public abstract class SessionContext extends Object
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.activemq.artemis.utils.IDGenerator |
idGenerator |
protected RemotingConnection |
remotingConnection |
protected SendAcknowledgementHandler |
sendAckHandler |
protected org.apache.activemq.artemis.core.client.impl.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 org.apache.activemq.artemis.core.client.impl.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(org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionQueueQueryResponseMessage response) |
abstract int |
getReconnectID() |
RemotingConnection |
getRemotingConnection() |
abstract SendAcknowledgementHandler |
getSendAcknowledgementHandler() |
abstract int |
getServerVersion() |
org.apache.activemq.artemis.core.client.impl.ClientSessionInternal |
getSession() |
protected void |
handleReceiveContinuation(ConsumerContext consumerID,
byte[] chunk,
int flowControlSize,
boolean isContinues) |
protected void |
handleReceiveLargeMessage(ConsumerContext consumerID,
org.apache.activemq.artemis.core.client.impl.ClientLargeMessageInternal clientLargeMessage,
long largeMessageSize) |
protected void |
handleReceiveMessage(ConsumerContext consumerID,
org.apache.activemq.artemis.core.client.impl.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,
org.apache.activemq.artemis.core.client.impl.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(org.apache.activemq.artemis.core.client.impl.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(org.apache.activemq.artemis.core.client.impl.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 |
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 org.apache.activemq.artemis.core.client.impl.ClientSessionInternal session
protected SendAcknowledgementHandler sendAckHandler
protected volatile RemotingConnection remotingConnection
protected final org.apache.activemq.artemis.utils.IDGenerator idGenerator
public SessionContext(RemotingConnection remotingConnection)
public org.apache.activemq.artemis.core.client.impl.ClientSessionInternal getSession()
public void setSession(org.apache.activemq.artemis.core.client.impl.ClientSessionInternal session)
public abstract void resetName(String name)
public abstract int getReconnectID()
public abstract boolean reattachOnNewConnection(RemotingConnection newConnection) throws ActiveMQException
newConnection - ActiveMQExceptionpublic RemotingConnection getRemotingConnection()
public abstract void closeConsumer(ClientConsumer consumer) throws ActiveMQException
ActiveMQExceptionpublic abstract void sendConsumerCredits(ClientConsumer consumer, int credits)
public abstract boolean supportsLargeMessage()
protected void handleReceiveLargeMessage(ConsumerContext consumerID, org.apache.activemq.artemis.core.client.impl.ClientLargeMessageInternal clientLargeMessage, long largeMessageSize) throws Exception
Exceptionprotected void handleReceiveMessage(ConsumerContext consumerID, org.apache.activemq.artemis.core.client.impl.ClientMessageInternal message) throws Exception
Exceptionprotected void handleReceiveContinuation(ConsumerContext consumerID, byte[] chunk, int flowControlSize, boolean isContinues) throws Exception
Exceptionprotected 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
ActiveMQExceptionpublic abstract int sendInitialChunkOnLargeMessage(Message msgI) throws ActiveMQException
msgI - ActiveMQExceptionpublic abstract int sendLargeMessageChunk(Message msgI, long messageBodySize, boolean sendBlocking, boolean lastChunk, byte[] chunk, int reconnectID, SendAcknowledgementHandler messageHandler) throws ActiveMQException
ActiveMQExceptionpublic abstract int sendServerLargeMessageChunk(Message msgI, long messageBodySize, boolean sendBlocking, boolean lastChunk, byte[] chunk, SendAcknowledgementHandler messageHandler) throws ActiveMQException
ActiveMQExceptionpublic 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
ActiveMQExceptionpublic abstract void createSharedQueue(QueueConfiguration queueConfiguration) throws ActiveMQException
ActiveMQExceptionpublic abstract void deleteQueue(SimpleString queueName) throws ActiveMQException
ActiveMQException@Deprecated public abstract void createAddress(SimpleString address, Set<RoutingType> routingTypes, boolean autoCreated) throws ActiveMQException
ActiveMQExceptionpublic 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
ActiveMQExceptionpublic 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
ActiveMQExceptionpublic abstract void createQueue(SimpleString address, SimpleString queueName, boolean temp, boolean autoCreated, QueueAttributes queueAttributes) throws ActiveMQException
ActiveMQExceptionpublic abstract void createQueue(QueueConfiguration queueConfiguration) throws ActiveMQException
ActiveMQExceptionpublic abstract ClientSession.QueueQuery queueQuery(SimpleString queueName) throws ActiveMQException
ActiveMQExceptionpublic abstract void forceDelivery(ClientConsumer consumer, long sequence) throws ActiveMQException
ActiveMQExceptionpublic abstract ClientSession.AddressQuery addressQuery(SimpleString address) throws ActiveMQException
ActiveMQExceptionpublic abstract void simpleCommit()
throws ActiveMQException
ActiveMQExceptionpublic abstract void simpleCommit(boolean block)
throws ActiveMQException
ActiveMQExceptionpublic 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 - ActiveMQExceptionpublic abstract void sessionStart()
throws ActiveMQException
ActiveMQExceptionpublic abstract void sessionStop()
throws ActiveMQException
ActiveMQExceptionpublic abstract void sendACK(boolean individual,
boolean block,
ClientConsumer consumer,
Message message)
throws ActiveMQException
ActiveMQExceptionpublic abstract void expireMessage(ClientConsumer consumer, Message message) throws ActiveMQException
ActiveMQExceptionpublic abstract void sessionClose()
throws ActiveMQException
ActiveMQExceptionpublic abstract void addSessionMetadata(String key, String data) throws ActiveMQException
ActiveMQExceptionpublic abstract void addUniqueMetaData(String key, String data) throws ActiveMQException
ActiveMQExceptionpublic abstract void sendProducerCreditsMessage(int credits,
SimpleString address)
public abstract void xaCommit(Xid xid, boolean onePhase) throws XAException, ActiveMQException
XAExceptionActiveMQExceptionpublic abstract void xaEnd(Xid xid, int flags) throws XAException, ActiveMQException
XAExceptionActiveMQExceptionpublic abstract void xaForget(Xid xid) throws XAException, ActiveMQException
XAExceptionActiveMQExceptionpublic abstract int xaPrepare(Xid xid) throws XAException, ActiveMQException
XAExceptionActiveMQExceptionpublic abstract Xid[] xaScan() throws ActiveMQException
ActiveMQExceptionpublic abstract void xaRollback(Xid xid, boolean wasStarted) throws ActiveMQException, XAException
ActiveMQExceptionXAExceptionpublic abstract void xaStart(Xid xid, int flags) throws XAException, ActiveMQException
XAExceptionActiveMQExceptionpublic abstract boolean configureTransactionTimeout(int seconds)
throws ActiveMQException
ActiveMQExceptionpublic abstract org.apache.activemq.artemis.core.client.impl.ClientConsumerInternal createConsumer(SimpleString queueName, SimpleString filterString, int priority, int windowSize, int maxRate, int ackBatchSize, boolean browseOnly, Executor executor, Executor flowControlExecutor) throws ActiveMQException
ActiveMQExceptionpublic abstract int recoverSessionTimeout()
throws ActiveMQException
ActiveMQExceptionpublic abstract int getServerVersion()
public abstract void recreateSession(String username, String password, int minLargeMessageSize, boolean xa, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge) throws ActiveMQException
ActiveMQExceptionpublic abstract void recreateConsumerOnServer(org.apache.activemq.artemis.core.client.impl.ClientConsumerInternal consumerInternal,
long consumerId,
boolean isSessionStarted)
throws ActiveMQException
ActiveMQExceptionpublic abstract void xaFailed(Xid xid) throws ActiveMQException
ActiveMQExceptionpublic abstract void restartSession()
throws ActiveMQException
ActiveMQExceptionpublic abstract int getDefaultConsumerWindowSize(org.apache.activemq.artemis.core.protocol.core.impl.wireformat.SessionQueueQueryResponseMessage response)
throws ActiveMQException
ActiveMQExceptionpublic abstract void returnBlocking(ActiveMQException cause)
public abstract void lockCommunications()
public abstract void releaseCommunications()
public abstract void cleanup()
public abstract void linkFlowControl(SimpleString address, org.apache.activemq.artemis.core.client.impl.ClientProducerCredits clientProducerCredits)
public abstract boolean isWritable(ReadyListener callback)
Copyright © 2020 The Apache Software Foundation. All rights reserved.