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 Web ServiceGroup :" + context);
}
if (context.get() == null) {
return false;
}
if ( context.getEntryPointType() == EntryPoint.JNDI ) {
/*
no.op. You cant access this servicegroup via JNDI.
*/
return false;
}
boolean result = false;
try {
ConfigContext ctxt = context.getServerContext().getConfigContext();
Config conf = ServerBeansFactory.getConfigBean( ctxt );
if (context.getEntryPointType() == EntryPoint.APPLOADER ) {
Descriptor desc = (Descriptor) context.get();
if (desc instanceof Application) {
// has atleast one webcomponent or
// Atleast one component has webservice
result = !((Application) desc).getWebBundleDescriptors().isEmpty() ||
!((Application) desc).getWebServiceDescriptors().isEmpty();
} else if (desc instanceof EjbBundleDescriptor) {
result = ((EjbBundleDescriptor) desc).hasWebServices();
} else if (desc instanceof EjbAbstractDescriptor) {
result = ((EjbAbstractDescriptor) desc).hasWebServiceEndpointInterface();
} else {
result = desc instanceof WebBundleDescriptor ||
desc instanceof WebServicesDescriptor;
}
}
if ( context.getEntryPointType() == EntryPoint.PORT ) {
// Start HTTP listener ports
HttpService httpService = conf.getHttpService();
HttpListener[] httpListeners = httpService.getHttpListener();
for ( int i=0; i<httpListeners.length; i++ ) {
int port = Integer.parseInt(httpListeners[i].getPort());
if (port == ((Integer) context.get()).intValue() ) {
result = true;
}
}
}
if (context.getEntryPointType() == EntryPoint.MBEAN) {
result = analyseObjectName((ObjectName) context.get());
}
} catch (Exception e) {
e.printStackTrace();
result = false;
}
return result;
|
private boolean | analyseObjectName(javax.management.ObjectName name)
/*
if (name == null) {
return true;
}
String cat = name.getKeyProperty("category");
if (cat != null && cat.equals("monitor")) {
return true;
}
*/
String type = name.getKeyProperty("type");
if ((type != null) && type.equals("Loader")) {
return true;
}
String j2eeType = name.getKeyProperty("j2eeType");
if ((j2eeType != null) &&
j2eeType.equals("WebModule")) {
return true;
}
if (name.getKeyProperty("WebModule") != null) {
return true;
}
String nameStr = name.getKeyProperty("name");
String ref = name.getKeyProperty("ref");
String app = name.getKeyProperty("J2EEApplication");
return belongsToThisServiceGroup(nameStr) ||
belongsToThisServiceGroup(ref) ||
belongsToThisServiceGroup(app);
|
private boolean | belongsToThisServiceGroup(java.lang.String name)
SystemAppLoader appLoader = OnDemandServer.getSystemAppLoader();
if (appLoader != null) {
for (Object n : appLoader.getWebServiceGroupSystemApps()) {
if (((String) n).equals(name)) {
return true;
}
}
}
return false;
|
private void | loadSystemApps()Loads all the system apps belongs to this servicegroup.
SystemAppLoader loader = OnDemandServer.getSystemAppLoader();
loader.loadSystemApps(loader.getWebServiceGroupSystemApps());
|
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 {
startLifecycleServices(context.getServerContext());
loadSystemApps();
AppclientJWSSupportManager.getInstance().
startJWSServicesForDeployedAppclients();
setState(ServiceGroup.STARTED);
} 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.getWebServiceGroupServices();
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();
|