Search in sources :

Example 1 with PostInitLoader

use of com.arjuna.orbportability.internal.utils.PostInitLoader in project narayana by jbosstm.

the class ORB method initORB.

/**
 * Initialise the ORB.
 */
public synchronized void initORB(Applet a, Properties p) throws SystemException {
    if (opLogger.logger.isTraceEnabled()) {
        opLogger.logger.trace("ORB::initORB (Applet, Properties)");
    }
    if (!_orb.initialised()) {
        loadProperties(p);
        /**
         * Perform pre-initialisation classes for all ORBs
         */
        PreInitLoader preInit = new PreInitLoader(PreInitLoader.generateORBPropertyName(ORB_INITIALISER_NS), this);
        /**
         * Perform pre-initialisation classes for this ORB only
         */
        preInit = new PreInitLoader(PreInitLoader.generateORBPropertyName(ORB_INITIALISER_NS, _orbName), this);
        preInit = null;
        parseProperties(null, false);
        _orb.init(a, p);
        parseProperties(null, true);
        /**
         * Perform post-initialisation classes for all ORBs
         */
        PostInitLoader postInit = new PostInitLoader(PostInitLoader.generateORBPropertyName(ORB_INITIALISER_NS), this);
        /**
         * Perform post-initialisation classes for this ORB only
         */
        postInit = new PostInitLoader(PostInitLoader.generateORBPropertyName(ORB_INITIALISER_NS, _orbName), this);
        postInit = null;
    }
}
Also used : PostInitLoader(com.arjuna.orbportability.internal.utils.PostInitLoader) PreInitLoader(com.arjuna.orbportability.internal.utils.PreInitLoader)

Example 2 with PostInitLoader

use of com.arjuna.orbportability.internal.utils.PostInitLoader in project narayana by jbosstm.

the class ORB method initORB.

/**
 * Initialise the ORB.
 */
public synchronized void initORB(String[] s, Properties p) throws SystemException {
    if (opLogger.logger.isTraceEnabled()) {
        opLogger.logger.trace("ORB::initORB (String[], Properties)");
    }
    if (!_orb.initialised()) {
        loadProperties(p);
        /**
         * Perform pre-initialisation classes for all ORBs
         */
        PreInitLoader preInit = new PreInitLoader(PreInitLoader.generateORBPropertyName(ORB_INITIALISER_NS), this);
        /**
         * Perform pre-initialisation classes for this ORB only
         */
        preInit = new PreInitLoader(PreInitLoader.generateORBPropertyName(ORB_INITIALISER_NS, _orbName), this);
        preInit = null;
        parseProperties(s, false);
        _orb.init(s, p);
        parseProperties(s, true);
        /**
         * Perform post-initialisation classes for all ORBs
         */
        PostInitLoader postInit = new PostInitLoader(PostInitLoader.generateORBPropertyName(ORB_INITIALISER_NS), this);
        /**
         * Perform post-initialisation classes for this ORB only
         */
        postInit = new PostInitLoader(PostInitLoader.generateORBPropertyName(ORB_INITIALISER_NS, _orbName), this);
        postInit = null;
    }
}
Also used : PostInitLoader(com.arjuna.orbportability.internal.utils.PostInitLoader) PreInitLoader(com.arjuna.orbportability.internal.utils.PreInitLoader)

Example 3 with PostInitLoader

use of com.arjuna.orbportability.internal.utils.PostInitLoader in project narayana by jbosstm.

the class ORB method initORB.

/**
 * Initialise the default ORB.
 */
public synchronized void initORB() throws SystemException {
    if (opLogger.logger.isTraceEnabled()) {
        opLogger.logger.trace("ORB::initORB ()");
    }
    if (!_orb.initialised()) {
        // null op - just skip it loadProperties(null);
        /**
         * Perform pre-initialisation classes for all ORBs
         */
        PreInitLoader preInit = new PreInitLoader(PreInitLoader.generateORBPropertyName(ORB_INITIALISER_NS), this);
        /**
         * Perform pre-initialisation classes for this ORB only
         */
        preInit = new PreInitLoader(PreInitLoader.generateORBPropertyName(ORB_INITIALISER_NS, _orbName), this);
        preInit = null;
        parseProperties(null, false);
        _orb.init();
        parseProperties(null, true);
        /**
         * Perform post-initialisation classes for all ORBs
         */
        PostInitLoader postInit = new PostInitLoader(PostInitLoader.generateORBPropertyName(ORB_INITIALISER_NS), this);
        /**
         * Perform post-initialisation classes for this ORB only
         */
        postInit = new PostInitLoader(PostInitLoader.generateORBPropertyName(ORB_INITIALISER_NS, _orbName), this);
        postInit = null;
    }
}
Also used : PostInitLoader(com.arjuna.orbportability.internal.utils.PostInitLoader) PreInitLoader(com.arjuna.orbportability.internal.utils.PreInitLoader)

Example 4 with PostInitLoader

use of com.arjuna.orbportability.internal.utils.PostInitLoader in project narayana by jbosstm.

the class OA method performPostInit.

/**
 * Loads and runs the configured post-initialisation classes
 */
