KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > portal > event > Receiver


1 /*
2  * Copyright 2005 The Apache Software Foundation.
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 org.apache.cocoon.portal.event;
17
18 /**
19  * A receiver registers its interest in a class
20  * of events through the {@link org.apache.cocoon.portal.event.EventManager}.
21  * An event is an object of the interface {@link org.apache.cocoon.portal.event.Event}
22  * or a subclass/interface of it. Usually a receiver is not interested in
23  * every event but only for some specific event types. These types are represented
24  * by an own subclass/interface.
25  * When a receiver subscribes itself at the event manager, the manager checks (using
26  * reflection) for occurances of the method "inform" on the receiver. The signature
27  * of the method consists of two parameters, where the first one is the event subclass
28  * and the second one the PortalService.
29  * If for example a receiver is interested in all {@link org.apache.cocoon.portal.event.CopletInstanceEvent}s
30  * then it subscribes using the event manager and should provide an inform method
31  * with the following signature:
32  * public void inform(CopletInstanceEvent event, PortalService).
33  *
34  * If a receiver is interested in more than one event type, then it can implement
35  * several inform methods each with the corresponding event class as the first
36  * parameter.
37  *
38  * @author <a HREF="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
39  *
40  * @version CVS $Id: Receiver.java 219049 2005-07-14 15:11:52Z cziegeler $
41  */

42 public interface Receiver {
43
44     // THIS IS JUST A MARKER INTERFACE!
45
}
46
Popular Tags