Examples of WSIFJMSCorrelationId


Examples of org.apache.wsif.util.jms.WSIFJMSCorrelationId

        WSIFCorrelationId cid;

        // 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 );
              }
           }
        }
          

        wsifOp.setAsyncRequestID(new WSIFJMSCorrelationId(msgID));

        // SOAP doesn't like a null response so give it a dummy null
        responseSOAPContext = new SOAPContext();
        responseSOAPContext.setRootPart(DUMMY_RESPONSE, "text/xml");
        responseReader = new BufferedReader(new StringReader(DUMMY_RESPONSE));
View Full Code Here

Examples of org.apache.wsif.util.jms.WSIFJMSCorrelationId

      if (inputOnlyOp) {
        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);
          }
        }
      }
View Full Code Here

Examples of org.apache.wsif.util.jms.WSIFJMSCorrelationId

        WSIFCorrelationId cid;

        // only save op in the correlation service if there's a response handler
        if ( wsifOp.getResponseHandler() == null ) {
           msgID = dest.send( data );
           cid = new WSIFJMSCorrelationId( msgID );
        } else {
            Long transportAsyncTimeoutValue =
               (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 );
              }
           }
        }
         

        // Save msg ID in the WSIFop for this calling client
        wsifOp.setAsyncRequestID(new WSIFJMSCorrelationId(msgID));

        // Axis doesn't like a null response so give it something
        Message responseMessage = new Message(DUMMY_RESPONSE);
        messageContext.setResponseMessage(responseMessage);
    }
View Full Code Here

Examples of org.apache.wsif.util.jms.WSIFJMSCorrelationId

            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"));

            cid = new WSIFJMSCorrelationId("2");
            s = (String) cs.get(cid);
            assertTrue(s.equals("ant"));

            cid = new WSIFJMSCorrelationId("3");
            s = (String) cs.get(cid);
            assertTrue(s.equals("tanya"));

            System.out.println("\nwaiting for timeouts...");
            try {
                Thread.sleep(10000);
            } catch (Exception ex) {
                System.out.println("interupted early");
            }

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

            cid = new WSIFJMSCorrelationId("2");
            s = (String) cs.get(cid);
            assertTrue(s.equals("ant"));

            cid = new WSIFJMSCorrelationId("3");
            s = (String) cs.get(cid);
            assertTrue(s == null); // should have timed out

            cid = new WSIFJMSCorrelationId("2");
            cs.remove(cid);

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

            cid = new WSIFJMSCorrelationId("2");
            s = (String) cs.get(cid);
            assertTrue(s == null); // due to remove

      // test primative clasess
      Class[] clss =
        new Class[] {
          int.class,
          float.class,
          long.class,
          double.class,
          short.class,
          byte.class,
          boolean.class,
          void.class };
      Class[] clss2;
      cid = new WSIFJMSCorrelationId("P1");
      cs.put(cid, clss, (long) 0);
      clss2 = (Class[]) cs.get(cid);
      for (int i = 0; i < clss.length; i++) {
        assertTrue(
          "class " + clss[i] + " failed!!",
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.