summaryrefslogtreecommitdiff
path: root/java/demo/Ice/async/Server.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/demo/Ice/async/Server.java')
-rw-r--r--java/demo/Ice/async/Server.java24
1 files changed, 23 insertions, 1 deletions
diff --git a/java/demo/Ice/async/Server.java b/java/demo/Ice/async/Server.java
index 4434f3b59a5..ffca3c49247 100644
--- a/java/demo/Ice/async/Server.java
+++ b/java/demo/Ice/async/Server.java
@@ -28,7 +28,29 @@ public class Server extends Ice.Application
Ice.ObjectAdapter adapter = communicator().createObjectAdapter("Hello");
_workQueue = new WorkQueue();
- adapter.add(new HelloI(_workQueue), communicator().stringToIdentity("hello"));
+
+ final HelloI helloServant = new HelloI(_workQueue);
+
+ Ice.ServantLocator servantLocator = new Ice.ServantLocator()
+ {
+ public Ice.Object locate(Ice.Current curr, Ice.LocalObjectHolder cookie)
+ {
+ return helloServant;
+ }
+
+ public void finished(Ice.Current curr, Ice.Object servant, Ice.LocalObject cookie)
+ {
+ // nothin
+ }
+
+ public void deactivate(String category)
+ {
+ System.err.println("deactivating servant locator");
+ }
+ };
+
+
+ adapter.addServantLocator(servantLocator, "");
_workQueue.start();
adapter.activate();