protected void performPostInit(String oaName) {
    /**
     * Perform post-initialisation classes for all OAs
     */
    PostInitLoader postInit = new PostInitLoader(PostInitLoader.generateOAPropertyName(ORB.ORB_INITIALISER_NS), this);
    /**
     * Perform post-initialisation classes for all OAs
     */
    postInit = new PostInitLoader(PostInitLoader.generateOAPropertyName(ORB.ORB_INITIALISER_NS, _associatedORB.getName()), this);
    /**
     * Perform post-initialisation classes for this OA only
     */
    postInit = new PostInitLoader(PostInitLoader.generateOAPropertyName(ORB.ORB_INITIALISER_NS, _associatedORB.getName(), oaName), this);
    postInit = null;
}
Also used : PostInitLoader(com.arjuna.orbportability.internal.utils.PostInitLoader)

Example 5 with PostInitLoader

use of com.arjuna.orbportability.internal.utils.PostInitLoader in project wildfly by wildfly.

the class ArjunaRecoveryManagerService method start.

public synchronized void start(StartContext context) throws StartException {
    // Recovery env bean
    final RecoveryEnvironmentBean recoveryEnvironmentBean = recoveryPropertyManager.getRecoveryEnvironmentBean();
    final SocketBinding recoveryBinding = recoveryBindingInjector.getValue();
    recoveryEnvironmentBean.setRecoveryInetAddress(recoveryBinding.getSocketAddress().getAddress());
    recoveryEnvironmentBean.setRecoveryPort(recoveryBinding.getSocketAddress().getPort());
    final SocketBinding statusBinding = statusBindingInjector.getValue();
    recoveryEnvironmentBean.setTransactionStatusManagerInetAddress(statusBinding.getSocketAddress().getAddress());
    recoveryEnvironmentBean.setTransactionStatusManagerPort(statusBinding.getSocketAddress().getPort());
    recoveryEnvironmentBean.setRecoveryListener(recoveryListener);
    if (recoveryListener) {
        ManagedBinding binding = ManagedBinding.Factory.createSimpleManagedBinding(recoveryBinding);
        bindingManager.getValue().getNamedRegistry().registerBinding(binding);
    }
    final List<String> recoveryExtensions = new ArrayList<String>();
    // must be first
    recoveryExtensions.add(CommitMarkableResourceRecordRecoveryModule.class.getName());
    recoveryExtensions.add(AtomicActionRecoveryModule.class.getName());
    recoveryExtensions.add(TORecoveryModule.class.getName());
    recoveryExtensions.add(SubordinateAtomicActionRecoveryModule.class.getName());
    final List<String> expiryScanners;
    if (System.getProperty("RecoveryEnvironmentBean.expiryScannerClassNames") != null || System.getProperty("com.arjuna.ats.arjuna.common.RecoveryEnvironmentBean.expiryScannerClassNames") != null) {
        expiryScanners = recoveryEnvironmentBean.getExpiryScannerClassNames();
    } else {
        expiryScanners = new ArrayList<String>();
        expiryScanners.add(ExpiredTransactionStatusManagerScanner.class.getName());
    }
    if (!jts) {
        recoveryExtensions.add(com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.class.getName());
        recoveryEnvironmentBean.setRecoveryModuleClassNames(recoveryExtensions);
        recoveryEnvironmentBean.setExpiryScannerClassNames(expiryScanners);
        recoveryEnvironmentBean.setRecoveryActivators(null);
        final RecoveryManagerService recoveryManagerService = new RecoveryManagerService();
        try {
            recoveryManagerService.create();
        } catch (Exception e) {
            throw TransactionLogger.ROOT_LOGGER.managerStartFailure(e, "Recovery");
        }
        recoveryManagerService.start();
        this.recoveryManagerService = recoveryManagerService;
    } else {
        final ORB orb = orbInjector.getValue();
        new PostInitLoader(PostInitLoader.generateORBPropertyName("com.arjuna.orbportability.orb"), orb);
        recoveryExtensions.add(TopLevelTransactionRecoveryModule.class.getName());
        recoveryExtensions.add(ServerTransactionRecoveryModule.class.getName());
        recoveryExtensions.add(JCAServerTransactionRecoveryModule.class.getName());
        recoveryExtensions.add(com.arjuna.ats.internal.jta.recovery.jts.XARecoveryModule.class.getName());
        expiryScanners.add(ExpiredContactScanner.class.getName());
        expiryScanners.add(ExpiredToplevelScanner.class.getName());
        expiryScanners.add(ExpiredServerScanner.class.getName());
        recoveryEnvironmentBean.setRecoveryModuleClassNames(recoveryExtensions);
        recoveryEnvironmentBean.setExpiryScannerClassNames(expiryScanners);
        recoveryEnvironmentBean.setRecoveryActivatorClassNames(Collections.singletonList(com.arjuna.ats.internal.jts.orbspecific.recovery.RecoveryEnablement.class.getName()));
        try {
            final RecoveryManagerService recoveryManagerService = new com.arjuna.ats.jbossatx.jts.RecoveryManagerService(orb);
            recoveryManagerService.create();
            recoveryManagerService.start();
            this.recoveryManagerService = recoveryManagerService;
        } catch (Exception e) {
            throw TransactionLogger.ROOT_LOGGER.managerStartFailure(e, "Recovery");
        }
    }
    recoverySuspendController = new RecoverySuspendController(recoveryManagerService);
    processStateInjector.getValue().addPropertyChangeListener(recoverySuspendController);
    suspendControllerInjector.getValue().registerActivity(recoverySuspendController);
}
Also used : SocketBinding(org.jboss.as.network.SocketBinding) ExpiredContactScanner(com.arjuna.ats.internal.jts.recovery.contact.ExpiredContactScanner) SubordinateAtomicActionRecoveryModule(com.arjuna.ats.internal.jta.recovery.arjunacore.SubordinateAtomicActionRecoveryModule) AtomicActionRecoveryModule(com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule) ExpiredTransactionStatusManagerScanner(com.arjuna.ats.internal.arjuna.recovery.ExpiredTransactionStatusManagerScanner) ArrayList(java.util.ArrayList) TopLevelTransactionRecoveryModule(com.arjuna.ats.internal.jts.recovery.transactions.TopLevelTransactionRecoveryModule) ManagedBinding(org.jboss.as.network.ManagedBinding) CommitMarkableResourceRecordRecoveryModule(com.arjuna.ats.internal.jta.recovery.arjunacore.CommitMarkableResourceRecordRecoveryModule) RecoveryManagerService(com.arjuna.ats.jbossatx.jta.RecoveryManagerService) PostInitLoader(com.arjuna.orbportability.internal.utils.PostInitLoader) StartException(org.jboss.msc.service.StartException) ExpiredToplevelScanner(com.arjuna.ats.internal.jts.recovery.transactions.ExpiredToplevelScanner) TORecoveryModule(com.arjuna.ats.internal.txoj.recovery.TORecoveryModule) RecoveryEnvironmentBean(com.arjuna.ats.arjuna.common.RecoveryEnvironmentBean) RecoverySuspendController(org.jboss.as.txn.suspend.RecoverySuspendController) SubordinateAtomicActionRecoveryModule(com.arjuna.ats.internal.jta.recovery.arjunacore.SubordinateAtomicActionRecoveryModule) JCAServerTransactionRecoveryModule(com.arjuna.ats.internal.jta.recovery.jts.JCAServerTransactionRecoveryModule) ServerTransactionRecoveryModule(com.arjuna.ats.internal.jts.recovery.transactions.ServerTransactionRecoveryModule) JCAServerTransactionRecoveryModule(com.arjuna.ats.internal.jta.recovery.jts.JCAServerTransactionRecoveryModule) ExpiredServerScanner(com.arjuna.ats.internal.jts.recovery.transactions.ExpiredServerScanner) ORB(org.omg.CORBA.ORB)

