Examples of ExceptionHandler


Examples of org.jboss.virtual.spi.ExceptionHandler

         initEntries();
         initStatus = InitializationStatus.INITIALIZED;
      }
      catch (Exception ex)
      {
         ExceptionHandler eh = getExceptionHandler();
         if (eh != null)
            eh.handleZipEntriesInitException(ex, getZipSource().getName());
         else
            throw new RuntimeException("Failed to read zip file: " + getZipSource(), ex);
      }
      finally
      {
View Full Code Here

Examples of org.jbpm.graph.def.ExceptionHandler

  }

  protected void readExceptionHandler(Element exceptionHandlerElement, GraphElement graphElement)
  {
    // create the exception handler
    ExceptionHandler exceptionHandler = new ExceptionHandler();
    exceptionHandler.setExceptionClassName(exceptionHandlerElement.attributeValue("exception-class"));
    // add it to the graph element
    graphElement.addExceptionHandler(exceptionHandler);

    // read the actions in the body of the exception-handler element
    Iterator<?> iter = exceptionHandlerElement.elementIterator();
    while (iter.hasNext())
    {
      Element childElement = (Element)iter.next();
      if (ActionTypes.hasActionName(childElement.getName()))
      {
        Action action = createAction(childElement);
        exceptionHandler.addAction(action);
      }
    }
  }
View Full Code Here

Examples of org.jbpm.graph.def.ExceptionHandler

      "</process-definition>"
    );
   
    processDefinition = saveAndReload(processDefinition);
    Task task = processDefinition.getTaskMgmtDefinition().getTask("wash car");
    ExceptionHandler exceptionHandler = (ExceptionHandler) task.getExceptionHandlers().get(0);
    assertNotNull(exceptionHandler);
    assertEquals("TooIntelligentException",exceptionHandler.getExceptionClassName());
    assertSame(task, exceptionHandler.getGraphElement());
  }
View Full Code Here

Examples of org.jbpm.graph.def.ExceptionHandler

    }
  }

  protected void readExceptionHandler(Element exceptionHandlerElement, GraphElement graphElement) {
    // create the exception handler
    ExceptionHandler exceptionHandler = new ExceptionHandler();
    exceptionHandler.setExceptionClassName(exceptionHandlerElement.attributeValue("exception-class"));
    // add it to the graph element
    graphElement.addExceptionHandler(exceptionHandler);

    // read the actions in the body of the exception-handler element
    Iterator iter = exceptionHandlerElement.elementIterator();
    while (iter.hasNext()) {
      Element childElement = (Element) iter.next();
      if (ActionTypes.hasActionName(childElement.getName())) {
        Action action = createAction(childElement);
        exceptionHandler.addAction(action);
      }
    }
  }
View Full Code Here

Examples of org.jbpm.process.core.context.exception.ExceptionHandler

    final String faultName = element.getAttribute("faultName");
    emptyAttributeCheck(localName, "faultName", type, parser);
   
    final String faultVariable = element.getAttribute("faultVariable");
   
    ExceptionHandler exceptionHandler = null;
    if ("action".equals(type)) {
      exceptionHandler = new ActionExceptionHandler();
      org.w3c.dom.Node xmlNode = element.getFirstChild();
          if (xmlNode instanceof Element) {
          Element actionXml = (Element) xmlNode;
          DroolsAction action = ActionNodeHandler.extractAction(actionXml);
          ((ActionExceptionHandler) exceptionHandler).setAction(action);
          }
    } else {
      throw new SAXParseException("Unknown exception handler type " + type, parser.getLocator());
    }
   
    if (faultVariable != null && faultVariable.length() > 0) {
      exceptionHandler.setFaultVariable(faultVariable);
    }
   
    ExceptionScope exceptionScope = (ExceptionScope)
      contextContainer.getDefaultContext(ExceptionScope.EXCEPTION_SCOPE);
    if (exceptionScope == null) {
View Full Code Here

Examples of org.jbpm.process.core.context.exception.ExceptionHandler

   
    public static void visitExceptionHandlers(Map<String, ExceptionHandler> exceptionHandlers, StringBuilder xmlDump) {
        if (exceptionHandlers != null && exceptionHandlers.size() > 0) {
            xmlDump.append("    <exceptionHandlers>" + EOL);
            for (Map.Entry<String, ExceptionHandler> entry: exceptionHandlers.entrySet()) {
              ExceptionHandler exceptionHandler = entry.getValue();
              if (exceptionHandler instanceof ActionExceptionHandler) {
                ActionExceptionHandler actionExceptionHandler = (ActionExceptionHandler) exceptionHandler;
                xmlDump.append("      <exceptionHandler faultName=\"" + entry.getKey() + "\" type=\"action\" ");
                String faultVariable = exceptionHandler.getFaultVariable();
                if (faultVariable != null && faultVariable.length() > 0) {
                  xmlDump.append("faultVariable=\"" + faultVariable + "\" ");
                }
              xmlDump.append(">" + EOL);
              DroolsAction action = actionExceptionHandler.getAction();
View Full Code Here

Examples of org.jbpm.process.core.context.exception.ExceptionHandler

    public ExceptionScope getExceptionScope() {
        return (ExceptionScope) getContext();
    }
   
    public void handleException(String exception, Object params) {
        ExceptionHandler handler = getExceptionScope().getExceptionHandler(exception);
        if (handler == null) {
            throw new IllegalArgumentException(
                "Could not find ExceptionHandler for " + exception);
        }
        handleException(handler, exception, params);
View Full Code Here

Examples of org.jf.dexlib2.iface.ExceptionHandler

                        writer.writeUshort(offset);
                        exceptionHandlerOffsetMap.put(tryBlock.getExceptionHandlers(), offset);

                        // check if the last exception handler is a catch-all and adjust the size accordingly
                        int ehSize = tryBlock.getExceptionHandlers().size();
                        ExceptionHandler ehLast = tryBlock.getExceptionHandlers().get(ehSize-1);
                        if (ehLast.getExceptionType() == null) {
                            ehSize = ehSize * (-1) + 1;
                        }

                        // now let's layout the exception handlers, assuming that catch-all is always last
                        DexDataWriter.writeSleb128(ehBuf, ehSize);
View Full Code Here

Examples of org.jf.dexlib2.iface.ExceptionHandler

    }

    @Override
    public boolean equals(@Nullable Object o) {
        if (o instanceof ExceptionHandler) {
            ExceptionHandler other = (ExceptionHandler)o;
            return Objects.equal(getExceptionType(), other.getExceptionType()) &&
                   (getHandlerCodeAddress() == other.getHandlerCodeAddress());
        }
        return false;
    }
View Full Code Here

Examples of org.jf.dexlib2.iface.ExceptionHandler

        Assert.assertEquals(252, exceptionHandlers.get(0).getStartCodeAddress());
        Assert.assertEquals(752, exceptionHandlers.get(0).getCodeUnitCount());

        Assert.assertEquals(1, exceptionHandlers.get(0).getExceptionHandlers().size());

        ExceptionHandler exceptionHandler = exceptionHandlers.get(0).getExceptionHandlers().get(0);
        Assert.assertEquals(504, exceptionHandler.getHandlerCodeAddress());

        List<DebugItem> debugItems = Lists.newArrayList(impl.getDebugItems());

        Assert.assertEquals(5, debugItems.size());
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.