public class ClientContext extends Object implements Serializable, Encodable
ClientContext
class holds the data related to a client
context.Modifier and Type | Class and Description |
---|---|
static class |
ClientContext.ClientContextFactory |
(package private) static class |
ClientContext.MultiReplyContext |
Modifier and Type | Field and Description |
---|---|
private Vector<String> |
activeSubs
Vector of active subscriptions' names.
|
private int |
cancelledRequestId
Identifier of a cancelled "receive" request, set when a PTP listener has
been unset.
|
private Hashtable |
commitTable
Contexts waiting for the replies from some local agents
|
private Hashtable<AgentId,AgentId> |
deliveringQueues
Identifiers of queues delivering messages.
|
private int |
id
Context identifier.
|
static Logger |
logger
logger
|
boolean |
modified |
private ProxyAgentItf |
proxy |
private AgentId |
proxyId
The proxy's agent identifier.
|
private Vector |
repliesBuffer
Pending replies waiting for the context to be activated.
|
private static long |
serialVersionUID
define serialVersionUID for interoperability
|
private boolean |
started
true if the context is activated. |
private Vector<AgentId> |
tempDestinations
Vector of temporary destinations.
|
private Hashtable<Xid,XACnxPrepare> |
transactionsTable
Prepared transactions objects waiting for commit.
|
String |
txName |
BOOLEAN_ENCODED_SIZE, BYTE_ENCODED_SIZE, DOUBLE_ENCODED_SIZE, FLOAT_ENCODED_SIZE, INT_ENCODED_SIZE, LONG_ENCODED_SIZE, SHORT_ENCODED_SIZE
Constructor and Description |
---|
ClientContext() |
ClientContext(AgentId proxyId,
int id)
Constructs a
ClientContext instance. |
Modifier and Type | Method and Description |
---|---|
(package private) void |
addDeliveringQueue(AgentId queueId)
Adds, if not already, the identifier of a delivering queue.
|
(package private) void |
addMultiReplyContext(int requestId,
int asyncReplyCount)
Some requests may require to wait for several
SendReplyNot notifications before replying to the client.
|
(package private) void |
addPendingDelivery(AbstractJmsReply reply)
Adds a pending delivery.
|
(package private) void |
addSubName(String subName)
Adds an active subscription name.
|
(package private) void |
addTemporaryDestination(AgentId destId)
Adds a temporary destination identifier.
|
(package private) void |
cancelReceive(int cancelledRequestId)
Cancels a "receive" request.
|
(package private) void |
clearPendingDeliveries()
Clears the pending deliveries buffer.
|
void |
decode(Decoder decoder)
Decodes the content of this object
|
void |
delete() |
void |
encode(Encoder encoder)
Encodes the content of this object
|
(package private) boolean |
getActivated()
Returns
true if the context is activated. |
(package private) List<String> |
getActiveSubList() |
(package private) Iterator |
getActiveSubs()
Returns the active subscriptions' names.
|
(package private) int |
getCancelledReceive()
Returns the cancelled "receive" request identifier.
|
(package private) Iterator |
getDeliveringQueues()
Returns the identifiers of the delivering queues.
|
(package private) Map<AgentId,AgentId> |
getDeliveringQueueTable() |
int |
getEncodableClassId()
Returns a unique class identifier.
|
int |
getEncodedSize()
Returns the size of the byte array that results from the encoding of this object.
|
(package private) int |
getId()
Returns the identifier of the context.
|
(package private) Iterator |
getPendingDeliveries()
Returns the pending deliveries.
|
AgentId |
getProxyId() |
(package private) List<AgentId> |
getTempDestinationList() |
(package private) Iterator |
getTempDestinations() |
static String |
getTransactionPrefix(AgentId proxyId) |
(package private) Hashtable<Xid,XACnxPrepare> |
getTransactionsTable() |
(package private) Iterator |
getTxIds()
Returns the identifiers of the prepared transactions.
|
private String |
getTxName() |
(package private) XACnxPrepare |
getTxPrepare(Object key)
Returns and deletes a given transaction "prepare".
|
boolean |
isPrepared(Object key) |
(package private) void |
registerTxPrepare(Object key,
XACnxPrepare prepare)
Registers a given transaction "prepare".
|
(package private) void |
removeSubName(String subName)
Removes an active subscription name.
|
(package private) void |
removeTemporaryDestination(AgentId destId)
Removes a temporary destination identifier.
|
void |
save() |
(package private) void |
setActivated(boolean started)
Sets the activation status of the context.
|
private void |
setModified() |
(package private) void |
setProxyAgent(ProxyAgentItf px) |
void |
setProxyId(AgentId proxyId) |
(package private) int |
setReply(int requestId)
Called by UserAgent when a SendReplyNot arrived.
|
String |
toString() |
private static final long serialVersionUID
public static Logger logger
private AgentId proxyId
private int id
private Hashtable<AgentId,AgentId> deliveringQueues
private Hashtable<Xid,XACnxPrepare> transactionsTable
private transient boolean started
true
if the context is activated.private transient int cancelledRequestId
private transient Vector repliesBuffer
private transient Hashtable commitTable
private transient ProxyAgentItf proxy
public transient String txName
public transient boolean modified
ClientContext()
ClientContext(AgentId proxyId, int id)
ClientContext
instance.proxyId
- The proxy's agent identifier.id
- Identifier of the context.public AgentId getProxyId()
public void setProxyId(AgentId proxyId)
void setProxyAgent(ProxyAgentItf px)
int getId()
void setActivated(boolean started)
boolean getActivated()
true
if the context is activated.void addTemporaryDestination(AgentId destId)
Iterator getTempDestinations()
void removeTemporaryDestination(AgentId destId)
void addPendingDelivery(AbstractJmsReply reply)
Iterator getPendingDeliveries()
void clearPendingDeliveries()
void addSubName(String subName)
Iterator getActiveSubs()
void removeSubName(String subName)
void cancelReceive(int cancelledRequestId)
int getCancelledReceive()
void addDeliveringQueue(AgentId queueId)
Iterator getDeliveringQueues()
void addMultiReplyContext(int requestId, int asyncReplyCount)
requestId
- asyncReplyCount
- int setReply(int requestId)
requestId
- void registerTxPrepare(Object key, XACnxPrepare prepare) throws Exception
Exception
XACnxPrepare getTxPrepare(Object key)
public boolean isPrepared(Object key)
key
- XIDIterator getTxIds()
public int getEncodableClassId()
Encodable
getEncodableClassId
in interface Encodable
public int getEncodedSize() throws Exception
Encodable
getEncodedSize
in interface Encodable
Exception
- if an error occurspublic void encode(Encoder encoder) throws Exception
Encodable
public void decode(Decoder decoder) throws Exception
Encodable
public void delete()
private String getTxName()
public void save()
private void setModified()
Hashtable<Xid,XACnxPrepare> getTransactionsTable()
Copyright © 2022 ScalAgent D.T.. All rights reserved.