Package org.apache.aries.jpa.container.context.transaction.impl

Examples of org.apache.aries.jpa.container.context.transaction.impl.DestroyCallback


   * @throws InvalidSyntaxException
   */
  @Test
  public void testNoOpQuiesce() throws InvalidSyntaxException
  {
    DestroyCallback cbk = Skeleton.newMock(DestroyCallback.class);
    Bundle b = context.getBundle();
    mgr.quiesceUnits(b, cbk);
   
    Skeleton.getSkeleton(cbk).assertCalledExactNumberOfTimes(new MethodCall(DestroyCallback.class,
        "callback"), 1);
View Full Code Here


   */
  @Test
  public void testBasicQuiesce() throws InvalidSyntaxException
  {
    testContextThenUnit();
    DestroyCallback cbk = Skeleton.newMock(DestroyCallback.class);
    Bundle b = context.getBundle();
    mgr.quiesceUnits(b, cbk);
   
    Skeleton.getSkeleton(cbk).assertCalledExactNumberOfTimes(new MethodCall(DestroyCallback.class,
        "callback"), 1);
View Full Code Here

    mgr.registerContext("unit", client1, new HashMap<String, Object>());
   
    reg2 = registerUnit(emf1, "unit2", TRUE);
    mgr.registerContext("unit2", client2, new HashMap<String, Object>());
   
    DestroyCallback cbk = Skeleton.newMock(DestroyCallback.class);
    Bundle b = context.getBundle();
    mgr.quiesceUnits(b, cbk);
   
    Skeleton.getSkeleton(cbk).assertCalledExactNumberOfTimes(new MethodCall(DestroyCallback.class,
        "callback"), 1);
View Full Code Here

   
    emf.createEntityManager().persist(new Object());
    emf2.createEntityManager().persist(new Object());
   
   
    DestroyCallback cbk = Skeleton.newMock(DestroyCallback.class);
    Bundle b = context.getBundle();
    mgr.quiesceUnits(b, cbk);
   
    Skeleton.getSkeleton(cbk).assertNotCalled(new MethodCall(DestroyCallback.class,
        "callback"));
View Full Code Here

   * @throws InvalidSyntaxException
   */
  @Test
  public void testNoOpQuiesceAll() throws InvalidSyntaxException
  {
    DestroyCallback cbk = Skeleton.newMock(DestroyCallback.class);
    Bundle b = context.getBundle();
    mgr.quiesceAllUnits(cbk);
   
    Skeleton.getSkeleton(cbk).assertCalledExactNumberOfTimes(new MethodCall(DestroyCallback.class,
        "callback"), 1);
View Full Code Here

   */
  @Test
  public void testBasicQuiesceAll() throws InvalidSyntaxException
  {
    testContextThenUnit();
    DestroyCallback cbk = Skeleton.newMock(DestroyCallback.class);
    Bundle b = context.getBundle();
    mgr.quiesceAllUnits(cbk);
   
    Skeleton.getSkeleton(cbk).assertCalledExactNumberOfTimes(new MethodCall(DestroyCallback.class,
        "callback"), 1);
View Full Code Here

    mgr.registerContext("unit", client1, new HashMap<String, Object>());
   
    reg2 = registerUnit(emf1, "unit2", TRUE);
    mgr.registerContext("unit2", client2, new HashMap<String, Object>());
   
    DestroyCallback cbk = Skeleton.newMock(DestroyCallback.class);
    Bundle b = context.getBundle();
    mgr.quiesceAllUnits(cbk);
   
    Skeleton.getSkeleton(cbk).assertCalledExactNumberOfTimes(new MethodCall(DestroyCallback.class,
        "callback"), 1);
View Full Code Here

   
    emf.createEntityManager().persist(new Object());
    emf2.createEntityManager().persist(new Object());
   
   
    DestroyCallback cbk = Skeleton.newMock(DestroyCallback.class);
    Bundle b = context.getBundle();
    mgr.quiesceAllUnits(cbk);
   
    Skeleton.getSkeleton(cbk).assertNotCalled(new MethodCall(DestroyCallback.class,
        "callback"));
View Full Code Here

      if(managers.isEmpty())
        callback.callback();
      else {
        final GlobalPersistenceManager gpm = this;
        //A special callback to say we're done when everyone has replied!
        DestroyCallback destroy = new DestroyCallback() {
          int count = mgrs.size();
          public void callback() {
            count--;
            if(count == 0) {
              for(Entry<Bundle, PersistenceContextManager> entry : mgrs){
View Full Code Here

      if(managers.isEmpty())
        callback.callback();
      else {
        final GlobalPersistenceManager gpm = this;
        //A special callback to say we're done when everyone has replied!
        DestroyCallback destroy = new DestroyCallback() {
          int count = mgrs.size();
          public void callback() {
            count--;
            if(count == 0) {
              for(Entry<Bundle, PersistenceContextManager> entry : mgrs){
View Full Code Here

TOP

Related Classes of org.apache.aries.jpa.container.context.transaction.impl.DestroyCallback

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.