From ce57ab760f69de6db452def7ffbf5b114a2d8694 Mon Sep 17 00:00:00 2001 From: mark Date: Fri, 10 Mar 2006 21:46:48 +0000 Subject: Imported GNU Classpath 0.90 * scripts/makemake.tcl: Set gnu/java/awt/peer/swing to ignore. * gnu/classpath/jdwp/VMFrame.java (SIZE): New constant. * java/lang/VMCompiler.java: Use gnu.java.security.hash.MD5. * java/lang/Math.java: New override file. * java/lang/Character.java: Merged from Classpath. (start, end): Now 'int's. (canonicalName): New field. (CANONICAL_NAME, NO_SPACES_NAME, CONSTANT_NAME): New constants. (UnicodeBlock): Added argument. (of): New overload. (forName): New method. Updated unicode blocks. (sets): Updated. * sources.am: Regenerated. * Makefile.in: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111942 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/classpath/gnu/CORBA/IOR.java | 54 ++++++++++++++++++++++ .../gnu/CORBA/NamingService/NamingMap.java | 13 ++++-- .../NamingService/NamingServiceTransient.java | 2 +- .../gnu/CORBA/NamingService/TransientContext.java | 35 ++++++++++++-- 4 files changed, 93 insertions(+), 11 deletions(-) (limited to 'libjava/classpath/gnu/CORBA') diff --git a/libjava/classpath/gnu/CORBA/IOR.java b/libjava/classpath/gnu/CORBA/IOR.java index 5d6d3152f8f..917e1983289 100644 --- a/libjava/classpath/gnu/CORBA/IOR.java +++ b/libjava/classpath/gnu/CORBA/IOR.java @@ -140,6 +140,27 @@ public class IOR b.append(' '); return b.toString(); } + + /** + * Get a better formatted multiline string representation. + */ + public String toStringFormatted() + { + StringBuffer b = new StringBuffer(); + b.append("\n Native set " + name(native_set)); + if (conversion != null && conversion.length > 0) + { + b.append("\n Other supported sets:\n "); + for (int i = 0; i < conversion.length; i++) + { + b.append(name(conversion[i])); + b.append(' '); + } + } + b.append("\n"); + return b.toString(); + } + /** * Write into CDR stream. @@ -590,6 +611,39 @@ public class IOR return b.toString(); } + + /** + * Returns a multiline formatted human readable string representation of + * this IOR object. + */ + public String toStringFormatted() + { + StringBuffer b = new StringBuffer(); + b.append("\nObject Id:\n "); + b.append(Id); + b.append("\nObject is accessible at:\n "); + b.append(Internet); + + if (Big_Endian) + b.append("\n Big endian encoding"); + else + b.append("\n Little endian encoding."); + + b.append("\nObject Key\n "); + + for (int i = 0; i < key.length; i++) + { + b.append(Integer.toHexString(key[i] & 0xFF)); + } + + b.append("\nSupported code sets:"); + b.append("\n Wide:"); + b.append(Internet.CodeSets.wide.toStringFormatted()); + b.append(" Narrow:"); + b.append(Internet.CodeSets.wide.toStringFormatted()); + + return b.toString(); + } /** * Returs a stringified reference. diff --git a/libjava/classpath/gnu/CORBA/NamingService/NamingMap.java b/libjava/classpath/gnu/CORBA/NamingService/NamingMap.java index 95deb0096bd..f4e940ea907 100644 --- a/libjava/classpath/gnu/CORBA/NamingService/NamingMap.java +++ b/libjava/classpath/gnu/CORBA/NamingService/NamingMap.java @@ -58,11 +58,11 @@ public class NamingMap /** * The actual map. */ - private final TreeMap map; + protected final TreeMap map; /** * Creates an instance of the naming map, intialising the comparator - * to the {@link cmpNameComparator}. + * to the {@link NameComponentComparator}. */ public NamingMap() { @@ -70,7 +70,7 @@ public class NamingMap } /** - * Put the given CORBA object, specifying the given name as a key. + * Put the given GIOP object, specifying the given name as a key. * If the entry with the given name already exists, or if the given * object is already mapped under another name, the * {@link AlreadyBound} exception will be thrown. @@ -93,8 +93,11 @@ public class NamingMap else { if (containsValue(object)) - throw new AlreadyBound("Tha object has another name"); + throw new AlreadyBound("The object has another name"); } + + // There are no restrictions in binding the object. + rebind(name, object); } /** @@ -141,7 +144,7 @@ public class NamingMap } /** - * Put the given CORBA object, specifying the given name as a key. + * Put the given GIOP object, specifying the given name as a key. * Remove all pre - existing mappings for the given name and object. * * @param name the name. diff --git a/libjava/classpath/gnu/CORBA/NamingService/NamingServiceTransient.java b/libjava/classpath/gnu/CORBA/NamingService/NamingServiceTransient.java index bf72637d7d7..3669879f22a 100644 --- a/libjava/classpath/gnu/CORBA/NamingService/NamingServiceTransient.java +++ b/libjava/classpath/gnu/CORBA/NamingService/NamingServiceTransient.java @@ -136,7 +136,7 @@ public class NamingServiceTransient System.out.println("GNU Classpath transient naming service " + "started at " + iorr.Internet.host + ":" + iorr.Internet.port + " key 'NameService'.\n\n" - + "Copyright (C) 2005 Free Software Foundation\n" + + "Copyright (C) 2006 Free Software Foundation\n" + "This tool comes with ABSOLUTELY NO WARRANTY. " + "This is free software, and you are\nwelcome to " + "redistribute it under conditions, defined in " diff --git a/libjava/classpath/gnu/CORBA/NamingService/TransientContext.java b/libjava/classpath/gnu/CORBA/NamingService/TransientContext.java index 4b7c1938fde..c2d8275e001 100644 --- a/libjava/classpath/gnu/CORBA/NamingService/TransientContext.java +++ b/libjava/classpath/gnu/CORBA/NamingService/TransientContext.java @@ -59,7 +59,7 @@ import java.util.Map; /** * This class implements the transient naming service, defined by - * {@link NamingContex}. The 'transient' means that the service does + * {@link NamingContext}. The 'transient' means that the service does * not store its state into the persistent memory. If the service is * restarted, the named objects must be re-registered again. * @@ -71,15 +71,40 @@ public class TransientContext extends _NamingContextImplBase implements NamingContext, NamingContextOperations { + /** + * Use serial version UID for interoperability. + */ + private static final long serialVersionUID = 2; + /** * The already named contexts. */ - protected final NamingMap named_contexts = new NamingMap(); + protected final NamingMap named_contexts; /** * The already named objects. */ - protected final NamingMap named_objects = new NamingMap(); + protected final NamingMap named_objects; + + /** + * Create the naming conetxt with default (transient) naming maps. + */ + public TransientContext() + { + this(new NamingMap(), new NamingMap()); + } + + /** + * Create the naming conetxt with the two provided naming maps. + * + * @param context_map the map for contexts + * @param object_map the map for objectss + */ + public TransientContext(NamingMap context_map, NamingMap object_map) + { + named_contexts = context_map; + named_objects = object_map; + } /** * Gives the object a name, valid in this context. @@ -376,7 +401,7 @@ public class TransientContext /** * Create a binding. * - * @param entry the entry, defining the bound object. + * @param an_entry the entry, defining the bound object. * @param type the binding type. * @return the created binding. */ @@ -396,7 +421,7 @@ public class TransientContext * name, and pass the remainder (without the first node) * of the name for that context to resolve. * - * @param name the name to resolve. + * @param a_name the name to resolve. * * @return the resolved context */ -- cgit v1.2.3