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.model.container.subscription;
17  
18  import org.apache.commons.logging.Log;
19  
20  import fulmine.event.subscription.ISubscriptionParameters;
21  import fulmine.event.subscription.Subscription;
22  import fulmine.model.container.IContainer;
23  import fulmine.util.log.AsyncLog;
24  
25  /**
26   * A subscription implementation for matching against {@link IContainer}
27   * instances. When registering a listener against a matching container, an image
28   * event is forced from the container so that the newly registered listener
29   * receives the current state of the container.
30   * 
31   * @author Ramon Servadei
32   */
33  public class ContainerSubscription extends Subscription
34  {
35      private final static AsyncLog LOG =
36          new AsyncLog(ContainerSubscription.class);
37  
38      /**
39       * Standard constructor
40       * 
41       * @param parameters
42       *            the parameters for the subscription
43       * @param listener
44       *            the listener to register against subscription matches
45       */
46      protected ContainerSubscription(ISubscriptionParameters parameters)
47      {
48          super(parameters);
49      }
50  
51      @Override
52      protected Log getLog()
53      {
54          return LOG;
55      }
56  }