Examples of PersistenceContextProvider


Examples of org.apache.aries.jpa.container.context.PersistenceContextProvider

      fail("No context should exist");
    } catch (RuntimeException re) {
      //Expected
    }
   
    PersistenceContextProvider provider = getOsgiService(PersistenceContextProvider.class);
   
    HashMap<String, Object> props = new HashMap<String, Object>();
    props.put(PersistenceContextProvider.PERSISTENCE_CONTEXT_TYPE, PersistenceContextType.TRANSACTION);
    provider.registerContext("test-unit", bundleContext.getBundle(), props);
   
    emf = getOsgiService(EntityManagerFactory.class, "(&(osgi.unit.name=test-unit)("
          + PersistenceUnitConstants.CONTAINER_MANAGED_PERSISTENCE_UNIT + "=true)" +
        "(" + PersistenceContextProvider.PROXY_FACTORY_EMF_ATTRIBUTE + "=*))", DEFAULT_TIMEOUT);
   
View Full Code Here

Examples of org.apache.aries.jpa.container.context.PersistenceContextProvider

    assertEquals("blue", list.get(1).getColour());
    assertEquals("A1AAA", list.get(1).getNumberPlate());
  }
 
  private void registerClient(String name) {
    PersistenceContextProvider provider = context().getService(PersistenceContextProvider.class);
   
    HashMap<String, Object> props = new HashMap<String, Object>();
    props.put(PersistenceContextProvider.PERSISTENCE_CONTEXT_TYPE, PersistenceContextType.TRANSACTION);
    provider.registerContext(name, bundleContext.getBundle(), props);
  }
View Full Code Here

