org.jacorb.notification.servant
Class AbstractProxySupplier

java.lang.Object
  extended by org.jacorb.notification.servant.AbstractProxy
      extended by org.jacorb.notification.servant.AbstractProxySupplier
All Implemented Interfaces:
java.lang.Comparable, org.apache.avalon.framework.configuration.Configurable, Disposable, FilterStage, FilterStageSource, JMXManageable, MessageConsumer, NotifyingDisposable, IServantLifecyle
Direct Known Subclasses:
AbstractProxyPushSupplier, ProxyPullSupplierImpl, SequenceProxyPullSupplierImpl, StructuredProxyPullSupplierImpl, TypedProxyPullSupplierImpl

public abstract class AbstractProxySupplier
extends AbstractProxy
implements MessageConsumer

Abstract base class for ProxySuppliers. This class provides base functionality for the different ProxySuppliers:

Version:
$Id: AbstractProxySupplier.java,v 1.31 2006/05/23 10:50:35 alphonse.bendt Exp $
Author:
Alphonse Bendt

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jacorb.notification.interfaces.JMXManageable
JMXManageable.JMXCallback
 
Field Summary
 
Fields inherited from class org.jacorb.notification.servant.AbstractProxy
config_, eventTypes_, logger_, offerManager_, qosSettings_, subscriptionManager_
 
Constructor Summary
protected AbstractProxySupplier(IAdmin admin, org.omg.CORBA.ORB orb, org.omg.PortableServer.POA poa, org.apache.avalon.framework.configuration.Configuration conf, TaskProcessor taskProcessor, OfferManager offerManager, SubscriptionManager subscriptionManager, ConsumerAdmin consumerAdmin)
           
 
Method Summary
 void clearPendingMessageQueue()
           
protected  void clientDisconnected()
           
 int compareTo(java.lang.Object o)
           
 void connectClient(org.omg.CORBA.Object client)
           
 void dispose()
           
protected  void enqueue(Message message)
          put a copy of the Message in the queue of pending Messages.
protected  Message[] getAllMessages()
           
protected  Message[] getAtLeastMessages(int min)
           
protected abstract  long getCost()
           
 java.lang.String getDiscardPolicy()
           
 int getErrorThreshold()
           
 int getMaxEventsPerConsumer()
           
 Message getMessageBlocking()
           
 MessageConsumer getMessageConsumer()
          get the associated MessageConsumer or null.
protected  Message getMessageNoBlock()
           
protected  EventQueueFactory getMessageQueueFactory()
           
 int getNumberOfDiscardedMessages()
           
 java.lang.String getOrderPolicy()
           
 int getPendingMessagesCount()
           
 java.util.List getSubsequentFilterStages()
           
protected  Message[] getUpToMessages(int max)
           
 boolean hasMessageConsumer()
          check if this FilterStage has a MessageConsumer associcated.
 boolean hasPendingData()
           
 boolean isRetryAllowed()
           
protected  void messageQueued()
          this is an extension point.
 ConsumerAdmin MyAdmin()
           
 EventType[] obtain_offered_types(ObtainInfoMode obtainInfoMode)
           
 void queueMessage(Message message)
          Deliver a Message to the associated Consumer.
protected  void removeListener()
           
 void setMaxEventsPerConsumer(int max)
           
 void subscription_change(EventType[] added, EventType[] removed)
           
 
Methods inherited from class org.jacorb.notification.servant.AbstractProxy
activate, add_filter, checkDestroyStatus, checkIsConnected, checkIsNotConnected, checkStillConnected, configure, connectionResumed, connectionSuspended, deactivate, destroy, disconnectClient, get_all_filters, get_filter, get_qos, getClientIOR, getConnected, getErrorCounter, getFilters, getID, getInterFilterGroupOperator, getJMXNotificationTypes, getJMXObjectName, getLifetimeFilter, getMBeanName, getMBeanType, getORB, getPOA, getPriorityFilter, getStatus, getTaskProcessor, handleDisconnected, hasInterFilterGroupOperatorOR, hasLifetimeFilter, hasPriorityFilter, incErrorCounter, isDestroyed, isIDPublic, isSuspended, lifetime_filter, lifetime_filter, MyType, priority_filter, priority_filter, registerDisposable, remove_all_filters, remove_filter, resetErrorCounter, resume_connection, sendNotification, sendNotification, set_qos, setJMXCallback, suspend_connection, validate_event_qos, validate_qos
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jacorb.notification.interfaces.MessageConsumer
destroy, isDestroyed
 
