geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r239937 [2/73] - in /geronimo/trunk/sandbox/eclipse-plugin: org.apache.geronimo.core/src/org/apache/geronimo/core/internal/ org.apache.geronimo.core/src/org/apache/geronimo/core/operations/ org.apache.geronimo.deployment.model/src/org/apach...
Date Wed, 24 Aug 2005 21:36:53 GMT
Modified: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/internal/GeronimoServerBehaviour.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/internal/GeronimoServerBehaviour.java?rev=239937&r1=239936&r2=239937&view=diff
==============================================================================
--- geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/internal/GeronimoServerBehaviour.java (original)
+++ geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/internal/GeronimoServerBehaviour.java Wed Aug 24 14:34:34 2005
@@ -1,527 +1,527 @@
-/**
- * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
- *
- *  Licensed 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.core.internal;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.jar.Attributes;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-import java.util.jar.JarOutputStream;
-
-import javax.enterprise.deploy.shared.CommandType;
-import javax.enterprise.deploy.shared.factories.DeploymentFactoryManager;
-import javax.enterprise.deploy.spi.DeploymentManager;
-import javax.enterprise.deploy.spi.Target;
-import javax.enterprise.deploy.spi.TargetModuleID;
-import javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException;
-import javax.enterprise.deploy.spi.exceptions.TargetException;
-import javax.enterprise.deploy.spi.factories.DeploymentFactory;
-import javax.enterprise.deploy.spi.status.DeploymentStatus;
-import javax.enterprise.deploy.spi.status.ProgressEvent;
-import javax.enterprise.deploy.spi.status.ProgressListener;
-import javax.enterprise.deploy.spi.status.ProgressObject;
-import javax.management.MBeanServerConnection;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-import javax.management.remote.JMXConnector;
-import javax.management.remote.JMXConnectorFactory;
-import javax.management.remote.JMXServiceURL;
-
-import org.apache.geronimo.deployment.plugin.factories.DeploymentFactoryImpl;
-import org.apache.geronimo.kernel.GBeanNotFoundException;
-import org.apache.geronimo.kernel.InternalKernelException;
-import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.config.Configuration;
-import org.apache.geronimo.kernel.jmx.KernelDelegate;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jst.server.core.IJ2EEModule;
-import org.eclipse.jst.server.generic.core.internal.GenericServerBehaviour;
-import org.eclipse.jst.server.generic.core.internal.Trace;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-
-public class GeronimoServerBehaviour extends GenericServerBehaviour {
-
-	private final static String DEFAULT_URI = "deployer:geronimo:jmx:rmi://localhost/jndi/rmi:/JMXConnector";
-
-	private final static String J2EE_DEPLOYER_ID = "org/apache/geronimo/RuntimeDeployer";
-    
-    private static final int MAX_TRIES = 10;
-    
-    private static final long TIMEOUT = 100000;
-
-	private DeploymentFactoryManager dfm = null;
-
-	private DeploymentManager dm = null;
-
-	private IProgressMonitor _monitor = null;
-
-	private Kernel kernel = null;
-
-	public GeronimoServerBehaviour() {
-		super();
-	}
-
-	private void discoverDeploymentFactory() {
-
-		try {
-			JarFile deployerJar = new JarFile(getServer().getRuntime().getLocation().append(
-					"/deployer.jar").toFile());
-			java.util.jar.Manifest manifestFile = deployerJar.getManifest();
-			Attributes attributes = manifestFile.getMainAttributes();
-			String key = "J2EE-DeploymentFactory-Implementation-Class";
-			String className = attributes.getValue(key);
-			dfm = DeploymentFactoryManager.getInstance();
-			Class deploymentFactory = Class.forName(className);
-			DeploymentFactory deploymentFactoryInstance = (DeploymentFactory) deploymentFactory
-					.newInstance();
-			dfm.registerDeploymentFactory(deploymentFactoryInstance);
-		} catch (IOException e) {
-			e.printStackTrace();
-		} catch (ClassNotFoundException e) {
-			e.printStackTrace();
-		} catch (InstantiationException e) {
-			e.printStackTrace();
-		} catch (IllegalAccessException e) {
-			e.printStackTrace();
-		}
-	}
-
-	public DeploymentManager getDeploymentManager() throws DeploymentManagerCreationException {
-
-		if (dm == null) {
-			discoverDeploymentFactory();
-			if (dfm != null) {
-				dm = dfm.getDeploymentManager(DEFAULT_URI, getUserName(), getPassword());
-			} else {
-				DeploymentFactory df = new DeploymentFactoryImpl();
-				dm = df.getDeploymentManager(DEFAULT_URI, getUserName(), getPassword());
-			}
-		}
-		return dm;
-	}
-
-	private String getUserName() {
-		return "system";
-	}
-
-	private String getPassword() {
-		return "manager";
-	}
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.wst.server.core.model.ServerBehaviourDelegate#stop(boolean)
-	 */
-	public void stop(boolean force) {
-	               
-		if (getKernel() != null) {
-            //lets shutdown the kernel so shutdown messages are displayed in the console view
-			kernel.shutdown();
-		}
-
-		dm = null;
-		kernel = null;
-        
-		//kill the process
-		super.stop(true);
-	}
-
-	private Kernel getKernel() {
-
-		int tries = MAX_TRIES;
-
-		if (kernel == null) {
-
-			Map map = new HashMap();
-			map.put("jmx.remote.credentials", new String[] { getUserName(), getPassword() });
-			try {
-				JMXServiceURL address = new JMXServiceURL(
-						"service:jmx:rmi://localhost/jndi/rmi:/JMXConnector");
-				do {
-					try {
-
-						JMXConnector jmxConnector = JMXConnectorFactory.connect(address, map);
-						MBeanServerConnection mbServerConnection = jmxConnector
-								.getMBeanServerConnection();
-						kernel = new KernelDelegate(mbServerConnection);
-						Trace.trace("Connected to kernel.");
-						break;
-					} catch (Exception e) {
-						Thread.sleep(3000);
-						tries--;
-						if (tries != 0) {
-                            Trace.trace(Trace.WARNING,"Couldn't connect to kernel.  Trying again...");
-						} else {
-                            Trace.trace(Trace.SEVERE,"Connection to Geronimo kernel failed.", e);
-						}
-					}
-				} while (tries > 0);
-			} catch (MalformedURLException e) {
-				e.printStackTrace();
-			} catch (InterruptedException e) {
-				e.printStackTrace();
-			}
-		}
-
-		return kernel;
-	}
-
-	protected void setServerStarted() {
-
-		boolean started = false;
-
-		try {
-			ObjectName configName = Configuration.getConfigurationObjectName(new URI(
-					J2EE_DEPLOYER_ID));
-
-			for (int tries = MAX_TRIES; tries > 0 && !started; tries--) {
-				try {
-					if (getKernel() != null) {
-						if (kernel.getGBeanState(configName) == 1) {
-							started = true;
-                            setServerState(IServer.STATE_STARTED);
-							Trace.trace("RuntimeDeployer has started.");
-						} else {
-							Trace.trace("RuntimeDeployer has not yet started.");
-						}
-					}
-				} catch (InternalKernelException e) {
-				} catch (GBeanNotFoundException e) {
-				}
-				Thread.sleep(2000);
-			}
-		} catch (MalformedObjectNameException e) {
-			e.printStackTrace();
-		} catch (URISyntaxException e) {
-			e.printStackTrace();
-		} catch (InterruptedException e) {
-			e.printStackTrace();
-		}
-		
-		if (!started) {
-			Trace.trace(Trace.SEVERE, "Runtime deployer failed to start.");
-		}		
-
-	}
-
-	public void publishModule(int kind, int deltaKind, IModule[] module, IProgressMonitor monitor)
-			throws CoreException {
-
-		_monitor = monitor;
-
-		// Can only publish when the server is running
-		int state = getServer().getServerState();
-		if (state == IServer.STATE_STOPPED || state == IServer.STATE_STOPPING) {
-			throw new CoreException(Status.CANCEL_STATUS);
-		}
-
-		if (state == IServer.STATE_STARTING) {
-			int timeout = 25;
-			while (getServer().getServerState() == IServer.STATE_STARTING) {
-				if (--timeout == 0)
-					throw new CoreException(Status.CANCEL_STATUS);
-				try {
-					Thread.sleep(1000);
-				} catch (InterruptedException e) {
-					e.printStackTrace();
-				}
-			}
-		}
-
-		if (deltaKind == NO_CHANGE) // Temporary workaround for WTP server tools
-			// bug
-			deltaKind = CHANGED;
-
-		if (!(deltaKind == ADDED || deltaKind == REMOVED || deltaKind == CHANGED))
-			return;
-
-		invokeCommand(deltaKind, module[module.length - 1]);
-	}
-
-	class WaitForNotificationThread extends Thread {
-		public void run() {
-			try {
-				sleep(TIMEOUT);
-			} catch (InterruptedException e) {
-			}
-		}
-	}
-
-	class GeronimoDeploymentProgressListener implements ProgressListener {
-
-		private Thread waitThread;
-
-		private CommandType cmd = null;
-
-		private IProject project = null;
-
-		public String lastMessage = null;
-
-		public GeronimoDeploymentProgressListener() {
-			waitThread = new WaitForNotificationThread();
-		}
-
-		public void handleProgressEvent(ProgressEvent event) {
-			String message = DeploymentStatusMessageTranslator.getTranslatedMessage(event, project);			
-			if (!message.equals(lastMessage)) {
-                _monitor.setTaskName(message);
-				Trace.trace(message);
-			}
-			lastMessage = message;
-			DeploymentStatus status = event.getDeploymentStatus();
-			if (status.getMessage() != null) {
-				Trace.trace("\t" + status.getMessage());
-				_monitor.subTask(status.getMessage());
-			}
-			if (cmd == null || cmd == status.getCommand()) {
-				if (status.isCompleted() || status.isFailed()) {
-					waitThread.interrupt();
-				}
-			}
-		}
-
-		public void start() {
-			waitThread.start();
-		}
-
-		public void setType(CommandType cmd) {
-			this.cmd = cmd;
-		}
-
-		public Thread getWaitThread() {
-			return waitThread;
-		}
-
-		public void setProject(IProject project) {
-			this.project = project;
-		}
-	}
-
-	private void waitForCompletion(ProgressObject po, GeronimoDeploymentProgressListener listener,
-			CommandType cmd, IProject project) {
-
-		listener.setType(cmd);
-		listener.setProject(project);
-
-		po.addProgressListener(listener);
-
-		try {
-			listener.getWaitThread().join();
-		} catch (InterruptedException e) {
-
-		} finally {
-			po.removeProgressListener(listener);
-		}
-	}
-
-	private void invokeCommand(int deltaKind, IModule module) throws CoreException {
-
-		GeronimoUtils.getConfigId(module); //triggers web dp creation
-
-		GeronimoUtils.copyDeploymentPlanToDeployable(module); // Temporary
-
-		try {
-			switch (deltaKind) {
-			case ADDED: {
-				doDeploy(module);
-				break;
-			}
-			case CHANGED: {
-				doReploy(module);
-				break;
-			}
-			case REMOVED: {
-				doUndeploy(module);
-				break;
-			}
-			default:
-				throw new IllegalArgumentException();
-			}
-		}  catch (DeploymentManagerCreationException e) {			
-			e.printStackTrace();
-			throw new CoreException(new Status(IStatus.ERROR, "org.eclipse.jst.geronimo.core", 0,e.getMessage(), e));
-		}
-	}
-
-	private void doDeploy(IModule module) throws CoreException, DeploymentManagerCreationException {
-
-		IJ2EEModule j2eeModule = (IJ2EEModule) module.loadAdapter(IJ2EEModule.class, null);
-
-		Target[] targets = getDeploymentManager().getTargets();
-		File jarFile = createJarFile(j2eeModule.getLocation());
-
-		GeronimoDeploymentProgressListener listener = createAndStartListener();
-
-		ProgressObject po = getDeploymentManager().distribute(targets, jarFile, null);
-		waitForCompletion(po, listener, CommandType.DISTRIBUTE, module.getProject());
-
-		if (po.getDeploymentStatus().isCompleted()) {
-
-			listener = createAndStartListener();
-
-			po = getDeploymentManager().start(po.getResultTargetModuleIDs());
-			waitForCompletion(po, listener, CommandType.START, module.getProject());
-
-			if (po.getDeploymentStatus().isCompleted()) {
-
-			} else if (po.getDeploymentStatus().isFailed()) {
-				// TODO handle fail
-			}
-		} else if (po.getDeploymentStatus().isFailed()) {
-			IStatus status = new Status(IStatus.ERROR, "org.eclipse.jst.geronimo.core", 0, "Distribution of application failed.  See .log for details.", new Exception(listener.lastMessage));
-			throw new CoreException(status);
-		}
-	}
-
-	private void doReploy(IModule module) throws CoreException, DeploymentManagerCreationException{
-
-		IJ2EEModule j2eeModule = (IJ2EEModule) module.loadAdapter(IJ2EEModule.class, null);
-
-		TargetModuleID id = getTargetModuleID(module);
-		if (id != null) {
-			File jarFile = createJarFile(j2eeModule.getLocation());
-			GeronimoDeploymentProgressListener listener = createAndStartListener();
-			ProgressObject po = getDeploymentManager().redeploy(new TargetModuleID[] { id },
-					jarFile, null);
-			waitForCompletion(po, listener, CommandType.REDEPLOY, module.getProject());
-			if (po.getDeploymentStatus().isCompleted()) {
-
-			} else if (po.getDeploymentStatus().isFailed()) {
-				// TODO handle fail
-			}
-		}
-	}
-
-	private void doUndeploy(IModule module) throws CoreException, DeploymentManagerCreationException {
-		TargetModuleID id = getTargetModuleID(module);
-		if (id != null) {
-			GeronimoDeploymentProgressListener listener = createAndStartListener();
-			ProgressObject po = getDeploymentManager().undeploy(new TargetModuleID[] { id });
-			waitForCompletion(po, listener, CommandType.UNDEPLOY, module.getProject());
-			if (po.getDeploymentStatus().isCompleted()) {
-
-			} else if (po.getDeploymentStatus().isFailed()) {
-				// TODO handle fail
-			}
-		}
-	}
-
-	private GeronimoDeploymentProgressListener createAndStartListener() {
-		GeronimoDeploymentProgressListener listener = new GeronimoDeploymentProgressListener();
-		listener.start();
-		return listener;
-	}
-
-	// TODO find a better way to get TargetModuleID for IModule
-	private TargetModuleID getTargetModuleID(IModule module) throws DeploymentManagerCreationException {
-		try {
-			TargetModuleID ids[] = getDeploymentManager().getAvailableModules(
-					GeronimoUtils.getJSR88ModuleType(module), getDeploymentManager().getTargets());
-			if (ids != null) {
-				for (int i = 0; i < ids.length; i++) {
-					if (ids[i].getModuleID().equals(GeronimoUtils.getConfigId(module))) {
-						return ids[i];
-					}
-				}
-			}
-		} catch (IllegalStateException e) {
-			e.printStackTrace();
-		} catch (TargetException e) {
-			e.printStackTrace();
-		}
-		return null;
-	}
-
-	private File createJarFile(IPath location) {
-
-		try {
-
-			String rootFilename = location.toOSString();
-
-			File rootDir = new File(rootFilename);
-			String zipFilePrefix = rootDir.getName();
-			if (zipFilePrefix.length() < 3)
-				zipFilePrefix += "123";
-			File zipFile = File.createTempFile(zipFilePrefix, null);
-
-			if (zipFile.exists())
-				zipFile.delete();
-
-			FileOutputStream fos = new FileOutputStream(zipFile);
-			JarOutputStream jos = new JarOutputStream(fos);
-
-			addToJar("", rootDir, jos);
-
-			jos.close();
-			fos.close();
-
-			zipFile.deleteOnExit();
-
-			return zipFile;
-
-		} catch (IOException e) {
-			Trace.trace(Trace.SEVERE, "Error creating zip file", e);
-			return null;
-		}
-	}
-
-	private void addToJar(String namePrefix, File dir, JarOutputStream jos) throws IOException {
-		File[] contents = dir.listFiles();
-		for (int i = 0; i < contents.length; i++) {
-			File f = contents[i];
-			if (f.isDirectory()) {
-				// Recurse into the directory
-				addToJar(namePrefix + f.getName() + "/", f, jos);
-			} else {
-				JarEntry entry = new JarEntry(namePrefix + f.getName());
-				jos.putNextEntry(entry);
-
-				byte[] buffer = new byte[10000];
-				FileInputStream fis = new FileInputStream(f);
-				int bytesRead = 0;
-				while (bytesRead != -1) {
-					bytesRead = fis.read(buffer);
-					if (bytesRead > 0)
-						jos.write(buffer, 0, bytesRead);
-				}
-			}
-		}
-	}
-
-	protected List getPublishClasspath() {
-		String cpRef = getServerDefinition().getStop().getClasspathReference();
-		return serverClasspath(cpRef);
-	}
-
-	public Map getServerInstanceProperties() {
-		return getRuntimeDelegate().getServerInstanceProperties();
-	}
-
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.core.internal;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.jar.Attributes;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+import java.util.jar.JarOutputStream;
+
+import javax.enterprise.deploy.shared.CommandType;
+import javax.enterprise.deploy.shared.factories.DeploymentFactoryManager;
+import javax.enterprise.deploy.spi.DeploymentManager;
+import javax.enterprise.deploy.spi.Target;
+import javax.enterprise.deploy.spi.TargetModuleID;
+import javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException;
+import javax.enterprise.deploy.spi.exceptions.TargetException;
+import javax.enterprise.deploy.spi.factories.DeploymentFactory;
+import javax.enterprise.deploy.spi.status.DeploymentStatus;
+import javax.enterprise.deploy.spi.status.ProgressEvent;
+import javax.enterprise.deploy.spi.status.ProgressListener;
+import javax.enterprise.deploy.spi.status.ProgressObject;
+import javax.management.MBeanServerConnection;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.management.remote.JMXConnector;
+import javax.management.remote.JMXConnectorFactory;
+import javax.management.remote.JMXServiceURL;
+
+import org.apache.geronimo.deployment.plugin.factories.DeploymentFactoryImpl;
+import org.apache.geronimo.kernel.GBeanNotFoundException;
+import org.apache.geronimo.kernel.InternalKernelException;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.jmx.KernelDelegate;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jst.server.core.IJ2EEModule;
+import org.eclipse.jst.server.generic.core.internal.GenericServerBehaviour;
+import org.eclipse.jst.server.generic.core.internal.Trace;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+
+public class GeronimoServerBehaviour extends GenericServerBehaviour {
+
+	private final static String DEFAULT_URI = "deployer:geronimo:jmx:rmi://localhost/jndi/rmi:/JMXConnector";
+
+	private final static String J2EE_DEPLOYER_ID = "org/apache/geronimo/RuntimeDeployer";
+    
+    private static final int MAX_TRIES = 10;
+    
+    private static final long TIMEOUT = 100000;
+
+	private DeploymentFactoryManager dfm = null;
+
+	private DeploymentManager dm = null;
+
+	private IProgressMonitor _monitor = null;
+
+	private Kernel kernel = null;
+
+	public GeronimoServerBehaviour() {
+		super();
+	}
+
+	private void discoverDeploymentFactory() {
+
+		try {
+			JarFile deployerJar = new JarFile(getServer().getRuntime().getLocation().append(
+					"/deployer.jar").toFile());
+			java.util.jar.Manifest manifestFile = deployerJar.getManifest();
+			Attributes attributes = manifestFile.getMainAttributes();
+			String key = "J2EE-DeploymentFactory-Implementation-Class";
+			String className = attributes.getValue(key);
+			dfm = DeploymentFactoryManager.getInstance();
+			Class deploymentFactory = Class.forName(className);
+			DeploymentFactory deploymentFactoryInstance = (DeploymentFactory) deploymentFactory
+					.newInstance();
+			dfm.registerDeploymentFactory(deploymentFactoryInstance);
+		} catch (IOException e) {
+			e.printStackTrace();
+		} catch (ClassNotFoundException e) {
+			e.printStackTrace();
+		} catch (InstantiationException e) {
+			e.printStackTrace();
+		} catch (IllegalAccessException e) {
+			e.printStackTrace();
+		}
+	}
+
+	public DeploymentManager getDeploymentManager() throws DeploymentManagerCreationException {
+
+		if (dm == null) {
+			discoverDeploymentFactory();
+			if (dfm != null) {
+				dm = dfm.getDeploymentManager(DEFAULT_URI, getUserName(), getPassword());
+			} else {
+				DeploymentFactory df = new DeploymentFactoryImpl();
+				dm = df.getDeploymentManager(DEFAULT_URI, getUserName(), getPassword());
+			}
+		}
+		return dm;
+	}
+
+	private String getUserName() {
+		return "system";
+	}
+
+	private String getPassword() {
+		return "manager";
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.wst.server.core.model.ServerBehaviourDelegate#stop(boolean)
+	 */
+	public void stop(boolean force) {
+	               
+		if (getKernel() != null) {
+            //lets shutdown the kernel so shutdown messages are displayed in the console view
+			kernel.shutdown();
+		}
+
+		dm = null;
+		kernel = null;
+        
+		//kill the process
+		super.stop(true);
+	}
+
+	private Kernel getKernel() {
+
+		int tries = MAX_TRIES;
+
+		if (kernel == null) {
+
+			Map map = new HashMap();
+			map.put("jmx.remote.credentials", new String[] { getUserName(), getPassword() });
+			try {
+				JMXServiceURL address = new JMXServiceURL(
+						"service:jmx:rmi://localhost/jndi/rmi:/JMXConnector");
+				do {
+					try {
+
+						JMXConnector jmxConnector = JMXConnectorFactory.connect(address, map);
+						MBeanServerConnection mbServerConnection = jmxConnector
+								.getMBeanServerConnection();
+						kernel = new KernelDelegate(mbServerConnection);
+						Trace.trace("Connected to kernel.");
+						break;
+					} catch (Exception e) {
+						Thread.sleep(3000);
+						tries--;
+						if (tries != 0) {
+                            Trace.trace(Trace.WARNING,"Couldn't connect to kernel.  Trying again...");
+						} else {
+                            Trace.trace(Trace.SEVERE,"Connection to Geronimo kernel failed.", e);
+						}
+					}
+				} while (tries > 0);
+			} catch (MalformedURLException e) {
+				e.printStackTrace();
+			} catch (InterruptedException e) {
+				e.printStackTrace();
+			}
+		}
+
+		return kernel;
+	}
+
+	protected void setServerStarted() {
+
+		boolean started = false;
+
+		try {
+			ObjectName configName = Configuration.getConfigurationObjectName(new URI(
+					J2EE_DEPLOYER_ID));
+
+			for (int tries = MAX_TRIES; tries > 0 && !started; tries--) {
+				try {
+					if (getKernel() != null) {
+						if (kernel.getGBeanState(configName) == 1) {
+							started = true;
+                            setServerState(IServer.STATE_STARTED);
+							Trace.trace("RuntimeDeployer has started.");
+						} else {
+							Trace.trace("RuntimeDeployer has not yet started.");
+						}
+					}
+				} catch (InternalKernelException e) {
+				} catch (GBeanNotFoundException e) {
+				}
+				Thread.sleep(2000);
+			}
+		} catch (MalformedObjectNameException e) {
+			e.printStackTrace();
+		} catch (URISyntaxException e) {
+			e.printStackTrace();
+		} catch (InterruptedException e) {
+			e.printStackTrace();
+		}
+		
+		if (!started) {
+			Trace.trace(Trace.SEVERE, "Runtime deployer failed to start.");
+		}		
+
+	}
+
+	public void publishModule(int kind, int deltaKind, IModule[] module, IProgressMonitor monitor)
+			throws CoreException {
+
+		_monitor = monitor;
+
+		// Can only publish when the server is running
+		int state = getServer().getServerState();
+		if (state == IServer.STATE_STOPPED || state == IServer.STATE_STOPPING) {
+			throw new CoreException(Status.CANCEL_STATUS);
+		}
+
+		if (state == IServer.STATE_STARTING) {
+			int timeout = 25;
+			while (getServer().getServerState() == IServer.STATE_STARTING) {
+				if (--timeout == 0)
+					throw new CoreException(Status.CANCEL_STATUS);
+				try {
+					Thread.sleep(1000);
+				} catch (InterruptedException e) {
+					e.printStackTrace();
+				}
+			}
+		}
+
+		if (deltaKind == NO_CHANGE) // Temporary workaround for WTP server tools
+			// bug
+			deltaKind = CHANGED;
+
+		if (!(deltaKind == ADDED || deltaKind == REMOVED || deltaKind == CHANGED))
+			return;
+
+		invokeCommand(deltaKind, module[module.length - 1]);
+	}
+
+	class WaitForNotificationThread extends Thread {
+		public void run() {
+			try {
+				sleep(TIMEOUT);
+			} catch (InterruptedException e) {
+			}
+		}
+	}
+
+	class GeronimoDeploymentProgressListener implements ProgressListener {
+
+		private Thread waitThread;
+
+		private CommandType cmd = null;
+
+		private IProject project = null;
+
+		public String lastMessage = null;
+
+		public GeronimoDeploymentProgressListener() {
+			waitThread = new WaitForNotificationThread();
+		}
+
+		public void handleProgressEvent(ProgressEvent event) {
+			String message = DeploymentStatusMessageTranslator.getTranslatedMessage(event, project);			
+			if (!message.equals(lastMessage)) {
+                _monitor.setTaskName(message);
+				Trace.trace(message);
+			}
+			lastMessage = message;
+			DeploymentStatus status = event.getDeploymentStatus();
+			if (status.getMessage() != null) {
+				Trace.trace("\t" + status.getMessage());
+				_monitor.subTask(status.getMessage());
+			}
+			if (cmd == null || cmd == status.getCommand()) {
+				if (status.isCompleted() || status.isFailed()) {
+					waitThread.interrupt();
+				}
+			}
+		}
+
+		public void start() {
+			waitThread.start();
+		}
+
+		public void setType(CommandType cmd) {
+			this.cmd = cmd;
+		}
+
+		public Thread getWaitThread() {
+			return waitThread;
+		}
+
+		public void setProject(IProject project) {
+			this.project = project;
+		}
+	}
+
+	private void waitForCompletion(ProgressObject po, GeronimoDeploymentProgressListener listener,
+			CommandType cmd, IProject project) {
+
+		listener.setType(cmd);
+		listener.setProject(project);
+
+		po.addProgressListener(listener);
+
+		try {
+			listener.getWaitThread().join();
+		} catch (InterruptedException e) {
+
+		} finally {
+			po.removeProgressListener(listener);
+		}
+	}
+
+	private void invokeCommand(int deltaKind, IModule module) throws CoreException {
+
+		GeronimoUtils.getConfigId(module); //triggers web dp creation
+
+		GeronimoUtils.copyDeploymentPlanToDeployable(module); // Temporary
+
+		try {
+			switch (deltaKind) {
+			case ADDED: {
+				doDeploy(module);
+				break;
+			}
+			case CHANGED: {
+				doReploy(module);
+				break;
+			}
+			case REMOVED: {
+				doUndeploy(module);
+				break;
+			}
+			default:
+				throw new IllegalArgumentException();
+			}
+		}  catch (DeploymentManagerCreationException e) {			
+			e.printStackTrace();
+			throw new CoreException(new Status(IStatus.ERROR, "org.eclipse.jst.geronimo.core", 0,e.getMessage(), e));
+		}
+	}
+
+	private void doDeploy(IModule module) throws CoreException, DeploymentManagerCreationException {
+
+		IJ2EEModule j2eeModule = (IJ2EEModule) module.loadAdapter(IJ2EEModule.class, null);
+
+		Target[] targets = getDeploymentManager().getTargets();
+		File jarFile = createJarFile(j2eeModule.getLocation());
+
+		GeronimoDeploymentProgressListener listener = createAndStartListener();
+
+		ProgressObject po = getDeploymentManager().distribute(targets, jarFile, null);
+		waitForCompletion(po, listener, CommandType.DISTRIBUTE, module.getProject());
+
+		if (po.getDeploymentStatus().isCompleted()) {
+
+			listener = createAndStartListener();
+
+			po = getDeploymentManager().start(po.getResultTargetModuleIDs());
+			waitForCompletion(po, listener, CommandType.START, module.getProject());
+
+			if (po.getDeploymentStatus().isCompleted()) {
+
+			} else if (po.getDeploymentStatus().isFailed()) {
+				// TODO handle fail
+			}
+		} else if (po.getDeploymentStatus().isFailed()) {
+			IStatus status = new Status(IStatus.ERROR, "org.eclipse.jst.geronimo.core", 0, "Distribution of application failed.  See .log for details.", new Exception(listener.lastMessage));
+			throw new CoreException(status);
+		}
+	}
+
+	private void doReploy(IModule module) throws CoreException, DeploymentManagerCreationException{
+
+		IJ2EEModule j2eeModule = (IJ2EEModule) module.loadAdapter(IJ2EEModule.class, null);
+
+		TargetModuleID id = getTargetModuleID(module);
+		if (id != null) {
+			File jarFile = createJarFile(j2eeModule.getLocation());
+			GeronimoDeploymentProgressListener listener = createAndStartListener();
+			ProgressObject po = getDeploymentManager().redeploy(new TargetModuleID[] { id },
+					jarFile, null);
+			waitForCompletion(po, listener, CommandType.REDEPLOY, module.getProject());
+			if (po.getDeploymentStatus().isCompleted()) {
+
+			} else if (po.getDeploymentStatus().isFailed()) {
+				// TODO handle fail
+			}
+		}
+	}
+
+	private void doUndeploy(IModule module) throws CoreException, DeploymentManagerCreationException {
+		TargetModuleID id = getTargetModuleID(module);
+		if (id != null) {
+			GeronimoDeploymentProgressListener listener = createAndStartListener();
+			ProgressObject po = getDeploymentManager().undeploy(new TargetModuleID[] { id });
+			waitForCompletion(po, listener, CommandType.UNDEPLOY, module.getProject());
+			if (po.getDeploymentStatus().isCompleted()) {
+
+			} else if (po.getDeploymentStatus().isFailed()) {
+				// TODO handle fail
+			}
+		}
+	}
+
+	private GeronimoDeploymentProgressListener createAndStartListener() {
+		GeronimoDeploymentProgressListener listener = new GeronimoDeploymentProgressListener();
+		listener.start();
+		return listener;
+	}
+
+	// TODO find a better way to get TargetModuleID for IModule
+	private TargetModuleID getTargetModuleID(IModule module) throws DeploymentManagerCreationException {
+		try {
+			TargetModuleID ids[] = getDeploymentManager().getAvailableModules(
+					GeronimoUtils.getJSR88ModuleType(module), getDeploymentManager().getTargets());
+			if (ids != null) {
+				for (int i = 0; i < ids.length; i++) {
+					if (ids[i].getModuleID().equals(GeronimoUtils.getConfigId(module))) {
+						return ids[i];
+					}
+				}
+			}
+		} catch (IllegalStateException e) {
+			e.printStackTrace();
+		} catch (TargetException e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+
+	private File createJarFile(IPath location) {
+
+		try {
+
+			String rootFilename = location.toOSString();
+
+			File rootDir = new File(rootFilename);
+			String zipFilePrefix = rootDir.getName();
+			if (zipFilePrefix.length() < 3)
+				zipFilePrefix += "123";
+			File zipFile = File.createTempFile(zipFilePrefix, null);
+
+			if (zipFile.exists())
+				zipFile.delete();
+
+			FileOutputStream fos = new FileOutputStream(zipFile);
+			JarOutputStream jos = new JarOutputStream(fos);
+
+			addToJar("", rootDir, jos);
+
+			jos.close();
+			fos.close();
+
+			zipFile.deleteOnExit();
+
+			return zipFile;
+
+		} catch (IOException e) {
+			Trace.trace(Trace.SEVERE, "Error creating zip file", e);
+			return null;
+		}
+	}
+
+	private void addToJar(String namePrefix, File dir, JarOutputStream jos) throws IOException {
+		File[] contents = dir.listFiles();
+		for (int i = 0; i < contents.length; i++) {
+			File f = contents[i];
+			if (f.isDirectory()) {
+				// Recurse into the directory
+				addToJar(namePrefix + f.getName() + "/", f, jos);
+			} else {
+				JarEntry entry = new JarEntry(namePrefix + f.getName());
+				jos.putNextEntry(entry);
+
+				byte[] buffer = new byte[10000];
+				FileInputStream fis = new FileInputStream(f);
+				int bytesRead = 0;
+				while (bytesRead != -1) {
+					bytesRead = fis.read(buffer);
+					if (bytesRead > 0)
+						jos.write(buffer, 0, bytesRead);
+				}
+			}
+		}
+	}
+
+	protected List getPublishClasspath() {
+		String cpRef = getServerDefinition().getStop().getClasspathReference();
+		return serverClasspath(cpRef);
+	}
+
+	public Map getServerInstanceProperties() {
+		return getRuntimeDelegate().getServerInstanceProperties();
+	}
+
 }

Propchange: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/internal/GeronimoServerBehaviour.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/internal/GeronimoServerRuntimeTargetHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/internal/GeronimoServerRuntimeTargetHandler.java?rev=239937&r1=239936&r2=239937&view=diff
==============================================================================
--- geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/internal/GeronimoServerRuntimeTargetHandler.java (original)
+++ geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/internal/GeronimoServerRuntimeTargetHandler.java Wed Aug 24 14:34:34 2005
@@ -1,123 +1,123 @@
-/**
- * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
- *
- *  Licensed 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.core.internal;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jst.server.generic.core.internal.GenericServerRuntimeTargetHandler;
-import org.eclipse.jst.server.generic.core.internal.ServerTypeDefinitionUtil;
-import org.eclipse.jst.server.generic.servertype.definition.ArchiveType;
-import org.eclipse.jst.server.generic.servertype.definition.Classpath;
-import org.eclipse.jst.server.generic.servertype.definition.ServerRuntime;
-import org.eclipse.wst.server.core.IRuntime;
-
-public class GeronimoServerRuntimeTargetHandler extends
-		GenericServerRuntimeTargetHandler {
-	
-	String cachedArchiveString=null;
-	IClasspathEntry[] cachedClasspath=null;
-	
-
-	/* (non-Javadoc)
-	 * @see ClasspathRuntimeTargetHandler#resolveClasspathContainer(IRuntime, java.lang.String)
-	 */
-	public IClasspathEntry[] resolveClasspathContainer(IRuntime runtime,String id){		
-		return getServerClassPathEntry(runtime);
-	}
-	
-	public IClasspathEntry[] getServerClassPathEntry(IRuntime runtime)
-	{
-		ServerRuntime serverDefinition = ServerTypeDefinitionUtil.getServerTypeDefinition(runtime);		
-		String ref = serverDefinition.getProject().getClasspathReference();
-		Classpath cp = serverDefinition.getClasspath(ref);
-		List archives = cp.getArchive();
-		
-		// It's expensive to keep searching directories, so try to cache the result
-		IClasspathEntry[] savedClasspath=getCachedClasspathFor(serverDefinition, archives);
-		if(savedClasspath!=null)
-			return savedClasspath;
-		
-		Iterator archiveIter = archives.iterator();
-		ArrayList entryList = new ArrayList();
-		while (archiveIter.hasNext()) {
-			ArchiveType archive = (ArchiveType) archiveIter.next();
-			String item = serverDefinition.getResolver().resolveProperties(archive.getPath());
-			Path path=new Path(item);
-			File file=path.toFile();
-			if(file.isDirectory())
-			{
-				File[] list=file.listFiles();
-				for(int i=0; i<list.length; i++)
-				{
-					if(!list[i].isDirectory())
-					{
-						Path p=new Path(list[i].getAbsolutePath());
-						IClasspathEntry entry = JavaCore.newLibraryEntry(p,null,null );
-						entryList.add(entry);	
-					}					
-				}
-	
-			}
-			else
-			{
-				IClasspathEntry entry = JavaCore.newLibraryEntry(path,null,null );
-				entryList.add(entry);
-			}
-		}
-		
-		IClasspathEntry[] classpath=(IClasspathEntry[])entryList.toArray(new IClasspathEntry[entryList.size()]);
-		setCachedClasspath(classpath);
-
-		return classpath;
-	}
-
-	private IClasspathEntry[] getCachedClasspathFor(ServerRuntime serverDefinition, List archives) {
-		
-		// Need to iterate through the list, and expand the variables (in case they have changed)
-		// The simplest approach is to construct/cache a string for this
-		// That will still save the overhead of going to the filesystem
-		
-		StringBuffer buffer=new StringBuffer();
-		Iterator archiveIter = archives.iterator();
-		while (archiveIter.hasNext()) {
-			ArchiveType archive = (ArchiveType) archiveIter.next();
-			String item = serverDefinition.getResolver().resolveProperties(archive.getPath());
-			buffer.append(item);
-			buffer.append(File.pathSeparatorChar);
-		}
-		
-		String archiveString=buffer.toString();
-		
-		if(cachedArchiveString != null && cachedArchiveString.equals(archiveString))
-			return cachedClasspath;
-		
-		// This is a cache miss - ensure the data is null (to be safe), but save the key (archiveString) now
-		// The data will be set once it's calculated
-		cachedClasspath=null;
-		cachedArchiveString=archiveString;
-		return null;
-	}
-
-	private void setCachedClasspath(IClasspathEntry[] classpath) {
-		cachedClasspath=classpath;
-	}
-}
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.core.internal;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jst.server.generic.core.internal.GenericServerRuntimeTargetHandler;
+import org.eclipse.jst.server.generic.core.internal.ServerTypeDefinitionUtil;
+import org.eclipse.jst.server.generic.servertype.definition.ArchiveType;
+import org.eclipse.jst.server.generic.servertype.definition.Classpath;
+import org.eclipse.jst.server.generic.servertype.definition.ServerRuntime;
+import org.eclipse.wst.server.core.IRuntime;
+
+public class GeronimoServerRuntimeTargetHandler extends
+		GenericServerRuntimeTargetHandler {
+	
+	String cachedArchiveString=null;
+	IClasspathEntry[] cachedClasspath=null;
+	
+
+	/* (non-Javadoc)
+	 * @see ClasspathRuntimeTargetHandler#resolveClasspathContainer(IRuntime, java.lang.String)
+	 */
+	public IClasspathEntry[] resolveClasspathContainer(IRuntime runtime,String id){		
+		return getServerClassPathEntry(runtime);
+	}
+	
+	public IClasspathEntry[] getServerClassPathEntry(IRuntime runtime)
+	{
+		ServerRuntime serverDefinition = ServerTypeDefinitionUtil.getServerTypeDefinition(runtime);		
+		String ref = serverDefinition.getProject().getClasspathReference();
+		Classpath cp = serverDefinition.getClasspath(ref);
+		List archives = cp.getArchive();
+		
+		// It's expensive to keep searching directories, so try to cache the result
+		IClasspathEntry[] savedClasspath=getCachedClasspathFor(serverDefinition, archives);
+		if(savedClasspath!=null)
+			return savedClasspath;
+		
+		Iterator archiveIter = archives.iterator();
+		ArrayList entryList = new ArrayList();
+		while (archiveIter.hasNext()) {
+			ArchiveType archive = (ArchiveType) archiveIter.next();
+			String item = serverDefinition.getResolver().resolveProperties(archive.getPath());
+			Path path=new Path(item);
+			File file=path.toFile();
+			if(file.isDirectory())
+			{
+				File[] list=file.listFiles();
+				for(int i=0; i<list.length; i++)
+				{
+					if(!list[i].isDirectory())
+					{
+						Path p=new Path(list[i].getAbsolutePath());
+						IClasspathEntry entry = JavaCore.newLibraryEntry(p,null,null );
+						entryList.add(entry);	
+					}					
+				}
+	
+			}
+			else
+			{
+				IClasspathEntry entry = JavaCore.newLibraryEntry(path,null,null );
+				entryList.add(entry);
+			}
+		}
+		
+		IClasspathEntry[] classpath=(IClasspathEntry[])entryList.toArray(new IClasspathEntry[entryList.size()]);
+		setCachedClasspath(classpath);
+
+		return classpath;
+	}
+
+	private IClasspathEntry[] getCachedClasspathFor(ServerRuntime serverDefinition, List archives) {
+		
+		// Need to iterate through the list, and expand the variables (in case they have changed)
+		// The simplest approach is to construct/cache a string for this
+		// That will still save the overhead of going to the filesystem
+		
+		StringBuffer buffer=new StringBuffer();
+		Iterator archiveIter = archives.iterator();
+		while (archiveIter.hasNext()) {
+			ArchiveType archive = (ArchiveType) archiveIter.next();
+			String item = serverDefinition.getResolver().resolveProperties(archive.getPath());
+			buffer.append(item);
+			buffer.append(File.pathSeparatorChar);
+		}
+		
+		String archiveString=buffer.toString();
+		
+		if(cachedArchiveString != null && cachedArchiveString.equals(archiveString))
+			return cachedClasspath;
+		
+		// This is a cache miss - ensure the data is null (to be safe), but save the key (archiveString) now
+		// The data will be set once it's calculated
+		cachedClasspath=null;
+		cachedArchiveString=archiveString;
+		return null;
+	}
+
+	private void setCachedClasspath(IClasspathEntry[] classpath) {
+		cachedClasspath=classpath;
+	}
+}

Propchange: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/internal/GeronimoServerRuntimeTargetHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/internal/GeronimoUtils.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/internal/GeronimoUtils.java?rev=239937&r1=239936&r2=239937&view=diff
==============================================================================
--- geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/internal/GeronimoUtils.java (original)
+++ geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/internal/GeronimoUtils.java Wed Aug 24 14:34:34 2005
@@ -1,214 +1,214 @@
-/**
- * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
- *
- *  Licensed 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.core.internal;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-
-import javax.enterprise.deploy.shared.ModuleType;
-
-import org.apache.geronimo.xml.ns.web.DocumentRoot;
-import org.apache.geronimo.xml.ns.web.WebAppType;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.emf.ecore.xmi.XMIResource;
-import org.eclipse.jst.j2ee.internal.deployables.J2EEFlexProjDeployable;
-import org.eclipse.jst.server.core.IJ2EEModule;
-import org.eclipse.jst.server.core.IWebModule;
-import org.eclipse.wst.common.componentcore.ArtifactEdit;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IFlexibleProject;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.server.core.IModule;
-
-public class GeronimoUtils {
-
-	public static String getConfigId(IModule module) {
-
-		String configId = null;
-
-		if (isWebModule(module)) {			
-			WebAppType deploymentPlan = getWebDeploymentPlan(module);
-
-			if (deploymentPlan != null)
-				configId = deploymentPlan.getConfigId();
-
-			if (configId == null)
-				configId = getId(module);
-		} else if (isEjbJarModule(module)) {
-			configId = getId(module);
-		}
-
-		return configId;
-	}
-
-	public static boolean isWebModule(IModule module) {
-		return "j2ee.web".equals(module.getModuleType().getId());
-	}
-
-	public static boolean isEjbJarModule(IModule module) {
-		return "j2ee.ejb".equals(module.getModuleType().getId());
-	}
-
-	public static ModuleType getJSR88ModuleType(IModule module) {
-		if (isWebModule(module)) {
-			return ModuleType.WAR;
-		} else if (isEjbJarModule(module)) {
-			return ModuleType.EJB;
-		}
-		return null;
-	}
-
-	public static String getContextRoot(IModule module) {
-		String contextRoot = null;
-		
-		WebAppType deploymentPlan = getWebDeploymentPlan(module);
-		if (deploymentPlan != null)
-			contextRoot = deploymentPlan.getContextRoot();
-
-		if (contextRoot == null)
-			contextRoot = getId(module);
-
-		return contextRoot;
-	}
-
-	public static String getId(IModule module) {
-		// use the module ID
-		String moduleId = module.getId();
-
-		IJ2EEModule j2eeModule = (IJ2EEModule) module.loadAdapter(IJ2EEModule.class, null);
-		if (j2eeModule != null && j2eeModule instanceof J2EEFlexProjDeployable) {
-			J2EEFlexProjDeployable j2eeFlex = (J2EEFlexProjDeployable) j2eeModule;
-			// j2eeFlex
-			ArtifactEdit edit = null;
-
-			try {
-				edit = ArtifactEdit.getArtifactEditForRead(j2eeFlex.getComponentHandle());
-				XMIResource res = (XMIResource) edit.getContentModelRoot().eResource();
-				moduleId = res.getID(edit.getContentModelRoot());
-			} finally {
-				if (edit != null)
-					edit.dispose();
-			}
-		}
-
-		if (moduleId != null && moduleId.length() > 0)
-			return moduleId;
-
-		// ...but if there is no defined module ID, pick the best alternative
-
-		IPath moduleLocation = j2eeModule.getLocation();
-		if (moduleLocation != null) {
-			moduleId = moduleLocation.removeFileExtension().lastSegment();
-		}
-
-		if (j2eeModule instanceof IWebModule) {
-			// A better choice is to use the context root
-			// For wars most appservers use the module name
-			// as the context root
-			String contextRoot = ((IWebModule) j2eeModule).getContextRoot();
-			if (contextRoot.charAt(0) == '/')
-				moduleId = contextRoot.substring(1);
-		}
-
-		return moduleId;
-	}
-
-	// Temporary workaround - ensure the .deployable copy
-	// of the file is also updated (WTP should be doing this)
-	public static void copyDeploymentPlanToDeployable(IModule module) {
-		IFile planFile = DeploymentPlanCreationOperation.getGeronimoWebDeploymentPlanFile(module);
-		if (planFile.exists()) {
-			try {
-				IJ2EEModule j2eeModule = (IJ2EEModule) module.loadAdapter(IJ2EEModule.class, null);
-				File deployableFile = j2eeModule.getLocation().addTrailingSeparator().append(
-						"WEB-INF").addTrailingSeparator().append(DeploymentPlanCreationOperation.WEB_DEP_PLAN_NAME).toFile();
-				InputStream input = planFile.getContents();
-				FileOutputStream output = new FileOutputStream(deployableFile);
-				byte[] buffer = new byte[1000];
-				int bytesRead = 0;
-				while (bytesRead > -1) {
-					bytesRead = input.read(buffer);
-					if (bytesRead > 0)
-						output.write(buffer, 0, bytesRead);
-				}
-				output.close();
-				input.close();
-			} catch (Exception e) {
-				Trace.trace(Trace.SEVERE, "Error copying deployment plan", e);
-			}
-		}
-	}
-
-	private static Resource load(IFile dpFile) {
-		try {
-			ResourceSet resourceSet = new ResourceSetImpl();
-            DeploymentPlanCreationOperation.registerForWeb(resourceSet);
-				
-			URI uri = URI.createPlatformResourceURI(dpFile.getFullPath().toString());
-			
-			Resource resource = resourceSet.createResource(uri);
-			if (!resource.isLoaded()) {
-				resource.load(null);
-			}
-			return resource;
-		} catch (MalformedURLException e) {
-			e.printStackTrace();
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-		return null;
-	}
-    
-    public static WebAppType getWebDeploymentPlan(IFile dpFile) {       
-        if (dpFile.exists()) {
-            Resource resource = load(dpFile);
-            if (resource != null) {
-                return ((DocumentRoot) resource.getContents().get(0)).getWebApp();
-            }
-        } 
-        return null;
-    }
-
-	private static WebAppType getWebDeploymentPlan(IModule module) {
-        IFile dpFile = DeploymentPlanCreationOperation.getGeronimoWebDeploymentPlanFile(module);
-		if (dpFile.exists()) {
-			Resource resource = load(dpFile);
-			if (resource != null) {
-				return ((DocumentRoot) resource.getContents().get(0)).getWebApp();
-			}
-		} else {
-			if (module != null) {
-				return createWebDeploymentPlan(module);
-			}
-		}
-		return null;
-	}
-    
-    private static WebAppType createWebDeploymentPlan(IModule module) {
-        IFlexibleProject flexProject = ComponentCore.createFlexibleProject(module.getProject());
-        IVirtualComponent component = flexProject.getComponent(module.getName());
-        DeploymentPlanCreationOperation op = new DeploymentPlanCreationOperation();
-        return op.createGeronimoWebDeploymentPlan(component);
-    }
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.core.internal;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+
+import javax.enterprise.deploy.shared.ModuleType;
+
+import org.apache.geronimo.xml.ns.web.DocumentRoot;
+import org.apache.geronimo.xml.ns.web.WebAppType;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.xmi.XMIResource;
+import org.eclipse.jst.j2ee.internal.deployables.J2EEFlexProjDeployable;
+import org.eclipse.jst.server.core.IJ2EEModule;
+import org.eclipse.jst.server.core.IWebModule;
+import org.eclipse.wst.common.componentcore.ArtifactEdit;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.resources.IFlexibleProject;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.server.core.IModule;
+
+public class GeronimoUtils {
+
+	public static String getConfigId(IModule module) {
+
+		String configId = null;
+
+		if (isWebModule(module)) {			
+			WebAppType deploymentPlan = getWebDeploymentPlan(module);
+
+			if (deploymentPlan != null)
+				configId = deploymentPlan.getConfigId();
+
+			if (configId == null)
+				configId = getId(module);
+		} else if (isEjbJarModule(module)) {
+			configId = getId(module);
+		}
+
+		return configId;
+	}
+
+	public static boolean isWebModule(IModule module) {
+		return "j2ee.web".equals(module.getModuleType().getId());
+	}
+
+	public static boolean isEjbJarModule(IModule module) {
+		return "j2ee.ejb".equals(module.getModuleType().getId());
+	}
+
+	public static ModuleType getJSR88ModuleType(IModule module) {
+		if (isWebModule(module)) {
+			return ModuleType.WAR;
+		} else if (isEjbJarModule(module)) {
+			return ModuleType.EJB;
+		}
+		return null;
+	}
+
+	public static String getContextRoot(IModule module) {
+		String contextRoot = null;
+		
+		WebAppType deploymentPlan = getWebDeploymentPlan(module);
+		if (deploymentPlan != null)
+			contextRoot = deploymentPlan.getContextRoot();
+
+		if (contextRoot == null)
+			contextRoot = getId(module);
+
+		return contextRoot;
+	}
+
+	public static String getId(IModule module) {
+		// use the module ID
+		String moduleId = module.getId();
+
+		IJ2EEModule j2eeModule = (IJ2EEModule) module.loadAdapter(IJ2EEModule.class, null);
+		if (j2eeModule != null && j2eeModule instanceof J2EEFlexProjDeployable) {
+			J2EEFlexProjDeployable j2eeFlex = (J2EEFlexProjDeployable) j2eeModule;
+			// j2eeFlex
+			ArtifactEdit edit = null;
+
+			try {
+				edit = ArtifactEdit.getArtifactEditForRead(j2eeFlex.getComponentHandle());
+				XMIResource res = (XMIResource) edit.getContentModelRoot().eResource();
+				moduleId = res.getID(edit.getContentModelRoot());
+			} finally {
+				if (edit != null)
+					edit.dispose();
+			}
+		}
+
+		if (moduleId != null && moduleId.length() > 0)
+			return moduleId;
+
+		// ...but if there is no defined module ID, pick the best alternative
+
+		IPath moduleLocation = j2eeModule.getLocation();
+		if (moduleLocation != null) {
+			moduleId = moduleLocation.removeFileExtension().lastSegment();
+		}
+
+		if (j2eeModule instanceof IWebModule) {
+			// A better choice is to use the context root
+			// For wars most appservers use the module name
+			// as the context root
+			String contextRoot = ((IWebModule) j2eeModule).getContextRoot();
+			if (contextRoot.charAt(0) == '/')
+				moduleId = contextRoot.substring(1);
+		}
+
+		return moduleId;
+	}
+
+	// Temporary workaround - ensure the .deployable copy
+	// of the file is also updated (WTP should be doing this)
+	public static void copyDeploymentPlanToDeployable(IModule module) {
+		IFile planFile = DeploymentPlanCreationOperation.getGeronimoWebDeploymentPlanFile(module);
+		if (planFile.exists()) {
+			try {
+				IJ2EEModule j2eeModule = (IJ2EEModule) module.loadAdapter(IJ2EEModule.class, null);
+				File deployableFile = j2eeModule.getLocation().addTrailingSeparator().append(
+						"WEB-INF").addTrailingSeparator().append(DeploymentPlanCreationOperation.WEB_DEP_PLAN_NAME).toFile();
+				InputStream input = planFile.getContents();
+				FileOutputStream output = new FileOutputStream(deployableFile);
+				byte[] buffer = new byte[1000];
+				int bytesRead = 0;
+				while (bytesRead > -1) {
+					bytesRead = input.read(buffer);
+					if (bytesRead > 0)
+						output.write(buffer, 0, bytesRead);
+				}
+				output.close();
+				input.close();
+			} catch (Exception e) {
+				Trace.trace(Trace.SEVERE, "Error copying deployment plan", e);
+			}
+		}
+	}
+
+	private static Resource load(IFile dpFile) {
+		try {
+			ResourceSet resourceSet = new ResourceSetImpl();
+            DeploymentPlanCreationOperation.registerForWeb(resourceSet);
+				
+			URI uri = URI.createPlatformResourceURI(dpFile.getFullPath().toString());
+			
+			Resource resource = resourceSet.createResource(uri);
+			if (!resource.isLoaded()) {
+				resource.load(null);
+			}
+			return resource;
+		} catch (MalformedURLException e) {
+			e.printStackTrace();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+    
+    public static WebAppType getWebDeploymentPlan(IFile dpFile) {       
+        if (dpFile.exists()) {
+            Resource resource = load(dpFile);
+            if (resource != null) {
+                return ((DocumentRoot) resource.getContents().get(0)).getWebApp();
+            }
+        } 
+        return null;
+    }
+
+	private static WebAppType getWebDeploymentPlan(IModule module) {
+        IFile dpFile = DeploymentPlanCreationOperation.getGeronimoWebDeploymentPlanFile(module);
+		if (dpFile.exists()) {
+			Resource resource = load(dpFile);
+			if (resource != null) {
+				return ((DocumentRoot) resource.getContents().get(0)).getWebApp();
+			}
+		} else {
+			if (module != null) {
+				return createWebDeploymentPlan(module);
+			}
+		}
+		return null;
+	}
+    
+    private static WebAppType createWebDeploymentPlan(IModule module) {
+        IFlexibleProject flexProject = ComponentCore.createFlexibleProject(module.getProject());
+        IVirtualComponent component = flexProject.getComponent(module.getName());
+        DeploymentPlanCreationOperation op = new DeploymentPlanCreationOperation();
+        return op.createGeronimoWebDeploymentPlan(component);
+    }
 }

Propchange: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/internal/GeronimoUtils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/internal/Messages.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/internal/Messages.java?rev=239937&r1=239936&r2=239937&view=diff
==============================================================================
--- geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/internal/Messages.java (original)
+++ geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/internal/Messages.java Wed Aug 24 14:34:34 2005
@@ -1,26 +1,26 @@
-/**
- * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
- *
- *  Licensed 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.core.internal;
-
-import org.eclipse.osgi.util.NLS;
-/**
- * Translated messages.
- */
-public class Messages extends NLS {
-	static {
-		NLS.initializeMessages(GeronimoPlugin.PLUGIN_ID + ".internal.Messages", Messages.class);
-	}
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.core.internal;
+
+import org.eclipse.osgi.util.NLS;
+/**
+ * Translated messages.
+ */
+public class Messages extends NLS {
+	static {
+		NLS.initializeMessages(GeronimoPlugin.PLUGIN_ID + ".internal.Messages", Messages.class);
+	}
 }

Propchange: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/internal/Messages.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/internal/Trace.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/internal/Trace.java?rev=239937&r1=239936&r2=239937&view=diff
==============================================================================
--- geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/internal/Trace.java (original)
+++ geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/internal/Trace.java Wed Aug 24 14:34:34 2005
@@ -1,78 +1,78 @@
-/**
- * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
- *
- *  Licensed 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.core.internal;
-/**
- * Helper class to route trace output.
- */
-public class Trace {
-	/**
-	 * Config trace event.
-	 */
-	public static byte CONFIG = 0;
-
-	/**
-	 * Warning trace event.
-	 */
-	public static byte WARNING = 1;
-
-	/**
-	 * Severe trace event.
-	 */
-	public static byte SEVERE = 2;
-
-	/**
-	 * Finest trace event.
-	 */
-	public static byte FINEST = 3;
-
-	/**
-	 * Parsing trace event.
-	 */
-	public static byte PARSING = 4;
-
-	/**
-	 * Trace constructor comment.
-	 */
-	private Trace() {
-		super();
-	}
-
-	/**
-	 * Trace the given text.
-	 *
-	 * @param level the trace level
-	 * @param s a message
-	 */
-	public static void trace(byte level, String s) {
-		trace(level, s, null);
-	}
-
-	/**
-	 * Trace the given message and exception.
-	 *
-	 * @param level the trace level
-	 * @param s a message
-	 * @param t a throwable
-	 */
-	public static void trace(byte level, String s, Throwable t) {
-		if (!GeronimoPlugin.getInstance().isDebugging())
-			return;
-
-		System.out.println(GeronimoPlugin.PLUGIN_ID + " " + s);
-		if (t != null)
-			t.printStackTrace();
-	}
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.core.internal;
+/**
+ * Helper class to route trace output.
+ */
+public class Trace {
+	/**
+	 * Config trace event.
+	 */
+	public static byte CONFIG = 0;
+
+	/**
+	 * Warning trace event.
+	 */
+	public static byte WARNING = 1;
+
+	/**
+	 * Severe trace event.
+	 */
+	public static byte SEVERE = 2;
+
+	/**
+	 * Finest trace event.
+	 */
+	public static byte FINEST = 3;
+
+	/**
+	 * Parsing trace event.
+	 */
+	public static byte PARSING = 4;
+
+	/**
+	 * Trace constructor comment.
+	 */
+	private Trace() {
+		super();
+	}
+
+	/**
+	 * Trace the given text.
+	 *
+	 * @param level the trace level
+	 * @param s a message
+	 */
+	public static void trace(byte level, String s) {
+		trace(level, s, null);
+	}
+
+	/**
+	 * Trace the given message and exception.
+	 *
+	 * @param level the trace level
+	 * @param s a message
+	 * @param t a throwable
+	 */
+	public static void trace(byte level, String s, Throwable t) {
+		if (!GeronimoPlugin.getInstance().isDebugging())
+			return;
+
+		System.out.println(GeronimoPlugin.PLUGIN_ID + " " + s);
+		if (t != null)
+			t.printStackTrace();
+	}
 }

Propchange: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/internal/Trace.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/operations/ExportDeploymentPlanDataModelProvider.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/operations/ExportDeploymentPlanOperation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.core/src/org/apache/geronimo/core/operations/IExportDeploymentPlanDataModelProperties.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.deployment.model/src/org/apache/geronimo/xml/model/GeronimoModelPlugin.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.deployment.model/src/org/apache/geronimo/xml/model/GeronimoModelPlugin.java?rev=239937&r1=239936&r2=239937&view=diff
==============================================================================
--- geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.deployment.model/src/org/apache/geronimo/xml/model/GeronimoModelPlugin.java (original)
+++ geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.deployment.model/src/org/apache/geronimo/xml/model/GeronimoModelPlugin.java Wed Aug 24 14:34:34 2005
@@ -1,106 +1,106 @@
-/**
- * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
- *
- *  Licensed 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.xml.model;
-
-import org.eclipse.emf.common.EMFPlugin;
-
-import org.eclipse.emf.common.util.ResourceLocator;
-
-/**
- * This is the central singleton for the Geronimo-web model plugin.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-public final class GeronimoModelPlugin extends EMFPlugin {
-    /**
-     * <!-- begin-user-doc -->
-     * <!-- end-user-doc -->
-     * @generated
-     */
-    public static final String copyright = "Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable.";
-
-    /**
-     * Keep track of the singleton.
-     * <!-- begin-user-doc -->
-     * <!-- end-user-doc -->
-     * @generated
-     */
-    public static final GeronimoModelPlugin INSTANCE = new GeronimoModelPlugin();
-
-    /**
-     * Keep track of the singleton.
-     * <!-- begin-user-doc -->
-     * <!-- end-user-doc -->
-     * @generated
-     */
-    private static Implementation plugin;
-
-    /**
-     * Create the instance.
-     * <!-- begin-user-doc -->
-     * <!-- end-user-doc -->
-     * @generated
-     */
-    public GeronimoModelPlugin() {
-        super(new ResourceLocator [] {});
-    }
-
-    /**
-     * Returns the singleton instance of the Eclipse plugin.
-     * <!-- begin-user-doc -->
-     * <!-- end-user-doc -->
-     * @return the singleton instance.
-     * @generated
-     */
-    public ResourceLocator getPluginResourceLocator() {
-        return plugin;
-    }
-
-    /**
-     * Returns the singleton instance of the Eclipse plugin.
-     * <!-- begin-user-doc -->
-     * <!-- end-user-doc -->
-     * @return the singleton instance.
-     * @generated
-     */
-    public static Implementation getPlugin() {
-        return plugin;
-    }
-
-    /**
-     * The actual implementation of the Eclipse <b>Plugin</b>.
-     * <!-- begin-user-doc -->
-     * <!-- end-user-doc -->
-     * @generated
-     */
-    public static class Implementation extends EclipsePlugin {
-        /**
-         * Creates an instance.
-         * <!-- begin-user-doc -->
-         * <!-- end-user-doc -->
-         * @generated
-         */
-        public Implementation() {
-            super();
-
-            // Remember the static instance.
-            //
-            plugin = this;
-        }
-    }
-
-}
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.xml.model;
+
+import org.eclipse.emf.common.EMFPlugin;
+
+import org.eclipse.emf.common.util.ResourceLocator;
+
+/**
+ * This is the central singleton for the Geronimo-web model plugin.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+public final class GeronimoModelPlugin extends EMFPlugin {
+    /**
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     * @generated
+     */
+    public static final String copyright = "Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable.";
+
+    /**
+     * Keep track of the singleton.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     * @generated
+     */
+    public static final GeronimoModelPlugin INSTANCE = new GeronimoModelPlugin();
+
+    /**
+     * Keep track of the singleton.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     * @generated
+     */
+    private static Implementation plugin;
+
+    /**
+     * Create the instance.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     * @generated
+     */
+    public GeronimoModelPlugin() {
+        super(new ResourceLocator [] {});
+    }
+
+    /**
+     * Returns the singleton instance of the Eclipse plugin.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     * @return the singleton instance.
+     * @generated
+     */
+    public ResourceLocator getPluginResourceLocator() {
+        return plugin;
+    }
+
+    /**
+     * Returns the singleton instance of the Eclipse plugin.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     * @return the singleton instance.
+     * @generated
+     */
+    public static Implementation getPlugin() {
+        return plugin;
+    }
+
+    /**
+     * The actual implementation of the Eclipse <b>Plugin</b>.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     * @generated
+     */
+    public static class Implementation extends EclipsePlugin {
+        /**
+         * Creates an instance.
+         * <!-- begin-user-doc -->
+         * <!-- end-user-doc -->
+         * @generated
+         */
+        public Implementation() {
+            super();
+
+            // Remember the static instance.
+            //
+            plugin = this;
+        }
+    }
+
+}

Propchange: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.deployment.model/src/org/apache/geronimo/xml/model/GeronimoModelPlugin.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.deployment.model/src/org/apache/geronimo/xml/ns/deployment/AttributeType.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.deployment.model/src/org/apache/geronimo/xml/ns/deployment/AttributeType.java?rev=239937&r1=239936&r2=239937&view=diff
==============================================================================
--- geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.deployment.model/src/org/apache/geronimo/xml/ns/deployment/AttributeType.java (original)
+++ geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.deployment.model/src/org/apache/geronimo/xml/ns/deployment/AttributeType.java Wed Aug 24 14:34:34 2005
@@ -1,120 +1,120 @@
-/**
- * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
- *
- *  Licensed 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.xml.ns.deployment;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Attribute Type</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- *   <li>{@link org.apache.geronimo.xml.ns.deployment.AttributeType#getValue <em>Value</em>}</li>
- *   <li>{@link org.apache.geronimo.xml.ns.deployment.AttributeType#getName <em>Name</em>}</li>
- *   <li>{@link org.apache.geronimo.xml.ns.deployment.AttributeType#getType <em>Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.apache.geronimo.xml.ns.deployment.DeploymentPackage#getAttributeType()
- * @model extendedMetaData="name='attributeType' kind='simple'"
- * @generated
- */
-public interface AttributeType extends EObject{
-    /**
-     * Returns the value of the '<em><b>Value</b></em>' attribute.
-     * <!-- begin-user-doc -->
-     * <p>
-     * If the meaning of the '<em>Value</em>' attribute isn't clear,
-     * there really should be more of a description here...
-     * </p>
-     * <!-- end-user-doc -->
-     * @return the value of the '<em>Value</em>' attribute.
-     * @see #setValue(String)
-     * @see org.apache.geronimo.xml.ns.deployment.DeploymentPackage#getAttributeType_Value()
-     * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
-     *        extendedMetaData="name=':0' kind='simple'"
-     * @generated
-     */
-    String getValue();
-
-    /**
-     * Sets the value of the '{@link org.apache.geronimo.xml.ns.deployment.AttributeType#getValue <em>Value</em>}' attribute.
-     * <!-- begin-user-doc -->
-     * <!-- end-user-doc -->
-     * @param value the new value of the '<em>Value</em>' attribute.
-     * @see #getValue()
-     * @generated
-     */
-    void setValue(String value);
-
-    /**
-     * Returns the value of the '<em><b>Name</b></em>' attribute.
-     * <!-- begin-user-doc -->
-     * <p>
-     * If the meaning of the '<em>Name</em>' attribute isn't clear,
-     * there really should be more of a description here...
-     * </p>
-     * <!-- end-user-doc -->
-     * @return the value of the '<em>Name</em>' attribute.
-     * @see #setName(String)
-     * @see org.apache.geronimo.xml.ns.deployment.DeploymentPackage#getAttributeType_Name()
-     * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
-     *        extendedMetaData="kind='attribute' name='name'"
-     * @generated
-     */
-    String getName();
-
-    /**
-     * Sets the value of the '{@link org.apache.geronimo.xml.ns.deployment.AttributeType#getName <em>Name</em>}' attribute.
-     * <!-- begin-user-doc -->
-     * <!-- end-user-doc -->
-     * @param value the new value of the '<em>Name</em>' attribute.
-     * @see #getName()
-     * @generated
-     */
-    void setName(String value);
-
-    /**
-     * Returns the value of the '<em><b>Type</b></em>' attribute.
-     * <!-- begin-user-doc -->
-     * <p>
-     * If the meaning of the '<em>Type</em>' attribute isn't clear,
-     * there really should be more of a description here...
-     * </p>
-     * <!-- end-user-doc -->
-     * @return the value of the '<em>Type</em>' attribute.
-     * @see #setType(String)
-     * @see org.apache.geronimo.xml.ns.deployment.DeploymentPackage#getAttributeType_Type()
-     * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
-     *        extendedMetaData="kind='attribute' name='type'"
-     * @generated
-     */
-    String getType();
-
-    /**
-     * Sets the value of the '{@link org.apache.geronimo.xml.ns.deployment.AttributeType#getType <em>Type</em>}' attribute.
-     * <!-- begin-user-doc -->
-     * <!-- end-user-doc -->
-     * @param value the new value of the '<em>Type</em>' attribute.
-     * @see #getType()
-     * @generated
-     */
-    void setType(String value);
-
-} // AttributeType
+/**
+ * Copyright 2004, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ *  Licensed 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.xml.ns.deployment;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Attribute Type</b></em>'.
+ * <!-- end-user-doc -->
+ *
+ * <p>
+ * The following features are supported:
+ * <ul>
+ *   <li>{@link org.apache.geronimo.xml.ns.deployment.AttributeType#getValue <em>Value</em>}</li>
+ *   <li>{@link org.apache.geronimo.xml.ns.deployment.AttributeType#getName <em>Name</em>}</li>
+ *   <li>{@link org.apache.geronimo.xml.ns.deployment.AttributeType#getType <em>Type</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @see org.apache.geronimo.xml.ns.deployment.DeploymentPackage#getAttributeType()
+ * @model extendedMetaData="name='attributeType' kind='simple'"
+ * @generated
+ */
+public interface AttributeType extends EObject{
+    /**
+     * Returns the value of the '<em><b>Value</b></em>' attribute.
+     * <!-- begin-user-doc -->
+     * <p>
+     * If the meaning of the '<em>Value</em>' attribute isn't clear,
+     * there really should be more of a description here...
+     * </p>
+     * <!-- end-user-doc -->
+     * @return the value of the '<em>Value</em>' attribute.
+     * @see #setValue(String)
+     * @see org.apache.geronimo.xml.ns.deployment.DeploymentPackage#getAttributeType_Value()
+     * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
+     *        extendedMetaData="name=':0' kind='simple'"
+     * @generated
+     */
+    String getValue();
+
+    /**
+     * Sets the value of the '{@link org.apache.geronimo.xml.ns.deployment.AttributeType#getValue <em>Value</em>}' attribute.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     * @param value the new value of the '<em>Value</em>' attribute.
+     * @see #getValue()
+     * @generated
+     */
+    void setValue(String value);
+
+    /**
+     * Returns the value of the '<em><b>Name</b></em>' attribute.
+     * <!-- begin-user-doc -->
+     * <p>
+     * If the meaning of the '<em>Name</em>' attribute isn't clear,
+     * there really should be more of a description here...
+     * </p>
+     * <!-- end-user-doc -->
+     * @return the value of the '<em>Name</em>' attribute.
+     * @see #setName(String)
+     * @see org.apache.geronimo.xml.ns.deployment.DeploymentPackage#getAttributeType_Name()
+     * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
+     *        extendedMetaData="kind='attribute' name='name'"
+     * @generated
+     */
+    String getName();
+
+    /**
+     * Sets the value of the '{@link org.apache.geronimo.xml.ns.deployment.AttributeType#getName <em>Name</em>}' attribute.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     * @param value the new value of the '<em>Name</em>' attribute.
+     * @see #getName()
+     * @generated
+     */
+    void setName(String value);
+
+    /**
+     * Returns the value of the '<em><b>Type</b></em>' attribute.
+     * <!-- begin-user-doc -->
+     * <p>
+     * If the meaning of the '<em>Type</em>' attribute isn't clear,
+     * there really should be more of a description here...
+     * </p>
+     * <!-- end-user-doc -->
+     * @return the value of the '<em>Type</em>' attribute.
+     * @see #setType(String)
+     * @see org.apache.geronimo.xml.ns.deployment.DeploymentPackage#getAttributeType_Type()
+     * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
+     *        extendedMetaData="kind='attribute' name='type'"
+     * @generated
+     */
+    String getType();
+
+    /**
+     * Sets the value of the '{@link org.apache.geronimo.xml.ns.deployment.AttributeType#getType <em>Type</em>}' attribute.
+     * <!-- begin-user-doc -->
+     * <!-- end-user-doc -->
+     * @param value the new value of the '<em>Type</em>' attribute.
+     * @see #getType()
+     * @generated
+     */
+    void setType(String value);
+
+} // AttributeType

Propchange: geronimo/trunk/sandbox/eclipse-plugin/org.apache.geronimo.deployment.model/src/org/apache/geronimo/xml/ns/deployment/AttributeType.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message