public class MSubscriberEventSource extends MEventSource
Modifier and Type | Field and Description |
---|---|
protected MApp |
m_app
Deprecated.
|
protected boolean |
m_autoConfirm
Deprecated.
|
protected java.util.Vector |
m_classNames
Deprecated.
|
protected MConsumer |
m_consumer
Deprecated.
|
protected MEndpointSpec |
m_endpointSpec
Deprecated.
|
protected int |
m_messageFormat
Deprecated.
|
protected long |
m_numMessagesReceived
Deprecated.
|
m_handlers, m_listeners
m_registry
Modifier | Constructor and Description |
---|---|
protected |
MSubscriberEventSource(MComponentRegistry registry,
java.lang.String name)
Deprecated.
|
protected |
MSubscriberEventSource(MComponentRegistry registry,
java.lang.String name,
MEndpointSpec endpointSpec,
boolean autoConfirm)
Deprecated.
|
protected |
MSubscriberEventSource(java.lang.String p_name)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
activate()
Deprecated.
Activate a subscriber.
|
void |
addListener(MEventListener p_listener)
Deprecated.
Add an event listener to this event source.
|
void |
addTPluginName(java.lang.String sTPluginName)
Deprecated.
|
void |
deactivate()
Deprecated.
Deactivate a subscriber.
|
int |
getDeliveryMode()
Deprecated.
Return the delivery mode this subscriber is in
|
java.lang.String |
getDestinationName()
Deprecated.
Return the destination name for this subscriber
|
MEndpointSpec |
getEndpointSpec()
Deprecated.
|
java.util.Enumeration |
getListeners()
Deprecated.
Retrieve the listeners that have been added to this event source.
|
int |
getMessageFormat()
Deprecated.
Return the message format used by this subscriber
|
long |
getNumMessagesReceived()
Deprecated.
|
MSession |
getSession()
Deprecated.
Return the session associated with this subscriber
|
java.util.Vector |
getTPluginNames()
Deprecated.
|
boolean |
hasListeners()
Deprecated.
Return true if there is at least one listener attached to this event source, returns false otherwise
|
long |
incrementMessagesReceivedCount()
Deprecated.
|
protected void |
init(MComponentRegistry registry,
MEndpointSpec endpointSpec,
boolean isOwner,
boolean autoConfirm)
Deprecated.
|
boolean |
isAutoConfirm()
Deprecated.
|
boolean |
isValidating()
Deprecated.
|
void |
noAutoConfirm()
Deprecated.
Turn off automatic event confirmation.
|
MEventListener |
removeListener(MEventListener p_listener)
Deprecated.
Remove specified event listener from this event source.
|
void |
setTPEndpointName(java.lang.String name)
Deprecated.
|
void |
suspend()
Deprecated.
Suspend subscription preserving the persistent delivery subscription agreement.
|
notify
getComponentRegistry, getName, getStatus, isActivated, remove
protected MConsumer m_consumer
protected MEndpointSpec m_endpointSpec
protected java.util.Vector m_classNames
protected MApp m_app
protected int m_messageFormat
protected long m_numMessagesReceived
protected boolean m_autoConfirm
protected MSubscriberEventSource(MComponentRegistry registry, java.lang.String name)
protected MSubscriberEventSource(MComponentRegistry registry, java.lang.String name, MEndpointSpec endpointSpec, boolean autoConfirm) throws MException
MException
protected MSubscriberEventSource(java.lang.String p_name)
public void activate() throws MException
When you create a subscriber, it is activated by the system if a listener is attached to it,
unless explicitly specified otherwise in the adapter instance description object. You can
deactivate an active subscriber by calling MSubscriber.deactivate()
and call this method
to activate a subscriber that was either never active or that had been deactivated.
Because only subscribers with attached listeners can be activated, applications must always attach a listener to any subscriber they want to have activated during initialization.
activate
in interface MComponent
activate
in class MBaseComponent
MException
- on any failure to start this subscriber listening.deactivate()
public void deactivate() throws MException
When a subscriber is created, it is activated by the system unless explicitly specified
otherwise in the adapter instance description object. You can deactivate the subscriber explicitly
using this method and later reactivate it by calling MSubscriber.activate()
.
When you deactivate a subscriber, it is cancelled, not suspended. As a result, messages can be lost, even if you are using an RVCM session.
deactivate
in interface MComponent
deactivate
in class MBaseComponent
MException
- on any failure to stop this subscriber listening.activate()
,
suspend()
public void suspend() throws MException
MException
public void noAutoConfirm() throws MException
confirm()
method to perform
explicit confirmation that the event is consumed.
The default behavior of certified listeners is to automatically confirm message delivery upon return from the data callback function. Programs can selectively override this behavior for specific listening endpoints (without affecting other listening endpoints).
By overriding automatic confirmation, the listener assumes responsibility for explicitly confirming each inbound certified message. Consider overriding automatic confirmation when processing inbound messages involves asynchronous activity, such as computations in other threads, database queries, or additional network communications.
MException
- on any error during the process of directing this
RVCM subscriber not to send confirmation automatically.public int getMessageFormat()
public java.lang.String getDestinationName()
public MSession getSession()
public int getDeliveryMode()
public void addListener(MEventListener p_listener)
MEventSource
Applications can create multiple subclasses of MEventListener
for different types of events and attach multiple
listeners to one event source. For example, you could attach one listener that waits for data events and one
that waits for timeout events.
addListener
in class MEventSource
p_listener
- the event listener to register topublic java.util.Enumeration getListeners()
MEventSource
Enumeration.nextElement()
can be cast to MEventListener
.getListeners
in class MEventSource
public boolean hasListeners()
MEventSource
hasListeners
in class MEventSource
public MEventListener removeListener(MEventListener p_listener)
MEventSource
If you have multiple listeners attached to one event source, you must remove each one individually. This method does not cancel certified delivery agreement for RVCM.
removeListener
in class MEventSource
p_listener
- Event listener to remove from this event source.protected void init(MComponentRegistry registry, MEndpointSpec endpointSpec, boolean isOwner, boolean autoConfirm) throws MException
MException
public long getNumMessagesReceived()
public long incrementMessagesReceivedCount()
public boolean isValidating()
public void addTPluginName(java.lang.String sTPluginName)
public java.util.Vector getTPluginNames()
public void setTPEndpointName(java.lang.String name)
public boolean isAutoConfirm()
public MEndpointSpec getEndpointSpec()