01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.cocoon.portal.event;
18:
19: /**
20: * A receiver registers its interest in a class
21: * of events through the {@link org.apache.cocoon.portal.event.EventManager}.
22: * An event is an object of the interface {@link org.apache.cocoon.portal.event.Event}
23: * or a subclass/interface of it. Usually a receiver is not interested in
24: * every event but only for some specific event types. These types are represented
25: * by an own subclass/interface.
26: * When a receiver subscribes itself at the event manager, the manager checks (using
27: * reflection) for occurances of the method "inform" on the receiver. The signature
28: * of the method consists of two parameters, where the first one is the event subclass
29: * and the second one the PortalService.
30: * If for example a receiver is interested in all {@link org.apache.cocoon.portal.event.CopletInstanceEvent}s
31: * then it subscribes using the event manager and should provide an inform method
32: * with the following signature:
33: * public void inform(CopletInstanceEvent event, PortalService).
34: *
35: * If a receiver is interested in more than one event type, then it can implement
36: * several inform methods each with the corresponding event class as the first
37: * parameter. However, it is important to notice that the current implementation
38: * of the event manager has some restrictions! A receiver should not implement to
39: * inform methods where one event is a subclass or subinterface of the other event.
40: * In that case only one method is called and it's not deterministic which one will be called
41: * (this may vary for example on the used operating system the code runs on!).
42: * This problem will be solved in 2.2.
43: *
44: * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
45: *
46: * @version CVS $Id: Receiver.java 433543 2006-08-22 06:22:54Z crossley $
47: */
48: public interface Receiver {
49:
50: // THIS IS JUST A MARKER INTERFACE!
51: }
|