Search in sources :

Example 1 with ROstringSeqPOATie

use of alma.ACS.ROstringSeqPOATie in project ACS by ACS-Community.

the class MasterComponentImplBase method initialize.

/******************* [ Lifecycle implementations ] *******************/
/**
	 * Master component subclasses must call <code>super.initialize()</code> if they override this method!
	 * @see alma.acs.component.ComponentLifecycle#initialize(alma.acs.container.ContainerServices)
	 */
public void initialize(ContainerServices containerServices) throws ComponentLifecycleException {
    super.initialize(containerServices);
    subsysComponentMonitor = new SubsysResourceMonitor(m_logger, containerServices.getThreadFactory(), 10);
    try {
        ROstringSeqImpl currentStateHierarchyImpl = new ROstringSeqImpl("currentStateHierarchy", this);
        m_currentStateHierarchyDataAccess = currentStateHierarchyImpl.getDataAccess();
        ROstringSeqPOATie currentStateHierarchyTie = new ROstringSeqPOATie(currentStateHierarchyImpl);
        m_currentStateHierarchy = ROstringSeqHelper.narrow(this.registerProperty(currentStateHierarchyImpl, currentStateHierarchyTie));
    } catch (Throwable th) {
        throw new ComponentLifecycleException("Failed to create ACS property for nested component states.", th);
    }
    AlmaSubsystemActions actionHandler = getActionHandler();
    if (actionHandler == null) {
        throw new ComponentLifecycleException("Action handler was null. Check implementation of method getActionHandler in concrete master component implementation class.");
    }
    m_stateMachine = new AlmaSubsystemContext(actionHandler, m_logger, m_containerServices.getThreadFactory());
    m_stateMachine.addAcsStateChangeListener(this);
    if (StateChangeNotificationChecker.monitorStateChangeNotification) {
        try {
            stateChangeNotificationChecker = new StateChangeNotificationChecker(m_logger);
            stateChangeNotificationChecker.createMonitor(m_currentStateHierarchy, m_containerServices);
            m_logger.info("Running in state change notification test mode: All externally visible state changes will be compared with the internally triggered changes.");
        } catch (Exception e) {
            m_logger.log(Level.WARNING, "Master component " + name() + " failed to monitor its state change notification although this was requested by the property '" + StateChangeNotificationChecker.PROPERTYNAME + "'.", e);
        }
    }
    try {
        updateStateHierarchy();
    } catch (AcsJException e) {
        throw new ComponentLifecycleException("failed to initialize state property", e);
    }
}
Also used : AlmaSubsystemActions(alma.ACS.MasterComponentImpl.statemachine.AlmaSubsystemActions) ROstringSeqImpl(alma.ACS.impl.ROstringSeqImpl) AcsJException(alma.acs.exceptions.AcsJException) ROstringSeqPOATie(alma.ACS.ROstringSeqPOATie) ComponentLifecycleException(alma.acs.component.ComponentLifecycleException) AlmaSubsystemContext(alma.ACS.MasterComponentImpl.statemachine.AlmaSubsystemContext) ComponentLifecycleException(alma.acs.component.ComponentLifecycleException) AcsJException(alma.acs.exceptions.AcsJException)

Example 2 with ROstringSeqPOATie

use of alma.ACS.ROstringSeqPOATie in project ACS by ACS-Community.

the class SimpleMasterComponentImpl method initialize.

/**
	 * @see alma.acs.component.ComponentLifecycle#initialize(alma.acs.container.ContainerServices)
	 */
public void initialize(ContainerServices containerServices) throws ComponentLifecycleException {
    super.initialize(containerServices);
    try {
        CurrentStateHierarchyDataAccess csha = new CurrentStateHierarchyDataAccess(this, new String[] { "SpecialState", "BoringState", "StatelessState", "InvalidState" }, 2);
        // currentStateHierarchy
        ROstringSeqImpl currentStateHierarchyImpl = new ROstringSeqImpl("currentStateHierarchy", this, csha);
        ROstringSeqPOATie currentStateHierarchyTie = new ROstringSeqPOATie(currentStateHierarchyImpl);
        currentStateHierarchy = ROstringSeqHelper.narrow(this.registerProperty(currentStateHierarchyImpl, currentStateHierarchyTie));
    } catch (Throwable th) {
        throw new ComponentLifecycleException("Failed to create properties.", th);
    }
}
Also used : ROstringSeqImpl(alma.ACS.impl.ROstringSeqImpl) ROstringSeqPOATie(alma.ACS.ROstringSeqPOATie) ComponentLifecycleException(alma.acs.component.ComponentLifecycleException)

Aggregations

ROstringSeqPOATie (alma.ACS.ROstringSeqPOATie)2 ROstringSeqImpl (alma.ACS.impl.ROstringSeqImpl)2 ComponentLifecycleException (alma.acs.component.ComponentLifecycleException)2 AlmaSubsystemActions (alma.ACS.MasterComponentImpl.statemachine.AlmaSubsystemActions)1 AlmaSubsystemContext (alma.ACS.MasterComponentImpl.statemachine.AlmaSubsystemContext)1 AcsJException (alma.acs.exceptions.AcsJException)1