// ********************************************************************** // // Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. // // ********************************************************************** // Ice version 3.4.1 package Ice; // <auto-generated> // // Generated from file `Locator.ice' // // Warning: do not edit this file. // // </auto-generated> /** * The Ice locator interface. This interface is used by clients to * lookup adapters and objects. It is also used by servers to get the * locator registry proxy. * * <p class="Note">The {@link Locator} interface is intended to be used by * Ice internals and by locator implementations. Regular user code * should not attempt to use any functionality of this interface * directly. * **/ public final class LocatorPrxHelper extends Ice.ObjectPrxHelperBase implements LocatorPrx { /** * Find an adapter by id and return its proxy (a dummy direct * proxy created by the adapter). * * @param id The adapter id. * * @return The adapter proxy, or null if the adapter is not active. * * @throws AdapterNotFoundException Raised if the adapter cannot be * found. * **/ public Ice.ObjectPrx findAdapterById(String id) throws AdapterNotFoundException { return findAdapterById(id, null, false); } /** * Find an adapter by id and return its proxy (a dummy direct * proxy created by the adapter). * * @param id The adapter id. * * @param __ctx The Context map to send with the invocation. * @return The adapter proxy, or null if the adapter is not active. * * @throws AdapterNotFoundException Raised if the adapter cannot be * found. * **/ public Ice.ObjectPrx findAdapterById(String id, java.util.Map<String, String> __ctx) throws AdapterNotFoundException { return findAdapterById(id, __ctx, true); } private Ice.ObjectPrx findAdapterById(String id, java.util.Map<String, String> __ctx, boolean __explicitCtx) throws AdapterNotFoundException { if(__explicitCtx && __ctx == null) { __ctx = _emptyContext; } int __cnt = 0; while(true) { Ice._ObjectDel __delBase = null; try { __checkTwowayOnly("findAdapterById"); __delBase = __getDelegate(false); _LocatorDel __del = (_LocatorDel)__delBase; return __del.findAdapterById(id, __ctx); } catch(IceInternal.LocalExceptionWrapper __ex) { __cnt = __handleExceptionWrapperRelaxed(__delBase, __ex, null, __cnt); } catch(Ice.LocalException __ex) { __cnt = __handleException(__delBase, __ex, null, __cnt); } } } private static final String __findAdapterById_name = "findAdapterById"; /** * Find an adapter by id and return its proxy (a dummy direct * proxy created by the adapter). * * @param __cb The callback object for the operation. * @param id The adapter id. * **/ public Ice.AsyncResult begin_findAdapterById(String id) { return begin_findAdapterById(id, null, false, null); } /** * Find an adapter by id and return its proxy (a dummy direct * proxy created by the adapter). * * @param __cb The callback object for the operation. * @param id The adapter id. * * @param __ctx The Context map to send with the invocation. **/ public Ice.AsyncResult begin_findAdapterById(String id, java.util.Map<String, String> __ctx) { return begin_findAdapterById(id, __ctx, true, null); } /** * Find an adapter by id and return its proxy (a dummy direct * proxy created by the adapter). * * @param __cb The callback object for the operation. * @param id The adapter id. * **/ public Ice.AsyncResult begin_findAdapterById(String id, Ice.Callback __cb) { return begin_findAdapterById(id, null, false, __cb); } /** * Find an adapter by id and return its proxy (a dummy direct * proxy created by the adapter). * * @param __cb The callback object for the operation. * @param id The adapter id. * * @param __ctx The Context map to send with the invocation. **/ public Ice.AsyncResult begin_findAdapterById(String id, java.util.Map<String, String> __ctx, Ice.Callback __cb) { return begin_findAdapterById(id, __ctx, true, __cb); } /** * Find an adapter by id and return its proxy (a dummy direct * proxy created by the adapter). * * @param __cb The callback object for the operation. * @param id The adapter id. * **/ public Ice.AsyncResult begin_findAdapterById(String id, Callback_Locator_findAdapterById __cb) { return begin_findAdapterById(id, null, false, __cb); } /** * Find an adapter by id and return its proxy (a dummy direct * proxy created by the adapter). * * @param __cb The callback object for the operation. * @param id The adapter id. * * @param __ctx The Context map to send with the invocation. **/ public Ice.AsyncResult begin_findAdapterById(String id, java.util.Map<String, String> __ctx, Callback_Locator_findAdapterById __cb) { return begin_findAdapterById(id, __ctx, true, __cb); } private Ice.AsyncResult begin_findAdapterById(String id, java.util.Map<String, String> __ctx, boolean __explicitCtx, IceInternal.CallbackBase __cb) { __checkAsyncTwowayOnly(__findAdapterById_name); IceInternal.OutgoingAsync __result = new IceInternal.OutgoingAsync(this, __findAdapterById_name, __cb); try { __result.__prepare(__findAdapterById_name, Ice.OperationMode.Idempotent, __ctx, __explicitCtx); IceInternal.BasicStream __os = __result.__os(); __os.writeString(id); __os.endWriteEncaps(); __result.__send(true); } catch(Ice.LocalException __ex) { __result.__exceptionAsync(__ex); } return __result; } /** * ice_response indicates that * the operation completed successfully. * @param __ret (return value) The adapter proxy, or null if the adapter is not active. * **/ public Ice.ObjectPrx end_findAdapterById(Ice.AsyncResult __result) throws AdapterNotFoundException { Ice.AsyncResult.__check(__result, this, __findAdapterById_name); if(!__result.__wait()) { try { __result.__throwUserException(); } catch(AdapterNotFoundException __ex) { throw __ex; } catch(Ice.UserException __ex) { throw new Ice.UnknownUserException(__ex.ice_name()); } } Ice.ObjectPrx __ret; IceInternal.BasicStream __is = __result.__is(); __is.startReadEncaps(); __ret = __is.readProxy(); __is.endReadEncaps(); return __ret; } /** * Find an adapter by id and return its proxy (a dummy direct * proxy created by the adapter). * * @param __cb The callback object for the operation. * @param id The adapter id. * **/ public boolean findAdapterById_async(AMI_Locator_findAdapterById __cb, String id) { Ice.AsyncResult __r; try { __checkTwowayOnly(__findAdapterById_name); __r = begin_findAdapterById(id, null, false, __cb); } catch(Ice.TwowayOnlyException ex) { __r = new IceInternal.OutgoingAsync(this, __findAdapterById_name, __cb); __r.__exceptionAsync(ex); } return __r.sentSynchronously(); } /** * Find an adapter by id and return its proxy (a dummy direct * proxy created by the adapter). * * @param __cb The callback object for the operation. * @param id The adapter id. * * @param __ctx The Context map to send with the invocation. **/ public boolean findAdapterById_async(AMI_Locator_findAdapterById __cb, String id, java.util.Map<String, String> __ctx) { Ice.AsyncResult __r; try { __checkTwowayOnly(__findAdapterById_name); __r = begin_findAdapterById(id, __ctx, true, __cb); } catch(Ice.TwowayOnlyException ex) { __r = new IceInternal.OutgoingAsync(this, __findAdapterById_name, __cb); __r.__exceptionAsync(ex); } return __r.sentSynchronously(); } /** * Find an object by identity and return its proxy. * * @param id The identity. * * @return The proxy, or null if the object is not active. * * @throws ObjectNotFoundException Raised if the object cannot * be found. * **/ public Ice.ObjectPrx findObjectById(Identity id) throws ObjectNotFoundException { return findObjectById(id, null, false); } /** * Find an object by identity and return its proxy. * * @param id The identity. * * @param __ctx The Context map to send with the invocation. * @return The proxy, or null if the object is not active. * * @throws ObjectNotFoundException Raised if the object cannot * be found. * **/ public Ice.ObjectPrx findObjectById(Identity id, java.util.Map<String, String> __ctx) throws ObjectNotFoundException { return findObjectById(id, __ctx, true); } private Ice.ObjectPrx findObjectById(Identity id, java.util.Map<String, String> __ctx, boolean __explicitCtx) throws ObjectNotFoundException { if(__explicitCtx && __ctx == null) { __ctx = _emptyContext; } int __cnt = 0; while(true) { Ice._ObjectDel __delBase = null; try { __checkTwowayOnly("findObjectById"); __delBase = __getDelegate(false); _LocatorDel __del = (_LocatorDel)__delBase; return __del.findObjectById(id, __ctx); } catch(IceInternal.LocalExceptionWrapper __ex) { __cnt = __handleExceptionWrapperRelaxed(__delBase, __ex, null, __cnt); } catch(Ice.LocalException __ex) { __cnt = __handleException(__delBase, __ex, null, __cnt); } } } private static final String __findObjectById_name = "findObjectById"; /** * Find an object by identity and return its proxy. * * @param __cb The callback object for the operation. * @param id The identity. * **/ public Ice.AsyncResult begin_findObjectById(Identity id) { return begin_findObjectById(id, null, false, null); } /** * Find an object by identity and return its proxy. * * @param __cb The callback object for the operation. * @param id The identity. * * @param __ctx The Context map to send with the invocation. **/ public Ice.AsyncResult begin_findObjectById(Identity id, java.util.Map<String, String> __ctx) { return begin_findObjectById(id, __ctx, true, null); } /** * Find an object by identity and return its proxy. * * @param __cb The callback object for the operation. * @param id The identity. * **/ public Ice.AsyncResult begin_findObjectById(Identity id, Ice.Callback __cb) { return begin_findObjectById(id, null, false, __cb); } /** * Find an object by identity and return its proxy. * * @param __cb The callback object for the operation. * @param id The identity. * * @param __ctx The Context map to send with the invocation. **/ public Ice.AsyncResult begin_findObjectById(Identity id, java.util.Map<String, String> __ctx, Ice.Callback __cb) { return begin_findObjectById(id, __ctx, true, __cb); } /** * Find an object by identity and return its proxy. * * @param __cb The callback object for the operation. * @param id The identity. * **/ public Ice.AsyncResult begin_findObjectById(Identity id, Callback_Locator_findObjectById __cb) { return begin_findObjectById(id, null, false, __cb); } /** * Find an object by identity and return its proxy. * * @param __cb The callback object for the operation. * @param id The identity. * * @param __ctx The Context map to send with the invocation. **/ public Ice.AsyncResult begin_findObjectById(Identity id, java.util.Map<String, String> __ctx, Callback_Locator_findObjectById __cb) { return begin_findObjectById(id, __ctx, true, __cb); } private Ice.AsyncResult begin_findObjectById(Identity id, java.util.Map<String, String> __ctx, boolean __explicitCtx, IceInternal.CallbackBase __cb) { __checkAsyncTwowayOnly(__findObjectById_name); IceInternal.OutgoingAsync __result = new IceInternal.OutgoingAsync(this, __findObjectById_name, __cb); try { __result.__prepare(__findObjectById_name, Ice.OperationMode.Idempotent, __ctx, __explicitCtx); IceInternal.BasicStream __os = __result.__os(); id.__write(__os); __os.endWriteEncaps(); __result.__send(true); } catch(Ice.LocalException __ex) { __result.__exceptionAsync(__ex); } return __result; } /** * ice_response indicates that * the operation completed successfully. * @param __ret (return value) The proxy, or null if the object is not active. * **/ public Ice.ObjectPrx end_findObjectById(Ice.AsyncResult __result) throws ObjectNotFoundException { Ice.AsyncResult.__check(__result, this, __findObjectById_name); if(!__result.__wait()) { try { __result.__throwUserException(); } catch(ObjectNotFoundException __ex) { throw __ex; } catch(Ice.UserException __ex) { throw new Ice.UnknownUserException(__ex.ice_name()); } } Ice.ObjectPrx __ret; IceInternal.BasicStream __is = __result.__is(); __is.startReadEncaps(); __ret = __is.readProxy(); __is.endReadEncaps(); return __ret; } /** * Find an object by identity and return its proxy. * * @param __cb The callback object for the operation. * @param id The identity. * **/ public boolean findObjectById_async(AMI_Locator_findObjectById __cb, Identity id) { Ice.AsyncResult __r; try { __checkTwowayOnly(__findObjectById_name); __r = begin_findObjectById(id, null, false, __cb); } catch(Ice.TwowayOnlyException ex) { __r = new IceInternal.OutgoingAsync(this, __findObjectById_name, __cb); __r.__exceptionAsync(ex); } return __r.sentSynchronously(); } /** * Find an object by identity and return its proxy. * * @param __cb The callback object for the operation. * @param id The identity. * * @param __ctx The Context map to send with the invocation. **/ public boolean findObjectById_async(AMI_Locator_findObjectById __cb, Identity id, java.util.Map<String, String> __ctx) { Ice.AsyncResult __r; try { __checkTwowayOnly(__findObjectById_name); __r = begin_findObjectById(id, __ctx, true, __cb); } catch(Ice.TwowayOnlyException ex) { __r = new IceInternal.OutgoingAsync(this, __findObjectById_name, __cb); __r.__exceptionAsync(ex); } return __r.sentSynchronously(); } /** * Get the locator registry. * * @return The locator registry. * **/ public LocatorRegistryPrx getRegistry() { return getRegistry(null, false); } /** * Get the locator registry. * * @param __ctx The Context map to send with the invocation. * @return The locator registry. * **/ public LocatorRegistryPrx getRegistry(java.util.Map<String, String> __ctx) { return getRegistry(__ctx, true); } private LocatorRegistryPrx getRegistry(java.util.Map<String, String> __ctx, boolean __explicitCtx) { if(__explicitCtx && __ctx == null) { __ctx = _emptyContext; } int __cnt = 0; while(true) { Ice._ObjectDel __delBase = null; try { __checkTwowayOnly("getRegistry"); __delBase = __getDelegate(false); _LocatorDel __del = (_LocatorDel)__delBase; return __del.getRegistry(__ctx); } catch(IceInternal.LocalExceptionWrapper __ex) { __cnt = __handleExceptionWrapperRelaxed(__delBase, __ex, null, __cnt); } catch(Ice.LocalException __ex) { __cnt = __handleException(__delBase, __ex, null, __cnt); } } } private static final String __getRegistry_name = "getRegistry"; /** * Get the locator registry. * * @param __cb The callback object for the operation. **/ public Ice.AsyncResult begin_getRegistry() { return begin_getRegistry(null, false, null); } /** * Get the locator registry. * * @param __cb The callback object for the operation. * @param __ctx The Context map to send with the invocation. **/ public Ice.AsyncResult begin_getRegistry(java.util.Map<String, String> __ctx) { return begin_getRegistry(__ctx, true, null); } /** * Get the locator registry. * * @param __cb The callback object for the operation. **/ public Ice.AsyncResult begin_getRegistry(Ice.Callback __cb) { return begin_getRegistry(null, false, __cb); } /** * Get the locator registry. * * @param __cb The callback object for the operation. * @param __ctx The Context map to send with the invocation. **/ public Ice.AsyncResult begin_getRegistry(java.util.Map<String, String> __ctx, Ice.Callback __cb) { return begin_getRegistry(__ctx, true, __cb); } /** * Get the locator registry. * * @param __cb The callback object for the operation. **/ public Ice.AsyncResult begin_getRegistry(Callback_Locator_getRegistry __cb) { return begin_getRegistry(null, false, __cb); } /** * Get the locator registry. * * @param __cb The callback object for the operation. * @param __ctx The Context map to send with the invocation. **/ public Ice.AsyncResult begin_getRegistry(java.util.Map<String, String> __ctx, Callback_Locator_getRegistry __cb) { return begin_getRegistry(__ctx, true, __cb); } private Ice.AsyncResult begin_getRegistry(java.util.Map<String, String> __ctx, boolean __explicitCtx, IceInternal.CallbackBase __cb) { __checkAsyncTwowayOnly(__getRegistry_name); IceInternal.OutgoingAsync __result = new IceInternal.OutgoingAsync(this, __getRegistry_name, __cb); try { __result.__prepare(__getRegistry_name, Ice.OperationMode.Idempotent, __ctx, __explicitCtx); IceInternal.BasicStream __os = __result.__os(); __os.endWriteEncaps(); __result.__send(true); } catch(Ice.LocalException __ex) { __result.__exceptionAsync(__ex); } return __result; } /** * ice_response indicates that * the operation completed successfully. * @param __ret (return value) The locator registry. * **/ public LocatorRegistryPrx end_getRegistry(Ice.AsyncResult __result) { Ice.AsyncResult.__check(__result, this, __getRegistry_name); if(!__result.__wait()) { try { __result.__throwUserException(); } catch(Ice.UserException __ex) { throw new Ice.UnknownUserException(__ex.ice_name()); } } LocatorRegistryPrx __ret; IceInternal.BasicStream __is = __result.__is(); __is.startReadEncaps(); __ret = LocatorRegistryPrxHelper.__read(__is); __is.endReadEncaps(); return __ret; } public static LocatorPrx checkedCast(Ice.ObjectPrx __obj) { LocatorPrx __d = null; if(__obj != null) { try { __d = (LocatorPrx)__obj; } catch(ClassCastException ex) { if(__obj.ice_isA("::Ice::Locator")) { LocatorPrxHelper __h = new LocatorPrxHelper(); __h.__copyFrom(__obj); __d = __h; } } } return __d; } public static LocatorPrx checkedCast(Ice.ObjectPrx __obj, java.util.Map<String, String> __ctx) { LocatorPrx __d = null; if(__obj != null) { try { __d = (LocatorPrx)__obj; } catch(ClassCastException ex) { if(__obj.ice_isA("::Ice::Locator", __ctx)) { LocatorPrxHelper __h = new LocatorPrxHelper(); __h.__copyFrom(__obj); __d = __h; } } } return __d; } public static LocatorPrx checkedCast(Ice.ObjectPrx __obj, String __facet) { LocatorPrx __d = null; if(__obj != null) { Ice.ObjectPrx __bb = __obj.ice_facet(__facet); try { if(__bb.ice_isA("::Ice::Locator")) { LocatorPrxHelper __h = new LocatorPrxHelper(); __h.__copyFrom(__bb); __d = __h; } } catch(Ice.FacetNotExistException ex) { } } return __d; } public static LocatorPrx checkedCast(Ice.ObjectPrx __obj, String __facet, java.util.Map<String, String> __ctx) { LocatorPrx __d = null; if(__obj != null) { Ice.ObjectPrx __bb = __obj.ice_facet(__facet); try { if(__bb.ice_isA("::Ice::Locator", __ctx)) { LocatorPrxHelper __h = new LocatorPrxHelper(); __h.__copyFrom(__bb); __d = __h; } } catch(Ice.FacetNotExistException ex) { } } return __d; } public static LocatorPrx uncheckedCast(Ice.ObjectPrx __obj) { LocatorPrx __d = null; if(__obj != null) { try { __d = (LocatorPrx)__obj; } catch(ClassCastException ex) { LocatorPrxHelper __h = new LocatorPrxHelper(); __h.__copyFrom(__obj); __d = __h; } } return __d; } public static LocatorPrx uncheckedCast(Ice.ObjectPrx __obj, String __facet) { LocatorPrx __d = null; if(__obj != null) { Ice.ObjectPrx __bb = __obj.ice_facet(__facet); LocatorPrxHelper __h = new LocatorPrxHelper(); __h.__copyFrom(__bb); __d = __h; } return __d; } protected Ice._ObjectDelM __createDelegateM() { return new _LocatorDelM(); } protected Ice._ObjectDelD __createDelegateD() { return new _LocatorDelD(); } public static void __write(IceInternal.BasicStream __os, LocatorPrx v) { __os.writeProxy(v); } public static LocatorPrx __read(IceInternal.BasicStream __is) { Ice.ObjectPrx proxy = __is.readProxy(); if(proxy != null) { LocatorPrxHelper result = new LocatorPrxHelper(); result.__copyFrom(proxy); return result; } return null; } }