KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * Copyright 1999-2002,2004 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 import org.apache.avalon.framework.component.Component;
19
20 /**
21  * Convert events from and into strings
22  *
23  * @author <a HREF="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
24  * @author <a HREF="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
25  *
26  * @version CVS $Id: EventConverter.java 125127 2005-01-14 01:21:53Z rgoers $
27  */

28 public interface EventConverter extends Component {
29
30     String JavaDoc ROLE = EventConverter.class.getName();
31     
32     /**
33      * Encode an event.
34      * This is used to "activate" events using a link
35      * @param event The event to encode
36      * @return A unique string representation for this event
37      */

38     String JavaDoc encode(Event event);
39     
40     /**
41      * Decode an event
42      * This is used to "activate" events using a link
43      * @param value The string representation created using {@link #encode(Event)}
44      * @return The event or null
45      */

46     Event decode(String JavaDoc value);
47
48     /**
49      * This notifies the converter that a new event processing phase starts
50      */

51     void start();
52     
53     /**
54      * This notifies the converter that an event processing phase ends
55      */

56     void finish();
57
58     /**
59      * Returns true if events are not to be returned as request parameters
60      */

61     boolean isMarshallEvents();
62 }
63
Popular Tags