org.apache.servicemix.components.jmx
Class CounterMonitorComponent

java.lang.Object
  extended by org.apache.servicemix.jbi.management.BaseLifeCycle
      extended by org.apache.servicemix.components.util.PojoSupport
          extended by org.apache.servicemix.components.util.ComponentSupport
              extended by org.apache.servicemix.components.jmx.CounterMonitorComponent
All Implemented Interfaces:
EventListener, javax.jbi.component.Component, javax.jbi.component.ComponentLifeCycle, javax.jbi.management.LifeCycleMBean, NotificationListener, org.apache.servicemix.jbi.listener.MessageExchangeListener, MBeanInfoProvider

public class CounterMonitorComponent
extends ComponentSupport
implements NotificationListener, MessageExchangeListener

A JMX Counter Monitor as a Component to enable firing notifications

Version:
$Revision: 2153 $

Field Summary
 
Fields inherited from class org.apache.servicemix.components.util.PojoSupport
logger
 
Fields inherited from class org.apache.servicemix.jbi.management.BaseLifeCycle
currentState, INITIALIZED, listener
 
Fields inherited from interface javax.jbi.management.LifeCycleMBean
SHUTDOWN, STARTED, STOPPED, UNKNOWN
 
Constructor Summary
CounterMonitorComponent()
           
 
Method Summary
 String getAttributeName()
           
 CounterMonitor getCounterMonitor()
           
 long getGranularityPeriod()
           
 MBeanServer getMbeanServer()
           
 String getName()
          Get the name of the item
 String getObservedObjectName()
           
 Number getOffset()
           
 Number getThreshold()
           
 void handleNotification(Notification notification, Object arg1)
           
 void init(javax.jbi.component.ComponentContext cc)
          Called when the Component is initialized
 void onMessageExchange(javax.jbi.messaging.MessageExchange exchange)
           
 void setAttributeName(String attributeName)
           
 void setCounterMonitor(CounterMonitor counterMonitor)
           
 void setGranularityPeriod(long granularityPeriod)
           
 void setMbeanServer(MBeanServer mbeanServer)
           
 void setName(String name)
           
 void setObservedObjectName(String observedObjectName)
           
 void setOffset(Number offset)
           
 void setThreshold(Number threshold)
           
 void shutDown()
          Shut down the item.
 void start()
          Start the item.
 void stop()
          Stop the item.
protected  void validate()
           
 
Methods inherited from class org.apache.servicemix.components.util.ComponentSupport
createComponentLifeCycle, createInOnlyExchange, createInOnlyExchange, createInOnlyExchange, createInOptionalOutExchange, createInOutExchange, createInOutExchange, createRobustInOnlyExchange, createServiceUnitManager, creatInOutExchange, forwardToExchange, forwardToExchange, getInMessage, getLifeCycle, getMessageTransformer, getServiceDescription, getServiceUnitManager, initializeServiceUnitManager, invoke, isExchangeWithConsumerOkay, isExchangeWithProviderOkay, propagateCorrelationId, resolveEndpointReference, setMessageTransformer
 
Methods inherited from class org.apache.servicemix.components.util.PojoSupport
answer, done, fail, fail, getBody, getContext, getDeliveryChannel, getDescription, getEndpoint, getExchangeFactory, getExtensionMBeanName, getService, init, isInAndOut, send, sendSync, sendSync, setBody, setEndpoint, setExtensionMBeanName, setService
 
Methods inherited from class org.apache.servicemix.jbi.management.BaseLifeCycle
firePropertyChanged, getAttributeInfos, getCurrentState, getObjectToManage, getOperationInfos, getSubType, getType, isInitialized, isShutDown, isStarted, isStopped, isUnknown, setCurrentState, setPropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CounterMonitorComponent

public CounterMonitorComponent()
Method Detail

init

public void init(javax.jbi.component.ComponentContext cc)
          throws javax.jbi.JBIException
