public class CATransport extends Object implements Transport, ReactorHandler, Timer.TimerRunnable
| Modifier and Type | Field and Description |
|---|---|
protected short |
priority
Process priority.
|
protected ResponseHandler |
responseHandler
CA reponse handler.
|
| Constructor and Description |
|---|
CATransport(CAJContext context,
TransportClient client,
ResponseHandler responseHandler,
SocketChannel channel,
short remoteTransportRevision,
short priority) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acquire(TransportClient client)
Acquires transport.
|
void |
beaconArrivalNotify()
Beacon arrival.
|
void |
changedTransport()
Changed transport (server restarted) notify.
|
void |
close(boolean forced)
Close connection.
|
protected void |
disableFlowControl()
Disable flow control (enables events).
|
void |
echoNotify()
Called when echo request (state-of-health message) was responed.
|
protected void |
enableFlowControl()
Enable flow control (disables events).
|
boolean |
flush()
Flush send buffer.
|
boolean |
flushInternal()
Flush send buffer (blocks until flushed).
|
CAContext |
getContext()
Get context transport is living in.
|
short |
getMinorRevision()
Transport protocol minor revision.
|
short |
getPriority()
Transport priority.
|
InetSocketAddress |
getRemoteAddress()
Get remote address.
|
void |
handleEvent(SelectionKey key)
Handle IO event.
|
protected void |
processRead()
Process input (read) IO event.
|
protected void |
processRead(ByteBuffer socketBuffer)
Process input.
|
protected void |
processWrite()
Process output (write) IO event.
|
void |
release(TransportClient client)
Releases transport.
|
void |
send(ByteBuffer buffer,
boolean asyncCloseOnError)
Send a buffer through the transport.
|
void |
setMinorRevision(short rev) |
void |
submit(Request requestMessage)
Enqueue (if supported or if necessary send immediately) request message.
|
void |
timeout(long timeToRun)
Beacon timer.
|
void |
updateUserName()
Sends client username message to the server.
|
protected ResponseHandler responseHandler
protected short priority
public CATransport(CAJContext context, TransportClient client, ResponseHandler responseHandler, SocketChannel channel, short remoteTransportRevision, short priority)
context - responseHandler - client - channel - remoteTransportRevision - priority - public void close(boolean forced)
forced - flag indicating if forced (e.g. forced disconnect) is requiredpublic boolean acquire(TransportClient client)
client - client (channel) acquiring the transporttrue if transport was granted, false otherwise.public void release(TransportClient client)
client - client (channel) releasing the transportpublic short getMinorRevision()
TransportgetMinorRevision in interface TransportTransport.getMinorRevision()public void setMinorRevision(short rev)
public void handleEvent(SelectionKey key)
handleEvent in interface ReactorHandlerkey - key to be processed.ReactorHandler.handleEvent(java.nio.channels.SelectionKey)protected void processRead()
protected void processRead(ByteBuffer socketBuffer)
protected void processWrite()
public void updateUserName()
protected void disableFlowControl()
protected void enableFlowControl()
public void send(ByteBuffer buffer, boolean asyncCloseOnError) throws IOException
buffer - buffer to be sentIOExceptionpublic boolean flush()
flush in interface Transporttrue on success, false on failure.Transport.flush()public boolean flushInternal()
Transport.flush()public void submit(Request requestMessage) throws IOException
TransportSEND_IMMEDIATELY_PRIORITY.submit in interface TransportrequestMessage - request message to enqueue.IOExceptionTransport.submit(com.cosylab.epics.caj.impl.Request)public CAContext getContext()
TransportgetContext in interface TransportTransport.getContext()public InetSocketAddress getRemoteAddress()
TransportgetRemoteAddress in interface TransportTransport.getRemoteAddress()public short getPriority()
TransportgetPriority in interface TransportTransport.getPriority()public void beaconArrivalNotify()
public void timeout(long timeToRun)
timeout in interface Timer.TimerRunnabletimeToRun - time in ms to run.Timer.TimerRunnable.timeout(long)public void echoNotify()
public void changedTransport()
Copyright © 2004-2020 EPICS. All Rights Reserved.