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
ConstructorsModifierConstructorDescriptionprotectedCreates a new instance of ChannelFactory -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ChannelSystemGet the associated channel system from the channel factory implementation.static ChannelFactoryGet the default factory which determines the low level channel implementationvoiddestroy()protected abstract voiddispose()static voidDispose 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 booleaninit()Initialize the channel systembooleanisTest()protected abstract ChannelnewChannel(String signalName) Create a concrete channel which makes an appropriate low level channelprotected ChannelnewChannel(String signalName, ValueTransform transform) Create a new channel for the given signal name and set its value transform.protected static ChannelFactoryInstantiate a new ChannelFactorystatic ChannelFactoryInstantiate a new server ChannelFactoryabstract voidPrint information about this factoryvoidsetTest(boolean test) Sets the test flag.voidsetTestSuffix(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
-