com.sun.jini.jeri.internal.mux
Class Session
java.lang.Object
com.sun.jini.jeri.internal.mux.Session
final class Session
- extends Object
A Session represents a single session of a multiplexed connection,
for either client-side and server-side perspective. The particular
role (CLIENT or SERVER) is indicated at construction time.
- Author:
- Sun Microsystems, Inc.
Nested Class Summary |
private class |
Session.MuxInputStream
Output stream returned by OutboundRequests and InboundRequests for
a session of a multiplexed connection. |
private class |
Session.MuxOutputStream
Output stream returned by OutboundRequests and InboundRequests for
a session of a multiplexed connection. |
Constructor Summary |
Session(Mux mux,
int sessionID,
int role)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CLIENT
static final int CLIENT
- See Also:
- Constant Field Values
SERVER
static final int SERVER
- See Also:
- Constant Field Values
IDLE
private static final int IDLE
- See Also:
- Constant Field Values
OPEN
private static final int OPEN
- See Also:
- Constant Field Values
FINISHED
private static final int FINISHED
- See Also:
- Constant Field Values
TERMINATED
private static final int TERMINATED
- See Also:
- Constant Field Values
stateNames
private static final String[] stateNames
systemThreadPool
private static final Executor systemThreadPool
- pool of threads for executing tasks in system thread group: used for
I/O (reader and writer) threads and other asynchronous tasks
logger
private static final Logger logger
- mux logger
mux
private final Mux mux
sessionID
private final int sessionID
role
private final int role
out
private final OutputStream out
in
private final InputStream in
sessionLock
private final Object sessionLock
- lock guarding all mutable instance state (below)
sessionDown
private boolean sessionDown
sessionDownMessage
private String sessionDownMessage
sessionDownCause
private Throwable sessionDownCause
outState
private int outState
outRation
private int outRation
outRationInfinite
private final boolean outRationInfinite
partialDeliveryStatus
private boolean partialDeliveryStatus
inState
private int inState
inRation
private int inRation
inRationInfinite
private final boolean inRationInfinite
inBufRemaining
private int inBufRemaining
inBufQueue
private final LinkedList inBufQueue
inBufPos
private int inBufPos
inEOF
private boolean inEOF
inClosed
private boolean inClosed
fakeOKtoWrite
private boolean fakeOKtoWrite
removeLater
private boolean removeLater
receivedAckRequired
private boolean receivedAckRequired
sentAcknowledgment
private boolean sentAcknowledgment
ackListeners
private Collection ackListeners
sentAckRequired
private boolean sentAckRequired
receivedAcknowledgment
private boolean receivedAcknowledgment
Session
Session(Mux mux,
int sessionID,
int role)
getOutboundRequest
OutboundRequest getOutboundRequest()
getInboundRequest
InboundRequest getInboundRequest()
abort
void abort()
setDown
void setDown(String message,
Throwable cause)
handleIncrementRation
void handleIncrementRation(int increment)
throws ProtocolException
- Throws:
ProtocolException
handleAbort
void handleAbort(boolean partial)
throws ProtocolException
- Throws:
ProtocolException
handleClose
void handleClose()
throws ProtocolException
- Throws:
ProtocolException
handleAcknowledgment
void handleAcknowledgment()
throws ProtocolException
- Throws:
ProtocolException
handleData
void handleData(ByteBuffer data,
boolean eof,
boolean close,
boolean ackRequired)
throws ProtocolException
- Throws:
ProtocolException
handleOpen
void handleOpen()
throws ProtocolException
- Throws:
ProtocolException
setOutState
private void setOutState(int newState)
setInState
private void setInState(int newState)
notifyAcknowledgmentListeners
private void notifyAcknowledgmentListeners(boolean received)
Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.