Package xal.ca
Class ChannelFactory
java.lang.Object
xal.ca.ChannelFactory
- Direct Known Subclasses:
Epics7ChannelFactory
,Epics7ServerChannelFactory
ChannelFactory is a factory for generating channels.
- Author:
- tap
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Creates a new instance of ChannelFactory -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ChannelSystem
Get the associated channel system from the channel factory implementation.static ChannelFactory
Get the default factory which determines the low level channel implementationvoid
destroy()
protected abstract void
dispose()
static void
Dispose all channel systemsgetChannel
(String signalName) Get a channel associated with the signal name.getChannel
(String signalName, ValueTransform transform) Get a channel associated with the signal name and transform.abstract boolean
init()
Initialize the channel systemboolean
isTest()
protected abstract Channel
newChannel
(String signalName) Create a concrete channel which makes an appropriate low level channelprotected Channel
newChannel
(String signalName, ValueTransform transform) Create a new channel for the given signal name and set its value transform.protected static ChannelFactory
Instantiate a new ChannelFactorystatic ChannelFactory
Instantiate a new server ChannelFactoryabstract void
Print information about this factoryvoid
setTest
(boolean test) Sets the test flag.void
setTestSuffix
(String suffix) This method allows to define a suffix for all PVs when the test mode is enabled.
-
Field Details
-
testSuffix
-
-
Constructor Details
-
ChannelFactory
protected ChannelFactory()Creates a new instance of ChannelFactory
-
-
Method Details
-
init
public abstract boolean init()Initialize the channel system- Returns:
- true if the initialization was successful and false if not
-
dispose
protected abstract void dispose() -
destroy
public void destroy() -
disposeAll
public static void disposeAll()Dispose all channel systems -
getChannel
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
Get a channel associated with the signal name and transform. 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 channeltransform
- The channel's value transform- Returns:
- The channel corresponding to the signal name
-
newChannel
Create a concrete channel which makes an appropriate low level channel- Parameters:
signalName
- PV for which to create a new channel- Returns:
- a new channel for the specified signal name
-
newChannel
Create a new channel for the given signal name and set its value transform.- Parameters:
signalName
- The PV signal nametransform
- The value transform to use in the channel- Returns:
- The new channel
-
defaultFactory
Get the default factory which determines the low level channel implementation- Returns:
- The default channel factory
-
channelSystem
Get the associated channel system from the channel factory implementation.- Returns:
- The channel system
-
newFactory
Instantiate a new ChannelFactory- Returns:
- a new channel factory
-
newServerFactory
Instantiate a new server ChannelFactory- Returns:
- a new server channel factory
-
printInfo
public abstract void printInfo()Print information about this factory -
setTest
public void setTest(boolean test) Sets the test flag. If the test flag is on, the factory will add a suffix to the signal names to distinguish from the original signals. This is a useful feature to test applications, which can run a server with the test flag and the client will connect to the test channels.- Parameters:
test
-
-
isTest
public boolean isTest() -
setTestSuffix
This method allows to define a suffix for all PVs when the test mode is enabled. By default, the suffix is ":TEST".- Parameters:
suffix
-
-
getTestSuffix
-