Examples of org.apache.aries.jpa.container.context.PersistenceContextProvider

 
  @Test
  public void testSimpleContextQuiesce() throws Exception {

    //Get a managed context registered
    PersistenceContextProvider provider = context().getService(PersistenceContextProvider.class);
   
    HashMap<String, Object> props = new HashMap<String, Object>();
    props.put(PersistenceContextProvider.PERSISTENCE_CONTEXT_TYPE, PersistenceContextType.TRANSACTION);
    provider.registerContext("test-unit", bundleContext.getBundle(), props);
   
    context().getService(EntityManagerFactory.class, "(&(osgi.unit.name=test-unit)("
          + PersistenceUnitConstants.CONTAINER_MANAGED_PERSISTENCE_UNIT + "=true)" +
        "(" + PersistenceContextProvider.PROXY_FACTORY_EMF_ATTRIBUTE + "=*))");
   
View Full Code Here

Examples of org.apache.aries.jpa.container.context.PersistenceContextProvider

  public void testComplexContextQuiesce() throws Exception {
    //This is load bearing. we have to wait to create the EntityManager until the DataSource is available
    context().getService(DataSource.class);
   
    // Get a managed context registered
    PersistenceContextProvider provider = context().getService(PersistenceContextProvider.class);
   
    HashMap<String, Object> props = new HashMap<String, Object>();
    props.put(PersistenceContextProvider.PERSISTENCE_CONTEXT_TYPE, PersistenceContextType.TRANSACTION);
    provider.registerContext("test-unit", bundleContext.getBundle(), props);
   
    EntityManagerFactory emf = context().getService(EntityManagerFactory.class, "(&(osgi.unit.name=test-unit)("
          + PersistenceUnitConstants.CONTAINER_MANAGED_PERSISTENCE_UNIT + "=true)" +
        "(" + PersistenceContextProvider.PROXY_FACTORY_EMF_ATTRIBUTE + "=*))");
   
View Full Code Here

Examples of org.apache.aries.jpa.container.context.PersistenceContextProvider

  @Test
  public void testContextRuntimeQuiesce() throws Exception {
    //This is load bearing. we have to wait to create the EntityManager until the DataSource is available
    context().getService(DataSource.class);
   
    PersistenceContextProvider provider = context().getService(PersistenceContextProvider.class);
   
    HashMap<String, Object> props = new HashMap<String, Object>();
    props.put(PersistenceContextProvider.PERSISTENCE_CONTEXT_TYPE, PersistenceContextType.TRANSACTION);
    provider.registerContext("test-unit", bundleContext.getBundle(), props);
   
    EntityManagerFactory emf = context().getService(EntityManagerFactory.class, "(&(osgi.unit.name=test-unit)("
          + PersistenceUnitConstants.CONTAINER_MANAGED_PERSISTENCE_UNIT + "=true)" +
        "(" + PersistenceContextProvider.PROXY_FACTORY_EMF_ATTRIBUTE + "=*))");
   
View Full Code Here

Examples of org.apache.aries.jpa.container.context.PersistenceContextProvider

    //This is load bearing. we have to wait to create the EntityManager until the DataSource is available
    context().getService(DataSource.class);
   
    // Get a managed context registered
    PersistenceContextProvider provider = context().getService(PersistenceContextProvider.class);
   
    HashMap<String, Object> props = new HashMap<String, Object>();
    props.put(PersistenceContextProvider.PERSISTENCE_CONTEXT_TYPE, PersistenceContextType.TRANSACTION);
    provider.registerContext("test-unit", bundleContext.getBundle(), props);
   
    EntityManagerFactory emf = context().getService(EntityManagerFactory.class, "(&(osgi.unit.name=test-unit)("
          + PersistenceUnitConstants.CONTAINER_MANAGED_PERSISTENCE_UNIT + "=true)" +
        "(" + PersistenceContextProvider.PROXY_FACTORY_EMF_ATTRIBUTE + "=*))");
   
View Full Code Here

Examples of org.apache.aries.jpa.container.context.PersistenceContextProvider

  public void testComplexQuiesceInteraction2() throws Exception {
    //This is load bearing. we have to wait to create the EntityManager until the DataSource is available
    context().getService(DataSource.class);
   
    // Get a managed context registered
    PersistenceContextProvider provider = context().getService(PersistenceContextProvider.class);
   
    HashMap<String, Object> props = new HashMap<String, Object>();
    props.put(PersistenceContextProvider.PERSISTENCE_CONTEXT_TYPE, PersistenceContextType.TRANSACTION);
    provider.registerContext("test-unit", bundleContext.getBundle(), props);
   
    EntityManagerFactory emf = context().getService(EntityManagerFactory.class, "(&(osgi.unit.name=test-unit)("
          + PersistenceUnitConstants.CONTAINER_MANAGED_PERSISTENCE_UNIT + "=true)" +
        "(" + PersistenceContextProvider.PROXY_FACTORY_EMF_ATTRIBUTE + "=*))");
   
View Full Code Here

Examples of org.apache.aries.jpa.container.context.PersistenceContextProvider

 
  @Test
  public void testSimpleContextQuiesce() throws Exception {

    //Get a managed context registered
    PersistenceContextProvider provider = getOsgiService(PersistenceContextProvider.class);
   
    HashMap<String, Object> props = new HashMap<String, Object>();
    props.put(PersistenceContextProvider.PERSISTENCE_CONTEXT_TYPE, PersistenceContextType.TRANSACTION);
    provider.registerContext("test-unit", bundleContext.getBundle(), props);
   
    EntityManagerFactory emf = getOsgiService(EntityManagerFactory.class, "(&(osgi.unit.name=test-unit)("
          + PersistenceUnitConstants.CONTAINER_MANAGED_PERSISTENCE_UNIT + "=true)" +
        "(" + PersistenceContextProvider.PROXY_FACTORY_EMF_ATTRIBUTE + "=*))", DEFAULT_TIMEOUT);
   
View Full Code Here

Examples of org.apache.aries.jpa.container.context.PersistenceContextProvider

  public void testComplexContextQuiesce() throws Exception {
    //This is load bearing. we have to wait to create the EntityManager until the DataSource is available
    getOsgiService(DataSource.class);
   
    // Get a managed context registered
    PersistenceContextProvider provider = getOsgiService(PersistenceContextProvider.class);
   
    HashMap<String, Object> props = new HashMap<String, Object>();
    props.put(PersistenceContextProvider.PERSISTENCE_CONTEXT_TYPE, PersistenceContextType.TRANSACTION);
    provider.registerContext("test-unit", bundleContext.getBundle(), props);
   
    EntityManagerFactory emf = getOsgiService(EntityManagerFactory.class, "(&(osgi.unit.name=test-unit)("
          + PersistenceUnitConstants.CONTAINER_MANAGED_PERSISTENCE_UNIT + "=true)" +
        "(" + PersistenceContextProvider.PROXY_FACTORY_EMF_ATTRIBUTE + "=*))", DEFAULT_TIMEOUT);
   
View Full Code Here

Examples of org.apache.aries.jpa.container.context.PersistenceContextProvider

  @Test
  public void testContextRuntimeQuiesce() throws Exception {
    //This is load bearing. we have to wait to create the EntityManager until the DataSource is available
    getOsgiService(DataSource.class);
   
    PersistenceContextProvider provider = getOsgiService(PersistenceContextProvider.class);
   
    HashMap<String, Object> props = new HashMap<String, Object>();
    props.put(PersistenceContextProvider.PERSISTENCE_CONTEXT_TYPE, PersistenceContextType.TRANSACTION);
    provider.registerContext("test-unit", bundleContext.getBundle(), props);
   
    EntityManagerFactory emf = getOsgiService(EntityManagerFactory.class, "(&(osgi.unit.name=test-unit)("
          + PersistenceUnitConstants.CONTAINER_MANAGED_PERSISTENCE_UNIT + "=true)" +
        "(" + PersistenceContextProvider.PROXY_FACTORY_EMF_ATTRIBUTE + "=*))", DEFAULT_TIMEOUT);
   
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.