[jboss-cvs] JBossAS SVN: r91130 - in branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management: client/upload and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Sat Jul 11 17:14:05 EDT 2009
Author: scott.stark at jboss.org
Date: 2009-07-11 17:14:04 -0400 (Sat, 11 Jul 2009)
New Revision: 91130
Added:
branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/client/upload/
branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/client/upload/DeploymentProgressImpl.java
branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/client/upload/SerializableDeploymentID.java
branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/client/upload/SerializableDeploymentStatus.java
Removed:
branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentProgressImpl.java
branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/upload/SerializableDeploymentID.java
branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/upload/SerializableDeploymentStatus.java
Modified:
branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentManagerImpl.java
branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/AbstractDeployHandler.java
branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/StreamingDeploymentTarget.java
Log:
JBPAPP-2245, move additional client side classes into jboss-profileservice-client.jar
Copied: branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/client/upload/DeploymentProgressImpl.java (from rev 90947, branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentProgressImpl.java)
===================================================================
--- branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/client/upload/DeploymentProgressImpl.java (rev 0)
+++ branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/client/upload/DeploymentProgressImpl.java 2009-07-11 21:14:04 UTC (rev 91130)
@@ -0,0 +1,434 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.profileservice.management.client.upload;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+import org.jboss.deployers.spi.management.deploy.DeploymentID;
+import org.jboss.deployers.spi.management.deploy.DeploymentProgress;
+import org.jboss.deployers.spi.management.deploy.DeploymentStatus;
+import org.jboss.deployers.spi.management.deploy.DeploymentTarget;
+import org.jboss.deployers.spi.management.deploy.ProgressEvent;
+import org.jboss.deployers.spi.management.deploy.ProgressListener;
+import org.jboss.deployers.spi.management.deploy.DeploymentStatus.CommandType;
+import org.jboss.deployers.spi.management.deploy.DeploymentStatus.StateType;
+
+/**
+ * The deployment progress.
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class DeploymentProgressImpl implements DeploymentProgress, Serializable
+{
+ private static final long serialVersionUID = 1;
+
+ /** The client side listeners */
+ private transient CopyOnWriteArrayList<ProgressListener> listeners = new CopyOnWriteArrayList<ProgressListener>();
+ private transient DeploymentStatus currentStatus;
+ private transient boolean isCancelled;
+ /** The targets to distribute to */
+ private List<DeploymentTarget> targets;
+ /** The deployment being distributed */
+ private DeploymentID deployment;
+ private CommandType command;
+
+ public DeploymentProgressImpl(List<DeploymentTarget> targets, DeploymentID deployment, CommandType command)
+ {
+ this.targets = targets;
+ this.deployment = deployment;
+ this.command = command;
+ }
+
+ public synchronized void addProgressListener(ProgressListener listener)
+ {
+ if(listeners == null)
+ listeners = new CopyOnWriteArrayList<ProgressListener>();
+ listeners.add(listener);
+ }
+ public void removeProgressListener(ProgressListener listener)
+ {
+ listeners.remove(listener);
+ }
+
+ /**
+ * Begins the deployment command process
+ */
+ public void run()
+ {
+ switch(command)
+ {
+ case DISTRIBUTE:
+ distribute();
+ break;
+ case PREPARE:
+ prepare();
+ break;
+ case START:
+ start();
+ break;
+ case STOP:
+ stop();
+ break;
+ case REMOVE:
+ remove();
+ break;
+ case REDEPLOY:
+ redeploy();
+ break;
+ default:
+ throw new IllegalStateException(command+" is not currently handled");
+ }
+ }
+
+ public void cancel()
+ {
+ isCancelled = true;
+ }
+
+ public DeploymentStatus getDeploymentStatus()
+ {
+ return currentStatus;
+ }
+
+ public DeploymentID getDeploymentID()
+ {
+ return deployment;
+ }
+
+ public List<DeploymentTarget> getDeploymentTargets()
+ {
+ return targets;
+ }
+
+ /**
+ *
+ * @param event
+ */
+ protected void notify(ProgressEvent event)
+ {
+ if(listeners == null)
+ return;
+
+ for(ProgressListener listener : listeners)
+ {
+ try
+ {
+ listener.progressEvent(event);
+ }
+ catch(Throwable ignore)
+ {
+ }
+ }
+ }
+
+ protected void distribute()
+ {
+ SerializableDeploymentStatus status = new SerializableDeploymentStatus(command, StateType.DEPLOYING);
+ status.setMessage("Running distribute to: "+targets);
+ status.setRunning(true);
+ currentStatus = status;
+ ProgressEvent event = new ProgressEvent(deployment, currentStatus);
+ notify(event);
+ for(DeploymentTarget target : targets)
+ {
+ if(isCancelled)
+ {
+ status = new SerializableDeploymentStatus(command, StateType.CANCELLED);
+ status.setMessage("Distribute has been cancelled");
+ currentStatus = status;
+ event = new ProgressEvent(deployment, currentStatus);
+ notify(event);
+ break;
+ }
+
+ try
+ {
+ // TODO, percent complete info in upload and overall distribute
+ status = new SerializableDeploymentStatus(command, StateType.UPLOADING);
+ status.setTarget(target);
+ status.setRunning(true);
+ status.setMessage("Begining distribute to target: "+target);
+ currentStatus = status;
+ event = new ProgressEvent(deployment, currentStatus);
+ notify(event);
+
+ // TODO, cancellation of in progress distribution
+ target.distribute(deployment);
+ status = new SerializableDeploymentStatus(command, StateType.DEPLOYING);
+ status.setTarget(target);
+ status.setMessage("Completed distribute to target: "+target);
+ currentStatus = status;
+ event = new ProgressEvent(deployment, currentStatus);
+ notify(event);
+ }
+ catch(Exception e)
+ {
+ status = new SerializableDeploymentStatus(command, StateType.FAILED);
+ status.setTarget(target);
+ status.setFailure(e);
+ status.setFailed(true);
+ currentStatus = status;
+ ProgressEvent error = new ProgressEvent(deployment, currentStatus);
+ notify(error);
+ break;
+ }
+ }
+
+ if(currentStatus.isFailed() == false)
+ {
+ status = new SerializableDeploymentStatus(command, StateType.COMPLETED);
+ status.setMessage("Completed distribute to all targets");
+ status.setCompleted(true);
+ currentStatus = status;
+ event = new ProgressEvent(deployment, currentStatus);
+ notify(event);
+ }
+ }
+
+ protected void start()
+ {
+ SerializableDeploymentStatus status = new SerializableDeploymentStatus(command, StateType.RUNNING);
+ status.setMessage("Running start to: "+targets);
+ status.setRunning(true);
+ currentStatus = status;
+ ProgressEvent event = new ProgressEvent(deployment, currentStatus);
+ notify(event);
+ for(DeploymentTarget target : targets)
+ {
+ if(isCancelled)
+ {
+ status = new SerializableDeploymentStatus(command, StateType.CANCELLED);
+ status.setMessage("Start has been cancelled");
+ currentStatus = status;
+ event = new ProgressEvent(deployment, currentStatus);
+ notify(event);
+ break;
+ }
+
+ try
+ {
+ target.start(deployment);
+ status = new SerializableDeploymentStatus(command, StateType.COMPLETED);
+ status.setTarget(target);
+ status.setMessage("Completed start for target: "+target);
+ status.setCompleted(true);
+ currentStatus = status;
+ event = new ProgressEvent(deployment, currentStatus);
+ notify(event);
+ }
+ catch(Exception e)
+ {
+ status = new SerializableDeploymentStatus(command, StateType.FAILED);
+ status.setTarget(target);
+ status.setFailure(e);
+ status.setFailed(true);
+ currentStatus = status;
+ ProgressEvent error = new ProgressEvent(deployment, currentStatus);
+ notify(error);
+ break;
+ }
+ }
+ }
+
+ protected void stop()
+ {
+ SerializableDeploymentStatus status = new SerializableDeploymentStatus(command, StateType.RUNNING);
+ status.setMessage("Running stop to: "+targets);
+ status.setRunning(true);
+ currentStatus = status;
+ ProgressEvent event = new ProgressEvent(deployment, currentStatus);
+ notify(event);
+ for(DeploymentTarget target : targets)
+ {
+ if(isCancelled)
+ {
+ status = new SerializableDeploymentStatus(command, StateType.CANCELLED);
+ status.setMessage("Stop has been cancelled");
+ currentStatus = status;
+ event = new ProgressEvent(deployment, currentStatus);
+ notify(event);
+ break;
+ }
+
+ try
+ {
+ target.stop(deployment);
+ status = new SerializableDeploymentStatus(command, StateType.COMPLETED);
+ status.setTarget(target);
+ status.setMessage("Completed stop for target: "+target);
+ status.setCompleted(true);
+ currentStatus = status;
+ event = new ProgressEvent(deployment, currentStatus);
+ notify(event);
+ }
+ catch(Exception e)
+ {
+ status = new SerializableDeploymentStatus(command, StateType.FAILED);
+ status.setTarget(target);
+ status.setFailure(e);
+ status.setFailed(true);
+ currentStatus = status;
+ ProgressEvent error = new ProgressEvent(deployment, currentStatus);
+ notify(error);
+ break;
+ }
+ }
+ }
+
+ protected void remove()
+ {
+ SerializableDeploymentStatus status = new SerializableDeploymentStatus(command, StateType.RUNNING);
+ status.setMessage("Running undeploy to: "+targets);
+ status.setRunning(true);
+ currentStatus = status;
+ ProgressEvent event = new ProgressEvent(deployment, currentStatus);
+ notify(event);
+ for(DeploymentTarget target : targets)
+ {
+ if(isCancelled)
+ {
+ status = new SerializableDeploymentStatus(command, StateType.CANCELLED);
+ status.setMessage("Undeploy has been cancelled");
+ currentStatus = status;
+ event = new ProgressEvent(deployment, currentStatus);
+ notify(event);
+ break;
+ }
+
+ try
+ {
+ target.remove(deployment);
+ status = new SerializableDeploymentStatus(command, StateType.COMPLETED);
+ status.setTarget(target);
+ status.setMessage("Completed undeploy for target: "+target);
+ status.setCompleted(true);
+ currentStatus = status;
+ event = new ProgressEvent(deployment, currentStatus);
+ notify(event);
+ }
+ catch(Exception e)
+ {
+ status = new SerializableDeploymentStatus(command, StateType.FAILED);
+ status.setTarget(target);
+ status.setFailure(e);
+ status.setFailed(true);
+ currentStatus = status;
+ ProgressEvent error = new ProgressEvent(deployment, currentStatus);
+ notify(error);
+ break;
+ }
+ }
+ }
+
+ protected void redeploy()
+ {
+ SerializableDeploymentStatus status = new SerializableDeploymentStatus(command, StateType.RUNNING);
+ status.setMessage("Running redeploy to: "+targets);
+ status.setRunning(true);
+ currentStatus = status;
+ ProgressEvent event = new ProgressEvent(deployment, currentStatus);
+ notify(event);
+ for(DeploymentTarget target : targets)
+ {
+ if(isCancelled)
+ {
+ status = new SerializableDeploymentStatus(command, StateType.CANCELLED);
+ status.setMessage("Redeploy has been cancelled");
+ currentStatus = status;
+ event = new ProgressEvent(deployment, currentStatus);
+ notify(event);
+ break;
+ }
+
+ try
+ {
+ target.redeploy(deployment);
+ status = new SerializableDeploymentStatus(command, StateType.COMPLETED);
+ status.setTarget(target);
+ status.setMessage("Completed redeploy for target: "+target);
+ status.setCompleted(true);
+ currentStatus = status;
+ event = new ProgressEvent(deployment, currentStatus);
+ notify(event);
+ }
+ catch(Exception e)
+ {
+ status = new SerializableDeploymentStatus(command, StateType.FAILED);
+ status.setTarget(target);
+ status.setFailure(e);
+ status.setFailed(true);
+ currentStatus = status;
+ ProgressEvent error = new ProgressEvent(deployment, currentStatus);
+ notify(error);
+ break;
+ }
+ }
+ }
+
+ protected void prepare()
+ {
+ SerializableDeploymentStatus status = new SerializableDeploymentStatus(command, StateType.RUNNING);
+ status.setMessage("Running prepare to: "+targets);
+ status.setRunning(true);
+ currentStatus = status;
+ ProgressEvent event = new ProgressEvent(deployment, currentStatus);
+ notify(event);
+ for(DeploymentTarget target : targets)
+ {
+ if(isCancelled)
+ {
+ status = new SerializableDeploymentStatus(command, StateType.CANCELLED);
+ status.setMessage("Prepare has been cancelled");
+ currentStatus = status;
+ event = new ProgressEvent(deployment, currentStatus);
+ notify(event);
+ break;
+ }
+
+ try
+ {
+ target.prepare(deployment);
+ status = new SerializableDeploymentStatus(command, StateType.COMPLETED);
+ status.setTarget(target);
+ status.setMessage("Completed prepare for target: "+target);
+ status.setCompleted(true);
+ currentStatus = status;
+ event = new ProgressEvent(deployment, currentStatus);
+ notify(event);
+ }
+ catch(Exception e)
+ {
+ status = new SerializableDeploymentStatus(command, StateType.FAILED);
+ status.setTarget(target);
+ status.setFailure(e);
+ status.setFailed(true);
+ currentStatus = status;
+ ProgressEvent error = new ProgressEvent(deployment, currentStatus);
+ notify(error);
+ break;
+ }
+ }
+ }
+}
Copied: branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/client/upload/SerializableDeploymentID.java (from rev 90947, branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/upload/SerializableDeploymentID.java)
===================================================================
--- branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/client/upload/SerializableDeploymentID.java (rev 0)
+++ branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/client/upload/SerializableDeploymentID.java 2009-07-11 21:14:04 UTC (rev 91130)
@@ -0,0 +1,192 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.profileservice.management.client.upload;
+
+import java.io.InputStream;
+import java.io.Serializable;
+import java.net.URL;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jboss.deployers.spi.management.deploy.DeploymentID;
+import org.jboss.profileservice.spi.DeploymentOption;
+import org.jboss.profileservice.spi.ProfileKey;
+
+/**
+ * A serializable DeploymentID implementation.
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class SerializableDeploymentID implements DeploymentID, Serializable
+{
+ private static final long serialVersionUID = 1;
+
+ /** An InputStream to use to copy the contents */
+ private transient InputStream contentIS;
+ private Set<DeploymentOption> options;
+ private String[] deploymentNames;
+ private String[] repositoryNames;
+ private ProfileKey profileKey;
+ private String description;
+ private URL contentURL;
+ private boolean copyContent;
+
+ public SerializableDeploymentID(DeploymentID deployment)
+ {
+ this(deployment.getNames(), deployment.getProfile(), deployment.getDescription(), deployment.getDeploymentOptions());
+ }
+
+ public SerializableDeploymentID(String name, ProfileKey profileKey, String description)
+ {
+ this(new String[]{name}, profileKey, description);
+ }
+
+ public SerializableDeploymentID(String[] names, ProfileKey profileKey, String description)
+ {
+ this(names, profileKey, description, new DeploymentOption[0]);
+ }
+
+ public SerializableDeploymentID(String[] names, ProfileKey profileKey, String description, DeploymentOption... options)
+ {
+ this.deploymentNames = names;
+ this.profileKey = profileKey;
+ this.description = description;
+ this.copyContent = true; // by default we copy content
+ this.options = new HashSet<DeploymentOption>();
+ if(options != null && options.length > 0)
+ {
+ for(DeploymentOption option : options)
+ addDeploymentOption(option);
+ }
+ }
+
+ public String[] getNames()
+ {
+ return deploymentNames;
+ }
+
+ public String[] getRepositoryNames()
+ {
+ if(repositoryNames == null)
+ repositoryNames = deploymentNames;
+ return repositoryNames;
+ }
+ public void setRepositoryNames(String[] names)
+ {
+ this.repositoryNames = names;
+ }
+
+ /**
+ * The target profile for the deployment.
+ * For further use.
+ */
+ public ProfileKey getProfile()
+ {
+ return this.profileKey;
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public URL getContentURL()
+ {
+ return contentURL;
+ }
+ public void setContentURL(URL contentURL)
+ {
+ this.contentURL = contentURL;
+ }
+
+ public boolean isCopyContent()
+ {
+ return copyContent;
+ }
+ public void setCopyContent(boolean copyContent)
+ {
+ this.copyContent = copyContent;
+ }
+
+ /**
+ * An optional deployment archive content stream for the top-level
+ * deployment.
+ *
+ * @return the archive input stream if it exists
+ */
+ public InputStream getContentIS()
+ {
+ return contentIS;
+ }
+ /**
+ *
+ * @param contentIS
+ */
+ public void setContentIS(InputStream contentIS)
+ {
+ this.contentIS = contentIS;
+ }
+
+ public void addDeploymentOption(DeploymentOption option)
+ {
+ if(option == null)
+ throw new IllegalArgumentException("null option");
+ this.options.add(option);
+ }
+
+ public DeploymentOption[] getDeploymentOptions()
+ {
+ return this.options.toArray(new DeploymentOption[this.options.size()]);
+ }
+
+ public boolean hasDeploymentOption(DeploymentOption option)
+ {
+ if(option == null)
+ throw new IllegalArgumentException("null option");
+ return this.options.contains(option);
+ }
+
+ public boolean removeDeploymentOption(DeploymentOption option)
+ {
+ return this.options.remove(option);
+ }
+
+ public String toString()
+ {
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("names=").append(Arrays.toString(getNames()));
+ // Only add the repositoryNames if it differs from deploymentNames
+ if(getRepositoryNames() != getNames())
+ buffer.append(", repositoryNames=").append(Arrays.toString(getRepositoryNames()));
+ // Only log copyContent when the contentURL is set
+ if(getContentURL() != null)
+ buffer.append(", copyContent=").append(copyContent);
+ if(description != null)
+ buffer.append(", description=").append(description);
+ if(options != null && options.isEmpty() == false)
+ buffer.append(", options=").append(options);
+ return buffer.toString();
+ }
+
+}
Copied: branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/client/upload/SerializableDeploymentStatus.java (from rev 90947, branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/upload/SerializableDeploymentStatus.java)
===================================================================
--- branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/client/upload/SerializableDeploymentStatus.java (rev 0)
+++ branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/client/upload/SerializableDeploymentStatus.java 2009-07-11 21:14:04 UTC (rev 91130)
@@ -0,0 +1,153 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.profileservice.management.client.upload;
+
+import java.io.PrintWriter;
+import java.io.Serializable;
+import java.io.StringWriter;
+
+import org.jboss.deployers.spi.management.deploy.DeploymentStatus;
+import org.jboss.deployers.spi.management.deploy.DeploymentTarget;
+
+/**
+ * Simple javabean impl of DeploymentStatus
+ *
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class SerializableDeploymentStatus implements DeploymentStatus,
+ Serializable
+{
+ private static final long serialVersionUID = 1;
+
+ private CommandType command;
+ private Exception failure;
+ private String message;
+ private StateType state;
+ private DeploymentTarget target;
+ private boolean isCompleted;
+ private boolean isFailed;
+ private boolean isRunning;
+
+ public SerializableDeploymentStatus(CommandType command, StateType state)
+ {
+ this.command = command;
+ this.state = state;
+ }
+
+ public CommandType getCommand()
+ {
+ return command;
+ }
+ public void setCommand(CommandType command)
+ {
+ this.command = command;
+ }
+
+ public DeploymentTarget getTarget()
+ {
+ return target;
+ }
+ public void setTarget(DeploymentTarget target)
+ {
+ this.target = target;
+ }
+
+ public Exception getFailure()
+ {
+ return failure;
+ }
+ public void setFailure(Exception failure)
+ {
+ this.failure = failure;
+ }
+ public String getMessage()
+ {
+ return message;
+ }
+ public void setMessage(String message)
+ {
+ this.message = message;
+ }
+ public StateType getState()
+ {
+ return state;
+ }
+ public void setState(StateType state)
+ {
+ this.state = state;
+ }
+ public boolean isCompleted()
+ {
+ return isCompleted;
+ }
+ public void setCompleted(boolean isCompleted)
+ {
+ this.isCompleted = isCompleted;
+ }
+ public boolean isFailed()
+ {
+ return isFailed;
+ }
+ public void setFailed(boolean isFailed)
+ {
+ this.isFailed = isFailed;
+ }
+ public boolean isRunning()
+ {
+ return isRunning;
+ }
+ public void setRunning(boolean isRunning)
+ {
+ this.isRunning = isRunning;
+ }
+
+ @Override
+ public String toString()
+ {
+ StringBuffer tmp = new StringBuffer("DeploymentStatus(");
+ tmp.append("command=");
+ tmp.append(command);
+ tmp.append(",state=");
+ tmp.append(state);
+ tmp.append(",message=");
+ tmp.append(message);
+ tmp.append(",isCompleted=");
+ tmp.append(isCompleted);
+ tmp.append(",isRunning=");
+ tmp.append(isRunning);
+ tmp.append(",isFailed=");
+ tmp.append(isFailed);
+
+ if(failure != null)
+ {
+ StringWriter sw = new StringWriter();
+ PrintWriter pw = new PrintWriter(sw);
+ failure.printStackTrace(pw);
+ tmp.append(",failure:\n");
+ tmp.append(sw.toString());
+ }
+ tmp.append(")");
+ return tmp.toString();
+ }
+
+}
Modified: branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentManagerImpl.java
===================================================================
--- branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentManagerImpl.java 2009-07-11 19:11:42 UTC (rev 91129)
+++ branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentManagerImpl.java 2009-07-11 21:14:04 UTC (rev 91130)
@@ -34,6 +34,8 @@
import org.jboss.deployers.spi.management.deploy.DeploymentTarget;
import org.jboss.deployers.spi.management.deploy.DeploymentStatus.CommandType;
import org.jboss.logging.Logger;
+import org.jboss.profileservice.management.client.upload.DeploymentProgressImpl;
+import org.jboss.profileservice.management.client.upload.SerializableDeploymentID;
import org.jboss.profileservice.management.upload.remoting.StreamingDeploymentTarget;
import org.jboss.profileservice.spi.DeploymentOption;
import org.jboss.profileservice.spi.NoSuchProfileException;
Deleted: branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentProgressImpl.java
===================================================================
--- branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentProgressImpl.java 2009-07-11 19:11:42 UTC (rev 91129)
+++ branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/upload/DeploymentProgressImpl.java 2009-07-11 21:14:04 UTC (rev 91130)
@@ -1,434 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.profileservice.management.upload;
-
-import java.io.Serializable;
-import java.util.List;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import org.jboss.deployers.spi.management.deploy.DeploymentID;
-import org.jboss.deployers.spi.management.deploy.DeploymentProgress;
-import org.jboss.deployers.spi.management.deploy.DeploymentStatus;
-import org.jboss.deployers.spi.management.deploy.DeploymentTarget;
-import org.jboss.deployers.spi.management.deploy.ProgressEvent;
-import org.jboss.deployers.spi.management.deploy.ProgressListener;
-import org.jboss.deployers.spi.management.deploy.DeploymentStatus.CommandType;
-import org.jboss.deployers.spi.management.deploy.DeploymentStatus.StateType;
-
-/**
- * The deployment progress.
- *
- * @author Scott.Stark at jboss.org
- * @version $Revision$
- */
-public class DeploymentProgressImpl implements DeploymentProgress, Serializable
-{
- private static final long serialVersionUID = 1;
-
- /** The client side listeners */
- private transient CopyOnWriteArrayList<ProgressListener> listeners = new CopyOnWriteArrayList<ProgressListener>();
- private transient DeploymentStatus currentStatus;
- private transient boolean isCancelled;
- /** The targets to distribute to */
- private List<DeploymentTarget> targets;
- /** The deployment being distributed */
- private DeploymentID deployment;
- private CommandType command;
-
- public DeploymentProgressImpl(List<DeploymentTarget> targets, DeploymentID deployment, CommandType command)
- {
- this.targets = targets;
- this.deployment = deployment;
- this.command = command;
- }
-
- public synchronized void addProgressListener(ProgressListener listener)
- {
- if(listeners == null)
- listeners = new CopyOnWriteArrayList<ProgressListener>();
- listeners.add(listener);
- }
- public void removeProgressListener(ProgressListener listener)
- {
- listeners.remove(listener);
- }
-
- /**
- * Begins the deployment command process
- */
- public void run()
- {
- switch(command)
- {
- case DISTRIBUTE:
- distribute();
- break;
- case PREPARE:
- prepare();
- break;
- case START:
- start();
- break;
- case STOP:
- stop();
- break;
- case REMOVE:
- remove();
- break;
- case REDEPLOY:
- redeploy();
- break;
- default:
- throw new IllegalStateException(command+" is not currently handled");
- }
- }
-
- public void cancel()
- {
- isCancelled = true;
- }
-
- public DeploymentStatus getDeploymentStatus()
- {
- return currentStatus;
- }
-
- public DeploymentID getDeploymentID()
- {
- return deployment;
- }
-
- public List<DeploymentTarget> getDeploymentTargets()
- {
- return targets;
- }
-
- /**
- *
- * @param event
- */
- protected void notify(ProgressEvent event)
- {
- if(listeners == null)
- return;
-
- for(ProgressListener listener : listeners)
- {
- try
- {
- listener.progressEvent(event);
- }
- catch(Throwable ignore)
- {
- }
- }
- }
-
- protected void distribute()
- {
- SerializableDeploymentStatus status = new SerializableDeploymentStatus(command, StateType.DEPLOYING);
- status.setMessage("Running distribute to: "+targets);
- status.setRunning(true);
- currentStatus = status;
- ProgressEvent event = new ProgressEvent(deployment, currentStatus);
- notify(event);
- for(DeploymentTarget target : targets)
- {
- if(isCancelled)
- {
- status = new SerializableDeploymentStatus(command, StateType.CANCELLED);
- status.setMessage("Distribute has been cancelled");
- currentStatus = status;
- event = new ProgressEvent(deployment, currentStatus);
- notify(event);
- break;
- }
-
- try
- {
- // TODO, percent complete info in upload and overall distribute
- status = new SerializableDeploymentStatus(command, StateType.UPLOADING);
- status.setTarget(target);
- status.setRunning(true);
- status.setMessage("Begining distribute to target: "+target);
- currentStatus = status;
- event = new ProgressEvent(deployment, currentStatus);
- notify(event);
-
- // TODO, cancellation of in progress distribution
- target.distribute(deployment);
- status = new SerializableDeploymentStatus(command, StateType.DEPLOYING);
- status.setTarget(target);
- status.setMessage("Completed distribute to target: "+target);
- currentStatus = status;
- event = new ProgressEvent(deployment, currentStatus);
- notify(event);
- }
- catch(Exception e)
- {
- status = new SerializableDeploymentStatus(command, StateType.FAILED);
- status.setTarget(target);
- status.setFailure(e);
- status.setFailed(true);
- currentStatus = status;
- ProgressEvent error = new ProgressEvent(deployment, currentStatus);
- notify(error);
- break;
- }
- }
-
- if(currentStatus.isFailed() == false)
- {
- status = new SerializableDeploymentStatus(command, StateType.COMPLETED);
- status.setMessage("Completed distribute to all targets");
- status.setCompleted(true);
- currentStatus = status;
- event = new ProgressEvent(deployment, currentStatus);
- notify(event);
- }
- }
-
- protected void start()
- {
- SerializableDeploymentStatus status = new SerializableDeploymentStatus(command, StateType.RUNNING);
- status.setMessage("Running start to: "+targets);
- status.setRunning(true);
- currentStatus = status;
- ProgressEvent event = new ProgressEvent(deployment, currentStatus);
- notify(event);
- for(DeploymentTarget target : targets)
- {
- if(isCancelled)
- {
- status = new SerializableDeploymentStatus(command, StateType.CANCELLED);
- status.setMessage("Start has been cancelled");
- currentStatus = status;
- event = new ProgressEvent(deployment, currentStatus);
- notify(event);
- break;
- }
-
- try
- {
- target.start(deployment);
- status = new SerializableDeploymentStatus(command, StateType.COMPLETED);
- status.setTarget(target);
- status.setMessage("Completed start for target: "+target);
- status.setCompleted(true);
- currentStatus = status;
- event = new ProgressEvent(deployment, currentStatus);
- notify(event);
- }
- catch(Exception e)
- {
- status = new SerializableDeploymentStatus(command, StateType.FAILED);
- status.setTarget(target);
- status.setFailure(e);
- status.setFailed(true);
- currentStatus = status;
- ProgressEvent error = new ProgressEvent(deployment, currentStatus);
- notify(error);
- break;
- }
- }
- }
-
- protected void stop()
- {
- SerializableDeploymentStatus status = new SerializableDeploymentStatus(command, StateType.RUNNING);
- status.setMessage("Running stop to: "+targets);
- status.setRunning(true);
- currentStatus = status;
- ProgressEvent event = new ProgressEvent(deployment, currentStatus);
- notify(event);
- for(DeploymentTarget target : targets)
- {
- if(isCancelled)
- {
- status = new SerializableDeploymentStatus(command, StateType.CANCELLED);
- status.setMessage("Stop has been cancelled");
- currentStatus = status;
- event = new ProgressEvent(deployment, currentStatus);
- notify(event);
- break;
- }
-
- try
- {
- target.stop(deployment);
- status = new SerializableDeploymentStatus(command, StateType.COMPLETED);
- status.setTarget(target);
- status.setMessage("Completed stop for target: "+target);
- status.setCompleted(true);
- currentStatus = status;
- event = new ProgressEvent(deployment, currentStatus);
- notify(event);
- }
- catch(Exception e)
- {
- status = new SerializableDeploymentStatus(command, StateType.FAILED);
- status.setTarget(target);
- status.setFailure(e);
- status.setFailed(true);
- currentStatus = status;
- ProgressEvent error = new ProgressEvent(deployment, currentStatus);
- notify(error);
- break;
- }
- }
- }
-
- protected void remove()
- {
- SerializableDeploymentStatus status = new SerializableDeploymentStatus(command, StateType.RUNNING);
- status.setMessage("Running undeploy to: "+targets);
- status.setRunning(true);
- currentStatus = status;
- ProgressEvent event = new ProgressEvent(deployment, currentStatus);
- notify(event);
- for(DeploymentTarget target : targets)
- {
- if(isCancelled)
- {
- status = new SerializableDeploymentStatus(command, StateType.CANCELLED);
- status.setMessage("Undeploy has been cancelled");
- currentStatus = status;
- event = new ProgressEvent(deployment, currentStatus);
- notify(event);
- break;
- }
-
- try
- {
- target.remove(deployment);
- status = new SerializableDeploymentStatus(command, StateType.COMPLETED);
- status.setTarget(target);
- status.setMessage("Completed undeploy for target: "+target);
- status.setCompleted(true);
- currentStatus = status;
- event = new ProgressEvent(deployment, currentStatus);
- notify(event);
- }
- catch(Exception e)
- {
- status = new SerializableDeploymentStatus(command, StateType.FAILED);
- status.setTarget(target);
- status.setFailure(e);
- status.setFailed(true);
- currentStatus = status;
- ProgressEvent error = new ProgressEvent(deployment, currentStatus);
- notify(error);
- break;
- }
- }
- }
-
- protected void redeploy()
- {
- SerializableDeploymentStatus status = new SerializableDeploymentStatus(command, StateType.RUNNING);
- status.setMessage("Running redeploy to: "+targets);
- status.setRunning(true);
- currentStatus = status;
- ProgressEvent event = new ProgressEvent(deployment, currentStatus);
- notify(event);
- for(DeploymentTarget target : targets)
- {
- if(isCancelled)
- {
- status = new SerializableDeploymentStatus(command, StateType.CANCELLED);
- status.setMessage("Redeploy has been cancelled");
- currentStatus = status;
- event = new ProgressEvent(deployment, currentStatus);
- notify(event);
- break;
- }
-
- try
- {
- target.redeploy(deployment);
- status = new SerializableDeploymentStatus(command, StateType.COMPLETED);
- status.setTarget(target);
- status.setMessage("Completed redeploy for target: "+target);
- status.setCompleted(true);
- currentStatus = status;
- event = new ProgressEvent(deployment, currentStatus);
- notify(event);
- }
- catch(Exception e)
- {
- status = new SerializableDeploymentStatus(command, StateType.FAILED);
- status.setTarget(target);
- status.setFailure(e);
- status.setFailed(true);
- currentStatus = status;
- ProgressEvent error = new ProgressEvent(deployment, currentStatus);
- notify(error);
- break;
- }
- }
- }
-
- protected void prepare()
- {
- SerializableDeploymentStatus status = new SerializableDeploymentStatus(command, StateType.RUNNING);
- status.setMessage("Running prepare to: "+targets);
- status.setRunning(true);
- currentStatus = status;
- ProgressEvent event = new ProgressEvent(deployment, currentStatus);
- notify(event);
- for(DeploymentTarget target : targets)
- {
- if(isCancelled)
- {
- status = new SerializableDeploymentStatus(command, StateType.CANCELLED);
- status.setMessage("Prepare has been cancelled");
- currentStatus = status;
- event = new ProgressEvent(deployment, currentStatus);
- notify(event);
- break;
- }
-
- try
- {
- target.prepare(deployment);
- status = new SerializableDeploymentStatus(command, StateType.COMPLETED);
- status.setTarget(target);
- status.setMessage("Completed prepare for target: "+target);
- status.setCompleted(true);
- currentStatus = status;
- event = new ProgressEvent(deployment, currentStatus);
- notify(event);
- }
- catch(Exception e)
- {
- status = new SerializableDeploymentStatus(command, StateType.FAILED);
- status.setTarget(target);
- status.setFailure(e);
- status.setFailed(true);
- currentStatus = status;
- ProgressEvent error = new ProgressEvent(deployment, currentStatus);
- notify(error);
- break;
- }
- }
- }
-}
Deleted: branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/upload/SerializableDeploymentID.java
===================================================================
--- branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/upload/SerializableDeploymentID.java 2009-07-11 19:11:42 UTC (rev 91129)
+++ branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/upload/SerializableDeploymentID.java 2009-07-11 21:14:04 UTC (rev 91130)
@@ -1,192 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.profileservice.management.upload;
-
-import java.io.InputStream;
-import java.io.Serializable;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.jboss.deployers.spi.management.deploy.DeploymentID;
-import org.jboss.profileservice.spi.DeploymentOption;
-import org.jboss.profileservice.spi.ProfileKey;
-
-/**
- * A serializable DeploymentID implementation.
- *
- * @author Scott.Stark at jboss.org
- * @version $Revision$
- */
-public class SerializableDeploymentID implements DeploymentID, Serializable
-{
- private static final long serialVersionUID = 1;
-
- /** An InputStream to use to copy the contents */
- private transient InputStream contentIS;
- private Set<DeploymentOption> options;
- private String[] deploymentNames;
- private String[] repositoryNames;
- private ProfileKey profileKey;
- private String description;
- private URL contentURL;
- private boolean copyContent;
-
- public SerializableDeploymentID(DeploymentID deployment)
- {
- this(deployment.getNames(), deployment.getProfile(), deployment.getDescription(), deployment.getDeploymentOptions());
- }
-
- public SerializableDeploymentID(String name, ProfileKey profileKey, String description)
- {
- this(new String[]{name}, profileKey, description);
- }
-
- public SerializableDeploymentID(String[] names, ProfileKey profileKey, String description)
- {
- this(names, profileKey, description, new DeploymentOption[0]);
- }
-
- public SerializableDeploymentID(String[] names, ProfileKey profileKey, String description, DeploymentOption... options)
- {
- this.deploymentNames = names;
- this.profileKey = profileKey;
- this.description = description;
- this.copyContent = true; // by default we copy content
- this.options = new HashSet<DeploymentOption>();
- if(options != null && options.length > 0)
- {
- for(DeploymentOption option : options)
- addDeploymentOption(option);
- }
- }
-
- public String[] getNames()
- {
- return deploymentNames;
- }
-
- public String[] getRepositoryNames()
- {
- if(repositoryNames == null)
- repositoryNames = deploymentNames;
- return repositoryNames;
- }
- public void setRepositoryNames(String[] names)
- {
- this.repositoryNames = names;
- }
-
- /**
- * The target profile for the deployment.
- * For further use.
- */
- public ProfileKey getProfile()
- {
- return this.profileKey;
- }
-
- public String getDescription()
- {
- return description;
- }
-
- public URL getContentURL()
- {
- return contentURL;
- }
- public void setContentURL(URL contentURL)
- {
- this.contentURL = contentURL;
- }
-
- public boolean isCopyContent()
- {
- return copyContent;
- }
- public void setCopyContent(boolean copyContent)
- {
- this.copyContent = copyContent;
- }
-
- /**
- * An optional deployment archive content stream for the top-level
- * deployment.
- *
- * @return the archive input stream if it exists
- */
- public InputStream getContentIS()
- {
- return contentIS;
- }
- /**
- *
- * @param contentIS
- */
- public void setContentIS(InputStream contentIS)
- {
- this.contentIS = contentIS;
- }
-
- public void addDeploymentOption(DeploymentOption option)
- {
- if(option == null)
- throw new IllegalArgumentException("null option");
- this.options.add(option);
- }
-
- public DeploymentOption[] getDeploymentOptions()
- {
- return this.options.toArray(new DeploymentOption[this.options.size()]);
- }
-
- public boolean hasDeploymentOption(DeploymentOption option)
- {
- if(option == null)
- throw new IllegalArgumentException("null option");
- return this.options.contains(option);
- }
-
- public boolean removeDeploymentOption(DeploymentOption option)
- {
- return this.options.remove(option);
- }
-
- public String toString()
- {
- StringBuffer buffer = new StringBuffer();
- buffer.append("names=").append(Arrays.toString(getNames()));
- // Only add the repositoryNames if it differs from deploymentNames
- if(getRepositoryNames() != getNames())
- buffer.append(", repositoryNames=").append(Arrays.toString(getRepositoryNames()));
- // Only log copyContent when the contentURL is set
- if(getContentURL() != null)
- buffer.append(", copyContent=").append(copyContent);
- if(description != null)
- buffer.append(", description=").append(description);
- if(options != null && options.isEmpty() == false)
- buffer.append(", options=").append(options);
- return buffer.toString();
- }
-
-}
Deleted: branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/upload/SerializableDeploymentStatus.java
===================================================================
--- branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/upload/SerializableDeploymentStatus.java 2009-07-11 19:11:42 UTC (rev 91129)
+++ branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/upload/SerializableDeploymentStatus.java 2009-07-11 21:14:04 UTC (rev 91130)
@@ -1,153 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.profileservice.management.upload;
-
-import java.io.PrintWriter;
-import java.io.Serializable;
-import java.io.StringWriter;
-
-import org.jboss.deployers.spi.management.deploy.DeploymentStatus;
-import org.jboss.deployers.spi.management.deploy.DeploymentTarget;
-
-/**
- * Simple javabean impl of DeploymentStatus
- *
- * @author Scott.Stark at jboss.org
- * @version $Revision:$
- */
-public class SerializableDeploymentStatus implements DeploymentStatus,
- Serializable
-{
- private static final long serialVersionUID = 1;
-
- private CommandType command;
- private Exception failure;
- private String message;
- private StateType state;
- private DeploymentTarget target;
- private boolean isCompleted;
- private boolean isFailed;
- private boolean isRunning;
-
- public SerializableDeploymentStatus(CommandType command, StateType state)
- {
- this.command = command;
- this.state = state;
- }
-
- public CommandType getCommand()
- {
- return command;
- }
- public void setCommand(CommandType command)
- {
- this.command = command;
- }
-
- public DeploymentTarget getTarget()
- {
- return target;
- }
- public void setTarget(DeploymentTarget target)
- {
- this.target = target;
- }
-
- public Exception getFailure()
- {
- return failure;
- }
- public void setFailure(Exception failure)
- {
- this.failure = failure;
- }
- public String getMessage()
- {
- return message;
- }
- public void setMessage(String message)
- {
- this.message = message;
- }
- public StateType getState()
- {
- return state;
- }
- public void setState(StateType state)
- {
- this.state = state;
- }
- public boolean isCompleted()
- {
- return isCompleted;
- }
- public void setCompleted(boolean isCompleted)
- {
- this.isCompleted = isCompleted;
- }
- public boolean isFailed()
- {
- return isFailed;
- }
- public void setFailed(boolean isFailed)
- {
- this.isFailed = isFailed;
- }
- public boolean isRunning()
- {
- return isRunning;
- }
- public void setRunning(boolean isRunning)
- {
- this.isRunning = isRunning;
- }
-
- @Override
- public String toString()
- {
- StringBuffer tmp = new StringBuffer("DeploymentStatus(");
- tmp.append("command=");
- tmp.append(command);
- tmp.append(",state=");
- tmp.append(state);
- tmp.append(",message=");
- tmp.append(message);
- tmp.append(",isCompleted=");
- tmp.append(isCompleted);
- tmp.append(",isRunning=");
- tmp.append(isRunning);
- tmp.append(",isFailed=");
- tmp.append(isFailed);
-
- if(failure != null)
- {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
- failure.printStackTrace(pw);
- tmp.append(",failure:\n");
- tmp.append(sw.toString());
- }
- tmp.append(")");
- return tmp.toString();
- }
-
-}
Modified: branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/AbstractDeployHandler.java
===================================================================
--- branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/AbstractDeployHandler.java 2009-07-11 19:11:42 UTC (rev 91129)
+++ branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/AbstractDeployHandler.java 2009-07-11 21:14:04 UTC (rev 91130)
@@ -35,7 +35,7 @@
import org.jboss.deployers.spi.management.deploy.DeploymentID;
import org.jboss.deployers.spi.management.deploy.DeploymentManager;
import org.jboss.logging.Logger;
-import org.jboss.profileservice.management.upload.SerializableDeploymentID;
+import org.jboss.profileservice.management.client.upload.SerializableDeploymentID;
import org.jboss.profileservice.spi.DeploymentRepository;
import org.jboss.profileservice.spi.NoSuchProfileException;
import org.jboss.profileservice.spi.ProfileDeployment;
Modified: branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/StreamingDeploymentTarget.java
===================================================================
--- branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/StreamingDeploymentTarget.java 2009-07-11 19:11:42 UTC (rev 91129)
+++ branches/JBPAPP_5_0/profileservice/src/main/org/jboss/profileservice/management/upload/remoting/StreamingDeploymentTarget.java 2009-07-11 21:14:04 UTC (rev 91130)
@@ -34,7 +34,7 @@
import org.jboss.deployers.spi.management.deploy.DeploymentID;
import org.jboss.deployers.spi.management.deploy.DeploymentTarget;
import org.jboss.logging.Logger;
-import org.jboss.profileservice.management.upload.SerializableDeploymentID;
+import org.jboss.profileservice.management.client.upload.SerializableDeploymentID;
import org.jboss.remoting.Client;
import org.jboss.remoting.InvokerLocator;
More information about the jboss-cvs-commits
mailing list