Package org.xmlBlaster.util.def

Examples of org.xmlBlaster.util.def.ErrorCode


         throw new XmlBlasterException(glob, ErrorCode.INTERNAL_ILLEGALARGUMENT, ME, "Illegal argument in intercept() call - msgUnit is null");
      }
     
      String ec = this.exceptionErrorCode;
      if (ec != null && ec.length() > 0) {
         ErrorCode errorCode = ErrorCode.INTERNAL_PUBLISH;
         try {
            errorCode = ErrorCode.toErrorCode(ec);
         }
         catch (IllegalArgumentException e) {}
         log.warning("Throwing test exception '" + errorCode + "' for published message " + msgUnit.getKeyOid());
View Full Code Here


         if (msgUnits.length == 1) {
            if (type == MsgInfo.EXCEPTION_BYTE && this.sendSimpleExceptionFormat) {
               // This must be parsable on the other side similar to XmlBlasterException.parseByteArr()
               // See code in MsgInfo.java
               //ErrorCode errorCode = ErrorCode.getCategory(msgUnits[0].getQos()); -> toplevel only, like 'user'
               ErrorCode errorCode = ErrorCode.toErrorCode(msgUnits[0].getQos());
               StringBuffer buf = new StringBuffer(1024);
               buf.append("<qos><state id='ERROR' info='").append(errorCode.getErrorCode());
               buf.append("'/></qos>");
               out.write(buf.toString().getBytes(Constants.UTF8_ENCODING));
            }
            else {
               msgUnits[0].toXml(offset, out, props);
View Full Code Here

               }
               if ("onFail".equalsIgnoreCase(key)) {
                  if (value.length() > 1) { // if empty ignore it
                     if (log.isLoggable(Level.FINE)) this.log.fine("startElement: onFail : " + key + "='" + value +"'");
                     try {
                        ErrorCode code = ErrorCode.toErrorCode(value);
                        this.runLevelAction.setOnFail(code);
                     }
                     catch (IllegalArgumentException ex) {
                        log.warning("startElement onFail='" + value + "' is an unknown error code");
                        this.ex = new XmlBlasterException(this.glob, ErrorCode.RESOURCE_CONFIGURATION, ME + ".startElement", "check the spelling of your error code, it is unknown and probably wrongly spelled", ex);
View Full Code Here

            this.glob.getPluginManager().getPluginObject(pluginInfo);
            long deltaTime = System.currentTimeMillis() - startTime;
            log.fine("Run level '" + from + "' to '" + to + "' plugin '" + pluginConfig.getId() + "' successful loaded in '" + deltaTime + "' ms");
         }
         catch (Throwable ex) {
            ErrorCode code = pluginConfig.getUpAction().getOnFail();
            if (code == null) {
               log.warning("Exception when loading the plugin '" + pluginConfig.getId() + "' reason: " + ex.toString());
               ex.printStackTrace();
            }
            else {
View Full Code Here

            plugin.shutdown();
            this.glob.getPluginManager().removeFromPluginCache(pluginInfo.getId());
            log.fine("fireRunlevelEvent: run level '" + from + "' to '" + to + "' plugin '" + pluginConfig.getId() + "' shutdown");
         }
         catch (Throwable ex) {
            ErrorCode code = pluginConfig.getDownAction().getOnFail();
            if (code == null) {
               log.warning(".fireRunlevelEvent. Exception when shutting down the plugin '" + pluginConfig.getId() + "' reason: " + ex.toString());
            }
            else {
               throw new XmlBlasterException(this.glob, code, ME + ".fireRunlevelEvent"".fireRunlevelEvent. Exception when shutting down the plugin '" + pluginConfig.getId() + "'", ex);
View Full Code Here

      String message = "";
      long size = 0;
     
      try {
         XmlBlasterException xmlBlasterException = msgErrorInfo.getXmlBlasterException();
         ErrorCode errorCode = xmlBlasterException.getErrorCode();
         message = xmlBlasterException.getMessage();
         MsgQueueEntry[] msgQueueEntries = msgErrorInfo.getMsgQueueEntries();
         DispatchManager dispatchManager = (this.sessionInfo == null) ? null : this.sessionInfo.getDispatchManager();
         I_Queue msgQueue = msgErrorInfo.getQueue()// is null if entry is not yet in queue
  
         if (log.isLoggable(Level.FINER)) log.finer("Error handling started: " + msgErrorInfo.toString());
  
         if (msgQueueEntries != null && msgQueueEntries.length > 0) {
            // 1. Generate dead letters from passed messages
            glob.getRequestBroker().deadMessage(msgQueueEntries, msgQueue, message);
  
            if (msgQueue != null) {
               // Remove the above published dead message from the queue
               try {
                  if (log.isLoggable(Level.FINE)) log.fine("Removing " + msgQueueEntries.length + " dead messages from queue");
                  long removed = 0L;
                  boolean tmp[] = msgQueue.removeRandom(msgQueueEntries);
                  for (int i=0; i < tmp.length; i++) if (tmp[i]) removed++;
                  if (removed != msgQueueEntries.length) {
                     log.warning("Expected to remove " + msgQueueEntries.length + " messages from queue but where only " + removed + ": " + message);
                  }
               }
               catch (XmlBlasterException e) {
                  log.warning("Can't remove " + msgQueueEntries.length + " messages from queue: " + e.getMessage() + ". Original cause was: " + message);
               }
            }
         }
  
         if (xmlBlasterException.isUser()) {
            // The update() method from the client has thrown a ErrorCode.USER* error
            if (log.isLoggable(Level.FINE)) log.fine("Error handlig for exception " + errorCode.toString() + " done");
            return;
         }
  
         // 2a. Generate dead letters if there are some entries in the queue
         size = (msgQueue == null) ? 0 : msgQueue.getNumOfEntries();
View Full Code Here

         log.info("Returning update() - control goes back to server");
      }

      if (this.updateExceptionErrorCode != null) {
         log.info("Throwing XmlBlasterException with errorCode='" + this.updateExceptionErrorCode + "' back to server ...");
         ErrorCode errorCode;
         try {
            errorCode = ErrorCode.toErrorCode(this.updateExceptionErrorCode);
         }
         catch (IllegalArgumentException e) {
            log.severe("Please supply a valid exception errorCode (see ErrorCode.java) for instead of -updateException.errorCode " + this.updateExceptionErrorCode + "");
View Full Code Here

         return e;
      }

      // Transform a Throwable to an XmlBlasterException ...
      log.severe("Internal problem in " + action.toString() + "(): " + origEx.getMessage());
      ErrorCode code = ErrorCode.INTERNAL_UNKNOWN;
      if (action == MethodName.PUBLISH) code = ErrorCode.INTERNAL_PUBLISH;
      else if (action == MethodName.PUBLISH_ARR) code = ErrorCode.INTERNAL_PUBLISH_ARR;
      else if (action == MethodName.SUBSCRIBE) code = ErrorCode.INTERNAL_SUBSCRIBE;
      else if (action == MethodName.UNSUBSCRIBE) code = ErrorCode.INTERNAL_UNSUBSCRIBE;
      else if (action == MethodName.ERASE) code = ErrorCode.INTERNAL_ERASE;        
View Full Code Here

         exceptionFromServer = new Boolean(new String(data, start, end-start));
      }
      catch (java.lang.StringIndexOutOfBoundsException e) {
         log.severe("Receiving invalid format for XmlBlasterException in '" + new String(data) + "'");
      }
      ErrorCode errorCode = (fallback == null) ? ErrorCode.INTERNAL_UNKNOWN : fallback;
      try {
         errorCode = ErrorCode.toErrorCode(errorCodeStr);
      }
      catch (Throwable e) {
         log.severe("Receiving invalid errorCode in XmlBlasterException in '" + new String(data) + "', handling it as " + errorCode.toString());
         message = "Receiving invalid errorCode in XmlBlasterException: Can't parse XmlBlasterException in method parseByteArr(). original message is '" + new String(data) + "'";
      }
      Timestamp ti = new Timestamp();
      try {
         ti = Timestamp.valueOf(timestampStr);
View Full Code Here

               timeout, userData, this.timerKey);
      }
   }

   private boolean isAuthenticationException(XmlBlasterException ex) {
           ErrorCode code = ex.getErrorCode();
           if (code == null)
                   return false;
           return code.isOfType(ErrorCode.USER_SECURITY_AUTHENTICATION);
   }
View Full Code Here

TOP

Related Classes of org.xmlBlaster.util.def.ErrorCode

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.