tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgallim...@apache.org
Subject svn commit: r684356 - in /openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.eclipse.jst.server.generic.openejb: ./ src/main/java/org/apache/openejb/eclipse/server/
Date Sat, 09 Aug 2008 21:46:42 GMT
Author: jgallimore
Date: Sat Aug  9 14:46:42 2008
New Revision: 684356

URL: http://svn.apache.org/viewvc?rev=684356&view=rev
Log:
OPENEJB-882 added support for deploying EAR projects to standalone server

Modified:
    openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.eclipse.jst.server.generic.openejb/plugin.xml
    openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.eclipse.jst.server.generic.openejb/src/main/java/org/apache/openejb/eclipse/server/OpenEJBServer.java
    openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.eclipse.jst.server.generic.openejb/src/main/java/org/apache/openejb/eclipse/server/OpenEJBServerBehaviour.java

Modified: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.eclipse.jst.server.generic.openejb/plugin.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.eclipse.jst.server.generic.openejb/plugin.xml?rev=684356&r1=684355&r2=684356&view=diff
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.eclipse.jst.server.generic.openejb/plugin.xml
(original)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.eclipse.jst.server.generic.openejb/plugin.xml
Sat Aug  9 14:46:42 2008
@@ -29,6 +29,10 @@
 	      <moduleType
 	         types="jst.ejb"
 	         versions="1.0, 2.0, 2.1, 3.0"/>
+       <moduleType
+             types="jst.ear"
+             versions="1.4, 5.0">
+       </moduleType>
 	    </runtimeType>
  	</extension>
 
@@ -107,13 +111,22 @@
          version="3.0.0"/>
        <facet
          id="jst.ejb"
-         version="2.1, 3.0"/>
+         version="1.0, 2.0, 2.1, 3.0"/>
        <facet
              id="jst.java"
              version="1.4, 5.0">
        </facet>
 
     </supported>
+    <supported>
+       <runtime-component
+             id="org.apache.openejb.server.generic.runtime.openejb"
+             version="3.0.0"></runtime-component>
+       <facet
+             id="jst.ear"
+             version="1.4,5.0">
+       </facet>
+    </supported>
 
   </extension>
 

Modified: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.eclipse.jst.server.generic.openejb/src/main/java/org/apache/openejb/eclipse/server/OpenEJBServer.java
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.eclipse.jst.server.generic.openejb/src/main/java/org/apache/openejb/eclipse/server/OpenEJBServer.java?rev=684356&r1=684355&r2=684356&view=diff
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.eclipse.jst.server.generic.openejb/src/main/java/org/apache/openejb/eclipse/server/OpenEJBServer.java
(original)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.eclipse.jst.server.generic.openejb/src/main/java/org/apache/openejb/eclipse/server/OpenEJBServer.java
Sat Aug  9 14:46:42 2008
@@ -53,32 +53,14 @@
 	}
 
 	private boolean isSupportedModule(IModule module) {
-		return (module.getModuleType() != null && module.getModuleType().getId().equals("jst.ejb"));
+		return (module.getModuleType() != null 
+				&& ("jst.ejb".equals(module.getModuleType().getId())
+						|| "jst.ear".equals(module.getModuleType().getId())));
 	
 	}
 
 	@Override
 	public IModule[] getChildModules(IModule[] module) {
-		if (module[0] != null && module[0].getModuleType() != null) {
-			if (module.length == 1) {
-				IModuleType moduleType = module[0].getModuleType();
-				if (moduleType != null && "jst.ear".equals(moduleType.getId())) { //$NON-NLS-1$
-					IEnterpriseApplication enterpriseApplication = (IEnterpriseApplication) module[0].loadAdapter(IEnterpriseApplication.class,
null);
-					if (enterpriseApplication != null) {
-						IModule[] earModules = enterpriseApplication.getModules();
-						if (earModules != null) {
-							return earModules;
-						}
-					}
-				} else if (moduleType != null && "jst.web".equals(moduleType.getId())) { //$NON-NLS-1$
-					IWebModule webModule = (IWebModule) module[0].loadAdapter(IWebModule.class, null);
-					if (webModule != null) {
-						IModule[] modules = webModule.getModules();
-						return modules;
-					}
-				}
-			}
-		}
 		return new IModule[0];
 	}
 
