Details

    • Type: Feature Request Feature Request
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Done
    • Affects Version/s: 1.0
    • Fix Version/s: 1.0-m1, 1.0
    • Component/s: General
    • Labels:
      None
    • Similar Issues:
      Show 8 results 

      Description

      MeshKeeper currently supports the ability to run Runnables via its Launcher interface. One drawback to this approach is that it causes a new JVM to be created for each runnable. We could expand on this and allow users to create an Execution Container capable of hosting multiple Runnables, or more generally ... anything Distributable something like this:

      class TestComponent implements Distributable
      {
         public void start()
         {
            Thread thread = new Thread(this);
             thread.start();
         }
       
         public void doSomething()
         {
           //test something:
           //MeshKeeper below is provided by the mesh container:
           mesh.eventing().sendEvent(new MeshEvent("SUCCESS");
         }
       
      }
       
      public void test() throws Exception
      {
          MeshKeeper mesh = getMeshKeeper();
       
          //Might specify launch properties like JVM etc when creating MeshContainer:
          MeshContainer m = mesh.createMeshContainer("agent1", .... );
       
          //Might additionally allow the component to register itself at some path. 
          TestComponent component1 = m.host(new TestComponent());
          TestComponent component2 = m.host(new TestComponent());
          component1.start();
          component2.start(); 
          waitForFinishedEvents();
          
      }

        Gliffy Diagrams

          Activity

          Hide
          Colin MacNaughton added a comment -

          Added MeshContainer

          Show
          Colin MacNaughton added a comment - Added MeshContainer

            People

            • Assignee:
              Colin MacNaughton
              Reporter:
              Colin MacNaughton
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development