Package org.jgroups.util

Examples of org.jgroups.util.TimeScheduler$Task


      super(fp, "Task", "Create Task");
    }

    @Override
    protected Task createFlowElement(ICreateContext context) {
      Task task = ModelHandler.FACTORY.createTask();
      task.setName("Task Name");
      return task;
    }
View Full Code Here


    public CreateTaskFeature(IFeatureProvider fp) {
      super(fp, "Log Task", "Create Log Task");
    }

    protected Task createFlowElement(ICreateContext context) {
      Task task = ModelHandler.FACTORY.createTask();
      task.setName("Log Task");
      ArrayList<EStructuralFeature> attributes = Bpmn2Preferences
          .getAttributes(task.eClass());
      for (EStructuralFeature eStructuralFeature : attributes) {
        if (eStructuralFeature.getName().equals("taskName"))
          task.eSet(eStructuralFeature, "log");
      }
      return task;
    }
View Full Code Here

    public CreateTaskFeature(IFeatureProvider fp) {
      super(fp, "Email Task", "Create Email Task");
    }

    protected Task createFlowElement(ICreateContext context) {
      Task task = ModelHandler.FACTORY.createTask();
      task.setName("Email Task");
      ArrayList<EStructuralFeature> attributes = Bpmn2Preferences
          .getAttributes(task.eClass());
      for (EStructuralFeature eStructuralFeature : attributes) {
        if (eStructuralFeature.getName().equals("taskName"))
          task.eSet(eStructuralFeature, "email");
      }
      return task;
    }
View Full Code Here

        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = unmarshaller.unmarshall(getTestJsonFile("sequenceFlow.json"));
        assertTrue(definitions.getRootElements().size() == 1);
        Process process = (Process) definitions.getRootElements().get(0);
        assertTrue(process.getFlowElements().get(0) instanceof Task);
        Task task = (Task) process.getFlowElements().get(0);
        assertEquals("task1", task.getName());
        Task task2 = (Task) process.getFlowElements().get(1);
        assertEquals("task2", task2.getName());
        SequenceFlow flow = (SequenceFlow) process.getFlowElements().get(2);
        assertEquals("seqFlow", flow.getName());
        assertEquals(task, flow.getSourceRef());
        assertEquals(task2, flow.getTargetRef());
        definitions.eResource().save(System.out, Collections.emptyMap());
View Full Code Here

    public void testAssociationUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = unmarshaller.unmarshall(getTestJsonFile("association.json"));
        assertTrue(definitions.getRootElements().size() == 1);
        Process process = (Process) definitions.getRootElements().get(0);
        Task g = (Task) process.getFlowElements().get(0);
        assertEquals("task", g.getName());
        TextAnnotation textA = (TextAnnotation) process.getArtifacts().get(0);
        Association association = (Association) process.getArtifacts().get(1);
        assertEquals(g, association.getSourceRef());
        assertEquals(textA, association.getTargetRef());
        assertEquals(AssociationDirection.NONE, association.getAssociationDirection());
View Full Code Here

    @Test
    public void testAssociationUnidirectionalUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = unmarshaller.unmarshall(getTestJsonFile("associationOne.json"));
        Process process = (Process) definitions.getRootElements().get(0);
        Task g = (Task) process.getFlowElements().get(0);
        assertEquals("task", g.getName());
        TextAnnotation textA = (TextAnnotation) process.getArtifacts().get(0);
        Association association = (Association) process.getArtifacts().get(1);
        assertEquals(g, association.getSourceRef());
        assertEquals(textA, association.getTargetRef());
        assertEquals(AssociationDirection.ONE, association.getAssociationDirection());
View Full Code Here

    @Test
    public void testAssociationBidirectionalUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = unmarshaller.unmarshall(getTestJsonFile("associationBoth.json"));
        Process process = (Process) definitions.getRootElements().get(0);
        Task g = (Task) process.getFlowElements().get(0);
        assertEquals("task", g.getName());
        TextAnnotation textA = (TextAnnotation) process.getArtifacts().get(0);
        Association association = (Association) process.getArtifacts().get(1);
        assertEquals(g, association.getSourceRef());
        assertEquals(textA, association.getTargetRef());
        assertEquals(AssociationDirection.BOTH, association.getAssociationDirection());
View Full Code Here

    @Test
    public void testDoubleLaneUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = unmarshaller.unmarshall(getTestJsonFile("doubleLane.json"));
        Process process = (Process) definitions.getRootElements().get(0);
        Task g = (Task) process.getFlowElements().get(0);
        assertEquals("task", g.getName());
        assertTrue(process.getLaneSets().size() == 1);
        assertTrue(process.getLaneSets().get(0).getLanes().size() == 1);
        Lane firstLane = process.getLaneSets().get(0).getLanes().get(0);
        assertEquals("First lane", firstLane.getName());
        Lane secondLane = firstLane.getChildLaneSet().getLanes().get(0);
View Full Code Here

    static final double       PERCENTAGE_OFF=1.3; // how much can expected xmit_timeout and real timeout differ to still be okay ?
    final Map<Long,Entry>     msgs=new ConcurrentHashMap<Long,Entry>(); // keys=seqnos (Long), values=Entries

    @DataProvider(name="provider")
    Object[][] provider() {
        final TimeScheduler timer=new DefaultTimeScheduler(10);
        return new Object[][] {
                {timer,
                 new AckSenderWindow(new MyRetransmitCommand(), new StaticInterval(xmit_timeouts), timer)}
        };
    }
View Full Code Here

    public void testShutdownOfTimer() throws Exception {
        a=createSharedChannel(SINGLETON_1);
        b=createSharedChannel(SINGLETON_1);
        a.connect("x");
        b.connect("y");
        TimeScheduler timer1=a.getProtocolStack().getTransport().getTimer();
        TimeScheduler timer2=b.getProtocolStack().getTransport().getTimer();

        assert timer1 == timer2;

        assert !timer1.isShutdown();
        assert !timer2.isShutdown();

        Util.sleep(500);
        b.close();

        assert !timer2.isShutdown();
        assert !timer1.isShutdown();

        a.close(); // now, reference counting reaches 0, so the timer thread pool is stopped
        assert timer2.isShutdown();
        assert timer1.isShutdown();
    }
View Full Code Here

TOP

Related Classes of org.jgroups.util.TimeScheduler$Task

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.