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


     */
    private InterfaceContract getInterfaceContract(InterfaceContract interfaceContract, Class<?> businessInterface)
        throws CloneNotSupportedException, InvalidInterfaceException {
        boolean compatible = false;
        if (interfaceContract != null && interfaceContract.getInterface() != null) {
            Interface interfaze = interfaceContract.getInterface();
            if (interfaze instanceof JavaInterface) {
                Class<?> cls = ((JavaInterface)interfaze).getJavaClass();
                if (businessInterface.isAssignableFrom(cls)) {
                    compatible = true;
                }
View Full Code Here

                    binding = reference.getBinding(SCABinding.class);
                    if (binding == null) {
                        binding = reference.getBindings().get(0);
                    }
                }
                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.
View Full Code Here

   
    private void initializeInvocation() {
     
        __log.debug("Initializing BPELInvoker");

        Interface interfaze = operation.getInterface();
        if(interfaze instanceof WSDLInterface){
            WSDLInterface wsdlInterface = null;
            wsdlInterface = (WSDLInterface) interfaze;
           
            // The following commented out code is bogus and is replaced by what follows - Mike Edwards
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

            if (scopeContainer != null && currentConversationID != null) {
                scopeContainer.addWrapperReference(currentConversationID, conversation.getConversationID());
            }
        }

        Interface interfaze = msg.getFrom().getCallbackEndpoint().getInterfaceContract().getInterface();
        if (callbackObject != null) {
            if (callbackObject instanceof ServiceReference) {
                EndpointReference callbackRef = ((CallableReferenceExt<?>)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 {
                        if (!(callbackObject instanceof Serializable)) {
                            throw new IllegalArgumentException(
View Full Code Here

    public static Method findMethod(Class<?> implClass, Operation operation) throws NoSuchMethodException {
        String name = operation.getName();
        if (operation instanceof JavaOperation) {
            name = ((JavaOperation)operation).getJavaMethod().getName();
        }
        Interface interface1 = operation.getInterface();
        int numParams = operation.getInputType().getLogical().size();
        if (interface1 != null && interface1.isRemotable()) {
            List<Method> matchingMethods = new ArrayList<Method>();
            for (Method m : implClass.getMethods()) {
                if (m.getName().equals(name) && m.getParameterTypes().length == numParams) {
                    matchingMethods.add(m);
                }
View Full Code Here

    public static Method findMethod(Class<?> implClass, Operation operation) throws NoSuchMethodException {
        String name = operation.getName();
        if (operation instanceof JavaOperation) {
            name = ((JavaOperation)operation).getJavaMethod().getName();
        }
        Interface interface1 = operation.getInterface();
        int numParams = operation.getInputType().getLogical().size();
        if (interface1 != null && interface1.isRemotable()) {
            List<Method> matchingMethods = new ArrayList<Method>();
            for (Method m : implClass.getMethods()) {
                if (m.getName().equals(name) && m.getParameterTypes().length == numParams) {
                    matchingMethods.add(m);
                }
View Full Code Here

        return null;
    }

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

        }
    }

    @Test
    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.