Package org.jbpm

Examples of org.jbpm.PvmException


        String converterName = properties.getProperty(converterClassName);
        converterNames.put(converterClass, converterName);
        Converter converter = (Converter) converterClass.newInstance();
        converters.put(converterName, converter);
      } catch (Exception e) {
        throw new PvmException("couldn't initialize converter type "+converterClassName, e);
      }
    }
  }
View Full Code Here


      ObjectOutputStream oos = new ObjectOutputStream(baos);
      oos.writeObject(o);
      oos.flush();
      bytes = baos.toByteArray();
    } catch (IOException e) {
      throw new PvmException("couldn't serialize '"+o+"'", e);
    }
   
    return bytes;
  }
View Full Code Here

    try {
      ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
      ObjectInputStream ois = new ObjectInputStream(bais);
      return ois.readObject();
    } catch (Exception e) {
      throw new PvmException("couldn't deserialize object", e);
    }
  }
View Full Code Here

      if (Environment.getCurrent() == null) {
        environmentFactory.openEnvironment();
        Environment.getCurrent().get(JobExecutor.class).jobWasAdded();
        Environment.getCurrent().close();
      } else {
        throw new PvmException("No environment should be open in this thread");
      }
    }
View Full Code Here

   * unit = (y|year|years|month|months|w|week|weeks|d|day|days|h|hour|hours|min|minute|minutes|s|sec|second|seconds|milli|millis|millisecond|milliseconds)
   *
   * @throws PvmException if the parsing is unsuccessful
   */
  public Duration(String text) {
    if (text==null) throw new PvmException("text is null");

    for (String part: splitInParts(text)) {
      parsePart(part);
    }
   
View Full Code Here

  }

  private void parsePart(String part) {
    int spaceIndex = part.indexOf(' ');
    if (spaceIndex==-1) {
      throw new PvmException("couldn't parse duration part "+part);
    }
    String quantityText = part.substring(0, spaceIndex).trim();
    spaceIndex = part.lastIndexOf(' ');
    String unitText = part.substring(spaceIndex+1).trim().toLowerCase();
   
    int quantity;
    try {
      quantity = Integer.parseInt(quantityText);
    } catch (NumberFormatException e) {
      throw new PvmException("couldn't parse quantity "+quantityText+" in duration text", e);
    }
    FieldSetter fieldSetter = fieldSetters.get(unitText);
    if (fieldSetter==null) {
      throw new PvmException("couldn't parse quantity "+quantityText);
    }
    fieldSetter.set(this, quantity);
  }
View Full Code Here

  public Object revert(Object o) {
    try {
      return dateFormat.parseObject((String)o);
    } catch (ParseException e) {
      throw new PvmException("invalid date format in date variable: "+o, e);
    }
  }
View Full Code Here

        javaTimer.schedule(task, eligibleDate, repeatDelay);
      } else {
        javaTimer.schedule(task, eligibleDate);
      }
    } catch (IllegalStateException e) {
      throw new PvmException(e.getMessage(), e);
    }
    scheduledJobs.put(id, task);
  }
View Full Code Here

    public ExecutionTask(Timer timer) {
      this.id = timer.getDbid();
      this.timer = timer;
      if (Environment.getCurrent() == null) {
        throw new PvmException("Task scheduling must occur in a valid environment");
      }
      environmentFactory =
        Environment.getCurrent().getEnvironmentFactory();
    }
View Full Code Here

          } finally {
            if (tmpEnvironment != null)
              tmpEnvironment.close();
          }
        } else {
          throw new PvmException("Unable to get the activity for the task");
        }
      } catch (Exception e) {
        throw new PvmException(e);
      } finally {
        if (!repeat) {
          scheduledJobs.remove(id);
        }
      }
View Full Code Here

TOP

Related Classes of org.jbpm.PvmException

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.