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

WebServiceEndpointMdl

public abstract class WebServiceEndpointMdl extends J2EEManagedObjectMdl
WebServiceEndpoint rutime MBean. This MBean acts as base class for ServletWebServiceEndpoint and EJBWebServiceEndpoint. Please use either ServletWebServiceEndpoint or EJBWebServiceEndpoint, inorder to instantiate runtime mbean of type WebServiceEndpoint.

Fields Summary
private static final String
MANAGED_OBJECT_TYPE
protected static final String
WEB_MBEAN
protected static final String
EJB_MBEAN
private final String
moduleName
private final String
registrationName
private final String
applicationName
private final String
epName
private final boolean
isEjb
private final boolean
isStandAlone
private String
mbeanName
Constructors Summary
WebServiceEndpointMdl(String name, String mName, String regName, boolean isVirtual, boolean isejb)
constructor.

param
name Name of the web service endpoint
param
moduleName Name of the module (which this web service belongs)
param
regName registration name of the application or module
param
isVirtual true, if the module is stand alone, false otherwise
param
isEjb If this Web service endpoint is implemented as EJB or Servlet

    
                                                                                                                 
         
        
        super(name,false, false, false);
        this.moduleName = mName;
        this.applicationName = regName;
        this.registrationName = regName;
        this.isStandAlone = isVirtual;
        this.epName = name;
        this.isEjb = isejb;
        if (isejb == true) {
            mbeanName = EJB_MBEAN;
        } else {
            mbeanName = WEB_MBEAN;
        }
    
WebServiceEndpointMdl(String name, String moduleName, String regName, String serverName, boolean isVirtual, boolean isejb)
constructor.

param
name Name of the web service endpoint
param
moduleName Name of the module (which this web service belongs)
param
regName registration name of the application or module
param
serverName Name of the server instance
param
isVirtual true, if the module is stand alone, false otherwise
param
isEjb If this Web service endpoint is implemented as EJB or Servlet


        super(name, serverName, false, false, false);
        this.moduleName = moduleName;
        this.applicationName = regName;
        this.registrationName = regName;
        this.epName = name;
        this.isEjb = isejb;
        if (isejb == true) {
            mbeanName = EJB_MBEAN;
        } else {
            mbeanName = WEB_MBEAN;
        }
        this.isStandAlone = isVirtual;
    
Methods Summary
public java.lang.StringgetImplementationType()
This returns the underlying implementation Servlet or EJB' type It could be J2EETypes.SERVLET or J2EETypes.EJB.

return
String "EJB" or "SERVLET"

        if (isEjb) {
            return "EJB";
        } else {
            return "SERVLET";
        }
    
public java.lang.StringgetJ2EEApplication()
Accessor method for the J2EE Application key

return
String Application's name

       return this.applicationName;
    
public longgetLastResetTime()
Returns the last reset time stamp in milliseconds.

return
last reset time stamp in milliseconds

        long resetTime = 0;
        WebServiceEndpointStatsProvider provider = getWSProvider();
        if (provider != null) {
            resetTime = provider.getLastResetTime();
        }

        return resetTime;
    
public abstract java.lang.StringgetMBeanName()
The MBean name of the J2EEManagedObject as specified in runtime-mbeans-descriptors.xml. This value is used in registering the MBean.

return
String MBeanName value of this Managed Object

public java.util.Map[]getMessagesInHistory()
Returns last N message content and info collected for this web service.

return
MessageTrace[] collection message content/trace information

        String partialEpName = null;

        if (isStandAlone) {
            // standalone module
            partialEpName = this.epName;
        } else {
            partialEpName = this.moduleName+ "#" + this.epName;
        }

        Map<String,Serializable>[] maps = null; 
        MessageTrace[] result = 
            MessageTraceMgr.getInstance().getMessages(this.registrationName,
                 partialEpName);
        if ( result == null) {
            return null;
        }
        if (  result.length > 0 ) {
            maps = new Map[result.length];
            for ( int idx =0; idx < result.length; idx++) {
                maps[idx] = result[idx].asMap();
                TypeCast.checkSerializable( maps[ idx] );
            }
        } 
        return maps;
        
    
public java.lang.StringgetModule()
Accessor method for the module name key

return
String Module's name

       return this.moduleName;
    
private com.sun.enterprise.admin.wsmgmt.stats.spi.WebServiceEndpointStatsProvidergetWSProvider()
Returns the stats provider for this web service endpoint.

        final String NS = "#";
        StatsProviderManager spMgr = StatsProviderManager.getInstance();

        String fqName = null;
        if (isStandAlone == false) {
            fqName = registrationName + NS + moduleName + NS + epName;
        } else {
            fqName = registrationName + NS + epName;
        }
        WebServiceEndpointStatsProvider provider = 
                spMgr.getEndpointStatsProvider(fqName);

        return provider;
    
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
String J2eeType of this Managed Object

        return MANAGED_OBJECT_TYPE;
    
public voidresetStats()
Resets the statistics.

        WebServiceEndpointStatsProvider provider = getWSProvider();
        if (provider != null) {
            provider.reset();
        }