Package org.apache.tuscany.sca.assembly

Examples of org.apache.tuscany.sca.assembly.EndpointReference


        this.registry = registry;
    }

    @Override
    public Object clone() throws CloneNotSupportedException {
        EndpointReference cloned = (EndpointReference)super.clone();

        if (targetEndpoint != null) {
            cloned.setTargetEndpoint((Endpoint)targetEndpoint.clone());
        }

        return cloned;
    }
View Full Code Here


        }
        Object payload = msg.getBody();

        Object contextId = null;

        EndpointReference from = msg.getFrom();

        // store the current thread context classloader
        // as we need to replace it with the class loader
        // used to load the java class as per SCA Spec
        ClassLoader tccl = Thread.currentThread().getContextClassLoader();
View Full Code Here

        }
    }   
   
    public Message invokeRequest(Message msg) {

            EndpointReference from = assemblyFactory.createEndpointReference();
            Endpoint fromEndpoint = assemblyFactory.createEndpoint();
            from.setTargetEndpoint(fromEndpoint);
            from.setStatus(EndpointReference.Status.WIRED_TARGET_FOUND_AND_MATCHED);
            msg.setFrom(from);
            Endpoint callbackEndpoint = assemblyFactory.createEndpoint();
//            callbackEndpoint.setURI(callbackAddress); // TODO: is this needed? Seems to work without it
            callbackEndpoint.setUnresolved(true);
            from.setCallbackEndpoint(callbackEndpoint);

            return msg;

    } // end method invokeRequest
View Full Code Here

        assertEquals(policiedComposite.getRequiredIntents().get(0).getName(),
                     new QName(namespaceUri, "tuscanyIntent_1"));

        Component component = composite.getComponents().get(0);
        Endpoint ep = component.getServices().get(0).getEndpoints().get(0);
        EndpointReference epr = component.getReferences().get(0).getEndpointReferences().get(0);

        System.out.println(ep.getRequiredIntents());
        System.out.println(epr.getRequiredIntents());
    }
View Full Code Here

    private String getContext() {
        if (subject instanceof Endpoint) {
            Endpoint endpoint = (Endpoint)subject;
            return endpoint.getURI();
        } else if (subject instanceof EndpointReference) {
            EndpointReference endpointReference = (EndpointReference)subject;
            return endpointReference.getURI();
        } else if (subject instanceof Component) {
            Component component = (Component)subject;
            return component.getURI();
        }
        return null;
View Full Code Here

      ref.getTargets().clear();
      ref.getBindings().clear();
      ref.getEndpointReferences().clear();
     
      // clone epr
      EndpointReference callbackEndpointReference = (EndpointReference)reference.getEndpointReferences().get(0).clone();
      callbackEndpointReference.setReference(ref);
      callbackEndpointReference.setTargetEndpoint(callbackEndpoint);
      callbackEndpointReference.setUnresolved(true);
     
      // The callback endpoint will be resolved when the wire chains are created
      ref.getEndpointReferences().add(callbackEndpointReference);
      return (RuntimeEndpointReference) ref.getEndpointReferences().get(0);
    } catch ( CloneNotSupportedException e ) {
View Full Code Here

                            }
                        }
                       
                        if (autowireEndpoint == null){
                            // create new EPR for autowire
                            EndpointReference autowireEndpointRefrence = null;
                            try {
                                autowireEndpointRefrence = (EndpointReference)endpointReference.clone();
                            } catch (Exception ex){
                                // won't happen as clone is supported
                            }
                           
                            autowireEndpointRefrence.setTargetEndpoint(endpoint);
                            autowireEndpointRefrence.setBinding(endpoint.getBinding());
                            autowireEndpointRefrence.setStatus(EndpointReference.Status.WIRED_TARGET_FOUND_AND_MATCHED);
                            endpointReference.getReference().getEndpointReferences().add(autowireEndpointRefrence)
                        }
                    }
//              }
            }
View Full Code Here

    private void createCallbackEPR( String callbackAddress, MessageContext inMC, Message msg ) throws AxisFault {
        if (callbackAddress != null ) {
          // Check for special (& not allowed!) WS_Addressing values
          checkCallbackAddress( callbackAddress, inMC );
          //
          EndpointReference from = assemblyFactory.createEndpointReference();
            Endpoint fromEndpoint = assemblyFactory.createEndpoint();
            from.setTargetEndpoint(fromEndpoint);
            from.setStatus(EndpointReference.Status.WIRED_TARGET_FOUND_AND_MATCHED);
            msg.setFrom(from);
            RuntimeEndpoint callbackEndpoint = (RuntimeEndpoint)assemblyFactory.createEndpoint();
            //
            WebServiceBinding cbBinding = webServiceBindingFactory.createWebServiceBinding();
            cbBinding.setURI(callbackAddress);
            callbackEndpoint.setBinding(cbBinding);
            //
            callbackEndpoint.setURI(callbackAddress);
            callbackEndpoint.setUnresolved(true);
            from.setCallbackEndpoint(callbackEndpoint);
        } // end if
    } // end method createCallbackEPR
View Full Code Here

     * @param serviceName - the service name
     * @return - and Endpoint which is the Callback endpoint for the service for this process instance.
     * Returns null if there is no callback metadata for this service.
     */
    public EndpointReference getCallbackMetadata( Long processID, String serviceName ) {
      EndpointReference theEPR;
      //System.out.println("Get callback metadata: ProcessID " + processID.toString() + " service: " + serviceName);
     
      metadataLock.lock();
      try {
        while(true) {
View Full Code Here

        componentReference.setInterfaceContract(interfaceContract);
        componentReference.setMultiplicity(Multiplicity.ONE_ONE);
        // component.getReferences().add(componentReference);

        // create endpoint reference
        EndpointReference endpointReference = assemblyFactory.createEndpointReference();
        endpointReference.setComponent(component);
        endpointReference.setReference(componentReference);
        endpointReference.setBinding(endpoint.getBinding());
        endpointReference.setUnresolved(false);
        endpointReference.setStatus(EndpointReference.Status.WIRED_TARGET_FOUND_READY_FOR_MATCHING);

        endpointReference.setTargetEndpoint(endpoint);

        componentReference.getEndpointReferences().add(endpointReference);
        ((RuntimeComponentReference)componentReference).setComponent((RuntimeComponent)component);
        ((RuntimeEndpointReference)endpointReference).bind(compositeContext);
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.assembly.EndpointReference

Copyright © 2018 www.massapicom. 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.