0 Replies Latest reply on Mar 6, 2007 3:25 PM by Tom Baeyens

    updates in wiring and context

    Tom Baeyens Master

      i'm going to commit some changes tomorrow. here are the highlights:

      JbpmConfiguration --> org.jbpm.ctx.ContextFactory (interface)
      JbpmContext --> org.jbpm.ctx.Context (class)
      WiringContext --> WireScope


      so this will be the context block:

      static ContextFactory contextFactory = ...;
      ...
      
      Context context = contextFactory.createContext();
      try {
       ...do things in this context...
      } finally {
       context.close();
      }
      


      A context will have a set of scopes. Each scope represents one set of key value pairs. A WireScope is a set of key value pairs of which the values are specified by Descriptor's.

      After creation, a context will have 2 scopes:
      1) the application scope and the context scope. The application scope will be the same for all created contexts.
      2) A new context scope will be created for each context based on the same WireDefinition (= map of descriptors).

      Searching between scopes is implemented in the context. So you can do a context.find("sessionFactory"). The context will then start searching for this object in all its scopes. By default, the scopes are searched in the reverse order as they were added. Scopes only have to look inside when an object is requested.

      New scopes can be added dynamically to the context. They are keyed by their class. Each scope has to have its own scope class.

      now i'm chewing on the listeners to get the close and flush methods implemented.