001: /* The Jcorporate Apache Style Software License, Version 1.2 05-07-2002
002: *
003: * Copyright (c) 1995-2002 Jcorporate Ltd. All rights reserved.
004: *
005: * Redistribution and use in source and binary forms, with or without
006: * modification, are permitted provided that the following conditions
007: * are met:
008: *
009: * 1. Redistributions of source code must retain the above copyright
010: * notice, this list of conditions and the following disclaimer.
011: *
012: * 2. Redistributions in binary form must reproduce the above copyright
013: * notice, this list of conditions and the following disclaimer in
014: * the documentation and/or other materials provided with the
015: * distribution.
016: *
017: * 3. The end-user documentation included with the redistribution,
018: * if any, must include the following acknowledgment:
019: * "This product includes software developed by Jcorporate Ltd.
020: * (http://www.jcorporate.com/)."
021: * Alternately, this acknowledgment may appear in the software itself,
022: * if and wherever such third-party acknowledgments normally appear.
023: *
024: * 4. "Jcorporate" and product names such as "Expresso" must
025: * not be used to endorse or promote products derived from this
026: * software without prior written permission. For written permission,
027: * please contact info@jcorporate.com.
028: *
029: * 5. Products derived from this software may not be called "Expresso",
030: * or other Jcorporate product names; nor may "Expresso" or other
031: * Jcorporate product names appear in their name, without prior
032: * written permission of Jcorporate Ltd.
033: *
034: * 6. No product derived from this software may compete in the same
035: * market space, i.e. framework, without prior written permission
036: * of Jcorporate Ltd. For written permission, please contact
037: * partners@jcorporate.com.
038: *
039: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
040: * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
041: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
042: * DISCLAIMED. IN NO EVENT SHALL JCORPORATE LTD OR ITS CONTRIBUTORS
043: * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
044: * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
045: * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
046: * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
047: * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
048: * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
049: * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
050: * SUCH DAMAGE.
051: * ====================================================================
052: *
053: * This software consists of voluntary contributions made by many
054: * individuals on behalf of the Jcorporate Ltd. Contributions back
055: * to the project(s) are encouraged when you make modifications.
056: * Please send them to support@jcorporate.com. For more information
057: * on Jcorporate Ltd. and its products, please see
058: * <http://www.jcorporate.com/>.
059: *
060: * Portions of this software are based upon other open source
061: * products and are subject to their respective licenses.
062: */
063:
064: package com.jcorporate.expresso.core.registry;
065:
066: import com.jcorporate.expresso.core.security.User;
067:
068: /**
069: * Test model to verify Expresso Threads. When the thread is run and
070: * exists, it will have set the values of the RequestRegistry for that
071: * thread.
072: *
073: * @author Michael Rimov
074: * @version $Revision: 1.2 $ on $Date: 2004/11/17 20:48:23 $
075: */
076: public class ExpressoThreadTestModel extends ExpressoThread {
077: private String dataContext;
078:
079: private User user;
080:
081: public ExpressoThreadTestModel() {
082: super ();
083: }
084:
085: public void setDataContext(String dataContext) {
086: this .dataContext = dataContext;
087: }
088:
089: public void setUser(User user) {
090: this .user = user;
091: }
092:
093: public String getDataContext() {
094: return dataContext;
095: }
096:
097: public User getUser() {
098: return user;
099: }
100:
101: /**
102: * When an object implementing interface <code>Runnable</code> is used to
103: * create a thread, starting the thread causes the object's
104: * <code>run</code> method to be called in that separately executing
105: * thread.
106: */
107: public void run() {
108: super.run();
109:
110: this.setDataContext(RequestRegistry.getDataContext());
111: this.setUser(RequestRegistry.getUser());
112: }
113: }
|