KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > lateralnz > panther > deploy > SessionDescriptor


1 /* ====================================================================
2  * The LateralNZ Software License, Version 1.0
3  *
4  * Copyright (c) 2003 LateralNZ. All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in binary form must reproduce the above copyright
14  * notice, this list of conditions and the following disclaimer in
15  * the documentation and/or other materials provided with the
16  * distribution.
17  *
18  * 3. The end-user documentation included with the redistribution,
19  * if any, must include the following acknowledgment:
20  * "This product includes software developed by
21  * LateralNZ (http://www.lateralnz.org/) and other third parties."
22  * Alternately, this acknowledgment may appear in the software itself,
23  * if and wherever such third-party acknowledgments normally appear.
24  *
25  * 4. The names "LateralNZ" must not be used to endorse or promote
26  * products derived from this software without prior written
27  * permission. For written permission, please
28  * contact oss@lateralnz.org.
29  *
30  * 5. Products derived from this software may not be called "Panther",
31  * or "Lateral" or "LateralNZ", nor may "PANTHER" or "LATERAL" or
32  * "LATERALNZ" appear in their name, without prior written
33  * permission of LateralNZ.
34  *
35  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
36  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
37  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
38  * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
39  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
40  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
41  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
42  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
43  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
44  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
45  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
46  * SUCH DAMAGE.
47  * ====================================================================
48  *
49  * This software consists of voluntary contributions made by many
50  * individuals on behalf of LateralNZ. For more
51  * information on Lateral, please see http://www.lateralnz.com/ or
52  * http://www.lateralnz.org
53  *
54  */

55 package org.lateralnz.panther.deploy;
56
57 import java.util.Map JavaDoc;
58
59 import org.lateralnz.common.util.Constants;
60
61 /**
62  * a data holder for session bean information
63  *
64  * @author J R Briggs
65  */

66 public class SessionDescriptor implements Constants {
67   private static final String JavaDoc ASTERISK = "*";
68   
69   private String JavaDoc ejbName;
70   private String JavaDoc ejbRemoteClass;
71   private String JavaDoc ejbHomeClass;
72   private String JavaDoc ejbClass;
73   private String JavaDoc sessionType;
74   private Map JavaDoc envEntries = null;
75   private Map JavaDoc transEntries = null;
76
77   public SessionDescriptor(String JavaDoc ejbName, String JavaDoc ejbRemoteClass, String JavaDoc ejbHomeClass,
78                            String JavaDoc ejbClass, String JavaDoc sessionType) {
79     this.ejbName = ejbName;
80     this.ejbRemoteClass = ejbRemoteClass;
81     this.ejbHomeClass = ejbHomeClass;
82     this.ejbClass = ejbClass;
83     this.sessionType = sessionType;
84   }
85   
86   public String JavaDoc getEJBName() {
87     return ejbName;
88   }
89   
90   public String JavaDoc getEJBRemoteClass() {
91     return ejbRemoteClass;
92   }
93   
94   public String JavaDoc getEJBHomeClass() {
95     return ejbHomeClass;
96   }
97   
98   public String JavaDoc getEJBClass() {
99     return ejbClass;
100   }
101   
102   public String JavaDoc getSessionType() {
103     return sessionType;
104   }
105   
106   public void setTransEntries(Map JavaDoc transEntries) {
107     this.transEntries = transEntries;
108   }
109   
110   public String JavaDoc getTransEntry(String JavaDoc method) {
111     if (transEntries.containsKey(method)) {
112       return (String JavaDoc)transEntries.get(method);
113     }
114     else if (transEntries.containsKey(ASTERISK)) {
115       return (String JavaDoc)transEntries.get(ASTERISK);
116     }
117     else {
118       return EMPTY;
119     }
120   }
121   
122   public void setEnvEntries(Map JavaDoc envEntries) {
123     this.envEntries = envEntries;
124   }
125   
126   public Map JavaDoc getEnvEntries() {
127     return envEntries;
128   }
129   
130   public String JavaDoc toString() {
131     return getEJBName() + COMMA + getEJBRemoteClass() + COMMA +
132            getEJBClass() + COMMA + getSessionType() + COMMA + transEntries;
133   }
134 }
135
Popular Tags