use of com.sun.enterprise.deployment.NameValuePairDescriptor in project Payara by payara.
the class ServiceInvocationHandler method setStubProperties.
private void setStubProperties(Stub stub, int methodType, Method method, Object[] args) {
// Port info lookup will be based on SEI or port.
QName port = null;
String serviceEndpointInterface = null;
switch(methodType) {
case GET_PORT_CONTAINER_MANAGED:
serviceEndpointInterface = ((Class) args[0]).getName();
break;
case GET_PORT_CLIENT_MANAGED:
port = (QName) args[0];
serviceEndpointInterface = ((Class) args[1]).getName();
break;
case GENERATED_SERVICE_METHOD:
// java.rmi.Remote get<Name_of_wsdl:port>()
String portLocalPart = method.getName().startsWith("get") ? method.getName().substring(3) : null;
if (portLocalPart != null) {
QName serviceName = serviceRef.getServiceName();
port = new QName(serviceName.getNamespaceURI(), portLocalPart);
}
serviceEndpointInterface = method.getReturnType().getName();
break;
default:
return;
}
ServiceRefPortInfo portInfo = null;
// If port is known, it takes precedence in lookup.
if (port != null) {
portInfo = serviceRef.getPortInfoByPort(port);
}
if (portInfo == null) {
portInfo = serviceRef.getPortInfoBySEI(serviceEndpointInterface);
}
if (portInfo != null) {
Set properties = portInfo.getStubProperties();
for (Iterator iter = properties.iterator(); iter.hasNext(); ) {
NameValuePairDescriptor next = (NameValuePairDescriptor) iter.next();
stub._setProperty(next.getName(), next.getValue());
}
// precedence.
if (portInfo.hasTargetEndpointAddress()) {
if (!portInfo.hasStubProperty(Stub.ENDPOINT_ADDRESS_PROPERTY)) {
stub._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, portInfo.getTargetEndpointAddress());
}
}
}
}
use of com.sun.enterprise.deployment.NameValuePairDescriptor in project Payara by payara.
the class ServiceInvocationHandler method setCallProperties.
private void setCallProperties(Call call, Set callProperties) {
for (Iterator iter = callProperties.iterator(); iter.hasNext(); ) {
NameValuePairDescriptor next = (NameValuePairDescriptor) iter.next();
call.setProperty(next.getName(), next.getValue());
}
}
Aggregations