001: /**
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 1999 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: *
008: * modify it under the terms of the GNU Lesser General Public
009: * License as published by the Free Software Foundation; either
010: * version 2.1 of the License, or 1any later version.
011: *
012: * This library is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this library; if not, write to the Free Software
019: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
020: * USA
021: *
022: * Initial developer: JOnAS team
023: * --------------------------------------------------------------------------
024: * $Id: MessageDrivenRuleSet.java 4715 2004-05-10 11:29:10Z sauthieg $
025: * --------------------------------------------------------------------------
026: */package org.objectweb.jonas_ejb.deployment.rules;
027:
028: import org.apache.commons.digester.Digester;
029: import org.objectweb.jonas_lib.deployment.rules.JRuleSetBase;
030: import org.objectweb.jonas_lib.deployment.rules.EnvironmentRuleSet;
031:
032: /**
033: * This class defines the rules to analyze the element message-driven
034: *
035: * @author JOnAS team
036: */
037:
038: public class MessageDrivenRuleSet extends JRuleSetBase {
039:
040: /**
041: * Construct an object with a specific prefix
042: * @param prefix prefix to use during the parsing
043: */
044: public MessageDrivenRuleSet(String prefix) {
045: super (prefix);
046: }
047:
048: /**
049: * Add a set of rules to the digester object
050: * @param digester Digester instance
051: */
052:
053: public void addRuleInstances(Digester digester) {
054: digester.addObjectCreate(prefix + "message-driven",
055: "org.objectweb.jonas_ejb.deployment.xml.MessageDriven");
056: digester.addSetNext(prefix + "message-driven",
057: "addMessageDriven",
058: "org.objectweb.jonas_ejb.deployment.xml.MessageDriven");
059: digester.addCallMethod(prefix + "message-driven/description",
060: "setDescription", 0);
061: digester.addCallMethod(prefix + "message-driven/display-name",
062: "setDisplayName", 0);
063: digester.addCallMethod(prefix + "message-driven/small-icon",
064: "setSmallIcon", 0);
065: digester.addCallMethod(prefix + "message-driven/large-icon",
066: "setLargeIcon", 0);
067: digester.addCallMethod(prefix + "message-driven/ejb-name",
068: "setEjbName", 0);
069: digester.addCallMethod(prefix + "message-driven/ejb-class",
070: "setEjbClass", 0);
071: digester.addCallMethod(prefix
072: + "message-driven/transaction-type",
073: "setTransactionType", 0);
074: /* EJB 2.0 Specific Part */
075: digester.addCallMethod(prefix
076: + "message-driven/message-selector",
077: "setMessageSelector", 0);
078: digester.addCallMethod(prefix
079: + "message-driven/acknowledge-mode",
080: "setAcknowledgeMode", 0);
081: digester.addRuleSet(new MessageDrivenDestinationRuleSet(prefix
082: + "message-driven/"));
083: /* EJB 2.1 Specific Part */
084: digester.addCallMethod(
085: prefix + "message-driven/messaging-type",
086: "setMessagingType", 0);
087: digester.addCallMethod(prefix
088: + "message-driven/message-destination-type",
089: "setMessageDestinationType", 0);
090: digester.addCallMethod(prefix
091: + "message-driven/message-destination-link",
092: "setMessageDestinationLink", 0);
093: digester.addRuleSet(new ActivationConfigRuleSet(prefix
094: + "message-driven/"));
095:
096: /* End of EJB 2.1 Specific Part */
097: digester.addRuleSet(new EnvironmentRuleSet(prefix
098: + "message-driven/"));
099: digester.addRuleSet(new SecurityIdentityRuleSet(prefix
100: + "message-driven/"));
101:
102: }
103: }
|