01: /**
02: * JOnAS: Java(TM) Open Application Server
03: * Copyright (C) 1999 Bull S.A.
04: * Contact: jonas-team@objectweb.org
05: *
06: * This library is free software; you can redistribute it and/or
07: *
08: * modify it under the terms of the GNU Lesser General Public
09: * License as published by the Free Software Foundation; either
10: * version 2.1 of the License, or 1any later version.
11: *
12: * This library is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this library; if not, write to the Free Software
19: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20: * USA
21: *
22: * Initial developer: JOnAS team
23: * --------------------------------------------------------------------------
24: * $Id: SessionRuleSet.java 5876 2004-12-08 14:05:09Z benoitf $
25: * --------------------------------------------------------------------------
26: */package org.objectweb.jonas_ejb.deployment.rules;
27:
28: import org.apache.commons.digester.Digester;
29:
30: import org.objectweb.jonas_lib.deployment.rules.EnvironmentRuleSet;
31: import org.objectweb.jonas_lib.deployment.rules.JRuleSetBase;
32: import org.objectweb.jonas_lib.deployment.rules.SecurityRoleRefRuleSet;
33:
34: /**
35: * This class defines the rules to analyze the element session
36: *
37: * @author JOnAS team
38: */
39:
40: public class SessionRuleSet extends JRuleSetBase {
41:
42: /**
43: * Construct an object with a specific prefix
44: * @param prefix prefix to use during the parsing
45: */
46: public SessionRuleSet(String prefix) {
47: super (prefix);
48: }
49:
50: /**
51: * Add a set of rules to the digester object
52: * @param digester Digester instance
53: */
54:
55: public void addRuleInstances(Digester digester) {
56: digester.addObjectCreate(prefix + "session",
57: "org.objectweb.jonas_ejb.deployment.xml.Session");
58: digester.addSetNext(prefix + "session", "addSession",
59: "org.objectweb.jonas_ejb.deployment.xml.Session");
60: digester.addCallMethod(prefix + "session/description",
61: "setDescription", 0);
62: digester.addCallMethod(prefix + "session/display-name",
63: "setDisplayName", 0);
64: digester.addCallMethod(prefix + "session/small-icon",
65: "setSmallIcon", 0);
66: digester.addCallMethod(prefix + "session/large-icon",
67: "setLargeIcon", 0);
68: digester.addCallMethod(prefix + "session/ejb-name",
69: "setEjbName", 0);
70: digester.addCallMethod(prefix + "session/home", "setHome", 0);
71: digester.addCallMethod(prefix + "session/remote", "setRemote",
72: 0);
73: digester.addCallMethod(prefix + "session/local-home",
74: "setLocalHome", 0);
75: digester.addCallMethod(prefix + "session/local", "setLocal", 0);
76: digester.addCallMethod(prefix + "session/service-endpoint",
77: "setServiceEndpoint", 0);
78: digester.addCallMethod(prefix + "session/ejb-class",
79: "setEjbClass", 0);
80: digester.addCallMethod(prefix + "session/session-type",
81: "setSessionType", 0);
82: digester.addCallMethod(prefix + "session/transaction-type",
83: "setTransactionType", 0);
84: digester
85: .addRuleSet(new EnvironmentRuleSet(prefix + "session/"));
86: digester.addRuleSet(new SecurityRoleRefRuleSet(prefix
87: + "session/"));
88: digester.addRuleSet(new SecurityIdentityRuleSet(prefix
89: + "session/"));
90: digester.addRuleSet(new IorSecurityConfigRuleSet(prefix
91: + "session/"));
92: }
93: }
|