|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.wgen.op.OpExecutorFactory
Factory to create OpExecutors so that the caller doesn't have to set them manually in each Op.
The default factory is theEjbOpExecutorFactory
which produces EjbOpExecutors that lookup a JNDI-registered EJB that will process the Op.
To override this for a non-appserver context, such as within your IDE, you can either set the
system property net.wgen.data.OpExecutorFactorywith the fully-qualified class name of the alternate OpExecutorFactory, or you can manually set up your own factory and identify it to this OpExecutorFactory as the delegated-to Factory. The following code, for example, creates a "Direct" factory which creates DirectOpExecutors who make direct connections to the database (not thru EJB). The DirectOpExecutors use the DataSource names declare in the Ops to map to actual connections. Here is how you might setup a TestCase that would bypass EJB.
String cxUrl = "jdbc:oracle:thin:@howl.wgenhq.net:1521:DEV2";
DirectExecutorFactory fact = new DirectExecutorFactory();
fact.mapConnectionFactory( SeeApplication.DATA_SOURCE, cxUrl , "walk" , "walk123" );
fact.mapConnectionFactory( AMPApplication.DATA_SOURCE, cxUrl , "wgen" , "wgen123" );
OpExecutorFactory.setDelegatingFactory( fact );
EjbOpExecutorFactory,
DirectExecutorFactory| Field Summary | |
private static OpExecutorFactory |
_delegatingFactory
The concrete factory that will produce the OpExecutorFactory. |
static java.lang.String |
SYSTEM_PROPERTY
The name of the system property in which to find a fully-qualified class name of an implementation of OpExecutorFactory. |
| Constructor Summary | |
OpExecutorFactory()
|
|
| Method Summary | |
protected abstract OpExecutor |
_createExecutorForOp(Op op)
Internal create to be implemented by the _delegatingFactory. |
static OpExecutor |
create(Op op)
Invoked by the Op to provide it an OpExecutor. |
static OpExecutorFactory |
getDelegatingFactory()
The current _delegatingFactory used to create OpExecutors. |
private static void |
initializeFromSystemProperty()
Examines the system property for a fully-qualified class name identifying an implementation of an OpExecutorFactory, or defaults to an EjbOpExecutor. |
static void |
setDelegatingFactory(OpExecutorFactory delegatingFactory)
Allow a runtime override of the _delegatingFactory. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String SYSTEM_PROPERTY
private static OpExecutorFactory _delegatingFactory
| Constructor Detail |
public OpExecutorFactory()
| Method Detail |
private static void initializeFromSystemProperty()
SYSTEM_PROPERTYprotected abstract OpExecutor _createExecutorForOp(Op op)
op - the Op requesting the OpExecutor
public static OpExecutor create(Op op)
op - the Op requesting the OpExecutor
Op.execute()public static void setDelegatingFactory(OpExecutorFactory delegatingFactory)
delegatingFactory - the new factory that will provide the OpExecutorspublic static OpExecutorFactory getDelegatingFactory()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||