org.ow2.petals.jbi.messaging.routing.monitoring
Class RouterMonitorServiceImpl

java.lang.Object
  extended by org.ow2.petals.jbi.messaging.routing.monitoring.RouterMonitorServiceImpl
All Implemented Interfaces:
SenderModule, RouterMonitorMBean, RouterMonitorService, org.ow2.petals.jmx.api.IPetalsMonitoringService

public class RouterMonitorServiceImpl
extends java.lang.Object
implements RouterMonitorService, SenderModule

The NMR monitor service.

Since:
3.1
Author:
rnaudin

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.ow2.petals.jmx.api.IPetalsMonitoringService
org.ow2.petals.jmx.api.IPetalsMonitoringService.Event, org.ow2.petals.jmx.api.IPetalsMonitoringService.EventType, org.ow2.petals.jmx.api.IPetalsMonitoringService.Exchange, org.ow2.petals.jmx.api.IPetalsMonitoringService.MEP, org.ow2.petals.jmx.api.IPetalsMonitoringService.NormalizedMessage, org.ow2.petals.jmx.api.IPetalsMonitoringService.NormalizedMessageType, org.ow2.petals.jmx.api.IPetalsMonitoringService.Role, org.ow2.petals.jmx.api.IPetalsMonitoringService.RouterMonitor, org.ow2.petals.jmx.api.IPetalsMonitoringService.Status
 
Constructor Summary
RouterMonitorServiceImpl()
           
 
Method Summary
 void clearMonitorStorage()
          Clear the monitor storage.The persisted data related to the monitored exchanges are deleted.
 void electEndpoints(java.util.Map<ServiceEndpoint,TransportSendContext> electedEndpoints, ComponentContext sourceComponentContext, org.ow2.petals.jbi.messaging.exchange.MessageExchangeWrapper exchangeDecorator)
          Elect a list of candidate endpoints to be destination of the exchange.
 void exchangeReceived(org.ow2.petals.jbi.messaging.exchange.MessageExchangeWrapper exchangeDecorator)
           
 void exchangeSent(org.ow2.petals.jbi.messaging.exchange.MessageExchangeWrapper exchangeDecorator)
           
 java.util.Map<java.lang.String,java.lang.String> getExchange(java.lang.String exchangeId)
          Get the exchange with the given exchange Id.
 java.util.Map<java.lang.String,java.lang.Long> getExchangeHistory(java.lang.String exchangeId)
          Get the history of the given exchange.
 java.util.List<java.lang.String> getExchangeIds(javax.xml.namespace.QName interfaceName, javax.xml.namespace.QName serviceName, java.lang.String endpointName, javax.xml.namespace.QName operationName, long startDate, long endDate)
          Get the list of exchange Ids that has been sent or received at least once, matching the given criteria and the exchange persistence duration.
 java.util.List<java.lang.String> getExchangeIds(java.lang.String propertyKey, java.lang.String propertyValue)
          Get the list of exchange Ids that has been sent or received at least once, matching the given exchange property and the exchange persistence duration.
 int getExchanges(javax.xml.namespace.QName interfaceName, javax.xml.namespace.QName serviceName, java.lang.String endpointName, javax.xml.namespace.QName operationName, long startDate, long endDate)
          Get the number of exchange that has been sent or received at least once and matching the duration.
 java.util.List<java.util.Map<java.lang.String,java.lang.String>> getMonitoredExchanges()
          Get the list of Router Monitor filter.
 long getMonitorStorageDuration()
          Get the duration of the monitoring storage.
 void monitorExchanges(javax.xml.namespace.QName interfaceName, javax.xml.namespace.QName serviceName, java.lang.String endpointName, javax.xml.namespace.QName operationName, boolean storeExchanges)
          Activate the monitoring of the exchanges matching the given criteria.
 void setMonitorStorageDuration(long duration)
          Set the duration of the monitoring storage.
protected  void start()
          Start the Fractal component
