|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.wgen.op.OpExecutorFactory
net.wgen.op.DirectExecutorFactory
Creates an OpExecutorFactory that produces DirectOpExecutors. A DirectOpExecutor is instantiated with a MappedConnectionFactory that is passed on to all CallExecutors created by that OpExecutor.
The following code, for example, creates a "Direct" factory which creates DirectOpExecutors who make direct connections to the database (not thru EJB or JNDI).
OracleConnectionPoolDataSource ds = new OracleConnectionPoolDataSource();
ds.setURL( "jdbc:oracle:thin:@ora.widgets.com:1521:DEV" );
DirectExecutorFactory fact = new DirectExecutorFactory();
fact.mapConnectionFactory( MyModule.DATA_SOURCE_NAME, "myapp" , "myapp123", ds );
fact.mapConnectionFactory( PlatformModule.DATA_SOURCE_NAME, "platform" , "platform123", ds );
OpExecutorFactory.setDelegatingFactory( fact );
| Field Summary | |
private static java.util.Map |
DATASOURCE_MAPPINGS
|
| Fields inherited from class net.wgen.op.OpExecutorFactory |
SYSTEM_PROPERTY |
| Constructor Summary | |
DirectExecutorFactory()
|
|
| Method Summary | |
protected OpExecutor |
_createExecutorForOp(Op op)
An OpExecutor packed with a MappedConnectionFactory that will provide the Op access to various datasources. |
private MappedConnectionFactory |
createMappedConnectionFactory(Op op)
For each datasource registered in this factory, create a connection factory that can access those connections. |
org.apache.commons.dbcp.ConnectionFactory |
getConnectionFactory(java.lang.String dataSourceName)
Get the connection factory for the DataSource. |
void |
mapConnectionFactory(java.lang.String dataSourceName,
org.apache.commons.dbcp.ConnectionFactory cxFactory)
Map a connection factory to a dataSourceName. |
void |
mapConnectionFactory(java.lang.String dataSourceName,
java.lang.String user,
java.lang.String pass,
javax.sql.DataSource dataSource)
Map connection factory to a dataSourceName. |
| Methods inherited from class net.wgen.op.OpExecutorFactory |
create, getDelegatingFactory, setDelegatingFactory |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static final java.util.Map DATASOURCE_MAPPINGS
| Constructor Detail |
public DirectExecutorFactory()
| Method Detail |
public void mapConnectionFactory(java.lang.String dataSourceName,
org.apache.commons.dbcp.ConnectionFactory cxFactory)
dataSourceName - cxFactory -
public void mapConnectionFactory(java.lang.String dataSourceName,
java.lang.String user,
java.lang.String pass,
javax.sql.DataSource dataSource)
throws java.lang.IllegalAccessException,
java.lang.InstantiationException
dataSourceName - user - pass -
java.lang.IllegalAccessException
java.lang.InstantiationExceptionpublic org.apache.commons.dbcp.ConnectionFactory getConnectionFactory(java.lang.String dataSourceName)
dataSourceName -
protected OpExecutor _createExecutorForOp(Op op)
_createExecutorForOp in class OpExecutorFactoryop - the Op to be executed
private MappedConnectionFactory createMappedConnectionFactory(Op op)
op - the Op to be executed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||