Package org.osgi.service.coordinator

Examples of org.osgi.service.coordinator.Coordination.end()


        c2.addParticipant(p22);
        assertTrue(c2.getParticipants().contains(p21));
        assertTrue(c2.getParticipants().contains(p22));
        assertEquals(2, c2.getParticipants().size());

        c2.end();
        assertTrue(p21.ended);
        assertEquals(c2, p21.c);
        assertTrue(p22.ended);
        assertEquals(c2, p22.c);
        assertTrue("p22 must be called before p21", p22.time < p21.time);
View Full Code Here


        c3.addParticipant(p31); // should be "ignored"
        assertTrue(c3.getParticipants().contains(p31));
        assertTrue(c3.getParticipants().contains(p32));
        assertEquals(2, c3.getParticipants().size());

        c3.end();
        assertTrue(p31.ended);
        assertEquals(c3, p31.c);
        assertTrue(p32.ended);
        assertEquals(c3, p32.c);
        assertTrue("p32 must be called before p31", p32.time < p31.time);
View Full Code Here

                {
                    p1.addParticipantFailure(t);
                }
                finally
                {
                    c2.end();
                }
            }
        };
        c2Thread.start();
View Full Code Here

      coordination.fail(t);
    }
    finally {
      if (!embedded) {
        try {
          coordination.end();
        }
        catch (CoordinationException e) {
          Throwable t = e.getCause();
          if (t instanceof SubsystemException)
            throw (SubsystemException)t;
View Full Code Here

          ResourceInstaller.newInstance(coordination, root, root).install();
          populateRootSubsystem(root, coordination);
        } catch (Exception e) {
          coordination.fail(e);
        } finally {
          coordination.end();
        }
      }
      else {
        // There are persisted subsystems.
        Coordination coordination = Utils.createCoordination();
View Full Code Here

          ResourceInstaller.newInstance(coordination, root, root).install();
          populateRootSubsystem(root, coordination);
        } catch (Exception e) {
          coordination.fail(e);
        } finally {
          coordination.end();
        }
      }
    }
    return root;
  }
View Full Code Here

      coordination.fail(t);
      // TODO Need to reinstate complete isolation by disconnecting the
      // region and transition to INSTALLED.
    } finally {
      try {
        coordination.end();
      } catch (CoordinationException e) {
        target.setState(State.RESOLVED);
        Throwable t = e.getCause();
        if (t instanceof SubsystemException)
          throw (SubsystemException)t;
View Full Code Here

    catch (Throwable t) {
      coordination.fail(t);
    }
    finally {
      try {
        coordination.end();
      }
      catch (CoordinationException e) {
        logger.error("Resource could not be installed", e);
      }
    }
View Full Code Here

        assertNull(coordinator.peek());

        assertFalse(c1.fail(new Exception()));
        try
        {
            c1.end();
            fail("Expected CoordinationException.FAILED on end() after fail()");
        }
        catch (CoordinationException ce)
        {
            // expected failed
View Full Code Here

        assertNull(coordinator.peek());
        assertNull(c2.getFailure());
        assertFalse(c2.isTerminated());
        assertTrue(c2.getParticipants().isEmpty());

        c2.end();
        assertNull(c2.getFailure());
        assertTrue(c2.isTerminated());
        assertNull(coordinator.peek());

        assertFalse(c2.fail(new Exception()));
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.