KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > servicemix > jbi > management > task > ListServiceAssembliesTask


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17 package org.apache.servicemix.jbi.management.task;
18
19 import org.apache.servicemix.jbi.framework.AdminCommandsServiceMBean;
20 import org.apache.tools.ant.BuildException;
21 import org.apache.tools.ant.Project;
22
23 /**
24  * List deployed Service Assemblies
25  *
26  * @version $Revision: 379004 $
27  */

28 public class ListServiceAssembliesTask extends JbiTask {
29     
30     private String JavaDoc state;
31     private String JavaDoc componentName;
32     private String JavaDoc serviceAssemblyName;
33     private String JavaDoc xmlOutput;
34
35     /**
36      * @return the xmlOutput
37      */

38     public String JavaDoc isXmlOutput() {
39         return xmlOutput;
40     }
41
42     /**
43      * @param xmlOutput the xmlOutput to set
44      */

45     public void setXmlOutput(String JavaDoc xmlOutput) {
46         this.xmlOutput = xmlOutput;
47     }
48
49
50     /**
51      *
52      * @return the state
53      */

54     public String JavaDoc getState() {
55         return state;
56     }
57
58     /**
59      *
60      * @param state Sets the state
61      */

62     public void setState(String JavaDoc state) {
63         this.state = state;
64     }
65
66     /**
67      *
68      * @return the component name
69      */

70     public String JavaDoc getComponentName() {
71         return componentName;
72     }
73
74     /**
75      *
76      * @param componentName Sets the component name
77      */

78     public void setComponentName(String JavaDoc componentName) {
79         this.componentName = componentName;
80     }
81
82     /**
83      *
84      * @return service assembly name
85      */

86     public String JavaDoc getServiceAssemblyName() {
87         return serviceAssemblyName;
88     }
89
90     /**
91      *
92      * @param serviceAssemblynname Sets the service assembly name
93      */

94     public void setServiceAssemblyName(String JavaDoc serviceAssemblynname) {
95         this.serviceAssemblyName = serviceAssemblynname;
96     }
97
98     /**
99      * execute the task
100      *
101      * @throws BuildException
102      */

103     public void doExecute(AdminCommandsServiceMBean acs) throws Exception JavaDoc {
104         String JavaDoc result = acs.listServiceAssemblies(getState(), getComponentName(), getServiceAssemblyName());
105         if (xmlOutput != null) {
106             getProject().setProperty(xmlOutput, result);
107         }
108         log(result, Project.MSG_WARN);
109     }
110     
111 }
Popular Tags