_localInvoker = new RMIInvokerImpl();
_localInvoker.setConnection(this);
try {
UnicastRemoteObject.exportObject(_localInvoker);
} catch (RemoteException exception) {
throw new ResourceException("Failed to export invocation handler",
exception);
}
try {
_remoteInvoker = factory.createInvoker(principal, _localInvoker,
_localURI.toString());
} catch (AccessException exception) {
throw new SecurityException(exception.getMessage(), exception);
} catch (RemoteException exception) {
if (exception.detail instanceof AccessException) {
throw new SecurityException(exception.getMessage(),
exception.detail);
}
throw new ResourceException("Failed to create invocation handler",
exception);
}
_principal = principal;
}