diff options
| author | Tom Tromey <tromey@gcc.gnu.org> | 2005-09-23 21:31:04 +0000 |
|---|---|---|
| committer | Tom Tromey <tromey@gcc.gnu.org> | 2005-09-23 21:31:04 +0000 |
| commit | 1ea63ef8be1cc54dd0de9d82c684713a1dcf1e06 (patch) | |
| tree | 3ca4b2e68dc14c3128b9c781d23f1d0b1f2bee49 /libjava/classpath/gnu/CORBA/Connected_objects.java | |
| parent | 9b044d19517541c95681d35a92dbc81e6e21d94f (diff) | |
Imported Classpath 0.18.
* sources.am, Makefile.in: Updated.
* Makefile.am (nat_source_files): Removed natProxy.cc.
* java/lang/reflect/natProxy.cc: Removed.
* gnu/classpath/jdwp/VMFrame.java,
gnu/classpath/jdwp/VMIdManager.java,
gnu/classpath/jdwp/VMVirtualMachine.java,
java/lang/reflect/VMProxy.java: New files.
2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com>
* scripts/makemake.tcl (verbose): Add gnu/java/awt/peer/qt to BC
list.
2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com>
* gnu/java/net/DefaultContentHandlerFactory.java (getContent):
Remove ClasspathToolkit references.
2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com>
* gnu/awt/xlib/XCanvasPeer.java: Add new peer methods.
* gnu/awt/xlib/XFramePeer.java: Likewise.
* gnu/awt/xlib/XGraphicsConfiguration.java: Likewise.
2005-09-23 Thomas Fitzsimmons <fitzsim@redhat.com>
* Makefile.am (libgcjawt_la_SOURCES): Remove jawt.c. Add
classpath/native/jawt/jawt.c.
* Makefile.in: Regenerate.
* jawt.c: Remove file.
* include/Makefile.am (tool_include__HEADERS): Remove jawt.h and
jawt_md.h. Add ../classpath/include/jawt.h and
../classpath/include/jawt_md.h.
* include/Makefile.in: Regenerate.
* include/jawt.h: Regenerate.
* include/jawt_md.h: Regenerate.
From-SVN: r104586
Diffstat (limited to 'libjava/classpath/gnu/CORBA/Connected_objects.java')
| -rw-r--r-- | libjava/classpath/gnu/CORBA/Connected_objects.java | 63 |
1 files changed, 44 insertions, 19 deletions
diff --git a/libjava/classpath/gnu/CORBA/Connected_objects.java b/libjava/classpath/gnu/CORBA/Connected_objects.java index 30d15e75c3a..b7eefb133a2 100644 --- a/libjava/classpath/gnu/CORBA/Connected_objects.java +++ b/libjava/classpath/gnu/CORBA/Connected_objects.java @@ -60,11 +60,14 @@ public class Connected_objects /** * Create an initialised instance. */ - cObject(org.omg.CORBA.Object _object, int _port, byte[] _key) + cObject(org.omg.CORBA.Object _object, int _port, byte[] _key, + java.lang.Object an_identity + ) { object = _object; port = _port; key = _key; + identity = an_identity; } /** @@ -82,6 +85,12 @@ public class Connected_objects */ public final byte[] key; + /** + * The shared serving identity (usually POA) or null if no such + * applicable. + */ + public final java.lang.Object identity; + public boolean equals(java.lang.Object other) { if (other instanceof cObject) @@ -118,17 +127,23 @@ public class Connected_objects */ public cObject getKey(org.omg.CORBA.Object stored_object) { - Map.Entry item; - Iterator iter = objects.entrySet().iterator(); - cObject ref; - - while (iter.hasNext()) + synchronized (objects) { - item = (Map.Entry) iter.next(); - ref = (cObject) item.getValue(); - if (stored_object.equals(ref.object)) - return ref; + Map.Entry item; + Iterator iter = objects.entrySet().iterator(); + cObject ref; + + while (iter.hasNext()) + { + item = (Map.Entry) iter.next(); + ref = (cObject) item.getValue(); + if (stored_object.equals(ref.object) || + stored_object._is_equivalent(ref.object) + ) + return ref; + } } + return null; } @@ -144,7 +159,7 @@ public class Connected_objects */ public cObject add(org.omg.CORBA.Object object, int port) { - return add(generateObjectKey(object), object, port); + return add(generateObjectKey(object), object, port, null); } /** @@ -155,10 +170,15 @@ public class Connected_objects * @param port the port, on that the ORB will be listening on the * remote invocations. */ - public cObject add(byte[] key, org.omg.CORBA.Object object, int port) + public cObject add(byte[] key, org.omg.CORBA.Object object, int port, + java.lang.Object identity + ) { - cObject rec = new cObject(object, port, key); - objects.put(key, rec); + cObject rec = new cObject(object, port, key, identity); + synchronized (objects) + { + objects.put(key, rec); + } return rec; } @@ -171,12 +191,14 @@ public class Connected_objects */ public cObject get(byte[] key) { - return (cObject) objects.get(key); + synchronized (objects) + { + return (cObject) objects.get(key); + } } /** * Get the map entry set. - * @return */ public Set entrySet() { @@ -190,9 +212,12 @@ public class Connected_objects */ public void remove(org.omg.CORBA.Object object) { - cObject ref = getKey(object); - if (ref != null) - objects.remove(ref.key); + synchronized (objects) + { + cObject ref = getKey(object); + if (ref != null) + objects.remove(ref.key); + } } /** |
