|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.qpid.client.protocol.AMQProtocolSession
public class AMQProtocolSession
Wrapper for protocol session that provides type-safe access to session attributes. The underlying protocol session is still available but clients should not use it to obtain session attributes.
Field Summary | |
---|---|
protected java.util.concurrent.ConcurrentMap |
_channelId2SessionMap
Maps from the channel id to the AMQSession that it represents. |
protected java.util.concurrent.ConcurrentMap |
_channelId2UnprocessedMsgMap
Maps from a channel id to an unprocessed message. |
protected java.util.concurrent.ConcurrentMap |
_closingChannels
|
protected org.apache.mina.common.WriteFuture |
_lastWriteFuture
|
protected static org.apache.log4j.Logger |
_logger
|
protected org.apache.mina.common.IoSession |
_minaProtocolSession
|
protected AMQProtocolHandler |
_protocolHandler
The handler from which this session was created and which is used to handle protocol events. |
protected int |
_queueId
Counter to ensure unique queue names |
protected java.lang.Object |
_queueIdLock
|
protected static java.lang.String |
AMQ_CONNECTION
|
protected static java.lang.String |
CONNECTION_TUNE_PARAMETERS
|
protected static int |
LAST_WRITE_FUTURE_JOIN_TIMEOUT
|
static java.lang.String |
PROTOCOL_INITIATION_RECEIVED
|
protected static java.lang.String |
SASL_CLIENT
|
Fields inherited from interface org.apache.qpid.framing.ProtocolVersionList |
---|
PROTOCOL_MAJOR, PROTOCOL_MINOR, pv |
Constructor Summary | |
---|---|
AMQProtocolSession()
No-arg constructor for use by test subclass - has to initialise final vars NOT intended for use other then for test |
|
AMQProtocolSession(AMQProtocolHandler protocolHandler,
org.apache.mina.common.IoSession protocolSession,
AMQConnection connection)
|
Method Summary | |
---|---|
void |
addSessionByChannel(int channelId,
AMQSession session)
|
boolean |
channelClosed(int channelId,
int code,
java.lang.String text)
Called from the ChannelClose handler when a channel close frame is received. |
void |
closeProtocolSession()
|
void |
closeSession(AMQSession session)
Starts the process of closing a session |
void |
failover(java.lang.String host,
int port)
|
protected java.lang.String |
generateQueueName()
|
AMQConnection |
getAMQConnection()
|
java.lang.String |
getClientID()
|
ConnectionTuneParameters |
getConnectionTuneParameters()
|
org.apache.mina.common.IoSession |
getIoSession()
|
java.lang.String |
getPassword()
|
javax.security.sasl.SaslClient |
getSaslClient()
|
java.lang.String |
getUsername()
|
java.lang.String |
getVirtualHost()
|
void |
init()
|
void |
messageContentBodyReceived(int channelId,
org.apache.qpid.framing.ContentBody contentBody)
|
void |
messageContentHeaderReceived(int channelId,
org.apache.qpid.framing.ContentHeaderBody contentHeader)
|
void |
removeSessionByChannel(int channelId)
|
void |
setClientID(java.lang.String clientID)
|
void |
setConnectionTuneParameters(ConnectionTuneParameters params)
|
void |
setSaslClient(javax.security.sasl.SaslClient client)
Store the SASL client currently being used for the authentication handshake |
void |
unprocessedMessageReceived(UnprocessedMessage message)
Callback invoked from the BasicDeliverMethodHandler when a message has been received. |
void |
writeFrame(org.apache.qpid.framing.AMQDataBlock frame)
Convenience method that writes a frame to the protocol session. |
void |
writeFrame(org.apache.qpid.framing.AMQDataBlock frame,
boolean wait)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int LAST_WRITE_FUTURE_JOIN_TIMEOUT
protected static final org.apache.log4j.Logger _logger
public static final java.lang.String PROTOCOL_INITIATION_RECEIVED
protected static final java.lang.String CONNECTION_TUNE_PARAMETERS
protected static final java.lang.String AMQ_CONNECTION
protected static final java.lang.String SASL_CLIENT
protected final org.apache.mina.common.IoSession _minaProtocolSession
protected org.apache.mina.common.WriteFuture _lastWriteFuture
protected final AMQProtocolHandler _protocolHandler
protected java.util.concurrent.ConcurrentMap _channelId2SessionMap
protected java.util.concurrent.ConcurrentMap _closingChannels
protected java.util.concurrent.ConcurrentMap _channelId2UnprocessedMsgMap
protected int _queueId
protected final java.lang.Object _queueIdLock
Constructor Detail |
---|
public AMQProtocolSession()
public AMQProtocolSession(AMQProtocolHandler protocolHandler, org.apache.mina.common.IoSession protocolSession, AMQConnection connection)
Method Detail |
---|
public void init()
public java.lang.String getClientID()
public void setClientID(java.lang.String clientID) throws javax.jms.JMSException
javax.jms.JMSException
public java.lang.String getVirtualHost()
public java.lang.String getUsername()
public java.lang.String getPassword()
public org.apache.mina.common.IoSession getIoSession()
public javax.security.sasl.SaslClient getSaslClient()
public void setSaslClient(javax.security.sasl.SaslClient client)
client
- if non-null, stores this in the session. if null clears any existing client
being storedpublic ConnectionTuneParameters getConnectionTuneParameters()
public void setConnectionTuneParameters(ConnectionTuneParameters params)
public void unprocessedMessageReceived(UnprocessedMessage message) throws org.apache.qpid.AMQException
message
-
org.apache.qpid.AMQException
- if this was not expectedpublic void messageContentHeaderReceived(int channelId, org.apache.qpid.framing.ContentHeaderBody contentHeader) throws org.apache.qpid.AMQException
org.apache.qpid.AMQException
public void messageContentBodyReceived(int channelId, org.apache.qpid.framing.ContentBody contentBody) throws org.apache.qpid.AMQException
org.apache.qpid.AMQException
public void writeFrame(org.apache.qpid.framing.AMQDataBlock frame)
frame
- the frame to writepublic void writeFrame(org.apache.qpid.framing.AMQDataBlock frame, boolean wait)
public void addSessionByChannel(int channelId, AMQSession session)
public void removeSessionByChannel(int channelId)
public void closeSession(AMQSession session)
session
- the AMQSession being closedpublic boolean channelClosed(int channelId, int code, java.lang.String text)
channelId
- the id of the channel (session)
public AMQConnection getAMQConnection()
public void closeProtocolSession()
public void failover(java.lang.String host, int port)
protected java.lang.String generateQueueName()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |