geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lin...@apache.org
Subject svn commit: r582931 [2/3] - in /geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources: ./ META-INF/ schema/ src/ src/org/ src/org/apache/ src/org/apache/geronimo/ src/org/apache/geronimo/devtools/ src/org/apache/geronimo/devtoo...
Date Mon, 08 Oct 2007 18:50:09 GMT
Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/src/org/apache/geronimo/devtools/j2g/resources/security/SecurityResourcesTool.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/src/org/apache/geronimo/devtools/j2g/resources/security/SecurityResourcesTool.java?rev=582931&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/src/org/apache/geronimo/devtools/j2g/resources/security/SecurityResourcesTool.java (added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/src/org/apache/geronimo/devtools/j2g/resources/security/SecurityResourcesTool.java Mon Oct  8 11:50:05 2007
@@ -0,0 +1,575 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.devtools.j2g.resources.security;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Iterator;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.devtools.j2g.common.IFileMigration;
+import org.apache.geronimo.devtools.j2g.common.IOutput;
+import org.apache.geronimo.devtools.j2g.common.Tool;
+import org.apache.geronimo.devtools.j2g.util.resources.Constants;
+import org.apache.geronimo.devtools.j2g.util.resources.xml.XMLConversionHelper;
+import org.dom4j.Attribute;
+import org.dom4j.Document;
+import org.dom4j.DocumentException;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Element;
+import org.dom4j.Namespace;
+import org.dom4j.QName;
+
+/**
+ * Class which implement the Security Resource File Migration 
+ */
+public class SecurityResourcesTool implements IFileMigration {
+
+    // Initialization of the IOutput for SecurityResourcesTool class
+    IOutput out = Tool.getCurrent().getOutput();
+    // Initialization of the logger for SecurityResourcesTool class
+    Log logger = LogFactory.getLog(SecurityResourcesTool.class);
+
+    /**
+     * mgration method from data source jboss discripters to geronimo
+     * discriptors
+     * 
+     * @param sourceFile :data source jboss discriptor file
+     * @return status of the migration
+     */
+    public boolean migrate(File sourceFile, File rootDirectory) {
+        // read the login-config.xml file and then make the changes to the
+        // geronimo side
+        boolean migrated = false;
+            String fileName = sourceFile.getPath();
+            String directoryName = fileName.substring(0, fileName.lastIndexOf(File.separator));
+            String jbossSecirityFileName = sourceFile.getName();
+            logger.debug("Directory Name ==> " + directoryName);
+            logger.debug("jboss security file Name ==> " + jbossSecirityFileName);
+            // Checking wether file is a valid login-config.xml file
+            if (jbossSecirityFileName.equals(Constants.JBOSS_VALID_SECURITY_XML_FILE)) {
+                out.info(SecurityResourcesTool.class.getSimpleName(), "Converting Jboss login-config.xml file in " + directoryName);
+                try {
+                    Document jbossDocument = XMLConversionHelper.getJbossDocument(sourceFile);
+                    Document geronimoDocument = migrationFromJboss2Geronimo(jbossDocument
+                            .getRootElement());
+                    String geronimoSecurityFileName = directoryName + File.separator
+                            + Constants.GERONIMO_SECURITY_PLAN_FILE;
+                    // Check whether the file already exists if so back up
+                    // that and save that or check the req
+                    // This was done at upper level of the tool
+                    XMLConversionHelper.saveGeronimoDocument(geronimoSecurityFileName,
+                            geronimoDocument);
+                    migrated = true;
+                    out.info(SecurityResourcesTool.class.getSimpleName(), "The Security Resource File Migration Complete !!!\n");
+                } catch (DocumentException e) {
+                	out.error(SecurityResourcesTool.class.getSimpleName(), "Error occured while reading xml descriptor "
+    						+ sourceFile.getAbsolutePath()
+    						+ ". It is possible that the migrator cannot download the xml schema or the xml file has incorrect syntax. Nested exception:"
+    						+ e.getMessage());
+                } catch (IOException e) {
+                    out.error(SecurityResourcesTool.class.getSimpleName(), "IO exception " + e.getMessage());
+                }
+            }
+
+        return migrated;
+    }
+
+    /**
+     * Accepts the jboss side Elements that holdes the discripter infomation and
+     * return the geronimo discripter
+     * 
+     * @param jbossRootElement
+     * @return geronimo plan
+     */
+    private Document migrationFromJboss2Geronimo(Element jbossRootElement) {
+        Document geronimoDocument = XMLConversionHelper.createNewGeronimoDocument(
+                Constants.NAMESPACE_ENV, "module", Constants.SECURITY_RESOURCE_TOOL, "", "");
+        Document geronimoNewDocument = createGBeanElement(jbossRootElement, geronimoDocument);
+        return geronimoNewDocument;
+    }
+
+    /**
+     * Create the GBeanElement by refering the jboss side elamanets
+     * 
+     * @param jbossRootElement
+     * @param geronimoDocument
+     * @return geronimo security plan which contains the GBean Element
+     */
+    private Document createGBeanElement(Element jbossRootElement, Document geronimoDocument) {
+        Namespace rootNamespace = geronimoDocument.getRootElement().getNamespace();
+        Element gbeanElement = DocumentHelper.createElement(new QName("gbean", rootNamespace));
+        gbeanElement.add(DocumentHelper.createAttribute(gbeanElement, "name", "SecurityRealm"));
+        gbeanElement.add(DocumentHelper.createAttribute(gbeanElement, "class",
+                "org.apache.geronimo.security.realm.GenericSecurityRealm"));
+        Element attributeElement = DocumentHelper.createElement(new QName("attribute",
+                rootNamespace));
+        attributeElement.add(DocumentHelper.createAttribute(gbeanElement, "name", "realmName"));
+        attributeElement.addText("SecurityRealm");
+        gbeanElement.add(createReferenceElement("ServerInfo", "ServerInfo", rootNamespace));
+        gbeanElement.add(createReferenceElement("LoginService", "JaasLoginService", rootNamespace));
+        Element xml_referenceElement = DocumentHelper.createElement(new QName("xml-reference",
+                rootNamespace));
+        xml_referenceElement.add(DocumentHelper.createAttribute(xml_referenceElement, "name",
+                "LoginModuleConfiguration"));
+        Element loginConfigElement = createLoginConfigElement();
+        Element newLoginConfigElement = createLoginModulesByReferingJbossDocument(
+                loginConfigElement, jbossRootElement);
+        xml_referenceElement.add(newLoginConfigElement);
+        gbeanElement.add(xml_referenceElement);
+        geronimoDocument.getRootElement().add(gbeanElement);
+        return geronimoDocument;
+    }
+
+    /**
+     * create the reference element
+     * 
+     * @param name
+     * @param contain
+     * @param rootNamespace
+     * @return return the reference element
+     */
+    private Element createReferenceElement(String name, String contain, Namespace rootNamespace) {
+        Element referenceElement = DocumentHelper.createElement(new QName("reference",
+                rootNamespace));
+        referenceElement.add(DocumentHelper.createAttribute(referenceElement, "name", name));
+        Element nameElement = DocumentHelper.createElement(new QName("name", rootNamespace));
+        nameElement.addText(contain);
+        referenceElement.add(nameElement);
+        return referenceElement;
+
+    }
+
+    /**
+     * create the login config elament
+     * 
+     * @return login config element
+     */
+    private Element createLoginConfigElement() {
+        Namespace loginNamespace = new Namespace("log", Constants.NAMESPACE_GERONIMO_LOGGIN);
+        Element login_configElement = DocumentHelper.createElement(new QName("login-config",
+                loginNamespace));
+        return login_configElement;
+    }
+
+    /**
+     * create the login module by referencing the jboss document
+     * 
+     * @param loginConfigElement
+     * @param jbossRootElement
+     * @return the login module
+     */
+    private Element createLoginModulesByReferingJbossDocument(Element loginConfigElement,
+            Element jbossRootElement) {
+        String login_domain_name = null;
+        String control_flag = null;
+        String login_module_class = null;
+        Element login_moduleElement = null;
+        Iterator elementIterator = jbossRootElement.elementIterator();
+        while (elementIterator.hasNext()) {
+            Element itElement = (Element) elementIterator.next();
+            if (itElement.getName().equals("application-policy")) {
+                out.info(SecurityResourcesTool.class.getSimpleName(), "Starting Module Migration");
+                if (validateSecurityPolicy(itElement)) {
+                    login_domain_name = obtainLoginDomainName(itElement);
+                    if (XMLConversionHelper.containSubElement(itElement, "authentication")) {
+                        Element authenticationElement = XMLConversionHelper.obtainSubElement(
+                                itElement, "authentication");
+                        if (XMLConversionHelper.containSubElement(authenticationElement,
+                                "login-module")) {
+                            login_moduleElement = XMLConversionHelper.obtainSubElement(
+                                    authenticationElement, "login-module");
+                            control_flag = obtainControlFlagFromLoginModuleElement(login_moduleElement);
+                            login_module_class = obtainLoginModuleClassFromLoginModuleElement(login_moduleElement);
+                        }
+                    }
+                    Element geronimo_login_moduleElement = createLoginModuleElementbyReferingJbossApplicationPolicyElement(
+                            login_moduleElement, loginConfigElement, control_flag,
+                            login_domain_name, login_module_class);
+                    loginConfigElement.add(geronimo_login_moduleElement);
+                    out.info(SecurityResourcesTool.class.getSimpleName(), "Finishing Module Migration");
+                } else {
+                    out.error(SecurityResourcesTool.class.getSimpleName(), "The security resource conversion tool does not support module functionality");
+                    out.info(SecurityResourcesTool.class.getSimpleName(), "Finishing Module Migration");
+                }
+            }
+        }
+        return loginConfigElement;
+    }
+
+    /**
+     * return the login module class from the login module element
+     * 
+     * @param login_moduleElement
+     * @return String version of the login module class
+     */
+    private String obtainLoginModuleClassFromLoginModuleElement(Element login_moduleElement) {
+        String login_module_class = null;
+        Iterator attribIterator = login_moduleElement.attributeIterator();
+        while (attribIterator.hasNext()) {
+            Attribute itAttribute = (Attribute) attribIterator.next();
+            if (itAttribute.getName().equals("code")) {
+                login_module_class = itAttribute.getText();
+                if (login_module_class.equals(Constants.JBOSS_LOGIN_MODULE_IDELTITY)) {
+                    return Constants.GERONIMO_LOGIN_MODULE_IDELTITY;
+                } else if (login_module_class.equals(Constants.JBOSS_LOGIN_MODULE_LDAP)) {
+                    return Constants.GERONIMO_LOGIN_MODULE_LDAP;
+                } else if (login_module_class.equals(Constants.JBOSS_LOGIN_MODULE_DATABASE_SERVER)) {
+                    return Constants.GERONIMO_LOGIN_MODULE_DATABASE_SERVER;
+                } else if (login_module_class.equals(Constants.JBOSS_LOGIN_MODULE_USERS_ROLES)) {
+                    return Constants.GERONIMO_LOGIN_MODULE_USERS_ROLES;
+                }
+            }
+        }
+        return login_module_class;
+    }
+
+    /**
+     * obtain the login domain name from the element
+     * 
+     * @param application_policyElement
+     * @return String version of the login domain name
+     */
+    private String obtainLoginDomainName(Element application_policyElement) {
+        String login_domain_name = null;
+        Iterator attribIterator = application_policyElement.attributeIterator();
+        while (attribIterator.hasNext()) {
+            Attribute itAttribute = (Attribute) attribIterator.next();
+            if (itAttribute.getName().equals("name")) {
+                login_domain_name = itAttribute.getText();
+            }
+        }
+        return login_domain_name;
+    }
+
+    /**
+     * creates the mudule elements by referencing the jboss side apllication
+     * policy elamentsS
+     * 
+     * @param jbossLoginModuleElement
+     * @param geronimoLoginConfigElement
+     * @param control_flag
+     * @param login_domain_name
+     * @param login_module_class
+     * @return login module element
+     */
+    private Element createLoginModuleElementbyReferingJbossApplicationPolicyElement(
+            Element jbossLoginModuleElement, Element geronimoLoginConfigElement,
+            String control_flag, String login_domain_name, String login_module_class) {
+        Element login_moduleElement = DocumentHelper.createElement(new QName("login-module",
+                geronimoLoginConfigElement.getNamespace()));
+        login_moduleElement.add(DocumentHelper.createAttribute(login_moduleElement, "control-flag",
+                control_flag.toUpperCase()));
+        // Adding this defaults
+        login_moduleElement.add(DocumentHelper.createAttribute(login_moduleElement, "server-side",
+                "true"));
+        login_moduleElement.add(DocumentHelper.createAttribute(login_moduleElement,
+                "wrap-principals", "false"));
+        login_moduleElement.add(XMLConversionHelper.createSibling("login-domain-name",
+                login_domain_name, geronimoLoginConfigElement.getNamespace()));
+        login_moduleElement.add(XMLConversionHelper.createSibling("login-module-class",
+                login_module_class, geronimoLoginConfigElement.getNamespace()));
+        if (XMLConversionHelper.containSubElement(jbossLoginModuleElement, "module-option")) {
+            login_moduleElement = addAppropriateOptionToAppropriateLoginModule(
+                    jbossLoginModuleElement, login_moduleElement, login_module_class);
+        }
+        return login_moduleElement;
+    }
+
+    /**
+     * adding the appropriate options for the appropriate login modules
+     * 
+     * @param jbossLoginModuleElement
+     * @param geronimoLoginmoduleElement
+     * @param login_module_class
+     * @return returns the login module
+     */
+    private Element addAppropriateOptionToAppropriateLoginModule(Element jbossLoginModuleElement,
+            Element geronimoLoginmoduleElement, String login_module_class) {
+        String option_value = null;
+        String option_attrib_name_value = null;
+        Element[] extraOptionsElement = new Element[4];
+        int countIterations = 0;
+        Iterator elementIterator = jbossLoginModuleElement.elementIterator();
+        while (elementIterator.hasNext()) {
+            Element itElement = (Element) elementIterator.next();
+            if (itElement.getName().equals("module-option")) {
+                option_value = itElement.getText();
+                Iterator attribIterator = itElement.attributeIterator();
+                while (attribIterator.hasNext()) {
+                    Attribute itAttribute = (Attribute) attribIterator.next();
+                    if (itAttribute.getName().equals("name")) {
+                        option_attrib_name_value = itAttribute.getText();
+                    }
+                }
+                Element optionElement = null;
+                if (login_module_class.equals(Constants.GERONIMO_LOGIN_MODULE_DATABASE_SERVER)) {
+                    if (option_attrib_name_value.equals("principalsQuery")) {
+                        option_attrib_name_value = "userSelect";
+                    }
+                    if (option_attrib_name_value.equals("rolesQuery")) {
+                        option_attrib_name_value = "groupSelect";
+                    }
+                    if (option_attrib_name_value.equals("dsJndiName")) {
+                        option_attrib_name_value = "dataSourceName";
+                        // This is to be modified to the algorithm that
+                        // cuts only the last tocken
+                        option_value = option_value.substring(option_value.indexOf(File.separator) + 1,
+                                option_value.length());
+                    }
+                    if (!(option_attrib_name_value.equals("unauthenticatedIdentity"))) {
+                        optionElement = XMLConversionHelper.createSiblingWithAttrib("option",
+                                option_value, "name", option_attrib_name_value,
+                                geronimoLoginmoduleElement.getNamespace());
+                    }
+                }
+                // No Need , because of no Geronimo side support
+                // else if
+                // (login_module_class.equals(Constants.GERONIMO_LOGIN_MODULE_IDELTITY)){
+                // optionElement =
+                // XMLConversionHelper.createSiblingWithAttrib("option",
+                // option_value, "name", option_attrib_name_value,
+                // geronimoLoginmoduleElement.getNamespace());
+                // }
+                else if (login_module_class.equals(Constants.GERONIMO_LOGIN_MODULE_LDAP)) {
+
+                    if (option_attrib_name_value.equals("java.naming.factory.initial")) {
+                        option_attrib_name_value = "initialContextFactory";
+                        optionElement = XMLConversionHelper.createSiblingWithAttrib("option",
+                                option_value, "name", option_attrib_name_value,
+                                geronimoLoginmoduleElement.getNamespace());
+                    }
+                    if (option_attrib_name_value.equals("java.naming.provider.url")) {
+                        String connectionURLString = "ldap://localhost:";
+                        if (XMLConversionHelper.containSubElementWithAttribute(
+                                jbossLoginModuleElement, "module-option", "name",
+                                "java.naming.security.protocol")) {
+                            Element securityProtocolElement = XMLConversionHelper
+                                    .obtainSubElementWithAttribute(jbossLoginModuleElement,
+                                            "module-option", "name",
+                                            "java.naming.security.protocol");
+                            String securityProtocolElementString = securityProtocolElement
+                                    .getText();
+                            if (securityProtocolElementString.equals("ssl")) {
+                                connectionURLString += "636";
+                            } else {
+                                connectionURLString += "389";
+                            }
+                        }
+                        option_attrib_name_value = "connectionURL";
+                        option_value = connectionURLString;
+                        optionElement = XMLConversionHelper.createSiblingWithAttrib("option",
+                                option_value, "name", option_attrib_name_value,
+                                geronimoLoginmoduleElement.getNamespace());
+                    }
+                    if (option_attrib_name_value.equals("java.naming.security.protocol")) {
+                        option_attrib_name_value = "connectionProtocol";
+                        optionElement = XMLConversionHelper.createSiblingWithAttrib("option",
+                                option_value, "name", option_attrib_name_value,
+                                geronimoLoginmoduleElement.getNamespace());
+                    }
+                    if (option_attrib_name_value.equals("java.naming.security.authentication")) {
+                        option_attrib_name_value = "authentication";
+                        optionElement = XMLConversionHelper.createSiblingWithAttrib("option",
+                                option_value, "name", option_attrib_name_value,
+                                geronimoLoginmoduleElement.getNamespace());
+                    }
+                    if (option_attrib_name_value.equals("roleAttributeID")) {
+                        option_attrib_name_value = "roleName";
+                        option_value = "roles";
+                        optionElement = XMLConversionHelper.createSiblingWithAttrib("option",
+                                option_value, "name", option_attrib_name_value,
+                                geronimoLoginmoduleElement.getNamespace());
+                    }
+                    if (option_attrib_name_value.equals("java.naming.security.protocol")) {
+                        option_attrib_name_value = "connectionProtocol";
+                        optionElement = XMLConversionHelper.createSiblingWithAttrib("option",
+                                option_value, "name", option_attrib_name_value,
+                                geronimoLoginmoduleElement.getNamespace());
+                    }
+                    if (option_attrib_name_value.equals("principalDNPrefix")) {
+                        if (XMLConversionHelper.containSubElementWithAttribute(
+                                jbossLoginModuleElement, "module-option", "name",
+                                "principalDNSuffix")) {
+                            Element principalDNSuffixElement = XMLConversionHelper
+                                    .obtainSubElementWithAttribute(jbossLoginModuleElement,
+                                            "module-option", "name", "principalDNSuffix");
+                            String principalDNSuffixElementString = principalDNSuffixElement
+                                    .getText();
+                            if (principalDNSuffixElementString != null) {
+                                // option_value+=principalDNSuffixElementString.substring(0,
+                                // principalDNSuffixElementString.indexOf(","));
+                                option_value += "{0}" + principalDNSuffixElementString;
+                            } else {
+                                option_value += "{0}";
+                            }
+                        }
+                        option_attrib_name_value = "userSearchMatching";
+                        optionElement = XMLConversionHelper.createSiblingWithAttrib("option",
+                                option_value, "name", option_attrib_name_value,
+                                geronimoLoginmoduleElement.getNamespace());
+                    }
+                    if (option_attrib_name_value.equals("rolesCtxDN")) {
+                        option_attrib_name_value = "roleSearchMatching";
+                        if (XMLConversionHelper.containSubElementWithAttribute(
+                                jbossLoginModuleElement, "module-option", "name", "matchOnUserDN")) {
+                            Element matchOnUserDNElement = XMLConversionHelper
+                                    .obtainSubElementWithAttribute(jbossLoginModuleElement,
+                                            "module-option", "name", "matchOnUserDN");
+                            String matchOnUserDNString = matchOnUserDNElement.getText();
+                            if (XMLConversionHelper.containSubElementWithAttribute(
+                                    jbossLoginModuleElement, "module-option", "name",
+                                    "matchOnUserDN")) {
+                                Element uidAttributeIDElement = XMLConversionHelper
+                                        .obtainSubElementWithAttribute(jbossLoginModuleElement,
+                                                "module-option", "name", "uidAttributeID");
+                                String uidAttributeIDString = uidAttributeIDElement.getText();
+                                // String first_part_of_option_value =
+                                // option_value.substring(0,
+                                // option_value.indexOf(","));
+                                // String secoend_part_of_option_value =
+                                // first_part_of_option_value.substring(0,
+                                // option_value.indexOf(","));
+                                String first_part_of_option_value = "{0}";
+                                String secoend_part_of_option_value = "{1}";
+                                option_value = option_value
+                                        + "???("
+                                        + uidAttributeIDString
+                                        + "="
+                                        + (matchOnUserDNString.equals("true") ? first_part_of_option_value
+                                                : secoend_part_of_option_value) + ")";
+                            }
+                        }
+                        optionElement = XMLConversionHelper.createSiblingWithAttrib("option",
+                                option_value, "name", option_attrib_name_value,
+                                geronimoLoginmoduleElement.getNamespace());
+                    }
+                    extraOptionsElement[0] = XMLConversionHelper.createSiblingWithAttrib("option",
+                            "", "name", "userBase", geronimoLoginmoduleElement.getNamespace());
+                    extraOptionsElement[1] = XMLConversionHelper.createSiblingWithAttrib("option",
+                            "", "name", "roleBase", geronimoLoginmoduleElement.getNamespace());
+                    extraOptionsElement[2] = XMLConversionHelper.createSiblingWithAttrib("option",
+                            "true", "name", "userSearchSubtree", geronimoLoginmoduleElement
+                                    .getNamespace());
+                    extraOptionsElement[3] = XMLConversionHelper.createSiblingWithAttrib("option",
+                            "true", "name", "roleSearchSubtree", geronimoLoginmoduleElement
+                                    .getNamespace());
+                } else if (login_module_class.equals(Constants.GERONIMO_LOGIN_MODULE_USERS_ROLES)) {
+                    if (option_attrib_name_value.equals("usersProperties")) {
+                        option_attrib_name_value = "usersURI";
+                        option_value = Constants.USER_PROPERTIES_FILE_PATH;
+                        out
+                           .info(SecurityResourcesTool.class.getSimpleName(), "Security Resources Tool Assumes user properties are in location =>"
+                                    + Constants.USER_PROPERTIES_FILE_PATH);
+                    }
+                    if (option_attrib_name_value.equals("rolesProperties")) {
+                        option_attrib_name_value = "groupsURI";
+                        option_value = Constants.GROUP_PROPERTIES_FILE_PATH;
+                        out
+                           .info(SecurityResourcesTool.class.getSimpleName(), "Security Resources Tool Assumes groups properties are in location =>"
+                                    + Constants.GROUP_PROPERTIES_FILE_PATH);
+                    }
+                    optionElement = XMLConversionHelper.createSiblingWithAttrib("option",
+                            option_value, "name", option_attrib_name_value,
+                            geronimoLoginmoduleElement.getNamespace());
+                }
+                if (optionElement != null)
+                    geronimoLoginmoduleElement.add(optionElement);
+                if (countIterations == 0) {
+                    for (int i = 0; i < extraOptionsElement.length; i++) {
+                        if (extraOptionsElement[i] != null)
+                            geronimoLoginmoduleElement.add(extraOptionsElement[i]);
+                    }
+                }
+                countIterations += 1;
+            }
+        }
+        return geronimoLoginmoduleElement;
+    }
+
+    /**
+     * validate the wether the jeronimo side policy is a valid policy
+     * 
+     * @param application_policyElement
+     * @return boolean status of the check
+     */
+    private boolean validateSecurityPolicy(Element application_policyElement) {
+        String jbossLoginModule = null;
+        if (XMLConversionHelper.containSubElement(application_policyElement, "authentication")) {
+            Element authenticationElement = XMLConversionHelper.obtainSubElement(
+                    application_policyElement, "authentication");
+            if (XMLConversionHelper.containSubElement(authenticationElement, "login-module")) {
+                Element login_moduleElement = XMLConversionHelper.obtainSubElement(
+                        authenticationElement, "login-module");
+                Iterator attribIterator = login_moduleElement.attributeIterator();
+                while (attribIterator.hasNext()) {
+                    Attribute itAttribute = (Attribute) attribIterator.next();
+                    if (itAttribute.getName().equals("code")) {
+                        jbossLoginModule = itAttribute.getText();
+                        boolean return_value = validateJbossLoginModule(jbossLoginModule);
+                        return return_value;
+                    }
+                }
+            }
+        }
+        return false;
+    }
+
+    /**
+     * obtain the control flag from the login module element
+     * 
+     * @param login_moduleElement
+     * @return String version of the control flag
+     */
+    private String obtainControlFlagFromLoginModuleElement(Element login_moduleElement) {
+        String control_flag = null;
+        Iterator attribIterator = login_moduleElement.attributeIterator();
+        while (attribIterator.hasNext()) {
+            Attribute itAttribute = (Attribute) attribIterator.next();
+            if (itAttribute.getName().equals("flag")) {
+                control_flag = itAttribute.getText();
+                return control_flag;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * validate the jboss security modules wethere these are acceptable for the
+     * geronimo side
+     * 
+     * @param jbossLoginModule
+     * @return boolean status of the validation
+     */
+    private boolean validateJbossLoginModule(String jbossLoginModule) {
+        boolean status = false;
+        logger.debug("Jboss login module class name => " + jbossLoginModule);
+        if (jbossLoginModule.equals(Constants.JBOSS_LOGIN_MODULE_DATABASE_SERVER)) {
+            status = true;
+        } else if (jbossLoginModule.equals(Constants.JBOSS_LOGIN_MODULE_LDAP)) {
+            status =  true;
+        } else if (jbossLoginModule.equals(Constants.JBOSS_LOGIN_MODULE_USERS_ROLES)) {
+            status =  true;
+        }else {
+            out.error(SecurityResourcesTool.class.getSimpleName(), "The security resource conversion tool does not support "+
+                       jbossLoginModule+" module functionality");
+        }
+        return status;
+    }
+
+}

Propchange: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/src/org/apache/geronimo/devtools/j2g/resources/security/SecurityResourcesTool.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/ds/hsqldb-ds.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/ds/hsqldb-ds.xml?rev=582931&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/ds/hsqldb-ds.xml (added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/ds/hsqldb-ds.xml Mon Oct  8 11:50:05 2007
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. -->
+
+<!-- The Hypersonic embedded database JCA connection factory config
+$Id: hsqldb-ds.xml 561821 2007-08-01 15:05:12Z pmcmahan $ -->
+
+
+<datasources>
+   <local-tx-datasource>
+
+      <!-- The jndi name of the DataSource, it is prefixed with java:/ -->
+      <!-- Datasources are not available outside the virtual machine -->
+      <jndi-name>DefaultDS</jndi-name>
+
+      <!-- for tcp connection, allowing other processes to use the hsqldb
+      database. This requires the org.jboss.jdbc.HypersonicDatabase mbean.
+      <connection-url>jdbc:hsqldb:hsql://localhost:1701</connection-url>
+-->
+      <!-- for totally in-memory db, not saved when jboss stops. 
+      The org.jboss.jdbc.HypersonicDatabase mbean necessary
+      <connection-url>jdbc:hsqldb:.</connection-url>
+-->
+      <!-- for in-process persistent db, saved when jboss stops. The
+      org.jboss.jdbc.HypersonicDatabase mbean is necessary for properly db shutdown
+-->
+      <connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}localDB</connection-url>
+
+      <!-- The driver class -->
+      <driver-class>org.hsqldb.jdbcDriver</driver-class>
+
+      <!-- The login and password -->
+      <user-name>sa</user-name>
+      <password></password>
+
+      <!--example of how to specify class that determines if exception means connection should be destroyed-->
+      <!--exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyExceptionSorter</exception-sorter-class-name-->
+
+      <!-- this will be run before a managed connection is removed from the pool for use by a client-->
+      <!--<check-valid-connection-sql>select * from something</check-valid-connection-sql> -->
+
+      <!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on first use -->
+      <min-pool-size>5</min-pool-size>
+
+      <!-- The maximum connections in a pool/sub-pool -->
+      <max-pool-size>20</max-pool-size>
+
+      <!-- The time before an unused connection is destroyed -->
+      <!-- NOTE: This is the check period. It will be destroyed somewhere between 1x and 2x this timeout after last use -->
+      <!-- TEMPORARY FIX! - Disable idle connection removal, HSQLDB has a problem with not reaping threads on closed connections -->
+      <idle-timeout-minutes>0</idle-timeout-minutes>
+
+      <!-- sql to call when connection is created
+        <new-connection-sql>some arbitrary sql</new-connection-sql>
+      -->
+
+      <!-- sql to call on an existing pooled connection when it is obtained from pool 
+         <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
+      -->
+
+      <!-- example of how to specify a class that determines a connection is valid before it is handed out from the pool
+         <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyValidConnectionChecker</valid-connection-checker-class-name>
+      -->
+
+      <!-- Whether to check all statements are closed when the connection is returned to the pool,
+           this is a debugging feature that should be turned off in production -->
+      <track-statements/>
+
+      <!-- Use the getConnection(user, pw) for logins
+        <application-managed-security/>
+      -->
+
+      <!-- Use the security domain defined in conf/login-config.xml -->
+      <security-domain>HsqlDbRealm</security-domain>
+
+      <!-- Use the security domain defined in conf/login-config.xml or the
+           getConnection(user, pw) for logins. The security domain takes precedence.
+        <security-domain-and-application>HsqlDbRealm</security-domain-and-application>
+      -->
+
+      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
+      <metadata>
+         <type-mapping>Hypersonic SQL</type-mapping>
+      </metadata>
+
+      <!-- This mbean can be used when using in process persistent hypersonic -->
+      <depends>jboss:service=Hypersonic,database=localDB</depends>
+   </local-tx-datasource>
+
+   <!-- This mbean should be used only when using tcp connections. Uncomment
+   when the tcp based connection-url is used. 
+   <mbean code="org.jboss.jdbc.HypersonicDatabase" 
+     name="jboss:service=Hypersonic">
+     <attribute name="Port">1701</attribute>
+     <attribute name="Silent">true</attribute>
+     <attribute name="Database">default</attribute>
+     <attribute name="Trace">false</attribute>
+     <attribute name="No_system_exit">true</attribute>
+   </mbean>
+ -->
+
+   <!-- This mbean can be used when using in process persistent db -->
+   <mbean code="org.jboss.jdbc.HypersonicDatabase" 
+     name="jboss:service=Hypersonic,database=localDB">
+     <attribute name="Database">localDB</attribute>
+     <attribute name="InProcessMode">true</attribute>
+   </mbean>
+</datasources>

Propchange: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/ds/hsqldb-ds.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/ds/hsqldb-geronimo-plan.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/ds/hsqldb-geronimo-plan.xml?rev=582931&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/ds/hsqldb-geronimo-plan.xml (added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/ds/hsqldb-geronimo-plan.xml Mon Oct  8 11:50:05 2007
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.1">
+  <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
+    <dep:moduleId>
+      <dep:artifactId>DefaultDS</dep:artifactId>
+    </dep:moduleId>
+    <dep:dependencies>
+      <dep:dependency>
+        <dep:groupId>hsqldb</dep:groupId>
+        <dep:artifactId>hsqldb</dep:artifactId>
+        <dep:type>jar</dep:type>
+      </dep:dependency>
+    </dep:dependencies>
+  </dep:environment>
+  <resourceadapter>
+    <outbound-resourceadapter>
+      <connection-definition>
+        <connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
+        <connectiondefinition-instance>
+          <name>DefaultDS</name>
+          <config-property-setting name="UserName">sa</config-property-setting>
+          <config-property-setting name="Password"></config-property-setting>
+          <config-property-setting name="Driver">org.hsqldb.jdbcDriver</config-property-setting>
+          <config-property-setting name="ConnectionURL">jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}localDB</config-property-setting>
+          <connectionmanager>
+            <local-transaction/>
+            <single-pool>
+              <max-size>20</max-size>
+              <min-size>5</min-size>
+              <blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
+              <idle-timeout-minutes>0</idle-timeout-minutes>
+              <match-one/>
+            </single-pool>
+          </connectionmanager>
+        </connectiondefinition-instance>
+      </connection-definition>
+    </outbound-resourceadapter>
+  </resourceadapter>
+</connector>

Propchange: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/ds/hsqldb-geronimo-plan.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/ds/mysql-ds.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/ds/mysql-ds.xml?rev=582931&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/ds/mysql-ds.xml (added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/ds/mysql-ds.xml Mon Oct  8 11:50:05 2007
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. -->
+
+<!-- $Id: mysql-ds.xml 561821 2007-08-01 15:05:12Z pmcmahan $ -->
+<!--  Datasource config for MySQL using 3.0.9 available from:
+http://www.mysql.com/downloads/api-jdbc-stable.html
+-->
+
+<datasources>
+
+  <local-tx-datasource>
+        <jndi-name>jdbc/TradeDB</jndi-name>
+        <connection-url>jdbc:mysql://localhost:3306/tradedb</connection-url>
+        <driver-class>com.mysql.jdbc.Driver</driver-class>
+        <user-name>root</user-name>
+        <password>password</password>
+        <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>        
+  </local-tx-datasource>
+ </datasources>
+

Propchange: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/ds/mysql-ds.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/ds/mysql-geronimo-plan.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/ds/mysql-geronimo-plan.xml?rev=582931&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/ds/mysql-geronimo-plan.xml (added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/ds/mysql-geronimo-plan.xml Mon Oct  8 11:50:05 2007
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.1">
+  <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
+    <dep:moduleId>
+      <dep:artifactId>TradeDB</dep:artifactId>
+    </dep:moduleId>
+    <dep:dependencies>
+      <dep:dependency>
+        <dep:groupId>mysql</dep:groupId>
+        <dep:artifactId>mysql-connector-java</dep:artifactId>
+        <dep:type>jar</dep:type>
+      </dep:dependency>
+    </dep:dependencies>
+  </dep:environment>
+  <resourceadapter>
+    <outbound-resourceadapter>
+      <connection-definition>
+        <connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
+        <connectiondefinition-instance>
+          <name>TradeDB</name>
+          <config-property-setting name="UserName">root</config-property-setting>
+          <config-property-setting name="Password">password</config-property-setting>
+          <config-property-setting name="Driver">com.mysql.jdbc.Driver</config-property-setting>
+          <config-property-setting name="ConnectionURL">jdbc:mysql://localhost:3306/tradedb</config-property-setting>
+          <connectionmanager>
+            <local-transaction/>
+            <single-pool>
+              <max-size>10</max-size>
+              <min-size>0</min-size>
+              <blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
+              <idle-timeout-minutes>30</idle-timeout-minutes>
+              <match-one/>
+            </single-pool>
+          </connectionmanager>
+        </connectiondefinition-instance>
+      </connection-definition>
+    </outbound-resourceadapter>
+  </resourceadapter>
+</connector>

Propchange: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/ds/mysql-geronimo-plan.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/ds/oracle-ds.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/ds/oracle-ds.xml?rev=582931&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/ds/oracle-ds.xml (added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/ds/oracle-ds.xml Mon Oct  8 11:50:05 2007
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. -->
+
+<!-- $Id: oracle-ds.xml 561821 2007-08-01 15:05:12Z pmcmahan $ -->
+<!--  Datasource config for MySQL using 3.0.9 available from:
+http://www.mysql.com/downloads/api-jdbc-stable.html
+-->
+
+<datasources>
+
+  <local-tx-datasource>
+        <jndi-name>jdbc/TradeDB</jndi-name>
+        <connection-url>jdbc:oracle://localhost:3306/tradedb</connection-url>
+        <driver-class>oracle.jdbc.OracleDriver</driver-class>
+        <user-name>root</user-name>
+        <password>password</password>
+        <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>        
+  </local-tx-datasource>
+ </datasources>
+

Propchange: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/ds/oracle-ds.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/ds/oracle-geronimo-plan.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/ds/oracle-geronimo-plan.xml?rev=582931&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/ds/oracle-geronimo-plan.xml (added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/ds/oracle-geronimo-plan.xml Mon Oct  8 11:50:05 2007
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.1">
+  <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1">
+    <dep:moduleId>
+      <dep:artifactId>TradeDB</dep:artifactId>
+    </dep:moduleId>
+    <dep:dependencies>
+      <dep:dependency>
+        <dep:groupId>oracle</dep:groupId>
+        <dep:artifactId>oracle-jdbc</dep:artifactId>
+        <dep:type>jar</dep:type>
+      </dep:dependency>
+    </dep:dependencies>
+  </dep:environment>
+  <resourceadapter>
+    <outbound-resourceadapter>
+      <connection-definition>
+        <connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
+        <connectiondefinition-instance>
+          <name>TradeDB</name>
+          <config-property-setting name="UserName">root</config-property-setting>
+          <config-property-setting name="Password">password</config-property-setting>
+          <config-property-setting name="Driver">oracle.jdbc.OracleDriver</config-property-setting>
+          <config-property-setting name="ConnectionURL">jdbc:oracle://localhost:3306/tradedb</config-property-setting>
+          <connectionmanager>
+            <local-transaction/>
+            <single-pool>
+              <max-size>10</max-size>
+              <min-size>0</min-size>
+              <blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
+              <idle-timeout-minutes>30</idle-timeout-minutes>
+              <match-one/>
+            </single-pool>
+          </connectionmanager>
+        </connectiondefinition-instance>
+      </connection-definition>
+    </outbound-resourceadapter>
+  </resourceadapter>
+</connector>

Propchange: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/ds/oracle-geronimo-plan.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/jms/geronimo-jms-resource-plan.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/jms/geronimo-jms-resource-plan.xml?rev=582931&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/jms/geronimo-jms-resource-plan.xml (added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/jms/geronimo-jms-resource-plan.xml Mon Oct  8 11:50:05 2007
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. -->
+<connector
+    xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.1">
+    <environment
+        xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
+        <moduleId>
+            <groupId>console.jms</groupId>
+            <artifactId>SampleResourceGroup</artifactId>
+            <version>1.0</version>
+            <type>rar</type>
+        </moduleId>
+        <dependencies>
+            <dependency>
+                 <groupId>geronimo</groupId>
+                 <artifactId>activemq-broker</artifactId>
+                 <type>car</type>
+            </dependency>
+        </dependencies>
+    </environment>
+  <resourceadapter>
+    <!-- how to connect to the JMS Server -->
+    <resourceadapter-instance>
+      <resourceadapter-name>
+        My JMS Resources
+      </resourceadapter-name>
+      <config-property-setting name="ServerUrl">
+        tcp://localhost:61616
+      </config-property-setting>
+      <config-property-setting name="UserName">
+        geronimo
+      </config-property-setting>
+      <config-property-setting name="Password">
+        geronimo
+      </config-property-setting>
+      <workmanager>
+                               105
+                  JMS Configuration [DRAFT (1.1)]
+      <gbean-link>DefaultWorkManager</gbean-link>
+    </workmanager>
+  </resourceadapter-instance>
+  <!-- defines a ConnectionFactory -->
+  <outbound-resourceadapter>
+    <connection-definition>
+      <connectionfactory-interface>
+        javax.jms.ConnectionFactory
+      </connectionfactory-interface>
+      <connectiondefinition-instance>
+        <name>MyConnectionFactory</name>
+        <implemented-interface>
+          javax.jms.QueueConnectionFactory
+        </implemented-interface>
+        <implemented-interface>
+          javax.jms.TopicConnectionFactory
+        </implemented-interface>
+        <connectionmanager>
+          <xa-transaction>
+            <transaction-caching />
+          </xa-transaction>
+          <single-pool>
+            <max-size>10</max-size>
+            <min-size>0</min-size>
+            <blocking-timeout-milliseconds>
+               5000
+            </blocking-timeout-milliseconds>
+            <idle-timeout-minutes>
+               0
+            </idle-timeout-minutes>
+            <match-one/>
+          </single-pool>
+        </connectionmanager>
+      </connectiondefinition-instance>
+    </connection-definition>
+  </outbound-resourceadapter>
+</resourceadapter>
+<!-- defines a Topic -->
+<adminobject>
+  <adminobject-interface>
+    javax.jms.Topic
+  </adminobject-interface>
+  <adminobject-class>
+    org.activemq.message.ActiveMQTopic
+  </adminobject-class>
+  <adminobject-instance>
+    <message-destination-name>
+      MyTopic
+    </message-destination-name>
+    <config-property-setting name="PhysicalName">
+      MyTopic
+    </config-property-setting>
+  </adminobject-instance>
+</adminobject>
+<!-- defines a Queue -->
+<adminobject>
+  <adminobject-interface>
+    javax.jms.Queue
+  </adminobject-interface>
+  <adminobject-class>
+    org.activemq.message.ActiveMQQueue
+  </adminobject-class>
+  <adminobject-instance>
+    <message-destination-name>
+                               106
+                   JMS Configuration [DRAFT (1.1)]
+        MyQueue
+      </message-destination-name>
+      <config-property-setting name="PhysicalName">
+        MyQueue
+      </config-property-setting>
+    </adminobject-instance>
+  </adminobject>
+</connector>

Propchange: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/jms/geronimo-jms-resource-plan.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/jms/jbossmq-destinations-service.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/jms/jbossmq-destinations-service.xml?rev=582931&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/jms/jbossmq-destinations-service.xml (added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/jms/jbossmq-destinations-service.xml Mon Oct  8 11:50:05 2007
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. -->
+
+<!--DOCTYPE server
+    PUBLIC "-//JBoss//DTD MBean Service 4.0//EN"
+    "http://www.jboss.org/j2ee/dtd/jboss-service_4_0.dtd"-->
+
+
+<!-- $Id: jbossmq-destinations-service.xml 561821 2007-08-01 15:05:12Z pmcmahan $ -->
+
+<!-- 
+   | This file defines the default Queues and Topics that JBossMQ
+   | ships with.  The default Queues and Topics are used by the 
+   | JBoss test suite and by the sample jms programs.
+   |
+   | You can add other destinations to this file, or you can create other
+   | *-service.xml files to contain your application's destinations.
+ -->
+
+<server>
+  <!-- Destination without a configured SecurityManager or without a 
+       a SecurityConf will default to role guest with read=true, write=true,
+       create=false.
+  -->
+  <mbean code="org.jboss.mq.server.jmx.Topic"
+	 name="jboss.mq.destination:service=Topic,name=testTopic">
+    <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+    <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
+    <attribute name="SecurityConf">
+      <security>
+        <role name="guest" read="true" write="true"/>
+        <role name="publisher" read="true" write="true" create="false"/>
+        <role name="durpublisher" read="true" write="true" create="true"/>
+      </security>
+    </attribute>
+  </mbean>
+
+  <mbean code="org.jboss.mq.server.jmx.Topic"
+	 name="jboss.mq.destination:service=Topic,name=securedTopic">
+    <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+    <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
+    <attribute name="SecurityConf">
+      <security>
+        <role name="publisher" read="true" write="true" create="false"/>
+      </security>
+    </attribute>
+  </mbean>
+
+  <mbean code="org.jboss.mq.server.jmx.Topic"
+	 name="jboss.mq.destination:service=Topic,name=testDurableTopic">
+    <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+    <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
+    <attribute name="SecurityConf">
+       <security>
+         <role name="guest" read="true" write="true"/>
+         <role name="publisher" read="true" write="true" create="false"/>
+         <role name="durpublisher" read="true" write="true" create="true"/>
+      </security>
+    </attribute>
+  </mbean>
+
+  <mbean code="org.jboss.mq.server.jmx.Queue"
+	 name="jboss.mq.destination:service=Queue,name=testQueue">
+    <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+    <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
+    <attribute name="MessageCounterHistoryDayLimit">-1</attribute>
+    <attribute name="SecurityConf">
+      <security>
+        <role name="guest" read="true" write="true"/>
+        <role name="publisher" read="true" write="true" create="false"/>
+        <role name="noacc" read="false" write="false" create="false"/>
+      </security>
+    </attribute>
+  </mbean>
+  <mbean code="org.jboss.mq.server.jmx.Queue"
+	 name="jboss.mq.destination:service=Queue,name=A">
+    <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+  </mbean>
+  <mbean code="org.jboss.mq.server.jmx.Queue"
+	 name="jboss.mq.destination:service=Queue,name=B">
+    <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+  </mbean>
+  <mbean code="org.jboss.mq.server.jmx.Queue"
+	 name="jboss.mq.destination:service=Queue,name=C">
+	 <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+  </mbean>
+  <mbean code="org.jboss.mq.server.jmx.Queue"
+	 name="jboss.mq.destination:service=Queue,name=D">
+    <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+  </mbean>
+  <mbean code="org.jboss.mq.server.jmx.Queue"
+	 name="jboss.mq.destination:service=Queue,name=ex">
+    <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
+  </mbean>
+
+</server>

Propchange: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/jms/jbossmq-destinations-service.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/jms/jms-ds.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/jms/jms-ds.xml?rev=582931&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/jms/jms-ds.xml (added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/jms/jms-ds.xml Mon Oct  8 11:50:05 2007
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. -->
+
+<!--!DOCTYPE connection-factories
+    PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
+    "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd"-->
+
+
+<connection-factories>
+ 
+  <!-- ==================================================================== -->
+  <!-- JMS Stuff                                                            -->
+  <!-- ==================================================================== -->
+
+  <!-- The JMS provider loader -->
+  <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
+	 name="jboss.mq:service=JMSProviderLoader,name=JMSProvider">
+    <attribute name="ProviderName">DefaultJMSProvider</attribute>
+    <attribute name="ProviderAdapterClass">
+      org.jboss.jms.jndi.JNDIProviderAdapter
+    </attribute>
+    <!-- The combined connection factory -->
+    <attribute name="FactoryRef">java:/XAConnectionFactory</attribute>
+    <!-- The queue connection factory -->
+    <attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute>
+    <!-- The topic factory -->
+    <attribute name="TopicFactoryRef">java:/XAConnectionFactory</attribute>
+    <!-- Uncomment to use HAJNDI to access JMS
+    <attribute name="Properties">
+       java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+       java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
+       java.naming.provider.url=localhost:1100
+    </attribute>
+    -->
+  </mbean>
+
+  <!-- The server session pool for Message Driven Beans -->
+  <mbean code="org.jboss.jms.asf.ServerSessionPoolLoader"
+	 name="jboss.mq:service=ServerSessionPoolMBean,name=StdJMSPool">
+    <depends optional-attribute-name="XidFactory">jboss:service=XidFactory</depends>
+    <attribute name="PoolName">StdJMSPool</attribute>
+    <attribute name="PoolFactoryClass">
+      org.jboss.jms.asf.StdServerSessionPoolFactory
+    </attribute>
+  </mbean>
+
+  <!-- JMS XA Resource adapter, use this to get transacted JMS in beans -->
+  <tx-connection-factory>
+    <jndi-name>JmsXA</jndi-name>
+    <xa-transaction/>
+    <rar-name>jms-ra.rar</rar-name>
+    <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition>
+    <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
+    <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property>
+	<max-pool-size>11</max-pool-size>
+<!--
+	<min-pool-size>1</min-pool-size>
+	<blocking-timeout-millis>5001</blocking-timeout-millis> 
+	<idle-timeout-minutes>31</idle-timeout-minutes>
+-->	
+    <security-domain-and-application>JmsXARealm</security-domain-and-application>
+  </tx-connection-factory>
+
+</connection-factories>

Propchange: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/jms/jms-ds.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/jms/jms-geronimo-plan.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/jms/jms-geronimo-plan.xml?rev=582931&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/jms/jms-geronimo-plan.xml (added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/jms/jms-geronimo-plan.xml Mon Oct  8 11:50:05 2007
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.1">
+  <sys:environment xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.1">
+    <sys:moduleId>
+      <sys:groupId>j2g</sys:groupId>
+      <sys:artifactId>jms</sys:artifactId>
+      <sys:version>1.0</sys:version>
+      <sys:type>jar</sys:type>
+    </sys:moduleId>
+    <sys:dependencies>
+      <sys:dependency>
+        <sys:groupId>j2g</sys:groupId>
+        <sys:artifactId>jms</sys:artifactId>
+        <sys:version>1.0</sys:version>
+        <sys:type>jar</sys:type>
+      </sys:dependency>
+    </sys:dependencies>
+  </sys:environment>
+  <resourceadapter>
+    <resourceadapter-instance>
+      <resourceadapter-name>DefaultJMSProvider</resourceadapter-name>
+      <config-property-setting name="ServerURL">tcp://localhost:61616</config-property-setting>
+      <config-property-setting name="UserName">geronimo</config-property-setting>
+      <config-property-setting name="Password">geronimo</config-property-setting>
+      <naming:workmanager xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.1">
+        <naming:gbean-link>DefaultWorkManager</naming:gbean-link>
+      </naming:workmanager>
+    </resourceadapter-instance>
+    <outbound-resourceadapter>
+      <connection-definition>
+        <connectionfactory-interface>javax.jms.ConnectionFactory</connectionfactory-interface>
+        <connectiondefinition-instance>
+          <name>MyConnectionFactory</name>
+          <implemented-interface>javax.jms.QueueConnectionFactory</implemented-interface>
+          <implemented-interface>javax.jms.TopicConnectionFactory</implemented-interface>
+          <connectionmanager>
+            <local-transaction/>
+            <single-pool>
+              <max-size>11</max-size>
+              <min-size>0</min-size>
+              <blocking-timeout-milliseconds>5000</blocking-timeout-milliseconds>
+              <idle-timeout-minutes>30</idle-timeout-minutes>
+              <match-one/>
+            </single-pool>
+          </connectionmanager>
+        </connectiondefinition-instance>
+      </connection-definition>
+    </outbound-resourceadapter>
+  </resourceadapter>
+  <adminobject>
+    <adminobject-interface>javax.jms.Queue</adminobject-interface>
+    <adminobject-class>org.activemq.message.ActiveMQTopic</adminobject-class>
+    <adminobject-instance>
+      <message-destination-name>testTopic</message-destination-name>
+      <config-property-setting name="PhysicalName">MyQueue</config-property-setting>
+    </adminobject-instance>
+  </adminobject>
+  <adminobject>
+    <adminobject-interface>javax.jms.Queue</adminobject-interface>
+    <adminobject-class>org.activemq.message.ActiveMQTopic</adminobject-class>
+    <adminobject-instance>
+      <message-destination-name>securedTopic</message-destination-name>
+      <config-property-setting name="PhysicalName">MyQueue</config-property-setting>
+    </adminobject-instance>
+  </adminobject>
+  <adminobject>
+    <adminobject-interface>javax.jms.Queue</adminobject-interface>
+    <adminobject-class>org.activemq.message.ActiveMQTopic</adminobject-class>
+    <adminobject-instance>
+      <message-destination-name>testDurableTopic</message-destination-name>
+      <config-property-setting name="PhysicalName">MyQueue</config-property-setting>
+    </adminobject-instance>
+  </adminobject>
+  <adminobject>
+    <adminobject-interface>javax.jms.Topic</adminobject-interface>
+    <adminobject-class>org.activemq.message.ActiveMQTopic</adminobject-class>
+    <adminobject-instance>
+      <message-destination-name>testQueue</message-destination-name>
+      <config-property-setting name="PhysicalName">Mytopic</config-property-setting>
+    </adminobject-instance>
+  </adminobject>
+  <adminobject>
+    <adminobject-interface>javax.jms.Topic</adminobject-interface>
+    <adminobject-class>org.activemq.message.ActiveMQTopic</adminobject-class>
+    <adminobject-instance>
+      <message-destination-name>A</message-destination-name>
+      <config-property-setting name="PhysicalName">Mytopic</config-property-setting>
+    </adminobject-instance>
+  </adminobject>
+  <adminobject>
+    <adminobject-interface>javax.jms.Topic</adminobject-interface>
+    <adminobject-class>org.activemq.message.ActiveMQTopic</adminobject-class>
+    <adminobject-instance>
+      <message-destination-name>B</message-destination-name>
+      <config-property-setting name="PhysicalName">Mytopic</config-property-setting>
+    </adminobject-instance>
+  </adminobject>
+  <adminobject>
+    <adminobject-interface>javax.jms.Topic</adminobject-interface>
+    <adminobject-class>org.activemq.message.ActiveMQTopic</adminobject-class>
+    <adminobject-instance>
+      <message-destination-name>C</message-destination-name>
+      <config-property-setting name="PhysicalName">Mytopic</config-property-setting>
+    </adminobject-instance>
+  </adminobject>
+  <adminobject>
+    <adminobject-interface>javax.jms.Topic</adminobject-interface>
+    <adminobject-class>org.activemq.message.ActiveMQTopic</adminobject-class>
+    <adminobject-instance>
+      <message-destination-name>D</message-destination-name>
+      <config-property-setting name="PhysicalName">Mytopic</config-property-setting>
+    </adminobject-instance>
+  </adminobject>
+  <adminobject>
+    <adminobject-interface>javax.jms.Topic</adminobject-interface>
+    <adminobject-class>org.activemq.message.ActiveMQTopic</adminobject-class>
+    <adminobject-instance>
+      <message-destination-name>ex</message-destination-name>
+      <config-property-setting name="PhysicalName">Mytopic</config-property-setting>
+    </adminobject-instance>
+  </adminobject>
+</connector>

Propchange: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/jms/jms-geronimo-plan.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/mail/err/mail-service.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/mail/err/mail-service.xml?rev=582931&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/mail/err/mail-service.xml (added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/mail/err/mail-service.xml Mon Oct  8 11:50:05 2007
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. -->
+<!-- DOCTYPE server -->
+ <!-- $Id: mail-service.xml 561821 2007-08-01 15:05:12Z pmcmahan $ -->
+<server>
+
+  <!-- ==================================================================== -->
+  <!-- Mail Connection Factory                                              -->
+  <!-- ==================================================================== -->
+
+  <mbean code="org.jboss.mail.MailService"
+         name="jboss:service=Mail">
+    <attribute name="JNDIName">java:/Mail</attribute>
+    <attribute name="User">nobody</attribute>
+    <attribute name="Password">password</attribute>
+    <attribute name="Configuration">
+       <!-- Test -->
+       <configuration>
+          <!-- Change to your mail server prototocol -->
+          <property name="mail.store.protocol" value="pop3"/>
+          <property name="mail.transport.protocol" value="smtp"/>
+
+          <!-- Change to the user who will receive mail  -->
+          <property name="mail.user" value="nobody"/>
+
+          <!-- Change to the mail server  -->
+          <property name="mail.pop3.host" value="pop3.nosuchhost.nosuchdomain.com"/>
+
+          <!-- Change to the SMTP gateway server -->
+          <property name="mail.smtp.host" value="smtp.nosuchhost.nosuchdomain.com"/>
+
+          <!-- Change to the address mail will be from  -->
+          <property name="mail.from" value="nobody@nosuchhost.nosuchdomain.com"/>
+
+          <!-- Enable debugging output from the javamail classes -->
+          <property name="mail.debug" value="false"/>
+       </configuration>
+    </attribute>
+  </mbean>
+
+</server>

Propchange: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/mail/err/mail-service.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/mail/geronimo-mail-service.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/mail/geronimo-mail-service.xml?rev=582931&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/mail/geronimo-mail-service.xml (added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/mail/geronimo-mail-service.xml Mon Oct  8 11:50:05 2007
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. -->
+ <module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
+  <environment>
+    <moduleId>
+      <groupId>j2g</groupId>
+      <artifactId>Mail</artifactId>
+      <version>1.0</version>
+      <type>car</type>
+    </moduleId>
+    <dependencies>
+      <dependency>
+        <groupId>geronimo</groupId>
+        <artifactId>javamail</artifactId>
+      </dependency>
+    </dependencies>
+  </environment>
+  <gbean name="mailSession" class="org.apache.geronimo.mail.MailGBean">
+    <attribute name="properties">
+mail.store.protocol=pop3
+mail.transport.protocol=smtp
+mail.user=nobody
+mail.pop3.host=pop3.nosuchhost.nosuchdomain.com
+mail.smtp.host=smtp.nosuchhost.nosuchdomain.com
+mail.from=nobody@nosuchhost.nosuchdomain.com
+mail.debug=false
+    </attribute>   
+  </gbean>
+</module>
\ No newline at end of file

Propchange: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/mail/geronimo-mail-service.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/mail/mail-geronimo-plan.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/mail/mail-geronimo-plan.xml?rev=582931&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/mail/mail-geronimo-plan.xml (added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/mail/mail-geronimo-plan.xml Mon Oct  8 11:50:05 2007
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<module xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
+  <environment>
+    <moduleId>
+      <groupId>j2g</groupId>
+      <artifactId>Mail</artifactId>
+      <version>1.0</version>
+      <type>car</type>
+    </moduleId>
+    <dependencies>
+      <dependency>
+        <groupId>geronimo</groupId>
+        <artifactId>javamail</artifactId>
+        <version>1.1</version>
+        <type>car</type>
+      </dependency>
+    </dependencies>
+  </environment>
+  <gbean name="mailSession" class="org.apache.geronimo.mail.MailGBean">
+    <attribute name="properties"><![CDATA[
+mail.store.protocol=pop3
+mail.transport.protocol=smtp
+mail.user=nobody
+mail.pop3.host=pop3.nosuchhost.nosuchdomain.com
+mail.smtp.host=smtp.nosuchhost.nosuchdomain.com
+mail.from=nobody@nosuchhost.nosuchdomain.com
+mail.debug=false]]></attribute>
+  </gbean>
+</module>

Added: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/mail/mail-service.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/mail/mail-service.xml?rev=582931&view=auto
==============================================================================
--- geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/mail/mail-service.xml (added)
+++ geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/mail/mail-service.xml Mon Oct  8 11:50:05 2007
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. -->
+<!-- DOCTYPE server
+    PUBLIC "-//JBoss//DTD MBean Service 4.0//EN"
+    "http://www.jboss.org/j2ee/dtd/jboss-service_4_0.dtd"-->
+<!-- $Id: mail-service.xml 561821 2007-08-01 15:05:12Z pmcmahan $ -->
+
+<server>
+
+  <!-- ==================================================================== -->
+  <!-- Mail Connection Factory                                              -->
+  <!-- ==================================================================== -->
+
+  <mbean code="org.jboss.mail.MailService"
+         name="jboss:service=Mail">
+    <attribute name="JNDIName">java:/Mail</attribute>
+    <attribute name="User">nobody</attribute>
+    <attribute name="Configuration">
+       <!-- Test -->
+       <configuration>
+          <!-- Change to your mail server prototocol -->
+          <property name="mail.store.protocol" value="pop3"/>
+          <property name="mail.transport.protocol" value="smtp"/>
+
+          <!-- Change to the user who will receive mail  -->
+          <property name="mail.user" value="nobody"/>
+
+          <!-- Change to the mail server  -->
+          <property name="mail.pop3.host" value="pop3.nosuchhost.nosuchdomain.com"/>
+
+          <!-- Change to the SMTP gateway server -->
+          <property name="mail.smtp.host" value="smtp.nosuchhost.nosuchdomain.com"/>
+
+          <!-- Change to the address mail will be from  -->
+          <property name="mail.from" value="nobody@nosuchhost.nosuchdomain.com"/>
+
+          <!-- Enable debugging output from the javamail classes -->
+          <property name="mail.debug" value="false"/>
+       </configuration>
+    </attribute>
+  </mbean>
+
+</server>

Propchange: geronimo/devtools/j2g/trunk/plugins/org.apache.geronimo.devtools.j2g.resources/test-apps/mail/mail-service.xml
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message