Search in sources :

Example 11 with OffShoot

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;
}
Also used : OffShoot(alma.ACS.OffShoot) AcsJContainerServicesEx(alma.JavaContainerError.wrappers.AcsJContainerServicesEx)

Aggregations

OffShoot (alma.ACS.OffShoot)11 CBDescIn (alma.ACS.CBDescIn)2 CBstringSeq (alma.ACS.CBstringSeq)2 AcsJContainerServicesEx (alma.JavaContainerError.wrappers.AcsJContainerServicesEx)2 Method (java.lang.reflect.Method)2 CBdouble (alma.ACS.CBdouble)1 CBdoubleSeq (alma.ACS.CBdoubleSeq)1 CBlong (alma.ACS.CBlong)1 CBlongSeq (alma.ACS.CBlongSeq)1 CBstring (alma.ACS.CBstring)1 CBvoid (alma.ACS.CBvoid)1 RWdouble (alma.ACS.RWdouble)1 ComponentInvocationHandler (alma.acs.component.dynwrapper.ComponentInvocationHandler)1 AcsJException (alma.acs.exceptions.AcsJException)1 Lamp (alma.acsexmplLamp.Lamp)1 DALChangeListener (com.cosylab.CDB.DALChangeListener)1 DALChangeListenerPOA (com.cosylab.CDB.DALChangeListenerPOA)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Servant (org.omg.PortableServer.Servant)1