Package org.jbpm.pvm.internal.env

Examples of org.jbpm.pvm.internal.env.Environment


  protected abstract Class<? extends Type> getIdType();
 
  public boolean matches(String name, Object value) {
    boolean matches = false;
   
    Environment environment = Environment.getCurrent();
    if (environment!=null) {
      SessionFactory sessionFactory = null;
      if (hibernateSessionFactoryName!=null) {
        sessionFactory = (SessionFactory) environment.get(hibernateSessionFactoryName);
      } else {
        sessionFactory = environment.get(SessionFactory.class);
      }
      if (sessionFactory!=null) {
        ClassMetadata classMetadata = sessionFactory.getClassMetadata(value.getClass());
        matches =  ( (classMetadata!=null)
                     && (classMetadata.getIdentifierType().getClass()==getIdType())
View Full Code Here


      log.trace("using provided classloader");
      return classLoader;
    }
   
    // 2) if the user provided a classloader through the environment, use that one
    Environment environment = Environment.getCurrent();
    if (environment!=null) {
      classLoader = environment.getClassLoader();
      if (classLoader!=null) {
        log.trace("using environment classloader");
        return classLoader;
      }
    }
View Full Code Here

  protected T constructFromDescriptor() {
    return (T) WireContext.create(descriptor);
  }

  protected T resolveValueExpression() {
    Environment environment = Environment.getCurrent();
    return null;
  }
View Full Code Here

      catch (MessagingException e) {
        throw new JbpmException("failed to add " + addresses + " to senders", e);
      }
    }

    Environment environment = Environment.getCurrent();
    IdentitySession identitySession = environment.get(IdentitySession.class);
    AddressResolver addressResolver = environment.get(AddressResolver.class);

    // resolve and tokenize users
    String userList = fromTemplate.getUsers();
    if (userList != null) {
      String[] userIds = tokenizeActors(userList, execution);
View Full Code Here

            + " to recipients of type "
            + recipientType, e);
      }
    }

    Environment environment = Environment.getCurrent();
    IdentitySession identitySession = environment.get(IdentitySession.class);
    AddressResolver addressResolver = environment.get(AddressResolver.class);

    // resolve and tokenize users
    String userList = addressTemplate.getUsers();
    if (userList != null) {
      String[] userIds = tokenizeActors(userList, execution);
View Full Code Here

      return create(objectName, isDelayable);
    }
   
    // then check if we can find it in the environment (if one is available)
    Environment environment = Environment.getCurrent();
    if (environment!=null) {
      log.trace("delivering "+objectName+" from environment");
      return environment.get(objectName);
    }
   
    log.trace("delivering null for undefined object "+objectName);
    return null;
  }
View Full Code Here

      performAtomicOperationSync(operation);
    }
  }
 
  public void sendContinuationMessage(AtomicOperation operation) {
    Environment environment = Environment.getCurrent();
    MessageSession messageSession = environment.get(MessageSession.class);
    if (messageSession==null) {
      throw new JbpmException("no message-session configured to send asynchronous continuation message");
    }
    MessageImpl<?> asyncMessage = operation.createAsyncMessage(this);
    setState(Execution.STATE_ASYNC);
View Full Code Here

      atomicOperations = new LinkedList<AtomicOperation>();
      atomicOperations.offer(operation);
     
      ExecutionContext originalExecutionContext = null;
      ExecutionContext executionContext = null;
      Environment environment = Environment.getCurrent();
      if (environment!=null) {
        originalExecutionContext = (ExecutionContext) environment.getContext(Context.CONTEXTNAME_EXECUTION);
        if ( (originalExecutionContext!=null)
             && (originalExecutionContext.getExecution()==this)
           ) {
          originalExecutionContext = null;
        } else {
          executionContext = new ExecutionContext(this);
          environment.setContext(executionContext);
        }
      }
     
      try {
        while (! atomicOperations.isEmpty()) {
          AtomicOperation atomicOperation = atomicOperations.poll();
          atomicOperation.perform(this);
        }

      } catch (RuntimeException e ) {
        throw e;
      } finally {
        atomicOperations = null;
       
        if (executionContext!=null) {
          environment.removeContext(executionContext);
        }
        if (originalExecutionContext!=null) {
          environment.setContext(originalExecutionContext);
        }
      }
    } else {
      atomicOperations.offer(operation);
    }
View Full Code Here

  // dummy string constructor to differentiate from 
  // the default constructor which is used by hibernate
  protected HistoryDetailImpl(String dummy) {
    this.time = Clock.getCurrentTime();
   
    Environment environment = Environment.getCurrent();
    if (environment!=null) {
      this.userId = environment.getUserId();
    }
  }
View Full Code Here

    }

    // identify the wireContext
    WireContext wireContext = null;
    if (contextName!=null) {
      Environment environment = Environment.getCurrent();
      if (environment!=null) {
        try {
          wireContext = (WireContext) environment.getContext(contextName);
          if (wireContext==null) {
            throw new WireException("couldn't subscribe because context "+contextName+" doesn't exist");
          }
        } catch (ClassCastException e) {
          throw new WireException("couldn't subscribe because context "+contextName+" is not a WireContext", e);
View Full Code Here

TOP

Related Classes of org.jbpm.pvm.internal.env.Environment

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.