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.distribution.events;
17  
18  import fulmine.context.IFrameworkContext;
19  import fulmine.distribution.connection.IConnectionDiscoverer;
20  import fulmine.event.IEventManager;
21  import fulmine.event.system.AbstractSystemEvent;
22  
23  /**
24   * Raised by an {@link IConnectionDiscoverer} when a remote context is no longer
25   * available.
26   * 
27   * @author Ramon Servadei
28   */
29  public class ContextNotAvailableEvent extends AbstractSystemEvent
30  {
31      /**
32       * The name of the remote {@link IFrameworkContext} that is no longer
33       * available.
34       */
35      final String remoteContextIdentity;
36  
37      /**
38       * Standard constructor with the name of the remote
39       * {@link IFrameworkContext} that is no longer available.
40       * 
41       * @param context
42       *            the context for event operations
43       * @param remoteContextIdentity
44       *            the name of the remote {@link IFrameworkContext} that is no
45       *            longer available
46       */
47      public ContextNotAvailableEvent(IEventManager context,
48          String remoteContextIdentity)
49      {
50          super(context);
51          this.remoteContextIdentity = remoteContextIdentity;
52      }
53  
54      public String getRemoteContextIdentity()
55      {
56          return this.remoteContextIdentity;
57      }
58  
59      @Override
60      protected String getAdditionalToString()
61      {
62          return "remoteContext=" + getRemoteContextIdentity();
63      }
64  }