public class JdbcConnector
extends org.mule.transport.AbstractConnector
implements org.mule.common.Testable
| Modifier and Type | Field and Description |
|---|---|
protected DataSource |
dataSource |
static long |
DEFAULT_POLLING_FREQUENCY |
protected Map<org.mule.api.endpoint.OutboundEndpoint,org.mule.api.transport.MessageDispatcher> |
endpointDispatchers |
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?
|
static String |
USE_DISPATCHER_POOL_SYSTEM_PROPERTY |
connecting, createMultipleTransactedReceivers, DEFAULT_CONTEXT_START_TIMEOUT, DEFAULT_NUM_CONCURRENT_TX_RECEIVERS, dispatcherFactory, dispatcherPoolFactory, dispatchers, initialStateStopped, lifecycleManager, logger, MULE_CONTEXT_START_TIMEOUT_SYSTEM_PROPERTY, muleContext, muleMessageFactory, name, numberOfConcurrentTransactedReceivers, receivers, requesterFactory, requesters, serviceDescriptor, serviceOverrides, sessionHandler, startOnConnect| Constructor and Description |
|---|
JdbcConnector(org.mule.api.MuleContext context) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyDispatcherLifecycle(org.mule.api.transport.MessageDispatcher dispatcher) |
protected org.mule.api.transport.MessageDispatcher |
borrowDispatcher(org.mule.api.endpoint.OutboundEndpoint endpoint) |
org.mule.api.processor.MessageProcessor |
createDispatcherMessageProcessor(org.mule.api.endpoint.OutboundEndpoint endpoint) |
protected <T> T |
createOperationResource(org.mule.api.endpoint.ImmutableEndpoint endpoint) |
org.mule.api.transport.MessageReceiver |
createReceiver(org.mule.api.construct.FlowConstruct flowConstruct,
org.mule.api.endpoint.InboundEndpoint endpoint) |
protected void |
doConnect() |
protected void |
doDisconnect() |
protected void |
doDispose() |
protected void |
doInitialise() |
protected void |
doStart() |
protected void |
doStop() |
Connection |
getConnection() |
DataSource |
getDataSource() |
protected String |
getNameFromParam(String param) |
protected <T> T |
getOperationResourceFactory() |
Object[] |
getParams(org.mule.api.endpoint.ImmutableEndpoint endpoint,
List paramNames,
org.mule.api.MuleMessage message,
String query) |
protected Object |
getParamValue(org.mule.api.endpoint.ImmutableEndpoint endpoint,
org.mule.api.MuleMessage message,
String param) |
long |
getPollingFrequency() |
String |
getProtocol() |
Map |
getQueries() |
String |
getQuery(org.mule.api.endpoint.ImmutableEndpoint endpoint,
String stmt) |
org.apache.commons.dbutils.QueryRunner |
getQueryRunner() |
org.apache.commons.dbutils.QueryRunner |
getQueryRunnerFor(org.mule.api.endpoint.ImmutableEndpoint endpoint) |
int |
getQueryTimeout() |
String[] |
getReadAndAckStatements(org.mule.api.endpoint.ImmutableEndpoint endpoint) |
org.apache.commons.dbutils.ResultSetHandler |
getResultSetHandler() |
SqlStatementStrategyFactory |
getSqlStatementStrategyFactory() |
String |
getStatement(org.mule.api.endpoint.ImmutableEndpoint endpoint) |
boolean |
isTransactionPerMessage() |
String |
parseStatement(String stmt,
List<String> params)
Parse the given statement filling the parameter list and return the ready to use statement.
|
protected void |
returnDispatcher(org.mule.api.endpoint.OutboundEndpoint endpoint,
org.mule.api.transport.MessageDispatcher dispatcher) |
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) |
org.mule.common.TestResult |
test() |
org.mule.api.retry.RetryContext |
validateConnection(org.mule.api.retry.RetryContext retryContext)
Verify that we are able to connect to the DataSource (needed for retry policies)
|
clearDispatchers, clearRequesters, configureDispatcherPool, connect, connectConnectorAndReceivers, createDefaultRedeliveryPolicy, createMuleMessageFactory, createScheduler, destroyReceiver, disconnect, dispose, disposeReceivers, disposeWorkManagers, doUnregisterListener, fireNotification, fireNotification, getCanonicalURI, getConnectEventId, getConnectionDescription, getDefaultExchangePattern, getDefaultInboundTransformers, getDefaultOutboundTransformers, getDefaultResponseTransformers, getDispatcherFactory, getDispatcherPoolFactory, getDispatcherThreadingProfile, getDispatcherWorkManager, getInboundExchangePatterns, getLifecycleState, getMaxDispatchersActive, getMaxRequestersActive, getMaxTotalDispatchers, getMuleContext, getMuleMessageFactory, getName, getNumberOfConcurrentTransactedReceivers, getOutboundExchangePatterns, getOutputStream, getReceiver, getReceiverKey, getReceivers, getReceivers, getReceiverThreadingProfile, getReceiverWorkManager, getReplyToHandler, getRequesterFactory, getRequesterThreadingProfile, getRequesterWorkManager, getRetryPolicyTemplate, getScheduler, getServiceDescriptor, getServiceOverrides, getSessionHandler, getSupportedProtocols, getTransactionalResource, handleWorkException, initFromServiceDescriptor, initialise, initialiseFromUrl, initWorkManagers, isConnected, isConnecting, isCreateMultipleTransactedReceivers, isDisposed, isEnableMessageEvents, isEnableMessageEvents, isInitialised, isInitialStateStopped, isResponseEnabled, isStarted, isStarting, isStopped, isStopping, isValidateConnections, lookupReceiver, registerListener, registerSupportedMetaProtocol, registerSupportedProtocol, registerSupportedProtocolWithoutPrefix, request, request, setConnected, setConnecting, setCreateMultipleTransactedReceivers, setDispatcherFactory, setDispatcherPoolFactory, setDispatcherPoolMaxWait, setDispatcherPoolWhenExhaustedAction, setDispatcherThreadingProfile, setDynamicNotification, setInitialStateStopped, setMaxDispatchersActive, setMaxRequestersActive, setName, setNumberOfConcurrentTransactedReceivers, setReceiverThreadingProfile, setRequesterFactory, setRequesterPoolMaxWait, setRequesterPoolWhenExhaustedAction, setRequesterThreadingProfile, setRetryPolicyTemplate, setServiceOverrides, setSessionHandler, setSupportedProtocols, setupDispatchReturn, setupRequestReturn, setValidateConnections, shutdownScheduler, start, startAfterConnect, stop, supportsProtocol, toString, unregisterListener, unregisterSupportedProtocol, updateCachedNotificationHandler, workAccepted, workCompleted, workRejected, workStartedpublic static final String JDBC
public static final String PROPERTY_POLLING_FREQUENCY
public static final long DEFAULT_POLLING_FREQUENCY
public static final String USE_DISPATCHER_POOL_SYSTEM_PROPERTY
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
protected Map<org.mule.api.endpoint.OutboundEndpoint,org.mule.api.transport.MessageDispatcher> endpointDispatchers
protected void doInitialise()
throws org.mule.api.lifecycle.InitialisationException
doInitialise in class org.mule.transport.AbstractConnectororg.mule.api.lifecycle.InitialisationExceptionpublic org.mule.api.transport.MessageReceiver createReceiver(org.mule.api.construct.FlowConstruct flowConstruct,
org.mule.api.endpoint.InboundEndpoint endpoint)
throws Exception
createReceiver in class org.mule.transport.AbstractConnectorExceptionpublic String[] getReadAndAckStatements(org.mule.api.endpoint.ImmutableEndpoint endpoint)
public Connection getConnection() throws Exception
Exceptionpublic boolean isTransactionPerMessage()
public void setTransactionPerMessage(boolean transactionPerMessage)
public String parseStatement(String stmt, List<String> params)
stmt - params - public Object[] getParams(org.mule.api.endpoint.ImmutableEndpoint endpoint, List paramNames, org.mule.api.MuleMessage message, String query) throws Exception
Exceptionprotected Object getParamValue(org.mule.api.endpoint.ImmutableEndpoint endpoint, org.mule.api.MuleMessage message, String param)
protected void doDispose()
doDispose in class org.mule.transport.AbstractConnectorprotected void doConnect()
throws Exception
doConnect in class org.mule.transport.AbstractConnectorExceptionpublic org.mule.api.retry.RetryContext validateConnection(org.mule.api.retry.RetryContext retryContext)
validateConnection in interface org.mule.api.transport.ConnectablevalidateConnection in class org.mule.transport.AbstractConnectorretryContext - protected void doDisconnect()
throws Exception
doDisconnect in class org.mule.transport.AbstractConnectorExceptionprotected void doStart()
throws org.mule.api.MuleException
doStart in class org.mule.transport.AbstractConnectororg.mule.api.MuleExceptionprotected void doStop()
throws org.mule.api.MuleException
doStop in class org.mule.transport.AbstractConnectororg.mule.api.MuleExceptionpublic String getProtocol()
getProtocol in interface org.mule.api.transport.Connectorpublic 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(org.mule.api.endpoint.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(org.mule.api.endpoint.ImmutableEndpoint endpoint)
public int getQueryTimeout()
public void setQueryTimeout(int queryTimeout)
protected <T> T getOperationResourceFactory()
getOperationResourceFactory in class org.mule.transport.AbstractConnectorprotected <T> T createOperationResource(org.mule.api.endpoint.ImmutableEndpoint endpoint)
throws org.mule.api.MuleException
createOperationResource in class org.mule.transport.AbstractConnectororg.mule.api.MuleExceptionpublic org.mule.common.TestResult test()
test in interface org.mule.common.Testablepublic org.mule.api.processor.MessageProcessor createDispatcherMessageProcessor(org.mule.api.endpoint.OutboundEndpoint endpoint)
throws org.mule.api.MuleException
createDispatcherMessageProcessor in class org.mule.transport.AbstractConnectororg.mule.api.MuleExceptionprotected org.mule.api.transport.MessageDispatcher borrowDispatcher(org.mule.api.endpoint.OutboundEndpoint endpoint)
throws org.mule.api.MuleException
borrowDispatcher in class org.mule.transport.AbstractConnectororg.mule.api.MuleExceptionprotected void returnDispatcher(org.mule.api.endpoint.OutboundEndpoint endpoint,
org.mule.api.transport.MessageDispatcher dispatcher)
returnDispatcher in class org.mule.transport.AbstractConnectorprotected void applyDispatcherLifecycle(org.mule.api.transport.MessageDispatcher dispatcher)
throws org.mule.api.MuleException
org.mule.api.MuleExceptionCopyright © 2003–2016 MuleSoft, Inc.. All rights reserved.