@@ -97,7 +79,7 @@
 	}
 
 	@SuppressWarnings("unchecked")
-	private IModule[] doGetParentModules(IModule module) {
+	public IModule[] doGetParentModules(IModule module) {
 		IModule[] ears = ServerUtil.getModules("jst.ear"); //$NON-NLS-1$
 		ArrayList list = new ArrayList();
 		for (int i = 0; i < ears.length; i++) {
@@ -113,7 +95,6 @@
 
 	@Override
 	public void modifyModules(IModule[] add, IModule[] remove, IProgressMonitor monitor) throws
CoreException {
-		// do owt for the time being
 	}
 
 }

Modified: openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.eclipse.jst.server.generic.openejb/src/main/java/org/apache/openejb/eclipse/server/OpenEJBServerBehaviour.java
URL: http://svn.apache.org/viewvc/openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.eclipse.jst.server.generic.openejb/src/main/java/org/apache/openejb/eclipse/server/OpenEJBServerBehaviour.java?rev=684356&r1=684355&r2=684356&view=diff
==============================================================================
--- openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.eclipse.jst.server.generic.openejb/src/main/java/org/apache/openejb/eclipse/server/OpenEJBServerBehaviour.java
(original)
+++ openejb/trunk/sandbox/openejb-eclipse-plugin/plugins/org.eclipse.jst.server.generic.openejb/src/main/java/org/apache/openejb/eclipse/server/OpenEJBServerBehaviour.java
Sat Aug  9 14:46:42 2008
@@ -38,6 +38,7 @@
 import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
 import org.eclipse.jdt.launching.IVMInstall;
 import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.jst.j2ee.application.internal.operations.EARComponentExportDataModelProvider;
 import org.eclipse.jst.j2ee.ejb.datamodel.properties.IEJBComponentExportDataModelProperties;
 import org.eclipse.jst.j2ee.internal.ejb.project.operations.EJBComponentExportDataModelProvider;
 import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
@@ -228,7 +229,7 @@
 	protected IStatus publishModule(int kind, IModule[] modules, int deltaKind, IProgressMonitor
monitor) {
 		if (IServer.STATE_STARTED != getServer().getServerState()) {
 			for (IModule module : modules) {
-				if (kind == REMOVED) {
+				if (deltaKind == REMOVED) {
 					String jarFile = publishedModules.get(module);
 					if (jarFile != null) {
 						new File(jarFile).delete();
@@ -249,10 +250,17 @@
 	}
 
 	protected String exportModule(IModule module) {
+		IDataModel model;
+		File tempJarFile;
+		
 		try {
-			File tempJarFile = File.createTempFile("oejb", ".jar");
-
-			IDataModel model = DataModelFactory.createDataModel(new EJBComponentExportDataModelProvider());
+			if ("jst.ear".equals(module.getModuleType().getId())) {
+				model = DataModelFactory.createDataModel(new EARComponentExportDataModelProvider());
+				tempJarFile = File.createTempFile("oejb", ".ear");
+			} else {
+				model = DataModelFactory.createDataModel(new EJBComponentExportDataModelProvider());
+				tempJarFile = File.createTempFile("oejb", ".jar");
+			}
 
 			model.setProperty(IEJBComponentExportDataModelProperties.PROJECT_NAME, module.getProject().getName());
 			model.setProperty(IEJBComponentExportDataModelProperties.ARCHIVE_DESTINATION, tempJarFile.getAbsolutePath());



Mime
View raw message