You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by pm...@apache.org on 2007/07/13 23:48:06 UTC
svn commit: r556157 - in /geronimo/sandbox/j2g: doc/
plugins/org.apache.geronimo.j2g.common/src/org/apache/geronimo/j2g/common/
plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/app/
plugins/org.apache.geronimo.j2g.des...
Author: pmcmahan
Date: Fri Jul 13 14:48:05 2007
New Revision: 556157
URL: http://svn.apache.org/viewvc?view=rev&rev=556157
Log:
GERONIMO-3304 update openejb-jar.xml by examining annotations. patch submitted by Viet Nguyen
Modified:
geronimo/sandbox/j2g/doc/readme.txt
geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.common/src/org/apache/geronimo/j2g/common/IFileMigration.java
geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.common/src/org/apache/geronimo/j2g/common/XMLMigrationTool.java
geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/app/ApplicationDescriptorTool.java
geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/comp/CMPDescriptorTool.java
geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/EJBDescriptorTool.java
geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/annotation/AnnotationConverter.java
geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/annotation/AnnotationTool.java
geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/web/WebDescriptorTool.java
geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/geronimo-web.xml
geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/app/test/TestApplicationDescriptorTool.java
geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/cmp/test/TestCMPDescriptorsTool.java
geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/ejb/test/TestEJBDescriptorTool.java
geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/web/test/TestWebDescriptorTool.java
geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/src/org/apache/geronimo/j2g/resources/datasource/DSResourcesTool.java
geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/src/org/apache/geronimo/j2g/resources/jms/JMSResourcesTool.java
geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/src/org/apache/geronimo/j2g/resources/mail/MailResourcesTool.java
geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/src/org/apache/geronimo/j2g/resources/security/SecurityResourcesTool.java
geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test-apps/security/security-geronimo-plan.xml
geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/datasource/test/DSResouresToolTestCase.java
geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/jms/test/JMSResouresToolTestCase.java
geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/mail/test/MailResouresToolTestCase.java
geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/security/test/SecurityResouresToolTestCase.java
geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/descriptors/xml/XMLConversionHelper.java
geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/test-apps/jboss-xml/jboss-web.xml
geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/test-apps/jboss-xml/jboss.xml
geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/test-apps/mail/geronimo-mail-service.xml
geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/test-apps/mail/mail-service.xml
Modified: geronimo/sandbox/j2g/doc/readme.txt
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/doc/readme.txt?view=diff&rev=556157&r1=556156&r2=556157
==============================================================================
--- geronimo/sandbox/j2g/doc/readme.txt (original)
+++ geronimo/sandbox/j2g/doc/readme.txt Fri Jul 13 14:48:05 2007
@@ -1,81 +1,81 @@
-/**
- * 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.
- */
-==================================
-J2G-Migration Package
-==================================
-Note: Please visit http://cwiki.apache.org/confluence/display/GMOxDOC11/J2G+Migration+Tool for more thorough documentation
-
-JBoss to Geronimo (J2G) is a tool set built as command line Eclipse SDK plug-ins
-designed to assist in migrating the sources of an application written for the JBoss
-application server or written for Java 2 Enterprise Edition (J2EE) to the Apache
-Geronimo platform.
-
-==================================
-Dependencies
-==================================
-The J2G tool set requires at least the following application versions
-(these are the versions J2G is known to work on)
-
- * Sun JDK 5.0+ (J2SE 1.5)
- * Eclipse SDK 3.3M7 with JDT Core Plug-in
- * Apache Geronimo 1.1.1
- * Application written for JBoss 3.2 and up or J2EE 1.2 and up.
-
-==================================
-Environment Variables
-==================================
-The tools in J2G require that the following environment variables be set to the proper
-locations:
-
- * JAVA_HOME (Location of the JDK)
- * ECLIPSE_HOME (Location of the Eclipse SDK)
- * WORKSPACE (Location for a temporary eclipse workspace)
-
-==================================
-1. Configurator
-==================================
-To run this component, navigate to bin, and run j2g-configure
-
-This will automatically copy the contents of the ./plugins directory to ECLIPSE_HOME/plugins,
-as well as make changes (or create, if necessary) to ECLIPSE_HOME/configuration/config.ini.
-
-==================================
-2. Source Identification Tool
-==================================
-This tool parses through source code (.java and .jsp files) recursively in directories
-passed to it as command line arguments. While doing this, it replaces any JBoss classes
-and dependencies for which there are Geronimo equivalents. If there is no equivalent, it
-will alert the user of this issue which must be resolved either through manual creation
-of a replacement class or rewriting the segment of code dependent on the JBoss class.
-
- - Usage: jsrc2g -src <APPLICATION>\src -web <APPLICATION>\web -geronimo <GERONIMO_HOME>
-
-==================================
-3. Descriptors Conversion Tool
-==================================
-This tool converts JBoss specific deployment descriptors and J2EE standard deployment
-descriptors (if necessary) to their Geronimo equivalents.
-
- - Usage: jdesc2g <APPLICATION>
-
-==================================
-4. Resource Conversion Tool
-==================================
-This tool converts JBoss specific resources, such as Java Messaging Services (JMS) Queues,
-JMS Topics, Java Database Connectivity (JDBC) data sources to their Geronimo equivalents.
-
- - Usage: jres2g <APPLICATION>
+/**
+ * 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.
+ */
+==================================
+J2G-Migration Package
+==================================
+Note: Please visit http://cwiki.apache.org/confluence/display/GMOxDOC11/J2G+Migration+Tool for more thorough documentation
+
+JBoss to Geronimo (J2G) is a tool set built as command line Eclipse SDK plug-ins
+designed to assist in migrating the sources of an application written for the JBoss
+application server or written for Java 2 Enterprise Edition (J2EE) to the Apache
+Geronimo platform.
+
+==================================
+Dependencies
+==================================
+The J2G tool set requires at least the following application versions
+(these are the versions J2G is known to work on)
+
+ * Sun JDK 5.0+ (J2SE 1.5)
+ * Eclipse SDK 3.3M7 with JDT Core Plug-in
+ * Apache Geronimo 1.1.1
+ * Application written for JBoss 3.2 and up or J2EE 1.2 and up.
+
+==================================
+Environment Variables
+==================================
+The tools in J2G require that the following environment variables be set to the proper
+locations:
+
+ * JAVA_HOME (Location of the JDK)
+ * ECLIPSE_HOME (Location of the Eclipse SDK)
+ * WORKSPACE (Location for a temporary eclipse workspace)
+
+==================================
+1. Configurator
+==================================
+To run this component, navigate to bin, and run j2g-configure
+
+This will automatically copy the contents of the ./plugins directory to ECLIPSE_HOME/plugins,
+as well as make changes (or create, if necessary) to ECLIPSE_HOME/configuration/config.ini.
+
+==================================
+2. Source Identification Tool
+==================================
+This tool parses through source code (.java and .jsp files) recursively in directories
+passed to it as command line arguments. While doing this, it replaces any JBoss classes
+and dependencies for which there are Geronimo equivalents. If there is no equivalent, it
+will alert the user of this issue which must be resolved either through manual creation
+of a replacement class or rewriting the segment of code dependent on the JBoss class.
+
+ - Usage: jsrc2g -src <APPLICATION>\src -web <APPLICATION>\web -geronimo <GERONIMO_HOME>
+
+==================================
+3. Descriptors Conversion Tool
+==================================
+This tool converts JBoss specific deployment descriptors and J2EE standard deployment
+descriptors (if necessary) to their Geronimo equivalents.
+
+ - Usage: jdesc2g <APPLICATION>
+
+==================================
+4. Resource Conversion Tool
+==================================
+This tool converts JBoss specific resources, such as Java Messaging Services (JMS) Queues,
+JMS Topics, Java Database Connectivity (JDBC) data sources to their Geronimo equivalents.
+
+ - Usage: jres2g <APPLICATION>
Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.common/src/org/apache/geronimo/j2g/common/IFileMigration.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.common/src/org/apache/geronimo/j2g/common/IFileMigration.java?view=diff&rev=556157&r1=556156&r2=556157
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.common/src/org/apache/geronimo/j2g/common/IFileMigration.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.common/src/org/apache/geronimo/j2g/common/IFileMigration.java Fri Jul 13 14:48:05 2007
@@ -28,5 +28,5 @@
* @param source source file
* @return
*/
- boolean migrate(File source);
+ boolean migrate(File source, File rootDirectory);
}
Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.common/src/org/apache/geronimo/j2g/common/XMLMigrationTool.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.common/src/org/apache/geronimo/j2g/common/XMLMigrationTool.java?view=diff&rev=556157&r1=556156&r2=556157
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.common/src/org/apache/geronimo/j2g/common/XMLMigrationTool.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.common/src/org/apache/geronimo/j2g/common/XMLMigrationTool.java Fri Jul 13 14:48:05 2007
@@ -19,8 +19,11 @@
import java.io.File;
import java.io.FileFilter;
import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
+import java.util.Set;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
@@ -60,9 +63,12 @@
usage();
return new Integer(0);
}
+
+ // save the root directory for later uses
+ String rootDirectory = args[0];
// Restore backed up files
- List files = new ArrayList();
+ List<File> files = new ArrayList<File>();
RollbackManager rollbackManager = new RollbackManager(XML_FILTER);
try {
for (int i = 0; i < args.length; ++i) {
@@ -80,15 +86,53 @@
getOutput().fatal(ex.getMessage());
return new Integer(1);
}
-
+ Set<File> filesToMigrate = new HashSet<File>();
+ // retrieve all of the files we need to migrate
+ filesToMigrate = getFilesToMigrate((File[])files.toArray(new File[files.size()]), filesToMigrate);
+ files.clear();
+ for(Iterator it = filesToMigrate.iterator(); it.hasNext(); ) {
+ files.add((File)it.next());
+ }
+ // sort the files to be migrated
+ sortByExtension(files);
// Migrate descriptors
Iterator it = files.iterator();
while (it.hasNext()) {
File file = (File) it.next();
- migrate(plugs, file);
+ File root = new File(rootDirectory);
+ migrate(plugs, file, root);
}
return new Integer(0);
}
+
+ private Set<File> getFilesToMigrate(File[] list, Set<File> set) {
+ // retrieve all files under each file/directory in 'list'
+ for(int i = 0; i < list.length; i++) {
+ if(list[i].isDirectory()) {
+ // recurse on this directory
+ Set<File> subSet = getFilesToMigrate(list[i].listFiles(XML_FILTER), set);
+ set.addAll(subSet);
+ } else {
+ // save this to the set
+ set.add(list[i]);
+ }
+ }
+ return set;
+ }
+
+ private void sortByExtension(List<File> list) {
+ // sort .xml first, then .java
+ // this is the order in which we want to process these files
+ for(int i = 0; i < list.size(); i++) {
+ File file = (File)list.get(i);
+ String filename = file.getName();
+ boolean elementEndsWithXML = filename.endsWith(".xml");
+ // bring all .xml files to the front of the list
+ if( elementEndsWithXML ) {
+ list.add(0, list.remove(i));
+ }
+ }
+ }
/**
* Print tool usage text.
@@ -98,24 +142,19 @@
}
/**
- * Migrate given file or directory.
+ * Migrate given file.
*
* @param plugs
* available migration plug-ins
* @param file
- * file or directory to migrate
+ * file to migrate
*/
- protected void migrate(IFileMigration[] plugs, File file) {
- if (file.isDirectory()) {
- File[] children = file.listFiles(XML_FILTER);
- for (int i = 0; i < children.length; ++i) {
- migrate(plugs, children[i]);
- }
- } else {
- for (int i = 0; i < plugs.length; ++i) {
- if (plugs[i].migrate(file)) {
- break;
- }
+ protected void migrate(IFileMigration[] plugs, File file, File root) {
+ File jbossXMLDirectory = null;
+ // for each plugin, attempt to migrate
+ for (int i = 0; i < plugs.length; i++) {
+ if (plugs[i].migrate(file, root)) {
+ break;
}
}
}
@@ -172,9 +211,9 @@
* Filter for .xml descriptors.
*/
protected static class XMLFilter implements FileFilter {
-/**
- * @see java.io.FileFilter#accept(java.io.File)
- */
+ /**
+ * @see java.io.FileFilter#accept(java.io.File)
+ */
public boolean accept(File file) {
return file.isDirectory() || file.getName().endsWith(XML_SUFFIX)
|| file.getName().endsWith(JAVA_SUFFIX);
Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/app/ApplicationDescriptorTool.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/app/ApplicationDescriptorTool.java?view=diff&rev=556157&r1=556156&r2=556157
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/app/ApplicationDescriptorTool.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/app/ApplicationDescriptorTool.java Fri Jul 13 14:48:05 2007
@@ -46,16 +46,16 @@
private SecurityElementProcessor securityElementProcessor;
public ApplicationDescriptorTool() {
- Tool currentTool = Tool.getCurrent();
- if (currentTool != null) {
- out = currentTool.getOutput();
- } else {
- out = new ConsoleOutput();
- }
+ Tool currentTool = Tool.getCurrent();
+ if (currentTool != null) {
+ out = currentTool.getOutput();
+ } else {
+ out = new ConsoleOutput();
+ }
securityElementProcessor = new SecurityElementProcessor();
}
- public boolean migrate(File file) {
+ public boolean migrate(File file, File rootDirectory) {
boolean migrated = false;
directoryName = file.getParent();
String jbossFileName = file.getName();
@@ -80,9 +80,9 @@
+ directoryName + ", with the error and warning messages as shown");
} catch (DocumentException e) {
out.error("Errors occurs while reading xml descriptor "
- + file.getAbsolutePath()
- + ". It is possible that the migrator cannot download an xml schema or xml file has a wrong syntax. Nested exception:"
- + e.getMessage());
+ + file.getAbsolutePath()
+ + ". It is possible that the migrator cannot download an xml schema or xml file has a wrong syntax. Nested exception:"
+ + e.getMessage());
} catch (IOException e) {
out.error("IO exception " + e.getMessage());
}
Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/comp/CMPDescriptorTool.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/comp/CMPDescriptorTool.java?view=diff&rev=556157&r1=556156&r2=556157
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/comp/CMPDescriptorTool.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/comp/CMPDescriptorTool.java Fri Jul 13 14:48:05 2007
@@ -67,7 +67,7 @@
ejbKeyColumnMapper = new HashMap();
}
- public boolean migrate(File file) {
+ public boolean migrate(File file, File rootDirectory) {
boolean migrated = false;
directoryName = file.getParent();
String jbossFileName = file.getName();
Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/EJBDescriptorTool.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/EJBDescriptorTool.java?view=diff&rev=556157&r1=556156&r2=556157
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/EJBDescriptorTool.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/EJBDescriptorTool.java Fri Jul 13 14:48:05 2007
@@ -91,7 +91,7 @@
* @return migrate sucess or not
*/
- public boolean migrate(File file) {
+ public boolean migrate(File file, File rootDirectory) {
boolean migrated = false;
String directoryName = file.getParent();
String jbossFileName = file.getName();
Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/annotation/AnnotationConverter.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/annotation/AnnotationConverter.java?view=diff&rev=556157&r1=556156&r2=556157
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/annotation/AnnotationConverter.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/annotation/AnnotationConverter.java Fri Jul 13 14:48:05 2007
@@ -43,6 +43,9 @@
// location of the properties file used to extract the differences
private final String PROP_ANNOTATION_FILE = "../properties/org.apache.geronimo.j2g.descriptors.ejb.annotation/annotation_differences.properties";
+ // annotations that may require further configuratoin by the user
+ private final String[] ambiguousAnnotations = {"@Resource", "@MessageDriven"};
+
private final IOutput out;
private Log log = LogFactory.getLog(AnnotationConverter.class);
@@ -68,6 +71,11 @@
// When there are annotations within annotations, the outter annotation
// will appear in the list before the inner annotations.
public ArrayList<String> getAnnotations(String fileStr) {
+ // warn the user if there exists JBoss-specific annotations
+ if(fileStr.contains("org.jboss.annotation.ejb.")) {
+ out.warn("This file is using JBoss's extension to EJB annotations. Convert them accordingly, as " +
+ "Geronimo does not support them.");
+ }
// list of annotations found from fileStr
ArrayList<String> listOfAnnotations = new ArrayList<String>();
// true when the part we are examining is a string defined in double quotes
@@ -115,6 +123,16 @@
// set up for next iteration
lastChar = currChar;
}
+
+ // warn the user if there are possible ambigous annotations in their code
+ // because jboss creates these references automatically, but geronimo does not
+ for(int i = 0; i < ambiguousAnnotations.length; i++) {
+ if(fileStr.contains(ambiguousAnnotations[i])) {
+ out.warn(ambiguousAnnotations[i] + " annotations may not be fully specified in "
+ + "the deployable. To fix this, you can create what these "
+ + "are supposed to reference and set a dependency on it.");
+ }
+ }
return listOfAnnotations;
}
@@ -166,7 +184,7 @@
// replace this attribute if there is a difference between jboss and geronimo
if(from != null) {
if(to == null) {
- log.error("There is not an attribute mapping for '" + from + "'");
+ // there is no specified conversion in the properties file.
} else {
annotation.replaceAttributeKey(from, to);
}
Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/annotation/AnnotationTool.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/annotation/AnnotationTool.java?view=diff&rev=556157&r1=556156&r2=556157
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/annotation/AnnotationTool.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/ejb/annotation/AnnotationTool.java Fri Jul 13 14:48:05 2007
@@ -26,7 +26,12 @@
import java.io.IOException;
import java.io.Writer;
import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Iterator;
+import org.apache.geronimo.j2g.util.descriptors.Constants;
+import org.apache.geronimo.j2g.util.descriptors.xml.XMLConversionHelper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.geronimo.j2g.common.ConsoleOutput;
@@ -34,11 +39,19 @@
import org.apache.geronimo.j2g.common.IOutput;
import org.apache.geronimo.j2g.common.XMLMigrationTool;
import org.apache.geronimo.j2g.common.Tool;
+import org.dom4j.Element;
+import org.dom4j.Document;
+import org.dom4j.Namespace;
+import org.dom4j.Node;
+import org.dom4j.QName;
public class AnnotationTool implements IFileMigration {
private IOutput out;
private Log logger = LogFactory.getLog(AnnotationTool.class);
-
+ // stores the directory in which jboss.xml is found
+ // if there is not a jboss.xml file, the it will
+ // contain the root directory
+ private static File jbossXMLDirectory;
private AnnotationConverter converter;
public AnnotationTool() {
@@ -49,41 +62,174 @@
out = new ConsoleOutput();
}
converter = new AnnotationConverter();
+ jbossXMLDirectory = null;
}
- public boolean migrate(File source) {
+ public boolean migrate(File source, File rootDirectory) {
boolean migrated = false;
+ if(jbossXMLDirectory == null) {
+ jbossXMLDirectory = getJBossXMLDirectory(rootDirectory);
+ }
try {
if (source.getCanonicalPath().endsWith(XMLMigrationTool.JAVA_SUFFIX)) {
out.info("Processing annotations for " + source.getCanonicalPath());
// get the contents of the file
String fileStr = getFileContents(source);
- // retrive all annotations
+ // retrieve all annotations
ArrayList<String> jbossAnnotations = converter.getAnnotations(fileStr);
- // The list given by getAnnotations() is ordered such that the
- // outter annotations will
- // appear before the inner annotations. Therefore, if we replace
- // the outside one first,
+ // The list given by getAnnotations() is ordered such that the outer annotations will
+ // appear before the inner annotations. Therefore, if we replace the outside one first,
// then the inside one nothing will be damaged.
for (int i = 0; i < jbossAnnotations.size(); i++) {
String geronimoAnnotation = converter.j2gAnnotation(jbossAnnotations.get(i));
- out.info("JBoss annotation: " + jbossAnnotations.get(i));
- out.info("Geronimo annotation: " + geronimoAnnotation);
- // swap in the geronimo stuff.
- fileStr = fileStr.replace(jbossAnnotations.get(i), geronimoAnnotation);
- if (fileStr.contains(geronimoAnnotation)) {
- out.info("Swapping successful.");
+ if(!jbossAnnotations.get(i).equals(geronimoAnnotation) ) {
+ out.info("JBoss annotation: " + jbossAnnotations.get(i));
+ out.info("Geronimo annotation: " + geronimoAnnotation);
+ // swap in the geronimo stuff.
+ fileStr = fileStr.replace(jbossAnnotations.get(i), geronimoAnnotation);
}
}
// write what is in the altered string to source file
writeContents(source, fileStr);
+ // Use the jbossXMLDirectory as the directory to place
+ // and/or look for the openejb-jar.xml.
+ Document openEJBDoc = XMLConversionHelper.getOpenEJBJarDocument(jbossXMLDirectory.getAbsolutePath());
+ // synchronize annotations with openejb-jar.xml
+ updateOpenEJBJar(openEJBDoc, jbossAnnotations, source);
+ // save this openejb-jar.xml
+ XMLConversionHelper.saveGeronimoDocument(
+ jbossXMLDirectory.getAbsolutePath() + File.separator + Constants.GERONIMO_OPEN_EJB_XML_FILE,
+ openEJBDoc);
+ out.info("openejb-jar.xml successfully updated.");
}
} catch (Exception e) {
e.printStackTrace();
}
return migrated;
}
+
+ private void updateOpenEJBJar(Document openEJBDoc, ArrayList<String> jbossAnnotations, File source) {
+ // TODO:
+ // Update the openejb-jar.xml based on the annotations.
+ for(int i = 0; i < jbossAnnotations.size(); i++) {
+ AnnotationInstance annotation = new AnnotationInstance(jbossAnnotations.get(i));
+ // message driven class
+ if(annotation.getKeyword().equals("MessageDriven")) {
+ // the default mdbName is the class name
+ // unless specified otherwise
+ String mdbName = source.getName().substring(0, source.getName().indexOf("."));
+ // TODO:
+ // Maybe there is a way to get the resource-link name, so here is where you want
+ // to retrieve it if possible. Otherwise, the user will have to manually specify one.
+
+ // resource-link name
+ String resourceLink = null;
+ // check to see if the mdbName is specified to be something different
+ ArrayList<String> attrValues = annotation.getAttributeValues();
+ ArrayList<String> attrKeys = annotation.getAttributeKeys();
+ for(int j = 0; j < attrKeys.size(); j++) {
+ if(attrKeys.get(j).equals("name")) {
+ mdbName = attrValues.get(j);
+ } else if(attrKeys.get(j).equals("mappedName")) {
+ mdbName = attrValues.get(j);
+ }
+ }
+ // add this mdb instance to the xml
+ addMessageDrivenInstance(openEJBDoc, mdbName, resourceLink);
+ }
+ // TODO:
+ // Add more variations to the openejb-jar.xml
+ // as I may be missing some cases.
+ }
+ }
+
+ private void addMessageDrivenInstance(Document openEJBDoc, String name, String link) {
+ Element rootElement = openEJBDoc.getRootElement();
+ // key = element name
+ // value = list of elements under the node with element name (=key)
+ Map elementMaps = XMLConversionHelper.getChildrenHashMap(rootElement);
+ Element enterpriseBeanElement = null;
+ if( !elementMaps.containsKey("enterprise-beans") ) {
+ // create an <enterprise-beans> tag
+ QName qname = new QName("enterprise-beans", rootElement.getNamespace());
+ enterpriseBeanElement = rootElement.addElement(qname);
+ } else {
+ // go through and find an enterprise-beans tag
+ for(Iterator it = rootElement.elementIterator(); it.hasNext(); ) {
+ Element element = (Element)it.next();
+ if(element.getName().equals("enterprise-beans")) {
+ // save this enterprise-bean element to update later
+ enterpriseBeanElement = element;
+ }
+ }
+ }
+ // add <message-driven> to enterpriseBeanElement
+ addMDBElement(enterpriseBeanElement, name, link);
+ }
+
+ private void addMDBElement(Element enterpriseElement, String name, String link) {
+ // TODO:
+ // Check for duplicates in the <enterprise-beans> tag
+
+ Namespace namespace = enterpriseElement.getNamespace();
+ QName mdbQName = new QName("message-driven", namespace);
+ QName ejbQName = new QName("ejb-name", namespace);
+ QName resourceAdapterQName = new QName("resource-adapter", namespace);
+ QName resourceLinkQName = new QName("resource-link", namespace);
+ // Structure:
+ //
+ // <enterprise-beans>
+ // <message-driven>
+ // <ejb-name>
+ // <resource-adapter>
+ // <resource-link>
+ Element mdbElement = enterpriseElement.addElement(mdbQName);
+ Element ejbElement = mdbElement.addElement(ejbQName);
+ if(name != null) {
+ ejbElement.setText(name);
+ } else {
+ out.warn("Unable to determine ejb-name value: supply your own.");
+ }
+ Element resourceAdapterElement = mdbElement.addElement(resourceAdapterQName);
+ Element resourceLinkElement = resourceAdapterElement.addElement(resourceLinkQName);
+ if(link != null) {
+ resourceLinkElement.setText(link);
+ } else {
+ out.warn("You need to supply your own reference to a resource-link.");
+ }
+ }
+
+ private File getJBossXMLDirectory(File root) {
+ // if there is a jboss.xml somewhere in the root directory
+ // return the directory in which is resides. Otherwise,
+ // return the root directory itself.
+ List<File> files = getListFromArray(root.listFiles());
+ while(files.size() != 0) {
+ File file = files.get(0);
+ if(file.isDirectory()) {
+ // recurse iteratively
+ List<File> additionalFiles = getListFromArray(file.listFiles());
+ files.addAll(additionalFiles);
+ } else {
+ // check if it is a jboss.xml
+ if(file.getName().equals(Constants.JBOSS_JBOSS_XML_FILE)) {
+ return file.getParentFile();
+ }
+ }
+ // remove this already-processed file
+ files.remove(0);
+ }
+ return root;
+ }
+ private List<File> getListFromArray(File[] arry) {
+ List<File> list = new ArrayList<File>();
+ for(int i = 0; i < arry.length; i++) {
+ list.add(arry[i]);
+ }
+ return list;
+ }
+
private void writeContents(File source, String fileStr) {
Writer output = null;
try {
Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/web/WebDescriptorTool.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/web/WebDescriptorTool.java?view=diff&rev=556157&r1=556156&r2=556157
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/web/WebDescriptorTool.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/src/org/apache/geronimo/j2g/descriptors/web/WebDescriptorTool.java Fri Jul 13 14:48:05 2007
@@ -61,7 +61,7 @@
namingElementProcessor = new NamingElementProcessor(envirionmentElementProcessor);
}
- public boolean migrate(File file) {
+ public boolean migrate(File file, File rootDirectory) {
boolean migrated = false;
String directoryName = file.getParent();
Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/geronimo-web.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/geronimo-web.xml?view=diff&rev=556157&r1=556156&r2=556157
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/geronimo-web.xml (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test-resources/geronimo-web.xml Fri Jul 13 14:48:05 2007
@@ -1,39 +1,39 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1" xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.1" xmlns:security="http://geronimo.apache.org/xml/ns/security-1.1" xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.1">
- <sys:environment>
- <sys:moduleId>
- <sys:groupId>j2g</sys:groupId>
- <sys:artifactId>web-module</sys:artifactId>
- <sys:version>1.0</sys:version>
- <sys:type>war</sys:type>
- </sys:moduleId>
- <sys:dependencies>
- <sys:dependency>
- <sys:groupId>j2g.jdbc</sys:groupId>
- <sys:artifactId>TestDB</sys:artifactId>
- <sys:version>1.0</sys:version>
- <sys:type>rar</sys:type>
- </sys:dependency>
- </sys:dependencies>
- </sys:environment>
- <security-realm-name>securityDomation</security-realm-name>
- <context-root>/myApp</context-root>
- <naming:resource-ref>
- <naming:ref-name>resource1</naming:ref-name>
- <naming:resource-link>TestDB</naming:resource-link>
- </naming:resource-ref>
- <security:security>
- <security:default-principal>
- <security:realm-principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="anonymous" domain-name="securityDomation" realm-name="securityDomation"/>
- </security:default-principal>
- <security:role-mappings>
- <security:role role-name="amila1">
- <security:realm-principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="amila1" domain-name="securityDomation" realm-name="securityDomation"/>
- </security:role>
- <security:role role-name="amila2">
- <security:realm-principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="amila2" domain-name="securityDomation" realm-name="securityDomation"/>
- </security:role>
- </security:role-mappings>
- </security:security>
-</web-app>
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1" xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.1" xmlns:security="http://geronimo.apache.org/xml/ns/security-1.1" xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.1">
+ <sys:environment>
+ <sys:moduleId>
+ <sys:groupId>j2g</sys:groupId>
+ <sys:artifactId>web-module</sys:artifactId>
+ <sys:version>1.0</sys:version>
+ <sys:type>war</sys:type>
+ </sys:moduleId>
+ <sys:dependencies>
+ <sys:dependency>
+ <sys:groupId>j2g.jdbc</sys:groupId>
+ <sys:artifactId>TestDB</sys:artifactId>
+ <sys:version>1.0</sys:version>
+ <sys:type>rar</sys:type>
+ </sys:dependency>
+ </sys:dependencies>
+ </sys:environment>
+ <security-realm-name>securityDomation</security-realm-name>
+ <context-root>/myApp</context-root>
+ <naming:resource-ref>
+ <naming:ref-name>resource1</naming:ref-name>
+ <naming:resource-link>TestDB</naming:resource-link>
+ </naming:resource-ref>
+ <security:security>
+ <security:default-principal>
+ <security:realm-principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="anonymous" domain-name="securityDomation" realm-name="securityDomation"/>
+ </security:default-principal>
+ <security:role-mappings>
+ <security:role role-name="amila1">
+ <security:realm-principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="amila1" domain-name="securityDomation" realm-name="securityDomation"/>
+ </security:role>
+ <security:role role-name="amila2">
+ <security:realm-principal class="org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal" name="amila2" domain-name="securityDomation" realm-name="securityDomation"/>
+ </security:role>
+ </security:role-mappings>
+ </security:security>
+</web-app>
Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/app/test/TestApplicationDescriptorTool.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/app/test/TestApplicationDescriptorTool.java?view=diff&rev=556157&r1=556156&r2=556157
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/app/test/TestApplicationDescriptorTool.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/app/test/TestApplicationDescriptorTool.java Fri Jul 13 14:48:05 2007
@@ -27,7 +27,7 @@
public void testMigrate() {
String jbossApplicatinXmlFile = "test-resources/jboss-app.xml";
ApplicationDescriptorTool applicationDescriptorTool = new ApplicationDescriptorTool();
- applicationDescriptorTool.migrate(new File(jbossApplicatinXmlFile));
+ applicationDescriptorTool.migrate(new File(jbossApplicatinXmlFile), null);
}
}
Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/cmp/test/TestCMPDescriptorsTool.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/cmp/test/TestCMPDescriptorsTool.java?view=diff&rev=556157&r1=556156&r2=556157
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/cmp/test/TestCMPDescriptorsTool.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/cmp/test/TestCMPDescriptorsTool.java Fri Jul 13 14:48:05 2007
@@ -28,7 +28,7 @@
public void testMigrate() {
File file = new File("test-resources/jbosscmp-jdbc.xml");
CMPDescriptorTool cmpDescriptorTool = new CMPDescriptorTool();
- cmpDescriptorTool.migrate(file);
+ cmpDescriptorTool.migrate(file, null);
}
}
Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/ejb/test/TestEJBDescriptorTool.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/ejb/test/TestEJBDescriptorTool.java?view=diff&rev=556157&r1=556156&r2=556157
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/ejb/test/TestEJBDescriptorTool.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/ejb/test/TestEJBDescriptorTool.java Fri Jul 13 14:48:05 2007
@@ -27,7 +27,7 @@
public void testMigrate() {
File file = new File("test-resources/jboss.xml");
EJBDescriptorTool ejbDescriptorTool = new EJBDescriptorTool();
- ejbDescriptorTool.migrate(file);
+ ejbDescriptorTool.migrate(file, null);
}
}
Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/web/test/TestWebDescriptorTool.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/web/test/TestWebDescriptorTool.java?view=diff&rev=556157&r1=556156&r2=556157
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/web/test/TestWebDescriptorTool.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.descriptors/test/org/apache/geronimo/j2g/descriptors/web/test/TestWebDescriptorTool.java Fri Jul 13 14:48:05 2007
@@ -27,7 +27,7 @@
public void testMigration() {
File file = new File("test-resources/jboss-web.xml");
WebDescriptorTool webMigrationTool = new WebDescriptorTool();
- webMigrationTool.migrate(file);
+ webMigrationTool.migrate(file, null);
}
}
Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/src/org/apache/geronimo/j2g/resources/datasource/DSResourcesTool.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/src/org/apache/geronimo/j2g/resources/datasource/DSResourcesTool.java?view=diff&rev=556157&r1=556156&r2=556157
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/src/org/apache/geronimo/j2g/resources/datasource/DSResourcesTool.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/src/org/apache/geronimo/j2g/resources/datasource/DSResourcesTool.java Fri Jul 13 14:48:05 2007
@@ -51,7 +51,7 @@
* @param sourceFile :data source jboss discriptor file
* @return status of the migration
*/
- public boolean migrate(File sourceFile) {
+ public boolean migrate(File sourceFile, File rootDirectory) {
boolean migrated = false;
String directoryName = sourceFile.getParent();
String jbossDSFileName = sourceFile.getName();
@@ -352,4 +352,4 @@
return false;
}
-}
\ No newline at end of file
+}
Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/src/org/apache/geronimo/j2g/resources/jms/JMSResourcesTool.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/src/org/apache/geronimo/j2g/resources/jms/JMSResourcesTool.java?view=diff&rev=556157&r1=556156&r2=556157
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/src/org/apache/geronimo/j2g/resources/jms/JMSResourcesTool.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/src/org/apache/geronimo/j2g/resources/jms/JMSResourcesTool.java Fri Jul 13 14:48:05 2007
@@ -52,7 +52,7 @@
* jms jboss discriptor file
* @return status of the migration
*/
- public boolean migrate(File sourceFile) {
+ public boolean migrate(File sourceFile, File rootDirectory) {
// read any *-servise files and then migrate that to the geronimo jms
// resources
boolean migrated = false;
Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/src/org/apache/geronimo/j2g/resources/mail/MailResourcesTool.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/src/org/apache/geronimo/j2g/resources/mail/MailResourcesTool.java?view=diff&rev=556157&r1=556156&r2=556157
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/src/org/apache/geronimo/j2g/resources/mail/MailResourcesTool.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/src/org/apache/geronimo/j2g/resources/mail/MailResourcesTool.java Fri Jul 13 14:48:05 2007
@@ -51,7 +51,7 @@
* @param sourceFile :jms jboss discriptor file
* @return status of the migration
*/
- public boolean migrate(File sourceFile) {
+ public boolean migrate(File sourceFile, File rootDirectory) {
boolean migrated = false;
String directoryName = sourceFile.getParent();
String mailFilename = sourceFile.getName();
Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/src/org/apache/geronimo/j2g/resources/security/SecurityResourcesTool.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/src/org/apache/geronimo/j2g/resources/security/SecurityResourcesTool.java?view=diff&rev=556157&r1=556156&r2=556157
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/src/org/apache/geronimo/j2g/resources/security/SecurityResourcesTool.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/src/org/apache/geronimo/j2g/resources/security/SecurityResourcesTool.java Fri Jul 13 14:48:05 2007
@@ -52,7 +52,7 @@
* @param sourceFile :data source jboss discriptor file
* @return status of the migration
*/
- public boolean migrate(File sourceFile) {
+ 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;
Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test-apps/security/security-geronimo-plan.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test-apps/security/security-geronimo-plan.xml?view=diff&rev=556157&r1=556156&r2=556157
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test-apps/security/security-geronimo-plan.xml (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test-apps/security/security-geronimo-plan.xml Fri Jul 13 14:48:05 2007
@@ -28,7 +28,7 @@
<log:login-module control-flag="REQUIRED" server-side="true" wrap-principals="false">
<log:login-domain-name>jbossmq</log:login-domain-name>
<log:login-module-class>org.apache.geronimo.security.realm.providers.SQLLoginModule</log:login-module-class>
- <log:option name="dataSourceName">java:/DefaultDS/Test</log:option>
+ <log:option name="dataSourceName">DefaultDS/Test</log:option>
<log:option name="userSelect">SELECT PASSWD FROM JMS_USERS WHERE USERID=?</log:option>
<log:option name="groupSelect">SELECT ROLEID, 'Roles' FROM JMS_ROLES WHERE USERID=?</log:option>
</log:login-module>
Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/datasource/test/DSResouresToolTestCase.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/datasource/test/DSResouresToolTestCase.java?view=diff&rev=556157&r1=556156&r2=556157
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/datasource/test/DSResouresToolTestCase.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/datasource/test/DSResouresToolTestCase.java Fri Jul 13 14:48:05 2007
@@ -42,7 +42,7 @@
public void testDSResourcesFileMigration_mysql() {
File file = new File("test-apps/ds/mysql-ds.xml");
DSResourcesTool dsResourcesTool = new DSResourcesTool();
- boolean result = dsResourcesTool.migrate(file);
+ boolean result = dsResourcesTool.migrate(file, null);
assertTrue(result);
}
@@ -50,7 +50,7 @@
public void testDSResourcesFileMigration_oracle() {
File file = new File("test-apps/ds/oracle-ds.xml");
DSResourcesTool dsResourcesTool = new DSResourcesTool();
- boolean result = dsResourcesTool.migrate(file);
+ boolean result = dsResourcesTool.migrate(file, null);
assertTrue(result);
}
@@ -58,7 +58,7 @@
public void testDSResourcesFileMigration_hsqldb() {
File file = new File("test-apps/ds/hsqldb-ds.xml");
DSResourcesTool dsResourcesTool = new DSResourcesTool();
- boolean result = dsResourcesTool.migrate(file);
+ boolean result = dsResourcesTool.migrate(file, null);
assertTrue(result);
}
Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/jms/test/JMSResouresToolTestCase.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/jms/test/JMSResouresToolTestCase.java?view=diff&rev=556157&r1=556156&r2=556157
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/jms/test/JMSResouresToolTestCase.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/jms/test/JMSResouresToolTestCase.java Fri Jul 13 14:48:05 2007
@@ -42,7 +42,7 @@
+ Constants.JBOSS_VALID_JMS_DESTINATIONS_SERVICES_XML_FILE;
File file = new File(fileLocation);
JMSResourcesTool jmsResourcesTool = new JMSResourcesTool();
- boolean result = jmsResourcesTool.migrate(file);
+ boolean result = jmsResourcesTool.migrate(file, null);
assertTrue(result);
}
}
Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/mail/test/MailResouresToolTestCase.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/mail/test/MailResouresToolTestCase.java?view=diff&rev=556157&r1=556156&r2=556157
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/mail/test/MailResouresToolTestCase.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/mail/test/MailResouresToolTestCase.java Fri Jul 13 14:48:05 2007
@@ -43,7 +43,7 @@
public void testMailResourcesFileMigration() {
File file = new File("test-apps/mail/mail-service.xml");
MailResourcesTool mailResourcesTool = new MailResourcesTool();
- boolean result = mailResourcesTool.migrate(file);
+ boolean result = mailResourcesTool.migrate(file, null);
assertTrue(result);
}
@@ -51,7 +51,7 @@
public void testMailResourcesFileMigration_withPassword() {
File file = new File("test-apps/mail/err/mail-service.xml");
MailResourcesTool mailResourcesTool = new MailResourcesTool();
- boolean result = mailResourcesTool.migrate(file);
+ boolean result = mailResourcesTool.migrate(file, null);
assertTrue(!result);
}
Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/security/test/SecurityResouresToolTestCase.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/security/test/SecurityResouresToolTestCase.java?view=diff&rev=556157&r1=556156&r2=556157
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/security/test/SecurityResouresToolTestCase.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.resources/test/org/apache/geronimo/j2g/resources/security/test/SecurityResouresToolTestCase.java Fri Jul 13 14:48:05 2007
@@ -39,7 +39,7 @@
public void testSecurityResourcesFileMigration_file() {
File file = new File("test-apps/security/login-config.xml");
SecurityResourcesTool securityResourcesTool = new SecurityResourcesTool();
- boolean result = securityResourcesTool.migrate(file);
+ boolean result = securityResourcesTool.migrate(file, null);
assertTrue(result);
}
}
Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/descriptors/xml/XMLConversionHelper.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/descriptors/xml/XMLConversionHelper.java?view=diff&rev=556157&r1=556156&r2=556157
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/descriptors/xml/XMLConversionHelper.java (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/src/org/apache/geronimo/j2g/util/descriptors/xml/XMLConversionHelper.java Fri Jul 13 14:48:05 2007
@@ -103,7 +103,6 @@
}
};
-
SAXReader saxReader = new SAXReader();
saxReader.setXMLFilter(xmlFilter);
return saxReader.read(file);
@@ -279,7 +278,7 @@
* @return children has map
*/
- private static Map getChildrenHashMap(Element element) {
+ public static Map getChildrenHashMap(Element element) {
Map elementsMap = new HashMap();
Element elementChild;
for (Iterator iter = element.elementIterator(); iter.hasNext();) {
Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/test-apps/jboss-xml/jboss-web.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/test-apps/jboss-xml/jboss-web.xml?view=diff&rev=556157&r1=556156&r2=556157
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/test-apps/jboss-xml/jboss-web.xml (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/test-apps/jboss-xml/jboss-web.xml Fri Jul 13 14:48:05 2007
@@ -1,51 +1,51 @@
-<?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 jboss PUBLIC
- "-//JBoss//DTD JBOSS 3.0//EN"
- "http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd"-->
-
-<jboss-web>
- <security-domain>securityDomation</security-domain>
- <context-root>/myApp</context-root>
- <resource-env-ref>
- <resource-env-ref-name>envResource1</resource-env-ref-name>
- <jndi-name>jdbc/TestDB</jndi-name>
- </resource-env-ref>
- <resource-ref>
- <res-ref-name>resource1</res-ref-name>
- <jndi-name>jdbc/TestDB</jndi-name>
- </resource-ref>
- <security-role>
- <role-name>amila1</role-name>
- <principal-name>amila1</principal-name>
- </security-role>
- <security-role>
- <role-name>amila2</role-name>
- <principal-name>amila2</principal-name>
- </security-role>
- <ejb-ref>
- <ejb-ref-name>ejb/TestEJB</ejb-ref-name>
- <jndi-name>ejb/TestEJB</jndi-name>
- </ejb-ref>
- <ejb-local-ref>
- <ejb-ref-name>ejb/LocalTestEJB</ejb-ref-name>
- <local-jndi-name>ejb/LocalEJB</local-jndi-name>
- </ejb-local-ref>
+<?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 jboss PUBLIC
+ "-//JBoss//DTD JBOSS 3.0//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd"-->
+
+<jboss-web>
+ <security-domain>securityDomation</security-domain>
+ <context-root>/myApp</context-root>
+ <resource-env-ref>
+ <resource-env-ref-name>envResource1</resource-env-ref-name>
+ <jndi-name>jdbc/TestDB</jndi-name>
+ </resource-env-ref>
+ <resource-ref>
+ <res-ref-name>resource1</res-ref-name>
+ <jndi-name>jdbc/TestDB</jndi-name>
+ </resource-ref>
+ <security-role>
+ <role-name>amila1</role-name>
+ <principal-name>amila1</principal-name>
+ </security-role>
+ <security-role>
+ <role-name>amila2</role-name>
+ <principal-name>amila2</principal-name>
+ </security-role>
+ <ejb-ref>
+ <ejb-ref-name>ejb/TestEJB</ejb-ref-name>
+ <jndi-name>ejb/TestEJB</jndi-name>
+ </ejb-ref>
+ <ejb-local-ref>
+ <ejb-ref-name>ejb/LocalTestEJB</ejb-ref-name>
+ <local-jndi-name>ejb/LocalEJB</local-jndi-name>
+ </ejb-local-ref>
</jboss-web>
Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/test-apps/jboss-xml/jboss.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/test-apps/jboss-xml/jboss.xml?view=diff&rev=556157&r1=556156&r2=556157
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/test-apps/jboss-xml/jboss.xml (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/test-apps/jboss-xml/jboss.xml Fri Jul 13 14:48:05 2007
@@ -1,43 +1,43 @@
-<?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 jboss PUBLIC
- "-//JBoss//DTD JBOSS 3.0//EN"
- "http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd"-->
-
-<jboss>
- <enterprise-beans>
- <session>
- <ejb-name>EJBTestRunnerEJB</ejb-name>
- <jndi-name>ejb/EJBTestRunner</jndi-name>
- </session>
- <entity>
- <ejb-name>OrganizationEJB</ejb-name>
- <local-jndi-name>crimeportal/Organization</local-jndi-name>
- </entity>
- <entity>
- <ejb-name>GangsterEJB</ejb-name>
- <local-jndi-name>crimeportal/Gangster</local-jndi-name>
- </entity>
- <entity>
- <ejb-name>JobEJB</ejb-name>
- <local-jndi-name>crimeportal/Job</local-jndi-name>
- </entity>
- </enterprise-beans>
-</jboss>
+<?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 jboss PUBLIC
+ "-//JBoss//DTD JBOSS 3.0//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss_3_0.dtd"-->
+
+<jboss>
+ <enterprise-beans>
+ <session>
+ <ejb-name>EJBTestRunnerEJB</ejb-name>
+ <jndi-name>ejb/EJBTestRunner</jndi-name>
+ </session>
+ <entity>
+ <ejb-name>OrganizationEJB</ejb-name>
+ <local-jndi-name>crimeportal/Organization</local-jndi-name>
+ </entity>
+ <entity>
+ <ejb-name>GangsterEJB</ejb-name>
+ <local-jndi-name>crimeportal/Gangster</local-jndi-name>
+ </entity>
+ <entity>
+ <ejb-name>JobEJB</ejb-name>
+ <local-jndi-name>crimeportal/Job</local-jndi-name>
+ </entity>
+ </enterprise-beans>
+</jboss>
Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/test-apps/mail/geronimo-mail-service.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/test-apps/mail/geronimo-mail-service.xml?view=diff&rev=556157&r1=556156&r2=556157
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/test-apps/mail/geronimo-mail-service.xml (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/test-apps/mail/geronimo-mail-service.xml Fri Jul 13 14:48:05 2007
@@ -1,42 +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>
+<?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>
Modified: geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/test-apps/mail/mail-service.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/test-apps/mail/mail-service.xml?view=diff&rev=556157&r1=556156&r2=556157
==============================================================================
--- geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/test-apps/mail/mail-service.xml (original)
+++ geronimo/sandbox/j2g/plugins/org.apache.geronimo.j2g.util/test-apps/mail/mail-service.xml Fri Jul 13 14:48:05 2007
@@ -1,57 +1,57 @@
-<?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 520023 2007-03-19 17:43:27Z 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">none</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>
+<?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 520023 2007-03-19 17:43:27Z 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">none</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>