Package org.apache.tuscany.sca.interfacedef

Examples of org.apache.tuscany.sca.interfacedef.Interface


            for(ComponentReference r: comp.getReferences()) {
                final Field f = impl.clazz.getDeclaredField(r.getName());
                f.setAccessible(true);
                // Inject a Java or WSDLReference proxy
                final Interface i = r.getInterfaceContract().getInterface();
                if(i instanceof JavaInterface)
                    f.set(instance, pxf.createProxy(comp.getComponentContext().getServiceReference(f.getType(), r.getName())));
                else
                    f.set(instance, new SampleWSDLProxy(asyncMessageMap, r.getEndpointReferences().get(0), i, ep));
            }
View Full Code Here


    protected Service createDynamicService() {
        Service dynamicService = assemblyFactory.createService();
        dynamicService.setName("$dynamic$");
        InterfaceContract dynamicInterfaceContract = new InterfaceContractImpl() {};
        Interface dynamicInterface = new InterfaceImpl() {
            @Override
            public boolean isDynamic() {
                return true;
            }
        };
        Operation dynamicOperation = assemblyFactory.createOperation();
        dynamicOperation.setDynamic(true);
        dynamicInterface.getOperations().add(dynamicOperation);
        dynamicInterfaceContract.setInterface(dynamicInterface);
        dynamicService.setInterfaceContract(dynamicInterfaceContract);

        return dynamicService;
    }
View Full Code Here

        }
    }

    protected Operation getOperation(AxisOperation axisOp) {
        String operationName = axisOp.getName().getLocalPart();
        Interface iface = wsBinding.getBindingInterfaceContract().getInterface();
        for (Operation op : iface.getOperations()) {
            if (op.getName().equalsIgnoreCase(operationName)) {
                return op;
            }
        }
        return null;
View Full Code Here

     * @throws NoSuchMethodException if no such method exists
     * @Deprecated
     */
    public static Method findMethod(Class<?> implClass, Operation operation) throws NoSuchMethodException {
        String name = operation.getName();
        Interface interface1 = operation.getInterface();
        if (interface1 != null && interface1.isRemotable()) {
            for (Method m : implClass.getMethods()) {
                if (m.getName().equals(name)) {
                    return m;
                }
            }
View Full Code Here

            processProperties(implementation.getServiceProperties(service.getName()), props);
        else
            processProperties(implementation.getServiceCallbackProperties(service.getName()), props);
       
        String filter = getOSGiFilter(props);
        Interface serviceInterface = service.getInterfaceContract().getInterface();
        String scaServiceName = service.getName();
           
        return getOSGiServiceReference(serviceInterface, filter, scaServiceName);
          
    }
View Full Code Here

                isOSGiToOSGiWire = true;
                   
                // If the target component is stateless, use a proxy to create a new service each time
                if (!implProvider.getScope().equals(Scope.COMPOSITE)) createProxy = true;
               
                Interface interfaze = wire.getTarget().getInterfaceContract().getInterface();
               
                // If the target interface is remotable, create a proxy to support pass-by-value semantics
                // AllowsPassByReference is not detected until the target instance is obtained.
                if (interfaze.isRemotable())
                    createProxy = true;
                   
                // If any of the operations in the target interface is non-blocking, create a proxy
                List<Operation> ops = interfaze.getOperations();
                for (Operation op : ops) {
                    if (op.isNonBlocking())
                        createProxy = true;
                }
                   
View Full Code Here

                   
                    isOSGiToOSGiWire[index] = wire.getTarget().getComponent() != null &&
                            wire.getTarget().getComponent().getImplementationProvider()
                            instanceof OSGiImplementationProvider;
                           
                    Interface refInterface = reference.getInterfaceContract().getInterface();
                    if (refInterface instanceof JavaInterface) {
                        interfaceClasses[index] = ((JavaInterface)refInterface).getJavaClass();
                   
                        if (!isOSGiToOSGiWire[index])
                            resolveWireCreateDummyBundles(interfaceClasses[index]);

                    }
                   
                    if (!resolvedWires.contains(wire)) {
                        resolvedWires.add(wire);                      
                    }
                    else
                        wireResolved[index] = true;
                   
                    index++;
                }
                for (ComponentService service : runtimeComponent.getServices()) {
                    Interface callbackInterface = service.getInterfaceContract().getCallbackInterface();
                    if (callbackInterface instanceof JavaInterface) {
                        interfaceClasses[index] = ((JavaInterface)callbackInterface).getJavaClass();
                       
                        resolveWireCreateDummyBundles(interfaceClasses[index]);
                    }
View Full Code Here

    }
   
    public Invoker createTargetInvoker(RuntimeComponentService service, Operation operation)  {
      
       
        Interface serviceInterface = operation.getInterface();
        boolean isRemotable = serviceInterface.isRemotable();


        Invoker invoker = new OSGiTargetInvoker(operation, this, service);
        if (isRemotable) {
            return new OSGiRemotableInvoker(osgiAnnotations, dataBindingRegistry, operation, this, service);
View Full Code Here

        this.binding = endpoint.getBinding();
        this.jaxrs = isJAXRSResource();
    }

    private boolean isJAXRSResource() {
        Interface interfaze = endpoint.getComponentServiceInterfaceContract().getInterface();
        if (interfaze instanceof JavaInterface) {
            if (JAXRSHelper.isJAXRSResource(((JavaInterface)interfaze).getJavaClass())) {
                return true;
            }
        }
View Full Code Here

        this.binding = endpoint.getBinding();
        this.jaxrs = isJAXRSResource();
    }

    private boolean isJAXRSResource() {
        Interface interfaze = endpoint.getComponentServiceInterfaceContract().getInterface();
        if (interfaze instanceof JavaInterface) {
            if (JAXRSHelper.isJAXRSResource(((JavaInterface)interfaze).getJavaClass())) {
                return true;
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.interfacedef.Interface

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.