FileDocCategorySizeDatePackage
ServletImpl.javaAPI DocGlassfish v2 API5924Fri May 04 22:23:30 BST 2007com.sun.enterprise.management.j2ee

ServletImpl

public final class ServletImpl extends J2EEManagedObjectImplBase

Fields Summary
private static final Set
IGNORE_MISSING
Constructors Summary
public ServletImpl(com.sun.enterprise.management.support.Delegate delegate)

		super( delegate );
	
Methods Summary
protected java.lang.StringgetMonitoringPeerJ2EEType()

		return( XTypes.SERVLET_MONITOR );
	
protected voidhandleMissingOriginals(java.util.Set missingOriginals)
We don't map any of the Attributes derived from statistics.

	    
		             	 
	     
	    
	
	    missingOriginals.removeAll( IGNORE_MISSING );
	    
        super.handleMissingOriginals( missingOriginals );
	
protected javax.management.ObjectNamequeryMonitoringPeerFailed(java.util.Map propsMap)

		final WebModule			webModule	= (WebModule)getContainer();
		
		debug( "queryMonitoringPeerFailed: expecting to find " +
		    MapUtil.toString( propsMap ) );
		    
		if ( webModule == null )
		{
		    logWarning(
		        "ServletImpl.queryMonitoringPeerFailed: " +
		        "Can't get containing WebModule, my ObjectName = " + getObjectName());
		}
		
		ObjectName	result	= null;
		
		try
		{
			final WebModuleVirtualServerMonitor	webModuleVirtualServerMonitor	=
				(WebModuleVirtualServerMonitor)webModule.getMonitoringPeer();
			if ( webModuleVirtualServerMonitor == null )
			{
			    final ObjectName    objectName  = Util.getObjectName( webModule );
			    
			    final String msg = "ServletImpl.queryMonitoringPeerFailed: " +
			        "Can't get WebModuleVirtualServerMonitor for " +
			            quote( toString( objectName ));
			    debug( msg );
			    logFine( msg );
			}
			else
			{
    			final Map<String,ServletMonitor> servletMap	= 
    			    webModuleVirtualServerMonitor.getServletMonitorMap();
    			
    			final ServletMonitor	sm	= servletMap.get( getName() );
    			if ( sm != null )
    			{
    				result	= Util.getObjectName( sm );
    			}
    			else
    			{
    			    final String  servletMonitorNames = CollectionUtil.toString(
    			        Util.toObjectNames( servletMap ).values(), StringUtil.NEWLINE() );
    			    
    		        logWarning(
    		            "ServletImpl.queryMonitoringPeerFailed: " +
    		            "Can't find ServletMonitor, my ObjectName = " +
    		                quote( toString( getObjectName() ) ) +
    		                ", WebModuleVirtualServerMonitor " +
    		                quote( toString( Util.getObjectName(webModuleVirtualServerMonitor) )) +
    		                " ServletMonitor names:" + StringUtil.NEWLINE() + servletMonitorNames );
    			}
			}
		}
		catch( Exception e )
		{
		    logWarning( "ServletImpl.queryMonitoringPeerFailed: " + e);
		    debug( "ServletImpl.queryMonitoringPeerFailed: " + e + "\n" +
		        ExceptionUtil.getStackTrace( e ) );
		}
		
		return result;