Package org.apache.tuscany.sca.interfacedef.java

Examples of org.apache.tuscany.sca.interfacedef.java.JavaInterface


    }
   
    private void postJAXWSProcessorResolve(JavaInterfaceContract javaInterfaceContract, ModelResolver resolver, ProcessorContext context)
        throws ContributionResolveException, IncompatibleInterfaceContractException {
       
        JavaInterface javaInterface = (JavaInterface)javaInterfaceContract.getInterface();
       
        // the Java interface may now be marked as unresolved due to a new Java interface
        // name retrieved from JAXWS annotations. Resolve it again if it is.
        if (javaInterface != null && javaInterface.isUnresolved()){
            javaInterface = resolveJavaInterface(javaInterface, resolver, context);
            javaInterfaceContract.setInterface(javaInterface);
        }
       
        JavaInterface javaCallbackInterface = (JavaInterface)javaInterfaceContract.getCallbackInterface();
        // the Java callback interface may now be marked as unresolved due to a new Java interface
        // name retrieved from JAXWS annotations. Resolve it again if it is.
        if (javaCallbackInterface != null && javaCallbackInterface.isUnresolved()){
            javaCallbackInterface = resolveJavaInterface(javaCallbackInterface, resolver, context);
            javaInterfaceContract.setCallbackInterface(javaCallbackInterface);
        }
       
        // the Java interface may be replaced by a WSDL contract picked up from JAXWS annotation
View Full Code Here


        // Set the name for the service
        service.setName(name);

        // Set the call interface and, if present, the callback interface
        JavaInterface callInterface = javaFactory.createJavaInterface(interfaze);
        service.getInterfaceContract().setInterface(callInterface);
        if (callInterface.getCallbackClass() != null) {
            JavaInterface callbackInterface = javaFactory.createJavaInterface(callInterface.getCallbackClass());
            service.getInterfaceContract().setCallbackInterface(callbackInterface);
        }
        return service;
    } // end method createService
View Full Code Here

        // to 1..1 - for Spring implementations, this is the only multiplicity supported
        reference.setName(name);
        reference.setMultiplicity(Multiplicity.ONE_ONE);

        // Set the call interface and, if present, the callback interface
        JavaInterface callInterface = javaFactory.createJavaInterface(interfaze);
        reference.getInterfaceContract().setInterface(callInterface);
        if (callInterface.getCallbackClass() != null) {
            JavaInterface callbackInterface = javaFactory.createJavaInterface(callInterface.getCallbackClass());
            reference.getInterfaceContract().setCallbackInterface(callbackInterface);
        }

        return reference;
    }
