1 package org.codehaus.mojo.weblogic;
2
3 /*
4 * Copyright 2006 The Apache Software Foundation.
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19 import org.apache.maven.plugin.MojoExecutionException;
20
21 /**
22 * Stop an artifact on Weblogic server(s) or cluster(s).
23 *
24 * @author <a href="mailto:scott@theryansplace.com">Scott Ryan</a>
25 * @version $Id: StopMojo.java 6645 2008-04-02 01:38:51Z jonnio $
26 * @description This mojo will stop a component (EAR, WAR) on a server or group of servers.
27 * @goal stop
28 */
29 public class StopMojo
30 extends DeployMojoBase
31 {
32
33 /**
34 * This method will perform the stop of an application unit.
35 *
36 * @throws MojoExecutionException Thrown if we fail to obtain a Weblogic deployment instance.
37 */
38 public void execute()
39 throws MojoExecutionException
40 {
41
42 if ( getLog().isInfoEnabled() )
43 {
44 getLog().info( "Weblogic artifact stop beginning with parameters " + this.toString() );
45 }
46
47 // get the basic parameters
48 final String[] parameters = this.getInputParameters( "stop" );
49 final boolean success = super.executeDeployer( parameters, "Exception encountered during artifact stop" );
50
51 if ( getLog().isInfoEnabled() )
52 {
53 if ( success )
54 {
55 getLog().info( "Weblogic artifact stop successful " );
56 }
57 else
58 {
59 getLog().info( "Weblogic artifact stop failed " );
60 }
61 }
62 }
63 }