solar.service.pack.proto
Interface BufferHandle

All Known Implementing Classes:
GroupBufferHandle, SingleBufferHandle

interface BufferHandle

Interface for subscription hanle and its associated buffers.

Version:
$Id: BufferHandle.java,v 1.5 2003/10/13 13:06:57 glchen Exp $
Author:
Guanling Chen

Method Summary
 void addSubscriber(Id subId, java.lang.Object policy, Buffer buffer)
          Add a subscriber with specified policy.
 BufferedEvent getBufferedEvent()
          Return the next event from buffers in this handle.
 Id getPubId()
          Return the publisher ID of this handle.
 java.lang.Object getSubKey()
          Return the key of subscription, ID or link address.
 boolean hasSubscriber(Id subId)
          Return whether this handle contains specified subscriber.
 boolean isSuspended()
          Return whether this handle is suspended.
 void pack()
          Pack the buffers in this handle.
 void putEvent(Id pubId, Id subId, Event evt)
          Put a subscribed event into this handle.
 void putEvents(Id pubId, Id subId, Buffer buffer)
          Put a list of events into this handle.
 Buffer removeSubscriber(Id subId)
          Remove an existing subscriber and return its associated buffer.
 void resume()
          Resume all buffers in this handle to output.
 int size()
          Total number of events in this handle.
 void suspend()
          Suspend all buffers in this handle from output.
 

Method Detail

size

public int size()
Total number of events in this handle.


getPubId

public Id getPubId()
Return the publisher ID of this handle.


getSubKey

public java.lang.Object getSubKey()
Return the key of subscription, ID or link address.


hasSubscriber

public boolean hasSubscriber(Id subId)
Return whether this handle contains specified subscriber.


addSubscriber

public void addSubscriber(Id subId,
                          java.lang.Object policy,
                          Buffer buffer)
Add a subscriber with specified policy.


removeSubscriber

public Buffer removeSubscriber(Id subId)
Remove an existing subscriber and return its associated buffer.


putEvent

public void putEvent(Id pubId,
                     Id subId,
                     Event evt)
              throws BufferFullException
Put a subscribed event into this handle.

BufferFullException

putEvents

public void putEvents(Id pubId,
                      Id subId,
                      Buffer buffer)
               throws BufferFullException
Put a list of events into this handle.

BufferFullException

getBufferedEvent

public BufferedEvent getBufferedEvent()
Return the next event from buffers in this handle.


pack

public void pack()
Pack the buffers in this handle.


suspend

public void suspend()
Suspend all buffers in this handle from output.


resume

public void resume()
Resume all buffers in this handle to output.


isSuspended

public boolean isSuspended()
Return whether this handle is suspended.