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.channel;
17
18 import fulmine.event.IEventManager;
19 import fulmine.event.system.AbstractSystemEvent;
20
21 /**
22 * Raised when an {@link IChannel} is ready - this means the channel can now be
23 * used. A channel can exist but not ready for use; only when it has
24 * synchronised readiness with the peer channel can it be considered available
25 * for use.
26 *
27 * @author Ramon Servadei
28 *
29 */
30 public class ChannelReadyEvent extends AbstractSystemEvent
31 {
32 /** The channel that is available */
33 private final IChannel channel;
34
35 /**
36 * Standard constructor
37 *
38 * @param context
39 * the context for event operations
40 * @param channel
41 * the channel that has been created
42 */
43 public ChannelReadyEvent(IEventManager context, IChannel channel)
44 {
45 super(context);
46 this.channel = channel;
47 }
48
49 /**
50 * Get the channel that has become ready
51 *
52 * @return the {@link IChannel} encapsulated by this event
53 */
54 public IChannel getChannel()
55 {
56 return channel;
57 }
58
59 @Override
60 protected String getAdditionalToString()
61 {
62 return "channel=" + this.channel;
63 }
64 }