Package org.apache.tuscany.sca.interfacedef

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


                   
                    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

        // used by the bundle.
        if (service.isCallback()) {
          Iterator<InstanceInfo<T>> instances = instanceInfoList.values().iterator();
          while (instances.hasNext()) {
            InstanceInfo<T> instanceInfo = instances.next();
            Interface interfaze = service.getInterfaceContract().getInterface();
            if (interfaze instanceof JavaInterface && ((JavaInterface)interfaze).getJavaClass() != null) {
              String interfaceName = ((JavaInterface)interfaze).getJavaClass().getName();
              Class[] interfaces = instanceInfo.osgiInstance.getClass().getInterfaces();
              for (Class clazz : interfaces) {
                if (clazz.getName().equals(interfaceName)) {
View Full Code Here

            // the service interface.  This isn't foolproof, as it's possible that
            // the service interface isn't a Java interface, or that the callback
            // object has the right method signature without implementing the
            // callback interface.  There is code in JavaImplementationInvoker
            // to deal with these possibilities.
            Interface iface = service.getInterfaceContract().getInterface();
            if (iface instanceof JavaInterface) {
                try {
                    Method method = JavaInterfaceUtil.findMethod(((JavaInterface)iface).getJavaClass(), operation);
                    return new JavaImplementationInvoker(operation, method, componentContextProvider.getComponent(), service.getInterfaceContract());
                } catch (NoSuchMethodException e1) {
View Full Code Here

        if (callInterface.getCallbackClass() != null) {
            JavaInterface callbackInterface = javaInterfaceFactory.createJavaInterface(callInterface.getCallbackClass());
            service.getInterfaceContract().setCallbackInterface(callbackInterface);
        }

        Interface javaInterface = service.getInterfaceContract().getInterface();
        javaInterface.setRemotable(interfaze.getAnnotation(Remotable.class) != null);
        service.getInterfaceContract().setInterface(javaInterface);
        return service;
    }
View Full Code Here

     * @param services
     * @return
     */
    private static boolean isInServiceInterface(Method operation, List<org.apache.tuscany.sca.assembly.Service> services) {
        for (org.apache.tuscany.sca.assembly.Service service : services) {
            Interface interface1 = service.getInterfaceContract().getInterface();
            if (interface1 instanceof JavaInterface) {
                Class<?> clazz = ((JavaInterface)interface1).getJavaClass();
                if (isMethodMatched(clazz, operation)) {
                    return true;
                }
View Full Code Here

        }
        return handler;
    }

    private void findInterface(Endpoint endpoint) throws MalformedURLException, ClassNotFoundException {
        Interface iface = endpoint.getService().getInterfaceContract().getInterface();
        if (iface instanceof JavaInterface) {
            String curi = domainRegistry.getContainingCompositesContributionURI(endpoint.getComponent().getName());
            if (curi != null) {
                ContributionDescription ic = domainRegistry.getInstalledContribution(curi);
                ClassLoader cl = new URLClassLoader(new URL[]{new URL(ic.getURL())});
View Full Code Here

        if (businessInterface == null) {
            return interfaceContract;
        }
        boolean compatible = false;
        if (interfaceContract != null && interfaceContract.getInterface() != null) {
            Interface interfaze = interfaceContract.getInterface();
            if (interfaze instanceof JavaInterface) {
                Class<?> cls = ((JavaInterface)interfaze).getJavaClass();
                if (cls != null && businessInterface.isAssignableFrom(cls)) {
                    compatible = true;
                }
View Full Code Here

        Component component = null;

        for (Component compositeComponent : domainComposite.getComponents()) {
            if (componentName == null) {
                for (ComponentService service : compositeComponent.getServices()) {
                    Interface intf = service.getInterfaceContract().getInterface();
                    if (intf instanceof JavaInterface) {
                        JavaInterface ji = (JavaInterface)intf;
                        if (ji.getJavaClass() == businessInterface) {
                            return ((RuntimeComponent)compositeComponent).getComponentContext()
                                .createSelfReference(businessInterface, service);
View Full Code Here

        }
    }   
   
    private static Operation getOperation(AxisOperation axisOp,WebServiceBinding wsBinding) {
        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

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.