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 StartServiceAssemblyMojo extends JMXServiceAssemblyAbstractMojo { 37 38 41 public void execute() throws MojoExecutionException { 42 try { 43 String currentState = this.getState(project.getArtifactId()); 44 if (LifeCycleMBean.SHUTDOWN.equals(currentState) 45 || LifeCycleMBean.STOPPED.equals(currentState)) { 46 this.performAction(JMXServiceAssemblyAbstractMojo.START, 47 project.getArtifactId()); 48 } else { 49 System.out 50 .println("The goal is skip because the service assembly 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 |