|
|
|
|||||
|
Can deactivated object adapter really be reactivated ?
In page 733 of Ice 3.1.0 manul:
Code:
... Once an adapter has been deactivated, you can reactivate it again. Any attempt to use a deactivated object adapter results in an ObjectAdapterDeactivatedException. ... Code:
public class Server {
public static void main(String[] args) {
int status = 0;
Ice.Communicator ic = null;
try {
ic = Ice.Util.initialize(args);
Ice.ObjectAdapter adapter = ic.createObjectAdapterWithEndpoints(
"SimplePrinterAdapter", "default -p 10000");
Ice.Object object = new PrinterI();
adapter.add(object, ic.stringToIdentity("SimplePrinter"));
System.out.println("1....");
adapter.activate();
System.out.println("2....");
adapter.deactivate();
System.out.println("3....");
adapter.activate();
//adapter.hold(); //error
System.out.println("4....");
ic.waitForShutdown();
} catch (Ice.LocalException e) {
e.printStackTrace();
status = 1;
} catch (Exception e) {
System.err.println(e.getMessage());
status = 1;
}
if (ic != null) {
// Clean up
//
try {
ic.destroy();
} catch (Exception e) {
System.err.println(e.getMessage());
status = 1;
}
}
System.exit(status);
}
}
Code:
D:\>java Server
1....
2....
3....
Ice.ObjectAdapterDeactivatedException
name = "SimplePrinterAdapter"
at Ice.ObjectAdapterI.checkForDeactivation(ObjectAdapterI.java:946)
at Ice.ObjectAdapterI.activate(ObjectAdapterI.java:40)
at Server.main(Server.java:25)
|
|
|||||
|
In my option, since ObjectAdapter has three states: hold, active, inactive, it is better that we don't allow an deactivated ObjectAdapter to be reactivated.
|
|
|||||
|
Thank you, I see.
|
|
|||||
|
Another:
Page 733, Line 22 ~ 24:
Code:
You can reactivate an inactive adapter by calling activate on it, but only once waitForDeactivate has returned. Page 734, Line 6 ~ 7: Code:
Once an adapter is in the inactive state, it can be reactivated again, but only once waitForDeactivate has returned. Calling hold, waitForHold, or deactivate on an adapter that is in the inactive state has no effect. Last edited by rc_hz : 08-23-2006 at 11:32 AM. |
|
||||||
|
Object adapters cannot be reactivated. You can recreate an object adapter with the same name (after waitForDeactivate() returns), but you cannot reactivate an existing object adapter. Sorry for the confusion, and we will fix the manual.
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to tell (in C++) when an adapter is deactivated | mefoster | Help Center | 8 | 10-06-2006 10:24 AM |
| Replicated Object Adapter | vsonnathi | Help Center | 3 | 04-13-2005 04:30 PM |
| Adding an Object to Adapter | Jennie | Help Center | 3 | 11-02-2004 05:15 PM |
| Proxy reconnection to reactivated adapter | brian | Help Center | 4 | 01-21-2004 06:49 PM |
| how to get an object adapter from the communicator | paulling | Help Center | 1 | 11-26-2003 01:29 AM |