| java.lang.Object org.jaffa.middleware.Factory
Factory | public class Factory (Code) | | Factory used by component managers to get a handle on the correct Implementation of the
Transaction Controller to use.
There is a System Setting in the framework.properties file that controls which implementation
the factory returns. This setting is either 1, 2 or 3
Setting 1 - This means that the Factory is in test mode, this means that it will go to an additional
properties file (middleware_test.properties) where it will look for a property with the
same (full) name as the interface class.
It expects to find a setting here to give the 'real' setting for the factory. If there is
no property or any other error, it assumes a '2-Tier' setting. If there is a propery
it must have the value 1, 2 or 3
Setting 2 - This means the Factory is in 2-tier Mode for all Interfaces
Setting 3 - This means the Factory is in 3-tier Mode for all Interfaces
How do the different Modes Work? Assuming the interface is in package XXX and is called IYYY.java
Test Mode - This assumes there is an implementing class called XXX.test.YYYTx.java.
This class should have fake implementations for all transaction methods such
that the presentation tier for the component can be fully tested.
2-Tier Mode - This assumes there is an implementing class called XXX.tx.YYYTx.java. This
implementing class should be the full implementation, and will be executed in
the presentation tier.
3-Tier Mode - This assumes there is an implementing class called XXX.ejb.YYYPx.java. This
implementing class is a Proxy to the real Transaction Controller. The proxy will
communicate with a Session Bean which will wrapper the real tranaction class
(normally called XXX.tx.YYYTx.java)
author: GautamJ/PaulE version: 2.0 |
Method Summary | |
public static Object | createObject(Class interfaceClass) Creates the Real Transaction Controller Object To Be Used
Based on the configuration settings. |
createObject | public static Object createObject(Class interfaceClass) throws CreateServiceException(Code) | | Creates the Real Transaction Controller Object To Be Used
Based on the configuration settings. The real
object may be either a Test Rig, a Local Implemntation or a Proxy
Parameters: interfaceClass - The name of the interface that the transaction controller bust be implementing throws: CreateServiceException - Thrown if the correct object could not be created Returns the specified obejct that implements thereqiured interface. This object on return should becasted back to the interface name that was passed in,not to a specific object instance. |
|
|