0 Replies Latest reply on Mar 14, 2008 8:12 AM by tom.baeyens

    services

    tom.baeyens

      i now have finalized the services and how they are wired. the previous approach with EnvironmentFactory.getCommandService() was not extensible towards sub projects.

      now the idea is as follows: The user always has to obtain an EnvironmentFactory object with one of the following methods:

      EnvironmentFactory environmentFactory = EnvironmentFactory.parseResource("resource");
      EnvironmentFactory environmentFactory = EnvironmentFactory.parseInputStream(stream);
      EnvironmentFactory.parseXxx(...);


      Then this environment factory is to be kept statically by the user. I have made environment factory implement context so that you can easily get the services that are defined in the application context like this:

      CommandService commandService = environmentFactory.get(CommandService.class);
      PvmService pvmService = environmentFactory.get(PvmService.class);
      IdentityService identityService = environmentFactory.get(IdentityService.class);


      To configure those, a binding is added to the wire descriptors so that the command service and pvm service can be configured like this:

      <environment>
      
       <application>
       <command-service />
       <pvm-service />
      
       ...
       </application>
      
       <block>
       ...
       </block>
      
      </environment>
      


      each of those services is now a session facade that will be the primary way for people to use the pvm and the subprojects.

      take a look at org.jbpm.PvmService and org.jbpm.client.impl.PvmServiceImpl

      does that make sense to you ?