Class MalcolmEpicsV4Connection
java.lang.Object
org.eclipse.scanning.connector.epics.MalcolmEpicsV4Connection
- All Implemented Interfaces:
IMalcolmConnection
This class uses EpicsV4 class to connect to an Epics V4 endpoint.
It provides the ability to get a pv, set a pv, call a method, and subsribe and unsubscribe to a pv.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.scanning.api.malcolm.connector.IMalcolmConnection
IMalcolmConnection.IMalcolmConnectionEventListener, IMalcolmConnection.IMalcolmConnectionStateListener -
Field Summary
Fields inherited from interface org.eclipse.scanning.api.malcolm.connector.IMalcolmConnection
ERROR_MESSAGE_PREFIX_FAILED_TO_CONNECT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCloses the connection.Returns the message generator.org.epics.pvdata.pv.PVStructure<U> UpvUnmarshal(org.epics.pvdata.pv.PVStructure anyObject, Class<U> beanClass) send(IMalcolmDevice device, MalcolmMessage message) Send the message and get one back, blocking, same as send(device, MalcolmMessage, true)protected MalcolmMessagesendGetMessage(IMalcolmDevice device, MalcolmMessage message) voidsubscribe(IMalcolmDevice device, MalcolmMessage subscribeMessage, IMalcolmConnection.IMalcolmConnectionEventListener listener) Subscribe to a message, adding the listener to the list of listeners for this messagevoidsubscribeToConnectionStateChange(IMalcolmDevice device, IMalcolmConnection.IMalcolmConnectionStateListener listener) Listens to connection state changes on the device, notifying the specified listener of any change.unsubscribe(IMalcolmDevice device, MalcolmMessage msg, IMalcolmConnection.IMalcolmConnectionEventListener... removeListeners) Unsubscribe to a message, if listeners is null all listeners will be unsubscribed, otherwise just those specified.
-
Constructor Details
-
MalcolmEpicsV4Connection
public MalcolmEpicsV4Connection()
-
-
Method Details
-
getMessageGenerator
Description copied from interface:IMalcolmConnectionReturns the message generator.- Specified by:
getMessageGeneratorin interfaceIMalcolmConnection- Returns:
-
disconnect
public void disconnect()Description copied from interface:IMalcolmConnectionCloses the connection.- Specified by:
disconnectin interfaceIMalcolmConnection
-
pvMarshal
- Throws:
Exception
-
pvUnmarshal
public <U> U pvUnmarshal(org.epics.pvdata.pv.PVStructure anyObject, Class<U> beanClass) throws Exception - Throws:
Exception
-
send
public MalcolmMessage send(IMalcolmDevice device, MalcolmMessage message) throws MalcolmDeviceException Description copied from interface:IMalcolmConnectionSend the message and get one back, blocking, same as send(device, MalcolmMessage, true)- Specified by:
sendin interfaceIMalcolmConnection- Parameters:
message-- Returns:
- Throws:
MalcolmDeviceException
-
subscribe
public void subscribe(IMalcolmDevice device, MalcolmMessage subscribeMessage, IMalcolmConnection.IMalcolmConnectionEventListener listener) throws MalcolmDeviceException Description copied from interface:IMalcolmConnectionSubscribe to a message, adding the listener to the list of listeners for this message- Specified by:
subscribein interfaceIMalcolmConnection- Parameters:
subscribeMessage-- Throws:
MalcolmDeviceException
-
subscribeToConnectionStateChange
public void subscribeToConnectionStateChange(IMalcolmDevice device, IMalcolmConnection.IMalcolmConnectionStateListener listener) throws MalcolmDeviceException Description copied from interface:IMalcolmConnectionListens to connection state changes on the device, notifying the specified listener of any change. This method blocks with no timeout until the connection is made, therefore this method should be called in a different thread.- Specified by:
subscribeToConnectionStateChangein interfaceIMalcolmConnection- Parameters:
device- the device to listen tolistener- the listener to be notified of changes- Throws:
MalcolmDeviceException
-
unsubscribe
public MalcolmMessage unsubscribe(IMalcolmDevice device, MalcolmMessage msg, IMalcolmConnection.IMalcolmConnectionEventListener... removeListeners) throws MalcolmDeviceException Description copied from interface:IMalcolmConnectionUnsubscribe to a message, if listeners is null all listeners will be unsubscribed, otherwise just those specified.- Specified by:
unsubscribein interfaceIMalcolmConnection- Parameters:
msg-- Returns:
- Throws:
MalcolmDeviceException
-
sendGetMessage
-