Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mule.transport.jdbc
Class JdbcConnector

    java.lang.Object
      org.mule.transport.AbstractConnector
          org.mule.transport.jdbc.JdbcConnector

All Implemented Interfaces:
  EventListener, javax.resource.spi.work.WorkListener, Disposable, Initialisable, Lifecycle, LifecycleStateEnabled, Startable, Stoppable, NamedObject, Connectable, Connector

    public class JdbcConnector

extends AbstractConnector

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 class org.mule.transport.AbstractConnector
`connected, createMultipleTransactedReceivers, DEFAULT_NUM_CONCURRENT_TX_RECEIVERS, dispatcherFactory, dispatcherPoolFactory, dispatchers, initialStateStopped, lifecycleManager, logger, muleContext, muleMessageFactory, name, numberOfConcurrentTransactedReceivers, receivers, requesterFactory, requesters, serviceDescriptor, serviceOverrides, sessionHandler, startOnConnect`

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
`Connection` | `getConnection()`
`DataSource` | `getDataSource()`
`protected String` | `getNameFromParam(String param)`
`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 org.mule.transport.AbstractConnector
`clearDispatchers, clearRequesters, configureDispatcherPool, connect, createDispatcherMessageProcessor, createMuleMessageFactory, createScheduler, destroyReceiver, disconnect, dispose, disposeReceivers, disposeWorkManagers, doUnregisterListener, exceptionThrown, fireNotification, 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, handleException, handleWorkException, initFromServiceDescriptor, initialise, initialiseFromUrl, initWorkManagers, isConnected, isCreateMultipleTransactedReceivers, isDisposed, isEnableMessageEvents, isInitialised, isInitialStateStopped, isResponseEnabled, isStarted, isStopped, isValidateConnections, lookupReceiver, registerListener, registerSupportedMetaProtocol, registerSupportedProtocol, registerSupportedProtocolWithoutPrefix, request, request, setConnected, 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, workStarted`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### JDBC

    public static final String JDBC

See Also:
  Constant Field Values

### PROPERTY_POLLING_FREQUENCY

    public static final String PROPERTY_POLLING_FREQUENCY

See Also:
  Constant Field Values

### DEFAULT_POLLING_FREQUENCY

    public static final long DEFAULT_POLLING_FREQUENCY

See Also:
  Constant Field Values

### pollingFrequency

    protected long pollingFrequency

### queries

    protected Map queries

### dataSource

    protected DataSource dataSource

### resultSetHandler

    protected org.apache.commons.dbutils.ResultSetHandler resultSetHandler

### queryRunner

    protected org.apache.commons.dbutils.QueryRunner queryRunner

### transactionPerMessage

    protected boolean transactionPerMessage

  Should each DB record be received in a separate transaction or should there be a single transaction for the entire ResultSet?

Constructor Detail

### JdbcConnector

    public JdbcConnector(MuleContext context)

Method Detail

### doInitialise

    protected void doInitialise()
                         throws InitialisationException

  Specified by:
    `doInitialise` in class `AbstractConnector`
  Throws:
    `InitialisationException`

### createReceiver

    public MessageReceiver createReceiver(FlowConstruct flowConstruct,
                                          InboundEndpoint endpoint)
                                   throws Exception

  Description copied from class: `AbstractConnector`
  Create a Message receiver for this connector

  Overrides:
    `createReceiver` in class `AbstractConnector`
  Parameters:
    `flowConstruct` - the service that will receive events from this receiver, the listener
    `endpoint` - the endpoint that defies this inbound communication
  Returns:
    an instance of the message receiver defined in this connectors' `TransportServiceDescriptor` initialised using the service and endpoint.
  Throws:
    `Exception` - if there is a problem creating the receiver. This exception really depends on the underlying transport, thus any exception could be thrown

### getReadAndAckStatements

    public String[] getReadAndAckStatements(ImmutableEndpoint endpoint)

### getQuery

    public String getQuery(ImmutableEndpoint endpoint,
                           String stmt)

### getConnection

    public Connection getConnection()
                             throws Exception

  Throws:
    `Exception`

### isTransactionPerMessage

    public boolean isTransactionPerMessage()

### setTransactionPerMessage

    public void setTransactionPerMessage(boolean transactionPerMessage)

### parseStatement

    public String parseStatement(String stmt,
                                 List params)

  Parse the given statement filling the parameter list and return the ready to use statement.

  Parameters:
    `stmt` -
    `params` -

### getParams

    public Object[] getParams(ImmutableEndpoint endpoint,
                              List paramNames,
                              MuleMessage message,
                              String query)
                       throws Exception

  Throws:
    `Exception`

### getParamValue

    protected Object getParamValue(ImmutableEndpoint endpoint,
                                   MuleMessage message,
                                   String param)

### getNameFromParam

    protected String getNameFromParam(String param)

### doDispose

    protected void doDispose()

  Description copied from class: `AbstractConnector`
  Template method to perform any work when destroying the connectoe

  Specified by:
    `doDispose` in class `AbstractConnector`

### doConnect

    protected void doConnect()
                      throws Exception

  Description copied from class: `AbstractConnector`
  Template method where any connections should be made for the connector

  Specified by:
    `doConnect` in class `AbstractConnector`
  Throws:
    `Exception`

### validateConnection

    public RetryContext validateConnection(RetryContext retryContext)

  Verify that we are able to connect to the DataSource (needed for retry policies)

  Specified by:
    `validateConnection` in interface `Connectable`
  Overrides:
    `validateConnection` in class `AbstractConnector`
  Parameters:
    `retryContext` -
  Returns:
    retry context with a success flag or failure details
  See Also:
    `RetryContext.isOk()`, `RetryContext.getLastFailure()`

### doDisconnect

    protected void doDisconnect()
                         throws Exception

  Description copied from class: `AbstractConnector`
  Template method where any connected resources used by the connector should be disconnected

  Specified by:
    `doDisconnect` in class `AbstractConnector`
  Throws:
    `Exception`

### doStart

    protected void doStart()
                    throws MuleException

  Description copied from class: `AbstractConnector`
  Template method to perform any work when starting the connectoe

  Specified by:
    `doStart` in class `AbstractConnector`
  Throws:
    `MuleException` - if the method fails

### doStop

    protected void doStop()
                   throws MuleException

  Description copied from class: `AbstractConnector`
  Template method to perform any work when stopping the connectoe

  Specified by:
    `doStop` in class `AbstractConnector`
  Throws:
    `MuleException` - if the method fails

### getProtocol

    public String getProtocol()

  Returns:
    the primary protocol name for endpoints of this connector

### getDataSource

    public DataSource getDataSource()

### setDataSource

    public void setDataSource(DataSource dataSource)

### getResultSetHandler

    public org.apache.commons.dbutils.ResultSetHandler getResultSetHandler()

### setResultSetHandler

    public void setResultSetHandler(org.apache.commons.dbutils.ResultSetHandler resultSetHandler)

### getQueryRunnerFor

    public org.apache.commons.dbutils.QueryRunner getQueryRunnerFor(ImmutableEndpoint endpoint)

### getQueryRunner

    public org.apache.commons.dbutils.QueryRunner getQueryRunner()

### setQueryRunner

    public void setQueryRunner(org.apache.commons.dbutils.QueryRunner queryRunner)

### getPollingFrequency

    public long getPollingFrequency()

  Returns:
    Returns the pollingFrequency.

### setPollingFrequency

    public void setPollingFrequency(long pollingFrequency)

  Parameters:
    `pollingFrequency` - The pollingFrequency to set.

### getQueries

    public Map getQueries()

  Returns:
    Returns the queries.

### setQueries

    public void setQueries(Map queries)

  Parameters:
    `queries` - The queries to set.

### getSqlStatementStrategyFactory

    public SqlStatementStrategyFactory getSqlStatementStrategyFactory()

### setSqlStatementStrategyFactory

    public void setSqlStatementStrategyFactory(SqlStatementStrategyFactory sqlStatementStrategyFactory)

### getStatement

    public String getStatement(ImmutableEndpoint endpoint)

### getQueryTimeout

    public int getQueryTimeout()

### setQueryTimeout

    public void setQueryTimeout(int queryTimeout)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2010 MuleSoft, Inc.. All Rights Reserved.