org.apache.camel.management.mbean
Class ManagedCamelContext

java.lang.Object
  extended by org.apache.camel.management.mbean.ManagedCounter
      extended by org.apache.camel.management.mbean.ManagedPerformanceCounter
          extended by org.apache.camel.management.mbean.ManagedCamelContext
All Implemented Interfaces:
ManagedCamelContextMBean, ManagedCounterMBean, ManagedPerformanceCounterMBean, PerformanceCounter, TimerListener

@ManagedResource(description="Managed CamelContext")
public class ManagedCamelContext
extends ManagedPerformanceCounter
implements TimerListener, ManagedCamelContextMBean

Version:

Field Summary
 
Fields inherited from class org.apache.camel.management.mbean.ManagedPerformanceCounter
TIMESTAMP_FORMAT
 
Fields inherited from class org.apache.camel.management.mbean.ManagedCounter
exchangesTotal, resetTimestamp
 
Constructor Summary
ManagedCamelContext(ModelCamelContext context)
           
 
Method Summary
 void addOrUpdateRoutesFromXml(String xml)
           
 void addOrUpdateRoutesFromXml(String xml, boolean urlDecode)
           
 List<String> completeEndpointPath(String componentName, Map<String,Object> endpointParameters, String completionText)
          Helper method for tooling which returns the completion list of the endpoint path from the given endpoint name, properties and current path expression.
 String componentParameterJsonSchema(String componentName)
          Returns the JSON schema representation of the endpoint parameters for the given component name
 boolean createEndpoint(String uri)
          Creates the endpoint by the given uri
 String dumpRoutesAsXml()
           
 String dumpRoutesStatsAsXml(boolean fullStats, boolean includeProcessors)
           
 List<String> findComponentNames()
          Find the names of all the Camel components available in the classpath and Registry.
 Map<String,Properties> findComponents()
          Find information about all the Camel components available in the classpath and Registry.
 String getApplicationContextClassName()
           
 String getCamelId()
           
 String getCamelVersion()
           
 String getClassResolver()
           
 String getComponentDocumentation(String componentName)
          Returns the HTML documentation for the given camel component
 CamelContext getContext()
           
 Integer getInflightExchanges()
           
 String getLoad01()
           
 String getLoad05()
           
 String getLoad15()
           
 String getManagementName()
           
 Boolean getMessageHistory()
           
 String getPackageScanClassResolver()
           
 Map<String,String> getProperties()
           
 String getProperty(String name)
          Gets the value of a CamelContext property name
 Integer getStartedRoutes()
           
 String getState()
           
 long getTimeout()
           
 TimeUnit getTimeUnit()
           
 Integer getTotalRoutes()
           
 Boolean getTracing()
           
 String getUptime()
           
 boolean isAllowUseOriginalMessage()
           
 boolean isMessageHistory()
           
 boolean isShutdownNowOnTimeout()
           
 boolean isUseBreadcrumb()
           
 boolean isUseMDCLogging()
           
 void onTimer()
          Notification invoked.
 int removeEndpoints(String pattern)
          Removes the endpoint by the given pattern
 Object requestBody(String endpointUri, Object body)
           
 Object requestBodyAndHeaders(String endpointUri, Object body, Map<String,Object> headers)
           
 Object requestStringBody(String endpointUri, String body)
           
 void reset(boolean includeRoutes)
          Resets all the performance counters.
 void restart()
           
 void resume()
           
 void sendBody(String endpointUri, Object body)
           
 void sendBodyAndHeaders(String endpointUri, Object body, Map<String,Object> headers)
           
 void sendStringBody(String endpointUri, String body)
           
 void setProperty(String name, String value)
          Sets the value of a CamelContext property name
 void setShutdownNowOnTimeout(boolean shutdownNowOnTimeout)
           
 void setTimeout(long timeout)
           
 void setTimeUnit(TimeUnit timeUnit)
           
 void setTracing(Boolean tracing)
           
 void start()
           
 void stop()
           
 void suspend()
           
 
