FileDocCategorySizeDatePackage
OrbConnectionManagerStatsImpl.javaAPI DocGlassfish v2 API6133Fri May 04 22:34:54 BST 2007com.sun.enterprise.iiop

OrbConnectionManagerStatsImpl

public class OrbConnectionManagerStatsImpl extends ORBCommonStatsImpl implements com.sun.enterprise.admin.monitor.stats.OrbConnectionManagerStats
This is the implementation for the OrbConnectionManagerStats and provides the implementation required to get the statistics for an orb connection
author
Pramod Gopinath

Fields Summary
private com.sun.corba.ee.spi.monitoring.MonitoredObject
connection
private String
connectionName
private static String
stringTotalConnections
private static String
stringIdleConnections
private static String
stringBusyConnections
private com.sun.enterprise.admin.monitor.stats.MutableBoundedRangeStatisticImpl
totalConnections
private com.sun.enterprise.admin.monitor.stats.MutableCountStatisticImpl
idleConnections
private com.sun.enterprise.admin.monitor.stats.MutableCountStatisticImpl
busyConnections
Constructors Summary
public OrbConnectionManagerStatsImpl(com.sun.corba.ee.spi.monitoring.MonitoredObject connectionNode)



         
        this.connection     = connectionNode; 
        this.connectionName = connection.getName();

        initializeStats();
    
Methods Summary
public javax.management.j2ee.statistics.CountStatisticgetConnectionsIdle()


        long numberIdleConnections = ((Long) connection.getAttribute( 
	    stringIdleConnections ).getValue()).longValue();


        idleConnections.setCount( numberIdleConnections );

        return (CountStatistic) idleConnections.modifiableView();
    
public javax.management.j2ee.statistics.CountStatisticgetConnectionsInUse()


        long numberBusyConnections = ((Long) connection.getAttribute( 
	    stringBusyConnections ).getValue()).longValue();

        busyConnections.setCount( numberBusyConnections );

        return (CountStatistic) busyConnections.modifiableView();
    
public javax.management.j2ee.statistics.BoundedRangeStatisticgetTotalConnections()


        long totalNumberOfConnections = ((Long) connection.getAttribute( 
            stringTotalConnections ).getValue()).longValue();

        totalConnections.setCount( totalNumberOfConnections );

        return (BoundedRangeStatistic) totalConnections.modifiableView();
    
private voidinitializeStats()

    	super.initialize(
            "com.sun.enterprise.admin.monitor.stats.OrbConnectionManagerStats");

        final long time = System.currentTimeMillis();

        totalConnections = 
            new MutableBoundedRangeStatisticImpl(
                new BoundedRangeStatisticImpl( 0, 0, 0, 
                    java.lang.Long.MAX_VALUE, 0,
                    "TotalConnections", "count",
                    connection.getAttribute( stringTotalConnections ).
                    getAttributeInfo( ).getDescription(), 
                    time, time ));

        idleConnections = 
            new MutableCountStatisticImpl(
                new CountStatisticImpl( 
                    "ConnectionsIdle", "count", 
                    connection.getAttribute( stringIdleConnections ).
                    getAttributeInfo( ).getDescription() ));

        busyConnections = 
            new MutableCountStatisticImpl(
                new CountStatisticImpl( 
                    "ConnectionsInUse", "count", 
                    connection.getAttribute( stringBusyConnections ).
                    getAttributeInfo( ).getDescription() ));