Examples of ReferenceParameters


Examples of javax.xml.ws.addressing.ReferenceParameters

         {
            clientid = "clientid-" + (++maxClientId);
            log.info("New clientid: " + clientid);
         }

         ReferenceParameters refParams = replyTo.getReferenceParameters();
         refParams.addElement(getClientIdElement(clientid));

         msgContext.put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, outProps);
         msgContext.setScope(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_OUTBOUND, Scope.APPLICATION);
      }
      catch (URISyntaxException ex)
View Full Code Here

Examples of javax.xml.ws.addressing.ReferenceParameters

   {
      AddressingProperties addrProps = (AddressingProperties)msgContext.get(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES_INBOUND);
      if (addrProps == null)
         throw new IllegalStateException("Cannot obtain AddressingProperties");

      ReferenceParameters refParams = addrProps.getReferenceParameters();
      for (Object obj : refParams.getElements())
      {
         SOAPHeaderElement el = (SOAPHeaderElement)obj;
         QName qname = DOMUtils.getElementQName(el);
         if (qname.equals(IDQN))
         {
View Full Code Here

Examples of org.apache.tuscany.sca.runtime.ReferenceParameters

        //fill message with QoS context info
        fillQoSContext(msg, inMC);
       
        // if reference parameters are needed, create a new "From" EPR to hold them
        EndpointReference from = null;
        ReferenceParameters parameters = null;
        if (callbackAddress != null ||
            callbackID != null ||
            conversationID != null) {
            from = new EndpointReferenceImpl(null);
            parameters = from.getReferenceParameters();
            msg.setFrom(from);
        }

        // set the reference parameters into the "From" EPR
        if (callbackAddress != null) {
            parameters.setCallbackReference(new EndpointReferenceImpl(callbackAddress));
        }
        if (callbackID != null) {
            parameters.setCallbackID(callbackID);
        }
        if (conversationID != null) {
            parameters.setConversationID(conversationID);
        }

        // find the runtime wire and invoke it with the message
        RuntimeWire wire = ((RuntimeComponentService)contract).getRuntimeWire(getBinding());
        return wire.invoke(op, msg);
View Full Code Here

Examples of org.apache.tuscany.sca.runtime.ReferenceParameters

     * @param interfaze
     * @throws TargetResolutionException
     */
    private void handleCallback(Message msg, RuntimeWire wire, Object currentConversationID)
        throws TargetResolutionException {
        ReferenceParameters parameters = msg.getFrom().getReferenceParameters();
        parameters.setCallbackID(getCallbackID());
        if (wire.getSource() == null || wire.getSource().getCallbackEndpoint() == null) {
            return;
        }

        parameters.setCallbackReference(wire.getSource().getCallbackEndpoint());

        // If we are passing out a callback target
        // register the calling component instance against this
        // new conversation id so that stateful callbacks will be
        // able to find it
        Object callbackObject = getCallbackObject();
        if (conversational && callbackObject == null) {
            // the component instance is already registered
            // so add another registration
            ScopeContainer<Object> scopeContainer = getConversationalScopeContainer(wire);

            if (scopeContainer != null && currentConversationID != null) {
                scopeContainer.addWrapperReference(currentConversationID, conversation.getConversationID());
            }
        }

        Interface interfaze = msg.getOperation().getInterface();
        if (callbackObject != null) {
            if (callbackObject instanceof ServiceReference) {
                EndpointReference callbackRef = ((CallableReferenceImpl)callbackObject).getEndpointReference();
                parameters.setCallbackReference(callbackRef);
            } else {
                if (interfaze != null) {
                    if (!interfaze.isConversational()) {
                        throw new IllegalArgumentException(
                                                           "Callback object for stateless callback is not a ServiceReference");
                    } else {
                        ScopeContainer scopeContainer = getConversationalScopeContainer(wire);
                        if (scopeContainer != null) {
                            InstanceWrapper wrapper = new CallbackObjectWrapper(callbackObject);
                            scopeContainer.registerWrapper(wrapper, conversation.getConversationID());
                        }
                        parameters.setCallbackObjectID(callbackObject);
                    }
                }
            }
        }
    }
View Full Code Here

Examples of org.apache.tuscany.sca.runtime.ReferenceParameters

        }
        this.callback = callback;
    }

    protected ReferenceParameters getReferenceParameters() {
        ReferenceParameters parameters = super.getReferenceParameters();
        if (callback != null) {
            if (callback instanceof ServiceReference) {
                EndpointReference callbackRef = ((CallableReferenceImpl)callback).getEndpointReference();
                parameters.setCallbackReference(callbackRef);
            } else {
                EndpointReference callbackRef = getRuntimeWire().getSource().getCallbackEndpoint();
                parameters.setCallbackReference(callbackRef);
                parameters.setCallbackObjectID(callback);
            }
        }
        return parameters;
    }
View Full Code Here

Examples of org.apache.tuscany.sca.runtime.ReferenceParameters

        EndpointReference to = msgContext.getTo();
        RuntimeComponentService service = (RuntimeComponentService) to.getContract();
        RuntimeComponent component = (RuntimeComponent) to.getComponent();
       
        CallableReference<B> callableReference = component.getComponentContext().getCallableReference(null, component, service);
        ReferenceParameters parameters = msgContext.getFrom().getReferenceParameters();
        ((CallableReferenceImpl<B>) callableReference).attachCallbackID(parameters.getCallbackID());
        if (callableReference.getConversation() != null) {
            ((CallableReferenceImpl<B>) callableReference).attachConversationID(parameters.getConversationID());
        }
        return callableReference;
    }
