001: /**
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 2005 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id$
023: * --------------------------------------------------------------------------
024: */package org.objectweb.jonas.ws.mbean;
025:
026: import java.util.ArrayList;
027: import java.util.List;
028:
029: /**
030: * A <code>WebService</code> MBean represents a <code>webservice-description</code>
031: * in webservices.xml.
032: *
033: * @author Guillaume Sauthier
034: */
035: public class Service extends AbstractWebServiceMBean {
036:
037: /**
038: * Service's name
039: */
040: private String name = null;
041:
042: /**
043: * Published WSDL URL
044: */
045: private String wsdlURL = null;
046:
047: /**
048: * JAX-RPC mapping file name
049: */
050: private String mappingFilename = null;
051:
052: /**
053: * WSDL file name
054: */
055: private String wsdlFilename = null;
056:
057: /**
058: * PortComponent MBean list
059: */
060: private List portComponents = new ArrayList();
061:
062: /**
063: * PortComponent's ObjectName list
064: */
065: private List portComponentONames = new ArrayList();
066:
067: /**
068: * Service Constructor
069: * @param objectName Service's ObjectName
070: */
071: public Service(String objectName) {
072: super (objectName);
073: }
074:
075: /**
076: * @return Returns the mappingFile.
077: */
078: public String getMappingFilename() {
079: return mappingFilename;
080: }
081:
082: /**
083: * @param mappingFile The mappingFile to set.
084: */
085: public void setMappingFilename(String mappingFile) {
086: this .mappingFilename = mappingFile;
087: }
088:
089: /**
090: * @return Returns the wsdlFilename.
091: */
092: public String getWsdlFilename() {
093: return wsdlFilename;
094: }
095:
096: /**
097: * @param wsdlFilename The wsdlFilename to set.
098: */
099: public void setWsdlFilename(String wsdlFilename) {
100: this .wsdlFilename = wsdlFilename;
101: }
102:
103: /**
104: * @return Returns the name.
105: */
106: public String getName() {
107: return name;
108: }
109:
110: /**
111: * @param name The name to set.
112: */
113: public void setName(String name) {
114: this .name = name;
115: }
116:
117: /**
118: * @return Returns the wsdlURL.
119: */
120: public String getWsdlURL() {
121: return wsdlURL;
122: }
123:
124: /**
125: * @param wsdlURL The wsdlURL to set.
126: */
127: public void setWsdlURL(String wsdlURL) {
128: this .wsdlURL = wsdlURL;
129: }
130:
131: /**
132: * @return Returns the portComponents MBean.
133: */
134: public List getPortComponentsMBean() {
135: return portComponents;
136: }
137:
138: /**
139: * @return Returns the portComponentONames.
140: */
141: public String[] getPortComponents() {
142: return (String[]) portComponentONames
143: .toArray(new String[portComponentONames.size()]);
144: }
145:
146: /**
147: * Add a portComponent
148: * @param pc PortComponent MBean
149: */
150: public void addPortComponentMBean(PortComponent pc) {
151: portComponents.add(pc);
152: portComponentONames.add(pc.getObjectName());
153: }
154:
155: /**
156: * @return Returns the Service MBean subtype
157: */
158: protected String getMBeanType() {
159: return WebServicesObjectName.WEBSERVICE_TYPE;
160: }
161:
162: /**
163: * @return Returns the childs MBeans (if any)
164: */
165: protected List getChildsMBeans() {
166: return portComponents;
167: }
168:
169: }
|