Package javax.jms

Examples of javax.jms.Destination


    this.ident = ident;
  }

  public void onMessage(Message msg) {
    try {
      Destination destination = msg.getJMSDestination();
      Destination replyTo = msg.getJMSReplyTo();

      System.out.println();
      System.out.println("URL collected:");
      System.out.println(ident + ": from=" + destination + ",replyTo=" + replyTo);
View Full Code Here


            request = context.getOutputStream().toString();
        } else {
            request = ((ByteArrayOutputStream)context.getOutputStream()).toByteArray();
        }

        Destination replyTo = pooledSession.destination();

        //We don't want to send temp queue in
        //replyTo header for oneway calls
        if (!responseExpected
            && (jmsAddressPolicy.getJndiReplyDestinationName() == null)) {
View Full Code Here

     * @return an appropriate pooled session
     */
    PooledSession createPointToPointReplyCapableSession() throws JMSException {
        QueueSession session =
            ((QueueConnection)theConnection).createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
        Destination destination = null;
        String selector = null;
       
        if (null != theReplyDestination) {
            destination = theReplyDestination;
           
View Full Code Here

            }
        }

        connection.start();

        Destination requestDestination =
                (Destination)context.lookup(
                                           addrDetails.getJndiDestinationName());

        Destination replyDestination = (null != addrDetails.getJndiReplyDestinationName())
            ? (Destination)context.lookup(addrDetails.getJndiReplyDestinationName()) : null;

        // create session factory to manage session, reply destination,
        // producer and consumer pooling
        //
View Full Code Here

      if (destMsg instanceof XBMessage)
         ((XBMessage)destMsg).giveFullAccess();
      */  
      try {
         // first strip all qos properties which are specific
         Destination dest = sourceMsg.getJMSDestination();
         if (dest != null)
            destMsg.setJMSDestination(dest);
         String corrId = sourceMsg.getJMSCorrelationID();
         if (corrId != null)
            destMsg.setJMSCorrelationID(corrId);
View Full Code Here

      if (global == null)
         throw new XBException("internal", "Convert: The passed 'global' attribute is null.");
      if (msg == null)
         throw new XBException("internal", "Convert: The passed 'msg' attribute is null.");
      // first strip all qos properties which are specific
      Destination dest = msg.getJMSDestination();
      if (!(dest instanceof XBDestination))
         throw new XBException("client.configuration", "destination is not an xmlblaster destination. Do not know how to handle it");
      PublishQos qos = null;
      PublishKey key = null;
      if (dest != null) {
View Full Code Here

         msg.setJMSDeliveryMode(DeliveryMode.PERSISTENT);
      else
         msg.setJMSDeliveryMode(DeliveryMode.NON_PERSISTENT);

      org.xmlBlaster.util.qos.address.Destination[] destArr = qosData.getDestinationArr();
      Destination dest = null;
      if (destArr != null && destArr.length > 0) {
         if (destArr.length > 1)
            log.warning("there are more than one destinations defined. The current JMS Implementation only supports single PtP Destinations");
         dest = new XBDestination(keyData.toXml(), destArr[0].getDestination().getAbsoluteName(), destArr[0].forceQueuing());
      }
      else
         dest = new XBDestination(keyData.toXml(), null, false);
      msg.setJMSDestination(dest);

      long life = qosData.getLifeTime();
      msg.setJMSExpiration(life);

      String msgId = "ID:" + qosData.getRcvTimestamp().getTimestamp();
      msg.setJMSMessageID(msgId);

      msg.setJMSPriority(qosData.getPriority().getInt());

      boolean redelivered = qosData.getClientProperty(XBMessage.addToKeyAndCheck(XBPropertyNames.JMS_REDELIVERED), false);
      if (redelivered)
         msg.setJMSRedelivered(true);

      if (sender != null) {
         // no force queuing (since I don't know better)
         Destination senderDest = new XBDestination(null, sender, false);
         msg.setJMSReplyTo(senderDest);
      }

      long timestamp = qosData.getClientProperty(XBMessage.addToKeyAndCheck(XBPropertyNames.JMS_TIMESTAMP), 0L);
      if (timestamp != 0L)
View Full Code Here

    }

    public void testPooledSession() throws Exception {
           
        Session sess =  EasyMock.createMock(Session.class);
        Destination dest = EasyMock.createMock(Destination.class);
        MessageProducer mproducer = EasyMock.createMock(MessageProducer.class);
        MessageConsumer mconsumer = EasyMock.createMock(MessageConsumer.class);
      
        PooledSession ps = new PooledSession(sess, dest, mproducer, mconsumer);
      
        assertTrue(ps.session().equals(sess));
        assertTrue(ps.destination().equals(dest));
        assertTrue(ps.consumer().equals(mconsumer));
        assertTrue(ps.producer().equals(mproducer));   
        
        MessageConsumer mcons = EasyMock.createMock(MessageConsumer.class);
        assertFalse(mconsumer.equals(mcons));
        
        ps.consumer(mcons);
        
        assertTrue(ps.consumer().equals(mcons));
        
        Destination mdest = EasyMock.createMock(Destination.class);
        assertFalse(dest.equals(mdest));
       
        ps.destination(mdest);
        assertTrue(mdest.equals(ps.destination()));
    }   
View Full Code Here

   {
      MethodInvocation mi = (MethodInvocation)invocation;
     
      Object[] args = mi.getArguments();
     
      Destination destination = (Destination)args[0];
      Message m = (Message)args[1];
      int deliveryMode = ((Integer)args[2]).intValue();
      int priority = ((Integer)args[3]).intValue();
      long timeToLive = ((Long)args[4]).longValue();
View Full Code Here

   public Object handleCreateConsumerDelegate(Invocation invocation) throws Throwable
   {
      MethodInvocation mi = (MethodInvocation)invocation;
     
      // read permission required on the destination
      Destination dest = (Destination)mi.getArguments()[0];
     
      SessionAdvised del = (SessionAdvised)invocation.getTargetObject();
      ServerSessionEndpoint sess = (ServerSessionEndpoint)del.getEndpoint();
     
      check(dest, CheckType.READ, sess.getConnectionEndpoint());
View Full Code Here

TOP

Related Classes of javax.jms.Destination

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.