FileDocCategorySizeDatePackage
ServerRootMonitorImpl.javaAPI DocGlassfish v2 API6272Thu Jul 26 12:54:40 BST 2007com.sun.enterprise.management.monitor

ServerRootMonitorImpl

public final class ServerRootMonitorImpl extends MonitoringImplBase

Fields Summary
private static final Set
NOT_SUPERFLUOUS
final Set
FAUX_CONTAINEE_TYPES
Constructors Summary
public ServerRootMonitorImpl()

		super( XTypes.SERVER_ROOT_MONITOR );
	
Methods Summary
public final javax.management.ObjectNamegetCallFlowMonitorObjectName()

	    return getContaineeObjectName( XTypes.CALL_FLOW_MONITOR );
	
public final java.util.SetgetContaineeObjectNameSet(java.lang.String childJ2EEType)

		final Set<ObjectName>	result	= super.getContaineeObjectNameSet( childJ2EEType );
		
		if ( getFauxChildTypes().contains( childJ2EEType ) )
		{
			final String	nullAppMonitorProp	= Util.makeProp( XTypes.APPLICATION_MONITOR, AMX.NULL_NAME );

			final Set<ObjectName>	fauxContainees	= getFauxContaineeObjectNameSet( childJ2EEType, nullAppMonitorProp);
			result.addAll( fauxContainees );
		}
		
		return( result );
	
protected java.util.SetgetFauxChildTypes()

		
		 
	
	
		return( FAUX_CONTAINEE_TYPES );
	
protected final java.util.SetgetNotSuperfluousMethods()

	      
	
	
	    return GSetUtil.newSet( super.getNotSuperfluousMethods(), NOT_SUPERFLUOUS );
	
public java.util.MapgetORBConnectionManagerMonitorObjectNameMap()

		return( getContaineeObjectNameMap( XTypes.CONNECTION_MANAGER_MONITOR ) );
	
protected final voidregisterCallFlow()

		final ObjectNames	objectNames	= ObjectNames.getInstance( getJMXDomain() );
		final ObjectName	childObjectName	=
			objectNames.buildContaineeObjectName( getObjectName(),
				getFullType(), XTypes.CALL_FLOW_MONITOR,
					getName() );
		
		final CallFlowMonitorImpl	callFlow	= new CallFlowMonitorImpl();
		try
		{
            debug( "Loading CallFlowMonitor for DAS: " + childObjectName );
			getMBeanServer().registerMBean( callFlow, childObjectName );
		}
		catch( JMException e )
		{
			logWarning( "ServerRootMonitor: Can't load CallFlow" );
		}
	
protected voidregisterMisc()

		super.registerMisc();
		
		if ( getLoader().isDAS() )
		{
		    if ( ( BootUtil.getInstance().getServerName().equals( getName() ) ) )
		    {
		        // this is the ServerRootMonitor for the DAS.
		        registerCallFlow();
		    }
		}
		else
		{	
		    // they should be cascaded from other instances
		    // and ServerRootMonitorImpl does not exist there.
	         throw new RuntimeException( "ServerRootMonitorImpl expected in DAS only" );
		}

	
protected voidunregisterMisc()

	    if ( getLoader().isDAS() )
	    {
            final MBeanServer mbeanServer       = getMBeanServer();
            final ObjectName callFlowObjectName = getCallFlowMonitorObjectName();
            // ObjectName might or might not be available
            if ( callFlowObjectName != null )
            {
                try
                {
                    mbeanServer.unregisterMBean( callFlowObjectName );
                }
                catch( JMException e )
                {
                    logWarning( "ServerRootMonitorImpl: exception unregistering CallFlowMonitor: " +
                        ExceptionUtil.getRootCause(e));
                }
            }
		}