Package jade.proto
Interface SubscriptionResponder.SubscriptionManager
-
- Enclosing class:
- SubscriptionResponder
public static interface SubscriptionResponder.SubscriptionManagerInner interface SubscriptionManager.A
SubscriptionResponder, besides enforcing and controlling the sequence of messages in a subscription conversation, also stores current subscriptions into an internal table. In many cases however it is desirable to manage Subscription objects in an application specific way (e.g. storing them to a persistent support such as a DB). To enable that, it is possible to pass a SubscriptionManager implementation to the SubscriptionResponder. The SubscriptionManager is notified about subscription and cancellation events by means of the register() and deregister() methods.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanderegister(SubscriptionResponder.Subscription s)Deregister a Subscription objectbooleanregister(SubscriptionResponder.Subscription s)Register a new Subscription object
-
-
-
Method Detail
-
register
boolean register(SubscriptionResponder.Subscription s) throws RefuseException, NotUnderstoodException
Register a new Subscription object- Parameters:
s- The Subscription object to be registered- Returns:
- The boolean value returned by this method provides an
indication to the
SubscriptionResponderabout whether or not an AGREE message should be sent back to the initiator. The default implementation of thehandleSubscription()method of theSubscriptionResponderignores this indication, but programmers can override it. - Throws:
RefuseExceptionNotUnderstoodException
-
deregister
boolean deregister(SubscriptionResponder.Subscription s) throws FailureException
Deregister a Subscription object- Returns:
- The boolean value returned by this method provides an
indication to the
SubscriptionResponderabout whether or not an INFORM message should be sent back to the initiator. The default implementation of thehandleCancel()method of theSubscriptionResponderignores this indication, but programmers can override it. - Throws:
FailureException
-
-