Methods inherited from class org.apache.camel.management.mbean.ManagedPerformanceCounter
completedExchange, dumpStatsAsXml, failedExchange, getDeltaProcessingTime, getExchangesCompleted, getExchangesFailed, getExternalRedeliveries, getFailuresHandled, getFirstExchangeCompletedExchangeId, getFirstExchangeCompletedTimestamp, getFirstExchangeFailureExchangeId, getFirstExchangeFailureTimestamp, getLastExchangeCompletedExchangeId, getLastExchangeCompletedTimestamp, getLastExchangeFailureExchangeId, getLastExchangeFailureTimestamp, getLastProcessingTime, getMaxProcessingTime, getMeanProcessingTime, getMinProcessingTime, getRedeliveries, getTotalProcessingTime, init, isStatisticsEnabled, reset, setStatisticsEnabled
 
Methods inherited from class org.apache.camel.management.mbean.ManagedCounter
getExchangesTotal, getResetTimestamp, increment
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.camel.api.management.mbean.ManagedPerformanceCounterMBean
dumpStatsAsXml, getDeltaProcessingTime, getExchangesCompleted, getExchangesFailed, getExternalRedeliveries, getFailuresHandled, getFirstExchangeCompletedExchangeId, getFirstExchangeCompletedTimestamp, getFirstExchangeFailureExchangeId, getFirstExchangeFailureTimestamp, getLastExchangeCompletedExchangeId, getLastExchangeCompletedTimestamp, getLastExchangeFailureExchangeId, getLastExchangeFailureTimestamp, getLastProcessingTime, getMaxProcessingTime, getMeanProcessingTime, getMinProcessingTime, getRedeliveries, getTotalProcessingTime, isStatisticsEnabled, setStatisticsEnabled
 
Methods inherited from interface org.apache.camel.api.management.mbean.ManagedCounterMBean
getExchangesTotal, getResetTimestamp, reset
 

Constructor Detail

ManagedCamelContext

public ManagedCamelContext(ModelCamelContext context)
Method Detail

getContext

public CamelContext getContext()

getCamelId

public String getCamelId()
Specified by:
getCamelId in interface ManagedCamelContextMBean

getManagementName

public String getManagementName()
Specified by:
getManagementName in interface ManagedCamelContextMBean

getCamelVersion

public String getCamelVersion()
Specified by:
getCamelVersion in interface ManagedCamelContextMBean

getState

public String getState()
Specified by:
getState in interface ManagedCamelContextMBean

getUptime

public String getUptime()
Specified by:
getUptime in interface ManagedCamelContextMBean

getClassResolver

public String getClassResolver()
Specified by:
getClassResolver in interface ManagedCamelContextMBean

getPackageScanClassResolver

public String getPackageScanClassResolver()
Specified by:
getPackageScanClassResolver in interface ManagedCamelContextMBean

getApplicationContextClassName

public String getApplicationContextClassName()
Specified by:
getApplicationContextClassName in interface ManagedCamelContextMBean

getProperties

public Map<String,String> getProperties()
Specified by:
getProperties in interface ManagedCamelContextMBean

getProperty

public String getProperty(String name)
                   throws Exception
Description copied from interface: ManagedCamelContextMBean
Gets the value of a CamelContext property name

Specified by:
getProperty in interface ManagedCamelContextMBean
Parameters:
name - the name of the property
Returns:
String the value of the property
Throws:
Exception - is thrown if error occurred

setProperty

public void setProperty(String name,
                        String value)
                 throws Exception
Description copied from interface: ManagedCamelContextMBean
Sets the value of a CamelContext property name

Specified by:
setProperty in interface ManagedCamelContextMBean
Parameters:
name - the name of the property
value - the new value of the property
Throws:
Exception - is thrown if error occurred

getTracing

public Boolean getTracing()
Specified by:
getTracing in interface ManagedCamelContextMBean

setTracing

public void setTracing(Boolean tracing)
Specified by:
setTracing in interface ManagedCamelContextMBean

getMessageHistory

public Boolean getMessageHistory()
Specified by:
getMessageHistory in interface ManagedCamelContextMBean

getInflightExchanges

public Integer getInflightExchanges()
Specified by:
getInflightExchanges in interface ManagedCamelContextMBean

getTotalRoutes

