org.fusesource.fabric.camel.facade
Class CamelFacadeSupport

java.lang.Object
  extended by org.fusesource.fabric.camel.facade.CamelFacadeSupport
All Implemented Interfaces:
CamelFacade
Direct Known Subclasses:
LocalCamelFacade, RemoteJMXCamelFacade

public abstract class CamelFacadeSupport
extends java.lang.Object
implements CamelFacade

Common facade support for both local and remote.

This implementation will provide most implementation supports as it turns out that both the local and remote CamelContext will use the JMX API to gather information.


Field Summary
protected  java.lang.String camelContextManagementName
           
protected  javax.management.MBeanServerConnection mBeanServer
           
 
Constructor Summary
protected CamelFacadeSupport(java.lang.String camelContextManagementName, javax.management.MBeanServerConnection mBeanServer)
           
 
Method Summary
static
<T> T
addGetId(java.lang.Class<T> ic, java.lang.Object target, java.lang.String id)
           
 java.lang.String dumpRoutesStatsAsXml(java.lang.String managementName)
          Dumps the performance statistics of all the routes for the given CamelContext, as XML
protected  java.util.Set<javax.management.ObjectName> findCamelContexts(javax.management.MBeanServerConnection connection, java.lang.String managementName)
          Finds all CamelContext's registered on a certain JMX-Server or, if a JMX-BrokerName has been set, the broker with that name.
 CamelContextMBean getCamelContext(java.lang.String managementName)
          Gets the CamelContext
 java.util.List<CamelContextMBean> getCamelContexts()
          Gets all the CamelContexts in the JVM
 java.util.List<CamelComponentMBean> getComponents(java.lang.String managementName)
          Gets all the components of the given CamelContext
 java.util.List<CamelConsumerMBean> getConsumers(java.lang.String managementName)
          Gets all the consumers of the given CamelContext
 java.util.List<CamelEndpointMBean> getEndpoints(java.lang.String managementName)
          Gets all the endpoints of the given CamelContext
 CamelFabricTracerMBean getFabricTracer(java.lang.String managementName)
          Gets the fabric tracer
protected  javax.management.MBeanServerConnection getMBeanServerConnection()
           
 java.util.List<CamelProcessorMBean> getProcessors(java.lang.String managementName)
          Gets all the processors of the given CamelContext
 java.util.List<CamelRouteMBean> getRoutes(java.lang.String managementName)
          Gets all the routes of the given CamelContext
 java.util.List<CamelThreadPoolMBean> getThreadPools(java.lang.String managementName)
          Gets all the thread pools created and managed by the given CamelContext
protected  java.lang.Object newProxyInstance(javax.management.ObjectName objectName, java.lang.Class interfaceClass, boolean notificationBroadcaster)
           
protected  java.util.Set<javax.management.ObjectInstance> queryNames(javax.management.ObjectName name, javax.management.QueryExp query)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

camelContextManagementName

protected java.lang.String camelContextManagementName

mBeanServer

protected final javax.management.MBeanServerConnection mBeanServer
Constructor Detail

CamelFacadeSupport

protected CamelFacadeSupport(java.lang.String camelContextManagementName,
                             javax.management.MBeanServerConnection mBeanServer)
                      throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

getMBeanServerConnection

protected javax.management.MBeanServerConnection getMBeanServerConnection()
                                                                   throws java.lang.Exception
Throws:
java.lang.Exception

queryNames

protected java.util.Set<javax.management.ObjectInstance> queryNames(javax.management.ObjectName name,
                                                                    javax.management.QueryExp query)
                                                             throws java.lang.Exception
Throws:
java.lang.Exception

addGetId

public static <T> T addGetId(java.lang.Class<T> ic,
                             java.lang.Object target,
                             java.lang.String id)
                  throws java.lang.Exception
Throws:
java.lang.Exception

newProxyInstance

protected java.lang.Object newProxyInstance(javax.management.ObjectName objectName,
                                            java.lang.Class interfaceClass,
                                            boolean notificationBroadcaster)
                                     throws java.lang.Exception
Throws:
java.lang.Exception

findCamelContexts

