start();
}
public synchronized void start() throws ResourceAdapterInternalException {
if (started)
throw new ResourceAdapterInternalException("Adapter already started.");
if (stopped)
throw new ResourceAdapterInternalException("Adapter has been stopped.");
if (workManager == null) {
throw new ResourceAdapterInternalException("WorkManager has not been set.");
}
// set HA mode if needed
AdminModule.setHa(isHa);
if (logger.isLoggable(BasicLevel.INFO))
logger.log(BasicLevel.INFO, "JORAM adapter starting deployment...");
// Collocated mode: starting the JORAM server.
if (collocated) {
if (logger.isLoggable(BasicLevel.INFO))
logger.log(BasicLevel.INFO, " - Collocated JORAM server is starting...");
// TODO (AF): Setting system properties forbids the launching of multiples
// servers in an OSGi platform.
if (persistentPlatform) {
System.setProperty("Transaction", "fr.dyade.aaa.util.NTransaction");
System.setProperty("NTNoLockFile", "true");
} else {
System.setProperty("Transaction", "fr.dyade.aaa.util.NullTransaction");
System.setProperty("NbMaxAgents", "" + Integer.MAX_VALUE);
}
if (platformConfigDir != null) {
System.setProperty(AgentServer.CFG_DIR_PROPERTY, platformConfigDir);
System.setProperty(Debug.DEBUG_DIR_PROPERTY, platformConfigDir);
}
try {
AgentServer.init(serverId, serverName, null, clusterId);
AgentServer.start();
if (logger.isLoggable(BasicLevel.INFO))
logger.log(BasicLevel.INFO, "JoramAdapter - Collocated JORAM server has successfully started.");
} catch (Exception exc) {
AgentServer.stop();
AgentServer.reset(true);
throw new ResourceAdapterInternalException("Could not start collocated JORAM instance: " + exc);
}
}
// Starting an admin session...
try {