org.jacorb.notification.servant
Class AbstractProxySupplier

java.lang.Object
  extended byorg.jacorb.notification.servant.AbstractProxy
      extended byorg.jacorb.notification.servant.AbstractProxySupplier
All Implemented Interfaces:
java.lang.Comparable, org.apache.avalon.framework.configuration.Configurable, org.picocontainer.Disposable, Disposable, FilterAdminOperations, FilterStage, FilterStageSource, ManageableServant, MessageConsumer, NotifySubscribeOperations, QoSAdminOperations
Direct Known Subclasses:
AbstractProxyPushSupplier, ProxyPullSupplierImpl, StructuredProxyPullSupplierImpl, TypedProxyPullSupplierImpl

public abstract class AbstractProxySupplier
extends AbstractProxy
implements MessageConsumer, NotifySubscribeOperations

Abstract base class for ProxySuppliers. This class provides following logic for the different ProxySuppliers:

Version:
$Id: AbstractProxySupplier.java,v 1.21 2005/04/27 10:45:46 alphonse.bendt Exp $
Author:
Alphonse Bendt

Field Summary
 
Fields inherited from class org.jacorb.notification.servant.AbstractProxy
id_, isIDPublic_, lifetimeFilter_, logger_, offerManager_, priorityFilter_, qosSettings_, subscriptionManager_, thisServant_
 
Constructor Summary
protected AbstractProxySupplier(IAdmin admin, ORB orb, POA poa, org.apache.avalon.framework.configuration.Configuration conf, TaskProcessor taskProcessor, OfferManager offerManager, SubscriptionManager subscriptionManager, ConsumerAdmin consumerAdmin)
           
 
Method Summary
 int compareTo(java.lang.Object o)
           
 void connectClient(Object client)
           
 void deliverMessage(Message message)
          Deliver a Message to the associated Consumer.
 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()
           
 int getErrorThreshold()
           
 Message getMessageBlocking()
           
protected  Message getMessageNoBlock()
           
protected  EventQueueFactory getMessageQueueFactory()
           
 int getPendingMessagesCount()
           
protected  Message[] getUpToMessages(int max)
           
 boolean hasMessageConsumer()
          check if this FilterStage has a MessageConsumer associcated.
 boolean hasPendingData()
           
 boolean isRetryAllowed()
           
protected  void messageDelivered()
          this is an extension point.
 ConsumerAdmin MyAdmin()
           
 EventType[] obtain_offered_types(ObtainInfoMode obtainInfoMode)
           
protected  void removeListener()
           
 void subscription_change(EventType[] added, EventType[] removed)
           
 
Methods inherited from class org.jacorb.notification.servant.AbstractProxy
_default_POA, add_filter, addDisposeHook, checkDestroyStatus, checkIsConnected, checkIsNotConnected, checkStillConnected, configure, connectionResumed, connectionSuspended, deactivate, destroy, disconnectClient, get_all_filters, get_filter, get_qos, getErrorCounter, getFilters, getID, getLifetimeFilter, getORB, getPOA, getPriorityFilter, getServant, getTaskProcessor, handleDisconnected, hasInterFilterGroupOperatorOR, hasLifetimeFilter, hasPriorityFilter, incErrorCounter, isConnected, isDisposed, isIDPublic, isSuspended, lifetime_filter, lifetime_filter, MyType, priority_filter, priority_filter, remove_all_filters, remove_filter, resetErrorCounter, resume_connection, set_qos, 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, isDisposed
 
Methods inherited from interface org.jacorb.notification.interfaces.FilterStage
getMessageConsumer
 
Methods inherited from interface org.jacorb.notification.interfaces.FilterStageSource
getSubsequentFilterStages
 
Methods inherited from interface org.jacorb.notification.servant.ManageableServant
activate
 

Constructor Detail

AbstractProxySupplier

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

getMessageQueueFactory

protected EventQueueFactory getMessageQueueFactory()

getPendingMessagesCount

public int getPendingMessagesCount()

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()

deliverMessage

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

Specified by:
deliverMessage in interface MessageConsumer

messageDelivered

protected void messageDelivered()
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()
Specified by:
dispose in interface org.picocontainer.Disposable
Overrides:
dispose in class AbstractProxy

MyAdmin

public final ConsumerAdmin MyAdmin()

subscription_change

public final void subscription_change(EventType[] added,
                                      EventType[] removed)
                               throws InvalidEventType
Specified by:
subscription_change in interface NotifySubscribeOperations
Throws:
InvalidEventType

obtain_offered_types

public final EventType[] obtain_offered_types(ObtainInfoMode obtainInfoMode)

removeListener

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

connectClient

public void connectClient(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