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: EntityRuleSet.java 4715 2004-05-10 11:29:10Z sauthieg $
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 entity
36: *
37: * @author JOnAS team
38: */
39:
40: public class EntityRuleSet extends JRuleSetBase {
41:
42: /**
43: * Construct an object with a specific prefix
44: * @param prefix prefix to use during the parsing
45: */
46: public EntityRuleSet(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 + "entity",
57: "org.objectweb.jonas_ejb.deployment.xml.Entity");
58: digester.addSetNext(prefix + "entity", "addEntity",
59: "org.objectweb.jonas_ejb.deployment.xml.Entity");
60: digester.addCallMethod(prefix + "entity/description",
61: "setDescription", 0);
62: digester.addCallMethod(prefix + "entity/display-name",
63: "setDisplayName", 0);
64: digester.addCallMethod(prefix + "entity/small-icon",
65: "setSmallIcon", 0);
66: digester.addCallMethod(prefix + "entity/large-icon",
67: "setLargeIcon", 0);
68: digester.addCallMethod(prefix + "entity/ejb-name",
69: "setEjbName", 0);
70: digester.addCallMethod(prefix + "entity/home", "setHome", 0);
71: digester
72: .addCallMethod(prefix + "entity/remote", "setRemote", 0);
73: digester.addCallMethod(prefix + "entity/local-home",
74: "setLocalHome", 0);
75: digester.addCallMethod(prefix + "entity/local", "setLocal", 0);
76: digester.addCallMethod(prefix + "entity/ejb-class",
77: "setEjbClass", 0);
78: digester.addCallMethod(prefix + "entity/persistence-type",
79: "setPersistenceType", 0);
80: digester.addCallMethod(prefix + "entity/prim-key-class",
81: "setPrimKeyClass", 0);
82: digester.addCallMethod(prefix + "entity/reentrant",
83: "setReentrant", 0);
84: digester.addCallMethod(prefix + "entity/cmp-version",
85: "setCmpVersion", 0);
86: digester.addCallMethod(prefix + "entity/abstract-schema-name",
87: "setAbstractSchemaName", 0);
88: digester.addRuleSet(new CmpFieldRuleSet(prefix + "entity/"));
89: digester.addCallMethod(prefix + "entity/primkey-field",
90: "setPrimkeyField", 0);
91: digester.addRuleSet(new EnvironmentRuleSet(prefix + "entity/"));
92: digester.addRuleSet(new SecurityRoleRefRuleSet(prefix
93: + "entity/"));
94: digester.addRuleSet(new SecurityIdentityRuleSet(prefix
95: + "entity/"));
96: digester.addRuleSet(new QueryRuleSet(prefix + "entity/"));
97: }
98: }
|