View Javadoc

1   /*
2      Copyright 2008 Ramon Servadei
3   
4      Licensed under the Apache License, Version 2.0 (the "License");
5      you may not use this file except in compliance with the License.
6      You may obtain a copy of the License at
7   
8          http://www.apache.org/licenses/LICENSE-2.0
9   
10     Unless required by applicable law or agreed to in writing, software
11     distributed under the License is distributed on an "AS IS" BASIS,
12     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13     See the License for the specific language governing permissions and
14     limitations under the License.
15   */
16  package fulmine.event.system;
17  
18  import fulmine.IAddressable;
19  import fulmine.event.IEventManager;
20  import fulmine.event.IEventSource;
21  import fulmine.event.listener.IEventListener;
22  import fulmine.event.subscription.ISubscriptionListener;
23  import fulmine.event.subscription.ISubscriptionManager;
24  
25  /**
26   * A system event raised when an {@link ISubscriptionManager} removes a
27   * subscription.
28   * <p>
29   * Application code can register an {@link ISystemEventListener} to receive
30   * these events in order to stop servicing the affected event source(s).
31   * However, the event source(s) may have other subscriptions still requiring
32   * servicing; application code needs to check how many {@link IEventListener}
33   * instances are still attached to any of the matching {@link IEventSource}
34   * instances for the subscription before performing any cleanup for the
35   * resources servicing the source.
36   * 
37   * @see SubscribeEvent
38   * @see ISubscriptionListener
39   * @see ISubscriptionManager#unsubscribe(fulmine.event.subscription.ISubscriptionParameters)
40   * @author Ramon Servadei
41   */
42  public final class UnsubscribeEvent extends AbstractSystemEvent
43  {
44      /**
45       * Standard constructor
46       * 
47       * @param context
48       *            the context the event is handled in
49       * @param id
50       *            the subscription parameters
51       */
52      public UnsubscribeEvent(IEventManager context, IAddressable id)
53      {
54          super(context, id);
55      }
56  }