Package org.jboss.jms.client.state

Examples of org.jboss.jms.client.state.ProducerState


      boolean keepID = args.length>5? ((Boolean)args[5]).booleanValue() : false;
     
      // configure the message for sending, using attributes stored as metadata

      ProducerState producerState = getProducerState(mi);

      if (deliveryMode == -1)
      {
         // Use the delivery mode of the producer
         deliveryMode = producerState.getDeliveryMode();
         if (trace) { log.trace("Using producer's default delivery mode: " + deliveryMode); }
      }
      m.setJMSDeliveryMode(deliveryMode);

      if (priority == -1)
      {
         // Use the priority of the producer
         priority = producerState.getPriority();
         if (trace) { log.trace("Using producer's default priority: " + priority); }
      }
      if (priority < 0 || priority > 9)
      {
         throw new MessageFormatException("Invalid message priority (" + priority + "). " +
                                          "Valid priorities are 0-9");
      }
      m.setJMSPriority(priority);

      if (producerState.isDisableMessageTimestamp())
      {
         m.setJMSTimestamp(0l);
      }
      else
      {
         m.setJMSTimestamp(System.currentTimeMillis());
      }

      if (timeToLive == Long.MIN_VALUE)
      {
         // Use time to live value from producer
         timeToLive = producerState.getTimeToLive();
         if (trace) { log.trace("Using producer's default timeToLive: " + timeToLive); }
      }

      if (timeToLive == 0)
      {
         // Zero implies never expires
         m.setJMSExpiration(0);
      }
      else
      {
         m.setJMSExpiration(System.currentTimeMillis() + timeToLive);
      }

      if (destination == null)
      {
         // use destination from producer
         destination = producerState.getDestination();

         if (destination == null)
         {
            throw new UnsupportedOperationException("Destination not specified");
         }

         if (trace) { log.trace("Using producer's default destination: " + destination); }
      }
      else
      {
         // if a default destination was already specified then this must be same destination as
         // that specified in the arguments

         if (producerState.getDestination() != null &&
             !producerState.getDestination().equals(destination))
         {
            throw new UnsupportedOperationException("Where a default destination is specified " +
                                                    "for the sender and a destination is " +
                                                    "specified in the arguments to the send, " +
                                                    "these destinations must be equal");
         }
      }

      // destination should aways be a JBossDestination as this is tested on the MessageProducer creation
      // and on the send, so it should be safe to just do this cast
      if (((JBossDestination)destination).isTemporary())
      {
         validateTemporaryDestination(destination);
      }

      SessionState sessionState = (SessionState)producerState.getParent();

      // Generate the message id
      ConnectionState connectionState = (ConnectionState)sessionState.getParent();

      JBossMessage messageToSend;
