public class ActiveMQSessionContext extends SessionContext
idGenerator, remotingConnection, sendAckHandler, session
Constructor and Description |
---|
ActiveMQSessionContext(String name,
RemotingConnection remotingConnection,
Channel sessionChannel,
int serverVersion,
int confirmationWindow) |
Modifier and Type | Method and Description |
---|---|
ClientSession.AddressQuery |
addressQuery(SimpleString address) |
void |
addSessionMetadata(String key,
String data) |
void |
addUniqueMetaData(String key,
String data) |
protected int |
calcWindowSize(int windowSize) |
void |
cleanup() |
void |
closeConsumer(ClientConsumer consumer) |
boolean |
configureTransactionTimeout(int seconds) |
ClientConsumerInternal |
createConsumer(SimpleString queueName,
SimpleString filterString,
int windowSize,
int maxRate,
int ackBatchSize,
boolean browseOnly,
Executor executor,
Executor flowControlExecutor) |
void |
createQueue(SimpleString address,
SimpleString queueName,
SimpleString filterString,
boolean durable,
boolean temp) |
void |
createSharedQueue(SimpleString address,
SimpleString queueName,
SimpleString filterString,
boolean durable) |
void |
deleteQueue(SimpleString queueName) |
void |
expireMessage(ClientConsumer consumer,
Message message) |
void |
forceDelivery(ClientConsumer consumer,
long sequence) |
protected int |
getConfirmationWindow() |
int |
getCreditsOnSendingFull(MessageInternal msgI) |
protected String |
getName() |
int |
getReconnectID() |
int |
getServerVersion() |
protected Channel |
getSessionChannel() |
protected void |
handleReceiveProducerCredits(SessionProducerCreditsMessage message) |
protected void |
handleReceiveProducerFailCredits(SessionProducerCreditsFailMessage message) |
boolean |
isWritable(ReadyListener callback) |
void |
linkFlowControl(SimpleString address,
ClientProducerCreditsImpl clientProducerCredits) |
void |
lockCommunications()
it will lock the communication channel of the session avoiding anything to come while failover is happening.
|
protected ClassLoader |
lookupTCCL() |
protected CreateSessionMessage |
newCreateSession(String username,
String password,
int minLargeMessageSize,
boolean xa,
boolean autoCommitSends,
boolean autoCommitAcks,
boolean preAcknowledge,
SimpleString defaultAddress) |
ClientSession.QueueQuery |
queueQuery(SimpleString queueName) |
boolean |
reattachOnNewConnection(RemotingConnection newConnection)
it will eather reattach or reconnect, preferably reattaching it.
|
int |
recoverSessionTimeout()
Performs a round trip to the server requesting what is the current tx timeout on the session
|
void |
recreateConsumerOnServer(ClientConsumerInternal consumerInternal) |
void |
recreateSession(String username,
String password,
int minLargeMessageSize,
boolean xa,
boolean autoCommitSends,
boolean autoCommitAcks,
boolean preAcknowledge,
SimpleString defaultAddress) |
void |
releaseCommunications() |
void |
resetMetadata(HashMap<String,String> metaDataToSend) |
void |
resetName(String name) |
void |
restartSession() |
void |
returnBlocking(ActiveMQException cause)
Interrupt and return any blocked calls
|
void |
sendACK(boolean individual,
boolean block,
ClientConsumer consumer,
Message message) |
void |
sendConsumerCredits(ClientConsumer consumer,
int credits) |
void |
sendFullMessage(MessageInternal msgI,
boolean sendBlocking,
SendAcknowledgementHandler handler,
SimpleString defaultAddress) |
int |
sendInitialChunkOnLargeMessage(MessageInternal msgI)
it should return the number of credits (or bytes) used to send this packet
|
int |
sendLargeMessageChunk(MessageInternal msgI,
long messageBodySize,
boolean sendBlocking,
boolean lastChunk,
byte[] chunk,
int reconnectID,
SendAcknowledgementHandler messageHandler) |
void |
sendProducerCreditsMessage(int credits,
SimpleString address) |
void |
sessionClose() |
void |
sessionStart() |
void |
sessionStop() |
void |
setSendAcknowledgementHandler(SendAcknowledgementHandler handler) |
void |
simpleCommit() |
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.
|
boolean |
supportsLargeMessage()
ActiveMQ Artemis does support large messages
|
void |
xaCommit(Xid xid,
boolean onePhase) |
void |
xaEnd(Xid xid,
int flags) |
void |
xaFailed(Xid xid) |
void |
xaForget(Xid xid) |
int |
xaPrepare(Xid xid) |
void |
xaRollback(Xid xid,
boolean wasStarted) |
Xid[] |
xaScan() |
void |
xaStart(Xid xid,
int flags) |
getRemotingConnection, getSession, handleReceiveContinuation, handleReceiveLargeMessage, handleReceiveMessage, handleReceiveProducerCredits, handleReceiveProducerFailCredits, setSession
public ActiveMQSessionContext(String name, RemotingConnection remotingConnection, Channel sessionChannel, int serverVersion, int confirmationWindow)
protected Channel getSessionChannel()
protected String getName()
public void resetName(String name)
resetName
in class SessionContext
protected int getConfirmationWindow()
public int getReconnectID()
getReconnectID
in class SessionContext
public void returnBlocking(ActiveMQException cause)
SessionContext
returnBlocking
in class SessionContext
public void lockCommunications()
SessionContext
lockCommunications
in class SessionContext
public void releaseCommunications()
releaseCommunications
in class SessionContext
public void cleanup()
cleanup
in class SessionContext
public void linkFlowControl(SimpleString address, ClientProducerCreditsImpl clientProducerCredits)
linkFlowControl
in class SessionContext
public void setSendAcknowledgementHandler(SendAcknowledgementHandler handler)
setSendAcknowledgementHandler
in class SessionContext
public void createSharedQueue(SimpleString address, SimpleString queueName, SimpleString filterString, boolean durable) throws ActiveMQException
createSharedQueue
in class SessionContext
ActiveMQException
public void deleteQueue(SimpleString queueName) throws ActiveMQException
deleteQueue
in class SessionContext
ActiveMQException
public ClientSession.QueueQuery queueQuery(SimpleString queueName) throws ActiveMQException
queueQuery
in class SessionContext
ActiveMQException
public boolean isWritable(ReadyListener callback)
isWritable
in class SessionContext
public ClientConsumerInternal createConsumer(SimpleString queueName, SimpleString filterString, int windowSize, int maxRate, int ackBatchSize, boolean browseOnly, Executor executor, Executor flowControlExecutor) throws ActiveMQException
createConsumer
in class SessionContext
ActiveMQException
public int getServerVersion()
getServerVersion
in class SessionContext
public ClientSession.AddressQuery addressQuery(SimpleString address) throws ActiveMQException
addressQuery
in class SessionContext
ActiveMQException
public void closeConsumer(ClientConsumer consumer) throws ActiveMQException
closeConsumer
in class SessionContext
ActiveMQException
public void sendConsumerCredits(ClientConsumer consumer, int credits)
sendConsumerCredits
in class SessionContext
public void forceDelivery(ClientConsumer consumer, long sequence) throws ActiveMQException
forceDelivery
in class SessionContext
ActiveMQException
public void simpleCommit() throws ActiveMQException
simpleCommit
in class SessionContext
ActiveMQException
public void simpleRollback(boolean lastMessageAsDelivered) throws ActiveMQException
SessionContext
this is because we only ACK after on the RA, We may review this if we always acked earlier.
simpleRollback
in class SessionContext
ActiveMQException
public void sessionStart() throws ActiveMQException
sessionStart
in class SessionContext
ActiveMQException
public void sessionStop() throws ActiveMQException
sessionStop
in class SessionContext
ActiveMQException
public void addSessionMetadata(String key, String data) throws ActiveMQException
addSessionMetadata
in class SessionContext
ActiveMQException
public void addUniqueMetaData(String key, String data) throws ActiveMQException
addUniqueMetaData
in class SessionContext
ActiveMQException
public void xaCommit(Xid xid, boolean onePhase) throws XAException, ActiveMQException
xaCommit
in class SessionContext
XAException
ActiveMQException
public void xaEnd(Xid xid, int flags) throws XAException, ActiveMQException
xaEnd
in class SessionContext
XAException
ActiveMQException
public void sendProducerCreditsMessage(int credits, SimpleString address)
sendProducerCreditsMessage
in class SessionContext
public boolean supportsLargeMessage()
supportsLargeMessage
in class SessionContext
public int getCreditsOnSendingFull(MessageInternal msgI)
getCreditsOnSendingFull
in class SessionContext
public void sendFullMessage(MessageInternal msgI, boolean sendBlocking, SendAcknowledgementHandler handler, SimpleString defaultAddress) throws ActiveMQException
sendFullMessage
in class SessionContext
ActiveMQException
public int sendInitialChunkOnLargeMessage(MessageInternal msgI) throws ActiveMQException
SessionContext
sendInitialChunkOnLargeMessage
in class SessionContext
ActiveMQException
public int sendLargeMessageChunk(MessageInternal msgI, long messageBodySize, boolean sendBlocking, boolean lastChunk, byte[] chunk, int reconnectID, SendAcknowledgementHandler messageHandler) throws ActiveMQException
sendLargeMessageChunk
in class SessionContext
ActiveMQException
public void sendACK(boolean individual, boolean block, ClientConsumer consumer, Message message) throws ActiveMQException
sendACK
in class SessionContext
ActiveMQException
public void expireMessage(ClientConsumer consumer, Message message) throws ActiveMQException
expireMessage
in class SessionContext
ActiveMQException
public void sessionClose() throws ActiveMQException
sessionClose
in class SessionContext
ActiveMQException
public void xaForget(Xid xid) throws XAException, ActiveMQException
xaForget
in class SessionContext
XAException
ActiveMQException
public int xaPrepare(Xid xid) throws XAException, ActiveMQException
xaPrepare
in class SessionContext
XAException
ActiveMQException
public Xid[] xaScan() throws ActiveMQException
xaScan
in class SessionContext
ActiveMQException
public void xaRollback(Xid xid, boolean wasStarted) throws ActiveMQException, XAException
xaRollback
in class SessionContext
ActiveMQException
XAException
public void xaStart(Xid xid, int flags) throws XAException, ActiveMQException
xaStart
in class SessionContext
XAException
ActiveMQException
public boolean configureTransactionTimeout(int seconds) throws ActiveMQException
configureTransactionTimeout
in class SessionContext
ActiveMQException
public int recoverSessionTimeout() throws ActiveMQException
SessionContext
recoverSessionTimeout
in class SessionContext
ActiveMQException
public void createQueue(SimpleString address, SimpleString queueName, SimpleString filterString, boolean durable, boolean temp) throws ActiveMQException
createQueue
in class SessionContext
ActiveMQException
public boolean reattachOnNewConnection(RemotingConnection newConnection) throws ActiveMQException
SessionContext
reattachOnNewConnection
in class SessionContext
ActiveMQException
public void recreateSession(String username, String password, int minLargeMessageSize, boolean xa, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge, SimpleString defaultAddress) throws ActiveMQException
recreateSession
in class SessionContext
ActiveMQException
protected CreateSessionMessage newCreateSession(String username, String password, int minLargeMessageSize, boolean xa, boolean autoCommitSends, boolean autoCommitAcks, boolean preAcknowledge, SimpleString defaultAddress)
public void recreateConsumerOnServer(ClientConsumerInternal consumerInternal) throws ActiveMQException
recreateConsumerOnServer
in class SessionContext
ActiveMQException
public void xaFailed(Xid xid) throws ActiveMQException
xaFailed
in class SessionContext
ActiveMQException
public void restartSession() throws ActiveMQException
restartSession
in class SessionContext
ActiveMQException
public void resetMetadata(HashMap<String,String> metaDataToSend)
resetMetadata
in class SessionContext
protected void handleReceiveProducerCredits(SessionProducerCreditsMessage message)
protected void handleReceiveProducerFailCredits(SessionProducerCreditsFailMessage message)
protected ClassLoader lookupTCCL()
protected int calcWindowSize(int windowSize)
Copyright © 2016 JBoss by Red Hat. All rights reserved.