javax.slee.usage
Class SampleStatistics

java.lang.Object
  extended by javax.slee.usage.SampleStatistics
All Implemented Interfaces:
java.io.Serializable, VendorExtensions

public final class SampleStatistics
extends java.lang.Object
implements VendorExtensions, java.io.Serializable

This class provides basic statistical information for a sample-type usage parameter.

See Also:
Serialized Form

Constructor Summary
SampleStatistics()
          Create a new SampleStatistics object for containing statistical information for a sample-type usage parameter in the case where no samples have been counted yet.
SampleStatistics(long sampleCount, long min, long max, double mean)
          Create a new SampleStatistics object containing statistical information for a sample-type usage parameter.
 
Method Summary
static void disableVendorDataDeserialization()
          Disable the deserialization of vendor-specific data for objects of this class.
static void disableVendorDataSerialization()
          Disable the serialization of vendor-specific data for objects of this class.
static void enableVendorDataDeserialization()
          Enable the deserialization of vendor-specific data for objects of this class.
static void enableVendorDataSerialization()
          Enable the serialization of vendor-specific data for objects of this class.
 long getMaximum()
          Get the maximum sample value recorded for the usage parameter since either the service was deployed or the usage parameter was last reset (whichever occurred most recently).
 double getMean()
          Get the mean of sample values recorded for the usage parameter since either the service was deployed or the usage parameter was last reset (whichever occurred most recently).
 long getMinimum()
          Get the minimum sample value recorded for the usage parameter since either the service was deployed or the usage parameter was last reset (whichever occurred most recently).
 long getSampleCount()
          Get the number of samples recorded for the usage parameter since either the service was deployed or the usage parameter was last reset (whichever occurred most recently).
 java.lang.Object getVendorData()
          Get the vendor-specific data.
 void setVendorData(java.lang.Object vendorData)
          Set the vendor-specific data.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SampleStatistics

public SampleStatistics()
Create a new SampleStatistics object for containing statistical information for a sample-type usage parameter in the case where no samples have been counted yet.

This constructor is equivalent to SampleStatistics(0, Long.MAX_VALUE, Long.MIN_VALUE, 0.0).


SampleStatistics

public SampleStatistics(long sampleCount,
                        long min,
                        long max,
                        double mean)
Create a new SampleStatistics object containing statistical information for a sample-type usage parameter.

Parameters:
sampleCount - the number of samples recorded for the usage parameter.
min - the minimum sample value recorded.
max - the maximum sample value recorded.
mean - the mean of the sample values recorded.
Method Detail

getSampleCount

public long getSampleCount()
Get the number of samples recorded for the usage parameter since either the service was deployed or the usage parameter was last reset (whichever occurred most recently).

Returns:
the number of samples recorded.

getMinimum

public long getMinimum()
Get the minimum sample value recorded for the usage parameter since either the service was deployed or the usage parameter was last reset (whichever occurred most recently).

Returns:
the minimum sample value. This will be equal to Long.MAX_VALUE if no samples have yet been recorded.

getMaximum

public long getMaximum()
Get the maximum sample value recorded for the usage parameter since either the service was deployed or the usage parameter was last reset (whichever occurred most recently).

Returns:
the maximum sample value. This will be equal to Long.MIN_VALUE if no samples have yet been recorded.

getMean

public double getMean()
Get the mean of sample values recorded for the usage parameter since either the service was deployed or the usage parameter was last reset (whichever occurred most recently).

Returns:
the mean of sample values. This will be equal to 0.0 if no samples have yet been recorded.

enableVendorDataSerialization

public static void enableVendorDataSerialization()
Enable the serialization of vendor-specific data for objects of this class. This method is typically used by a SLEE implementation that wants to export vendor-specific data with objects of this class to management clients.

By default, any vendor-specific data included in an object of this class will not be included in the serialization stream when the object is serialized. Invoking this method changes this behavior so that vendor-specific data is included in the serialization stream when an object of this class is serialized.

This method should only be invoked if the vendor-specific data is serializable via standard Java serialization means.

Since:
SLEE 1.1
See Also:
disableVendorDataSerialization(), setVendorData(java.lang.Object)

disableVendorDataSerialization

public static void disableVendorDataSerialization()
Disable the serialization of vendor-specific data for objects of this class.

If the serialization of vendor-specific data for objects of this class has been enabled via the enableVendorDataSerialization() method, this method disables that behavior again.

Since:
SLEE 1.1

enableVendorDataDeserialization

public static void enableVendorDataDeserialization()
Enable the deserialization of vendor-specific data for objects of this class. This method is typically used by a management client that wants to obtain any vendor-specific data included in the serialization stream of objects of this class.

By default, any vendor-specific data included in the serialization stream of objects of this class is discarded upon deserialization. Invoking this method changes that behavior so that the vendor-specific data is also deserialized when an object of this class is deserialized. A management client that enables the deserialization of vendor-specific data must ensure that any necessary classes required to deserialize that data is available in the relevant classloader.

Since:
SLEE 1.1
See Also:
disableVendorDataDeserialization(), getVendorData()

disableVendorDataDeserialization

public static void disableVendorDataDeserialization()
Disable the deserialization of vendor-specific data for objects of this class.

If the deserialization of vendor-specific data for objects of this class has been enabled via the enableVendorDataDeserialization() method, this method disables that behavior again.

Since:
SLEE 1.1

setVendorData

public void setVendorData(java.lang.Object vendorData)
Set the vendor-specific data.

Specified by:
setVendorData in interface VendorExtensions
Parameters:
vendorData - the vendor-specific data.
Since:
SLEE 1.1

getVendorData

public java.lang.Object getVendorData()
Get the vendor-specific data.

Specified by:
getVendorData in interface VendorExtensions
Returns:
the vendor-specific data.
Since:
SLEE 1.1

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2009. All Rights Reserved.