JMACS

org.jmacs
Class IDi.AbstractFactory

java.lang.Object
  extended by org.jmacs.IDi.AbstractFactory
Enclosing interface:
IDi

public abstract static class IDi.AbstractFactory
extends Object

for creating IDi instances. The following occurs when this class is loaded:

  1. properties will be loaded from jmacs-di.properties. If this file is not found in the java class-path, or if the properties could not be loaded, a RuntimeException will be thrown.
  2. a security manager will be set, using * the policy file jmacs-di.policy if found in the java class-path.


Constructor Summary
IDi.AbstractFactory()
          creates new instance (when invoked by JMaCS implementation subclass).
 
Method Summary
abstract  IDi createDi(String name, Class driverClass, String monitorGuiClassname, String controlsGuiClassname, Serializable constants)
          creates DI.
abstract  IDi createDi(String name, IDi.IDriver driver, Object driverLock, String monitorGuiClassname, String controlsGuiClassname, Serializable constants)
          as above, but supplying a separate lock object.
abstract  IDi createDi(String name, IDi.IDriver driver, String monitorGuiClassname, String controlsGuiClassname, Serializable constants)
          as above, but supplying the driver instance (rather than class).
static IDi.AbstractFactory getInstance()
          returns global instance of class specified by the org.jmacs.IDi.AbstractFactory property--default value, com.lafros.jmacs.impln.di.Di$Factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IDi.AbstractFactory

public IDi.AbstractFactory()
creates new instance (when invoked by JMaCS implementation subclass).

Method Detail

getInstance

public static IDi.AbstractFactory getInstance()
returns global instance of class specified by the org.jmacs.IDi.AbstractFactory property--default value, com.lafros.jmacs.impln.di.Di$Factory.


createDi

public abstract IDi createDi(String name,
                             Class driverClass,
                             String monitorGuiClassname,
                             String controlsGuiClassname,
                             Serializable constants)
creates DI.

Parameters:
name - domain.like.name, determining the location of the DI in a logical hierarchy, and where the left-most portion is also the name of the target. If set, the value of the org.jmacs.targets.<target> property will be substituted for the name of the target, and the values of org.jmacs.targets.<target>.hostname and org.jmacs.targets.<target>.isLocal will be applied. If these latter properties are not set, then org.jmacs.target.hostname and org.jmacs.target.isLocal will apply. In this way, the name of the target may be configured at runtime, and more than one such target may be specified in the same JVM process.
driverClass - impl'ting IDi.IDriver and having public constructor optionally taking an argument of type Object, corr'ding to constants
monitorGuiClassname - ditto, but impl'ting IMonitorGui, or null
controlsGuiClassname - ditto, but impl'ting IControlsGui, or null (in which case commands will be limited to Strings submitted from a commandline)
constants - passed to the constructors of the named classes if non-null
Throws:
IllegalArgumentException - See IDi.Util.checkDiName(String).

createDi

public abstract IDi createDi(String name,
                             IDi.IDriver driver,
                             String monitorGuiClassname,
                             String controlsGuiClassname,
                             Serializable constants)
as above, but supplying the driver instance (rather than class).

Parameters:
driver - The caller undertakes to acquire the lock on this before accessing it subsequently.

createDi

public abstract IDi createDi(String name,
                             IDi.IDriver driver,
                             Object driverLock,
                             String monitorGuiClassname,
                             String controlsGuiClassname,
                             Serializable constants)
as above, but supplying a separate lock object.

Parameters:
driverLock - The caller undertakes to acquire the lock on this before accessing driver subsequently.

JMACS

jmacs.org