org.arm4.arm40.metric
Class ArmMetricFactory

java.lang.Object
  extended by org.arm4.arm40.transaction.ArmInterface
      extended by org.arm4.arm40.transaction.ArmFactory
          extended by org.arm4.arm40.metric.ArmMetricFactory
All Implemented Interfaces:
ArmMetricFactory, ArmInterface

public class ArmMetricFactory
extends ArmFactory
implements ArmMetricFactory

ArmMetricFactory provides methods to create instances of the classes in the org.opengroup.arm40.metric package. An error callback method can be registered for objects created with this factory. ArmMetricFactory is instantiated using a class loader. The actual name of the factory implementation class is obtained from the system property whose name is provided in the propertyKey constant of ArmMetricFactory.

Version:
$Revision$ $Date$
Author:
dcarter

Field Summary
static java.lang.String propertyKey
           
 
Fields inherited from class org.arm4.arm40.transaction.ArmFactory
m_nativeLoaded
 
Fields inherited from class org.arm4.arm40.transaction.ArmInterface
m_errorCode, m_factory
 
Constructor Summary
ArmMetricFactory()
           
 
Method Summary
 ArmMetricCounter32 newArmMetricCounter32(ArmMetricCounter32Definition definition)
          Creates a new metric instance.
 ArmMetricCounter32Definition newArmMetricCounter32Definition(ArmApplicationDefinition app, java.lang.String name, java.lang.String units, short usage, ArmID id)
          Creates a new metadata instance.
 ArmMetricCounter64 newArmMetricCounter64(ArmMetricCounter64Definition definition)
          Creates a new metric instance.
 ArmMetricCounter64Definition newArmMetricCounter64Definition(ArmApplicationDefinition app, java.lang.String name, java.lang.String units, short usage, ArmID id)
          Creates a new metadata instance.
 ArmMetricCounterFloat32 newArmMetricCounterFloat32(ArmMetricCounterFloat32Definition definition)
          Creates a new metric instance.
 ArmMetricCounterFloat32Definition newArmMetricCounterFloat32Definition(ArmApplicationDefinition app, java.lang.String name, java.lang.String units, short usage, ArmID id)
          Creates a new metadata instance.
 ArmMetricGauge32 newArmMetricGauge32(ArmMetricGauge32Definition definition)
          Creates a new metric instance.
 ArmMetricGauge32Definition newArmMetricGauge32Definition(ArmApplicationDefinition app, java.lang.String name, java.lang.String units, short usage, ArmID id)
          Creates a new metadata instance.
 ArmMetricGauge64 newArmMetricGauge64(ArmMetricGauge64Definition definition)
          Creates a new metric instance.
 ArmMetricGauge64Definition newArmMetricGauge64Definition(ArmApplicationDefinition app, java.lang.String name, java.lang.String units, short usage, ArmID id)
          Creates a new metadata instance.
 ArmMetricGaugeFloat32 newArmMetricGaugeFloat32(ArmMetricGaugeFloat32Definition definition)
          Creates a new metric instance.
 ArmMetricGaugeFloat32Definition newArmMetricGaugeFloat32Definition(ArmApplicationDefinition app, java.lang.String name, java.lang.String units, short usage, ArmID id)
          Creates a new metadata instance.
 ArmMetricGroup newArmMetricGroup(ArmMetricGroupDefinition groupDefinition, ArmMetric[] metrics)
          Creates an ordered set of ArmMetric subclasses ready for binding to transaction objects.
 ArmMetricGroupDefinition newArmMetricGroupDefinition(ArmMetricDefinition[] definitions)
          Creates an ordered set of ArmMetricDefinition subclasses ready for binding to transaction definition objects.
 ArmMetricNumericId32 newArmMetricNumericId32(ArmMetricNumericId32Definition definition)
          Creates a new metric instance.
 ArmMetricNumericId32Definition newArmMetricNumericId32Definition(ArmApplicationDefinition app, java.lang.String name, java.lang.String units, short usage, ArmID id)
          Creates a new metadata instance.
 ArmMetricNumericId64 newArmMetricNumericId64(ArmMetricNumericId64Definition definition)
          Creates a new metric instance.
 ArmMetricNumericId64Definition newArmMetricNumericId64Definition(ArmApplicationDefinition app, java.lang.String name, java.lang.String units, short usage, ArmID id)
          Creates a new metadata instance.
 ArmMetricString32 newArmMetricString32(ArmMetricString32Definition definition)
          Creates a new metric instance.
 ArmMetricString32Definition newArmMetricString32Definition(ArmApplicationDefinition app, java.lang.String name, java.lang.String units, short usage, ArmID id)
          Creates a new metadata instance.
 ArmTranReportWithMetrics newArmTranReportWithMetrics(ArmApplication app, ArmTransactionWithMetricsDefinition definition, ArmMetricGroup group)
          Creates an object that represents an instance of a transaction with an ArmTranReport interface.
 ArmTransactionWithMetrics newArmTransactionWithMetrics(ArmApplication app, ArmTransactionWithMetricsDefinition definition, ArmMetricGroup group)
          Creates an object that represents an instance of a transaction.
 ArmTransactionWithMetricsDefinition newArmTransactionWithMetricsDefinition(ArmApplicationDefinition app, java.lang.String name, ArmIdentityPropertiesTransaction identityProperties, ArmMetricGroupDefinition definition, ArmID id)
          Creates an object that contains the metadata about a transaction.
 boolean setErrorCallback(ArmErrorCallback errorCallback)
          Registers an error callback for objects created through this factory.
 
