Examples of ModuleInstance


Examples of org.jbpm.module.exe.ModuleInstance

  /**
   * removes the given optional moduleinstance (bidirectional).
   */
  public ModuleInstance removeInstance(ModuleInstance moduleInstance) {
    ModuleInstance removedModuleInstance = null;
    if (moduleInstance == null) throw new IllegalArgumentException("can't remove a null moduleInstance from a process instance");
    if (instances != null) {
      removedModuleInstance = (ModuleInstance) instances.remove(moduleInstance.getClass().getName());
      if (removedModuleInstance!=null) {
        moduleInstance.setProcessInstance(null);
View Full Code Here

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

Examples of org.jbpm.module.exe.ModuleInstance

      // loop over each optional definition
      Iterator iter = definitions.values().iterator();
      while (iter.hasNext()) {
        ModuleDefinition definition = (ModuleDefinition) iter.next();
        // and create the corresponding optional instance
        ModuleInstance instance = definition.createInstance();
        if (instance != null) {
          addInstance( instance );
        }
      }
    }
View Full Code Here

Examples of org.jbpm.module.exe.ModuleInstance

  /**
   * removes the given optional moduleinstance (bidirectional).
   */
  public ModuleInstance removeInstance(ModuleInstance moduleInstance) {
    ModuleInstance removedModuleInstance = null;
    if (moduleInstance == null) throw new IllegalArgumentException("can't remove a null moduleInstance from a process instance");
    if (instances != null) {
      removedModuleInstance = (ModuleInstance) instances.remove(moduleInstance.getClass().getName());
      if (removedModuleInstance!=null) {
        moduleInstance.setProcessInstance(null);
View Full Code Here

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

Examples of org.jbpm.module.exe.ModuleInstance

      // loop over each optional definition
      Iterator iter = definitions.values().iterator();
      while (iter.hasNext()) {
        ModuleDefinition definition = (ModuleDefinition) iter.next();
        // and create the corresponding optional instance
        ModuleInstance instance = definition.createInstance();
        if (instance != null) {
          addInstance( instance );
        }
      }
    }
View Full Code Here

Examples of org.jbpm.module.exe.ModuleInstance

  /**
   * removes the given optional moduleinstance (bidirectional).
   */
  public ModuleInstance removeInstance(ModuleInstance moduleInstance) {
    ModuleInstance removedModuleInstance = null;
    if (moduleInstance == null) throw new IllegalArgumentException("can't remove a null moduleInstance from a process instance");
    if (instances != null) {
      removedModuleInstance = (ModuleInstance) instances.remove(moduleInstance.getClass().getName());
      if (removedModuleInstance!=null) {
        moduleInstance.setProcessInstance(null);
View Full Code Here

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

Examples of org.qi4j.runtime.structure.ModuleInstance

        {   // Not yet in cache

            // Check if this is a root UoW, or if no parent UoW knows about this entity
            EntityState entityState = null;
            EntityModel model = null;
            ModuleInstance module = null;
            // Figure out what EntityStore to use
            for( ModelModule<EntityModel> potentialModule : potentialModels )
            {
                EntityStore store = potentialModule.module().entityStore();
                EntityStoreUnitOfWork storeUow = getEntityStoreUnitOfWork( store, potentialModule.module() );
View Full Code Here

Examples of org.qi4j.runtime.structure.ModuleInstance

            if( usesObject == null && !dependency.optional())
            {
                // No @Uses object provided
                // Try instantiating a Transient or Object for the given type
                ModuleInstance moduleInstance = context.module();

                try
                {
                    if (context.instance() != null)
                        uses = uses.use( context.instance() );
                    usesObject = moduleInstance.newTransient( injectionType, uses.toArray() );
                } catch( NoSuchCompositeException e )
                {
                    try
                    {
                        usesObject = moduleInstance.newObject( injectionType, uses.toArray() );
                    } catch( NoSuchObjectException e1 )
                    {
                        // Could not instantiate an instance - to try instantiate as plain class
                        try
                        {
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.