Package org.epics.ca.impl.requests
Class MonitorRequest<T>
- java.lang.Object
-
- org.epics.ca.impl.requests.MonitorRequest<T>
-
- Type Parameters:
T- the type of data which the monitor will transport.
- All Implemented Interfaces:
java.lang.AutoCloseable,NotifyResponseRequest,ResponseRequest,Monitor<T>
public class MonitorRequest<T> extends java.lang.Object implements Monitor<T>, NotifyResponseRequest
CA monitor for Type T.
-
-
Field Summary
Fields Modifier and Type Field Description protected ChannelImpl<?>channelChannel.protected java.util.concurrent.atomic.AtomicBooleanclosedClosed flag.protected java.util.function.Consumer<? super T>consumerReference to an object which will consume monitor update events.-
Fields inherited from interface org.epics.ca.Monitor
ALARM_MASK, LOG_MASK, PROPERTY_MASK, VALUE_MASK
-
-
Constructor Summary
Constructors Constructor Description MonitorRequest(ChannelImpl<?> channel, Transport transport, TypeSupports.TypeSupport<T> typeSupport, int mask, MonitorNotificationService<T> monitorNotificationService, java.util.function.Consumer<? super T> consumer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()Cancel response request (always to be called to complete/destroy).voidclose()voidexception(int errorCode, java.lang.String errorMessage)Exception response notification.intgetIOID()Get I/O ID.voidresponse(int status, short dataType, int dataCount, java.nio.ByteBuffer dataPayloadBuffer)Notification response.voidresubscribe(Transport transport)-
Methods inherited from interface org.epics.ca.Monitor
-
-
-
-
Field Detail
-
channel
protected final ChannelImpl<?> channel
Channel.
-
consumer
protected java.util.function.Consumer<? super T> consumer
Reference to an object which will consume monitor update events.
-
closed
protected final java.util.concurrent.atomic.AtomicBoolean closed
Closed flag.
-
-
Constructor Detail
-
MonitorRequest
public MonitorRequest(ChannelImpl<?> channel, Transport transport, TypeSupports.TypeSupport<T> typeSupport, int mask, MonitorNotificationService<T> monitorNotificationService, java.util.function.Consumer<? super T> consumer)
- Parameters:
channel- the channel.transport- the transport.typeSupport- the object which will provide type support.mask- the mask.monitorNotificationService- the monitor notification service.consumer- the consumer to be informed of monitor update events.
-
-
Method Detail
-
getIOID
public int getIOID()
Description copied from interface:ResponseRequestGet I/O ID.- Specified by:
getIOIDin interfaceResponseRequest- Returns:
- ioid
-
response
public void response(int status, short dataType, int dataCount, java.nio.ByteBuffer dataPayloadBuffer)Description copied from interface:NotifyResponseRequestNotification response.- Specified by:
responsein interfaceNotifyResponseRequest- Parameters:
status- the CA status code.dataType- the CA data type.dataCount- the CA channel element count.dataPayloadBuffer- the buffer with the payload
-
cancel
public void cancel()
Description copied from interface:ResponseRequestCancel response request (always to be called to complete/destroy).- Specified by:
cancelin interfaceResponseRequest
-
resubscribe
public void resubscribe(Transport transport)
-
exception
public void exception(int errorCode, java.lang.String errorMessage)Description copied from interface:ResponseRequestException response notification.- Specified by:
exceptionin interfaceResponseRequest- Parameters:
errorCode- exception code.errorMessage- received detailed message.
-
-