1 22 package org.objectweb.petals.tools.jbiplugin; 23 24 import javax.jbi.management.LifeCycleMBean; 25 26 import org.apache.maven.plugin.MojoExecutionException; 27 28 36 public class StartComponentMojo extends JMXComponentAbstractMojo { 37 38 41 public void execute() throws MojoExecutionException { 42 try { 43 44 String currentState = this.getState(project.getArtifactId()); 45 if (LifeCycleMBean.SHUTDOWN.equals(currentState) 46 || LifeCycleMBean.STOPPED.equals(currentState)) { 47 this.performComponentAction(JMXComponentAbstractMojo.START, project.getArtifactId()); 48 } else { 49 System.out 50 .println("The goal is skip because the compoenent is not in the state \"" 51 + LifeCycleMBean.SHUTDOWN + "\" or \"" + LifeCycleMBean.STOPPED + "\"."); 52 } 53 54 } catch (Exception e) { 55 e.printStackTrace(); 56 throw new MojoExecutionException(e.getLocalizedMessage(), e); 57 } 58 } 59 } 60 | Popular Tags |