public class FlowHandleImpl extends Object implements FlowReceiver, FlowHandle, LiveMessageController, Closeable, XMLMessageListener
| Modifier and Type | Class and Description |
|---|---|
static class |
FlowHandleImpl.ResourceBoundState |
static class |
FlowHandleImpl.StartState |
FlowHandle.FlowType| Modifier and Type | Field and Description |
|---|---|
boolean |
deliverAsyncOnReactor |
static org.apache.commons.logging.Log |
Trace |
| Constructor and Description |
|---|
FlowHandleImpl(Endpoint boundTo,
Topic newTopic,
XMLMessageListener listener,
CSMPSubscriberChannel channel,
JCSMPSession session,
boolean ad_enabled,
AssuredCtrlEnums.QueueAccessType q_access_type,
AssuredCtrlEnums.FlowType boundFlowType,
Long gr_permissions,
EndpointProperties endpointProperties,
String selector,
ConsumerFlowProperties cfp,
BaseTransactedSessionImpl old_ts,
FlowEventHandler flowEventHandler) |
public final boolean deliverAsyncOnReactor
public static final org.apache.commons.logging.Log Trace
public FlowHandleImpl(Endpoint boundTo, Topic newTopic, XMLMessageListener listener, CSMPSubscriberChannel channel, JCSMPSession session, boolean ad_enabled, AssuredCtrlEnums.QueueAccessType q_access_type, AssuredCtrlEnums.FlowType boundFlowType, Long gr_permissions, EndpointProperties endpointProperties, String selector, ConsumerFlowProperties cfp, BaseTransactedSessionImpl old_ts, FlowEventHandler flowEventHandler)
public ReentrantLock getLock()
public JCSMPBasicSession getSession()
public Long getGrantedPermissions()
public Object getAckCreateSendLock()
getAckCreateSendLock in interface FlowHandlepublic EndpointProperties getEndpointProperties()
public CSMPSubscriberChannel getCSMPSubscriberChannel()
public LiveMessageController getLiveMessageController()
public long getLastMsgIdAcked()
public Boolean tryToStartAutoRebind()
public Boolean isAutoRebindEnabled()
public Boolean isAutoRebindTriggered()
public void tryToTriggerAutoRebind(Boolean enabled)
public int getReconnectRetryIntervalInMsecs()
public final void transportInit()
public long getFlowId()
getFlowId in interface FlowHandlepublic XMLMessageListener getMessageListener()
public BrowserImpl getBrowserFlow()
public void setBrowserFlow(BrowserImpl flow)
public final void setMessageListener(XMLMessageListener listener)
setMessageListener in interface FlowReceiverpublic void setLastReportedWinSz(int winSz)
public void setFlowId(long flowId)
public long getEndpointId()
public void setEndpointId(long endpointId)
public String getFlowName()
public void setFlowName(String flowName)
public Endpoint getBoundResource()
public Topic getCachedTopic()
public String getCachedSelector()
public void setCachedSelector(String cachedSelector)
public void closeChannelDied()
public void close()
ConsumerOnce closed, an application acquires a new instance in order to continue to receive messages.
New messages will not be processed and delivered after a call to
close() returns, although it is possible for a single asynchronous
message delivery to occur if it has already begun when
close() is called.
public void close(boolean linger)
FlowReceiverlinger is set, the Endpoint will not be destroyed
immediately, but rather only after a appliance-defined timeout.
Unacknowledged messages on the Endpoint will be preserved during this
time.close in interface FlowReceiverlinger - If true, and this flow is bound to a non-durable
Endpoint, signals to the appliance the Endpoint should
not be immediately destroyed.public void closeSegmentFlows(boolean linger,
boolean rollback)
public void setBoundToResourceState(FlowHandleImpl.ResourceBoundState s)
public void setAckThreshold(int threshold)
public int getAckThreshold()
public int getOriginalAckThreshold()
public int getSubWindowSize()
public boolean isBoundToResource()
public void closeImpl(boolean allowAcks,
boolean linger,
TcpChannel.WriteBlockPolicy wpol,
JCSMPException cause)
public void closeImpl(boolean allowAcks,
boolean linger,
TcpChannel.WriteBlockPolicy wpol)
public void closeSync()
throws JCSMPException
closeSync in interface ConsumerJCSMPExceptionpublic void closeSync(boolean linger)
throws JCSMPException
closeSync in interface ConsumerJCSMPExceptionpublic void closeSyncImpl(boolean allowAcks,
boolean linger,
TcpChannel.WriteBlockPolicy wpol)
throws JCSMPInterruptedException
allowAcks - parameterJCSMPInterruptedExceptionpublic void resetAdState()
public BytesXMLMessage receive() throws JCSMPException
Consumerreceive in interface ConsumerInvalidOperationException - If the consumer is not started, or a message listener is set.JCSMPTransportException - If the consumer was closed after the function was called, but
before any message was received.JCSMPExceptionpublic boolean isOpened()
public BytesXMLMessage receive(int timeoutInMillis) throws JCSMPException
ConsumertimeoutInMillis is reached. A timeout of zero never expires,
and the call blocks indefinitely.
receive in interface ConsumertimeoutInMillis - The timeout in milliseconds.InvalidOperationException - If the consumer is not started, or a message listener is set.JCSMPTransportException - If the consumer was closed after the method was called, but
before any message was received.JCSMPExceptionpublic BytesXMLMessage receiveNoWait() throws JCSMPException
Consumernull immediately.receiveNoWait in interface ConsumerInvalidOperationException - If the consumer is not started, or a message listener is set.JCSMPTransportException - If the consumer was closed after the function was called but
before any message was received.JCSMPExceptionpublic void start()
throws JCSMPException
Consumerstart in interface ConsumerJCSMPException - upon errorInvalidOperationException - when called on a closed consumer.public void stop()
Consumer
Note that there is no guarantee the effect of calling stop()
will be instantaneous: messages already in-flight or being processed by
the API may still be delivered after the call to stop()
returns.
public void startSync()
throws JCSMPException
startSync in interface ConsumerJCSMPException - on errorpublic void stopSync()
throws JCSMPInterruptedException
stopSync in interface ConsumerJCSMPInterruptedExceptionpublic boolean stopSyncStart()
stopSyncStart in interface Consumerpublic void stopSyncWait()
throws JCSMPInterruptedException
stopSyncWait in interface ConsumerJCSMPInterruptedExceptionpublic void notifyPostReconnect()
public void notifyReconnected()
public void handleException(JCSMPException e)
public void handleControllerException(JCSMPException e)
public boolean notifyAdMessage(JCSMPXMLMessage msg)
public boolean processMessage(JCSMPXMLMessage msg)
public void handleQueueException(JCSMPException e)
public ConsumerNotificationDispatcher getConsumerNotifDsp()
public void checkLocalQueueEmptyAcks()
public void openWindow()
public void closeWindow()
public Object triggerAsyncDelivery()
triggerAsyncDelivery in interface FlowHandlepublic long getLastInOrderTpMsg()
getLastInOrderTpMsg in interface FlowHandlepublic int getWindowSize()
getWindowSize in interface FlowHandlepublic AbstractUnackedMessageList.UnackedMessageListInfo getCurrentUnackedMessageListInfo()
public void setNumUnackedTpMsgs(int num)
setNumUnackedTpMsgs in interface FlowHandlepublic int getNumUnackedTpMsgs()
public String getLogFlowInfoString()
public void logFlowInfo(JCSMPLogLevel level)
FlowReceiverlogFlowInfo in interface FlowReceiverlevel - The level (corresponding to
org.apache.commons.logging levels) at which to
output the log.public void startAckTimer()
startAckTimer in interface FlowHandlepublic void stopAckTimer()
stopAckTimer in interface FlowHandlepublic void startMsgSegmentTimer(boolean restart)
public void stopMsgSegmentTimer()
public void startSegmentFlowCreationTimer()
public void stopSegmentFlowCreationTimer()
public boolean isNoLocal()
public void throwClosedException(String message) throws InvalidOperationException
InvalidOperationExceptionpublic void ackMessage(JCSMPXMLMessage msg)
public void sendSingleAck(long msgId,
boolean allowReactorComplete)
sendSingleAck in interface FlowHandlepublic WireMessage tpCreateAck()
tpCreateAck in interface FlowHandlepublic WireMessage tpCreateStopAck()
tpCreateStopAck in interface FlowHandlepublic void tpSendAck(WireMessage ackMsg, boolean allowOnStateSub, boolean allowReactorComplete)
tpSendAck in interface FlowHandlepublic SubscriberQueueHooks getSubQueueHooks()
public void setSubQueueHooks(SubscriberQueueHooks subQueueHooks)
public int getMessageQueueSize()
public void addLiveTopicAction(CacheLiveDataAction action, Topic topic, LiveTopicListener listener) throws InvalidOperationException
addLiveTopicAction in interface LiveMessageControllerInvalidOperationExceptionpublic void removeLiveTopicAction(CacheLiveDataAction action, Topic topic)
removeLiveTopicAction in interface LiveMessageControllerpublic void addLiveResponseListener(String correlationId, LiveResponseListener listener)
addLiveResponseListener in interface LiveMessageControllerpublic void injectMessage(XMLMessage msg)
injectMessage in interface LiveMessageControllerpublic void handleLargeMsgNotification(ConsumerLargeMessageNotification notif)
public void handleMessageSegmentReconstructionTimeout(MsgSegmentReconstructionTimedTask task)
public void handleSegmentFlowCreationTimeout(SegmentFlowCreationTimedTask task)
public void handleUnackedMsgSegments()
public void injectNotification(Notification notif)
injectNotification in interface LiveMessageControllerpublic void injectCacheEvent(CacheEventMessage msg)
injectCacheEvent in interface LiveMessageControllerpublic void onLiveMessage(JCSMPXMLMessage msg)
public HashMap<String,LiveTopicListener> getLiveTopicMap()
getLiveTopicMap in interface LiveMessageControllerpublic void removeLiveResponseListener(String correlationId)
removeLiveResponseListener in interface LiveMessageControllerpublic static BytesXMLMessage createStructuredType(JCSMPXMLMessage msg)
public Endpoint getEndpoint()
FlowReceivergetEndpoint in interface FlowReceiverpublic Subscription getSubscription()
FlowReceiverTopicEndpoint.getSubscription in interface FlowReceiverTopic subscription associated to the
TopicEndpoint this flow is bound to, null if
not bound to a TopicEndpoint.public Destination getDestination()
FlowReceiverDestination to which messages should be
published to get routed to this flow's bound Endpoint.
TopicEndpoint, the
Destination will be of type Topic.Queue, the Destination will
be of type Queue.SubscriberEndpoint, this method returns
null.getDestination in interface FlowReceiverDestination to which messages should be
published to get routed to this flow's bound
Endpoint.public void setSubscription(Topic s)
public AssuredCtrlEnums.FlowType getFlowType()
public void rollback()
public BaseTransactedSessionImpl getTransactedSession()
public void setAckLastSerialNumber(long ackLastSerialNumber)
public long getAckLastSerialNumber()
public FlowEventHandler getFlowEventHandler()
public void notifyFlowEventHandler(FlowEventArgs eventArgs)
public void triggerDequeueFromConstructionQueue(ConsumerLargeMessageNotification timeoutNotification)
public void onReceive(BytesXMLMessage message)
XMLMessageListenerXMLMessageConsumer.onReceive in interface XMLMessageListenermessage - The BytesXMLMessage received.public void onException(JCSMPException exception)
XMLMessageListeneronException in interface XMLMessageListenerexception - The exception associated with the error condition.public boolean isMsgSegmentFlow()
public Long getEndpointErrorId()
public void setEndpointErrorId(Long id)
Copyright 2004-2020 Solace Corporation. All rights reserved.