All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class iBus.layers.DISPATCH

java.lang.Object
   |
   +----iBus.ProtocolObject
           |
           +----iBus.layers.DISPATCH

public class DISPATCH
extends ProtocolObject

DISPATCH: DISPATCH buffers incoming events and provides a selection of thread policies to dispatch events: Single thread, thread-per-request, thread pool.

Simple applications should rely on the single-threaded policy, which is the default.

The performance of servers that carry out time consuming queries can be improved considerably by using the threadPerRequest policy, at the cost of giving up FIFO ordering, however, because postings that arrive on the same channel are dispatched concurrently.

The threadPool policy works much like thread-per-request but imposes a maximum on the number of dispacher threads that are created to run concurently.

Finally, the threadPerChannel policy provides a certain level of concurrency but also ensures that postings that arrive on a channel are dispatched in the same order they were sent.

PARAMETERS:

POSITION IN STACK:

DESIGN:

EVENTS PRODUCED:

EVENTS HANDLED:

EVENTS CONSUMED:

THREADS:


Constructor Index

 o DISPATCH()
Create an DISPATCH protocol object

Method Index

 o createQueue(iBusURL)
Create a new queue.
 o dnFlush()
Flush the protocol object.
 o dnInit()
Initialize the protocol object after the protocol stack is created.
 o dnSubscribe(iBusURL)
Called by the object above to subscribe to a channel.
 o dnUnsubscribe(iBusURL)
Called by the object above or by an iBus application to unsubscribe from a certain channel.
 o getMaxPendingEvents()
Return the maxPendingEvents property
 o getPoolSize()
Get the poolSize property.
 o getQueue(iBusURL)
Obtain the event queue for a given channel.
 o getThreadGroup()
Obtain the thread group of the dispatcher threads.
 o isThreadPerRequest()
Get the threadPerRequest property.
 o isThreadPool()
Get the threadPool property.
 o isThrottling()
Return the throttling property.
 o removeQueue(iBusURL)
Remove a queue.
 o setMaxpendingEvents(int)
Set the maxPendingEvents property
 o setThrottling(boolean)
Set the throttling property.
 o upHandleEvent(Event)
Called by the protocol object beneath to pass an event up to me.

Constructors

 o DISPATCH
 public DISPATCH()
Create an DISPATCH protocol object

Methods

 o dnInit
 public synchronized void dnInit()
Initialize the protocol object after the protocol stack is created. Also checks whether the right parameters were given to the protocol object.

Overrides:
dnInit in class ProtocolObject
 o dnFlush
 public void dnFlush()
Flush the protocol object. Deliver any buffered messages.

Overrides:
dnFlush in class ProtocolObject
 o dnSubscribe
 public synchronized void dnSubscribe(iBusURL channel) throws AlreadySubscribed, CommException
Called by the object above to subscribe to a channel.

Parameters:
channel - the channel to subscribe to
Throws: AlreadySubscribed
if this stack is already subscribed to the channel
Throws: CommException
in case of a communication error
Overrides:
dnSubscribe in class ProtocolObject
 o dnUnsubscribe
 public synchronized void dnUnsubscribe(iBusURL channel) throws NotSubscribed, CommException
Called by the object above or by an iBus application to unsubscribe from a certain channel.

Parameters:
channel - the channel to unsubscribe from
Throws: NotSubscribed
if this stack is not subscribed to the channel
Throws: CommException
in case of a communication error
Overrides:
dnUnsubscribe in class ProtocolObject
 o upHandleEvent
 public void upHandleEvent(Event event)
Called by the protocol object beneath to pass an event up to me. An event can be the arrival of a posting, the detection of a failure, an acknowledgement, etc.

Parameters:
event - determines the type of event
Overrides:
upHandleEvent in class ProtocolObject
 o getMaxPendingEvents
 public int getMaxPendingEvents()
Return the maxPendingEvents property

Returns:
the maxPendingEvents property
 o setMaxpendingEvents
 public void setMaxpendingEvents(int m)
Set the maxPendingEvents property

Parameters:
m - the maxPendingEvents property
 o getThreadGroup
 public ThreadGroup getThreadGroup()
Obtain the thread group of the dispatcher threads.

Returns:
the thread group of the dispatcher threads
 o isThreadPerRequest
 public boolean isThreadPerRequest()
Get the threadPerRequest property.

Returns:
the threadPerRequest property
 o isThreadPool
 public boolean isThreadPool()
Get the threadPool property.

Returns:
the threadPool property
 o getPoolSize
 public int getPoolSize()
Get the poolSize property.

Returns:
the poolSize property
 o createQueue
 protected synchronized FIFOQueue createQueue(iBusURL channel)
Create a new queue.

Parameters:
channel - the channel of the queue
Returns:
the new queue
 o removeQueue
 protected synchronized void removeQueue(iBusURL channel)
Remove a queue.

Parameters:
channel - the channel of the queue
 o getQueue
 protected synchronized FIFOQueue getQueue(iBusURL channel)
Obtain the event queue for a given channel. This is needed by threadPerChannel.

Parameters:
channel - the channel
Returns:
the event queue for the channel
 o setThrottling
 protected void setThrottling(boolean t)
Set the throttling property.

Parameters:
t - the new value of the throttling property
 o isThrottling
 protected boolean isThrottling()
Return the throttling property.

Returns:
the throttling property

All Packages  Class Hierarchy  This Package  Previous  Next  Index