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.context; 17 18 import org.apache.cocoon.ProcessingException; 19 20 /** 21 * Interface for a context provider. 22 * Objects of this class provide special context, e.g. authentication or portal. 23 * The provider has to take care that the context is instantiated and managed 24 * correctly: for example a request context object should only created once 25 * per request, an authentication context once per session etc. 26 * 27 * @author <a HREF="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a> 28 * @version CVS $Id: SessionContextProvider.java 30932 2004-07-29 17:35:38Z vgritsenko $ 29 */ 30 public interface SessionContextProvider { 31 32 String ROLE = SessionContextProvider.class.getName(); 33 34 /** 35 * Get the context 36 * @param name The name of the context 37 * @return The context 38 * @throws ProcessingException If the context is not available. 39 */ 40 SessionContext getSessionContext(String name) 41 throws ProcessingException; 42 43 /** 44 * Does the context exist? 45 */ 46 boolean existsSessionContext(String name) 47 throws ProcessingException; 48 49 } 50