public class IBatisComponent extends UriEndpointComponent
Ibatis Component used to read/write to a database. Requires one of the following: 1. A Sql Map config file either on the root of the classpath or explicitly set. OR 2. A SqlMapClient explicit set. Using Ibatis as a source of data (<from>) you can use this component to treat a database table as a logical queue. Details are available in theIBatisConsumerUsing Ibatis as a destination for data (<to>) you can use this component to run an insert statement either on a single message or if the delivered content contains a collection of messages it can iterate through the collection and run the insert on each element. Details are available in theIBatisProducer
IBatisProducer,
IBatisConsumershutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending| Constructor and Description |
|---|
IBatisComponent() |
IBatisComponent(com.ibatis.sqlmap.client.SqlMapClient sqlMapClient) |
| Modifier and Type | Method and Description |
|---|---|
protected IBatisEndpoint |
createEndpoint(String uri,
String remaining,
Map<String,Object> parameters)
A factory method allowing derived components to create a new endpoint
from the given URI, remaining path and optional parameters
|
protected com.ibatis.sqlmap.client.SqlMapClient |
createSqlMapClient() |
protected void |
doStart()
Implementations override this method to support customized start/stop.
|
protected void |
doStop()
Implementations override this method to support customized start/stop.
|
com.ibatis.sqlmap.client.SqlMapClient |
getSqlMapClient() |
String |
getSqlMapConfig() |
boolean |
isUseTransactions() |
void |
setSqlMapClient(com.ibatis.sqlmap.client.SqlMapClient sqlMapClient)
To use the given
SqlMapClient |
void |
setSqlMapConfig(String sqlMapConfig)
Location of iBatis xml configuration file.
|
void |
setUseTransactions(boolean useTransactions)
Whether to use transactions.
|
createComponentConfiguration, createParameterConfigurationMap, getEndpointClass, getParameterConfigurationMap, populateParameterConfigurationMap, setEndpointClassafterConfiguration, createConfiguration, createEndpoint, getAndRemoveOrResolveReferenceParameter, getAndRemoveOrResolveReferenceParameter, getAndRemoveParameter, getAndRemoveParameter, getCamelContext, ifStartsWithReturnRemainder, preProcessUri, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceParameter, resolveAndRemoveReferenceParameter, setCamelContext, setProperties, setProperties, useIntrospectionOnEndpoint, useRawUri, validateParameters, validateURIdoResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendpublic IBatisComponent()
public IBatisComponent(com.ibatis.sqlmap.client.SqlMapClient sqlMapClient)
protected IBatisEndpoint createEndpoint(String uri, String remaining, Map<String,Object> parameters) throws Exception
DefaultComponentcreateEndpoint in class DefaultComponenturi - the full URI of the endpointremaining - the remaining part of the URI without the query
parameters or component prefixparameters - the optional parameters passed inException - is thrown if error creating the endpointprotected com.ibatis.sqlmap.client.SqlMapClient createSqlMapClient()
throws IOException
IOExceptionpublic com.ibatis.sqlmap.client.SqlMapClient getSqlMapClient()
public void setSqlMapClient(com.ibatis.sqlmap.client.SqlMapClient sqlMapClient)
SqlMapClientpublic String getSqlMapConfig()
public void setSqlMapConfig(String sqlMapConfig)
public boolean isUseTransactions()
public void setUseTransactions(boolean useTransactions)
protected void doStart()
throws Exception
ServiceSupportServiceSupport.doStop() for more details.doStart in class DefaultComponentExceptionServiceSupport.doStop()protected void doStop()
throws Exception
ServiceSupportServiceSupport.doStop() method when
the service is being stopped. This method will also be invoked
if the service is still in uninitialized state (eg has not
been started). The method is always called to allow the service
to do custom logic when the service is being stopped, such as when
CamelContext is shutting down.doStop in class DefaultComponentExceptionServiceSupport.doStart()Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.