KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > jcorporate > expresso > core > registry > MutableRequestRegistry


1 /* The Jcorporate Apache Style Software License, Version 1.2 05-07-2002
2 *
3 * Copyright (c) 1995-2002 Jcorporate Ltd. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in
14 * the documentation and/or other materials provided with the
15 * distribution.
16 *
17 * 3. The end-user documentation included with the redistribution,
18 * if any, must include the following acknowledgment:
19 * "This product includes software developed by Jcorporate Ltd.
20 * (http://www.jcorporate.com/)."
21 * Alternately, this acknowledgment may appear in the software itself,
22 * if and wherever such third-party acknowledgments normally appear.
23 *
24 * 4. "Jcorporate" and product names such as "Expresso" must
25 * not be used to endorse or promote products derived from this
26 * software without prior written permission. For written permission,
27 * please contact info@jcorporate.com.
28 *
29 * 5. Products derived from this software may not be called "Expresso",
30 * or other Jcorporate product names; nor may "Expresso" or other
31 * Jcorporate product names appear in their name, without prior
32 * written permission of Jcorporate Ltd.
33 *
34 * 6. No product derived from this software may compete in the same
35 * market space, i.e. framework, without prior written permission
36 * of Jcorporate Ltd. For written permission, please contact
37 * partners@jcorporate.com.
38 *
39 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
40 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
41 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
42 * DISCLAIMED. IN NO EVENT SHALL JCORPORATE LTD OR ITS CONTRIBUTORS
43 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
44 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
45 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
46 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
47 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
48 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
49 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
50 * SUCH DAMAGE.
51 * ====================================================================
52 *
53 * This software consists of voluntary contributions made by many
54 * individuals on behalf of the Jcorporate Ltd. Contributions back
55 * to the project(s) are encouraged when you make modifications.
56 * Please send them to support@jcorporate.com. For more information
57 * on Jcorporate Ltd. and its products, please see
58 * <http://www.jcorporate.com/>.
59 *
60 * Portions of this software are based upon other open source
61 * products and are subject to their respective licenses.
62  */

63
64
65 package com.jcorporate.expresso.core.registry;
66
67 import com.jcorporate.expresso.core.security.User;
68
69 /**
70  * This is the actual class that gets constructed during request initialization.
71  * It uses its setters to create state for the RequestRegistry object, but
72  * clients simply use RequestRegistry static methods as the interface.
73  * <p><em>So do not use this class directly as a client. Use
74  * {@link RequestRegistry} instead.</em></p>
75  *
76  * @author Michael Rimov
77  */

78 public class MutableRequestRegistry extends RequestRegistry {
79
80     /**
81      * Default constructor
82      */

83     public MutableRequestRegistry() {
84     }
85
86     /**
87      * Constructs a request registry with the given data context and user.
88      *
89      * @param dataContext String the current Expresso data context
90      * @param user User the current Expresso user from a security perspective.
91      */

92     public MutableRequestRegistry(String JavaDoc dataContext, User user) {
93         setDataContext(dataContext);
94         setUser(user);
95     }
96
97     /**
98      * Sets the current data context.
99      *
100      * @param dataContext String the data context.
101      */

102     public void setDataContext(String JavaDoc dataContext) {
103         this.dataContext = dataContext;
104     }
105
106     /**
107      * Sets the current thread's user.
108      *
109      * @param user User the user.
110      */

111     public void setUser(User user) {
112         this.user = user;
113     }
114
115     /**
116      * Needs to be called between http requests because otherwise
117      * we could have a security credential leak.
118      */

119     public void releaseSettings() {
120         super.releaseSettings();
121     }
122 }
123
Popular Tags