FileDocCategorySizeDatePackage
WebModuleSupport.javaAPI DocGlassfish v2 API5348Fri May 04 22:23:42 BST 2007com.sun.enterprise.management.support

WebModuleSupport

public final class WebModuleSupport extends Object

Fields Summary
public static final String
VIRTUAL_SERVER_PREFIX
Used to prefix a virtual server name for a j2eeType=WebModule
public static final String
VIRTUAL_SERVER_DELIM
Used to terminate a virtual server name for a j2eeType=WebModule
public static final String
JWS_APP_CLIENTS_WEB_MODULE_NAME
the category=monitor,type=web-module name is {@link #JWS_APP_CLIENTS_WEB_MODULE_MONITOR_NAME}
public static final String
JWS_APP_CLIENTS_WEB_MODULE_MONITOR_NAME
the category=runtime,type=WebModule name is {@link #JWS_APP_CLIENTS_WEB_MODULE_NAME}
Constructors Summary
private WebModuleSupport()

Methods Summary
public static java.lang.StringextractVirtualServerName(java.lang.String compositeName)
WebModule names are of the form ///. Extract the virtual-server-name portion

see
#extractWebModuleName

		if ( ! compositeName.startsWith( VIRTUAL_SERVER_PREFIX ) )
		{
			throw new IllegalArgumentException( compositeName );
		}
		
		final String temp	=
			StringUtil.stripPrefix( compositeName, VIRTUAL_SERVER_PREFIX );
		final int	delimIdx	= temp.indexOf( VIRTUAL_SERVER_DELIM );
		if ( delimIdx < 0 )
		{
		    throw new IllegalArgumentException( compositeName );
		}
		
		final String virtualServerName	= temp.substring( 0, delimIdx );
		
		return virtualServerName;
	
public static java.lang.StringextractWebModuleName(java.lang.String compositeName)
WebModule names are of the form ///. Extract the web-module-name portion

see
#extractVirtualServerName

	    final String virtualServerName  = extractVirtualServerName( compositeName );
	    
		final String prefix	=
			VIRTUAL_SERVER_PREFIX + virtualServerName + VIRTUAL_SERVER_DELIM;
	
	    String  name    = compositeName.substring( prefix.length(), compositeName.length() );
		if ( name.length() == 0 )
		{
		    name    = virtualServerName + ".default";
		}
		
		return name;
	
public static java.lang.StringformCompositeName(java.lang.String virtualServerName, java.lang.String webModuleName)

		return VIRTUAL_SERVER_PREFIX + virtualServerName + VIRTUAL_SERVER_DELIM + webModuleName;
	
public static java.lang.StringgetWebModuleName(javax.management.ObjectName oldObjectName)

		final String webModule			    = oldObjectName.getKeyProperty( "web-module" );
		final String standaloneWebModule	= oldObjectName.getKeyProperty( "standalone-web-module" );
		
		String	webModuleName   = null;
		if ( standaloneWebModule != null )
		{
		    webModuleName   = extractWebModuleName( standaloneWebModule );
		}
		else if ( webModule != null )
		{
		    webModuleName   = extractWebModuleName( webModule );
		}
		else
		{
		    throw new IllegalArgumentException( JMXUtil.toString( oldObjectName ) );
		}
		
		return( webModuleName );
	
public static booleanisLegalVirtualServerName(java.lang.String candidate)

	
		  
	    
	
		return (! candidate.startsWith( VIRTUAL_SERVER_PREFIX ) ) &&
			( candidate.indexOf( VIRTUAL_SERVER_DELIM ) < 0 );