|
|||||||||
| 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 String |
camelContextName
The Camel context name. |
protected org.ow2.jonas.camel.service.api.ICamelService |
camelService
The Camel service. |
protected Map<String,String> |
registryReplacements
Replacements to do in the registry. |
static String |
TRACE_LOGGER_NAME
|
protected 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,
List<String> registryFilesContent)
Configure CAMEL components, called just before registry injection. |
File |
getConfigurationFolder()
|
File |
getFileEndpointFile(String url)
|
String |
getRegistryPropertyOrReplacement(String key)
Returns the value of a certain key in the contents of all camel*.properties files in JONAS_BASE/conf
merged with registryReplacements. |
String |
getRouteName()
|
void |
setCamelService(org.ow2.jonas.camel.service.api.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, simple, systemProperty, systemProperty, xpath |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String TRACE_LOGGER_NAME
protected org.osgi.framework.BundleContext bundleContext
protected org.ow2.jonas.camel.service.api.ICamelService camelService
protected Map<String,String> registryReplacements
protected String camelContextName
protected String traceDestination
| Constructor Detail |
|---|
public RouteBuilderComponent(org.osgi.framework.BundleContext bundleContext)
| Method Detail |
|---|
public void start()
throws Throwable
Throwable
public void stop()
throws Throwable
Throwable
protected void configureCamelComponents(org.apache.camel.CamelContext camelContext,
List<String> registryFilesContent)
throws 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).
Exception
public void configure()
throws Exception
configure in class org.apache.camel.builder.RouteBuilderExceptionpublic void setCamelService(org.ow2.jonas.camel.service.api.ICamelService camelService)
camelService - Camel service to inject.public final File getConfigurationFolder()
public final String getRegistryPropertyOrReplacement(String key)
camel*.properties files in JONAS_BASE/conf
merged with registryReplacements.
key - the key to look for.
IllegalArgumentException - if key not found.public String getRouteName()
public File getFileEndpointFile(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 | ||||||||