} catch (UnsupportedOperationException uoe) {
}
}
Object newProxy = id.activate(force);
if (!Proxy.isProxyClass(newProxy.getClass())) {
throw new ActivateFailedException("invalid proxy");
}
InvocationHandler obj = Proxy.getInvocationHandler(newProxy);
if (!(obj instanceof ActivatableInvocationHandler)) {
throw new ActivateFailedException("invalid proxy handler");
}
ActivatableInvocationHandler handler =
(ActivatableInvocationHandler) obj;
if (!id.equals(handler.id)) {
throw new ActivateFailedException("unexpected activation id");
}
Remote newUproxy = handler.uproxy;
if (newUproxy == null) {
throw new ActivateFailedException("null underlying proxy");
} else if (newUproxy instanceof RemoteMethodControl) {
newUproxy = (Remote) ((RemoteMethodControl) newUproxy).
setConstraints(clientConstraints);
}
uproxy = newUproxy;
} catch (ConnectException e) {
throw new ConnectException("activation failed", e);
} catch (RemoteException e) {
throw new ConnectIOException("activation failed", e);
} catch (UnknownObjectException e) {
throw new NoSuchObjectException("object not registered");
} catch (ActivationException e) {
throw new ActivateFailedException("activation failed", e);
}
}