protected  void stop()
          Stop the Fractal component
 void unmonitorExchanges(javax.xml.namespace.QName interfaceName, javax.xml.namespace.QName serviceName, java.lang.String endpointName, javax.xml.namespace.QName operationName)
          Deactivate the monitoring of the exchanges matching the given criteria.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RouterMonitorServiceImpl

public RouterMonitorServiceImpl()
Method Detail

clearMonitorStorage

public void clearMonitorStorage()
Description copied from interface: RouterMonitorMBean
Clear the monitor storage.The persisted data related to the monitored exchanges are deleted.

Specified by:
clearMonitorStorage in interface RouterMonitorMBean

electEndpoints

public void electEndpoints(java.util.Map<ServiceEndpoint,TransportSendContext> electedEndpoints,
                           ComponentContext sourceComponentContext,
                           org.ow2.petals.jbi.messaging.exchange.MessageExchangeWrapper exchangeDecorator)
                    throws RoutingException
Description copied from interface: SenderModule
Elect a list of candidate endpoints to be destination of the exchange.

Specified by:
electEndpoints in interface SenderModule
exchangeDecorator - the exchange decorator to send
Throws:
RoutingException

exchangeReceived

public void exchangeReceived(org.ow2.petals.jbi.messaging.exchange.MessageExchangeWrapper exchangeDecorator)
Specified by:
exchangeReceived in interface RouterMonitorService

exchangeSent

public void exchangeSent(org.ow2.petals.jbi.messaging.exchange.MessageExchangeWrapper exchangeDecorator)
Specified by:
exchangeSent in interface RouterMonitorService

getExchange

public java.util.Map<java.lang.String,java.lang.String> getExchange(java.lang.String exchangeId)
                                                             throws javax.jbi.messaging.MessagingException
Description copied from interface: RouterMonitorMBean
Get the exchange with the given exchange Id.

Specified by:
getExchange in interface RouterMonitorMBean
Returns:
The exchange in a key/value form
Throws:
javax.jbi.messaging.MessagingException - Failed to retrieve the exchange

getExchangeHistory

public java.util.Map<java.lang.String,java.lang.Long> getExchangeHistory(java.lang.String exchangeId)
                                                                  throws javax.jbi.messaging.MessagingException
Description copied from interface: RouterMonitorMBean
Get the history of the given exchange.

Specified by:
getExchangeHistory in interface RouterMonitorMBean
Parameters:
exchangeId - the send/received history
Returns:
Throws:
javax.jbi.messaging.MessagingException - Failed to retrieve the exchange history

getExchangeIds

public java.util.List<java.lang.String> getExchangeIds(javax.xml.namespace.QName interfaceName,
                                                       javax.xml.namespace.QName serviceName,
                                                       java.lang.String endpointName,
                                                       javax.xml.namespace.QName operationName,
                                                       long startDate,
                                                       long endDate)
                                                throws javax.jbi.messaging.MessagingException
Description copied from interface: RouterMonitorMBean
Get the list of exchange Ids that has been sent or received at least once, matching the given criteria and the exchange persistence duration.

Specified by:
getExchangeIds in interface RouterMonitorMBean
Parameters:
interfaceName - The interface name that exchange targets. Can be null
serviceName - The service name that exchange targets. Can be null
endpointName - The endpoint name that exchange targets. Can be null
operationName - The operation name that exchange targets. Can be null
startDate - the start date
endDate - the end date
Returns:
the list of the exchange Ids
Throws:
javax.jbi.messaging.MessagingException - Failed to retrieve the list of exchange Ids

getExchangeIds

public java.util.List<java.lang.String> getExchangeIds(java.lang.String propertyKey,
                                                       java.lang.String propertyValue)
                                                throws javax.jbi.messaging.MessagingException
Description copied from interface: RouterMonitorMBean
Get the list of exchange Ids that has been sent or received at least once, matching the given exchange property and the exchange persistence duration.