Called when the Component is initialized

Specified by:
init in interface javax.jbi.component.ComponentLifeCycle
Overrides:
init in class PojoSupport
Parameters:
cc -
Throws:
javax.jbi.JBIException

start

public void start()
           throws javax.jbi.JBIException
Start the item.

Specified by:
start in interface javax.jbi.component.ComponentLifeCycle
Specified by:
start in interface javax.jbi.management.LifeCycleMBean
Overrides:
start in class BaseLifeCycle
Throws:
javax.jbi.JBIException - if the item fails to start.

stop

public void stop()
          throws javax.jbi.JBIException
Stop the item. This suspends current messaging activities.

Specified by:
stop in interface javax.jbi.component.ComponentLifeCycle
Specified by:
stop in interface javax.jbi.management.LifeCycleMBean
Overrides:
stop in class BaseLifeCycle
Throws:
javax.jbi.JBIException - if the item fails to stop.

shutDown

public void shutDown()
              throws javax.jbi.JBIException
Shut down the item. The releases resources, preparatory to uninstallation.

Specified by:
shutDown in interface javax.jbi.component.ComponentLifeCycle
Specified by:
shutDown in interface javax.jbi.management.LifeCycleMBean
Overrides:
shutDown in class PojoSupport
Throws:
javax.jbi.JBIException - if the item fails to shut down.

handleNotification

public void handleNotification(Notification notification,
                               Object arg1)
Specified by:
handleNotification in interface NotificationListener
See Also:
NotificationListener.handleNotification(javax.management.Notification, java.lang.Object)

validate

protected void validate()
                 throws javax.jbi.JBIException
Throws:
javax.jbi.JBIException

getAttributeName

public String getAttributeName()
Returns:
Returns the attributeName.

setAttributeName

public void setAttributeName(String attributeName)
Parameters:
attributeName - The attributeName to set.

getCounterMonitor

public CounterMonitor getCounterMonitor()
Returns:
Returns the counterMonitor.

setCounterMonitor

public void setCounterMonitor(CounterMonitor counterMonitor)
Parameters:
counterMonitor - The counterMonitor to set.

getGranularityPeriod

public long getGranularityPeriod()
Returns:
Returns the granularityPeriod.

setGranularityPeriod

public void setGranularityPeriod(long granularityPeriod)
Parameters:
granularityPeriod - The granularityPeriod to set.

getMbeanServer

public MBeanServer getMbeanServer()
Returns:
Returns the mbeanServer.

setMbeanServer

public void setMbeanServer(MBeanServer mbeanServer)
Parameters:
mbeanServer - The mbeanServer to set.

getName

public String getName()
Description copied from class: BaseLifeCycle
Get the name of the item

Specified by:
getName in interface MBeanInfoProvider
Overrides:
getName in class BaseLifeCycle
Returns:
Returns the name.

setName

public void setName(String name)
Parameters:
name - The name to set.

getObservedObjectName

public String getObservedObjectName()
Returns:
Returns the observedObjectName.

setObservedObjectName

public void setObservedObjectName(String observedObjectName)
Parameters:
observedObjectName - The observedObjectName to set.

getOffset

public Number getOffset()
Returns:
Returns the offset.

setOffset

public void setOffset(Number offset)
Parameters:
offset - The offset to set.

getThreshold

public Number getThreshold()
Returns:
Returns the threshold.

setThreshold

public void setThreshold(Number threshold)
Parameters:
threshold - The threshold to set.

onMessageExchange

public void onMessageExchange(javax.jbi.messaging.MessageExchange exchange)
                       throws javax.jbi.messaging.MessagingException
Specified by:
onMessageExchange in interface org.apache.servicemix.jbi.listener.MessageExchangeListener
Throws:
javax.jbi.messaging.MessagingException


Copyright © 2005-2010 The Apache Software Foundation. All Rights Reserved.