use of alma.ACS.OffShoot in project ACS by ACS-Community.
the class ManagerContainerServices method activateOffShoot.
/**
* @see alma.acs.container.ContainerServices#activateOffShoot(org.omg.PortableServer.Servant)
*/
public <T extends Servant & OffShootOperations> OffShoot activateOffShoot(T servant) throws AcsJContainerServicesEx {
checkOffShootServant(servant);
OffShoot shoot = null;
try {
checkOffShootPOA();
org.omg.CORBA.Object actObj = null;
offshootPoa.activate_object(servant);
actObj = offshootPoa.servant_to_reference(servant);
// just to provoke an exc. if something is wrong with our new object
actObj._hash(Integer.MAX_VALUE);
logger.finer("offshoot of type '" + servant.getClass().getName() + "' activated as a CORBA object.");
shoot = OffShootHelper.narrow(actObj);
} catch (Throwable thr) {
String msg = "failed to activate offshoot object of type '" + servant.getClass().getName() + "' for client '" + getName() + "'. ";
// flatten the exception chain by one level if possible
if (thr instanceof AcsJContainerServicesEx && thr.getCause() != null) {
msg += "(" + thr.getMessage() + ")";
thr = thr.getCause();
}
logger.log(Level.FINE, msg, thr);
AcsJContainerServicesEx ex = new AcsJContainerServicesEx(thr);
throw ex;
}
return shoot;
}
Aggregations