public abstract class SessionContext extends Object
Modifier and Type | Field and Description |
---|---|
protected IDGenerator |
idGenerator |
protected RemotingConnection |
remotingConnection |
protected SendAcknowledgementHandler |
sendAckHandler |
protected ClientSessionInternal |
session |
Constructor and Description |
---|
SessionContext(RemotingConnection remotingConnection) |
Modifier and Type | Method and Description |
---|---|
abstract ClientSession.AddressQuery |
addressQuery(SimpleString address) |
abstract void |
addSessionMetadata(String key,
String data) |
abstract void |
addUniqueMetaData(String key,
String data) |
abstract void |
cleanup() |
abstract void |
closeConsumer(ClientConsumer consumer) |
abstract boolean |
configureTransactionTimeout(int seconds) |
abstract ClientConsumerInternal |
createConsumer(SimpleString queueName,
SimpleString filterString,
int windowSize,
int maxRate,
int ackBatchSize,
boolean browseOnly,
Executor executor,
Executor flowControlExecutor) |
abstract void |
createQueue(SimpleString address,
SimpleString queueName,
SimpleString filterString,
boolean durable,
boolean temp) |
abstract void |
createSharedQueue(SimpleString address,
SimpleString queueName,
SimpleString filterString,
boolean durable) |
abstract void |
deleteQueue(SimpleString queueName) |
abstract void |
expireMessage(ClientConsumer consumer,
Message message) |
abstract void |
forceDelivery(ClientConsumer consumer,
long sequence) |
abstract int |
getCreditsOnSendingFull(MessageInternal msgI) |
abstract int |
getReconnectID() |
RemotingConnection |
getRemotingConnection() |
abstract int |
getServerVersion() |
ClientSessionInternal |
getSession() |
protected void |
handleReceiveContinuation(ConsumerContext consumerID,
byte[] chunk,
int flowControlSize,
boolean isContinues) |
protected void |
handleReceiveLargeMessage(ConsumerContext consumerID,
ClientLargeMessageInternal clientLargeMessage,
long largeMessageSize) |
protected void |
handleReceiveMessage(ConsumerContext consumerID,
ClientMessageInternal message) |
protected void |
handleReceiveProducerCredits(SimpleString address,
int credits) |
protected void |
handleReceiveProducerFailCredits(SimpleString address,
int credits) |
abstract boolean |
isWritable(ReadyListener callback) |
abstract void |
linkFlowControl(SimpleString address,
ClientProducerCreditsImpl clientProducerCredits) |
abstract void |
lockCommunications()
it will lock the communication channel of the session avoiding anything to come while failover is happening.
|
abstract ClientSession.QueueQuery |
queueQuery(SimpleString queueName) |
abstract boolean |
reattachOnNewConnection(RemotingConnection newConnection)
it will eather reattach or reconnect, preferably reattaching it.
|
abstract int |
recoverSessionTimeout()
Performs a round trip to the server requesting what is the current tx timeout on the session
|
abstract void |
recreateConsumerOnServer(ClientConsumerInternal consumerInternal) |
abstract void |
recreateSession(String username,
String password,
int minLargeMessageSize,
boolean xa,
boolean autoCommitSends,
boolean autoCommitAcks,
boolean preAcknowledge) |
abstract void |
releaseCommunications() |
abstract void |
resetMetadata(HashMap<String,String> metaDataToSend) |
abstract void |
resetName(String name) |
abstract void |
restartSession() |
abstract void |
returnBlocking(ActiveMQException cause)
Interrupt and return any blocked calls
|
abstract void |
sendACK(boolean individual,
boolean block,
ClientConsumer consumer,
Message message) |
abstract void |
sendConsumerCredits(ClientConsumer consumer,
int credits) |
abstract void |
sendFullMessage(MessageInternal msgI,
boolean sendBlocking,
SendAcknowledgementHandler handler,
SimpleString defaultAddress) |
abstract int |
sendInitialChunkOnLargeMessage(MessageInternal msgI)
it should return the number of credits (or bytes) used to send this packet
|
abstract int |
sendLargeMessageChunk(MessageInternal msgI,
long messageBodySize,
boolean sendBlocking,
boolean lastChunk,
byte[] chunk,
int reconnectID,
SendAcknowledgementHandler messageHandler) |
abstract void |
sendProducerCreditsMessage(int credits,
SimpleString address) |
abstract int |
sendServerLargeMessageChunk(MessageInternal msgI,
long messageBodySize,
boolean sendBlocking,
boolean lastChunk,
byte[] chunk,
SendAcknowledgementHandler messageHandler) |
abstract void |
sessionClose() |
abstract void |
sessionStart() |
abstract void |
sessionStop() |
abstract void |
setSendAcknowledgementHandler(SendAcknowledgementHandler handler) |
void |
setSession(ClientSessionInternal session) |
abstract void |
simpleCommit() |
abstract void |
simpleRollback(boolean lastMessageAsDelivered)
If we are doing a simple rollback on the RA, we need to ack the last message sent to the consumer,
otherwise DLQ won't work.
|
abstract boolean |
supportsLargeMessage() |
abstract void |
xaCommit(Xid xid,
boolean onePhase) |
abstract void |
xaEnd(Xid xid,
int flags) |
abstract void |
xaFailed(Xid xid) |
abstract void |
xaForget(Xid xid) |
abstract int |
xaPrepare(Xid xid) |
abstract void |
xaRollback(Xid xid,
boolean wasStarted) |
abstract Xid[] |
xaScan() |
abstract void |
xaStart(Xid xid,
int flags) |
protected ClientSessionInternal session
protected SendAcknowledgementHandler sendAckHandler
protected volatile RemotingConnection remotingConnection
protected final IDGenerator idGenerator
public SessionContext(RemotingConnection remotingConnection)
public ClientSessionInternal getSession()
public void setSession(ClientSessionInternal session)
public abstract void resetName(String name)
public abstract int getReconnectID()
public abstract boolean reattachOnNewConnection(RemotingConnection newConnection) throws ActiveMQException
newConnection
- ActiveMQException
public RemotingConnection getRemotingConnection()
public abstract void closeConsumer(ClientConsumer consumer) throws ActiveMQException
ActiveMQException
public abstract void sendConsumerCredits(ClientConsumer consumer, int credits)
public abstract boolean supportsLargeMessage()
protected void handleReceiveLargeMessage(ConsumerContext consumerID, ClientLargeMessageInternal clientLargeMessage, long largeMessageSize) throws Exception
Exception
protected void handleReceiveMessage(ConsumerContext consumerID, ClientMessageInternal message) throws Exception
Exception
protected void handleReceiveContinuation(ConsumerContext consumerID, byte[] chunk, int flowControlSize, boolean isContinues) throws Exception
Exception
protected void handleReceiveProducerCredits(SimpleString address, int credits)
protected void handleReceiveProducerFailCredits(SimpleString address, int credits)
public abstract int getCreditsOnSendingFull(MessageInternal msgI)
public abstract void sendFullMessage(MessageInternal msgI, boolean sendBlocking, SendAcknowledgementHandler handler, SimpleString defaultAddress) throws ActiveMQException
ActiveMQException
public abstract int sendInitialChunkOnLargeMessage(MessageInternal msgI) throws ActiveMQException
msgI
- ActiveMQException
public abstract int sendLargeMessageChunk(MessageInternal msgI, long messageBodySize, boolean sendBlocking, boolean lastChunk, byte[] chunk, int reconnectID, SendAcknowledgementHandler messageHandler) throws ActiveMQException
ActiveMQException
public abstract int sendServerLargeMessageChunk(MessageInternal msgI, long messageBodySize, boolean sendBlocking, boolean lastChunk, byte[] chunk, SendAcknowledgementHandler messageHandler) throws ActiveMQException
ActiveMQException
public abstract void setSendAcknowledgementHandler(SendAcknowledgementHandler handler)
public abstract void createSharedQueue(SimpleString address, SimpleString queueName, SimpleString filterString, boolean durable) throws ActiveMQException
ActiveMQException
public abstract void deleteQueue(SimpleString queueName) throws ActiveMQException
ActiveMQException
public abstract void createQueue(SimpleString address, SimpleString queueName, SimpleString filterString, boolean durable, boolean temp) throws ActiveMQException
ActiveMQException
public abstract ClientSession.QueueQuery queueQuery(SimpleString queueName) throws ActiveMQException
ActiveMQException
public abstract void forceDelivery(ClientConsumer consumer, long sequence) throws ActiveMQException
ActiveMQException
public abstract ClientSession.AddressQuery addressQuery(SimpleString address) throws ActiveMQException
ActiveMQException
public abstract void simpleCommit() throws ActiveMQException
ActiveMQException
public abstract void simpleRollback(boolean lastMessageAsDelivered) throws ActiveMQException
this is because we only ACK after on the RA, We may review this if we always acked earlier.
lastMessageAsDelivered
- ActiveMQException
public abstract void sessionStart() throws ActiveMQException
ActiveMQException
public abstract void sessionStop() throws ActiveMQException
ActiveMQException
public abstract void sendACK(boolean individual, boolean block, ClientConsumer consumer, Message message) throws ActiveMQException
ActiveMQException
public abstract void expireMessage(ClientConsumer consumer, Message message) throws ActiveMQException
ActiveMQException
public abstract void sessionClose() throws ActiveMQException
ActiveMQException
public abstract void addSessionMetadata(String key, String data) throws ActiveMQException
ActiveMQException
public abstract void addUniqueMetaData(String key, String data) throws ActiveMQException
ActiveMQException
public abstract void sendProducerCreditsMessage(int credits, SimpleString address)
public abstract void xaCommit(Xid xid, boolean onePhase) throws XAException, ActiveMQException
XAException
ActiveMQException
public abstract void xaEnd(Xid xid, int flags) throws XAException, ActiveMQException
XAException
ActiveMQException
public abstract void xaForget(Xid xid) throws XAException, ActiveMQException
XAException
ActiveMQException
public abstract int xaPrepare(Xid xid) throws XAException, ActiveMQException
XAException
ActiveMQException
public abstract Xid[] xaScan() throws ActiveMQException
ActiveMQException
public abstract void xaRollback(Xid xid, boolean wasStarted) throws ActiveMQException, XAException
ActiveMQException
XAException
public abstract void xaStart(Xid xid, int flags) throws XAException, ActiveMQException
XAException
ActiveMQException
public abstract boolean configureTransactionTimeout(int seconds) throws ActiveMQException
ActiveMQException
public abstract ClientConsumerInternal createConsumer(SimpleString queueName, SimpleString filterString, int windowSize, int maxRate, int ackBatchSize, boolean browseOnly, Executor executor, Executor flowControlExecutor) throws ActiveMQException
ActiveMQException
public abstract int recoverSessionTimeout() throws ActiveMQException
ActiveMQException
public abstract int getServerVersion()
public abstract void recreateSession(String username, String password, int minLargeMessageSize, boolean xa, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge) throws ActiveMQException
ActiveMQException
public abstract void recreateConsumerOnServer(ClientConsumerInternal consumerInternal) throws ActiveMQException
ActiveMQException
public abstract void xaFailed(Xid xid) throws ActiveMQException
ActiveMQException
public abstract void restartSession() throws ActiveMQException
ActiveMQException
public abstract void returnBlocking(ActiveMQException cause)
public abstract void lockCommunications()
public abstract void releaseCommunications()
public abstract void cleanup()
public abstract void linkFlowControl(SimpleString address, ClientProducerCreditsImpl clientProducerCredits)
public abstract boolean isWritable(ReadyListener callback)
Copyright © 2017 JBoss by Red Hat. All rights reserved.