Specified by:
getExchangeIds in interface RouterMonitorMBean
Parameters:
propertyKey - The name of the property
propertyValue - The value of the property as a String
Returns:
the list of the exchange Ids
Throws:
javax.jbi.messaging.MessagingException - Failed to retrieve the list of exchange Ids

getExchanges

public int getExchanges(javax.xml.namespace.QName interfaceName,
                        javax.xml.namespace.QName serviceName,
                        java.lang.String endpointName,
                        javax.xml.namespace.QName operationName,
                        long startDate,
                        long endDate)
                 throws javax.jbi.messaging.MessagingException
Description copied from interface: RouterMonitorMBean
Get the number of exchange that has been sent or received at least once and matching the duration.

Specified by:
getExchanges in interface RouterMonitorMBean
Parameters:
interfaceName - The interface name that exchange targets. Can be null
serviceName - The service name that exchange targets. Can be null
endpointName - The endpoint name that exchange targets. Can be null
operationName - The operation name that exchange targets. Can be null
startDate - the start date
endDate - the end date
Returns:
the list of the exchange Ids
Throws:
javax.jbi.messaging.MessagingException - Failed to retrieve the list of exchange Ids

getMonitoredExchanges

public java.util.List<java.util.Map<java.lang.String,java.lang.String>> getMonitoredExchanges()
Description copied from interface: RouterMonitorMBean
Get the list of Router Monitor filter.

Specified by:
getMonitoredExchanges in interface RouterMonitorMBean
Returns:
the list of Router Monitor filter in key/values form.

getMonitorStorageDuration

public long getMonitorStorageDuration()
Description copied from interface: RouterMonitorMBean
Get the duration of the monitoring storage. Once the duration is reached, the persisted data related to the monitored exchange are deleted.

Specified by:
getMonitorStorageDuration in interface RouterMonitorMBean

monitorExchanges

public void monitorExchanges(javax.xml.namespace.QName interfaceName,
                             javax.xml.namespace.QName serviceName,
                             java.lang.String endpointName,
                             javax.xml.namespace.QName operationName,
                             boolean storeExchanges)
                      throws javax.jbi.messaging.MessagingException
Description copied from interface: RouterMonitorMBean
Activate the monitoring of the exchanges matching the given criteria.

Specified by:
monitorExchanges in interface RouterMonitorMBean
Parameters:
interfaceName - The interface name that exchange targets. Can be null
serviceName - The service name that exchange targets. Can be null
endpointName - The endpoint name that exchange targets. Can be null
operationName - The operation name that exchange targets. Can be null
storeExchanges - if true, the exchanges are stored in the Persistence Service.
Throws:
javax.jbi.messaging.MessagingException - A Router Monitor filter already exists on these criteria

setMonitorStorageDuration

public void setMonitorStorageDuration(long duration)
Description copied from interface: RouterMonitorMBean
Set the duration of the monitoring storage. Once the duration is reached, the persisted data related to the monitored exchange are deleted.

Specified by:
setMonitorStorageDuration in interface RouterMonitorMBean
Parameters:
duration - The duration in millisecond

unmonitorExchanges

public void unmonitorExchanges(javax.xml.namespace.QName interfaceName,
                               javax.xml.namespace.QName serviceName,
                               java.lang.String endpointName,
                               javax.xml.namespace.QName operationName)
                        throws javax.jbi.messaging.MessagingException
Description copied from interface: RouterMonitorMBean
Deactivate the monitoring of the exchanges matching the given criteria.

Specified by:
unmonitorExchanges in interface RouterMonitorMBean
Parameters:
interfaceName - The interface name that exchange targets. Can be null
endpointName - The endpoint name that exchange targets. Can be null
operationName - The operation name that exchange targets. Can be null
Throws:
javax.jbi.messaging.MessagingException - No Router Monitor filter activated on the given criteria

start

protected void start()
Start the Fractal component

Throws:
RoutingException

stop

protected void stop()
Stop the Fractal component



Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.