protected java.util.Set<javax.management.ObjectName> findCamelContexts(javax.management.MBeanServerConnection connection,
                                                                       java.lang.String managementName)
                                                                throws java.lang.Exception
Finds all CamelContext's registered on a certain JMX-Server or, if a JMX-BrokerName has been set, the broker with that name.

Parameters:
connection - not null
managementName - to find a specific context by its management name
Returns:
Set with ObjectName-elements
Throws:
java.lang.Exception

getCamelContexts

public java.util.List<CamelContextMBean> getCamelContexts()
                                                   throws java.lang.Exception
Description copied from interface: CamelFacade
Gets all the CamelContexts in the JVM

Specified by:
getCamelContexts in interface CamelFacade
Throws:
java.lang.Exception

getCamelContext

public CamelContextMBean getCamelContext(java.lang.String managementName)
                                  throws java.lang.Exception
Description copied from interface: CamelFacade
Gets the CamelContext

Specified by:
getCamelContext in interface CamelFacade
Parameters:
managementName - the camel context management name (not context id)
Throws:
java.lang.Exception

getFabricTracer

public CamelFabricTracerMBean getFabricTracer(java.lang.String managementName)
                                       throws java.lang.Exception
Description copied from interface: CamelFacade
Gets the fabric tracer

Specified by:
getFabricTracer in interface CamelFacade
Parameters:
managementName - the camel context management name (not context id)
Throws:
java.lang.Exception

getComponents

public java.util.List<CamelComponentMBean> getComponents(java.lang.String managementName)
                                                  throws java.lang.Exception
Description copied from interface: CamelFacade
Gets all the components of the given CamelContext

Specified by:
getComponents in interface CamelFacade
Parameters:
managementName - the camel context management name (not context id)
Throws:
java.lang.Exception

getRoutes

public java.util.List<CamelRouteMBean> getRoutes(java.lang.String managementName)
                                          throws java.lang.Exception
Description copied from interface: CamelFacade
Gets all the routes of the given CamelContext

Specified by:
getRoutes in interface CamelFacade
Parameters:
managementName - the camel context management name (not context id)
Throws:
java.lang.Exception

getEndpoints

public java.util.List<CamelEndpointMBean> getEndpoints(java.lang.String managementName)
                                                throws java.lang.Exception
Description copied from interface: CamelFacade
Gets all the endpoints of the given CamelContext

Specified by:
getEndpoints in interface CamelFacade
Parameters:
managementName - the camel context management name (not context id)
Throws:
java.lang.Exception

getConsumers

public java.util.List<CamelConsumerMBean> getConsumers(java.lang.String managementName)
                                                throws java.lang.Exception
Description copied from interface: CamelFacade
Gets all the consumers of the given CamelContext

Specified by:
getConsumers in interface CamelFacade
Parameters:
managementName - the camel context management name (not context id)
Throws:
java.lang.Exception

getProcessors

public java.util.List<CamelProcessorMBean> getProcessors(java.lang.String managementName)
                                                  throws java.lang.Exception
Description copied from interface: CamelFacade
Gets all the processors of the given CamelContext

Specified by:
getProcessors in interface CamelFacade
Parameters:
managementName - the camel context management name (not context id)
Throws:
java.lang.Exception

getThreadPools

public java.util.List<CamelThreadPoolMBean> getThreadPools(java.lang.String managementName)
                                                    throws java.lang.Exception
Description copied from interface: CamelFacade
Gets all the thread pools created and managed by the given CamelContext

Specified by:
getThreadPools in interface CamelFacade
Parameters:
managementName - the camel context management name (not context id)
Throws:
java.lang.Exception

dumpRoutesStatsAsXml

public java.lang.String dumpRoutesStatsAsXml(java.lang.String managementName)
                                      throws java.lang.Exception
Description copied from interface: CamelFacade
Dumps the performance statistics of all the routes for the given CamelContext, as XML

Specified by:
dumpRoutesStatsAsXml in interface CamelFacade
Parameters:
managementName - the camel context management name (not context id)
Throws:
java.lang.Exception


Copyright © 2015 Red Hat. All Rights Reserved.