Package org.jbpm

Examples of org.jbpm.PvmException


  public static final int BUFFERSIZE = 4096;

  public static byte[] readBytes(InputStream inputStream) {
    byte[] bytes = null;
    if (inputStream==null) {
      throw new PvmException("inputStream is null");
    }
    try {
      ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
      transfer(inputStream, outputStream);
      bytes = outputStream.toByteArray();
      outputStream.close();
      return bytes;
    } catch (IOException e) {
      throw new PvmException("couldn't read bytes from inputStream", e);
    }
  }
View Full Code Here


        total += bytesRead;
        bytesRead = in.read( buffer );
      }
      return total;
    } catch (IOException e) {
      throw new PvmException("couldn't write bytes to output stream", e);
    }
  }
View Full Code Here

      if (namespaceValue.prefix==null) {
        qname = new QName(text);
      } else {
        String uri = element.lookupNamespaceURI(namespaceValue.prefix);
        if (uri==null) {
          throw new PvmException("unknown prefix in qname "+text);
        } else if (namespaceValue.localPart==null) {
          throw new PvmException("no local part in qname "+text);
        } else {
          qname = new QName(uri, namespaceValue.localPart, namespaceValue.prefix);
        }
      }
    }
View Full Code Here

    else if (TEXT_LOW.equalsIgnoreCase(priorityText)) return LOW;
    else if (TEXT_LOWEST.equalsIgnoreCase(priorityText)) return LOWEST;
    try {
      return Integer.parseInt(priorityText);
    } catch (NumberFormatException e) {
      throw new PvmException("priority '"+priorityText+"' could not be parsed as a priority", e);
    }
  }
View Full Code Here

      try {
        int length = (int) sqlClob.length();
        String text = sqlClob.getSubString(1, length);
        return text.toCharArray();
      } catch (SQLException e) {
        throw new PvmException("couldn't extract chars out of clob", e);
      }
    }
    return null;
  }
View Full Code Here

      //can be null if it was rescheduled
      if (lockExpirationDate != null) {
        long lockExpiration = lockExpirationDate.getTime();
        long currentTime = System.currentTimeMillis();
        if (currentTime>lockExpiration) {
          throw new PvmException("job took too long: lock expired "+(currentTime-lockExpiration)+"ms ago");
        }
      }
    } catch (Throwable exception) {
      log.log(Level.SEVERE, "exception while executing '"+job+"'", exception);
      handleJobExecutionException(environment, job, exception);
View Full Code Here

    java.sql.Blob sqlBlob = blob.getBlob();
    if (sqlBlob!=null) {
      try {
        return sqlBlob.getBytes(1, (int) sqlBlob.length());
      } catch (SQLException e) {
        throw new PvmException("couldn't extract bytes out of blob", e);
      }
    }
    return null;
  }
View Full Code Here

public class TransactionInterceptor extends Interceptor {

  public Object execute(Command command) {
    Environment environment = Environment.getCurrent();
    if (environment==null) {
      throw new PvmException("no environment for verifying authorization");
    }
    Transaction transaction = environment.getTransaction();
    if (transaction==null) {
      throw new PvmException("no transaction in environment");
    }
    try {
      return next.execute(command);
    } catch (RuntimeException e) {
      transaction.setRollbackOnly();
View Full Code Here

        } else {
          log.warning(p.toString());
        }
      }
      if (errorMsg!=null) {
        throw new PvmException("Error during parsing of "+description+": "+errorMsg);
      }
    }
  }
View Full Code Here

  boolean propagateUserId = true;

  public Object execute(Command command) {
    Environment environment = Environment.getCurrent();
    if (environment==null) {
      throw new PvmException("no environment for verifying authorization");
    }
    MessageSession messageSession = environment.get(MessageSession.class);
    if (messageSession==null) {
      throw new PvmException("no message session for executing command asynchronously");
    }
    String userId = (propagateUserId ? environment.getUserId() : null);
    messageSession.send(new AsyncCommandMessage(command, userId));
    return null;
  }
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.