Methods Summary |
---|
public void | abort(com.sun.enterprise.server.ondemand.entry.EntryContext context)Abort the servicegroup. This is not called from anywhere as of now.
super.stopLifecycleServices();
|
public boolean | analyseEntryContext(com.sun.enterprise.server.ondemand.entry.EntryContext context)Analyse the entrycontext and specifies whether this servicegroup
can be started or not.
if (_logger.isLoggable(Level.FINER)) {
_logger.log(Level.FINER,
"Analysing the context in Resources ServiceGroup :" + context);
}
if (context.get() == null) {
return false;
}
if ( context.getEntryPointType() == EntryPoint.JNDI ) {
// TODO. Move connectors lazy loading from naming to here.
return false;
}
boolean result = false;
try {
ConfigContext ctxt = context.getServerContext().getConfigContext();
Config conf = ServerBeansFactory.getConfigBean( ctxt );
JmsService jmsService_ = conf.getJmsService();
String defaultJmsHost = jmsService_.getDefaultJmsHost();
JmsHost jmsHost_ = null;
boolean embedded = true;
if (defaultJmsHost==null || defaultJmsHost.equals("")) {
jmsHost_ = ServerBeansFactory.getJmsHostBean(ctxt);
} else {
jmsHost_ = jmsService_.getJmsHostByName(defaultJmsHost);
}
if (jmsHost_ == null || jmsService_.getType() == null ||
! jmsService_.getType().equalsIgnoreCase("embedded")) {
embedded = false;
}
if ( context.getEntryPointType() == EntryPoint.STARTUP ) {
boolean onDemandStartup = ((Boolean) context.get()).booleanValue();
if (onDemandStartup == true && embedded == false) {
result = true;
}
} else if (embedded == false) {
return false;
}
if (context.getEntryPointType() == EntryPoint.APPLOADER ) {
String mqRA = ConnectorRuntime.DEFAULT_JMS_ADAPTER;
Descriptor desc = (Descriptor) context.get();
if (desc instanceof Application) {
Application application = (Application) desc;
for (ConnectorDescriptor cd : (java.util.Set<ConnectorDescriptor>)
application.getRarDescriptors()) {
Application app = cd.getApplication();
if (app !=null && mqRA.equals(app.getRegistrationName())) {
result = true;
}
}
} else if (desc instanceof ConnectorDescriptor ) {
ConnectorDescriptor cd = (ConnectorDescriptor) desc;
Application app = cd.getApplication();
if (app != null && mqRA.equals(app.getRegistrationName())) {
result = true;
}
}
}
if ( context.getEntryPointType() == EntryPoint.PORT ) {
String portStr = jmsHost_.getPort();
if (Integer.parseInt(portStr.trim()) ==
((Integer) context.get()).intValue()) {
result = true;
}
}
} catch (Exception e) {
e.printStackTrace();
result = false;
}
return result;
|
private void | loadSystemApps()Loads all the system apps belongs to this servicegroup.
SystemAppLoader loader = OnDemandServer.getSystemAppLoader();
loader.loadSystemApps(loader.getResourcesServiceGroupSystemApps());
|
public void | start(com.sun.enterprise.server.ondemand.entry.EntryContext context)Triggers the start of the servicegroup. The entry context
that caused this startup is used by the servicegroup to obtain
any startup information it require.
try {
//loadSystemApps();
startLifecycleServices(context.getServerContext());
//(ConnectorRuntime.DEFAULT_JMS_ADAPTER);
} catch (Exception e) {
throw new ServiceGroupException(e);
}
|
private void | startLifecycleServices(com.sun.enterprise.server.ServerContext context)Start lifecycles belonging to this service group.
String[][] services = OnDemandServices.getResourcesServiceGroupServices();
super.startLifecycleServices(services, context);
|
public void | stop(com.sun.enterprise.server.ondemand.entry.EntryContext context)Stop the servicegroup. It stops all the lifecycle modules belongs to this
servicegroup.
super.stopLifecycleServices();
|