KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > webapps > session > ContextManager


1 /*
2  * Copyright 1999-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.webapps.session;
17
18 import java.io.IOException JavaDoc;
19
20 import org.apache.cocoon.ProcessingException;
21 import org.apache.cocoon.webapps.session.context.SessionContext;
22 import org.xml.sax.SAXException JavaDoc;
23
24 /**
25  * This is the context manager.
26  *
27  * The main purpose of this component is maintaining contexts. Each
28  * application can have one or more session contexts.
29  * A context is a data container that can hold arbitrary information.
30  * The contained information can either be an XML tree or custom
31  * objects.
32  *
33  * @author <a HREF="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
34  * @version CVS $Id: ContextManager.java 30932 2004-07-29 17:35:38Z vgritsenko $
35 */

36 public interface ContextManager {
37
38     /** Avalon role */
39     String JavaDoc ROLE = ContextManager.class.getName();;
40
41     /**
42      * Create a new public context in the session.
43      * Create a new public session context for this user. If this context
44      * already exists no new context is created and the old one will be used
45      * instead.
46      */

47     SessionContext createContext(String JavaDoc name, String JavaDoc loadURI, String JavaDoc saveURI)
48     throws IOException JavaDoc, SAXException JavaDoc, ProcessingException;
49
50     /**
51      * Delete a public context in the session.
52      * If the context exists for this user, it and all of its information
53      * is deleted.
54      */

55     void deleteContext(String JavaDoc name)
56     throws ProcessingException;
57
58     /**
59      * Get a public context.
60      * The session context with the given name is returned. If the context does
61      * not exist <CODE>null</CODE> is returned.
62      */

63     SessionContext getContext(String JavaDoc name)
64     throws ProcessingException;
65
66     /**
67      * Check if a context exists
68      */

69     boolean hasSessionContext()
70     throws ProcessingException;
71
72     /**
73      * Check if a public context exists.
74      * If the session context with the given name exists, <CODE>true</CODE> is
75      * returned.
76      */

77     boolean existsContext(String JavaDoc name)
78     throws ProcessingException;
79 }
80
Popular Tags