KickJava   Java API By Example, From Geeks To Geeks.

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


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

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

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

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

54     public String JavaDoc getSharedLibraryName() {
55         return sharedLibraryName;
56     }
57
58     /**
59      *
60      * @param sharedLibraryName
61      */

62     public void setSharedLibraryName(String JavaDoc sharedLibraryName) {
63         this.sharedLibraryName = sharedLibraryName;
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
77      */

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

86     public String JavaDoc getBindingComponentName() {
87         return bindingComponentName;
88     }
89
90     /**
91      *
92      * @param bindingComponentName
93      */

94     public void setBindingComponentName(String JavaDoc bindingComponentName) {
95         this.bindingComponentName = bindingComponentName;
96     }
97
98     /**
99      *
100      * @return component state
101      */

102     public String JavaDoc getState() {
103         return state;
104     }
105
106     /**
107      *
108      * @param state Sets the component state
109      */

110     public void setState(String JavaDoc state) {
111         this.state = state;
112     }
113
114     /**
115      * execute the task
116      *
117      * @throws BuildException
118      */

119     public void doExecute(AdminCommandsServiceMBean acs) throws Exception JavaDoc {
120         String JavaDoc result = acs.listComponents(true, false, true, getState(), getSharedLibraryName(), getServiceAssemblyName());
121         if (xmlOutput != null) {
122             getProject().setProperty(xmlOutput, result);
123         }
124         log(result, Project.MSG_WARN);
125     }
126     
127 }
128
Popular Tags