Package gda.epics.connection
Class EpicsChannelManager
java.lang.Object
gda.epics.connection.EpicsChannelManager
- All Implemented Interfaces:
gov.aps.jca.event.ConnectionListener,gov.aps.jca.event.PutListener,EventListener
public class EpicsChannelManager
extends Object
implements gov.aps.jca.event.ConnectionListener, gov.aps.jca.event.PutListener
EPICS channel (connection, monitor) manager.
-
Field Summary
FieldsModifier and TypeFieldDescriptionMap of all handled channels.protected Set<gov.aps.jca.Channel> protected EpicsControllerEPICS controller.protected booleanCreation phase completed flag.protected booleanDestruction status.protected booleanInitialization status.Map of initial values of the channels.protected Map<gov.aps.jca.Channel, gov.aps.jca.event.MonitorListener> Monitors to be installed.protected Map<gov.aps.jca.event.MonitorListener, EpicsController.MonitorType> Type of monitors.Map of all critical (non-optional) channels to be connected. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.EpicsChannelManager(InitializationListener listener) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidconnectionChanged(gov.aps.jca.event.ConnectionEvent event) gov.aps.jca.ChannelcreateChannel(String pvName) Creates (optional) channel without monitor listener.gov.aps.jca.ChannelcreateChannel(String pvName, boolean optional) Creates channel without monitor listener.gov.aps.jca.ChannelcreateChannel(String pvName, gov.aps.jca.event.MonitorListener listener) Creates (optional) channel with monitor.gov.aps.jca.ChannelcreateChannel(String pvName, gov.aps.jca.event.MonitorListener monitorListener, boolean optional) Create channel.gov.aps.jca.ChannelcreateChannel(String pvName, gov.aps.jca.event.MonitorListener monitorListener, boolean optional, double initialValue) Create channel.gov.aps.jca.ChannelcreateChannel(String pvName, gov.aps.jca.event.MonitorListener monitorListener, boolean optional, double[] initialValue) Create channel.gov.aps.jca.ChannelcreateChannel(String pvName, gov.aps.jca.event.MonitorListener monitorListener, boolean optional, float initialValue) Create channel.gov.aps.jca.ChannelcreateChannel(String pvName, gov.aps.jca.event.MonitorListener monitorListener, boolean optional, int initialValue) Create channel.gov.aps.jca.ChannelcreateChannel(String pvName, gov.aps.jca.event.MonitorListener monitorListener, boolean optional, int[] initialValue) Create channel.gov.aps.jca.ChannelcreateChannel(String pvName, gov.aps.jca.event.MonitorListener monitorListener, boolean optional, short initialValue) Create channel.gov.aps.jca.ChannelcreateChannel(String pvName, gov.aps.jca.event.MonitorListener monitorListener, boolean optional, String initialValue) Create channel.gov.aps.jca.ChannelcreateChannel(String pvName, gov.aps.jca.event.MonitorListener monitorListener, EpicsController.MonitorType monitorType, boolean optional) Create channel with Monitor type.voidNotify channel manager that creation phase has completed, so that it can issue a initializatonCompleted callback.voiddestroy()Destroy all channels.gov.aps.jca.ChannelgetChannel(String pvName) Get channel (if created by this instance).Map of all handled channelsvoidputCompleted(gov.aps.jca.event.PutEvent pev) Default (convenience) put listener - only prints out a message.booleantryInitialize(long timeoutInMs) Checks if initialized (all critical channels are connected), if not waits until done or for timeoutInMs ms.
-
Field Details
-
controller
EPICS controller. -
channels
Map of all handled channels. -
monitoredChannels
Monitors to be installed. -
initialValues
Map of initial values of the channels. -
monitorTypes
Type of monitors. -
unconnectedCriticalChannels
Map of all critical (non-optional) channels to be connected. -
connectedCriticalChannels
-
initialized
protected boolean initializedInitialization status. (sync on unconnectedCriticalChannels) -
destroyed
protected boolean destroyedDestruction status. (sync on channels) -
creationPhaseCompleted
protected boolean creationPhaseCompletedCreation phase completed flag. (sync on unconnectedCriticalChannels)
-
-
Constructor Details
-
EpicsChannelManager
public EpicsChannelManager()Default constructor. -
EpicsChannelManager
Constructor.- Parameters:
listener- initialization listener.
-
-
Method Details
-
createChannel
public gov.aps.jca.Channel createChannel(String pvName, gov.aps.jca.event.MonitorListener monitorListener, boolean optional) throws gov.aps.jca.CAException Create channel.- Parameters:
pvName-monitorListener-optional-- Returns:
- JCA channel instance.
- Throws:
gov.aps.jca.CAException
-
createChannel
public gov.aps.jca.Channel createChannel(String pvName, gov.aps.jca.event.MonitorListener monitorListener, EpicsController.MonitorType monitorType, boolean optional) throws gov.aps.jca.CAException Create channel with Monitor type.- Parameters:
pvName-monitorListener-monitorType-optional-- Returns:
- JCA channel instance.
- Throws:
gov.aps.jca.CAException
-
createChannel
public gov.aps.jca.Channel createChannel(String pvName, gov.aps.jca.event.MonitorListener monitorListener, boolean optional, double initialValue) throws gov.aps.jca.CAException Create channel.- Parameters:
pvName-monitorListener-optional-initialValue-- Returns:
- JCA channel instance.
- Throws:
gov.aps.jca.CAException
-
createChannel
public gov.aps.jca.Channel createChannel(String pvName, gov.aps.jca.event.MonitorListener monitorListener, boolean optional, float initialValue) throws gov.aps.jca.CAException Create channel.- Parameters:
pvName-monitorListener-optional-initialValue-- Returns:
- JCA channel instance.
- Throws:
gov.aps.jca.CAException
-
createChannel
public gov.aps.jca.Channel createChannel(String pvName, gov.aps.jca.event.MonitorListener monitorListener, boolean optional, int initialValue) throws gov.aps.jca.CAException Create channel.- Parameters:
pvName-monitorListener-optional-initialValue-- Returns:
- JCA channel instance.
- Throws:
gov.aps.jca.CAException
-
createChannel
public gov.aps.jca.Channel createChannel(String pvName, gov.aps.jca.event.MonitorListener monitorListener, boolean optional, short initialValue) throws gov.aps.jca.CAException Create channel.- Parameters:
pvName-monitorListener-optional-initialValue-- Returns:
- JCA channel instance.
- Throws:
gov.aps.jca.CAException
-
createChannel
public gov.aps.jca.Channel createChannel(String pvName, gov.aps.jca.event.MonitorListener monitorListener, boolean optional, String initialValue) throws gov.aps.jca.CAException Create channel.- Parameters:
pvName-monitorListener-optional-initialValue-- Returns:
- JCA channel instance.
- Throws:
gov.aps.jca.CAException
-
createChannel
public gov.aps.jca.Channel createChannel(String pvName, gov.aps.jca.event.MonitorListener monitorListener, boolean optional, double[] initialValue) throws gov.aps.jca.CAException Create channel.- Parameters:
pvName-monitorListener-optional-initialValue-- Returns:
- JCA channel instance.
- Throws:
gov.aps.jca.CAException
-
createChannel
public gov.aps.jca.Channel createChannel(String pvName, gov.aps.jca.event.MonitorListener monitorListener, boolean optional, int[] initialValue) throws gov.aps.jca.CAException Create channel.- Parameters:
pvName-monitorListener-optional-initialValue-- Returns:
- JCA channel instance.
- Throws:
gov.aps.jca.CAException
-
createChannel
public gov.aps.jca.Channel createChannel(String pvName, boolean optional) throws gov.aps.jca.CAException Creates channel without monitor listener.- Parameters:
pvName-optional-- Returns:
- JCA channel instance.
- Throws:
gov.aps.jca.CAException
-
createChannel
Creates (optional) channel without monitor listener.- Parameters:
pvName-- Returns:
- JCA channel instance.
- Throws:
gov.aps.jca.CAException
-
createChannel
public gov.aps.jca.Channel createChannel(String pvName, gov.aps.jca.event.MonitorListener listener) throws gov.aps.jca.CAException Creates (optional) channel with monitor.- Parameters:
pvName-listener-- Returns:
- JCA channel instance.
- Throws:
gov.aps.jca.CAException
-
connectionChanged
public void connectionChanged(gov.aps.jca.event.ConnectionEvent event) - Specified by:
connectionChangedin interfacegov.aps.jca.event.ConnectionListener
-
tryInitialize
public boolean tryInitialize(long timeoutInMs) Checks if initialized (all critical channels are connected), if not waits until done or for timeoutInMs ms.- Parameters:
timeoutInMs-- Returns:
- initialization status
-
putCompleted
public void putCompleted(gov.aps.jca.event.PutEvent pev) Default (convenience) put listener - only prints out a message.- Specified by:
putCompletedin interfacegov.aps.jca.event.PutListener- See Also:
-
getChannel
Get channel (if created by this instance).- Parameters:
pvName-- Returns:
- channel instance or
null
-
getChannels
Map of all handled channels- Returns:
- map of all handled channels.
-
destroy
public void destroy()Destroy all channels. -
creationPhaseCompleted
public void creationPhaseCompleted()Notify channel manager that creation phase has completed, so that it can issue a initializatonCompleted callback. NOTE: this is needed not to issue the notification before all channels of a particular device are registered to the channel manager.
-