public Integer getTotalRoutes()
Specified by:
getTotalRoutes in interface ManagedCamelContextMBean

getStartedRoutes

public Integer getStartedRoutes()
Specified by:
getStartedRoutes in interface ManagedCamelContextMBean

setTimeout

public void setTimeout(long timeout)
Specified by:
setTimeout in interface ManagedCamelContextMBean

getTimeout

public long getTimeout()
Specified by:
getTimeout in interface ManagedCamelContextMBean

setTimeUnit

public void setTimeUnit(TimeUnit timeUnit)
Specified by:
setTimeUnit in interface ManagedCamelContextMBean

getTimeUnit

public TimeUnit getTimeUnit()
Specified by:
getTimeUnit in interface ManagedCamelContextMBean

setShutdownNowOnTimeout

public void setShutdownNowOnTimeout(boolean shutdownNowOnTimeout)
Specified by:
setShutdownNowOnTimeout in interface ManagedCamelContextMBean

isShutdownNowOnTimeout

public boolean isShutdownNowOnTimeout()
Specified by:
isShutdownNowOnTimeout in interface ManagedCamelContextMBean

getLoad01

public String getLoad01()
Specified by:
getLoad01 in interface ManagedCamelContextMBean

getLoad05

public String getLoad05()
Specified by:
getLoad05 in interface ManagedCamelContextMBean

getLoad15

public String getLoad15()
Specified by:
getLoad15 in interface ManagedCamelContextMBean

isUseBreadcrumb

public boolean isUseBreadcrumb()
Specified by:
isUseBreadcrumb in interface ManagedCamelContextMBean

isAllowUseOriginalMessage

public boolean isAllowUseOriginalMessage()
Specified by:
isAllowUseOriginalMessage in interface ManagedCamelContextMBean

isMessageHistory

public boolean isMessageHistory()
Specified by:
isMessageHistory in interface ManagedCamelContextMBean

isUseMDCLogging

public boolean isUseMDCLogging()
Specified by:
isUseMDCLogging in interface ManagedCamelContextMBean

onTimer

public void onTimer()
Description copied from interface: TimerListener
Notification invoked.

Specified by:
onTimer in interface TimerListener

start

public void start()
           throws Exception
Specified by:
start in interface ManagedCamelContextMBean
Throws:
Exception

stop

public void stop()
          throws Exception
Specified by:
stop in interface ManagedCamelContextMBean
Throws:
Exception

restart

public void restart()
             throws Exception
Specified by:
restart in interface ManagedCamelContextMBean
Throws:
Exception

suspend

public void suspend()
             throws Exception
Specified by:
suspend in interface ManagedCamelContextMBean
Throws:
Exception

resume

public void resume()
            throws Exception
Specified by:
resume in interface ManagedCamelContextMBean
Throws:
Exception

sendBody

public void sendBody(String endpointUri,
                     Object body)
              throws Exception
Specified by:
sendBody in interface ManagedCamelContextMBean
Throws:
Exception

sendStringBody

public void sendStringBody(String endpointUri,
                           String body)
                    throws Exception
Specified by:
sendStringBody in interface ManagedCamelContextMBean
Throws:
Exception

sendBodyAndHeaders

public void sendBodyAndHeaders(String endpointUri,
                               Object body,
                               Map<String,Object> headers)
                        throws Exception
Specified by:
sendBodyAndHeaders in interface ManagedCamelContextMBean
Throws:
Exception

requestBody

public Object requestBody(String endpointUri,
                          Object body)
                   throws Exception
Specified by:
requestBody in interface ManagedCamelContextMBean
Throws:
Exception

requestStringBody

public Object requestStringBody(String endpointUri,
                                String body)
                         throws Exception
Specified by:
requestStringBody in interface ManagedCamelContextMBean
Throws:
Exception

requestBodyAndHeaders

public Object requestBodyAndHeaders(String endpointUri,
                                    Object body,
                                    Map<String,Object> headers)
                             throws Exception
Specified by:
requestBodyAndHeaders in interface ManagedCamelContextMBean
Throws:
Exception

dumpRoutesAsXml

public String dumpRoutesAsXml()
                       throws Exception