Methods inherited from class org.arm4.arm40.transaction.ArmInterface
getErrorCode, getErrorMessage, getFactory, setErrorCode, setFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opengroup.arm40.transaction.ArmInterface
getErrorCode, getErrorMessage, setErrorCode
 

Field Detail

propertyKey

public static final java.lang.String propertyKey
See Also:
Constant Field Values
Constructor Detail

ArmMetricFactory

public ArmMetricFactory()
Method Detail

newArmMetricCounter32Definition

public ArmMetricCounter32Definition newArmMetricCounter32Definition(ArmApplicationDefinition app,
                                                                    java.lang.String name,
                                                                    java.lang.String units,
                                                                    short usage,
                                                                    ArmID id)
Description copied from interface: ArmMetricFactory
Creates a new metadata instance.

Specified by:
newArmMetricCounter32Definition in interface ArmMetricFactory
Parameters:
app - metadata about the containing application.
name - name for this definition.
units - units descrioption, or null.
usage - One of ArmMetricDefinition.METRIC_USE_GENERAL, ArmMetricDefinition.METRIC_USE_TRAN_SIZE, ArmMetricDefinition.METRIC_USE_TRAN_STATUS, or an application-specific negative value.
id - ID provided by the application for this metric definition, or null.
Returns:
a new metadata instance for this definition.
See Also:
ArmMetricDefinition

newArmMetricCounter64Definition

public ArmMetricCounter64Definition newArmMetricCounter64Definition(ArmApplicationDefinition app,
                                                                    java.lang.String name,
                                                                    java.lang.String units,
                                                                    short usage,
                                                                    ArmID id)
Description copied from interface: ArmMetricFactory
Creates a new metadata instance.

Specified by:
newArmMetricCounter64Definition in interface ArmMetricFactory
Parameters:
app - metadata about the containing application.
name - name for this definition.
units - units descrioption, or null.
usage - One of ArmMetricDefinition.METRIC_USE_GENERAL, ArmMetricDefinition.METRIC_USE_TRAN_SIZE, ArmMetricDefinition.METRIC_USE_TRAN_STATUS, or an application-specific negative value.
id - ID provided by the application for this metric definition, or null.
Returns:
a new metadata instance for this definition.

newArmMetricCounterFloat32Definition

public ArmMetricCounterFloat32Definition newArmMetricCounterFloat32Definition(ArmApplicationDefinition app,
                                                                              java.lang.String name,
                                                                              java.lang.String units,
                                                                              short usage,
                                                                              ArmID id)
Description copied from interface: ArmMetricFactory
Creates a new metadata instance.

Specified by:
newArmMetricCounterFloat32Definition in interface ArmMetricFactory
Parameters:
app - metadata about the containing application.
name - name for this definition.
units - units descrioption, or null.
usage - One of ArmMetricDefinition.METRIC_USE_GENERAL, ArmMetricDefinition.METRIC_USE_TRAN_SIZE, ArmMetricDefinition.METRIC_USE_TRAN_STATUS, or an application-specific negative value.
id - ID provided by the application for this metric definition, or null.
Returns:
a new metadata instance for this definition.

newArmMetricGauge32Definition

public ArmMetricGauge32Definition newArmMetricGauge32Definition(ArmApplicationDefinition app,
                                                                java.lang.String name,
                                                                java.lang.String units,
                                                                short usage,
                                                                ArmID id)
Description copied from interface: ArmMetricFactory
Creates a new metadata instance.

