Examples of DestroyCallback


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

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

   */
  @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

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

    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

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

   
    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

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

   * @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

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

   */
  @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

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

    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

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

   
    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

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

      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

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

      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
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.