Package org.osoa.sca

Examples of org.osoa.sca.Conversation


            // it is expected that this call returns a reference to Gamma that
            // reuses the established Conversation
            gammaRef = beta.getRef();

            // no Conversation exists
            Conversation con = gammaRef.getConversation();
            if (con == null) {
                System.out.println("Alpha1: Conversation to gamma is null");
            } else {
                System.out
                        .println("Alpha1: Conversation to gamma exists. conversationId="
                                + con.getConversationID());
                conversationId1 = con.getConversationID();               
            }

            // this call should reuse a Conversation, but as none exists it
            // creates a new conversation
            gammaRef.getService().doSomething();
            gammaRef.getService().doSomething();
            gammaRef.getService().doSomething();
           
            con = gammaRef.getConversation();
            if (con == null) {
                System.out.println("Alpha2: Conversation to gamma is null");
            } else {
                System.out
                        .println("Alpha2: Conversation to gamma exists. conversationId="
                                + con.getConversationID());
                conversationId2 = con.getConversationID();               
            }
           
            boolean testPassed = conversationId1.equals(conversationId2);
           
            if (conversationId0 == null){
View Full Code Here


            // it is expected that this call returns a reference to Gamma that
            // reuses the established Conversation
            gammaRef = beta.getRef();

            // no Conversation exists
            Conversation con = gammaRef.getConversation();
            if (con == null) {
                System.out.println("Alpha: Conversation to gamma is null");
            } else {
                System.out
                        .println("Alpha: Conversation to gamma exists. conversationId="
                                + con.getConversationID());
                conversationId1 = con.getConversationID();
            }

            // this call should reuse a Conversation, but as none exists it
            // creates a new conversation
            gammaRef.getService().doSomething();
            con = gammaRef.getConversation();
            if (con == null) {
                System.out.println("Alpha: Conversation to gamma is null");
            } else {
                System.out
                        .println("Alpha: Conversation to gamma exists. conversationId="
                                + con.getConversationID());
                conversationId2 = con.getConversationID();
            }

            if ((conversationId1 == null) || (conversationId2 == null)) {
                return false;
            }
View Full Code Here

    public void testConversation() {
        ServiceReference<BComponent> bSR = componentContext.getServiceReference(BComponent.class, "bReference");
        bSR.setConversationID("AConversationID");
        bSR.getService().testCustomConversationID();

        Conversation bc = bSR.getConversation();
        Assert.assertEquals("AConversationID", bc.getConversationID());
        bc.end();

        Assert.assertEquals("ComponentB", bReference.getService().getName());
        bReference.getService().testGeneratedConversationID(bReference.getConversation().getConversationID());
        bReference.getConversation().end();
View Full Code Here

    public Object getConversationID() {
        return conversationID;
    }

    public void setConversationID(Object conversationID) throws IllegalStateException {
        Conversation conversation = getConversation();
        if (conversation == null) {
            if (conversationID == null) {
                this.conversationID = UUID.randomUUID().toString();
            } else {
                this.conversationID = conversationID;
View Full Code Here

TOP

Related Classes of org.osoa.sca.Conversation

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.