1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
|
// **********************************************************************
//
// Copyright (c) 2003-2009 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.
//
// **********************************************************************
public class ServerLocatorRegistry extends Test._TestLocatorRegistryDisp
{
public void
setAdapterDirectProxy_async(Ice.AMD_LocatorRegistry_setAdapterDirectProxy cb, String adapter,
Ice.ObjectPrx object, Ice.Current current)
{
if(object != null)
{
_adapters.put(adapter, object);
}
else
{
_adapters.remove(adapter);
}
cb.ice_response();
}
public void
setReplicatedAdapterDirectProxy_async(Ice.AMD_LocatorRegistry_setReplicatedAdapterDirectProxy cb, String adapter,
String replica, Ice.ObjectPrx object, Ice.Current current)
{
if(object != null)
{
_adapters.put(adapter, object);
_adapters.put(replica, object);
}
else
{
_adapters.remove(adapter);
_adapters.remove(replica);
}
cb.ice_response();
}
public void
setServerProcessProxy_async(Ice.AMD_LocatorRegistry_setServerProcessProxy cb, String id, Ice.ProcessPrx proxy,
Ice.Current current)
{
}
public void
addObject(Ice.ObjectPrx object, Ice.Current current)
{
_objects.put(object.ice_getIdentity(), object);
}
public Ice.ObjectPrx
getAdapter(String adapter)
throws Ice.AdapterNotFoundException
{
Ice.ObjectPrx obj = _adapters.get(adapter);
if(obj == null)
{
throw new Ice.AdapterNotFoundException();
}
return obj;
}
public Ice.ObjectPrx
getObject(Ice.Identity id)
throws Ice.ObjectNotFoundException
{
Ice.ObjectPrx obj = _objects.get(id);
if(obj == null)
{
throw new Ice.ObjectNotFoundException();
}
return obj;
}
private java.util.HashMap<String, Ice.ObjectPrx> _adapters = new java.util.HashMap<String, Ice.ObjectPrx>();
private java.util.HashMap<Ice.Identity, Ice.ObjectPrx> _objects =
new java.util.HashMap<Ice.Identity, Ice.ObjectPrx>();
}
|