gov.sns.ca
Class ChannelFactory

java.lang.Object
  |
  +--gov.sns.ca.ChannelFactory
Direct Known Subclasses:
JcaChannelFactory

public abstract class ChannelFactory
extends java.lang.Object

ChannelFactory is a factory for generating channels.


Field Summary
protected  java.util.Map channelMap
           
protected static ChannelFactory defaultFactory
           
 
Constructor Summary
protected ChannelFactory()
          Creates a new instance of ChannelFactory
 
Method Summary
protected abstract  ChannelSystem channelSystem()
          Get the associated channel system from the channel factory implementation.
static ChannelFactory defaultFactory()
          Get the default factory which determines the low level channel implementation
 Channel getChannel(java.lang.String signalName)
          Get a channel associated with the signal name.
 Channel getChannel(java.lang.String signalName, ValueTransform transform)
          Get a channel associated with the signal name.
abstract  boolean init()
          Initialize the channel system
protected abstract  Channel newChannel(java.lang.String signalName)
          Create a concrete channel which makes an appropriate low level channel
protected  Channel newChannel(java.lang.String signalName, ValueTransform transform)
          Create a new channel for the given signal name and set its value transform.
protected static ChannelFactory newFactory()
          Instantiate a new ChannelFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultFactory

protected static ChannelFactory defaultFactory

channelMap

protected java.util.Map channelMap
Constructor Detail

ChannelFactory

protected ChannelFactory()
Creates a new instance of ChannelFactory

Method Detail

init

public abstract boolean init()
Initialize the channel system

Returns:
true if the initialization was successful and false if not

getChannel

public Channel getChannel(java.lang.String signalName)
Get a channel associated with the signal name. If the channel is already in our map, then return it, otherwise create a new one and add it to our channel map.

Parameters:
signalName - The PV signal name of the channel
Returns:
The channel corresponding to the signal name

getChannel

public Channel getChannel(java.lang.String signalName,
                          ValueTransform transform)
Get a channel associated with the signal name. If the channel is already in our map, then return it, otherwise create a new one and add it to our channel map.

Parameters:
signalName - The PV signal name of the channel
transform - The channel's value transform
Returns:
The channel corresponding to the signal name

newChannel

protected abstract Channel newChannel(java.lang.String signalName)
Create a concrete channel which makes an appropriate low level channel

Returns:
a new channel for the specified signal name

newChannel

protected Channel newChannel(java.lang.String signalName,
                             ValueTransform transform)
Create a new channel for the given signal name and set its value transform.

Parameters:
signalName - The PV signal name
transform - The value transform to use in the channel
Returns:
The new channel

defaultFactory

public static ChannelFactory defaultFactory()
Get the default factory which determines the low level channel implementation

Returns:
The default channel factory

channelSystem

protected abstract ChannelSystem channelSystem()
Get the associated channel system from the channel factory implementation.

Returns:
The channel system

newFactory

protected static ChannelFactory newFactory()
Instantiate a new ChannelFactory

Returns:
a new channel factory