View Javadoc

1   /*
2      Copyright 2007 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.events;
17  
18  import fulmine.event.IEventManager;
19  import fulmine.event.IEventSource;
20  import fulmine.event.system.AbstractSystemEvent;
21  import fulmine.event.system.ISystemEvent;
22  import fulmine.event.system.ISystemEventListener;
23  import fulmine.model.container.IContainer;
24  
25  /**
26   * Raised when a local {@link IContainer} has been created.
27   * <p>
28   * This is an {@link ISystemEvent} and listeners for these events need to be
29   * instances of {@link ISystemEventListener}. The listener should be registered
30   * against the {@link IEventSource} returned from
31   * {@link IEventManager#getSystemEventSource(Class)}.
32   * 
33   * @author Ramon Servadei
34   */
35  public final class ContainerCreatedEvent extends AbstractSystemEvent
36  {
37      /** The container that has been created */
38      private final IContainer container;
39  
40      /**
41       * Standard constructor
42       * 
43       * @param context
44       *            the context for event operations
45       * @param container
46       *            the container that has been created
47       */
48      public ContainerCreatedEvent(IEventManager context, IContainer container)
49      {
50          super(context, container);
51          this.container = container;
52      }
53  
54      /**
55       * Get the container that has been created
56       * 
57       * @return the {@link IContainer} that has been created
58       */
59      public IContainer getContainer()
60      {
61          return this.container;
62      }
63  }