1 22 package org.jboss.webservice.metadata.serviceref; 23 24 26 import org.jboss.deployment.DeploymentException; 27 import org.jboss.metadata.MetaData; 28 import org.w3c.dom.Element ; 29 30 import javax.xml.rpc.JAXRPCException ; 31 import java.io.Serializable ; 32 import java.util.Properties ; 33 import java.util.Iterator ; 34 35 40 public class PortComponentRefMetaData implements Serializable 41 { 42 static final long serialVersionUID = 3856598615591044263L; 43 private ServiceRefMetaData serviceRefMetaData; 45 46 private String serviceEndpointInterface; 48 private String portComponentLink; 50 51 52 private Properties callProperties; 53 54 public PortComponentRefMetaData(ServiceRefMetaData serviceRefMetaData) 55 { 56 this.serviceRefMetaData = serviceRefMetaData; 57 } 58 59 public ServiceRefMetaData getServiceRefMetaData() 60 { 61 return serviceRefMetaData; 62 } 63 64 75 public String getPortComponentLink() 76 { 77 return portComponentLink; 78 } 79 80 public String getServiceEndpointInterface() 81 { 82 return serviceEndpointInterface; 83 } 84 85 public Class getServiceEndpointInterfaceClass() 86 { 87 try 88 { 89 ClassLoader cl = serviceRefMetaData.getResourceCL(); 90 return cl.loadClass(serviceEndpointInterface); 91 } 92 catch (ClassNotFoundException e) 93 { 94 throw new JAXRPCException ("Cannot load service endpoint interface: " + serviceEndpointInterface); 95 } 96 } 97 98 public Properties getCallProperties() 99 { 100 return callProperties; 101 } 102 103 public void importStandardXml(Element element) 104 throws DeploymentException 105 { 106 serviceEndpointInterface = MetaData.getUniqueChildContent(element, "service-endpoint-interface"); 107 108 portComponentLink = MetaData.getOptionalChildContent(element, "port-component-link"); 109 } 110 111 public void importJBossXml(Element element) throws DeploymentException 112 { 113 Iterator iterator = MetaData.getChildrenByTagName(element, "call-property"); 115 while (iterator.hasNext()) 116 { 117 Element propElement = (Element ) iterator.next(); 118 String name = MetaData.getUniqueChildContent(propElement, "prop-name"); 119 String value = MetaData.getUniqueChildContent(propElement, "prop-value"); 120 if( callProperties == null ) 121 callProperties = new Properties (); 122 callProperties.setProperty(name, value); 123 } 124 125 } 126 } 127 | Popular Tags |