001 /*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements. See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License. You may obtain a copy of the License at
008 *
009 * http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017 package org.apache.servicemix.jbi.management.task;
018
019 import org.apache.servicemix.jbi.framework.AdminCommandsServiceMBean;
020 import org.apache.tools.ant.Project;
021
022 /**
023 * ListServiceEnginesTask
024 *
025 * @version $Revision:
026 */
027 public class ListServiceEnginesTask extends JbiTask {
028
029 private String state;
030
031 private String serviceAssemblyName;
032
033 private String sharedLibraryName;
034
035 private String xmlOutput;
036
037 /**
038 * @return the xmlOutput
039 */
040 public String isXmlOutput() {
041 return xmlOutput;
042 }
043
044 /**
045 * @param xmlOutput
046 * the xmlOutput to set
047 */
048 public void setXmlOutput(String xmlOutput) {
049 this.xmlOutput = xmlOutput;
050 }
051
052 /**
053 *
054 * @return the state
055 */
056 public String getState() {
057 return state;
058 }
059
060 /**
061 *
062 * @param state
063 * Sets the state
064 */
065 public void setState(String state) {
066 this.state = state;
067 }
068
069 /**
070 *
071 * @return service assembly name
072 */
073 public String getServiceAssemblyName() {
074 return serviceAssemblyName;
075 }
076
077 /**
078 *
079 * @param serviceAssemblyName
080 * the service assembly name to set
081 */
082 public void setServiceAssemblyName(String serviceAssemblyName) {
083 this.serviceAssemblyName = serviceAssemblyName;
084 }
085
086 /**
087 *
088 * @return The shared library name
089 */
090 public String getSharedLibraryName() {
091 return sharedLibraryName;
092 }
093
094 /**
095 *
096 * @param sharedLibraryName
097 * Sets the shared library name
098 */
099 public void setSharedLibraryName(String sharedLibraryName) {
100 this.sharedLibraryName = sharedLibraryName;
101 }
102
103 /**
104 * execute the task
105 *
106 * @throws BuildException
107 */
108 public void doExecute(AdminCommandsServiceMBean acs) throws Exception {
109 String result = acs.listComponents(false, true, true, getState(), getSharedLibraryName(), getServiceAssemblyName());
110 if (xmlOutput != null) {
111 getProject().setProperty(xmlOutput, result);
112 }
113 log(result, Project.MSG_WARN);
114 }
115
116 }