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 void |
createAddress(SimpleString address,
EnumSet<RoutingType> routingTypes,
boolean autoCreated) |
abstract void |
createAddress(SimpleString address,
Set<RoutingType> routingTypes,
boolean autoCreated)
Deprecated.
|
abstract ClientConsumerInternal |
createConsumer(SimpleString queueName,
SimpleString filterString,
int priority,
int windowSize,
int maxRate,
int ackBatchSize,
boolean browseOnly,
Executor executor,
Executor flowControlExecutor) |
abstract void |
createQueue(QueueConfiguration queueConfiguration) |
abstract void |
createQueue(SimpleString address,
RoutingType routingType,
SimpleString queueName,
SimpleString filterString,
boolean durable,
boolean temp,
int maxConsumers,
boolean purgeOnNoConsumers,
boolean autoCreated)
Deprecated.
|
abstract void |
createQueue(SimpleString address,
RoutingType routingType,
SimpleString queueName,
SimpleString filterString,
boolean durable,
boolean temp,
int maxConsumers,
boolean purgeOnNoConsumers,
boolean autoCreated,
Boolean exclusive,
Boolean lastVale) |
abstract void |
createQueue(SimpleString address,
SimpleString queueName,
boolean temp,
boolean autoCreated,
QueueAttributes queueAttributes) |
abstract void |
createQueue(SimpleString address,
SimpleString queueName,
SimpleString filterString,
boolean durable,
boolean temp,
boolean autoCreated)
Deprecated.
|
abstract void |
createSharedQueue(QueueConfiguration queueConfiguration) |
abstract void |
createSharedQueue(SimpleString address,
SimpleString queueName,
QueueAttributes queueAttributes)
Deprecated.
|
abstract void |
createSharedQueue(SimpleString address,
SimpleString queueName,
RoutingType routingType,
SimpleString filterString,
boolean durable)
Deprecated.
|
abstract void |
createSharedQueue(SimpleString address,
SimpleString queueName,
RoutingType routingType,
SimpleString filterString,
boolean durable,
Integer maxConsumers,
Boolean purgeOnNoConsumers,
Boolean exclusive,
Boolean lastValue)
Deprecated.
|
abstract void |
createSharedQueue(SimpleString address,
SimpleString queueName,
SimpleString filterString,
boolean durable)
Deprecated.
|
abstract void |
deleteQueue(SimpleString queueName) |
abstract void |
expireMessage(ClientConsumer consumer,
Message message) |
abstract void |
forceDelivery(ClientConsumer consumer,
long sequence) |
abstract int |
getCreditsOnSendingFull(Message msgI) |
abstract int |
getDefaultConsumerWindowSize(SessionQueueQueryResponseMessage response) |
abstract int |
getReconnectID() |
RemotingConnection |
getRemotingConnection() |
abstract SendAcknowledgementHandler |
getSendAcknowledgementHandler() |
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,
ClientProducerCredits 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 either 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,
long consumerId,
boolean isSessionStarted) |
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(ICoreMessage msgI,
boolean sendBlocking,
SendAcknowledgementHandler handler,
SimpleString defaultAddress) |
abstract int |
sendInitialChunkOnLargeMessage(Message msgI)
it should return the number of credits (or bytes) used to send this packet
|
abstract int |
sendLargeMessageChunk(Message msgI,
long messageBodySize,
boolean sendBlocking,
boolean lastChunk,
byte[] chunk,
int reconnectID,
SendAcknowledgementHandler messageHandler) |
abstract void |
sendProducerCreditsMessage(int credits,
SimpleString address) |
abstract int |
sendServerLargeMessageChunk(Message 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 |
simpleCommit(boolean block) |
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 |
transferConnection(RemotingConnection newConnection)
Transfers the session context to the given newConnection on the client-side
|
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 void transferConnection(RemotingConnection newConnection)
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(Message msgI)
public abstract void sendFullMessage(ICoreMessage msgI, boolean sendBlocking, SendAcknowledgementHandler handler, SimpleString defaultAddress) throws ActiveMQException
ActiveMQException
public abstract int sendInitialChunkOnLargeMessage(Message msgI) throws ActiveMQException
msgI
- ActiveMQException
public abstract int sendLargeMessageChunk(Message msgI, long messageBodySize, boolean sendBlocking, boolean lastChunk, byte[] chunk, int reconnectID, SendAcknowledgementHandler messageHandler) throws ActiveMQException
ActiveMQException
public abstract int sendServerLargeMessageChunk(Message msgI, long messageBodySize, boolean sendBlocking, boolean lastChunk, byte[] chunk, SendAcknowledgementHandler messageHandler) throws ActiveMQException
ActiveMQException
public abstract void setSendAcknowledgementHandler(SendAcknowledgementHandler handler)
public abstract SendAcknowledgementHandler getSendAcknowledgementHandler()
@Deprecated public abstract void createSharedQueue(SimpleString address, SimpleString queueName, RoutingType routingType, SimpleString filterString, boolean durable, Integer maxConsumers, Boolean purgeOnNoConsumers, Boolean exclusive, Boolean lastValue) throws ActiveMQException
address
- queueName
- routingType
- filterString
- durable
- exclusive
- lastValue
- ActiveMQException
@Deprecated public abstract void createSharedQueue(SimpleString address, SimpleString queueName, QueueAttributes queueAttributes) throws ActiveMQException
address
- queueName
- queueAttributes
- ActiveMQException
@Deprecated public abstract void createSharedQueue(SimpleString address, SimpleString queueName, RoutingType routingType, SimpleString filterString, boolean durable) throws ActiveMQException
ActiveMQException
@Deprecated public abstract void createSharedQueue(SimpleString address, SimpleString queueName, SimpleString filterString, boolean durable) throws ActiveMQException
ActiveMQException
public abstract void createSharedQueue(QueueConfiguration queueConfiguration) throws ActiveMQException
ActiveMQException
public abstract void deleteQueue(SimpleString queueName) throws ActiveMQException
ActiveMQException
@Deprecated public abstract void createAddress(SimpleString address, Set<RoutingType> routingTypes, boolean autoCreated) throws ActiveMQException
ActiveMQException
public abstract void createAddress(SimpleString address, EnumSet<RoutingType> routingTypes, boolean autoCreated) throws ActiveMQException
ActiveMQException
@Deprecated public abstract void createQueue(SimpleString address, SimpleString queueName, SimpleString filterString, boolean durable, boolean temp, boolean autoCreated) throws ActiveMQException
ActiveMQException
@Deprecated public abstract void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filterString, boolean durable, boolean temp, int maxConsumers, boolean purgeOnNoConsumers, boolean autoCreated) throws ActiveMQException
ActiveMQException
public abstract void createQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filterString, boolean durable, boolean temp, int maxConsumers, boolean purgeOnNoConsumers, boolean autoCreated, Boolean exclusive, Boolean lastVale) throws ActiveMQException
ActiveMQException
public abstract void createQueue(SimpleString address, SimpleString queueName, boolean temp, boolean autoCreated, QueueAttributes queueAttributes) throws ActiveMQException
ActiveMQException
public abstract void createQueue(QueueConfiguration queueConfiguration) 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 simpleCommit(boolean block) 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 priority, 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, long consumerId, boolean isSessionStarted) throws ActiveMQException
ActiveMQException
public abstract void xaFailed(Xid xid) throws ActiveMQException
ActiveMQException
public abstract void restartSession() throws ActiveMQException
ActiveMQException
public abstract int getDefaultConsumerWindowSize(SessionQueueQueryResponseMessage response) 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, ClientProducerCredits clientProducerCredits)
public abstract boolean isWritable(ReadyListener callback)
Copyright © 2021 JBoss by Red Hat. All rights reserved.