* ActivationID.activate() methiod. After that the remote call is delegated to the ref, by means of calling its 'invoke' method.
*/
public Object invoke(Remote obj, Method method, Object[] params, long opnum)
throws Exception {
Exception signal_exception = null;
RemoteRef rref;
// rmi.log.106=$$$$$$$$$ ActivatableRef.invoke:
rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.106")+obj+", "+method+";"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
if(ref == null) {
// rmi.log.107=ref == null
rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.107")); //$NON-NLS-1$
RemoteStub stub = (RemoteStub)id.activate(false); //ToDo Check whether it returns Remote or RemoteStub
// rmi.log.3C=Stub = {0}
rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.3C", stub)); //$NON-NLS-1$
ActivatableRef aref = (ActivatableRef)stub.getRef();
// rmi.log.108=aref = {0}
rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.108", aref)); //$NON-NLS-1$
ref = aref.ref; // Global variable stored for next calls
rref = aref.ref; // local variable
} else {
rref = ref;
}
/*
* If the group's VM was killed(or something bad happened to it) we may have stale activatable reference to the object.
* In this case rref.invoke() will throw 3 types of Exceptions: ConnectException, ConnectIOException and UnknownObjectException
* which should be catched and activation group should be activated again.
*/
try {
return rref.invoke(obj, method, params, opnum);
}
catch(ConnectException ce) {
}
catch(ConnectIOException cioe) {
}
catch(UnknownObjectException uoe) {
}
catch(Exception t) {
signal_exception = t;
}
// rmi.log.109=signal_exception = {0}
rlog.log(RMILog.VERBOSE, Messages.getString("rmi.log.109", signal_exception)); //$NON-NLS-1$
if (signal_exception == null) {
RemoteStub stub = (RemoteStub)id.activate(true);
ActivatableRef aref = (ActivatableRef) stub.getRef();
ref = aref.ref;
rref = aref.ref;
return rref.invoke(obj, method, params, opnum);
}
else {
throw signal_exception;
}
}