KickJava   Java API By Example, From Geeks To Geeks.

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


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  * ListServiceEnginesTask
25  *
26  * @version $Revision:
27  */

28 public class ListServiceEnginesTask extends JbiTask {
29     
30     private String JavaDoc state;
31     private String JavaDoc serviceAssemblyName;
32     private String JavaDoc sharedLibraryName;
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 service assembly name
69      */

70     public String JavaDoc getServiceAssemblyName() {
71         return serviceAssemblyName;
72     }
73
74     /**
75      *
76      * @param serviceAssemblyName the service assembly name to set
77      */

78     public void setServiceAssemblyName(String JavaDoc serviceAssemblyName) {
79         this.serviceAssemblyName = serviceAssemblyName;
80     }
81
82     /**
83      *
84      * @return The shared library name
85      */

86     public String JavaDoc getSharedLibraryName() {
87         return sharedLibraryName;
88     }
89
90     /**
91      *
92      * @param sharedLibraryName Sets the shared library name
93      */

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

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