diff options
author | Mark Spruiell <mes@zeroc.com> | 2002-02-05 19:26:24 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2002-02-05 19:26:24 +0000 |
commit | 1d24a86babc8a1088cca49d9e7d500738e98dc96 (patch) | |
tree | abd546607884656f3c5a72c00f6fe1b8ab9760b2 /java/src/Ice/Object.java | |
parent | removing XsdVisitor dependency (diff) | |
download | ice-1d24a86babc8a1088cca49d9e7d500738e98dc96.tar.bz2 ice-1d24a86babc8a1088cca49d9e7d500738e98dc96.tar.xz ice-1d24a86babc8a1088cca49d9e7d500738e98dc96.zip |
porting against C++ tag icej_baseline_02012002
Diffstat (limited to 'java/src/Ice/Object.java')
-rw-r--r-- | java/src/Ice/Object.java | 139 |
1 files changed, 135 insertions, 4 deletions
diff --git a/java/src/Ice/Object.java b/java/src/Ice/Object.java index 34af1efcc57..d02442f8fd3 100644 --- a/java/src/Ice/Object.java +++ b/java/src/Ice/Object.java @@ -78,8 +78,69 @@ public class Object return IceInternal.DispatchStatus.DispatchOK; } + public String[] + ice_ids(Current current) + { + // + // Note in general this must be __ids, not __classIds since + // __classIds is only classes and not interfaces. + // + return __classIds; + } + + public static IceInternal.DispatchStatus + ___ice_ids(Ice.Object __obj, IceInternal.Incoming __in, Current __current) + { + IceInternal.BasicStream __os = __in.os(); + String[] __ret = __obj.ice_ids(__current); + __os.writeStringSeq(__ret); + return IceInternal.DispatchStatus.DispatchOK; + } + + public String + ice_id(Current current) + { + return __classIds[0]; + } + + public static IceInternal.DispatchStatus + ___ice_id(Ice.Object __obj, IceInternal.Incoming __in, Current __current) + { + IceInternal.BasicStream __os = __in.os(); + String __ret = __obj.ice_id(__current); + __os.writeString(__ret); + return IceInternal.DispatchStatus.DispatchOK; + } + + public final String[] + ice_facets(Current current) + { + java.util.Set keySet = _activeFacetMap.keySet(); + String[] v = new String[keySet.size()]; + keySet.toArray(v); + return v; + } + + public static IceInternal.DispatchStatus + ___ice_facets(Ice.Object __obj, IceInternal.Incoming __in, Current __current) + { + IceInternal.BasicStream __os = __in.os(); + String[] __ret = __obj.ice_facets(__current); + __os.writeStringSeq(__ret); + return IceInternal.DispatchStatus.DispatchOK; + } + + public static String + ice_staticId() + { + return __classIds[0]; + } + private static String[] __all = { + "ice_facets", + "ice_id", + "ice_ids", "ice_isA", "ice_ping" }; @@ -97,10 +158,22 @@ public class Object { case 0: { - return ___ice_isA(this, in, current); + return ___ice_facets(this, in, current); } case 1: { + return ___ice_id(this, in, current); + } + case 2: + { + return ___ice_ids(this, in, current); + } + case 3: + { + return ___ice_isA(this, in, current); + } + case 4: + { return ___ice_ping(this, in, current); } } @@ -137,17 +210,75 @@ public class Object _activeFacetMap.clear(); - Ice.ObjectHolder h = new Ice.ObjectHolder(); while (sz-- > 0) { String key = __is.readString(); - __is.readObject("", h); - _activeFacetMap.put(key, h.value); + Object value = __is.readObject("", null); + _activeFacetMap.put(key, value); + } + } + } + + public void + __marshal(Ice.Stream __os) + { + synchronized(_activeFacetMapMutex) + { + final int sz = _activeFacetMap.size(); + + __os.startWriteDictionary("ice:facets", sz); + java.util.Set set = _activeFacetMap.keySet(); + String[] keys = new String[sz]; + set.toArray(keys); + for (int i = 0; i < sz; i++) + { + __os.startWriteDictionaryElement(); + __os.writeString("key", keys[i]); + __os.writeObject("value", (Object)_activeFacetMap.get(keys[i])); + __os.endWriteDictionaryElement(); + } + __os.endWriteDictionary(); + } + } + + public void + __unmarshal(Ice.Stream __is) + { + synchronized(_activeFacetMapMutex) + { + final String facetsName = "ice:facets"; + final String keyName = "key"; + final String valueName = "value"; + + int sz = __is.startReadDictionary(facetsName); + + _activeFacetMap.clear(); + + while (sz-- > 0) + { + __is.startReadDictionaryElement(); + String key = __is.readString(keyName); + Object value = __is.readObject(valueName, "", null); + _activeFacetMap.put(key, value); + __is.endReadDictionaryElement(); } + __is.endReadDictionary(); } } public final void + ice_marshal(String name, Ice.Stream stream) + { + stream.writeObject(name, this); + } + + public static Object + ice_unmarshal(String name, Ice.Stream stream) + { + return stream.readObject(name, "", null); + } + + public final void ice_addFacet(Object facet, String name) { synchronized(_activeFacetMapMutex) |