1 17 package org.apache.servicemix.common; 18 19 import org.apache.commons.logging.Log; 20 21 import javax.jbi.JBIException; 22 import javax.jbi.management.DeploymentException; 23 24 31 public abstract class AbstractDeployer implements Deployer { 32 33 protected final transient Log logger; 34 35 protected BaseComponent component; 36 37 public AbstractDeployer(BaseComponent component) { 38 this.component = component; 39 this.logger = component.logger; 40 } 41 42 protected DeploymentException failure(String task, String info, Throwable e) { 43 ManagementSupport.Message msg = new ManagementSupport.Message(); 44 msg.setComponent(component.getComponentName()); 45 msg.setTask(task); 46 msg.setResult("FAILED"); 47 msg.setType("ERROR"); 48 msg.setMessage(info); 49 msg.setException(e); 50 return new DeploymentException(ManagementSupport.createComponentMessage(msg)); 51 } 52 53 public void undeploy(ServiceUnit su) throws DeploymentException { 54 try { 58 su.shutDown(); 59 } catch (JBIException e) { 60 throw new DeploymentException("Unable to shutDown service unit", e); 61 } 62 } 63 64 } 65 | Popular Tags |