View Full Code Here

Examples of org.apache.tuscany.sca.runtime.ReferenceParameters

        JavaInterface javaInterface = (JavaInterface) callbackReference.getInterfaceContract().getInterface();
        Class<CB> javaClass = (Class<CB>)javaInterface.getJavaClass();
        List<RuntimeWire> wires = callbackReference.getRuntimeWires();
        CallbackReferenceImpl ref = new CallbackReferenceImpl(javaClass, proxyFactory, wires);
        ref.resolveTarget();
        ReferenceParameters parameters = msgContext.getFrom().getReferenceParameters();
        ref.attachCallbackID(parameters.getCallbackID());
        if (ref.getConversation() != null) {
            ref.attachConversationID(parameters.getConversationID());
        }
        return ref;
    }
View Full Code Here

Examples of org.apache.tuscany.sca.runtime.ReferenceParameters

        init(wire);
    }

    protected void init(RuntimeWire wire) {
        if (wire != null) {
            ReferenceParameters parameters = wire.getSource().getReferenceParameters();
            this.callbackID = parameters.getCallbackID();
            this.callbackObject = parameters.getCallbackReference();
            this.conversationID = parameters.getConversationID();
            InterfaceContract contract = wire.getSource().getInterfaceContract();
            this.conversational = contract.getInterface().isConversational();
        }
    }
View Full Code Here

Examples of org.apache.tuscany.sca.runtime.ReferenceParameters

     * of this class.
     */
    @SuppressWarnings("unchecked")
    private void handleCallback(Message msg, Object currentConversationID) throws TargetResolutionException {
        EndpointReference from = msg.getFrom();
        ReferenceParameters parameters = from.getReferenceParameters();
        parameters.setCallbackID(callbackID);
        if (from == null || from.getCallbackEndpoint() == null) {
            return;
        }
        // If we are passing out a callback target
        // register the calling component instance against this
        // new conversation id so that stateful callbacks will be
        // able to find it
        if (conversational && callbackObject == null) {
            // the component instance is already registered
            // so add another registration
            ScopeContainer scopeContainer = getConversationalScopeContainer(msg);

            if (scopeContainer != null) {
                scopeContainer.addWrapperReference(currentConversationID, parameters.getConversationID());
            }
        }

        Interface interfaze = msg.getOperation().getInterface();
        if (callbackObject != null) {
            if (callbackObject instanceof ServiceReference) {
                EndpointReference callbackRef = ((CallableReferenceImpl)callbackObject).getEndpointReference();
                parameters.setCallbackReference(callbackRef);
            } else {
                if (interfaze != null) {
                    if (!interfaze.isConversational()) {
                        throw new IllegalArgumentException(
                                                           "Callback object for stateless callback is not a ServiceReference");
                    } else {
                        ScopeContainer scopeContainer = getConversationalScopeContainer(msg);
                        if (scopeContainer != null) {
                            InstanceWrapper wrapper = new CallbackObjectWrapper(callbackObject);
                            scopeContainer.registerWrapper(wrapper, conversation.getConversationID());
                        }
                        parameters.setCallbackObjectID(callbackObject);
                    }
                }
            }
        }
    }
View Full Code Here

Examples of org.apache.tuscany.sca.runtime.ReferenceParameters

     * @param msg
     * @throws TargetResolutionException
     */
    private void conversationPreinvoke(Message msg) {
        if (conversational) {
            ReferenceParameters parameters = msg.getFrom().getReferenceParameters();
            // in some cases the ConversationID that should be used comes in with the
            // message, e.g. when ws binding is in use.
            Object convID = parameters.getConversationID();
            if (convID != null) {
                conversationID = convID;
            }
            conversation = conversationManager.getConversation(conversationID);
           
            if (conversation == null || conversation.getState() == ConversationState.ENDED) {
                conversation = conversationManager.startConversation(conversationID);
            }
   
            parameters.setConversationID(conversation.getConversationID());
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.