Scala Monitoring and Control System API
com.lafros.macs.Di

trait Factory

[source: com/lafros/macs/Di.scala]

trait Factory
extends AnyRef
for creating Di instances. The following occurs when this class is loaded:
  1. properties will be loaded from macs-di.properties. If this file is not found in the 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, macs-di.policy, which must also be in the class-path.
Direct Known Subclasses:
dummy.Di.Factory

Method Summary
abstract def createDi (name : java.lang.String, driver : Driver, monitorGuiClassname : scala.Option[java.lang.String], controlsGuiClassname : scala.Option[java.lang.String], constants : scala.Option[java.io.Serializable]) : Di
variant accepting a driver instance (rather than class).
abstract def createDi (name : java.lang.String, driver : Driver, driverLock : AnyRef, monitorGuiClassname : scala.Option[java.lang.String], controlsGuiClassname : scala.Option[java.lang.String], constants : scala.Option[java.io.Serializable]) : Di
variant accepting a separate lock object.
abstract def createDi (name : java.lang.String, driverClass : java.lang.Class[Driver], monitorGuiClassname : scala.Option[java.lang.String], controlsGuiClassname : scala.Option[java.lang.String], constants : scala.Option[java.io.Serializable]) : Di
creates DI.
abstract def createStatuslessDi (name : java.lang.String, driver : NonPollableDriver, driverLock : AnyRef, controlsGuiClassname : scala.Option[java.lang.String], constants : scala.Option[java.io.Serializable]) : Di
variant accepting a separate lock object.
abstract def createStatuslessDi (name : java.lang.String, driver : NonPollableDriver, controlsGuiClassname : scala.Option[java.lang.String], constants : scala.Option[java.io.Serializable]) : Di
variant accepting a driver instance (rather than class).
abstract def createStatuslessDi (name : java.lang.String, driverClass : java.lang.Class[NonPollableDriver], controlsGuiClassname : scala.Option[java.lang.String], constants : scala.Option[java.io.Serializable]) : Di
as for createDi method, but for use where device has no status.
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
abstract def createDi(name : java.lang.String, driverClass : java.lang.Class[Driver], monitorGuiClassname : scala.Option[java.lang.String], controlsGuiClassname : scala.Option[java.lang.String], constants : scala.Option[java.io.Serializable]) : Di
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 com.lafros.macs.targets.<target> property will be substituted for the name of the target, and the values of com.lafros.macs.targets.<target>.hostname and com.lafros.macs.targets.<target>.isLocal will be applied. If these latter properties are not set, then com.lafros.macs.target.hostname and com.lafros.macs.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 - requires public constructor optionally taking a single argument corr'ding to constants (whose type should be the actual type of the constants object)
monitorGuiClassname - ditto, but impl'ting MonitorGui
controlsGuiClassname - ditto, but impl'ting ControlsGui; if None, commands will be limited to Strings submitted from a commandline
constants - constants.get will be passed to any public constructor taking a single argument, when instantiating the driver or GUI classes; a no-argument public constructor is required if constants is None, or if the class has no use for them
Throws
IllegalArgumentException - See Di.Factory.checkDiName(String).

abstract def createDi(name : java.lang.String, driver : Driver, monitorGuiClassname : scala.Option[java.lang.String], controlsGuiClassname : scala.Option[java.lang.String], constants : scala.Option[java.io.Serializable]) : Di
variant accepting a driver instance (rather than class).
Parameters
driver - The caller undertakes to acquire the lock on this before accessing it subsequently.

abstract def createDi(name : java.lang.String, driver : Driver, driverLock : AnyRef, monitorGuiClassname : scala.Option[java.lang.String], controlsGuiClassname : scala.Option[java.lang.String], constants : scala.Option[java.io.Serializable]) : Di
variant accepting a separate lock object.
Parameters
driverLock - The caller undertakes to acquire the lock on this before accessing driver subsequently.

abstract def createStatuslessDi(name : java.lang.String, driverClass : java.lang.Class[NonPollableDriver], controlsGuiClassname : scala.Option[java.lang.String], constants : scala.Option[java.io.Serializable]) : Di
as for createDi method, but for use where device has no status.

abstract def createStatuslessDi(name : java.lang.String, driver : NonPollableDriver, controlsGuiClassname : scala.Option[java.lang.String], constants : scala.Option[java.io.Serializable]) : Di
variant accepting a driver instance (rather than class).
Parameters
driver - The caller undertakes to acquire the lock on this before accessing it subsequently.

abstract def createStatuslessDi(name : java.lang.String, driver : NonPollableDriver, driverLock : AnyRef, controlsGuiClassname : scala.Option[java.lang.String], constants : scala.Option[java.io.Serializable]) : Di
variant accepting a separate lock object.
Parameters
driverLock - The caller undertakes to acquire the lock on this before accessing driver subsequently.


Copyright 2009 Latterfrosken Software Development Limited