|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mule.transport.AbstractConnector
org.mule.transport.jdbc.JdbcConnector
public class JdbcConnector
Field Summary | |
---|---|
protected DataSource |
dataSource
|
static long |
DEFAULT_POLLING_FREQUENCY
|
static String |
JDBC
|
protected long |
pollingFrequency
|
static String |
PROPERTY_POLLING_FREQUENCY
|
protected Map |
queries
|
protected org.apache.commons.dbutils.QueryRunner |
queryRunner
|
protected org.apache.commons.dbutils.ResultSetHandler |
resultSetHandler
|
protected boolean |
transactionPerMessage
Should each DB record be received in a separate transaction or should there be a single transaction for the entire ResultSet? |
Fields inherited from interface org.mule.api.transport.Connector |
---|
INT_VALUE_NOT_SET |
Fields inherited from interface org.mule.api.lifecycle.Disposable |
---|
PHASE_NAME |
Constructor Summary | |
---|---|
JdbcConnector(MuleContext context)
|
Method Summary | ||
---|---|---|
protected
|
createOperationResource(ImmutableEndpoint endpoint)
|
|
MessageReceiver |
createReceiver(FlowConstruct flowConstruct,
InboundEndpoint endpoint)
Create a Message receiver for this connector |
|
protected void |
doConnect()
Template method where any connections should be made for the connector |
|
protected void |
doDisconnect()
Template method where any connected resources used by the connector should be disconnected |
|
protected void |
doDispose()
Template method to perform any work when destroying the connectoe |
|
protected void |
doInitialise()
|
|
protected void |
doStart()
Template method to perform any work when starting the connectoe |
|
protected void |
doStop()
Template method to perform any work when stopping the connectoe |
|
Connection |
getConnection()
|
|
DataSource |
getDataSource()
|
|
protected String |
getNameFromParam(String param)
|
|
protected
|
getOperationResourceFactory()
|
|
Object[] |
getParams(ImmutableEndpoint endpoint,
List paramNames,
MuleMessage message,
String query)
|
|
protected Object |
getParamValue(ImmutableEndpoint endpoint,
MuleMessage message,
String param)
|
|
long |
getPollingFrequency()
|
|
String |
getProtocol()
|
|
Map |
getQueries()
|
|
String |
getQuery(ImmutableEndpoint endpoint,
String stmt)
|
|
org.apache.commons.dbutils.QueryRunner |
getQueryRunner()
|
|
org.apache.commons.dbutils.QueryRunner |
getQueryRunnerFor(ImmutableEndpoint endpoint)
|
|
int |
getQueryTimeout()
|
|
String[] |
getReadAndAckStatements(ImmutableEndpoint endpoint)
|
|
org.apache.commons.dbutils.ResultSetHandler |
getResultSetHandler()
|
|
SqlStatementStrategyFactory |
getSqlStatementStrategyFactory()
|
|
String |
getStatement(ImmutableEndpoint endpoint)
|
|
boolean |
isTransactionPerMessage()
|
|
String |
parseStatement(String stmt,
List params)
Parse the given statement filling the parameter list and return the ready to use statement. |
|
void |
setDataSource(DataSource dataSource)
|
|
void |
setPollingFrequency(long pollingFrequency)
|
|
void |
setQueries(Map queries)
|
|
void |
setQueryRunner(org.apache.commons.dbutils.QueryRunner queryRunner)
|
|
void |
setQueryTimeout(int queryTimeout)
|
|
void |
setResultSetHandler(org.apache.commons.dbutils.ResultSetHandler resultSetHandler)
|
|
void |
setSqlStatementStrategyFactory(SqlStatementStrategyFactory sqlStatementStrategyFactory)
|
|
void |
setTransactionPerMessage(boolean transactionPerMessage)
|
|
RetryContext |
validateConnection(RetryContext retryContext)
Verify that we are able to connect to the DataSource (needed for retry policies) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String JDBC
public static final String PROPERTY_POLLING_FREQUENCY
public static final long DEFAULT_POLLING_FREQUENCY
protected long pollingFrequency
protected Map queries
protected DataSource dataSource
protected org.apache.commons.dbutils.ResultSetHandler resultSetHandler
protected org.apache.commons.dbutils.QueryRunner queryRunner
protected boolean transactionPerMessage
Constructor Detail |
---|
public JdbcConnector(MuleContext context)
Method Detail |
---|
protected void doInitialise() throws InitialisationException
doInitialise
in class AbstractConnector
InitialisationException
public MessageReceiver createReceiver(FlowConstruct flowConstruct, InboundEndpoint endpoint) throws Exception
AbstractConnector
createReceiver
in class AbstractConnector
flowConstruct
- the service that will receive events from this receiver, the
listenerendpoint
- the endpoint that defies this inbound communication
TransportServiceDescriptor
initialised using the service and endpoint.
Exception
- if there is a problem creating the receiver. This exception
really depends on the underlying transport, thus any exception
could be thrownpublic String[] getReadAndAckStatements(ImmutableEndpoint endpoint)
public String getQuery(ImmutableEndpoint endpoint, String stmt)
public Connection getConnection() throws Exception
Exception
public boolean isTransactionPerMessage()
public void setTransactionPerMessage(boolean transactionPerMessage)
public String parseStatement(String stmt, List params)
stmt
- params
- public Object[] getParams(ImmutableEndpoint endpoint, List paramNames, MuleMessage message, String query) throws Exception
Exception
protected Object getParamValue(ImmutableEndpoint endpoint, MuleMessage message, String param)
protected String getNameFromParam(String param)
protected void doDispose()
AbstractConnector
doDispose
in class AbstractConnector
protected void doConnect() throws Exception
AbstractConnector
doConnect
in class AbstractConnector
Exception
public RetryContext validateConnection(RetryContext retryContext)
validateConnection
in interface Connectable
validateConnection
in class AbstractConnector
retryContext
-
RetryContext.isOk()
,
RetryContext.getLastFailure()
protected void doDisconnect() throws Exception
AbstractConnector
doDisconnect
in class AbstractConnector
Exception
protected void doStart() throws MuleException
AbstractConnector
doStart
in class AbstractConnector
MuleException
- if the method failsprotected void doStop() throws MuleException
AbstractConnector
doStop
in class AbstractConnector
MuleException
- if the method failspublic String getProtocol()
public DataSource getDataSource()
public void setDataSource(DataSource dataSource)
public org.apache.commons.dbutils.ResultSetHandler getResultSetHandler()
public void setResultSetHandler(org.apache.commons.dbutils.ResultSetHandler resultSetHandler)
public org.apache.commons.dbutils.QueryRunner getQueryRunnerFor(ImmutableEndpoint endpoint)
public org.apache.commons.dbutils.QueryRunner getQueryRunner()
public void setQueryRunner(org.apache.commons.dbutils.QueryRunner queryRunner)
public long getPollingFrequency()
public void setPollingFrequency(long pollingFrequency)
pollingFrequency
- The pollingFrequency to set.public Map getQueries()
public void setQueries(Map queries)
queries
- The queries to set.public SqlStatementStrategyFactory getSqlStatementStrategyFactory()
public void setSqlStatementStrategyFactory(SqlStatementStrategyFactory sqlStatementStrategyFactory)
public String getStatement(ImmutableEndpoint endpoint)
public int getQueryTimeout()
public void setQueryTimeout(int queryTimeout)
protected <T> T getOperationResourceFactory()
getOperationResourceFactory
in class AbstractConnector
protected <T> T createOperationResource(ImmutableEndpoint endpoint) throws MuleException
createOperationResource
in class AbstractConnector
MuleException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |