|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.retrogui.messageserver.common.Session
Create message handlers that process inbound and outbound messages. After instantiating a new Session, call startMessageHandlers() to start the processing threads.
closeSession() will stop inbound and outbound queue and close socket If sessionControl isSendAndReceiveMessages() is false then sendMessage() and getMessage() do not function and do not throw exception - typically done prior to a shutdown.
| Constructor Summary | |
Session(ISessionControl sessionControl,
java.net.Socket socket)
Constructor |
|
| Method Summary | |
void |
closeSession()
close the session, stop the inbound & outbound queues and close the socket |
protected InboundMessageHandler |
getInboundHandler()
getter |
protected java.io.BufferedReader |
getInstream()
getter |
javax.security.auth.login.LoginContext |
getLoginContext()
|
Message |
getMessage(boolean blockUntilMessage)
get next inbound message from queue if blockUntilMessage=false then return null if no messages in queue if blockUntilMessage=true then block until message comes in. |
protected OutboundMessageHandler |
getOutboundHandler()
getter |
protected java.io.PrintStream |
getOutstream()
getter |
java.security.cert.Certificate[] |
getRemoteCertificates()
get remote client certificates (if available) for ie. |
java.lang.String |
getRemoteHost()
get remote host ip |
int |
getRemotePort()
get remote port |
ISessionControl |
getSessionControl()
DOCUMENT ME! |
long |
getSessionId()
getter |
protected java.net.Socket |
getSocket()
getter |
void |
sendMessage(Message msg)
send a message, throws exceptions if session is invalid or send-receive flag is false. |
protected void |
setInboundHandler(InboundMessageHandler inboundHandler)
setter |
protected void |
setInstream(java.io.BufferedReader instream)
setter |
void |
setLoginContext(javax.security.auth.login.LoginContext loginContext)
|
protected void |
setOutboundHandler(OutboundMessageHandler outboundHandler)
setter |
protected void |
setOutstream(java.io.PrintStream outstream)
setter |
void |
setSessionControl(ISessionControl sessionControl)
DOCUMENT ME! |
void |
setSessionId(long sessionId)
setter |
protected void |
setSocket(java.net.Socket socket)
setter |
void |
startMessageHandlers()
Start the handler threads so that the inbound and outbound messages will be processed. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Session(ISessionControl sessionControl,
java.net.Socket socket)
throws java.io.IOException
sessionControl - - usually a MessageClient or MessageServer objectsocket - - the client socket
java.io.IOException| Method Detail |
public void startMessageHandlers()
public java.lang.String getRemoteHost()
public int getRemotePort()
public java.security.cert.Certificate[] getRemoteCertificates()
public void sendMessage(Message msg)
throws SessionException
msg -
SessionException
public Message getMessage(boolean blockUntilMessage)
throws SessionException
blockUntilMessage -
SessionExceptionpublic void closeSession()
protected void setSocket(java.net.Socket socket)
socket - protected java.net.Socket getSocket()
protected void setInstream(java.io.BufferedReader instream)
instream - protected java.io.BufferedReader getInstream()
protected void setOutstream(java.io.PrintStream outstream)
outstream - protected java.io.PrintStream getOutstream()
public void setSessionId(long sessionId)
sessionId - public long getSessionId()
protected void setInboundHandler(InboundMessageHandler inboundHandler)
inboundHandler - protected InboundMessageHandler getInboundHandler()
protected void setOutboundHandler(OutboundMessageHandler outboundHandler)
outboundHandler - protected OutboundMessageHandler getOutboundHandler()
public void setSessionControl(ISessionControl sessionControl)
sessionControl - public ISessionControl getSessionControl()
public void setLoginContext(javax.security.auth.login.LoginContext loginContext)
loginContext - The loginContext to set.public javax.security.auth.login.LoginContext getLoginContext()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||