Package org.jbpm.persistence.db

Examples of org.jbpm.persistence.db.DbPersistenceServiceFactory


         {
            throw new IllegalArgumentException("JbpmConfiguration not found in JNDI", ne);
         }
      }

      DbPersistenceServiceFactory dbpsf = (DbPersistenceServiceFactory) jbpmConfiguration.getServiceFactory("persistence");
      if (Naming.getInitialContextProperties()!=null)
      {
         // Prefix regular JNDI properties for Hibernate
         Hashtable<String, String> hash = Naming.getInitialContextProperties();
         Properties prefixed = new Properties();
         for (Map.Entry<String, String> entry: hash.entrySet() )
         {
            prefixed.setProperty( Environment.JNDI_PREFIX + "." + entry.getKey(), entry.getValue() );
         }
        
         try
         {
            dbpsf.getConfiguration().getProperties().putAll(prefixed);
         }
         catch (HibernateException he)
         {
            log.info("could not set JNDI properties for jBPM persistence: " + he.getMessage());
         }
View Full Code Here


  }

  private void ensureCleanDatabase() {
    boolean hasLeftOvers = false;

    DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) getJbpmConfiguration().getServiceFactory(
        "persistence");
    JbpmSchema jbpmSchema = new JbpmSchema(persistenceServiceFactory.getConfiguration());
    Map<String, Long> recordCountPerTable = jbpmSchema.getRowsPerTable();

    for (Map.Entry<String, Long> entry : recordCountPerTable.entrySet()) {
      Long count = entry.getValue();
      if (count != 0) {
View Full Code Here

      jbpmSchema.cleanSchema();
    }
  }

  protected String getHibernateDialect() {
    DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) jbpmContext.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
    return persistenceServiceFactory.getConfiguration().getProperty(Environment.DIALECT);
  }
View Full Code Here

         {
            throw new IllegalArgumentException("JbpmConfiguration not found in JNDI", ne);
         }
      }

      DbPersistenceServiceFactory dbpsf = (DbPersistenceServiceFactory) jbpmConfiguration.getServiceFactory("persistence");
      if (Naming.getInitialContextProperties()!=null)
      {
         // Prefix regular JNDI properties for Hibernate
         Hashtable<String, String> hash = Naming.getInitialContextProperties();
         Properties prefixed = new Properties();
         for (Map.Entry<String, String> entry: hash.entrySet() )
         {
            prefixed.setProperty( Environment.JNDI_PREFIX + "." + entry.getKey(), entry.getValue() );
         }
        
         try
         {
            dbpsf.getConfiguration().getProperties().putAll(prefixed);
         }
         catch (HibernateException he)
         {
            log.info("could not set JNDI properties for jBPM persistence: " + he.getMessage());
         }
View Full Code Here

        " <string name='resource.varmapping' value='org/jbpm/context/exe/jbpm.varmapping.xml' />" +
        "</jbpm-configuration>"
      );

      Configuration configuration = getConfiguration(cfg, properties);
      DbPersistenceServiceFactory dbPersistenceServiceFactory = (DbPersistenceServiceFactory) jbpmConfiguration.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
      dbPersistenceServiceFactory.setConfiguration(configuration);

      jbpmConfigurations.put(key, jbpmConfiguration);
    }
    return jbpmConfiguration;
  }
View Full Code Here

 
  public void createSchema(String jbpmContextName) {
    JbpmContext jbpmContext = createJbpmContext(jbpmContextName);
    try {
      Services services = jbpmContext.getServices();
      DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) services.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
      persistenceServiceFactory.createSchema();
    } finally {
      jbpmContext.close();
    }
  }
View Full Code Here

 
  public void dropSchema(String jbpmContextName) {
    JbpmContext jbpmContext = createJbpmContext(jbpmContextName);
    try {
      Services services = jbpmContext.getServices();
      DbPersistenceServiceFactory persistenceServiceFactory = (DbPersistenceServiceFactory) services.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
      persistenceServiceFactory.dropSchema();
    } finally {
      jbpmContext.close();
    }
  }
View Full Code Here

    Services services = new Services(serviceFactories);
    assertSame(messageService, services.getMessageService());
  }
  public void testPersistenceService() {
    Map serviceFactories = new HashMap();
    DbPersistenceService persistenceService = new DbPersistenceService(new DbPersistenceServiceFactory());
    serviceFactories.put("persistence", new TestGivenServiceFactory(
      persistenceService
    ));
    Services services = new Services(serviceFactories);
    assertSame(persistenceService, services.getPersistenceService());
View Full Code Here

      log.debug( "created seam managed jBPM context");
   }

   private void assertNoTransactionManagement()
   {
      DbPersistenceServiceFactory dpsf = (DbPersistenceServiceFactory) jbpmContext.getJbpmConfiguration()
            .getServiceFactory(Services.SERVICENAME_PERSISTENCE);
      if ( dpsf.isTransactionEnabled() )
      {
         throw new IllegalStateException("jBPM transaction management is enabled, disable in jbpm.cfg.xml");
      }
   }
View Full Code Here

         {
            throw new IllegalArgumentException("JbpmConfiguration not found in JNDI", ne);
         }
      }

      DbPersistenceServiceFactory dbpsf = (DbPersistenceServiceFactory) jbpmConfiguration.getServiceFactory("persistence");
      if (Naming.getInitialContextProperties()!=null)
      {
         // Prefix regular JNDI properties for Hibernate
         Hashtable<String, String> hash = Naming.getInitialContextProperties();
         Properties prefixed = new Properties();
         for (Map.Entry<String, String> entry: hash.entrySet() )
         {
            prefixed.setProperty( Environment.JNDI_PREFIX + "." + entry.getKey(), entry.getValue() );
         }
        
         try
         {
            dbpsf.getConfiguration().getProperties().putAll(prefixed);
         }
         catch (HibernateException he)
         {
            log.warn("could not set JNDI properties for jBPM persistence: " + he.getMessage());
         }
View Full Code Here

TOP

Related Classes of org.jbpm.persistence.db.DbPersistenceServiceFactory

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.