KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_rar > deployment > rules > JonasConnectorRuleSet


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: Florent BENOIT
23  * --------------------------------------------------------------------------
24  * $Id: JonasConnectorRuleSet.java,v 1.3 2005/04/14 20:20:22 ehardesty Exp $
25  * --------------------------------------------------------------------------
26  */

27 package org.objectweb.jonas_rar.deployment.rules;
28
29 import org.apache.commons.digester.Digester;
30 import org.objectweb.jonas_lib.deployment.rules.JRuleSetBase;
31
32 /**
33  * This class defines the rules to analyze the element jonas-resource
34  *
35  * @author Florent Benoit
36  */

37
38 public class JonasConnectorRuleSet extends JRuleSetBase {
39
40     /**
41      * Prefix to use with JOnAS 4.0
42      */

43     private static final String JavaDoc CONNECTOR_PREFIX = "jonas-connector/";
44
45     /**
46      * Prefix for backward compliance. This prefix is deprecated
47      */

48     private static final String JavaDoc OLDCONNECTOR_PREFIX = "jonas-resource/";
49
50     /**
51      * Construct an object
52      */

53     public JonasConnectorRuleSet() {
54         super(CONNECTOR_PREFIX);
55     }
56
57     /**
58      * Construct an object with a specific prefix
59      * @param prefix prefix to use
60      */

61     private JonasConnectorRuleSet(String JavaDoc prefix) {
62         super(prefix);
63     }
64
65      /**
66      * Add a set of rules to the digester object
67      * @param digester Digester instance
68      */

69
70     public void addRuleInstances(Digester digester) {
71         digester.addCallMethod(prefix + "jndi-name",
72                                "setJndiName", 0);
73         // The rule below is for compliance with jonas-connector_3_0.dtd
74
// Now the right way is to use jndi-name
75
digester.addCallMethod(prefix + "jndiname",
76                                "setJndiName", 0);
77         digester.addCallMethod(prefix + "rarlink",
78                                "setRarlink", 0);
79         digester.addCallMethod(prefix + "native-lib",
80                                "setNativeLib", 0);
81         digester.addCallMethod(prefix + "log-enabled",
82                                "setLogEnabled", 0);
83         digester.addCallMethod(prefix + "log-topic",
84                                "setLogTopic", 0);
85         digester.addRuleSet(new PoolParamsRuleSet(prefix));
86         digester.addRuleSet(new JdbcConnParamsRuleSet(prefix));
87         digester.addRuleSet(new TmParamsRuleSet(prefix));
88         digester.addRuleSet(new JonasConfigPropertyRuleSet(prefix));
89         digester.addRuleSet(new JonasConnectionDefinitionRuleSet(prefix));
90         digester.addRuleSet(new JonasActivationspecRuleSet(prefix));
91         digester.addRuleSet(new JonasAdminobjectRuleSet(prefix));
92         digester.addRuleSet(new JonasSecurityMappingRuleSet(prefix));
93         // Add same rules but with another prefix
94
// This is for backward compliance with 3.0 DTD
95
if (prefix.equals(CONNECTOR_PREFIX)) {
96             digester.addRuleSet(new JonasConnectorRuleSet(OLDCONNECTOR_PREFIX));
97         }
98
99     }
100 }
101
Popular Tags