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: Florent BENOIT
23: * --------------------------------------------------------------------------
24: * $Id: JonasConnectorRuleSet.java 6553 2005-04-14 20:20:22Z ehardesty $
25: * --------------------------------------------------------------------------
26: */package org.objectweb.jonas_rar.deployment.rules;
27:
28: import org.apache.commons.digester.Digester;
29: import org.objectweb.jonas_lib.deployment.rules.JRuleSetBase;
30:
31: /**
32: * This class defines the rules to analyze the element jonas-resource
33: *
34: * @author Florent Benoit
35: */
36:
37: public class JonasConnectorRuleSet extends JRuleSetBase {
38:
39: /**
40: * Prefix to use with JOnAS 4.0
41: */
42: private static final String CONNECTOR_PREFIX = "jonas-connector/";
43:
44: /**
45: * Prefix for backward compliance. This prefix is deprecated
46: */
47: private static final String OLDCONNECTOR_PREFIX = "jonas-resource/";
48:
49: /**
50: * Construct an object
51: */
52: public JonasConnectorRuleSet() {
53: super (CONNECTOR_PREFIX);
54: }
55:
56: /**
57: * Construct an object with a specific prefix
58: * @param prefix prefix to use
59: */
60: private JonasConnectorRuleSet(String prefix) {
61: super (prefix);
62: }
63:
64: /**
65: * Add a set of rules to the digester object
66: * @param digester Digester instance
67: */
68:
69: public void addRuleInstances(Digester digester) {
70: digester.addCallMethod(prefix + "jndi-name", "setJndiName", 0);
71: // The rule below is for compliance with jonas-connector_3_0.dtd
72: // Now the right way is to use jndi-name
73: digester.addCallMethod(prefix + "jndiname", "setJndiName", 0);
74: digester.addCallMethod(prefix + "rarlink", "setRarlink", 0);
75: digester
76: .addCallMethod(prefix + "native-lib", "setNativeLib", 0);
77: digester.addCallMethod(prefix + "log-enabled", "setLogEnabled",
78: 0);
79: digester.addCallMethod(prefix + "log-topic", "setLogTopic", 0);
80: digester.addRuleSet(new PoolParamsRuleSet(prefix));
81: digester.addRuleSet(new JdbcConnParamsRuleSet(prefix));
82: digester.addRuleSet(new TmParamsRuleSet(prefix));
83: digester.addRuleSet(new JonasConfigPropertyRuleSet(prefix));
84: digester
85: .addRuleSet(new JonasConnectionDefinitionRuleSet(prefix));
86: digester.addRuleSet(new JonasActivationspecRuleSet(prefix));
87: digester.addRuleSet(new JonasAdminobjectRuleSet(prefix));
88: digester.addRuleSet(new JonasSecurityMappingRuleSet(prefix));
89: // Add same rules but with another prefix
90: // This is for backward compliance with 3.0 DTD
91: if (prefix.equals(CONNECTOR_PREFIX)) {
92: digester.addRuleSet(new JonasConnectorRuleSet(
93: OLDCONNECTOR_PREFIX));
94: }
95:
96: }
97: }
|