Search in sources :

Example 1 with AlarmSourceFactory

use of alma.acs.alarmsystem.source.AlarmSourceFactory in project ACS by ACS-Community.

the class ACSAlarmSystemInterfaceFactory method init.

/**
	 * Init the static variables of the class
	 * This method has to be called before executing any other
	 * method. 
	 * 
	 * @param logger The logger
	 * @param dal The DAL to init the AS with CERN or ACS implementation
	 * @throws AcsJContainerServicesEx 
	 */
public static void init(ContainerServicesBase containerServices) throws AcsJContainerServicesEx {
    if (containerServices == null) {
        throw new AcsJContainerServicesEx(new Exception("Invalid null ContainerServicesBase"));
    }
    ACSAlarmSystemInterfaceFactory.containerServices = containerServices;
    ACSAlarmSystemInterfaceFactory.logger = containerServices.getLogger();
    DAL dal = containerServices.getCDB();
    if (logger == null || dal == null) {
        throw new IllegalArgumentException("Invalid DAL or Logger from ContainerServicesBase");
    }
    alarmSourceFactory = new AlarmSourceFactory(containerServices);
    useACSAlarmSystem = retrieveImplementationType(dal);
    if (logger != null) {
        if (useACSAlarmSystem) {
            logger.log(AcsLogLevel.DEBUG, "Alarm system type: ACS");
        } else {
            logger.log(AcsLogLevel.DEBUG, "Alarm system type: CERN");
            try {
                initCmwMom();
            } catch (Throwable t) {
                throw new AcsJContainerServicesEx(new Exception("Error initing cmw-mom", t));
            }
        }
    }
}
Also used : AlarmSourceFactory(alma.acs.alarmsystem.source.AlarmSourceFactory) AcsJContainerServicesEx(alma.JavaContainerError.wrappers.AcsJContainerServicesEx) DAL(com.cosylab.CDB.DAL)

Example 2 with AlarmSourceFactory

use of alma.acs.alarmsystem.source.AlarmSourceFactory in project ACS by ACS-Community.

the class SourceFactoryTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    System.out.println("SourceFactoryTest.setUp");
    factory = new AlarmSourceFactory(this.getContainerServices());
    assertNotNull(factory);
}
Also used : AlarmSourceFactory(alma.acs.alarmsystem.source.AlarmSourceFactory)

Aggregations

AlarmSourceFactory (alma.acs.alarmsystem.source.AlarmSourceFactory)2 AcsJContainerServicesEx (alma.JavaContainerError.wrappers.AcsJContainerServicesEx)1 DAL (com.cosylab.CDB.DAL)1