Package org.jbpm.module.exe

Examples of org.jbpm.module.exe.ModuleInstance


  /**
   * looks up an optional module instance by its class.   
   */
  public ModuleInstance getInstance(Class clazz) {
    ModuleInstance moduleInstance = null;
    if ( instances != null ) {
      moduleInstance = (ModuleInstance) instances.get( clazz.getName() );
    }
   
    if (moduleInstance==null) {
      if (transientInstances==null) transientInstances = new HashMap();
     
      // client requested an instance that is not in the map of instances.
      // so we can safely assume that the client wants a transient instance
      moduleInstance = (ModuleInstance) transientInstances.get( clazz.getName() );
      if (moduleInstance==null) {
        try {
          moduleInstance = (ModuleInstance) clazz.newInstance();
          moduleInstance.setProcessInstance(this);

        } catch (Exception e) {
          e.printStackTrace();
          throw new JbpmException("couldn't instantiate transient module '"+clazz.getName()+"' with the default constructor");
        }
View Full Code Here

TOP

Related Classes of org.jbpm.module.exe.ModuleInstance

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.