Package org.apache.wsif

Examples of org.apache.wsif.WSIFCorrelationService


        sendJmsMessage(input);
      } else {
        if (handler == null) {
          correlId = new WSIFJMSCorrelationId(sendJmsMessage(input));
        } else {
          WSIFCorrelationService cs =
            WSIFCorrelationServiceLocator.getCorrelationService();
          synchronized (cs) {
            correlId =
              new WSIFJMSCorrelationId(sendJmsMessage(input));
            //register it to the correlation service
            cs.put(correlId, this, asyncTimeout);
          }
        }
      }
    } catch (Exception ex) {
      Trc.exception(ex);
View Full Code Here


        // only save op in the correlation service if there's a response handler
        if ( wsifOp.getResponseHandler() == null ) {
            msgID = destination.send(payloadSW.toString(), null);
            cid = new WSIFJMSCorrelationId( msgID );
        } else {
           WSIFCorrelationService correlator =
              WSIFCorrelationServiceLocator.getCorrelationService();
           synchronized( correlator ) {  
              msgID = destination.send(payloadSW.toString(), null);
              cid = new WSIFJMSCorrelationId( msgID );
              if ( correlator != null ) {
                 correlator.put(
                    cid,
                    (Serializable)getWsifOperation(),
                    asyncTimeout );
              }
           }
View Full Code Here

               (Long)messageContext.getProperty(WSIFJmsTransport.ASYNC_TIMEOUT);
            long asyncTimeout =
               transportAsyncTimeoutValue==null
               ? ASYNC_TIMEOUT
               : transportAsyncTimeoutValue.longValue();
           WSIFCorrelationService correlator =
              WSIFCorrelationServiceLocator.getCorrelationService();
           synchronized( correlator ) {  
              msgID = dest.send( data );
              cid = new WSIFJMSCorrelationId( msgID );
              if ( correlator != null ) {
                 correlator.put( cid, (Serializable)wsifOp, asyncTimeout );
              }
           }
        }
         
View Full Code Here

        return correlationService;
    }

    static private WSIFCorrelationService findCorrelationService() {
        Trc.entry(null);
        WSIFCorrelationService cs = null;
        ;
        try {
            Context ctx = new InitialContext();
            Object o = ctx.lookup(WSIFConstants.CORRELATION_SERVICE_NAMESPACE);
            if (o != null && o instanceof WSIFCorrelationService) {
                cs = (WSIFCorrelationService) o;
            }
        } catch (Exception ex) {
            Trc.ignoredException(ex);
        } finally {
            if (cs == null) {
                cs = new WSIFDefaultCorrelationService();
            }
        }

        MessageLogger.log("WSIF.0009I", cs.getClass().getName());

        Trc.exit(cs);
        return cs;
    }
View Full Code Here

        try {
            if (VERBOSE)
                System.out.println(
                    "WSIFJmsAsyncListener.processResponse called");

            WSIFCorrelationService cs =
                WSIFCorrelationServiceLocator.getCorrelationService();
            WSIFCorrelationId cid =
                new WSIFJMSCorrelationId(msg.getJMSCorrelationID());
            synchronized (cs) {
                so = cs.get(cid);
            }
            if (so != null && so instanceof WSIFOperation) {
                cs.remove(cid);
                ((WSIFOperation) so).fireAsyncResponse(msg);
            }
        } catch (Exception ex) {
            ex.printStackTrace();
        }
View Full Code Here

    public void testIt() {

        System.out.println("Testing the WSIFCorrelationService...");

        WSIFCorrelationService cs =
            WSIFCorrelationServiceLocator.getCorrelationService();

        WSIFCorrelationService cs2 =
            WSIFCorrelationServiceLocator.getCorrelationService();
        assertTrue(cs == cs2);

        try {

            WSIFCorrelationId cid = new WSIFJMSCorrelationId("1");
            cs.put(cid, "petra", (long) 0);

            cid = new WSIFJMSCorrelationId("2");
            cs.put(cid, "ant", (long) 0);

            cid = new WSIFJMSCorrelationId("3");
            cs2.put(cid, "tanya", 3000);

            cid = new WSIFJMSCorrelationId("1");
            String s = (String) cs.get(cid);
            assertTrue(s.equals("petra"));
View Full Code Here

        Object jmsResponse =
            TestUtilities.getJMSAsyncResponse(
                id.getCorrelationId(),
                TestUtilities.getWsifProperty("wsif.async.replytoq2"));
        
         WSIFCorrelationService cs =
            WSIFCorrelationServiceLocator.getCorrelationService();
         Object o;
         synchronized( cs ) {
            o = cs.get( id );
         }
         if ( o != null && o instanceof WSIFOperation ) {     
            cs.remove( id );
            op = (WSIFOperation)o;
         } else {
           assertTrue( "stored correlation object not as expected: " + o, false );
         }
         output = op.createOutputMessage();
View Full Code Here

TOP

Related Classes of org.apache.wsif.WSIFCorrelationService

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.