Specified by:
newArmMetricGauge32Definition in interface ArmMetricFactory
Parameters:
app - metadata about the containing application.
name - name for this definition.
units - units descrioption, or null.
usage - One of ArmMetricDefinition.METRIC_USE_GENERAL, ArmMetricDefinition.METRIC_USE_TRAN_SIZE, ArmMetricDefinition.METRIC_USE_TRAN_STATUS, or an application-specific negative value.
id - ID provided by the application for this metric definition, or null.
Returns:
a new metadata instance for this definition.

newArmMetricGauge64Definition

public ArmMetricGauge64Definition newArmMetricGauge64Definition(ArmApplicationDefinition app,
                                                                java.lang.String name,
                                                                java.lang.String units,
                                                                short usage,
                                                                ArmID id)
Description copied from interface: ArmMetricFactory
Creates a new metadata instance.

Specified by:
newArmMetricGauge64Definition in interface ArmMetricFactory
Parameters:
app - metadata about the containing application.
name - name for this definition.
units - units descrioption, or null.
usage - One of ArmMetricDefinition.METRIC_USE_GENERAL, ArmMetricDefinition.METRIC_USE_TRAN_SIZE, ArmMetricDefinition.METRIC_USE_TRAN_STATUS, or an application-specific negative value.
id - ID provided by the application for this metric definition, or null.
Returns:
a new metadata instance for this definition.

newArmMetricGaugeFloat32Definition

public ArmMetricGaugeFloat32Definition newArmMetricGaugeFloat32Definition(ArmApplicationDefinition app,
                                                                          java.lang.String name,
                                                                          java.lang.String units,
                                                                          short usage,
                                                                          ArmID id)
Description copied from interface: ArmMetricFactory
Creates a new metadata instance.

Specified by:
newArmMetricGaugeFloat32Definition in interface ArmMetricFactory
Parameters:
app - metadata about the containing application.
name - name for this definition.
units - units descrioption, or null.
usage - One of ArmMetricDefinition.METRIC_USE_GENERAL, ArmMetricDefinition.METRIC_USE_TRAN_SIZE, ArmMetricDefinition.METRIC_USE_TRAN_STATUS, or an application-specific negative value.
id - ID provided by the application for this metric definition, or null.
Returns:
a new metadata instance for this definition.

newArmMetricNumericId32Definition

public ArmMetricNumericId32Definition newArmMetricNumericId32Definition(ArmApplicationDefinition app,
                                                                        java.lang.String name,
                                                                        java.lang.String units,
                                                                        short usage,
                                                                        ArmID id)
Description copied from interface: ArmMetricFactory
Creates a new metadata instance.

Specified by:
newArmMetricNumericId32Definition in interface ArmMetricFactory
Parameters:
app - metadata about the containing application.
name - name for this definition.
units - units descrioption, or null.
usage - One of ArmMetricDefinition.METRIC_USE_GENERAL, ArmMetricDefinition.METRIC_USE_TRAN_SIZE, ArmMetricDefinition.METRIC_USE_TRAN_STATUS, or an application-specific negative value.
id - ID provided by the application for this metric definition, or null.
Returns:
a new metadata instance for this definition.

newArmMetricNumericId64Definition

public ArmMetricNumericId64Definition newArmMetricNumericId64Definition(ArmApplicationDefinition app,
                                                                        java.lang.String name,
                                                                        java.lang.String units,
                                                                        short usage,
                                                                        ArmID id)
Description copied from interface: ArmMetricFactory
Creates a new metadata instance.

Specified by:
newArmMetricNumericId64Definition in interface ArmMetricFactory
Parameters:
app - metadata about the containing application.
name - name for this definition.
units - units descrioption, or null.
usage - One of ArmMetricDefinition.METRIC_USE_GENERAL, ArmMetricDefinition.METRIC_USE_TRAN_SIZE, ArmMetricDefinition.METRIC_USE_TRAN_STATUS, or an application-specific negative value.
id - ID provided by the application for this metric definition, or null.
Returns:
a new metadata instance for this definition.

newArmMetricString32Definition

public ArmMetricString32Definition newArmMetricString32Definition(ArmApplicationDefinition app,
                                                                  java.lang.String name,
                                                                  java.lang.String units,
                                                                  short usage,
                                                                  ArmID id)
Description copied from interface: ArmMetricFactory
Creates a new metadata instance.

