You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by sp...@apache.org on 2006/04/12 22:03:02 UTC
svn commit: r393587 [2/7] - in
/geronimo/devtools/eclipse-plugin/trunk/plugins:
org.apache.geronimo.st.core/ org.apache.geronimo.st.core/META-INF/
org.apache.geronimo.st.core/src/ org.apache.geronimo.st.core/src/org/
org.apache.geronimo.st.core/src/org...
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/PingThread.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/PingThread.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/PingThread.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/PingThread.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,75 @@
+/**
+ * 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.st.core;
+
+import org.apache.geronimo.st.core.internal.Trace;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.util.SocketUtil;
+
+public class PingThread extends Thread {
+
+ private static final int PING_DELAY = 5000;
+ private static final int PING_INTERVAL = 5000;
+ private static final int MAX_PINGS = 40;
+
+ private IGeronimoServerBehavior geronimoServer;
+ private IServer server;
+
+ public PingThread(IGeronimoServerBehavior geronimoServer, IServer server) {
+ super();
+ this.geronimoServer = geronimoServer;
+ this.server = server;
+ this.setDaemon(true);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Runnable#run()
+ */
+ public void run() {
+
+ if (!SocketUtil.isLocalhost(server.getHost())) {
+ return;
+ }
+
+ try {
+ sleep(PING_DELAY);
+ } catch (InterruptedException e) {
+ // ignore
+ }
+
+ for (int tries = MAX_PINGS; tries > 0; tries--) {
+
+ if (geronimoServer.isFullyStarted()) {
+ Trace.trace(Trace.INFO, "Ping: success");
+ geronimoServer.setServerStarted();
+ return;
+ }
+
+ Trace.trace(Trace.INFO, "Ping: failed");
+
+ try {
+ sleep(PING_INTERVAL);
+ } catch (InterruptedException e) {
+ // ignore
+ }
+ }
+
+ Trace.trace(Trace.SEVERE, "Ping: Can't ping for server startup.");
+ server.stop(false);
+ }
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/PingThread.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/PingThread.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/PingThread.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/UpdateServerStateTask.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/UpdateServerStateTask.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/UpdateServerStateTask.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/UpdateServerStateTask.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,86 @@
+/**
+ * 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.st.core;
+
+import java.util.TimerTask;
+
+import org.apache.geronimo.st.core.internal.Trace;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.internal.Server;
+
+public class UpdateServerStateTask extends TimerTask {
+
+ private IGeronimoServerBehavior delegate;
+ private IServer server;
+
+ public UpdateServerStateTask(IGeronimoServerBehavior delegate,
+ IServer server) {
+ super();
+ this.delegate = delegate;
+ this.server = server;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.util.TimerTask#run()
+ */
+ public void run() {
+ synchronized (delegate) {
+ Trace.trace(Trace.INFO, "--> UpdateServerStateTask.run() "
+ + server.getName());
+ try {
+ switch (server.getServerState()) {
+ case IServer.STATE_STOPPED:
+ if (delegate.isKernelAlive())
+ updateFromStopped();
+ break;
+ case IServer.STATE_STARTING:
+ if (delegate.isKernelAlive())
+ updateFromStarting();
+ else
+ delegate.setServerStopped();
+ break;
+ case IServer.STATE_STARTED:
+ updateFromStarted();
+ break;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ Trace.trace(Trace.INFO, "<-- UpdateServerStateTask.run() "
+ + server.getName());
+ }
+ }
+
+ private void updateFromStopped() {
+ if (delegate.isFullyStarted()) {
+ delegate.setServerStarted();
+ } else {
+ ((Server) server).setServerState(IServer.STATE_STARTING);
+ }
+ }
+
+ private void updateFromStarting() {
+ if (delegate.isFullyStarted())
+ delegate.setServerStopped();
+ }
+
+ private void updateFromStarted() {
+ if (!delegate.isFullyStarted())
+ delegate.setServerStopped();
+ }
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/UpdateServerStateTask.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/UpdateServerStateTask.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/UpdateServerStateTask.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/AbstractDeploymentCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/AbstractDeploymentCommand.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/AbstractDeploymentCommand.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/AbstractDeploymentCommand.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,41 @@
+/**
+ * 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.st.core.commands;
+
+import javax.enterprise.deploy.spi.DeploymentManager;
+
+import org.eclipse.wst.server.core.IModule;
+
+abstract class AbstractDeploymentCommand implements IDeploymentCommand {
+
+ private DeploymentManager dm;
+
+ private IModule module;
+
+ public AbstractDeploymentCommand(DeploymentManager dm, IModule module) {
+ super();
+ this.dm = dm;
+ this.module = module;
+ }
+
+ public DeploymentManager getDeploymentManager() {
+ return dm;
+ }
+
+ public IModule getModule() {
+ return module;
+ }
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/AbstractDeploymentCommand.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/AbstractDeploymentCommand.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/AbstractDeploymentCommand.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeploymentCmdStatus.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeploymentCmdStatus.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeploymentCmdStatus.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeploymentCmdStatus.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,127 @@
+/**
+ * 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.st.core.commands;
+
+import javax.enterprise.deploy.spi.TargetModuleID;
+import javax.enterprise.deploy.spi.status.ProgressObject;
+
+import org.eclipse.core.runtime.IStatus;
+
+public class DeploymentCmdStatus implements IStatus {
+
+ private IStatus status;
+
+ private ProgressObject po;
+
+ public DeploymentCmdStatus(IStatus status, ProgressObject po) {
+ super();
+ this.status = status;
+ this.po = po;
+ }
+
+ public ProgressObject getProgressObject() {
+ return po;
+ }
+
+ public TargetModuleID[] getResultTargetModuleIDs() {
+ if (po != null) {
+ return po.getResultTargetModuleIDs();
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.IStatus#getChildren()
+ */
+ public IStatus[] getChildren() {
+ return status.getChildren();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.IStatus#getCode()
+ */
+ public int getCode() {
+ return status.getCode();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.IStatus#getException()
+ */
+ public Throwable getException() {
+ return status.getException();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.IStatus#getMessage()
+ */
+ public String getMessage() {
+ return status.getMessage();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.IStatus#getPlugin()
+ */
+ public String getPlugin() {
+ return status.getPlugin();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.IStatus#getSeverity()
+ */
+ public int getSeverity() {
+ return status.getSeverity();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.IStatus#isMultiStatus()
+ */
+ public boolean isMultiStatus() {
+ return status.isMultiStatus();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.IStatus#isOK()
+ */
+ public boolean isOK() {
+ return status.isOK();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.runtime.IStatus#matches(int)
+ */
+ public boolean matches(int severityMask) {
+ return status.matches(severityMask);
+ }
+
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeploymentCmdStatus.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeploymentCmdStatus.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeploymentCmdStatus.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeploymentCommandFactory.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeploymentCommandFactory.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeploymentCommandFactory.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeploymentCommandFactory.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,112 @@
+/**
+ * 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.st.core.commands;
+
+import javax.enterprise.deploy.spi.DeploymentManager;
+import javax.enterprise.deploy.spi.TargetModuleID;
+import javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException;
+
+import org.apache.geronimo.st.core.Activator;
+import org.apache.geronimo.st.core.GeronimoConnectionFactory;
+import org.apache.geronimo.st.core.internal.Messages;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+
+/**
+ *
+ * This class provides static factory methods that return "synchronized" wrapper
+ * instances of JSR-88 deployment commands.
+ *
+ */
+public class DeploymentCommandFactory {
+
+ private DeploymentCommandFactory() {
+ }
+
+ /**
+ * @param module
+ * @param server
+ * @return
+ * @throws CoreException
+ */
+ public static IDeploymentCommand createDistributeCommand(IModule module,
+ IServer server) throws CoreException {
+ return new SynchronizedDeploymentOp(new DistributeCommand(module, getDeploymentManager(server)));
+ }
+
+ /**
+ * @param ids
+ * @param module
+ * @param server
+ * @return
+ * @throws CoreException
+ */
+ public static IDeploymentCommand createStartCommand(TargetModuleID[] ids,
+ IModule module, IServer server) throws CoreException {
+ return new SynchronizedDeploymentOp(new StartCommand(ids, module, getDeploymentManager(server)));
+ }
+
+ /**
+ * @param module
+ * @param server
+ * @return
+ * @throws CoreException
+ */
+ public static IDeploymentCommand createStopCommand(IModule module,
+ IServer server) throws CoreException {
+ return new SynchronizedDeploymentOp(new StopCommand(module, getDeploymentManager(server)));
+ }
+
+ /**
+ * @param module
+ * @param server
+ * @return
+ * @throws CoreException
+ */
+ public static IDeploymentCommand createRedeployCommand(IModule module,
+ IServer server) throws CoreException {
+ return new SynchronizedDeploymentOp(new RedeployCommand(module, getDeploymentManager(server)));
+ }
+
+ /**
+ * @param module
+ * @param server
+ * @return
+ * @throws CoreException
+ */
+ public static IDeploymentCommand createUndeployCommand(IModule module,
+ IServer server) throws CoreException {
+ return new SynchronizedDeploymentOp(new UndeployCommand(module, getDeploymentManager(server)));
+ }
+
+ /**
+ * @param server
+ * @return
+ * @throws CoreException
+ */
+ public static DeploymentManager getDeploymentManager(IServer server)
+ throws CoreException {
+ try {
+ return GeronimoConnectionFactory.getInstance().getDeploymentManager(server);
+ } catch (DeploymentManagerCreationException e) {
+ throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID, 0, Messages.DM_CONNECTION_FAIL, e));
+ }
+ }
+
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeploymentCommandFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeploymentCommandFactory.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DeploymentCommandFactory.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DistributeCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DistributeCommand.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DistributeCommand.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DistributeCommand.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,55 @@
+/**
+ * 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.st.core.commands;
+
+import java.io.File;
+
+import javax.enterprise.deploy.shared.CommandType;
+import javax.enterprise.deploy.spi.DeploymentManager;
+import javax.enterprise.deploy.spi.Target;
+import org.apache.geronimo.st.core.DeploymentUtils;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.server.core.IModule;
+
+class DistributeCommand extends AbstractDeploymentCommand {
+
+ public DistributeCommand(IModule module, DeploymentManager dm) {
+ super(dm, module);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.core.commands.IDeploymentCommand#execute(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public IStatus execute(IProgressMonitor monitor) {
+ Target[] targets = getDeploymentManager().getTargets();
+ File jarFile = DeploymentUtils.createJarFile(getModule());
+ return new DeploymentCmdStatus(Status.OK_STATUS, getDeploymentManager().distribute(targets, jarFile, null));
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.core.commands.IDeploymentCommand#getCommandType()
+ */
+ public CommandType getCommandType() {
+ return CommandType.DISTRIBUTE;
+ }
+
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DistributeCommand.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DistributeCommand.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/DistributeCommand.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/IDeploymentCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/IDeploymentCommand.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/IDeploymentCommand.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/IDeploymentCommand.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,32 @@
+/**
+ * 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.st.core.commands;
+
+import javax.enterprise.deploy.shared.CommandType;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.wst.server.core.IModule;
+
+public interface IDeploymentCommand {
+
+ public IStatus execute(IProgressMonitor monitor) throws Exception;
+
+ public CommandType getCommandType();
+
+ public IModule getModule();
+
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/IDeploymentCommand.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/IDeploymentCommand.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/IDeploymentCommand.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/RedeployCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/RedeployCommand.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/RedeployCommand.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/RedeployCommand.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,58 @@
+/**
+ * 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.st.core.commands;
+
+import java.io.File;
+
+import javax.enterprise.deploy.shared.CommandType;
+import javax.enterprise.deploy.spi.DeploymentManager;
+import javax.enterprise.deploy.spi.TargetModuleID;
+
+import org.apache.geronimo.st.core.DeploymentUtils;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.server.core.IModule;
+
+class RedeployCommand extends AbstractDeploymentCommand {
+
+ public RedeployCommand(IModule module, DeploymentManager dm) {
+ super(dm, module);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.core.commands.IDeploymentCommand#execute(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public IStatus execute(IProgressMonitor monitor)
+ throws TargetModuleIdNotFoundException {
+
+ TargetModuleID id = DeploymentUtils.getTargetModuleID(getModule(), getDeploymentManager());
+ File jarFile = DeploymentUtils.createJarFile(getModule());
+ return new DeploymentCmdStatus(Status.OK_STATUS, getDeploymentManager().redeploy(new TargetModuleID[] { id }, jarFile, null));
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.core.commands.IDeploymentCommand#getCommandType()
+ */
+ public CommandType getCommandType() {
+ return CommandType.REDEPLOY;
+ }
+
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/RedeployCommand.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/RedeployCommand.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/RedeployCommand.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/StartCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/StartCommand.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/StartCommand.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/StartCommand.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,55 @@
+/**
+ * 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.st.core.commands;
+
+import javax.enterprise.deploy.shared.CommandType;
+import javax.enterprise.deploy.spi.DeploymentManager;
+import javax.enterprise.deploy.spi.TargetModuleID;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.server.core.IModule;
+
+class StartCommand extends AbstractDeploymentCommand {
+
+ TargetModuleID[] ids;
+
+ public StartCommand(TargetModuleID[] ids, IModule module,
+ DeploymentManager dm) {
+ super(dm, module);
+ this.ids = ids;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.core.commands.IDeploymentCommand#execute(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public IStatus execute(IProgressMonitor monitor) {
+ return new DeploymentCmdStatus(Status.OK_STATUS, getDeploymentManager().start(ids));
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.core.commands.IDeploymentCommand#getCommandType()
+ */
+ public CommandType getCommandType() {
+ return CommandType.START;
+ }
+
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/StartCommand.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/StartCommand.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/StartCommand.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/StopCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/StopCommand.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/StopCommand.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/StopCommand.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,55 @@
+/**
+ * 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.st.core.commands;
+
+import javax.enterprise.deploy.shared.CommandType;
+import javax.enterprise.deploy.spi.DeploymentManager;
+import javax.enterprise.deploy.spi.TargetModuleID;
+
+import org.apache.geronimo.st.core.DeploymentUtils;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.server.core.IModule;
+
+class StopCommand extends AbstractDeploymentCommand {
+
+ public StopCommand(IModule module, DeploymentManager dm) {
+ super(dm, module);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.core.commands.IDeploymentCommand#execute(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public IStatus execute(IProgressMonitor monitor)
+ throws TargetModuleIdNotFoundException {
+
+ TargetModuleID id = DeploymentUtils.getTargetModuleID(getModule(), getDeploymentManager());
+ return new DeploymentCmdStatus(Status.OK_STATUS, getDeploymentManager().stop(new TargetModuleID[] { id }));
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.core.commands.IDeploymentCommand#getCommandType()
+ */
+ public CommandType getCommandType() {
+ return CommandType.STOP;
+ }
+
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/StopCommand.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/StopCommand.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/StopCommand.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/SynchronizedDeploymentOp.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/SynchronizedDeploymentOp.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/SynchronizedDeploymentOp.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/SynchronizedDeploymentOp.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,147 @@
+/**
+ * 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.st.core.commands;
+
+import javax.enterprise.deploy.shared.CommandType;
+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 org.apache.geronimo.st.core.Activator;
+import org.apache.geronimo.st.core.DeploymentStatusMessage;
+import org.apache.geronimo.st.core.internal.Trace;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.server.core.IModule;
+
+/**
+ * This class is a wrapper IDeploymentCommand that when executed blocks the
+ * callee's thread until completed, either when the waiting thread times out, or
+ * a failed or completed notification is recieved from the DeploymentManager.
+ */
+public class SynchronizedDeploymentOp implements ProgressListener,
+ IDeploymentCommand {
+
+ private static final long TIMEOUT = 10000;
+
+ private IDeploymentCommand command;
+
+ private IStatus status = null;
+
+ private IProgressMonitor _monitor = null;
+
+ private boolean timedOut = true;
+
+ public SynchronizedDeploymentOp(IDeploymentCommand command) {
+ super();
+ this.command = command;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.core.commands.IDeploymentCommand#execute(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public IStatus execute(IProgressMonitor monitor) throws Exception {
+
+ _monitor = monitor;
+
+ if (_monitor == null) {
+ _monitor = new NullProgressMonitor();
+ }
+
+ ProgressObject po = run();
+
+ return new DeploymentCmdStatus(status, po);
+ }
+
+ private synchronized ProgressObject run() throws Exception {
+ Trace.trace(Trace.INFO, "--> run()");
+
+ IStatus ds = command.execute(_monitor);
+
+ ProgressObject po = null;
+
+ if (ds instanceof DeploymentCmdStatus) {
+ po = ((DeploymentCmdStatus) ds).getProgressObject();
+ po.addProgressListener(this);
+
+ try {
+ wait(TIMEOUT);
+ } catch (InterruptedException e) {
+ }
+
+ po.removeProgressListener(this);
+ if (timedOut) {
+ Trace.trace(Trace.SEVERE, "Command Timed Out!");
+ }
+ }
+
+ Trace.trace(Trace.INFO, "<-- run()");
+ return po;
+ }
+
+ private synchronized void sendNotification() {
+ timedOut = false;
+ Trace.trace(Trace.INFO, "notifyAll()");
+ notifyAll();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.enterprise.deploy.spi.status.ProgressListener#handleProgressEvent(javax.enterprise.deploy.spi.status.ProgressEvent)
+ */
+ public void handleProgressEvent(ProgressEvent event) {
+ DeploymentStatus deploymentStatus = event.getDeploymentStatus();
+ if (deploymentStatus != null) {
+ DeploymentStatusMessage dsm = new DeploymentStatusMessage(deploymentStatus);
+ Trace.trace(Trace.INFO, dsm.toString());
+ _monitor.subTask(dsm.toString());
+ if (command.getCommandType() == deploymentStatus.getCommand()) {
+ if (deploymentStatus.isCompleted()) {
+ status = new Status(IStatus.OK, Activator.PLUGIN_ID, 0, dsm.getMessage(), null);
+ sendNotification();
+ } else if (deploymentStatus.isFailed()) {
+ status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, 0, dsm.getMessage(), null);
+ sendNotification();
+ }
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.core.commands.IDeploymentCommand#getCommandType()
+ */
+ public CommandType getCommandType() {
+ return command.getCommandType();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.core.commands.IDeploymentCommand#getModule()
+ */
+ public IModule getModule() {
+ return command.getModule();
+ }
+
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/SynchronizedDeploymentOp.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/SynchronizedDeploymentOp.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/SynchronizedDeploymentOp.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/TargetModuleIdNotFoundException.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/TargetModuleIdNotFoundException.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/TargetModuleIdNotFoundException.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/TargetModuleIdNotFoundException.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,38 @@
+/**
+ * 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.st.core.commands;
+
+public class TargetModuleIdNotFoundException extends Exception {
+
+ private static final long serialVersionUID = -2530352160336730134L;
+
+ public TargetModuleIdNotFoundException() {
+ super();
+ }
+
+ public TargetModuleIdNotFoundException(String arg0) {
+ super(arg0);
+ }
+
+ public TargetModuleIdNotFoundException(String arg0, Throwable arg1) {
+ super(arg0, arg1);
+ }
+
+ public TargetModuleIdNotFoundException(Throwable arg0) {
+ super(arg0);
+ }
+
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/TargetModuleIdNotFoundException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/TargetModuleIdNotFoundException.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/TargetModuleIdNotFoundException.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/UndeployCommand.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/UndeployCommand.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/UndeployCommand.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/UndeployCommand.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,55 @@
+/**
+ * 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.st.core.commands;
+
+import javax.enterprise.deploy.shared.CommandType;
+import javax.enterprise.deploy.spi.DeploymentManager;
+import javax.enterprise.deploy.spi.TargetModuleID;
+
+import org.apache.geronimo.st.core.DeploymentUtils;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.server.core.IModule;
+
+class UndeployCommand extends AbstractDeploymentCommand {
+
+ public UndeployCommand(IModule module, DeploymentManager dm) {
+ super(dm, module);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.core.commands.IDeploymentCommand#execute(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public IStatus execute(IProgressMonitor monitor)
+ throws TargetModuleIdNotFoundException {
+
+ TargetModuleID id = DeploymentUtils.getTargetModuleID(getModule(), getDeploymentManager());
+ return new DeploymentCmdStatus(Status.OK_STATUS, getDeploymentManager().undeploy(new TargetModuleID[] { id }));
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.geronimo.core.commands.IDeploymentCommand#getCommandType()
+ */
+ public CommandType getCommandType() {
+ return CommandType.UNDEPLOY;
+ }
+
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/UndeployCommand.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/UndeployCommand.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/commands/UndeployCommand.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/internal/GeronimoServerLifeCycleListener.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/internal/GeronimoServerLifeCycleListener.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/internal/GeronimoServerLifeCycleListener.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/internal/GeronimoServerLifeCycleListener.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,58 @@
+/**
+ * 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.st.core.internal;
+
+import org.apache.geronimo.st.core.GeronimoConnectionFactory;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerLifecycleListener;
+
+public class GeronimoServerLifeCycleListener implements
+ IServerLifecycleListener {
+
+ public GeronimoServerLifeCycleListener() {
+ super();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.wst.server.core.IServerLifecycleListener#serverAdded(org.eclipse.wst.server.core.IServer)
+ */
+ public void serverAdded(IServer server) {
+ // do nothing
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.wst.server.core.IServerLifecycleListener#serverChanged(org.eclipse.wst.server.core.IServer)
+ */
+ public void serverChanged(IServer server) {
+ Trace.trace(Trace.INFO, "GeronimoServerLifeCycleListener.serverChanged()");
+ GeronimoConnectionFactory.getInstance().destroy(server);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.wst.server.core.IServerLifecycleListener#serverRemoved(org.eclipse.wst.server.core.IServer)
+ */
+ public void serverRemoved(IServer server) {
+ Trace.trace(Trace.INFO, "GeronimoServerLifeCycleListener.serverRemoved()");
+ GeronimoConnectionFactory.getInstance().destroy(server);
+ }
+
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/internal/GeronimoServerLifeCycleListener.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/internal/GeronimoServerLifeCycleListener.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/internal/GeronimoServerLifeCycleListener.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/internal/Messages.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/internal/Messages.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/internal/Messages.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/internal/Messages.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,36 @@
+/**
+ * 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.st.core.internal;
+
+import org.eclipse.osgi.util.NLS;
+
+/**
+ * Translated messages.
+ */
+public class Messages extends NLS {
+
+ static {
+ NLS.initializeMessages("org.apache.geronimo.core.internal.Messages", Messages.class);
+ }
+
+ public static String DISTRIBUTE_FAIL;
+ public static String START_FAIL;
+ public static String STOP_FAIL;
+ public static String UNDEPLOY_FAIL;
+ public static String REDEPLOY_FAIL;
+ public static String DM_CONNECTION_FAIL;
+
+}
\ No newline at end of file
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/internal/Messages.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/internal/Messages.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/internal/Messages.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/internal/Trace.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/internal/Trace.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/internal/Trace.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/internal/Trace.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,77 @@
+/**
+ * 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.st.core.internal;
+
+import org.apache.geronimo.st.core.Activator;
+
+/**
+ * Helper class to route trace output.
+ */
+public class Trace {
+
+ /**
+ * Finest trace event.
+ */
+ public static byte INFO = 0;
+
+ /**
+ * Warning trace event.
+ */
+ public static byte WARNING = 1;
+
+ /**
+ * Severe trace event.
+ */
+ public static byte SEVERE = 2;
+
+ /**
+ * 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 (!Activator.getDefault().isDebugging())
+ return;
+
+ System.out.println(Activator.PLUGIN_ID + ": " + s);
+ if (t != null)
+ t.printStackTrace();
+ }
+}
\ No newline at end of file
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/internal/Trace.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/internal/Trace.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/internal/Trace.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/AbstractGeronimoJ2EEComponentOperation.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/AbstractGeronimoJ2EEComponentOperation.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/AbstractGeronimoJ2EEComponentOperation.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/AbstractGeronimoJ2EEComponentOperation.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,82 @@
+/**
+ * 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.st.core.operations;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jst.j2ee.application.internal.operations.J2EEComponentCreationDataModelProvider;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IComponentCreationDataModelProperties;
+import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+
+public abstract class AbstractGeronimoJ2EEComponentOperation extends
+ AbstractDataModelOperation {
+
+ public AbstractGeronimoJ2EEComponentOperation() {
+ super();
+ }
+
+ /**
+ * @param model
+ */
+ public AbstractGeronimoJ2EEComponentOperation(IDataModel model) {
+ super(model);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor,
+ * org.eclipse.core.runtime.IAdaptable)
+ */
+ public IStatus redo(IProgressMonitor monitor, IAdaptable info)
+ throws ExecutionException {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.commands.operations.AbstractOperation#undo(org.eclipse.core.runtime.IProgressMonitor,
+ * org.eclipse.core.runtime.IAdaptable)
+ */
+ public IStatus undo(IProgressMonitor monitor, IAdaptable info)
+ throws ExecutionException {
+ return null;
+ }
+
+ public boolean isGeronimoRuntimeTarget() {
+ String runtimeID = model.getStringProperty(J2EEComponentCreationDataModelProvider.RUNTIME_TARGET_ID);
+ return runtimeID != null && runtimeID.startsWith("Apache Geronimo");
+ }
+
+ public String getComponentName() {
+ return model.getProperty(IComponentCreationDataModelProperties.COMPONENT_NAME).toString();
+ }
+
+ public IProject getProject() {
+ String projectName = model.getProperty(IComponentCreationDataModelProperties.PROJECT_NAME).toString();
+ if (projectName != null) {
+ return ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
+ }
+ return null;
+ }
+
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/AbstractGeronimoJ2EEComponentOperation.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/AbstractGeronimoJ2EEComponentOperation.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/AbstractGeronimoJ2EEComponentOperation.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/DeploymentPlanCreationOperation.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/DeploymentPlanCreationOperation.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/DeploymentPlanCreationOperation.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/DeploymentPlanCreationOperation.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,83 @@
+/**
+ * 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.st.core.operations;
+
+import java.io.IOException;
+import java.util.Collections;
+
+import org.apache.geronimo.st.core.GeronimoUtils;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.xmi.XMLResource;
+import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+
+public abstract class DeploymentPlanCreationOperation extends
+ AbstractGeronimoJ2EEComponentOperation implements
+ IDeploymentPlanCreationOp {
+
+ public DeploymentPlanCreationOperation(IDataModel model) {
+ super(model);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor,
+ * org.eclipse.core.runtime.IAdaptable)
+ */
+ public IStatus execute(IProgressMonitor monitor, IAdaptable info)
+ throws ExecutionException {
+ execute();
+ return Status.OK_STATUS;
+ }
+
+ public void execute() {
+ IVirtualComponent comp = ComponentCore.createComponent(getProject());
+
+ String type = J2EEProjectUtilities.getJ2EEProjectType(getProject());
+
+ if (IModuleConstants.JST_WEB_MODULE.equals(type)) {
+ createGeronimoWebDeploymentPlan(GeronimoUtils.getWebDeploymentPlanFile(comp));
+ } else if (IModuleConstants.JST_EJB_MODULE.equals(type)) {
+ createOpenEjbDeploymentPlan(GeronimoUtils.getOpenEjbDeploymentPlanFile(comp));
+ } else if (IModuleConstants.JST_EAR_MODULE.equals(type)) {
+ createGeronimoApplicationDeploymentPlan(GeronimoUtils.getApplicationDeploymentPlanFile(comp));
+ } else if (IModuleConstants.JST_CONNECTOR_MODULE.equals(type)) {
+ createConnectorDeploymentPlan(GeronimoUtils.getConnectorDeploymentPlanFile(comp));
+ }
+ }
+
+ public void save(Resource resource) {
+
+ if (resource instanceof XMLResource) {
+ ((XMLResource) resource).setEncoding("UTF-8");
+ }
+
+ try {
+ resource.save(Collections.EMPTY_MAP);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/DeploymentPlanCreationOperation.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/DeploymentPlanCreationOperation.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/DeploymentPlanCreationOperation.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/GeronimoDataModelProperties.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/GeronimoDataModelProperties.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/GeronimoDataModelProperties.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/GeronimoDataModelProperties.java Wed Apr 12 13:02:48 2006
@@ -0,0 +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.st.core.operations;
+
+public interface GeronimoDataModelProperties {
+
+ public static final String PROJECT_NAME = "IExportDeploymentPlanDataModelProperties.PROJECT_NAME";
+
+ public static final String COMPONENT_NAME = "IExportDeploymentPlanDataModelProperties.COMPONENT_NAME";
+
+ public static final String EXPORT_LOCATION = "IExportDeploymentPlanDataModelProperties.EXPORT_LOCATION";
+
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/GeronimoDataModelProperties.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/GeronimoDataModelProperties.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/GeronimoDataModelProperties.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/IDeploymentPlanCreationOp.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/IDeploymentPlanCreationOp.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/IDeploymentPlanCreationOp.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/IDeploymentPlanCreationOp.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,31 @@
+/**
+ * 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.st.core.operations;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.ecore.EObject;
+
+public interface IDeploymentPlanCreationOp {
+
+ public EObject createOpenEjbDeploymentPlan(IFile file);
+
+ public EObject createGeronimoWebDeploymentPlan(IFile file);
+
+ public EObject createGeronimoApplicationDeploymentPlan(IFile file);
+
+ public EObject createConnectorDeploymentPlan(IFile file);
+
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/IDeploymentPlanCreationOp.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/IDeploymentPlanCreationOp.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/org/apache/geronimo/st/core/operations/IDeploymentPlanCreationOp.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/.classpath
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/.classpath?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/.classpath (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/.classpath Wed Apr 12 13:02:48 2006
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/.project
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/.project?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/.project (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/.project Wed Apr 12 13:02:48 2006
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.apache.geronimo.st.ui</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/META-INF/MANIFEST.MF?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/META-INF/MANIFEST.MF (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/META-INF/MANIFEST.MF Wed Apr 12 13:02:48 2006
@@ -0,0 +1,33 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Geronimo Server Tools UI Plug-in
+Bundle-SymbolicName: org.apache.geronimo.st.ui;singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Activator: org.apache.geronimo.st.ui.Activator
+Bundle-Vendor: Apache
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.wst.server.core,
+ org.apache.geronimo.st.core,
+ org.eclipse.debug.core,
+ org.eclipse.jdt.launching,
+ org.eclipse.emf.ecore,
+ org.eclipse.ui.forms,
+ org.eclipse.emf.edit,
+ org.eclipse.emf.edit.ui,
+ org.eclipse.ui.ide,
+ org.eclipse.core.resources,
+ org.eclipse.ui.editors,
+ org.eclipse.ui.workbench.texteditor,
+ org.eclipse.jst.server.generic.core,
+ org.eclipse.wst.server.ui
+Eclipse-AutoStart: true
+Export-Package: org.apache.geronimo.st.ui,
+ org.apache.geronimo.st.ui.actions,
+ org.apache.geronimo.st.ui.commands,
+ org.apache.geronimo.st.ui.editors,
+ org.apache.geronimo.st.ui.internal,
+ org.apache.geronimo.st.ui.pages,
+ org.apache.geronimo.st.ui.sections,
+ org.apache.geronimo.st.ui.wizards
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/build.properties
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/build.properties?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/build.properties (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/build.properties Wed Apr 12 13:02:48 2006
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = target/classes/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/build.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/build.properties
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/build.properties
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/icons/bigG.gif
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/icons/bigG.gif?rev=393587&view=auto
==============================================================================
Binary file - no diff available.
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/icons/bigG.gif
------------------------------------------------------------------------------
svn:mime-type = image/gif
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/icons/g_banner.gif
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/icons/g_banner.gif?rev=393587&view=auto
==============================================================================
Binary file - no diff available.
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/icons/g_banner.gif
------------------------------------------------------------------------------
svn:mime-type = image/gif
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/icons/g_server.gif
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/icons/g_server.gif?rev=393587&view=auto
==============================================================================
Binary file - no diff available.
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/icons/g_server.gif
------------------------------------------------------------------------------
svn:mime-type = image/gif
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/icons/obj16/feature.gif
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/icons/obj16/feature.gif?rev=393587&view=auto
==============================================================================
Binary file - no diff available.
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/icons/obj16/feature.gif
------------------------------------------------------------------------------
svn:mime-type = image/gif
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/icons/obj16/littleG.gif
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/icons/obj16/littleG.gif?rev=393587&view=auto
==============================================================================
Binary file - no diff available.
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/icons/obj16/littleG.gif
------------------------------------------------------------------------------
svn:mime-type = image/gif
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.properties
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.properties?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.properties (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.properties Wed Apr 12 13:02:48 2006
@@ -0,0 +1,4 @@
+pluginName=Geronimo Server Tools UI
+providerName=Apache Software Foundation
+
+PopupMenus.launchconsole=Launch Geronimo Console
\ No newline at end of file
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.properties
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.properties
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml Wed Apr 12 13:02:48 2006
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+ <extension point="org.eclipse.ui.popupMenus">
+ <objectContribution id="org.apache.geronimo.ui.serveractions"
+ objectClass="org.eclipse.wst.server.core.IServer">
+ <action id="org.apache.geronimo.ui.launchconsole"
+ label="%PopupMenus.launchconsole" icon="icons/obj16/littleG.gif"
+ class="org.apache.geronimo.st.ui.actions.LaunchGeronimoConsoleAction"
+ enablesFor="1">
+ </action>
+ </objectContribution>
+ </extension>
+</plugin>
+
\ No newline at end of file
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/Activator.java
URL: http://svn.apache.org/viewcvs/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/Activator.java?rev=393587&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/Activator.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/Activator.java Wed Apr 12 13:02:48 2006
@@ -0,0 +1,131 @@
+package org.apache.geronimo.st.ui;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.geronimo.st.ui.internal.Trace;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.apache.geronimo.st.ui";
+
+ // The shared instance
+ private static Activator plugin;
+
+ private static String iconLocation;
+
+ private Map imageDescriptors = new HashMap();
+
+ public static final String ICONS_DIRECTORY = "icons/";
+ public static final String IMG_WIZ_GERONIMO = "gServer";
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ public static String getIconLocation() {
+ if (iconLocation == null) {
+ try {
+ iconLocation = Platform.resolve(plugin.getBundle().getEntry("/")).getPath()
+ + ICONS_DIRECTORY;
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ return iconLocation;
+ }
+
+ /**
+ * Return the image with the given key from the image registry.
+ *
+ * @param key
+ * java.lang.String
+ * @return org.eclipse.jface.parts.IImage
+ */
+ public static Image getImage(String key) {
+ return plugin.getImageRegistry().get(key);
+ }
+
+ /**
+ * Return the image with the given key from the image registry.
+ *
+ * @param key
+ * java.lang.String
+ * @return org.eclipse.jface.parts.IImage
+ */
+ public static ImageDescriptor getImageDescriptor(String key) {
+ try {
+ plugin.getImageRegistry();
+ return (ImageDescriptor) plugin.imageDescriptors.get(key);
+ } catch (Exception e) {
+ return null;
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeImageRegistry(org.eclipse.jface.resource.ImageRegistry)
+ */
+ protected void initializeImageRegistry(ImageRegistry reg) {
+ registerImage(reg, IMG_WIZ_GERONIMO, "g_server.gif");
+ }
+
+ private void registerImage(ImageRegistry registry, String key,
+ String partialURL) {
+
+ URL iconsURL = plugin.getBundle().getEntry(ICONS_DIRECTORY);
+
+ try {
+ ImageDescriptor id = ImageDescriptor.createFromURL(new URL(iconsURL, partialURL));
+ registry.put(key, id);
+ imageDescriptors.put(key, id);
+ } catch (Exception e) {
+ Trace.trace(Trace.WARNING, "Error registering image", e);
+ }
+ }
+
+}
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/Activator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/Activator.java
------------------------------------------------------------------------------
svn:keywords = Date Rev
Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/org/apache/geronimo/st/ui/Activator.java
------------------------------------------------------------------------------
svn:mime-type = text/plain