|
||||||||||
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 javax.sql.DataSource |
dataSource
|
static long |
DEFAULT_POLLING_FREQUENCY
|
static java.lang.String |
JDBC
|
protected long |
pollingFrequency
|
static java.lang.String |
PROPERTY_POLLING_FREQUENCY
|
protected java.util.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 | |
---|---|
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 |
java.sql.Connection |
getConnection()
|
javax.sql.DataSource |
getDataSource()
|
protected java.lang.String |
getNameFromParam(java.lang.String param)
|
java.lang.Object[] |
getParams(ImmutableEndpoint endpoint,
java.util.List paramNames,
MuleMessage message,
java.lang.String query)
|
long |
getPollingFrequency()
|
java.lang.String |
getProtocol()
|
java.util.Map |
getQueries()
|
java.lang.String |
getQuery(ImmutableEndpoint endpoint,
java.lang.String stmt)
|
org.apache.commons.dbutils.QueryRunner |
getQueryRunner()
|
org.apache.commons.dbutils.QueryRunner |
getQueryRunnerFor(ImmutableEndpoint endpoint)
|
int |
getQueryTimeout()
|
java.lang.String[] |
getReadAndAckStatements(ImmutableEndpoint endpoint)
|
org.apache.commons.dbutils.ResultSetHandler |
getResultSetHandler()
|
SqlStatementStrategyFactory |
getSqlStatementStrategyFactory()
|
java.lang.String |
getStatement(ImmutableEndpoint endpoint)
|
boolean |
isTransactionPerMessage()
|
java.lang.String |
parseStatement(java.lang.String stmt,
java.util.List params)
Parse the given statement filling the parameter list and return the ready to use statement. |
void |
setDataSource(javax.sql.DataSource dataSource)
|
void |
setPollingFrequency(long pollingFrequency)
|
void |
setQueries(java.util.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 java.lang.String JDBC
public static final java.lang.String PROPERTY_POLLING_FREQUENCY
public static final long DEFAULT_POLLING_FREQUENCY
protected long pollingFrequency
protected java.util.Map queries
protected javax.sql.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 java.lang.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.
java.lang.Exception
- if there is a problem creating the receiver. This exception
really depends on the underlying transport, thus any exception
could be thrownpublic java.lang.String[] getReadAndAckStatements(ImmutableEndpoint endpoint)
public java.lang.String getQuery(ImmutableEndpoint endpoint, java.lang.String stmt)
public java.sql.Connection getConnection() throws java.lang.Exception
java.lang.Exception
public boolean isTransactionPerMessage()
public void setTransactionPerMessage(boolean transactionPerMessage)
public java.lang.String parseStatement(java.lang.String stmt, java.util.List params)
stmt
- params
- public java.lang.Object[] getParams(ImmutableEndpoint endpoint, java.util.List paramNames, MuleMessage message, java.lang.String query) throws java.lang.Exception
java.lang.Exception
protected java.lang.String getNameFromParam(java.lang.String param)
protected void doDispose()
AbstractConnector
doDispose
in class AbstractConnector
protected void doConnect() throws java.lang.Exception
AbstractConnector
doConnect
in class AbstractConnector
java.lang.Exception
public RetryContext validateConnection(RetryContext retryContext)
validateConnection
in interface Connectable
validateConnection
in class AbstractConnector
retryContext
-
RetryContext.isOk()
,
RetryContext.getLastFailure()
protected void doDisconnect() throws java.lang.Exception
AbstractConnector
doDisconnect
in class AbstractConnector
java.lang.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 java.lang.String getProtocol()
public javax.sql.DataSource getDataSource()
public void setDataSource(javax.sql.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 java.util.Map getQueries()
public void setQueries(java.util.Map queries)
queries
- The queries to set.public SqlStatementStrategyFactory getSqlStatementStrategyFactory()
public void setSqlStatementStrategyFactory(SqlStatementStrategyFactory sqlStatementStrategyFactory)
public java.lang.String getStatement(ImmutableEndpoint endpoint)
public int getQueryTimeout()
public void setQueryTimeout(int queryTimeout)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |