org.jaffa.middleware
Class Factory

java.lang.Object
  extended byorg.jaffa.middleware.Factory

public class Factory
extends Object

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)

Version:
2.0
Author:
GautamJ/PaulE

Constructor Summary
Factory()
           
 
Method Summary
static Object createObject(Class interfaceClass)
          Creates the Real Transaction Controller Object To Be Used Based on the configuration settings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Factory

public Factory()
Method Detail

createObject

public static Object createObject(Class interfaceClass)
                           throws CreateServiceException
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
Returns:
Returns the specified obejct that implements the reqiured interface. This object on return should be casted back to the interface name that was passed in, not to a specific object instance.
Throws:
CreateServiceException - Thrown if the correct object could not be created


Copyright © 2002-2004 JAFFA Project.