KickJava   Java API By Example, From Geeks To Geeks.

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


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

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

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

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

53     public String JavaDoc getComponentName() {
54         return componentName;
55     }
56
57     /**
58      *
59      * @param componentName The component name to set
60      */

61     public void setComponentName(String JavaDoc componentName) {
62         this.componentName = componentName;
63     }
64
65     /**
66      *
67      * @return shared library name
68      */

69     public String JavaDoc getSharedLibraryName() {
70         return sharedLibraryName;
71     }
72
73     /**
74      *
75      * @param sharedLibraryName the shared library name to set
76      */

77     public void setSharedLibraryName(String JavaDoc sharedLibraryName) {
78         this.sharedLibraryName = sharedLibraryName;
79     }
80
81     /**
82      * execute the task
83      *
84      * @throws BuildException
85      */

86     public void doExecute(AdminCommandsServiceMBean acs) throws Exception JavaDoc {
87         String JavaDoc result = acs.listSharedLibraries(getComponentName(), getSharedLibraryName());
88         if (xmlOutput != null) {
89             getProject().setProperty(xmlOutput, result);
90         }
91         log(result, Project.MSG_WARN);
92     }
93     
94 }
95
Popular Tags