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>PortComponent</code> represents a port-component
031: * in webservices.xml.
032: *
033: * @author Guillaume Sauthier
034: */
035: public class PortComponent extends AbstractWebServiceMBean {
036:
037: /**
038: * PortComponent name
039: */
040: private String name = null;
041:
042: /**
043: * wsdl:port QName
044: */
045: private String wsdlPort = null;
046:
047: /**
048: * ssei fully qualified classname
049: */
050: private String serviceEndpointInterface = null;
051:
052: /**
053: * Implementation Bean's ObjectName
054: */
055: private String implementationBeanOName = null;
056:
057: /**
058: * Handler list (childs)
059: */
060: private List handlers = new ArrayList();
061:
062: /**
063: * Handler's ObjectName list
064: */
065: private List handlerONames = new ArrayList();
066:
067: /**
068: * Endpoint URL : where the PortComponent can be accessed
069: */
070: private String endpoint = null;
071:
072: /**
073: * PortComponent Constructor
074: * @param objectName PortComponent's ObjectName
075: */
076: public PortComponent(String objectName) {
077: super (objectName);
078: }
079:
080: /**
081: * @return Returns the endpoint.
082: */
083: public String getEndpoint() {
084: return endpoint;
085: }
086:
087: /**
088: * @param endpoint The endpoint to set.
089: */
090: public void setEndpoint(String endpoint) {
091: this .endpoint = endpoint;
092: }
093:
094: /**
095: * @return Returns the name.
096: */
097: public String getName() {
098: return name;
099: }
100:
101: /**
102: * @param name The name to set.
103: */
104: public void setName(String name) {
105: this .name = name;
106: }
107:
108: /**
109: * @return Returns the serviceEndpointInterface.
110: */
111: public String getServiceEndpointInterface() {
112: return serviceEndpointInterface;
113: }
114:
115: /**
116: * @param serviceEndpointInterface The serviceEndpointInterface to set.
117: */
118: public void setServiceEndpointInterface(
119: String serviceEndpointInterface) {
120: this .serviceEndpointInterface = serviceEndpointInterface;
121: }
122:
123: /**
124: * @return Returns the wsdlPort.
125: */
126: public String getWsdlPort() {
127: return wsdlPort;
128: }
129:
130: /**
131: * @param wsdlPort The wsdlPort to set.
132: */
133: public void setWsdlPort(String wsdlPort) {
134: this .wsdlPort = wsdlPort;
135: }
136:
137: /**
138: * @return Returns the handlers.
139: */
140: public List getHandlersMBean() {
141: return handlers;
142: }
143:
144: /**
145: * @return Returns the handlers.
146: */
147: public String[] getHandlers() {
148: return (String[]) handlerONames
149: .toArray(new String[handlerONames.size()]);
150: }
151:
152: /**
153: * Add a handler
154: * @param h Handler MBean
155: */
156: public void addHandlerMBean(Handler h) {
157: handlers.add(h);
158: handlerONames.add(h.getObjectName());
159: }
160:
161: /**
162: * @return Returns the implementationBeanOName.
163: */
164: public String getImplementationBean() {
165: return implementationBeanOName;
166: }
167:
168: /**
169: * @param implementationBean The implementationBeanOName to set.
170: */
171: public void setImplementationBean(String implementationBean) {
172: this .implementationBeanOName = implementationBean;
173: }
174:
175: /**
176: * @return Returns the PortComponent MBean subtype
177: */
178: protected String getMBeanType() {
179: return WebServicesObjectName.PORTCOMPONENT_TYPE;
180: }
181:
182: /**
183: * @return Returns the childs MBeans (if any)
184: */
185: protected List getChildsMBeans() {
186: return handlers;
187: }
188:
189: }
|