|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.engine.distributor.plugins.ConsumableQueuePlugin
public class ConsumableQueuePlugin
ConsumableQueuePlugin
Field Summary | |
---|---|
private Global |
global
|
(package private) boolean |
isReady
|
(package private) boolean |
isRunning
|
private static java.util.logging.Logger |
log
|
private static java.lang.String |
ME
|
private java.lang.Object |
mutex
|
private PluginInfo |
pluginInfo
|
private ServerScope |
serverScope
|
private java.lang.String |
topicId
|
Fields inherited from interface org.xmlBlaster.engine.I_SubscriptionListener |
---|
PRIO_01, PRIO_05, PRIO_10 |
Constructor Summary | |
---|---|
ConsumableQueuePlugin()
The default constructor. |
Method Summary | |
---|---|
void |
distribute(MsgUnitWrapper msgUnitWrapper)
This method should not throw any exception so it is responsability of the plugin developer to catch Throwable and make the necessary error handling. |
private boolean |
distributeOneEntry(MsgUnitWrapper msgUnitWrapper,
MsgQueueHistoryEntry entry,
java.util.List subInfoList)
Distributes one single entry taken from the history queue. |
private UpdateReturnQosServer |
doDistribute(SubscriptionInfo sub,
MsgQueueUpdateEntry entry)
Enforced by the I_DistributionInterceptor interface. |
private I_DispatchManager |
getDispatchManager(SubscriptionInfo subscriptionInfo)
|
java.lang.Integer |
getPriority()
The priority by which it will be invoked. |
java.lang.String |
getType()
|
java.lang.String |
getVersion()
|
private void |
givingUpDistribution(SubscriptionInfo sub,
MsgUnitWrapper msgUnitWrapper,
MsgQueueEntry entry,
java.lang.Throwable e)
|
void |
init(Global global,
PluginInfo pluginInfo)
Initializes the plugin |
(package private) void |
processHistoryQueue()
Takes entries from the history queue and distributes it to the dispatcher framework until there are entries available or until the dispatcher framework is alive. |
void |
shutdown()
It removes all subscriptions done on this topic |
void |
subscriptionAdd(SubscriptionEvent e)
Invoked when a subscriber is added to the TopicHandler |
void |
subscriptionRemove(SubscriptionEvent e)
Invoked when a subscriber is removed from the TopicHandler |
void |
toAlive(I_DispatchManager dispatchManager,
ConnectionStateEnum oldState)
Event arriving from one DispatchManager telling this plugin it can start distribute again. |
void |
toAliveSync(I_DispatchManager dispatchManager,
ConnectionStateEnum oldState)
|
void |
toDead(I_DispatchManager dispatchManager,
ConnectionStateEnum oldState,
XmlBlasterException xmlBlasterException)
|
void |
toPolling(I_DispatchManager dispatchManager,
ConnectionStateEnum oldState)
|
private void |
toRunning()
Invoked on status changes when it shall start to distribute entries. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String ME
boolean isReady
boolean isRunning
private Global global
private static java.util.logging.Logger log
private PluginInfo pluginInfo
private ServerScope serverScope
private java.lang.String topicId
private java.lang.Object mutex
Constructor Detail |
---|
public ConsumableQueuePlugin()
Method Detail |
---|
private void toRunning()
public void distribute(MsgUnitWrapper msgUnitWrapper)
I_MsgDistributor
distribute
in interface I_MsgDistributor
msgUnitWrapper
- the entry to distributeInvoked by the TopicHandler on publish or subscribe. Starts the distributor thread and
returnes immeditately. From here distribution is handled by another thread.
public void init(Global global, PluginInfo pluginInfo) throws XmlBlasterException
init
in interface I_Plugin
XmlBlasterException
public java.lang.String getType()
getType
in interface I_Plugin
public java.lang.String getVersion()
getVersion
in interface I_Plugin
public void shutdown() throws XmlBlasterException
shutdown
in interface I_Plugin
XmlBlasterException
- if an exception occurs. The exception is
handled by the RunLevelManager depending on how the plugin has been
configured with the action:
<action do='STOP' onShutdownRunlevel='2' sequence='5'
onFail='resource.configuration.pluginFailed'>
If onFail is defined to something, the RunLevelManager will stop.private final I_DispatchManager getDispatchManager(SubscriptionInfo subscriptionInfo)
public void subscriptionAdd(SubscriptionEvent e) throws XmlBlasterException
subscriptionAdd
in interface I_SubscriptionListener
subscriptionInfo
-
XmlBlasterException
public void subscriptionRemove(SubscriptionEvent e) throws XmlBlasterException
subscriptionRemove
in interface I_SubscriptionListener
subscriptionInfo
-
XmlBlasterException
public void toAlive(I_DispatchManager dispatchManager, ConnectionStateEnum oldState)
toAlive
in interface I_ConnectionStatusListener
public void toPolling(I_DispatchManager dispatchManager, ConnectionStateEnum oldState)
toPolling
in interface I_ConnectionStatusListener
public void toDead(I_DispatchManager dispatchManager, ConnectionStateEnum oldState, XmlBlasterException xmlBlasterException)
toDead
in interface I_ConnectionStatusListener
xmlBlasterException
- Can be nullpublic void toAliveSync(I_DispatchManager dispatchManager, ConnectionStateEnum oldState)
toAliveSync
in interface I_ConnectionStatusListener
void processHistoryQueue()
private boolean distributeOneEntry(MsgUnitWrapper msgUnitWrapper, MsgQueueHistoryEntry entry, java.util.List subInfoList)
subInfoList
- contains the SubscriptionInfo objects to scan. Once the
message is processed by one of the dispatchers, the associated
SessionInfo is put at the end of the list to allow some simple
load balancing mechanism.
private void givingUpDistribution(SubscriptionInfo sub, MsgUnitWrapper msgUnitWrapper, MsgQueueEntry entry, java.lang.Throwable e)
private UpdateReturnQosServer doDistribute(SubscriptionInfo sub, MsgQueueUpdateEntry entry) throws XmlBlasterException
XmlBlasterException
public java.lang.Integer getPriority()
I_SubscriptionListener
getPriority
in interface I_SubscriptionListener
I_SubscriptionListener.getPriority()
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |