Effective October 27, 2012, online and email support for FuseSource products will move to Red Hat support channels. For more information, please see the JIRA Migration to Red Hat FAQ.
As of October 27th, please open all new issues in the Red Hat Customer Portal .
Issue Details (XML | Word | Printable)

Key: MESHKEEPER-10
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Colin MacNaughton
Reporter: Colin MacNaughton
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Forge: MeshKeeper

Create MeshKeeper Execution Container

Created: 09/Sep/09 07:47 PM   Updated: 08/Dec/09 06:43 PM
Component/s: General
Affects Version/s: 1.0
Fix Version/s: 1.0-m1, 1.0


 Description  « Hide
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();
    
}


 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Colin MacNaughton added a comment - 08/Dec/09 06:43 PM
Added MeshContainer