Specified by:
newArmMetricString32Definition in interface ArmMetricFactory
Parameters:
app - metadata about the containing application.
name - name for this definition.
units - units descrioption, or null.
usage - One of ArmMetricDefinition.METRIC_USE_GENERAL, ArmMetricDefinition.METRIC_USE_TRAN_SIZE, ArmMetricDefinition.METRIC_USE_TRAN_STATUS, or an application-specific negative value.
id - ID provided by the application for this metric definition, or null.
Returns:
a new metadata instance for this definition.

newArmMetricGroupDefinition

public ArmMetricGroupDefinition newArmMetricGroupDefinition(ArmMetricDefinition[] definitions)
Description copied from interface: ArmMetricFactory
Creates an ordered set of ArmMetricDefinition subclasses ready for binding to transaction definition objects.

Specified by:
newArmMetricGroupDefinition in interface ArmMetricFactory
Parameters:
definitions - An array of ArmMetricDefinition objects.

The ordering in the array is important. The array can have up to seven elements and is position-sensitive. To remain consistent with ARM 2.0, any ArmMetricDefinition subclass except ArmMetricString32Definition can be assigned to elements 0:5 and only ArmMetricString32Definition can be assigned to element 6.

Any element can be null. If the input array has fewer than seven elements, the rest of the elements are assigned a value of null. The array can be sparsely populated. For example, there can be a non-null ArmMetricDefinition reference in element 0 and 6, and null references in elements 1:5.

Returns:
a new metadata instance for the metric definition group.

newArmTransactionWithMetricsDefinition

public ArmTransactionWithMetricsDefinition newArmTransactionWithMetricsDefinition(ArmApplicationDefinition app,
                                                                                  java.lang.String name,
                                                                                  ArmIdentityPropertiesTransaction identityProperties,
                                                                                  ArmMetricGroupDefinition definition,
                                                                                  ArmID id)
Description copied from interface: ArmMetricFactory
Creates an object that contains the metadata about a transaction. Details about the metadata are found in the ArmTransactionDefinition section. In addition, a binding to a set of metadata about metrics is added via an ArmMetricGroupDefinition object.

Specified by:
newArmTransactionWithMetricsDefinition in interface ArmMetricFactory
Parameters:
app - metadata about the containing application.
name - name for this definition.
identityProperties - an initialized set of identity properties.
definition - the metric definitions to be used with this transaction.
id - ID provided by the application for this transaction definition, or null.
Returns:
a new metadata instance for a transaction associated with metrics.

newArmMetricCounter32

public ArmMetricCounter32 newArmMetricCounter32(ArmMetricCounter32Definition definition)
Description copied from interface: ArmMetricFactory
Creates a new metric instance.

Specified by:
newArmMetricCounter32 in interface ArmMetricFactory
Parameters:
definition - the metadata describing this metric.
Returns:
a new metric instance.

newArmMetricCounter64

public ArmMetricCounter64 newArmMetricCounter64(ArmMetricCounter64Definition definition)
Description copied from interface: ArmMetricFactory
Creates a new metric instance.

Specified by:
newArmMetricCounter64 in interface ArmMetricFactory
Parameters:
definition - the metadata describing this metric.
Returns:
a new metric instance.

newArmMetricCounterFloat32

public ArmMetricCounterFloat32 newArmMetricCounterFloat32(ArmMetricCounterFloat32Definition definition)
Description copied from interface: ArmMetricFactory
Creates a new metric instance.

Specified by:
newArmMetricCounterFloat32 in interface ArmMetricFactory
Parameters:
definition - the metadata describing this metric.
Returns:
a new metric instance.

newArmMetricGauge32

public ArmMetricGauge32 newArmMetricGauge32(ArmMetricGauge32Definition definition)
Description copied from interface: ArmMetricFactory
Creates a new metric instance.

Specified by:
newArmMetricGauge32 in interface ArmMetricFactory
Parameters:
definition - the metadata describing this metric.
Returns:
a new metric instance.

newArmMetricGauge64

public ArmMetricGauge64 newArmMetricGauge64(ArmMetricGauge64Definition definition)
Description copied from interface: ArmMetricFactory
Creates a new metric instance.

Specified by:
newArmMetricGauge64 in interface ArmMetricFactory
Parameters:
definition - the metadata describing this metric.
Returns:
a new metric instance.

newArmMetricGaugeFloat32

public ArmMetricGaugeFloat32 newArmMetricGaugeFloat32(ArmMetricGaugeFloat32Definition definition)
Description copied from interface: ArmMetricFactory
Creates a new metric instance.

Specified by:
newArmMetricGaugeFloat32 in interface ArmMetricFactory
Parameters:
definition - the metadata describing this metric.
Returns:
a new metric instance.

