Search in sources :

Example 1 with ServiceRefPortInfo

use of com.sun.enterprise.deployment.ServiceRefPortInfo in project Payara by payara.

the class ComponentValidator method accept.

/**
 * Visits a service reference for the last J2EE component visited
 *
 * @param serviceRef the service reference
 */
@Override
protected void accept(ServiceReferenceDescriptor serviceRef) {
    Set portsInfo = serviceRef.getPortsInfo();
    for (Iterator iter = portsInfo.iterator(); iter.hasNext(); ) {
        ServiceRefPortInfo next = (ServiceRefPortInfo) iter.next();
        if (next.hasPortComponentLinkName() && !next.isLinkedToPortComponent()) {
            WebServiceEndpoint portComponentLink = next.resolveLinkName();
            if (portComponentLink == null) {
                String linkName = next.getPortComponentLinkName();
                DOLUtils.getDefaultLogger().log(Level.WARNING, DOLUtils.INVALID_DESC_MAPPING, new Object[] { "port-component", linkName });
            }
        }
    }
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) WebServiceEndpoint(com.sun.enterprise.deployment.WebServiceEndpoint) Iterator(java.util.Iterator) ServiceRefPortInfo(com.sun.enterprise.deployment.ServiceRefPortInfo)

Example 2 with ServiceRefPortInfo

use of com.sun.enterprise.deployment.ServiceRefPortInfo in project Payara by payara.

the class ServiceInvocationHandler method getPropertiesForCall.

private Set getPropertiesForCall(int methodType, Object[] args) {
    Set callProperties = null;
    switch(methodType) {
        case CREATE_CALL_PORT:
        case CREATE_CALL_OPERATION_QNAME:
        case CREATE_CALL_OPERATION_STRING:
        case GET_CALLS:
            // Each of these methods has port as first argument.
            QName port = (QName) args[0];
            // Check if call properties are set at the port level.
            ServiceRefPortInfo portInfo = serviceRef.getPortInfoByPort(port);
            if (portInfo != null) {
                callProperties = portInfo.getCallProperties();
            }
            break;
        case CREATE_CALL_NO_ARGS:
            callProperties = serviceRef.getCallProperties();
            break;
        default:
            break;
    }
    return callProperties;
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) QName(javax.xml.namespace.QName) ServiceRefPortInfo(com.sun.enterprise.deployment.ServiceRefPortInfo)

Example 3 with ServiceRefPortInfo

use of com.sun.enterprise.deployment.ServiceRefPortInfo in project Payara by payara.

the class ServiceReferenceNode method writeDeploymentDescriptor.

public Node writeDeploymentDescriptor(Node parent, ServiceReferenceDescriptor descriptor) {
    Node serviceRefNode = super.writeDescriptor(parent, WebServicesTagNames.SERVICE_REF, descriptor);
    writeDisplayableComponentInfo(serviceRefNode, descriptor);
    appendTextChild(serviceRefNode, WebServicesTagNames.SERVICE_REF_NAME, descriptor.getName());
    appendTextChild(serviceRefNode, WebServicesTagNames.SERVICE_INTERFACE, descriptor.getServiceInterface());
    appendTextChild(serviceRefNode, TagNames.LOOKUP_NAME, descriptor.getLookupName());
    appendTextChild(serviceRefNode, WebServicesTagNames.SERVICE_REF_TYPE, descriptor.getInjectionTargetType());
    appendTextChild(serviceRefNode, WebServicesTagNames.WSDL_FILE, descriptor.getWsdlFileUri());
    appendTextChild(serviceRefNode, WebServicesTagNames.JAXRPC_MAPPING_FILE, descriptor.getMappingFileUri());
    if (descriptor.hasServiceName()) {
        QName serviceName = descriptor.getServiceName();
        appendQNameChild(WebServicesTagNames.SERVICE_QNAME, serviceRefNode, serviceName.getNamespaceURI(), serviceName.getLocalPart(), descriptor.getServiceNameNamespacePrefix());
    }
    for (Iterator iter = descriptor.getPortsInfo().iterator(); iter.hasNext(); ) {
        ServiceRefPortInfo next = (ServiceRefPortInfo) iter.next();
        String sei = next.getServiceEndpointInterface();
        Node portComponentRefNode = appendChild(serviceRefNode, WebServicesTagNames.PORT_COMPONENT_REF);
        appendTextChild(portComponentRefNode, WebServicesTagNames.SERVICE_ENDPOINT_INTERFACE, sei);
        appendTextChild(portComponentRefNode, WebServicesTagNames.ENABLE_MTOM, next.getMtomEnabled());
        if (descriptor.getAddressing() != null) {
            AddressingNode adNode = new AddressingNode();
            adNode.writeDescriptor(portComponentRefNode, WebServicesTagNames.ADDRESSING, descriptor.getAddressing());
        }
        appendTextChild(portComponentRefNode, WebServicesTagNames.PORT_COMPONENT_LINK, next.getPortComponentLinkName());
    }
    WebServiceHandlerNode handlerNode = new WebServiceHandlerNode();
    handlerNode.writeWebServiceHandlers(serviceRefNode, descriptor.getHandlers());
    WebServiceHandlerChainNode handlerChainNode = new WebServiceHandlerChainNode();
    handlerChainNode.writeWebServiceHandlerChains(serviceRefNode, descriptor.getHandlerChain());
    appendTextChild(serviceRefNode, WebServicesTagNames.MAPPED_NAME, descriptor.getMappedName());
    if (descriptor.isInjectable()) {
        InjectionTargetNode ijNode = new InjectionTargetNode();
        for (InjectionTarget target : descriptor.getInjectionTargets()) {
            ijNode.writeDescriptor(serviceRefNode, TagNames.INJECTION_TARGET, target);
        }
    }
    return serviceRefNode;
}
Also used : InjectionTargetNode(com.sun.enterprise.deployment.node.InjectionTargetNode) QName(javax.xml.namespace.QName) JndiEnvRefNode(com.sun.enterprise.deployment.node.JndiEnvRefNode) InjectionTargetNode(com.sun.enterprise.deployment.node.InjectionTargetNode) Node(org.w3c.dom.Node) DisplayableComponentNode(com.sun.enterprise.deployment.node.DisplayableComponentNode) Iterator(java.util.Iterator) InjectionTarget(com.sun.enterprise.deployment.InjectionTarget) ServiceRefPortInfo(com.sun.enterprise.deployment.ServiceRefPortInfo)