Methods inherited from interface org.jacorb.notification.lifecycle.IServantLifecyle
newServant
 

Constructor Detail

AbstractProxySupplier

protected AbstractProxySupplier(IAdmin admin,
                                org.omg.CORBA.ORB orb,
                                org.omg.PortableServer.POA poa,
                                org.apache.avalon.framework.configuration.Configuration conf,
                                TaskProcessor taskProcessor,
                                OfferManager offerManager,
                                SubscriptionManager subscriptionManager,
                                ConsumerAdmin consumerAdmin)
                         throws org.apache.avalon.framework.configuration.ConfigurationException
Throws:
org.apache.avalon.framework.configuration.ConfigurationException
Method Detail

getMessageQueueFactory

protected EventQueueFactory getMessageQueueFactory()

getPendingMessagesCount

public int getPendingMessagesCount()

getOrderPolicy

public final java.lang.String getOrderPolicy()

getDiscardPolicy

public final java.lang.String getDiscardPolicy()

getMaxEventsPerConsumer

public final int getMaxEventsPerConsumer()

setMaxEventsPerConsumer

public void setMaxEventsPerConsumer(int max)

getNumberOfDiscardedMessages

public int getNumberOfDiscardedMessages()

hasPendingData

public boolean hasPendingData()

enqueue

protected void enqueue(Message message)
put a copy of the Message in the queue of pending Messages.

Parameters:
message - the Message to queue.

getMessageBlocking

public Message getMessageBlocking()
                           throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

getMessageNoBlock

protected Message getMessageNoBlock()

getAllMessages

protected Message[] getAllMessages()

queueMessage

public void queueMessage(Message message)
Description copied from interface: MessageConsumer
Deliver a Message to the associated Consumer.

Specified by:
queueMessage in interface MessageConsumer

messageQueued

protected void messageQueued()
this is an extension point.


getUpToMessages

protected Message[] getUpToMessages(int max)
Parameters:
max - maximum number of messages
Returns:
an array containing at most max Messages

getAtLeastMessages

protected Message[] getAtLeastMessages(int min)
Parameters:
min - minimum number of messages
Returns:
an array containing the requested number of Messages or null

getErrorThreshold

public int getErrorThreshold()

dispose

public final void dispose()
Overrides:
dispose in class AbstractProxy

MyAdmin

public final ConsumerAdmin MyAdmin()

subscription_change

public final void subscription_change(EventType[] added,
                                      EventType[] removed)
                               throws InvalidEventType
Throws:
InvalidEventType

obtain_offered_types

public final EventType[] obtain_offered_types(ObtainInfoMode obtainInfoMode)

removeListener

protected void removeListener()
Specified by:
removeListener in class AbstractProxy

clientDisconnected

protected final void clientDisconnected()
Specified by:
clientDisconnected in class AbstractProxy

connectClient

public void connectClient(org.omg.CORBA.Object client)
Overrides:
connectClient in class AbstractProxy

isRetryAllowed

public boolean isRetryAllowed()

getCost

protected abstract long getCost()

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

hasMessageConsumer

public final boolean hasMessageConsumer()
Description copied from interface: FilterStage
check if this FilterStage has a MessageConsumer associcated.

Specified by:
hasMessageConsumer in interface FilterStage

getSubsequentFilterStages

public final java.util.List getSubsequentFilterStages()
Specified by:
getSubsequentFilterStages in interface FilterStageSource

getMessageConsumer

public final MessageConsumer getMessageConsumer()
Description copied from interface: FilterStage
get the associated MessageConsumer or null.

Specified by:
getMessageConsumer in interface FilterStage

clearPendingMessageQueue

public void clearPendingMessageQueue()