FileDocCategorySizeDatePackage
J2EEServerMdl.javaAPI DocGlassfish v2 API10003Fri May 04 22:24:16 BST 2007com.sun.enterprise.management.model

J2EEServerMdl

public class J2EEServerMdl extends J2EEManagedObjectMdl

Fields Summary
private String
serverVendor
private String
serverVersion
private static String
MANAGED_OBJECT_TYPE
private long
startTime
private static String
DEBUG_SYS_PROPERTY
Constructors Summary
public J2EEServerMdl()

    
      
        /*
        super(System.getProperty(com.sun.enterprise.server.J2EEServer.J2EE_APPNAME, "j2ee") +
            System.getProperty(com.sun.enterprise.server.J2EEServer.J2EE_SERVER_ID_PROP, "100"), false, false, false);
        //this.serverName = System.getProperty(com.sun.enterprise.server.J2EEServer.J2EE_APPNAME) + System.getProperty(com.sun.enterprise.server.J2EEServer.J2EE_SERVER_ID_PROP);
         */
        super("j2ee100", true, false, false);
    
public J2EEServerMdl(String serverName, String version)

        super(serverName, serverName, true, false, false);
        this.serverVersion = version;
    
public J2EEServerMdl(String[] location)

        this(location[1], "8.0" /*FIXME: use constant*/); 
    
Methods Summary
public java.lang.StringgetdebugPort()
Returns the debug port for this instance.

        String debug = java.lang.System.getProperty(DEBUG_SYS_PROPERTY);
        int nameIndex;
        if ( debug!=null && (nameIndex = debug.indexOf("address")) != -1 ) {
            String value = debug.substring(nameIndex + "address".length() + 1);
            int commaIndex;
            if ( (commaIndex = value.indexOf(",")) != -1 ) {
                value = value.substring(0, commaIndex);
            }
            return value;
        }
        return null;
    
public java.lang.String[]getdeployedObjects()
A list of all applications deployed on this J2EEServer.

supplierCardinality
0..*

        Set apps = findNames("j2eeType=J2EEApplication,J2EEServer=" + getJ2EEServer());
        apps.addAll(findNames("j2eeType=EJBModule,J2EEServer=" + getJ2EEServer()));
        apps.addAll(findNames("j2eeType=WebModule,J2EEServer=" + getJ2EEServer()));
        apps.addAll(findNames("j2eeType=ResourceAdapterModule,J2EEServer=" + getJ2EEServer()));
        apps.addAll(findNames("j2eeType=AppClientModule,J2EEServer=" + getJ2EEServer()));

        Iterator it = apps.iterator();
        String [] deployed = new String[apps.size()];
        int i =0;
        while(it.hasNext()) {
            deployed[i++] = ((ObjectName)it.next()).toString();
        }
        return deployed;
    
public java.lang.Stringgetj2eeType()
The type of the J2EEManagedObject as specified by JSR77. The class that implements a specific type must override this method and return the appropriate type string.

        return MANAGED_OBJECT_TYPE;
    
public java.lang.String[]getjavaVMs()
A list of all Java virtual machines on which this J2EEServer has running threads.

supplierCardinality
0..*

        Set vms = findNames("j2eeType=JVM");

        Iterator it = vms.iterator();
        String [] jvms = new String[vms.size()];
        int i =0;
        while(it.hasNext()) {
            jvms[i++] = ((ObjectName)it.next()).toString();
        }
        return jvms;
    
public java.lang.String[]getnodes()
A list of nodes that this J2EEServer spans.

supplierCardinality
1..*

        try {
        	return new String [] { (java.net.InetAddress.getLocalHost()).toString() };
        } catch(Exception e) {
            return new String[0];
        }
    
public java.lang.String[]getresources()
A list of resources available to this server.

supplierCardinality
0..*

        Set res = findNames("j2eeType=JCAResource,J2EEServer=" + getJ2EEServer());
        res.addAll(findNames("j2eeType=JavaMailResource,J2EEServer=" + getJ2EEServer()));
        res.addAll(findNames("j2eeType=JDBCResource,J2EEServer=" + getJ2EEServer()));
        res.addAll(findNames("j2eeType=JMSResource,J2EEServer=" + getJ2EEServer()));
        res.addAll(findNames("j2eeType=JNDIResource,J2EEServer=" + getJ2EEServer()));
        res.addAll(findNames("j2eeType=JTAResource,J2EEServer=" + getJ2EEServer()));
        res.addAll(findNames("j2eeType=RMI_IIOPResource,J2EEServer=" + getJ2EEServer()));
        res.addAll(findNames("j2eeType=URLResource,J2EEServer=" + getJ2EEServer()));
        res.addAll(findNames("j2eeType=AdminObjectResource,J2EEServer=" + getJ2EEServer()));
        Iterator it = res.iterator();
        String [] resources = new String[res.size()];
        int i =0;
        while(it.hasNext()) {
            resources[i++] = ((ObjectName)it.next()).toString();
        }
        return resources;
    
public java.lang.StringgetserverVendor()
Identifies the J2EE platform vendor of this J2EEServer. The value of serverVendor is specified by the vendor.

        return serverVendor;
    
public java.lang.StringgetserverVersion()
Identifies the J2EE platform version of this J2EEServer. The value of serverVersion is specified by the vendor.

        return Version.getVersion();
    
public longgetstartTime()
start time for the server instance

        return this.startTime;
    
public booleanisrestartRequired()
Is instance restart required. Restart is required if dynamic reconfiguration on the instance could not be dones and the user has not restarted the instance since then.

deprecated
Use runtime status object to runtime status

        String instanceId = AdminService.getAdminService().getInstanceName();
        RMIClient rc = AdminChannel.getRMIClient(instanceId);

        return rc.isRestartNeeded();
    
public voidstart()
Starts the server instance.

        
    
public voidstartRecursive()
Starts the server instance.

        start();
    
public voidstop()
Stops the server instance.

        PEMain.shutdown();