Specified by:
dumpRoutesAsXml in interface ManagedCamelContextMBean
Throws:
Exception

addOrUpdateRoutesFromXml

public void addOrUpdateRoutesFromXml(String xml)
                              throws Exception
Specified by:
addOrUpdateRoutesFromXml in interface ManagedCamelContextMBean
Throws:
Exception

addOrUpdateRoutesFromXml

public void addOrUpdateRoutesFromXml(String xml,
                                     boolean urlDecode)
                              throws Exception
Specified by:
addOrUpdateRoutesFromXml in interface ManagedCamelContextMBean
Throws:
Exception

dumpRoutesStatsAsXml

public String dumpRoutesStatsAsXml(boolean fullStats,
                                   boolean includeProcessors)
                            throws Exception
Specified by:
dumpRoutesStatsAsXml in interface ManagedCamelContextMBean
Throws:
Exception

createEndpoint

public boolean createEndpoint(String uri)
                       throws Exception
Description copied from interface: ManagedCamelContextMBean
Creates the endpoint by the given uri

Specified by:
createEndpoint in interface ManagedCamelContextMBean
Parameters:
uri - uri of endpoint to create
Returns:
true if a new endpoint was created, false if the endpoint already existed
Throws:
Exception - is thrown if error occurred

removeEndpoints

public int removeEndpoints(String pattern)
                    throws Exception
Description copied from interface: ManagedCamelContextMBean
Removes the endpoint by the given pattern

Specified by:
removeEndpoints in interface ManagedCamelContextMBean
Parameters:
pattern - the pattern
Returns:
number of endpoints removed
Throws:
Exception - is thrown if error occurred
See Also:
CamelContext.removeEndpoints(String)

findComponents

public Map<String,Properties> findComponents()
                                      throws Exception
Description copied from interface: ManagedCamelContextMBean
Find information about all the Camel components available in the classpath and Registry.

Specified by:
findComponents in interface ManagedCamelContextMBean
Returns:
a map with the component name, and value with component details.
Throws:
Exception - is thrown if error occurred

getComponentDocumentation

public String getComponentDocumentation(String componentName)
                                 throws IOException
Description copied from interface: ManagedCamelContextMBean
Returns the HTML documentation for the given camel component

Specified by:
getComponentDocumentation in interface ManagedCamelContextMBean
Parameters:
componentName - the component name
Throws:
IOException

findComponentNames

public List<String> findComponentNames()
                                throws Exception
Description copied from interface: ManagedCamelContextMBean
Find the names of all the Camel components available in the classpath and Registry.

Specified by:
findComponentNames in interface ManagedCamelContextMBean
Returns:
a list with the names of the camel components
Throws:
Exception - is thrown if error occurred

completeEndpointPath

public List<String> completeEndpointPath(String componentName,
                                         Map<String,Object> endpointParameters,
                                         String completionText)
                                  throws Exception
Description copied from interface: ManagedCamelContextMBean
Helper method for tooling which returns the completion list of the endpoint path from the given endpoint name, properties and current path expression.

For example if using the file endpoint, this should complete a list of files (rather like bash completion) or for an ActiveMQ component this should complete the list of queues or topics.

Specified by:
completeEndpointPath in interface ManagedCamelContextMBean
Parameters:
componentName - the component name
endpointParameters - parameters of the endpoint
completionText - the entered text which we want to have completion suggestions for
Throws:
Exception - is thrown if error occurred

componentParameterJsonSchema

public String componentParameterJsonSchema(String componentName)
                                    throws Exception
Description copied from interface: ManagedCamelContextMBean
Returns the JSON schema representation of the endpoint parameters for the given component name

Specified by:
componentParameterJsonSchema in interface ManagedCamelContextMBean
Parameters:
componentName - the name of the component to lookup
Throws:
Exception - is thrown if error occurred

reset

public void reset(boolean includeRoutes)
           throws Exception
Description copied from interface: ManagedCamelContextMBean
Resets all the performance counters.

Specified by:
reset in interface ManagedCamelContextMBean
Parameters:
includeRoutes - whether to reset all routes as well.
Throws:
Exception - is thrown if error occurred


Apache Camel