org.apache.qpid.management.domain.model
Class QpidEvent

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by org.apache.qpid.management.domain.model.QpidEntity
          extended by org.apache.qpid.management.domain.model.QpidEvent
All Implemented Interfaces:
NotificationBroadcaster, NotificationEmitter, QpidEventMBean

 class QpidEvent
extends QpidEntity
implements QpidEventMBean

Qpid event definition.


Nested Class Summary
(package private)  class QpidEvent.QManManagedEvent
          MBean used for representing remote broker object instances.
(package private) static interface QpidEvent.State
          State interface for this event definition.
 
Nested classes/interfaces inherited from class org.apache.qpid.management.domain.model.QpidEntity
QpidEntity.QManManagedEntity
 
Field Summary
(package private)  Map<String,QpidProperty> _arguments
           
(package private)  List<QpidEvent.QManManagedEvent> _eventInstances
           
(package private)  QpidEvent.State _schemaInjected
          After a schema is built into this definition this is the current state of the class.
(package private)  QpidEvent.State _schemaNotRequested
          This is the initial state of every qpid class.
(package private)  QpidEvent.State _schemaRequestedButNotYetInjected
          This is the first state of this class definition : the schema is not yet injected so each injection of object data will be retained in raw format.
(package private)  QpidEvent.State _state
           
(package private) static String SEVERITY_ATTR_NAME
           
(package private) static String TIMESTAMP_ATTR_NAME
           
 
Fields inherited from class org.apache.qpid.management.domain.model.QpidEntity
_hash, _logger, _metadata, _name, _objectName, _parent, _service, JMX_SERVICE
 
Constructor Summary
QpidEvent(String eventClassName, Binary hash, QpidPackage parentPackage)
          Builds a new class with the given name and package as parent.
 
Method Summary
(package private)  void addEventData(byte[] rawData, long currentTimestamp, int severity)
          Adds the configuration data for the object instance associated to the given object identifier.
(package private)  void buildArguments(List<Map<String,Object>> arguments, MBeanAttributeInfo[] attributes)
          Internal method used for building attributes definitions.
(package private)  QpidEvent.QManManagedEvent createEventInstance(byte[] data, long timestamp, int severity)
          Returns the object instance associated to the given identifier.
(package private)  boolean hasNoInstances()
          Checks if this event definition contains event instance(s).
(package private)  void releaseResources()
          Deregisters all the object instances and release all previously acquired resources.
(package private)  void setSchema(List<Map<String,Object>> argumentDefinitions)
          Sets the schema for this class definition.
 String toString()
           
(package private)  void updateEventInstanceWithData(QpidEvent.QManManagedEvent instance)
          Updates the given obejct instance with the given incoming configuration data.
 
Methods inherited from class org.apache.qpid.management.domain.model.QpidEntity
getName, getPackageName, requestSchema
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.qpid.management.domain.model.QpidEventMBean
getName, getPackageName
 

Field Detail

_schemaNotRequested

final QpidEvent.State _schemaNotRequested
This is the initial state of every qpid class. The class definition instance is created but its schema has not been injected. Incoming configuration & instrumentation data will be stored in raw format because we don't know how to parse it until the schema arrives. In addition, this state is responsible (when data arrives) to request its schema.


_schemaRequestedButNotYetInjected

final QpidEvent.State _schemaRequestedButNotYetInjected
This is the first state of this class definition : the schema is not yet injected so each injection of object data will be retained in raw format.


_schemaInjected

final QpidEvent.State _schemaInjected
After a schema is built into this definition this is the current state of the class.


SEVERITY_ATTR_NAME

static final String SEVERITY_ATTR_NAME
See Also:
Constant Field Values

TIMESTAMP_ATTR_NAME

static final String TIMESTAMP_ATTR_NAME
See Also:
Constant Field Values

_arguments

Map<String,QpidProperty> _arguments

_eventInstances

List<QpidEvent.QManManagedEvent> _eventInstances

_state

QpidEvent.State _state
Constructor Detail

QpidEvent

QpidEvent(String eventClassName,
          Binary hash,
          QpidPackage parentPackage)
Builds a new class with the given name and package as parent.

Parameters:
className - the name of the class.
hash - the class schema hash.
parentPackage - the parent of this class.
Method Detail

addEventData

void addEventData(byte[] rawData,
                  long currentTimestamp,
                  int severity)
Adds the configuration data for the object instance associated to the given object identifier.

Parameters:
objectId - the object identifier.
rawData - the raw configuration data.

setSchema

void setSchema(List<Map<String,Object>> argumentDefinitions)
         throws UnableToBuildFeatureException
Sets the schema for this class definition. A schema is basically a metadata description of all properties, statistics, methods and events of this class.

Parameters:
propertyDefinitions - properties metadata.
statisticDefinitions - statistics metadata.
methodDefinitions - methods metadata.
Throws:
UnableToBuildFeatureException - when some error occurs while parsing the incoming schema.

buildArguments

void buildArguments(List<Map<String,Object>> arguments,
                    MBeanAttributeInfo[] attributes)
              throws UnableToBuildFeatureException
Internal method used for building attributes definitions.

Parameters:
props - the map contained in the properties schema.
stats - the map contained in the statistics schema.
attributes - the management metadata for attributes.
Throws:
UnableToBuildFeatureException - when it's not possibile to build one attribute definition.

createEventInstance

QpidEvent.QManManagedEvent createEventInstance(byte[] data,
                                               long timestamp,
                                               int severity)
Returns the object instance associated to the given identifier. Note that if the identifier is not associated to any obejct instance, a new one will be created.

Parameters:
objectId - the object identifier.
registration - a flag indicating whenever the (new ) instance must be registered with MBean server.
Returns:
the object instance associated to the given identifier.

updateEventInstanceWithData

void updateEventInstanceWithData(QpidEvent.QManManagedEvent instance)
Updates the given obejct instance with the given incoming configuration data.

Parameters:
instance - the managed object instance.
rawData - the incoming configuration data which contains new values for instance properties.

toString

public String toString()
Overrides:
toString in class Object

releaseResources

void releaseResources()
Deregisters all the object instances and release all previously acquired resources.


hasNoInstances

boolean hasNoInstances()
Checks if this event definition contains event instance(s).

Returns:
true if there is one or more managed instances.


Licensed to the Apache Software Foundation