public class AMQProtocolSession extends Object implements AMQVersionAwareProtocolSession
The underlying protocol session is still available but clients should not use it to obtain session attributes.
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
_logger |
protected static int |
LAST_WRITE_FUTURE_JOIN_TIMEOUT |
static int |
MAX_CHANNEL_MAX |
static int |
MIN_USABLE_CHANNEL_NUM |
| Constructor and Description |
|---|
AMQProtocolSession(AMQProtocolHandler protocolHandler,
AMQConnection connection) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
channelClosed(int channelId,
AMQConstant code,
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 |
confirmConsumerCancelled(int channelId,
AMQShortString consumerTag) |
void |
contentBodyReceived(int channelId,
ContentBody contentBody) |
void |
contentHeaderReceived(int channelId,
ContentHeaderBody contentHeader) |
void |
failover(String host,
int port) |
protected AMQShortString |
generateQueueName() |
AMQConnection |
getAMQConnection() |
protected ConcurrentMap<Integer,AMQSession> |
getChannelId2SessionMap()
Maps from the channel id to the AMQSession that it represents.
|
String |
getClientID() |
protected ConcurrentMap |
getClosingChannels() |
protected AMQConnection |
getConnection() |
FieldTable |
getConnectionStartServerProperties() |
ConnectionTuneParameters |
getConnectionTuneParameters() |
MethodDispatcher |
getMethodDispatcher() |
MethodRegistry |
getMethodRegistry() |
protected AMQProtocolHandler |
getProtocolHandler()
The handler from which this session was created and which is used to handle protocol events.
|
byte |
getProtocolMajorVersion() |
byte |
getProtocolMinorVersion() |
ProtocolVersion |
getProtocolVersion() |
protected int |
getQueueId()
Counter to ensure unique queue names
|
protected Object |
getQueueIdLock() |
SaslClient |
getSaslClient() |
Sender<ByteBuffer> |
getSender() |
protected AMQSession |
getSession(int channelId) |
AMQStateManager |
getStateManager() |
String |
getVirtualHost() |
void |
heartbeatBodyReceived(int channelId,
HeartbeatBody body) |
void |
init(ConnectionSettings settings) |
void |
methodFrameReceived(int channel,
AMQMethodBody amqMethodBody) |
void |
notifyError(Exception error) |
protected void |
setChannelId2SessionMap(ConcurrentMap<Integer,AMQSession> channelId2SessionMap) |
void |
setClientID(String clientID) |
protected void |
setClosingChannels(ConcurrentMap closingChannels) |
void |
setConnectionStartServerProperties(FieldTable serverProperties) |
void |
setFlowControl(int channelId,
boolean active) |
void |
setMaxFrameSize(long frameMax) |
void |
setMethodDispatcher(MethodDispatcher methodDispatcher) |
void |
setProtocolVersion(ProtocolVersion pv) |
protected void |
setQueueId(int queueId) |
void |
setSaslClient(SaslClient client)
Store the SASL client currently being used for the authentication handshake
|
void |
setSender(Sender<ByteBuffer> sender) |
void |
setTicket(int ticket,
int channelId) |
String |
toString() |
void |
tuneConnection(ConnectionTuneParameters params) |
void |
unprocessedMessageReceived(int channelId,
UnprocessedMessage message)
Callback invoked from the BasicDeliverMethodHandler when a message has been received.
|
void |
writeFrame(AMQDataBlock frame) |
protected static final int LAST_WRITE_FUTURE_JOIN_TIMEOUT
protected static final org.slf4j.Logger _logger
public static final int MAX_CHANNEL_MAX
public static final int MIN_USABLE_CHANNEL_NUM
public AMQProtocolSession(AMQProtocolHandler protocolHandler, AMQConnection connection)
public void init(ConnectionSettings settings)
public ConnectionTuneParameters getConnectionTuneParameters()
public void tuneConnection(ConnectionTuneParameters params)
public String getClientID()
public void setClientID(String clientID) throws javax.jms.JMSException
javax.jms.JMSExceptionpublic AMQStateManager getStateManager()
public String getVirtualHost()
public SaslClient getSaslClient()
public void setSaslClient(SaslClient client)
client - if non-null, stores this in the session. if null clears any existing client being storedpublic void unprocessedMessageReceived(int channelId,
UnprocessedMessage message)
throws AMQException
message - AMQException - if this was not expectedpublic void contentHeaderReceived(int channelId,
ContentHeaderBody contentHeader)
throws AMQException
contentHeaderReceived in interface AMQVersionAwareProtocolSessionAMQExceptionpublic void contentBodyReceived(int channelId,
ContentBody contentBody)
throws AMQException
contentBodyReceived in interface AMQVersionAwareProtocolSessionAMQExceptionpublic void heartbeatBodyReceived(int channelId,
HeartbeatBody body)
throws AMQException
heartbeatBodyReceived in interface AMQVersionAwareProtocolSessionAMQExceptionprotected AMQSession getSession(int channelId)
public void writeFrame(AMQDataBlock frame)
writeFrame in interface AMQProtocolWriterpublic void closeSession(AMQSession session)
session - the AMQSession being closedpublic boolean channelClosed(int channelId,
AMQConstant code,
String text)
throws AMQException
channelId - the id of the channel (session)AMQExceptionpublic AMQConnection getAMQConnection()
public void closeProtocolSession()
throws AMQException
AMQExceptionpublic Sender<ByteBuffer> getSender()
public void failover(String host, int port)
protected AMQShortString generateQueueName()
public void confirmConsumerCancelled(int channelId,
AMQShortString consumerTag)
public void setProtocolVersion(ProtocolVersion pv)
public byte getProtocolMinorVersion()
getProtocolMinorVersion in interface ProtocolVersionAwarepublic byte getProtocolMajorVersion()
getProtocolMajorVersion in interface ProtocolVersionAwarepublic ProtocolVersion getProtocolVersion()
getProtocolVersion in interface ProtocolVersionAwarepublic MethodRegistry getMethodRegistry()
getMethodRegistry in interface AMQVersionAwareProtocolSessionpublic MethodDispatcher getMethodDispatcher()
public void setTicket(int ticket,
int channelId)
public void setMethodDispatcher(MethodDispatcher methodDispatcher)
public void setFlowControl(int channelId,
boolean active)
public void methodFrameReceived(int channel,
AMQMethodBody amqMethodBody)
throws AMQException
methodFrameReceived in interface AMQVersionAwareProtocolSessionAMQExceptionpublic void notifyError(Exception error)
public void setSender(Sender<ByteBuffer> sender)
setSender in interface AMQVersionAwareProtocolSessionprotected AMQProtocolHandler getProtocolHandler()
protected ConcurrentMap<Integer,AMQSession> getChannelId2SessionMap()
protected void setChannelId2SessionMap(ConcurrentMap<Integer,AMQSession> channelId2SessionMap)
protected ConcurrentMap getClosingChannels()
protected void setClosingChannels(ConcurrentMap closingChannels)
protected int getQueueId()
protected void setQueueId(int queueId)
protected Object getQueueIdLock()
protected AMQConnection getConnection()
public void setConnectionStartServerProperties(FieldTable serverProperties)
public FieldTable getConnectionStartServerProperties()
public void setMaxFrameSize(long frameMax)
Copyright © 2006–2014 The Apache Software Foundation. All rights reserved.