KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_ejb > deployment > rules > EntityRuleSet


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  *
8  * modify it under the terms of the GNU Lesser General Public
9  * 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,v 1.3 2004/05/10 11:29:10 sauthieg Exp $
25  * --------------------------------------------------------------------------
26  */

27 package org.objectweb.jonas_ejb.deployment.rules;
28
29 import org.apache.commons.digester.Digester;
30
31 import org.objectweb.jonas_lib.deployment.rules.EnvironmentRuleSet;
32 import org.objectweb.jonas_lib.deployment.rules.JRuleSetBase;
33 import org.objectweb.jonas_lib.deployment.rules.SecurityRoleRefRuleSet;
34
35 /**
36  * This class defines the rules to analyze the element entity
37  *
38  * @author JOnAS team
39  */

40
41 public class EntityRuleSet extends JRuleSetBase {
42
43     /**
44      * Construct an object with a specific prefix
45      * @param prefix prefix to use during the parsing
46      */

47     public EntityRuleSet(String JavaDoc prefix) {
48         super(prefix);
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",
59                             "addEntity",
60                             "org.objectweb.jonas_ejb.deployment.xml.Entity");
61         digester.addCallMethod(prefix + "entity/description",
62                                "setDescription", 0);
63         digester.addCallMethod(prefix + "entity/display-name",
64                                "setDisplayName", 0);
65         digester.addCallMethod(prefix + "entity/small-icon",
66                                "setSmallIcon", 0);
67         digester.addCallMethod(prefix + "entity/large-icon",
68                                "setLargeIcon", 0);
69         digester.addCallMethod(prefix + "entity/ejb-name",
70                                "setEjbName", 0);
71         digester.addCallMethod(prefix + "entity/home",
72                                "setHome", 0);
73         digester.addCallMethod(prefix + "entity/remote",
74                                "setRemote", 0);
75         digester.addCallMethod(prefix + "entity/local-home",
76                                "setLocalHome", 0);
77         digester.addCallMethod(prefix + "entity/local",
78                                "setLocal", 0);
79         digester.addCallMethod(prefix + "entity/ejb-class",
80                                "setEjbClass", 0);
81         digester.addCallMethod(prefix + "entity/persistence-type",
82                                "setPersistenceType", 0);
83         digester.addCallMethod(prefix + "entity/prim-key-class",
84                                "setPrimKeyClass", 0);
85         digester.addCallMethod(prefix + "entity/reentrant",
86                                "setReentrant", 0);
87         digester.addCallMethod(prefix + "entity/cmp-version",
88                                "setCmpVersion", 0);
89         digester.addCallMethod(prefix + "entity/abstract-schema-name",
90                                "setAbstractSchemaName", 0);
91         digester.addRuleSet(new CmpFieldRuleSet(prefix + "entity/"));
92         digester.addCallMethod(prefix + "entity/primkey-field",
93                                "setPrimkeyField", 0);
94         digester.addRuleSet(new EnvironmentRuleSet(prefix + "entity/"));
95         digester.addRuleSet(new SecurityRoleRefRuleSet(prefix + "entity/"));
96         digester.addRuleSet(new SecurityIdentityRuleSet(prefix + "entity/"));
97         digester.addRuleSet(new QueryRuleSet(prefix + "entity/"));
98    }
99 }
100
Popular Tags