001: /*
002: * JBoss, Home of Professional Open Source.
003: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004: * as indicated by the @author tags. See the copyright.txt file in the
005: * distribution for a full listing of individual contributors.
006: *
007: * This is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU Lesser General Public License as
009: * published by the Free Software Foundation; either version 2.1 of
010: * the License, or (at your option) any later version.
011: *
012: * This software is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this software; if not, write to the Free
019: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021: */
022: package org.jboss.metadata;
023:
024: // $Id: EjbPortComponentMetaData.java 63190 2007-05-23 07:54:49Z thomas.diesler@jboss.com $
025:
026: import org.jboss.deployment.DeploymentException;
027: import org.w3c.dom.Element;
028:
029: /** The metdata data for session/port-component element from jboss.xml
030: *
031: * @author Scott.Stark@jboss.org
032: * @author Thomas.Diesler@jboss.com
033: * @version $Revision: 63190 $
034: */
035: public class EjbPortComponentMetaData {
036: private SessionMetaData sessionMetaData;
037:
038: private String portComponentName;
039: private String portComponentURI;
040: private String authMethod;
041: private String transportGuarantee;
042: private Boolean secureWSDLAccess;
043:
044: public EjbPortComponentMetaData(SessionMetaData sessionMetaData) {
045: this .sessionMetaData = sessionMetaData;
046: }
047:
048: public String getPortComponentName() {
049: return portComponentName;
050: }
051:
052: public String getPortComponentURI() {
053: return portComponentURI;
054: }
055:
056: public String getURLPattern() {
057: String pattern = "/*";
058: if (portComponentURI != null) {
059: return portComponentURI;
060: }
061: return pattern;
062: }
063:
064: public String getAuthMethod() {
065: return authMethod;
066: }
067:
068: public String getTransportGuarantee() {
069: return transportGuarantee;
070: }
071:
072: public Boolean getSecureWSDLAccess() {
073: return secureWSDLAccess;
074: }
075:
076: public void importStandardXml(Element element)
077: throws DeploymentException {
078: }
079:
080: /** Parse the port-component contents
081: * @param element
082: * @throws DeploymentException
083: */
084: public void importJBossXml(Element element)
085: throws DeploymentException {
086: // port-component/port-component-name
087: portComponentName = MetaData.getUniqueChildContent(element,
088: "port-component-name");
089:
090: // port-component/port-component-uri?
091: portComponentURI = MetaData.getOptionalChildContent(element,
092: "port-component-uri");
093: if (portComponentURI != null) {
094: if (portComponentURI.charAt(0) != '/')
095: portComponentURI = "/" + portComponentURI;
096: } else {
097: portComponentURI = "/" + sessionMetaData.getEjbName();
098: // The context root will be derived from deployment short name
099: }
100:
101: // port-component/auth-method?,
102: authMethod = MetaData.getOptionalChildContent(element,
103: "auth-method");
104: // port-component/transport-guarantee?
105: transportGuarantee = MetaData.getOptionalChildContent(element,
106: "transport-guarantee");
107: // port-component/secure-wsdl-access?
108: if (MetaData.getOptionalChildContent(element,
109: "secure-wsdl-access") != null)
110: secureWSDLAccess = Boolean.valueOf(MetaData
111: .getOptionalChildContent(element,
112: "secure-wsdl-access"));
113: }
114: }
|