use of alma.acsErrTypeAlarmSourceFactory.wrappers.AcsJFaultStateCreationErrorEx in project ACS by ACS-Community.
the class ACSAlarmSystemInterfaceFactory method createFaultState.
/**
* Factory method for creating ACSFaultState instances.
* @return a new ACSFaultState instance.
*
*/
public static synchronized ACSFaultState createFaultState() throws ACSASFactoryNotInitedEx, FaultStateCreationErrorEx {
if (useACSAlarmSystem == null) {
Exception e = new IllegalStateException("Factory not initialised");
throw new AcsJACSASFactoryNotInitedEx(e).toACSASFactoryNotInitedEx();
}
if (useACSAlarmSystem) {
return new ACSFaultStateImpl();
} else {
try {
Thread t = Thread.currentThread();
ClassLoader loader = t.getContextClassLoader();
Class cl = loader.loadClass("alma.acs.alarmsystem.binding.ACSLaserFaultStateImpl");
Class[] classes = {};
Constructor constructor = cl.getConstructor(classes);
return (ACSFaultState) constructor.newInstance();
} catch (Exception e) {
throw new AcsJFaultStateCreationErrorEx(e).toFaultStateCreationErrorEx();
}
}
}
Aggregations