1 26 27 package org.objectweb.jonas_ws.deployment.api; 28 29 import java.util.Iterator ; 30 import java.util.Properties ; 31 32 import javax.xml.namespace.QName ; 33 34 import org.objectweb.jonas_lib.I18n; 35 import org.objectweb.jonas_lib.deployment.xml.JonasCallProperty; 36 import org.objectweb.jonas_lib.deployment.xml.JonasPortComponentRef; 37 import org.objectweb.jonas_lib.deployment.xml.JonasStubProperty; 38 import org.objectweb.jonas_lib.deployment.xml.PortComponentRef; 39 40 46 public class PortComponentRefDesc { 47 48 49 private Class sei; 50 51 52 private String pcLink = null; 53 54 55 private PortComponentDesc pcDesc = null; 56 57 60 private Properties stubProperties = null; 61 62 65 private Properties callProperties = null; 66 67 70 private QName wsdlPort = null; 71 72 75 private static I18n i18n = I18n.getInstance(PortComponentRefDesc.class); 76 77 86 public PortComponentRefDesc(ClassLoader classLoader, PortComponentRef pcr, JonasPortComponentRef jpcr) throws WSDeploymentDescException { 87 88 String className = null; 89 stubProperties = new Properties (); 90 callProperties = new Properties (); 91 92 try { 93 className = pcr.getServiceEndpointInterface().trim(); 95 sei = classLoader.loadClass(className); 96 97 if (pcr.getPortComponentLink() != null) { 99 pcLink = pcr.getPortComponentLink().trim(); 100 } 101 102 if (jpcr != null) { 104 for (Iterator i = jpcr.getJonasCallPropertyList().iterator(); i.hasNext();) { 105 JonasCallProperty jp = (JonasCallProperty) i.next(); 106 callProperties.setProperty(jp.getParamName(), jp.getParamValue()); 107 } 108 for (Iterator i = jpcr.getJonasStubPropertyList().iterator(); i.hasNext();) { 109 JonasStubProperty jp = (JonasStubProperty) i.next(); 110 stubProperties.setProperty(jp.getParamName(), jp.getParamValue()); 111 } 112 if (jpcr.getWsdlPort() != null) { 113 wsdlPort = jpcr.getWsdlPort().getQName(); 114 } 115 } 116 } catch (ClassNotFoundException e) { 117 throw new WSDeploymentDescException(getI18n().getMessage("PortComponentRefDesc.seiNotFound", className), e); } 119 } 120 121 125 public String getPortComponentLink() { 126 return pcLink; 127 } 128 129 133 public void setPortComponentDesc(PortComponentDesc pcd) { 134 pcDesc = pcd; 135 } 136 137 141 public PortComponentDesc getPortComponentDesc() { 142 return pcDesc; 143 } 144 145 149 public Class getSEI() { 150 return sei; 151 } 152 153 156 public int hashCode() { 157 return sei.getName().hashCode(); 158 } 159 160 165 public boolean equals(Object other) { 166 if (other == null) { 167 return false; 168 } 169 170 if (!(other instanceof PortComponentRefDesc)) { 171 return false; 172 } 173 174 PortComponentRefDesc ref = (PortComponentRefDesc) other; 175 176 if (!sei.getName().equals(ref.getSEI().getName())) { 177 return false; 178 } 179 180 if (!pcLink.equals(ref.getPortComponentLink())) { 181 return false; 182 } 183 184 return true; 186 } 187 188 191 protected static I18n getI18n() { 192 return i18n; 193 } 194 195 198 public Properties getCallProperties() { 199 return callProperties; 200 } 201 202 205 public Properties getStubProperties() { 206 return stubProperties; 207 } 208 209 212 public QName getWsdlPort() { 213 return wsdlPort; 214 } 215 } | Popular Tags |