summaryrefslogtreecommitdiff
path: root/java/src/IceBox/Admin.java
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2007-09-27 11:37:26 -0400
committerBernard Normier <bernard@zeroc.com>2007-09-27 11:37:26 -0400
commit29aad94424e506d30ba89c18e3ce3d5fecc03dcc (patch)
tree9acda23df0d372428fe500ff55a02d07db382792 /java/src/IceBox/Admin.java
parentSquashed commit of the following: (diff)
downloadice-29aad94424e506d30ba89c18e3ce3d5fecc03dcc.tar.bz2
ice-29aad94424e506d30ba89c18e3ce3d5fecc03dcc.tar.xz
ice-29aad94424e506d30ba89c18e3ce3d5fecc03dcc.zip
iceboxadmin is now using IceBoxAdmin.ServiceManager.Proxy
Diffstat (limited to 'java/src/IceBox/Admin.java')
-rw-r--r--java/src/IceBox/Admin.java58
1 files changed, 34 insertions, 24 deletions
diff --git a/java/src/IceBox/Admin.java b/java/src/IceBox/Admin.java
index d83b4d1cc15..796b62a9aea 100644
--- a/java/src/IceBox/Admin.java
+++ b/java/src/IceBox/Admin.java
@@ -59,41 +59,51 @@ public final class Admin
return 0;
}
- Ice.Properties properties = communicator().getProperties();
+ Ice.ObjectPrx base = communicator().propertyToProxy("IceBoxAdmin.ServiceManager.Proxy");
- Ice.Identity managerIdentity = new Ice.Identity();
- managerIdentity.category = properties.getPropertyWithDefault("IceBox.InstanceName", "IceBox");
- managerIdentity.name = "ServiceManager";
-
- String managerProxy;
- if(properties.getProperty("Ice.Default.Locator").length() == 0)
+ if(base == null)
{
- String managerEndpoints = properties.getProperty("IceBox.ServiceManager.Endpoints");
- if(managerEndpoints.length() == 0)
+ //
+ // The old deprecated way to retrieve the service manager proxy
+ //
+
+ Ice.Properties properties = communicator().getProperties();
+
+ Ice.Identity managerIdentity = new Ice.Identity();
+ managerIdentity.category = properties.getPropertyWithDefault("IceBox.InstanceName", "IceBox");
+ managerIdentity.name = "ServiceManager";
+
+ String managerProxy;
+ if(properties.getProperty("Ice.Default.Locator").length() == 0)
{
- System.err.println(appName() + ": property `IceBox.ServiceManager.Endpoints' is not set");
- return 1;
+ String managerEndpoints = properties.getProperty("IceBox.ServiceManager.Endpoints");
+ if(managerEndpoints.length() == 0)
+ {
+ System.err.println(appName() + ": property `IceBoxAdmin.ServiceManager.Proxy' is not set");
+ return 1;
+ }
+
+ managerProxy = "\"" + communicator().identityToString(managerIdentity) + "\" :" + managerEndpoints;
}
-
- managerProxy = "\"" + communicator().identityToString(managerIdentity) + "\" :" + managerEndpoints;
- }
- else
- {
- String managerAdapterId = properties.getProperty("IceBox.ServiceManager.AdapterId");
- if(managerAdapterId.length() == 0)
+ else
{
- System.err.println(appName() + ": property `IceBox.ServiceManager.AdapterId' is not set");
- return 1;
+ String managerAdapterId = properties.getProperty("IceBox.ServiceManager.AdapterId");
+ if(managerAdapterId.length() == 0)
+ {
+ System.err.println(appName() + ": property `IceBoxAdmin.ServiceManager.Proxy' is not set");
+ return 1;
+ }
+
+ managerProxy = "\"" + communicator().identityToString(managerIdentity) + "\" @" + managerAdapterId;
}
-
- managerProxy = "\"" + communicator().identityToString(managerIdentity) + "\" @" + managerAdapterId;
+
+ base = communicator().stringToProxy(managerProxy);
}
- Ice.ObjectPrx base = communicator().stringToProxy(managerProxy);
IceBox.ServiceManagerPrx manager = IceBox.ServiceManagerPrxHelper.checkedCast(base);
if(manager == null)
{
- System.err.println(appName() + ": `" + managerProxy + "' is not running");
+ System.err.println(appName() + ": `" + base.toString() + "' is not an IceBox::ServiceManager");
return 1;
}