newArmMetricNumericId32

public ArmMetricNumericId32 newArmMetricNumericId32(ArmMetricNumericId32Definition definition)
Description copied from interface: ArmMetricFactory
Creates a new metric instance.

Specified by:
newArmMetricNumericId32 in interface ArmMetricFactory
Parameters:
definition - the metadata describing this metric.
Returns:
a new metric instance.

newArmMetricNumericId64

public ArmMetricNumericId64 newArmMetricNumericId64(ArmMetricNumericId64Definition definition)
Description copied from interface: ArmMetricFactory
Creates a new metric instance.

Specified by:
newArmMetricNumericId64 in interface ArmMetricFactory
Parameters:
definition - the metadata describing this metric.
Returns:
a new metric instance.

newArmMetricString32

public ArmMetricString32 newArmMetricString32(ArmMetricString32Definition definition)
Description copied from interface: ArmMetricFactory
Creates a new metric instance.

Specified by:
newArmMetricString32 in interface ArmMetricFactory
Parameters:
definition - the metadata describing this metric.
Returns:
a new metric instance.

newArmMetricGroup

public ArmMetricGroup newArmMetricGroup(ArmMetricGroupDefinition groupDefinition,
                                        ArmMetric[] metrics)
Description copied from interface: ArmMetricFactory
Creates an ordered set of ArmMetric subclasses ready for binding to transaction objects.

Specified by:
newArmMetricGroup in interface ArmMetricFactory
Parameters:
groupDefinition - metadata object describing the metrics provided through the metrics parameter.
metrics - an array of ArmMetric objects.

The ordering in the array is important. The array can have up to seven elements and is position-sensitive. To remain consistent with ARM 2.0, any ArmMetric subclass except ArmMetricString32 can be assigned to elements 0:5 and only ArmMetricString32 can be assigned to element 6. The ArmMetricDefinition objects associated with each ArmMetric object must have the exact same values as the ArmMetricDefinition objects associated with the ArmMetricGroupDefinition object (they will often be the same objects, though this is not mandatory).

Any element can be null. If the input array has fewer than seven elements, the rest of the elements are assigned a value of null. The array can be sparsely populated. For example, there can be a non-null ArmMetric reference in element 0 and 6, and null references in elements 1:5.

Returns:
a new metric group instance.

newArmTranReportWithMetrics

public ArmTranReportWithMetrics newArmTranReportWithMetrics(ArmApplication app,
                                                            ArmTransactionWithMetricsDefinition definition,
                                                            ArmMetricGroup group)
Description copied from interface: ArmMetricFactory
Creates an object that represents an instance of a transaction with an ArmTranReport interface.

Specified by:
newArmTranReportWithMetrics in interface ArmMetricFactory
Parameters:
app - instance of the containing application (scope).
definition - metadata about the transaction.
group - metrics binding object.

If the metric group reference is null, the resulting ArmTranReportWithMetrics has no metrics, so it would have no more functions than an ArmTranReport object, except to return null to the ArmTranReportWithMetrics.getMetricGroup() method.

Returns:
a new transaction instance associated with metrics.

newArmTransactionWithMetrics

public ArmTransactionWithMetrics newArmTransactionWithMetrics(ArmApplication app,
                                                              ArmTransactionWithMetricsDefinition definition,
                                                              ArmMetricGroup group)
Description copied from interface: ArmMetricFactory
Creates an object that represents an instance of a transaction.

Specified by:
newArmTransactionWithMetrics in interface ArmMetricFactory
Parameters:
app - instance of the containing application (scope).
definition - metadata about the transaction.
group - metrics binding object.

If the metric group reference is null, the resulting ArmTranReportWithMetrics has no metrics, so it would have no more functions than an ArmTranReport object, except to return null to the ArmTranReportWithMetrics.getMetricGroup() method.

Returns:
a new transaction instance associated with metrics.

setErrorCallback

public boolean setErrorCallback(ArmErrorCallback errorCallback)
Description copied from interface: ArmMetricFactory
Registers an error callback for objects created through this factory. See the error handling philosophy comment in the description of ArmTransactionFactory.

Specified by:
setErrorCallback in interface ArmMetricFactory
Overrides:
setErrorCallback in class ArmFactory
Parameters:
errorCallback - an application object implementing the ArmErrorCallback> interface.
Returns:
true if registration is accepted.
See Also:
ArmTransactionFactory.setErrorCallback(org.opengroup.arm40.transaction.ArmErrorCallback)