Example 4 with ServiceRefPortInfo

use of com.sun.enterprise.deployment.ServiceRefPortInfo in project Payara by payara.

the class WebServicesDelegateImpl method getBinding.

public MessageSecurityBindingDescriptor getBinding(ServiceReferenceDescriptor svcRef, Map properties) {
    MessageSecurityBindingDescriptor binding = null;
    WSDLPort p = (WSDLPort) properties.get("WSDL_MODEL");
    QName portName = null;
    if (p != null) {
        portName = p.getName();
    }
    if (portName != null) {
        ServiceRefPortInfo i = svcRef.getPortInfoByPort(portName);
        if (i != null) {
            binding = i.getMessageSecurityBinding();
        }
    }
    return binding;
}
Also used : MessageSecurityBindingDescriptor(com.sun.enterprise.deployment.runtime.common.MessageSecurityBindingDescriptor) QName(javax.xml.namespace.QName) ServiceRefPortInfo(com.sun.enterprise.deployment.ServiceRefPortInfo) WSDLPort(com.sun.xml.ws.api.model.wsdl.WSDLPort)

Example 5 with ServiceRefPortInfo

use of com.sun.enterprise.deployment.ServiceRefPortInfo in project Payara by payara.

the class JAXWSServiceDelegate method getPort.

public Object getPort(Class sei) {
    checkUnsupportedMethods(GET_PORT_CONTAINER_MANAGED);
    String serviceEndpointInterface = sei.getName();
    ServiceRefPortInfo portInfo = serviceRef.getPortInfo(serviceEndpointInterface);
    Object retVal;
    if ((portInfo != null) && portInfo.hasWsdlPort()) {
        retVal = getPort(portInfo.getWsdlPort(), sei);
    } else {
        retVal = serviceDelegate.getPort(sei);
    }
    return retVal;
}
Also used : ServiceRefPortInfo(com.sun.enterprise.deployment.ServiceRefPortInfo)

Aggregations

ServiceRefPortInfo (com.sun.enterprise.deployment.ServiceRefPortInfo)9 Iterator (java.util.Iterator)4 Set (java.util.Set)4 QName (javax.xml.namespace.QName)4 HashSet (java.util.HashSet)3 NameValuePairDescriptor (com.sun.enterprise.deployment.NameValuePairDescriptor)2 MessageSecurityBindingDescriptor (com.sun.enterprise.deployment.runtime.common.MessageSecurityBindingDescriptor)2 InjectionTarget (com.sun.enterprise.deployment.InjectionTarget)1 WebServiceEndpoint (com.sun.enterprise.deployment.WebServiceEndpoint)1 DisplayableComponentNode (com.sun.enterprise.deployment.node.DisplayableComponentNode)1 InjectionTargetNode (com.sun.enterprise.deployment.node.InjectionTargetNode)1 JndiEnvRefNode (com.sun.enterprise.deployment.node.JndiEnvRefNode)1 WSDLPort (com.sun.xml.ws.api.model.wsdl.WSDLPort)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Method (java.lang.reflect.Method)1 Call (javax.xml.rpc.Call)1 Stub (javax.xml.rpc.Stub)1 HandlerInfo (javax.xml.rpc.handler.HandlerInfo)1 Binding (javax.xml.ws.Binding)1 SOAPBinding (javax.xml.ws.soap.SOAPBinding)1