View Full Code Here

        RuntimeComponentReference reference = (RuntimeComponentReference)endpointReference.getReference();
        reference.setComponent((RuntimeComponent)endpointReference.getComponent());

        Interface i = reference.getInterfaceContract().getInterface();
        if (i instanceof JavaInterface) {
            JavaInterface javaInterface = (JavaInterface)i;
            if (javaInterface.isUnresolved()) {
                // Allow privileged access to get ClassLoader. Requires RuntimePermission in
                // security policy.
                ClassLoader classLoader = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
                    public ClassLoader run() {
                        return Thread.currentThread().getContextClassLoader();
                    }
                });

                javaInterface.setJavaClass(classLoader.loadClass(javaInterface.getName()));
                JavaInterfaceFactory javaInterfaceFactory = getJavaInterfaceFactory(compositeContext);

                try {
                    javaInterfaceFactory.createJavaInterface(javaInterface, javaInterface.getJavaClass());
                } catch (InvalidInterfaceException e) {
                    throw new ServiceRuntimeException(e);
                }
                //FIXME: If the interface needs XSDs to be loaded (e.g., for static SDO),
                // this needs to be done here.  We usually search for XSDs in the current
                // contribution at resolve time.  Is it possible to locate the current
                // contribution at runtime?
            }
            this.businessInterface = (Class<B>)javaInterface.getJavaClass();
        }

        Binding binding = endpointReference.getBinding();
        if (binding != null) {
            BindingBuilder bindingBuilder = builders.getBindingBuilder(binding.getType());
View Full Code Here

                if (businessInterface.isAssignableFrom(cls)) {
                    compatible = true;
                }
                if (!compatible) {
                    InterfaceContract biContract = javaInterfaceFactory.createJavaInterfaceContract();
                    JavaInterface callInterface = javaInterfaceFactory.createJavaInterface(businessInterface);
                    biContract.setInterface(callInterface);
                    if (callInterface.getCallbackClass() != null) {
                        biContract.setCallbackInterface(javaInterfaceFactory.createJavaInterface(callInterface
                            .getCallbackClass()));
                    }
                    InterfaceContractMapper ifcm = registry.getExtensionPoint(InterfaceContractMapper.class);
                    compatible = ifcm.isCompatibleSubset(biContract, interfaceContract);
        // If the business interface class is not assignable from the service interface class but
View Full Code Here

        RuntimeComponentService service = (RuntimeComponentService) to.getService();
        RuntimeComponentReference callbackReference = (RuntimeComponentReference)service.getCallbackReference();
        if (callbackReference == null) {
            return null;
        }
        JavaInterface javaInterface = (JavaInterface) callbackReference.getInterfaceContract().getInterface();
        Class<CB> javaClass = (Class<CB>)javaInterface.getJavaClass();
        List<EndpointReference> wires = callbackReference.getEndpointReferences();
        ServiceReferenceImpl ref = new CallbackServiceReferenceImpl(javaClass, wires);

        return ref;
    }
View Full Code Here

        this.resolvedEndpoint = new EndpointReferenceImpl(
                (RuntimeComponent) targetComponent, targetService, null,
                targetServiceIfaceContract);

        // Copy the Java Interface from the Service
        final JavaInterface ji = (JavaInterface) targetServiceIfaceContract.getInterface();
        this.businessInterface = (Class<B>) ji.getJavaClass();
       
        // We need to re-create the callback wire. We need to do this on a clone of the Service
        // wire since we need to change some details on it.
        // FIXME: Is this the best way to do this?
        final RuntimeWire cbWire = ((RuntimeComponentService) targetService).getRuntimeWires().get(0);
View Full Code Here

        }

        if (!compatible) {
            // The interface is not assignable from the interface contract
            interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
            JavaInterface callInterface = javaInterfaceFactory.createJavaInterface(businessInterface);
            interfaceContract.setInterface(callInterface);
            if (callInterface.getCallbackClass() != null) {
                interfaceContract.setCallbackInterface(javaInterfaceFactory.createJavaInterface(callInterface
                    .getCallbackClass()));
            }
        }

        return interfaceContract;
View Full Code Here

        RuntimeComponentService service = (RuntimeComponentService) to.getContract();
        RuntimeComponentReference callbackReference = (RuntimeComponentReference)service.getCallbackReference();
        if (callbackReference == null) {
            return null;
        }
        JavaInterface javaInterface = (JavaInterface) callbackReference.getInterfaceContract().getInterface();
        Class<CB> javaClass = (Class<CB>)javaInterface.getJavaClass();
        List<RuntimeWire> wires = callbackReference.getRuntimeWires();
        ProxyFactory proxyFactory = new ExtensibleProxyFactory(proxyFactoryExtensionPoint);
        CallbackReferenceImpl ref = CallbackReferenceImpl.newInstance(javaClass, proxyFactory, wires);
        if (ref != null) { 
            //ref.resolveTarget();
View Full Code Here

            monitor.problem(problem);
        }       
     }
   
    private JavaInterface createJavaInterface(String interfaceName) {
        JavaInterface javaInterface = javaFactory.createJavaInterface();
        javaInterface.setUnresolved(true);
        javaInterface.setName(interfaceName);
        return javaInterface;
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.interfacedef.java.JavaInterface

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.