Examples of RMException


Examples of org.jboss.ws.extensions.wsrm.api.RMException

            o.setLastMsgNumber(lastMsgNumberValue);
         }
      }
      catch (SOAPException se)
      {
         throw new RMException("Unable to deserialize RM message", se);
      }
      catch (RuntimeException re)
      {
         throw new RMException("Unable to deserialize RM message", re);
      }
   }
View Full Code Here

Examples of org.jboss.ws.extensions.wsrm.api.RMException

            lastMsgNumberElement.setValue(String.valueOf(o.getLastMsgNumber()));
         }
      }
      catch (SOAPException se)
      {
         throw new RMException("Unable to serialize RM message", se);
      }
   }
View Full Code Here

Examples of org.jboss.ws.extensions.wsrm.api.RMException

            }
         }
      }
      catch (SOAPException se)
      {
         throw new RMException("Unable to serialize RM message", se);
      }
   }
View Full Code Here

Examples of org.jboss.ws.extensions.wsrm.api.RMException

   }
  
   public void validate()
   {
      if (this.identifier == null)
         throw new RMException("Identifier not set");
   }
View Full Code Here

Examples of org.jboss.ws.extensions.wsrm.api.RMException

   }

   public void validate()
   {
      if (this.identifier == null)
         throw new RMException("Identifier not set");
      if ((this.acknowledgementRanges.size() == 0) && (this.nacks.size() == 0) && (!this.isNone))
         throw new RMException("AcknowledgementRange or Nack or None must be set");
   }
View Full Code Here

Examples of org.jboss.ws.extensions.wsrm.api.RMException

   }

   public void validate()
   {
      if (this.identifier == null)
         throw new RMException("Identifier not set");
   }
View Full Code Here

Examples of org.jboss.ws.extensions.wsrm.api.RMException

   }

   public void validate()
   {
      if (this.identifier == null)
         throw new RMException("Identifier not set");
   }
View Full Code Here

Examples of org.jboss.ws.extensions.wsrm.api.RMException

   public final RMMessage send(RMMessage request) throws Throwable
   {
      RMMessageRetransmissionConfig qos = RMTransportHelper.getSequence(request).getRMConfig().getMessageRetransmission();
      if (qos == null)
         throw new RMException("User must specify message retransmission configuration in JAX-WS WS-RM config");
     
      int countOfAttempts = qos.getCountOfAttempts();
      int inactivityTimeout = qos.getMessageTimeout();
      int retransmissionInterval = qos.getRetransmissionInterval();
      RMChannelResponse result = null;
      long startTime = 0L;
      long endTime = 0L;
      int attemptNumber = 1;
     
      for (int i = 0; i < countOfAttempts; i++)
      {
         logger.debug("Sending RM request - attempt no. " + attemptNumber++);
         Future<RMChannelResponse> futureResult = rmTasksQueue.submit(new RMChannelTask(request));
         try
         {
            startTime = System.currentTimeMillis();
            result = futureResult.get(inactivityTimeout, TimeUnit.SECONDS);
            if (result != null)
            {
               Throwable t = result.getFault();
               if (t != null)
               {
                  logger.warn(result.getFault().getClass().getName(), result.getFault());
               }
               else
               {
                  endTime = System.currentTimeMillis();
                  if (result.getResponse() != null)
                  {
                     Map<String, Object> remotingCtx = result.getResponse().getMetadata().getContext(RMChannelConstants.REMOTING_INVOCATION_CONTEXT);
                     if (remotingCtx != null)
                     {
                        if (Integer.valueOf(HttpServletResponse.SC_INTERNAL_SERVER_ERROR).equals(remotingCtx.get(HTTPMetadataConstants.RESPONSE_CODE)))
                        {
                           logger.debug("Response message received in " + (endTime - startTime) + " miliseconds, but contains internal server code, going to resend the request message");
                           continue;
                        }
                     }
                  }
                  logger.debug("Response message received in " + (endTime - startTime) + " miliseconds");
                  break;
               }
               try
               {
                  Thread.sleep(retransmissionInterval * 1000);
               }
               catch (InterruptedException ie)
               {
                  logger.warn(ie.getMessage(), ie);
               }
            }
         }
         catch (TimeoutException te)
         {
            endTime = System.currentTimeMillis();
            logger.warn("Timeout - response message not received in " + (endTime - startTime) + " miliseconds");
            try
            {
               Thread.sleep(retransmissionInterval * 1000);
            }
            catch (InterruptedException ie)
            {
               logger.warn(ie.getMessage(), ie);
            }
         }
      }

      if (result == null)
         throw new RMException("Unable to deliver message with addressing id: " + RMTransportHelper.getAddressingMessageId(request) + ". Count of attempts to deliver the message was: " + countOfAttempts);
     
      Throwable fault = result.getFault();
      if (fault != null)
      {
         throw new RMException("Unable to deliver message with addressing id: " + RMTransportHelper.getAddressingMessageId(request) + ". Count of attempts to deliver the message was: " + countOfAttempts, fault);
      }
      else
      {
         return result.getResponse();
      }
View Full Code Here

Examples of org.jboss.ws.extensions.wsrm.api.RMException

  
   public RMClientSequence(RMConfig wsrmConfig)
   {
      super();
      if (wsrmConfig == null)
         throw new RMException("WS-RM configuration missing");
     
      this.wsrmConfig = wsrmConfig;
      this.addressableClient = wsrmConfig.getBackPortsServer() != null;
      if (this.addressableClient)
      {
         try
         {
            String host = wsrmConfig.getBackPortsServer().getHost();
            if (host == null)
            {
               host = InetAddress.getLocalHost().getCanonicalHostName();
               logger.debug("Backports server configuration omits host configuration - using autodetected " + host);
           
            String port = wsrmConfig.getBackPortsServer().getPort();
            String path = PATH_PREFIX + UUIDGenerator.generateRandomUUIDString();
            this.backPort = new URI("http://" + host + ":" + port + path);
         }
         catch (URISyntaxException use)
         {
            logger.warn(use);
            throw new RMException(use.getMessage(), use);
         }
         catch (UnknownHostException uhe)
         {
            logger.warn(uhe);
            throw new RMException(uhe.getMessage(), uhe);
         }
      }
   }
View Full Code Here

Examples of org.jboss.ws.extensions.wsrm.api.RMException

         // call stub method
         this.client.invoke(operationQName, new Object[] {}, client.getBindingProvider().getResponseContext());
      }
      catch (Exception e)
      {
         throw new RMException("Unable to terminate WSRM sequence", e);
      }
   }
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.