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

WebModuleImpl

public final class WebModuleImpl extends J2EEModuleImplBase

Fields Summary
Constructors Summary
public WebModuleImpl(com.sun.enterprise.management.support.Delegate delegate)

		super( delegate );
	
Methods Summary
private final java.lang.StringdeduceModuleName()

		// get the last part of the workDir; it should be the actual module name
		final String	workDir	= getSelfProxy().getWorkDir();
		final int index1	= workDir.lastIndexOf( "/" );
		final int index2	= workDir.lastIndexOf( "\\" );
		final int index	= index1 > index2 ? index1 : index2;
		
		String	result	= null;
		
		if (index > 0 )
		{
			result	= workDir.substring( index + 1, workDir.length() );
		}
		
		return( result );
	
protected java.lang.StringgetConfigPeerName()
MBeans of type j2eeType=WebModule have their virtual server prepended to their name. For example, if the virtual server is "__asadmin", the name will start with "//__asadmin/".

		final String compositeName	= getName();
		
		final String webModuleName	= WebModuleSupport.extractWebModuleName( compositeName );

		return( webModuleName );
	
protected java.lang.StringgetMonitoringPeerJ2EEType()

		return( XTypes.WEB_MODULE_VIRTUAL_SERVER_MONITOR );
	
protected com.sun.appserv.management.j2ee.WebModulegetSelfProxy()

	    return (WebModule)getSelf();
	
public java.util.MapgetServletObjectNameMap()

		return( getContaineeObjectNameMap( J2EETypes.SERVLET ) );
	
public java.lang.String[]getservlets()

	    final Map<String,Servlet>   servlets    = getSelfProxy().getServletMap();
	    
		return( CollectionUtil.toStringArray( Util.toObjectNames( servlets ).values() ) );
	
public booleanisConfigProvider()

		boolean	isConfigProvider	= super.isConfigProvider();
		if ( super.isConfigProvider() && getObjectName() != null )
		{
			final String name	= getConfigPeerName();
			
			/*
				Ugly hack for our System WebModules.
				// context root is being used instead of module name
			 */
			if ( name.length() == 0 || name.equals( "asadmin" ) ||
				name.equals( "web1" ) )
			{
				isConfigProvider	= false;
			}
			
		}
		
		return( isConfigProvider );
	
protected javax.management.ObjectNamequeryConfigPeerFailed(java.util.Map propsMap)

		final String potentialName	= deduceModuleName();
		propsMap.put( AMX.NAME_KEY, potentialName );
		
		final ObjectName	result	= queryProps( propsMap );
		
		return( result );
	
protected javax.management.ObjectNamequeryMonitoringPeerFailed(java.util.Map propsMap)

		final String	selfName	= getName();
		
		final String virtualServerName	= WebModuleSupport.extractVirtualServerName( selfName );
		
		ObjectName	result	= null;
		
		final String potentialName	= deduceModuleName();
		if ( potentialName != null )
		{
			final String	name	= WebModuleSupport.formCompositeName( virtualServerName, potentialName );

			propsMap.put( AMX.NAME_KEY, name );
			result	= queryProps( propsMap );
		}
		
		return result;