Aggregations

PostInitLoader (com.arjuna.orbportability.internal.utils.PostInitLoader)6 PreInitLoader (com.arjuna.orbportability.internal.utils.PreInitLoader)3 StartException (org.jboss.msc.service.StartException)2 ORB (org.omg.CORBA.ORB)2 CoordinatorEnvironmentBean (com.arjuna.ats.arjuna.common.CoordinatorEnvironmentBean)1 RecoveryEnvironmentBean (com.arjuna.ats.arjuna.common.RecoveryEnvironmentBean)1 ObjStoreBrowser (com.arjuna.ats.arjuna.tools.osb.mbean.ObjStoreBrowser)1 AtomicActionRecoveryModule (com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule)1 ExpiredTransactionStatusManagerScanner (com.arjuna.ats.internal.arjuna.recovery.ExpiredTransactionStatusManagerScanner)1 CommitMarkableResourceRecordRecoveryModule (com.arjuna.ats.internal.jta.recovery.arjunacore.CommitMarkableResourceRecordRecoveryModule)1 SubordinateAtomicActionRecoveryModule (com.arjuna.ats.internal.jta.recovery.arjunacore.SubordinateAtomicActionRecoveryModule)1 JCAServerTransactionRecoveryModule (com.arjuna.ats.internal.jta.recovery.jts.JCAServerTransactionRecoveryModule)1 ExpiredContactScanner (com.arjuna.ats.internal.jts.recovery.contact.ExpiredContactScanner)1 ExpiredServerScanner (com.arjuna.ats.internal.jts.recovery.transactions.ExpiredServerScanner)1 ExpiredToplevelScanner (com.arjuna.ats.internal.jts.recovery.transactions.ExpiredToplevelScanner)1 ServerTransactionRecoveryModule (com.arjuna.ats.internal.jts.recovery.transactions.ServerTransactionRecoveryModule)1 TopLevelTransactionRecoveryModule (com.arjuna.ats.internal.jts.recovery.transactions.TopLevelTransactionRecoveryModule)1 TORecoveryModule (com.arjuna.ats.internal.txoj.recovery.TORecoveryModule)1 RecoveryManagerService (com.arjuna.ats.jbossatx.jta.RecoveryManagerService)1 Field (java.lang.reflect.Field)1