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(org.apache.activemq.artemis.api.core.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(org.apache.activemq.artemis.api.core.SimpleString address,
EnumSet<org.apache.activemq.artemis.api.core.RoutingType> routingTypes,
boolean autoCreated) |
abstract void |
createAddress(org.apache.activemq.artemis.api.core.SimpleString address,
Set<org.apache.activemq.artemis.api.core.RoutingType> routingTypes,
boolean autoCreated)
Deprecated.
|
abstract org.apache.activemq.artemis.core.client.impl.ClientConsumerInternal |
createConsumer(org.apache.activemq.artemis.api.core.SimpleString queueName,
org.apache.activemq.artemis.api.core.SimpleString filterString,
int windowSize,
int maxRate,
int ackBatchSize,
boolean browseOnly,
Executor executor,
Executor flowControlExecutor) |
abstract void |
createQueue(org.apache.activemq.artemis.api.core.SimpleString address,
org.apache.activemq.artemis.api.core.RoutingType routingType,
org.apache.activemq.artemis.api.core.SimpleString queueName,
org.apache.activemq.artemis.api.core.SimpleString filterString,
boolean durable,
boolean temp,
int maxConsumers,
boolean purgeOnNoConsumers,
boolean autoCreated)
Deprecated.
|
abstract void |
createQueue(org.apache.activemq.artemis.api.core.SimpleString address,
org.apache.activemq.artemis.api.core.RoutingType routingType,
org.apache.activemq.artemis.api.core.SimpleString queueName,
org.apache.activemq.artemis.api.core.SimpleString filterString,
boolean durable,
boolean temp,
int maxConsumers,
boolean purgeOnNoConsumers,
boolean autoCreated,
Boolean exclusive,
Boolean lastVale) |
abstract void |
createQueue(org.apache.activemq.artemis.api.core.SimpleString address,
org.apache.activemq.artemis.api.core.SimpleString queueName,
org.apache.activemq.artemis.api.core.SimpleString filterString,
boolean durable,
boolean temp,
boolean autoCreated)
Deprecated.
|
abstract void |
createSharedQueue(org.apache.activemq.artemis.api.core.SimpleString address,
org.apache.activemq.artemis.api.core.SimpleString queueName,
org.apache.activemq.artemis.api.core.RoutingType routingType,
org.apache.activemq.artemis.api.core.SimpleString filterString,
boolean durable) |
abstract void |
createSharedQueue(org.apache.activemq.artemis.api.core.SimpleString address,
org.apache.activemq.artemis.api.core.SimpleString queueName,
org.apache.activemq.artemis.api.core.RoutingType routingType,
org.apache.activemq.artemis.api.core.SimpleString filterString,
boolean durable,
Integer maxConsumers,
Boolean purgeOnNoConsumers,
Boolean exclusive,
Boolean lastValue)
Creates a shared queue using the routing type set by the Address.
|
abstract void |
createSharedQueue(org.apache.activemq.artemis.api.core.SimpleString address,
org.apache.activemq.artemis.api.core.SimpleString queueName,
org.apache.activemq.artemis.api.core.SimpleString filterString,
boolean durable) |
abstract void |
deleteQueue(org.apache.activemq.artemis.api.core.SimpleString queueName) |
abstract void |
expireMessage(ClientConsumer consumer,
Message message) |
abstract void |
forceDelivery(ClientConsumer consumer,
long sequence) |
abstract int |
getCreditsOnSendingFull(Message msgI) |
abstract int |
getReconnectID() |
RemotingConnection |
getRemotingConnection() |
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(org.apache.activemq.artemis.api.core.SimpleString address,
int credits) |
protected void |
handleReceiveProducerFailCredits(org.apache.activemq.artemis.api.core.SimpleString address,
int credits) |
abstract boolean |
isWritable(ReadyListener callback) |
abstract void |
linkFlowControl(org.apache.activemq.artemis.api.core.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(org.apache.activemq.artemis.api.core.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(org.apache.activemq.artemis.api.core.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,
org.apache.activemq.artemis.api.core.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,
org.apache.activemq.artemis.api.core.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 org.apache.activemq.artemis.api.core.ActiveMQException
newConnection
- org.apache.activemq.artemis.api.core.ActiveMQException
public RemotingConnection getRemotingConnection()
public abstract void closeConsumer(ClientConsumer consumer) throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
public 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
Exception
protected void handleReceiveMessage(ConsumerContext consumerID, org.apache.activemq.artemis.core.client.impl.ClientMessageInternal message) throws Exception
Exception
protected void handleReceiveContinuation(ConsumerContext consumerID, byte[] chunk, int flowControlSize, boolean isContinues) throws Exception
Exception
protected void handleReceiveProducerCredits(org.apache.activemq.artemis.api.core.SimpleString address, int credits)
protected void handleReceiveProducerFailCredits(org.apache.activemq.artemis.api.core.SimpleString address, int credits)
public abstract int getCreditsOnSendingFull(Message msgI)
public abstract void sendFullMessage(ICoreMessage msgI, boolean sendBlocking, SendAcknowledgementHandler handler, org.apache.activemq.artemis.api.core.SimpleString defaultAddress) throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract int sendInitialChunkOnLargeMessage(Message msgI) throws org.apache.activemq.artemis.api.core.ActiveMQException
msgI
- org.apache.activemq.artemis.api.core.ActiveMQException
public abstract int sendLargeMessageChunk(Message msgI, long messageBodySize, boolean sendBlocking, boolean lastChunk, byte[] chunk, int reconnectID, SendAcknowledgementHandler messageHandler) throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract int sendServerLargeMessageChunk(Message msgI, long messageBodySize, boolean sendBlocking, boolean lastChunk, byte[] chunk, SendAcknowledgementHandler messageHandler) throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract void setSendAcknowledgementHandler(SendAcknowledgementHandler handler)
public abstract void createSharedQueue(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.RoutingType routingType, org.apache.activemq.artemis.api.core.SimpleString filterString, boolean durable, Integer maxConsumers, Boolean purgeOnNoConsumers, Boolean exclusive, Boolean lastValue) throws org.apache.activemq.artemis.api.core.ActiveMQException
address
- queueName
- routingType
- filterString
- durable
- exclusive
- lastValue
- org.apache.activemq.artemis.api.core.ActiveMQException
public abstract void createSharedQueue(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.RoutingType routingType, org.apache.activemq.artemis.api.core.SimpleString filterString, boolean durable) throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract void createSharedQueue(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.SimpleString filterString, boolean durable) throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract void deleteQueue(org.apache.activemq.artemis.api.core.SimpleString queueName) throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
@Deprecated public abstract void createAddress(org.apache.activemq.artemis.api.core.SimpleString address, Set<org.apache.activemq.artemis.api.core.RoutingType> routingTypes, boolean autoCreated) throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract void createAddress(org.apache.activemq.artemis.api.core.SimpleString address, EnumSet<org.apache.activemq.artemis.api.core.RoutingType> routingTypes, boolean autoCreated) throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
@Deprecated public abstract void createQueue(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.SimpleString filterString, boolean durable, boolean temp, boolean autoCreated) throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
@Deprecated public abstract void createQueue(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.RoutingType routingType, org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.SimpleString filterString, boolean durable, boolean temp, int maxConsumers, boolean purgeOnNoConsumers, boolean autoCreated) throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract void createQueue(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.RoutingType routingType, org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.SimpleString filterString, boolean durable, boolean temp, int maxConsumers, boolean purgeOnNoConsumers, boolean autoCreated, Boolean exclusive, Boolean lastVale) throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract ClientSession.QueueQuery queueQuery(org.apache.activemq.artemis.api.core.SimpleString queueName) throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract void forceDelivery(ClientConsumer consumer, long sequence) throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract ClientSession.AddressQuery addressQuery(org.apache.activemq.artemis.api.core.SimpleString address) throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract void simpleCommit() throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract void simpleCommit(boolean block) throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract void simpleRollback(boolean lastMessageAsDelivered) throws org.apache.activemq.artemis.api.core.ActiveMQException
this is because we only ACK after on the RA, We may review this if we always acked earlier.
lastMessageAsDelivered
- org.apache.activemq.artemis.api.core.ActiveMQException
public abstract void sessionStart() throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract void sessionStop() throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract void sendACK(boolean individual, boolean block, ClientConsumer consumer, Message message) throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract void expireMessage(ClientConsumer consumer, Message message) throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract void sessionClose() throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract void addSessionMetadata(String key, String data) throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract void addUniqueMetaData(String key, String data) throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract void sendProducerCreditsMessage(int credits, org.apache.activemq.artemis.api.core.SimpleString address)
public abstract void xaCommit(Xid xid, boolean onePhase) throws XAException, org.apache.activemq.artemis.api.core.ActiveMQException
XAException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract void xaEnd(Xid xid, int flags) throws XAException, org.apache.activemq.artemis.api.core.ActiveMQException
XAException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract void xaForget(Xid xid) throws XAException, org.apache.activemq.artemis.api.core.ActiveMQException
XAException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract int xaPrepare(Xid xid) throws XAException, org.apache.activemq.artemis.api.core.ActiveMQException
XAException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract Xid[] xaScan() throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract void xaRollback(Xid xid, boolean wasStarted) throws org.apache.activemq.artemis.api.core.ActiveMQException, XAException
org.apache.activemq.artemis.api.core.ActiveMQException
XAException
public abstract void xaStart(Xid xid, int flags) throws XAException, org.apache.activemq.artemis.api.core.ActiveMQException
XAException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract boolean configureTransactionTimeout(int seconds) throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract org.apache.activemq.artemis.core.client.impl.ClientConsumerInternal createConsumer(org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.SimpleString filterString, int windowSize, int maxRate, int ackBatchSize, boolean browseOnly, Executor executor, Executor flowControlExecutor) throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract int recoverSessionTimeout() throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract int getServerVersion()
public abstract void recreateSession(String username, String password, int minLargeMessageSize, boolean xa, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge) throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract void recreateConsumerOnServer(org.apache.activemq.artemis.core.client.impl.ClientConsumerInternal consumerInternal, long consumerId, boolean isSessionStarted) throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract void xaFailed(Xid xid) throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract void restartSession() throws org.apache.activemq.artemis.api.core.ActiveMQException
org.apache.activemq.artemis.api.core.ActiveMQException
public abstract void returnBlocking(org.apache.activemq.artemis.api.core.ActiveMQException cause)
public abstract void lockCommunications()
public abstract void releaseCommunications()
public abstract void cleanup()
public abstract void linkFlowControl(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.core.client.impl.ClientProducerCredits clientProducerCredits)
public abstract boolean isWritable(ReadyListener callback)
Copyright © 2018 The Apache Software Foundation. All Rights Reserved.