Examples of Interface


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

            return;
        }
        JavaImplementation javaImpl = (JavaImplementation)implementation;
        EndpointReference callbackEndpoint = wire.getSource().getCallbackEndpoint();
        if (callbackEndpoint != null) {
            Interface iface = callbackEndpoint.getContract().getInterfaceContract().getInterface();
            if (!supportsCallbackInterface(iface, javaImpl)) {
                // callback to this impl is not possible, so ensure a callback object is set
                for (InvocationChain chain : wire.getInvocationChains()) {
                    chain.addInterceptor(Phase.REFERENCE, new CallbackInterfaceInterceptor());
                }
View Full Code Here

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

            if (ifaceClass.isAssignableFrom(impl.getJavaClass())) {
                return true;
            }
        }
        try {
            Interface implType = javaInterfaceFactory.createJavaInterface(impl.getJavaClass());
            // Ignore the remotable/conversational testing
            implType.setRemotable(iface.isRemotable());
            implType.setConversational(iface.isConversational());
            return interfaceContractMapper.isCompatible(iface, implType);
        } catch (InvalidInterfaceException e) {
            logger.log(Level.WARNING, e.getMessage(), e);
            return false;
        }
View Full Code Here

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

        }
        return null;
    }

    public static boolean matches(Contract contract, Class<?> type) {
        Interface interface1 = contract.getInterfaceContract().getInterface();
        if (interface1 instanceof JavaInterface) {
            return type == ((JavaInterface)interface1).getJavaClass();
        } else {
            return false;
        }
View Full Code Here

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

    }

   
    private void initializeInvocation() {
     
        Interface interfaze = operation.getInterface();
        if(interfaze instanceof WSDLInterface){
            WSDLInterface wsdlInterface = null;
            wsdlInterface = (WSDLInterface) interfaze;
           
            Service serviceDefinition = (Service) wsdlInterface.getWsdlDefinition().getDefinition().getAllServices().values().iterator().next();
View Full Code Here

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

    private class MockContract<T> extends InterfaceContractImpl {
        public MockContract() {
        }

        public MockContract(String interfaceClass) {
            Interface jInterface = new MockInterface();
            setInterface(jInterface);
        }
View Full Code Here

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

     * @throws java.lang.Exception
     */
    @Before
    public void setUp() throws Exception {
        contract = new MockInterfaceContract();
        Interface i1 = new MockInterface();
        contract.setInterface(i1);
        Operation op1 = newOperation("op1");
        i1.getOperations().add(op1);
        Interface i2 = new MockInterface();
        contract.setCallbackInterface(i2);
        Operation callbackOp1 = newOperation("callbackOp1");
        i2.getOperations().add(callbackOp1);
    }
View Full Code Here

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

        // Mock up the Service. Basically, it is going to call:
        // List<Operation> opList = service.getInterfaceContract().getInterface().getOperations();
        final InterfaceContract ifaceContract = EasyMock.createStrictMock(InterfaceContract.class);
        final RuntimeComponentService service = EasyMock.createStrictMock(RuntimeComponentService.class);
        final Interface iface = EasyMock.createStrictMock(Interface.class);
        EasyMock.expect(iface.getOperations()).andReturn(operations);
        EasyMock.expect(ifaceContract.getInterface()).andReturn(iface);
        EasyMock.expect(service.getInterfaceContract()).andReturn(ifaceContract);

        // Mock up getting and invoking the RuntimeWire. It is going to call:
        // service.getRuntimeWire(jmsBinding).invoke(operation, (Object[])requestPayload);
View Full Code Here

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

    protected Service createDynamicService() {
        Service dynamicService = assemblyFactory.createService();
        dynamicService.setName("$dynamic$");
        InterfaceContract dynamicInterfaceContract = new InterfaceContractImpl() {};
        Interface dynamicInterface = new DynamicInterfaceImpl();
        Operation dynamicOperation = new OperationImpl();
        dynamicOperation.setDynamic(true);
        dynamicInterface.getOperations().add(dynamicOperation);
        dynamicInterfaceContract.setInterface(dynamicInterface);
        dynamicService.setInterfaceContract(dynamicInterfaceContract);

        return dynamicService;
    }
View Full Code Here

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

            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) {
View Full Code Here

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

     * @throws CloneNotSupportedException
     * @throws InvalidInterfaceException
     */
    private InterfaceContract getInterfaceContract(InterfaceContract interfaceContract, Class<?> businessInterface)
        throws CloneNotSupportedException, InvalidInterfaceException {
        Interface interfaze = interfaceContract.getInterface();
        boolean compatible = false;
        if (interfaze instanceof JavaInterface) {
            Class<?> cls = ((JavaInterface)interfaze).getJavaClass();
            if (businessInterface.isAssignableFrom(cls)) {
                compatible = true;
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.