Package org.apache.tuscany.sca.interfacedef

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


        // 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

    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

            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

     * @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

    protected void setXMLDataBinding(RuntimeComponentService service) {
        if (service.getInterfaceContract() != null) {
            try {
                InterfaceContract ic = (InterfaceContract)service.getInterfaceContract().clone();

                Interface ii = (Interface)ic.getInterface().clone();
                ii.resetDataBinding("org.apache.axiom.om.OMElement");
                ic.setInterface(ii);
                service.setInterfaceContract(ic);

            } catch (CloneNotSupportedException e) {
                throw new RuntimeException(e);
View Full Code Here

    protected void setXMLDataBinding(RuntimeComponentReference reference) {
        try {
            InterfaceContract ic = (InterfaceContract)reference.getInterfaceContract().clone();

            Interface ii = (Interface)ic.getInterface().clone();
            ii.resetDataBinding("org.apache.axiom.om.OMElement");
            ic.setInterface(ii);
            reference.setInterfaceContract(ic);

        } catch (CloneNotSupportedException e) {
            throw new RuntimeException(e);
View Full Code Here

     * @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

        }
        return null;
    }

    public void testServiceContractConversationalInformationIntrospection() throws Exception {
        Interface i = javaFactory.createJavaInterface(Foo.class);
        assertNotNull(i);
        assertTrue(i.isConversational());
        ConversationSequence seq = getOperation(i, "operation").getConversationSequence();
        assertEquals(ConversationSequence.CONVERSATION_CONTINUE, seq);
        seq = getOperation(i, "endOperation").getConversationSequence();
        assertEquals(ConversationSequence.CONVERSATION_END, seq);
    }
View Full Code Here

            // expected
        }
    }

    public void testNonConversationalInformationIntrospection() throws Exception {
        Interface i = javaFactory.createJavaInterface(NonConversationalFoo.class);
        assertFalse(i.isConversational());
        ConversationSequence seq = getOperation(i, "operation")
            .getConversationSequence();
        assertEquals(ConversationSequence.CONVERSATION_NONE, seq);
    }
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.