Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.activemq.service
Interface Subscription

All Known Implementing Classes:
  SubscriptionImpl

public interface Subscription

A Subscription holds messages to be dispatched to a a Client Consumer

Version:
  $Revision: 1.13 $

Method Summary
`void` | `addMessage(MessageContainer container, ActiveMQMessage message)` If the Subscription is a target for the message, the subscription will add a reference to the message and register an interest in the message to the container
`void` | `clear()` Called when the Subscription is discarded
`java.lang.String` | `getClientId()`
`java.lang.String` | `getConsumerId()`
`int` | `getConsumerNumber()`
`ActiveMQDestination` | `getDestination()`
`MessageIdentity` | `getLastMessageIdentity()` Retreives the messageIdentity of the last message sent to this Queue based Subscription
`ActiveMQMessage[]` | `getMessagesToDispatch()` Retrieve messages to dispatch
`java.lang.String` | `getPersistentKey()` Returns the persistent key used to uniquely identify this durable topic subscription
`java.lang.String` | `getSelector()`
`java.lang.String` | `getSubscriberName()`
`boolean` | `isActive()`
`boolean` | `isAtPrefetchLimit()` Indicates the Subscription it's reached it's pre-fetch limit
`boolean` | `isBrowser()` Indicates the consumer is a browser only
`boolean` | `isDurableTopic()` Indicates the Consumer is a Durable Subscriber
`boolean` | `isReadyToDispatch()` Indicates if this Subscription has more messages to send to the Consumer
`boolean` | `isSameDurableSubscription(ConsumerInfo info)` Checks if this subscription is a duplicate durable subscription of the given consumer info
`boolean` | `isTarget(ActiveMQMessage message)` determines if the Subscription is interested in the message
`boolean` | `isWildcard()`
`void` | `messageConsumed(MessageAck ack)` Indicates a message has been delivered to a MessageConsumer which is typically called for topic based subscriptions
`void` | `onAcknowledgeTransactedMessageBeforeCommit(MessageAck ack)` We have not yet committed and so the message acknowledgement has not really occurred yet but we need to let the dispatcher know that we can commence dispatching more messages to the client.
`void` | `redeliverMessage(MessageContainer container, MessageAck ack)` Forces the given message to be redelivered
`void` | `reset()` Called when an active message consumer has closed.
`void` | `setActive(boolean newActive)` set the state of the Subscription
`void` | `setActiveConsumer(ConsumerInfo info)` Set the active consumer info
`void` | `setLastMessageIdentifier(MessageIdentity messageIdentity)` Used for a Queue based Subscription to set the last acknowledged message ID

Method Detail

### setActiveConsumer

    public void setActiveConsumer(ConsumerInfo info)

  Set the active consumer info

  Parameters:
    `info` -

### clear

    public void clear()
               throws JMSException

  Called when the Subscription is discarded

  Throws:
    `JMSException`

### reset

    public void reset()
               throws JMSException

  Called when an active message consumer has closed.

  Throws:
    `JMSException`

### getClientId

    public java.lang.String getClientId()

  Returns:
    Returns the clientId.

### getSubscriberName

    public java.lang.String getSubscriberName()

  Returns:
    Returns the subscriberName.

### getDestination

    public ActiveMQDestination getDestination()

  Returns:
    Returns the destination.

### getSelector

    public java.lang.String getSelector()

  Returns:
    Returns the selector.

### isActive

    public boolean isActive()

  Returns:
    Returns true if an active message consumer is associated with this

### setActive

    public void setActive(boolean newActive)
                   throws JMSException

  set the state of the Subscription

  Parameters:
    `newActive` -
  Throws:
    `JMSException`

### getConsumerNumber

    public int getConsumerNumber()

  Returns:
    Returns the consumerNumber.

### getConsumerId

    public java.lang.String getConsumerId()

  Returns:
    the consumer Id for the active consumer

### isTarget

    public boolean isTarget(ActiveMQMessage message)
                     throws JMSException

  determines if the Subscription is interested in the message

  Parameters:
    `message` -
  Returns:
  Throws:
    `JMSException`

### addMessage

    public void addMessage(MessageContainer container,
                           ActiveMQMessage message)
                    throws JMSException

  If the Subscription is a target for the message, the subscription will add a reference to the message and register an interest in the message to the container

  Parameters:
    `container` -
    `message` -
  Throws:
    `JMSException`

### messageConsumed

    public void messageConsumed(MessageAck ack)
                         throws JMSException

  Indicates a message has been delivered to a MessageConsumer which is typically called for topic based subscriptions

  Parameters:
    `ack` -
  Throws:
    `JMSException`

### redeliverMessage

    public void redeliverMessage(MessageContainer container,
                                 MessageAck ack)
                          throws JMSException

  Forces the given message to be redelivered

  Parameters:
    `container` -
    `ack` -
  Throws:
    `JMSException`

### getMessagesToDispatch

    public ActiveMQMessage[] getMessagesToDispatch()
                                            throws JMSException

  Retrieve messages to dispatch

  Returns:
  Throws:
    `JMSException`

### isReadyToDispatch

    public boolean isReadyToDispatch()
                              throws JMSException

  Indicates if this Subscription has more messages to send to the Consumer

  Returns:
    true if more messages available to dispatch
  Throws:
    `JMSException`

### isAtPrefetchLimit

    public boolean isAtPrefetchLimit()
                              throws JMSException

  Indicates the Subscription it's reached it's pre-fetch limit

  Returns:
    true/false
  Throws:
    `JMSException`

### isDurableTopic

    public boolean isDurableTopic()
                           throws JMSException

  Indicates the Consumer is a Durable Subscriber

  Returns:
  Throws:
    `JMSException`

### isBrowser

    public boolean isBrowser()
                      throws JMSException

  Indicates the consumer is a browser only

  Returns:
    true if a Browser
  Throws:
    `JMSException`

### getLastMessageIdentity

    public MessageIdentity getLastMessageIdentity()
                                           throws JMSException

  Retreives the messageIdentity of the last message sent to this Queue based Subscription

  Returns:
    the messageId of the last message or null
  Throws:
    `JMSException`

### setLastMessageIdentifier

    public void setLastMessageIdentifier(MessageIdentity messageIdentity)
                                  throws JMSException

  Used for a Queue based Subscription to set the last acknowledged message ID

  Parameters:
    `messageIdentity` -
  Throws:
    `JMSException`

### isWildcard

    public boolean isWildcard()

### getPersistentKey

    public java.lang.String getPersistentKey()

  Returns the persistent key used to uniquely identify this durable topic subscription

  Returns:

### isSameDurableSubscription

    public boolean isSameDurableSubscription(ConsumerInfo info)
                                      throws JMSException

  Checks if this subscription is a duplicate durable subscription of the given consumer info

  Parameters:
    `info` -
  Returns:
    true if this subscription is a durable topic subscription and the clientID and consumer names match
  Throws:
    `JMSException`

### onAcknowledgeTransactedMessageBeforeCommit

    public void onAcknowledgeTransactedMessageBeforeCommit(MessageAck ack)
                                                    throws JMSException

  We have not yet committed and so the message acknowledgement has not really occurred yet but we need to let the dispatcher know that we can commence dispatching more messages to the client. This is so that we can have a prefetch value of 1 yet we can still consume 1000 messages inside a transaction, with all the acks coming after the commit() on the client.

  Parameters:
    `ack` -
  Throws:
    `JMSException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 Protique, Ltd.. All Rights Reserved.