Methods Summary |
---|
public java.lang.String | getdeploymentDescriptor()The deploymentDescriptor string must contain the original XML deployment descriptor that was created for this module during the deployment process.
return module.getDeploymentDescriptor();
|
public java.lang.String[] | geteventTypes()
return eventTypes;
|
public java.lang.String | getserver()returns the OBJECT_NAME of the J2EEServer this module is deployed on.
String qs = "name=" + getJ2EEServer() + ",j2eeType=J2EEServer";
Set s = findNames(qs);
ObjectName[] sa = (ObjectName[]) s.toArray(
new ObjectName[s.size()]);
if (sa.length > 0) {
return sa[0].toString();
}
return "Failed to find the server ObjectName";
|
public long | getstartTime()
return this.startTime;
|
public int | getstate()
return this.state;
|
public void | setstate(int st)
this.state = st;
this.stateChanged(eventTypes[st]);
|
public void | start()
if ((this.state == this.STARTING_STATE) ||
(this.state == this.RUNNING_STATE) ||
(this.state == this.STOPPING_STATE)) {
throw new RuntimeException(
new Exception ("cannot start because the current state is " + this.state));
}
try{
this.state = this.STARTING_STATE;
this.stateChanged("j2ee.state.starting");
module.start(this);
this.state = this.RUNNING_STATE;
this.startTime = System.currentTimeMillis();
this.stateChanged("j2ee.state.running");
}catch(Exception ex){
this.state = this.FAILED_STATE;
this.stateChanged("j2ee.state.failed");
if(ex instanceof RuntimeException)
throw (RuntimeException)ex;
throw new RuntimeException(ex);
}
|
public void | startRecursive()
start();
|
private void | stateChanged(java.lang.String state)
/*
Called when this MBean is not yet registered (see below).
Since nothing should be listening to an MBean that is not yet registered, just
skip the Notification. If there were listeners, 'this' could be used as the
source object; it needn't be an ObjectName.
com.sun.enterprise.management.util.J2EEManagementObjectManager.setState(J2EEManagementObjectManager.java:1550)
com.sun.enterprise.management.util.J2EEManagementObjectManager.setApplicationState(J2EEManagementObjectManager.java:1498)
com.sun.enterprise.server.ApplicationLoader.setState(ApplicationLoader.java:395)
com.sun.enterprise.server.AbstractManager.load(AbstractManager.java:211)
com.sun.enterprise.server.ApplicationLifecycle.onStartup(ApplicationLifecycle.java:204)
com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.java:326)
com.sun.enterprise.server.ondemand.OnDemandServer.onStartup(OnDemandServer.java:112)
com.sun.enterprise.server.PEMain.run(PEMain.java:326)
com.sun.enterprise.server.PEMain.main(PEMain.java:260)
*/
final ObjectName objectName = getObjectName();
if ( objectName != null )
{
Notification notification = null;
synchronized (this) // thread safety, visibility of 'sequenceNo'
{
notification = new Notification( state, objectName, sequenceNo);
++sequenceNo;
}
this.sendNotification( notification );
}
|
public void | stop()
if ((this.state == this.STOPPED_STATE) ||
(this.state == this.STOPPING_STATE)) {
throw new RuntimeException(
new Exception("cannot stop because the current state is " + this.state));
}
try{
this.state = this.STOPPING_STATE;
this.stateChanged("j2ee.state.stopping");
module.stop(this);
this.state = this.STOPPED_STATE;
this.stateChanged("j2ee.state.stopped");
}catch(Exception ex){
this.state = this.FAILED_STATE;
this.stateChanged("j2ee.state.failed");
if(ex instanceof RuntimeException)
throw (RuntimeException)ex;
throw new RuntimeException(ex);
}
|