Package org.jgroups.mux

Examples of org.jgroups.mux.Multiplexer$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

            throw new IllegalArgumentException("stack name and service ID have to be non null");
       
        if(stack_name.length()==0 || id.length() == 0)
            throw new IllegalArgumentException("stack name and service ID have to non empty strings");
              
        Multiplexer mux = null;
        synchronized (channels) {
            if (!channels.containsKey(stack_name)) {
                JChannel ch = new JChannel(getConfig(stack_name));
                registerChannel(ch, stack_name);
                mux = new Multiplexer(ch);
                channels.put(stack_name, mux);
            } else {
                mux = channels.get(stack_name);
            }
        }
        if(register_for_state_transfer)
            mux.registerForStateTransfer(id, substate_id);
       
        Channel c = mux.createMuxChannel(id, stack_name);
        c.addChannelListener(new MuxFactoryChannelListener());
        return c;
    }
View Full Code Here

     * @param id
     *            service id
     * @return true if such MuxChannel exists, false otherwise
     */
   public boolean hasMuxChannel(String stack_name, String id) {
    Multiplexer entry = channels.get(stack_name);
    if (entry != null) {
      Set<String> services = entry.getServiceIds();
      return (services != null && services.contains(id));
    }
    return false;
  }
View Full Code Here

TOP

Related Classes of org.jgroups.mux.Multiplexer$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.