|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.camel.builder.BuilderSupport
org.apache.camel.builder.RouteBuilder
org.ow2.jonas.camel.component.RouteBuilderComponent
public abstract class RouteBuilderComponent
iPOJO component that creates a CAMEL context with:
Import-Package
declarations$JONAS_BASE/conf and injected into the CAMEL contextjdbc component for instanceClassLoader positioned on the current thread, to
avoid any class loading issues with dynamic components such as JNDI, JMS or
CXFTRACE_LOGGER_NAMEtraceDestination is not null, traces
also sending a message to that endpointconfigure() method, making
sure you first call super.configure() in your implementationorg.ow2.jonas.camel.component package is in
your bundle's Private-Package listmetadata.xml file has the required
definitions: <ipojo ...
...
<component ...
...
<requires optional="false"
specification="org.ow2.jonas.camel.service.api.ICamelService">
<callback type="bind" method="setCamelService" />
</requires>
<callback transition="validate" method="start" />
<callback transition="invalidate" method="stop" />
...
</component>
...
</ipojo>
| Field Summary | |
|---|---|
protected org.osgi.framework.BundleContext |
bundleContext
The OSGi bundle context. |
protected java.lang.String |
camelContextName
The Camel context name. |
protected ICamelService |
camelService
The Camel service. |
protected java.util.Map<java.lang.String,java.lang.String> |
registryReplacements
Replacements to do in the registry. |
static java.lang.String |
TRACE_LOGGER_NAME
|
protected java.lang.String |
traceDestination
The external trace destination, might be null. |
| Constructor Summary | |
|---|---|
RouteBuilderComponent(org.osgi.framework.BundleContext bundleContext)
Saves the bundle context and gets the JONAS_BASE/conf folder. |
|
| Method Summary | |
|---|---|
void |
configure()
Configures the Camel context with the tracer. |
protected void |
configureCamelComponents(org.apache.camel.CamelContext camelContext,
java.util.List<java.lang.String> registryFilesContent)
Configure CAMEL components, called just before registry injection. |
java.io.File |
getConfigurationFolder()
|
java.io.File |
getFileEndpointFile(java.lang.String url)
|
java.lang.String |
getRegistryPropertyOrReplacement(java.lang.String key)
Returns the value of a certain key in the contents of all camel*.properties files in
JONAS_BASE/conf merged with
registryReplacements. |
java.lang.String |
getRouteName()
|
void |
setCamelService(ICamelService camelService)
|
void |
start()
Start the Camel context. |
void |
stop()
Stop the Camel context. |
| Methods inherited from class org.apache.camel.builder.RouteBuilder |
|---|
addRoutes, addRoutesToCamelContext, checkInitialized, configureRoute, configureRoutes, createContainer, errorHandler, from, from, from, from, fromF, getContext, getRouteCollection, includeRoutes, intercept, interceptFrom, interceptFrom, interceptSendToEndpoint, onCompletion, onException, onException, populateRoutes, setErrorHandlerBuilder, setRouteCollection, toString |
| Methods inherited from class org.apache.camel.builder.BuilderSupport |
|---|
bean, bean, bean, bean, body, body, constant, createErrorHandlerBuilder, deadLetterChannel, deadLetterChannel, defaultErrorHandler, endpoint, endpoint, endpoints, endpoints, exceptionMessage, faultBody, faultBodyAs, getErrorHandlerBuilder, header, loggingErrorHandler, loggingErrorHandler, loggingErrorHandler, loggingErrorHandler, noErrorHandler, outBody, outBody, property, regexReplaceAll, regexReplaceAll, sendTo, setContext, systemProperty, systemProperty |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String TRACE_LOGGER_NAME
protected org.osgi.framework.BundleContext bundleContext
protected ICamelService camelService
protected java.util.Map<java.lang.String,java.lang.String> registryReplacements
protected java.lang.String camelContextName
protected java.lang.String traceDestination
| Constructor Detail |
|---|
public RouteBuilderComponent(org.osgi.framework.BundleContext bundleContext)
| Method Detail |
|---|
public void start()
throws java.lang.Throwable
java.lang.Throwable
public void stop()
throws java.lang.Throwable
java.lang.Throwable
protected void configureCamelComponents(org.apache.camel.CamelContext camelContext,
java.util.List<java.lang.String> registryFilesContent)
throws java.lang.Exception
jms component is configured to use the
JCF connection factory on JNDI.jdbc.
camelContext - CAMEL context.registryFilesContent - Actual contents of the CAMEL registry files
(with all variables replaced).
java.lang.Exception
public void configure()
throws java.lang.Exception
configure in class org.apache.camel.builder.RouteBuilderjava.lang.Exceptionpublic void setCamelService(ICamelService camelService)
camelService - Camel service to inject.public final java.io.File getConfigurationFolder()
public final java.lang.String getRegistryPropertyOrReplacement(java.lang.String key)
camel*.properties files in
JONAS_BASE/conf merged with
registryReplacements.
key - the key to look for.
java.lang.IllegalArgumentException - if key not found.public final java.lang.String getRouteName()
public java.io.File getFileEndpointFile(java.lang.String url)
File object (source or target) of a Camel endpoint of
type "file".
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||