|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.cosylab.epics.caj.cas.CASTransport
public class CASTransport
CAS transport implementation.
| Field Summary | |
|---|---|
protected ResponseHandler |
responseHandler
CAS reponse handler. |
| Constructor Summary | |
|---|---|
CASTransport(CAContext context,
SocketChannel channel)
|
|
| Method Summary | |
|---|---|
void |
close(boolean forced)
Close connection. |
void |
depreallocateChannelSID(int sid)
De-preallocate new channel SID. |
void |
eventsOff()
Turn event dispatching off. |
void |
eventsOn()
Turn event dispatching on. |
boolean |
flush()
Flush send buffer. |
boolean |
flushInternal()
Flush send buffer (blocks until flushed). |
gov.aps.jca.cas.ServerChannel |
getChannel(int sid)
Get channel by its SID. |
gov.aps.jca.cas.ServerChannel |
getChannelAndVerifyRequest(int sid,
short dataType,
int dataCount)
Get channel by its SID and do some additional checks. |
int |
getChannelCount()
Get channel count. |
String |
getClientHostname()
Get client hostname. |
String |
getClientUsername()
Get client username. |
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. |
boolean |
hasReplaceEventPolicy()
Get replace event policy flag. |
int |
preallocateChannelSID()
Preallocate new channel SID. |
boolean |
processEvents(Runnable event)
Process event. |
protected void |
processRead()
Process input (read) IO event. |
protected void |
processWrite()
Process output (write) IO event. |
void |
registerChannel(int sid,
gov.aps.jca.cas.ServerChannel channel)
Register a new channel. |
void |
run()
Event dispatching is done here. |
void |
send(ByteBuffer buffer)
Send a buffer through the transport. |
void |
setClientHostname(String clientHostname)
Set client hostname. |
void |
setClientUsername(String clientUsername)
Set client username. |
void |
setMinorRevision(short minorRevision)
Set minor revision number. |
void |
setPriority(short priority)
Set transport priority. |
void |
submit(Request requestMessage)
Enqueue (if supported or if necessary send immediately) request message. |
void |
unregisterChannel(int sid)
Unregister a new channel (and deallocates its handle). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ResponseHandler responseHandler
| Constructor Detail |
|---|
public CASTransport(CAContext context,
SocketChannel channel)
context - channel - | Method Detail |
|---|
public void close(boolean forced)
forced - flag indicating if forced (e.g. forced disconnect) is requiredpublic short getMinorRevision()
Transport
getMinorRevision in interface TransportTransport.getMinorRevision()public void setMinorRevision(short minorRevision)
minorRevision - minor revision number.public void handleEvent(SelectionKey key)
handleEvent in interface ReactorHandlerkey - key to be processed.ReactorHandler.handleEvent(java.nio.channels.SelectionKey)protected void processRead()
protected void processWrite()
public void send(ByteBuffer buffer)
throws IOException
buffer - buffer to be sent
IOExceptionpublic 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()
Transport
getContext in interface TransportTransport.getContext()public InetSocketAddress getRemoteAddress()
Transport
getRemoteAddress in interface TransportTransport.getRemoteAddress()public short getPriority()
Transport
getPriority in interface TransportTransport.getPriority()public void setPriority(short priority)
public String getClientHostname()
null if unset.public String getClientUsername()
null if unset.public void setClientHostname(String clientHostname)
clientHostname - client hostname.public void setClientUsername(String clientUsername)
clientUsername - client username.public int preallocateChannelSID()
public void depreallocateChannelSID(int sid)
sid - preallocated channel SID.
public void registerChannel(int sid,
gov.aps.jca.cas.ServerChannel channel)
sid - preallocated channel SID.channel - channel to register.public void unregisterChannel(int sid)
sid - SIDpublic gov.aps.jca.cas.ServerChannel getChannel(int sid)
sid - channel SID
null otherwise
public gov.aps.jca.cas.ServerChannel getChannelAndVerifyRequest(int sid,
short dataType,
int dataCount)
throws gov.aps.jca.CAStatusException
sid - channel SID
gov.aps.jca.CAStatusExceptionpublic int getChannelCount()
public void eventsOff()
public void eventsOn()
public final boolean hasReplaceEventPolicy()
public boolean processEvents(Runnable event)
event - event to be processed.
public void run()
run in interface RunnableRunnable.run()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||