View Full Code Here


         InventoryDataPoint dataPoint = (InventoryDataPoint) inventory2.get(ProducerState.class);
         if (dataPoint.getInstances() > 1)
         {
            // We should only have this producerState... we will look for where are the
            // other references
            ProducerState originalState = (ProducerState )
                ((DelegateSupport)p1.getDelegate()).getState();
            Object obj[] = jvmti.getAllObjects(ProducerState.class);

            for (int i = 0; i < obj.length; i++)
            {
View Full Code Here

      SessionState sessionState = (SessionState)getState(invocation);

      MethodInvocation mi = (MethodInvocation)invocation;
      Destination dest = ((Destination)mi.getArguments()[0]);

      ProducerState producerState = new ProducerState(sessionState, producerDelegate, dest);

      delegate.setState(producerState);

      // send an arbitrary invocation into the producer delegate, this will trigger AOP stack
      // initialization and AOP aspect class loading, using the "good" class loader, which is set
View Full Code Here

      boolean keepID = args.length>5? ((Boolean)args[5]).booleanValue() : false;
     
      // configure the message for sending, using attributes stored as metadata

      ProducerState producerState = getProducerState(mi);

      if (deliveryMode == -1)
      {
         // Use the delivery mode of the producer
         deliveryMode = producerState.getDeliveryMode();
         if (trace) { log.trace("Using producer's default delivery mode: " + deliveryMode); }
      }
      m.setJMSDeliveryMode(deliveryMode);

      if (priority == -1)
      {
         // Use the priority of the producer
         priority = producerState.getPriority();
         if (trace) { log.trace("Using producer's default priority: " + priority); }
      }
      if (priority < 0 || priority > 9)
      {
         throw new MessageFormatException("Invalid message priority (" + priority + "). " +
                                          "Valid priorities are 0-9");
      }
      m.setJMSPriority(priority);

      if (producerState.isDisableMessageTimestamp())
      {
         m.setJMSTimestamp(0l);
      }
      else
      {
         m.setJMSTimestamp(System.currentTimeMillis());
      }

      if (timeToLive == Long.MIN_VALUE)
      {
         // Use time to live value from producer
         timeToLive = producerState.getTimeToLive();
         if (trace) { log.trace("Using producer's default timeToLive: " + timeToLive); }
      }

      if (timeToLive == 0)
      {
         // Zero implies never expires
         m.setJMSExpiration(0);
      }
      else
      {
         m.setJMSExpiration(System.currentTimeMillis() + timeToLive);
      }

      if (destination == null)
      {
         // use destination from producer
         destination = producerState.getDestination();

         if (destination == null)
         {
            throw new UnsupportedOperationException("Destination not specified");
         }

         if (trace) { log.trace("Using producer's default destination: " + destination); }
      }
      else
      {
         // if a default destination was already specified then this must be same destination as
         // that specified in the arguments

         if (producerState.getDestination() != null &&
             !producerState.getDestination().equals(destination))
         {
            throw new UnsupportedOperationException("Where a default destination is specified " +
                                                    "for the sender and a destination is " +
                                                    "specified in the arguments to the send, " +
                                                    "these destinations must be equal");
         }
      }

      // destination should aways be a JBossDestination as this is tested on the MessageProducer creation
      // and on the send, so it should be safe to just do this cast
      if (((JBossDestination)destination).isTemporary())
      {
         validateTemporaryDestination(destination);
      }

      SessionState sessionState = (SessionState)producerState.getParent();

      // Generate the message id
      ConnectionState connectionState = (ConnectionState)sessionState.getParent();

      long id = -1;
View Full Code Here

      SessionState sessionState = (SessionState)getState(invocation);

      MethodInvocation mi = (MethodInvocation)invocation;
      Destination dest = ((Destination)mi.getArguments()[0]);

      ProducerState producerState = new ProducerState(sessionState, producerDelegate, dest);

      if (sessionState.isEnableOrderingGroup())
      {
         producerState.setOrderingGroupEnabled(true);
         producerState.setOrderingGroupName(sessionState.getDefaultOrderingGroupName());
      }
      delegate.setState(producerState);

      // send an arbitrary invocation into the producer delegate, this will trigger AOP stack
      // initialization and AOP aspect class loading, using the "good" class loader, which is set
View Full Code Here

      SessionState sessionState = (SessionState)getState(invocation);

      MethodInvocation mi = (MethodInvocation)invocation;
      Destination dest = ((Destination)mi.getArguments()[0]);

      ProducerState producerState = new ProducerState(sessionState, producerDelegate, dest);

      if (sessionState.isEnableOrderingGroup())
      {
         producerState.setOrderingGroupEnabled(true);
         producerState.setOrderingGroupName(sessionState.getDefaultOrderingGroupName());
      }
      delegate.setState(producerState);

      // send an arbitrary invocation into the producer delegate, this will trigger AOP stack
      // initialization and AOP aspect class loading, using the "good" class loader, which is set
View Full Code Here

/* 181 */     SessionState sessionState = (SessionState)getState(invocation);
/*     */
/* 183 */     MethodInvocation mi = (MethodInvocation)invocation;
/* 184 */     Destination dest = (Destination)mi.getArguments()[0];
/*     */
/* 186 */     ProducerState producerState = new ProducerState(sessionState, producerDelegate, dest);
/*     */
/* 188 */     delegate.setState(producerState);
/*     */
/* 193 */     producerDelegate.getDeliveryMode();
/*     */
View Full Code Here

/*     */
/*  90 */     boolean keepID = args.length > 5 ? ((Boolean)args[5]).booleanValue() : false;
/*     */
/*  92 */     String keptId = null;
/*     */
/*  96 */     ProducerState producerState = getProducerState(mi);
/*     */
/*  98 */     if (deliveryMode == -1)
/*     */     {
/* 101 */       deliveryMode = producerState.getDeliveryMode();
/* 102 */       if (this.trace) log.trace("Using producer's default delivery mode: " + deliveryMode);
/*     */     }
/* 104 */     m.setJMSDeliveryMode(deliveryMode);
/*     */
/* 106 */     if (priority == -1)
/*     */     {
/* 109 */       priority = producerState.getPriority();
/* 110 */       if (this.trace) log.trace("Using producer's default priority: " + priority);
/*     */     }
/* 112 */     m.setJMSPriority(priority);
/*     */
/* 114 */     if (producerState.isDisableMessageTimestamp())
/*     */     {
/* 116 */       m.setJMSTimestamp(0L);
/*     */     }
/*     */     else
/*     */     {
/* 120 */       m.setJMSTimestamp(System.currentTimeMillis());
/*     */     }
/*     */
/* 123 */     if (timeToLive == -9223372036854775808L)
/*     */     {
/* 126 */       timeToLive = producerState.getTimeToLive();
/* 127 */       if (this.trace) log.trace("Using producer's default timeToLive: " + timeToLive);
/*     */     }
/*     */
/* 130 */     if (timeToLive == 0L)
/*     */     {
/* 133 */       m.setJMSExpiration(0L);
/*     */     }
/*     */     else
/*     */     {
/* 137 */       m.setJMSExpiration(System.currentTimeMillis() + timeToLive);
/*     */     }
/*     */
/* 140 */     if (destination == null)
/*     */     {
/* 143 */       destination = producerState.getDestination();
/*     */
/* 145 */       if (destination == null)
/*     */       {
/* 147 */         throw new UnsupportedOperationException("Destination not specified");
/*     */       }
/*     */
/* 150 */       if (this.trace) log.trace("Using producer's default destination: " + destination);
/*     */
/*     */     }
/* 157 */     else if ((producerState.getDestination() != null) && (!producerState.getDestination().equals(destination)))
/*     */     {
/* 160 */       throw new UnsupportedOperationException("Where a default destination is specified for the sender and a destination is specified in the arguments to the send, these destinations must be equal");
/*     */     }
/*     */
/* 167 */     SessionState sessionState = (SessionState)producerState.getParent();
/*     */
/* 170 */     ConnectionState connectionState = (ConnectionState)sessionState.getParent();
/*     */
/* 172 */     long id = 0L;
/*     */
View Full Code Here

      String keptId = null;

      // configure the message for sending, using attributes stored as metadata

      ProducerState producerState = getProducerState(mi);

      if (deliveryMode == -1)
      {
         // Use the delivery mode of the producer
         deliveryMode = producerState.getDeliveryMode();
         if (trace) { log.trace("Using producer's default delivery mode: " + deliveryMode); }
      }
      m.setJMSDeliveryMode(deliveryMode);

      if (priority == -1)
      {
         // Use the priority of the producer
         priority = producerState.getPriority();
         if (trace) { log.trace("Using producer's default priority: " + priority); }
      }
      m.setJMSPriority(priority);

      if (producerState.isDisableMessageTimestamp())
      {
         m.setJMSTimestamp(0l);
      }
      else
      {
         m.setJMSTimestamp(System.currentTimeMillis());
      }

      if (timeToLive == Long.MIN_VALUE)
      {
         // Use time to live value from producer
         timeToLive = producerState.getTimeToLive();
         if (trace) { log.trace("Using producer's default timeToLive: " + timeToLive); }
      }

      if (timeToLive == 0)
      {
         // Zero implies never expires
         m.setJMSExpiration(0);
      }
      else
      {
         m.setJMSExpiration(System.currentTimeMillis() + timeToLive);
      }

      if (destination == null)
      {
         // use destination from producer
         destination = producerState.getDestination();

         if (destination == null)
         {
            throw new UnsupportedOperationException("Destination not specified");
         }

         if (trace) { log.trace("Using producer's default destination: " + destination); }
      }
      else
      {
         // if a default destination was already specified then this must be same destination as
         // that specified in the arguments

         if (producerState.getDestination() != null &&
             !producerState.getDestination().equals(destination))
         {
            throw new UnsupportedOperationException("Where a default destination is specified " +
                                                    "for the sender and a destination is " +
                                                    "specified in the arguments to the send, " +
                                                    "these destinations must be equal");
         }
      }

      SessionState sessionState = (SessionState)producerState.getParent();

      // Generate the message id
      ConnectionState connectionState = (ConnectionState)sessionState.getParent();

      long id = 0;
View Full Code Here

TOP

Related Classes of org.jboss.jms.client.state.ProducerState

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.