org.fusesource.meshkeeper
Interface MeshKeeper


public interface MeshKeeper

MeshKeeper

MeshKeeper provides a collection of facilities that assist Java applications to discover, launch, coordinate, and control remote processes across a grid of computers.

Version:
1.0
Author:
cmacnaug

Nested Class Summary
static interface MeshKeeper.DistributionRef<D>
          DistributionRef
static interface MeshKeeper.Eventing
          Eventing
static interface MeshKeeper.Launcher
          Launcher
static interface MeshKeeper.Registry
          Registry
static interface MeshKeeper.Remoting
          Remoting
static interface MeshKeeper.Repository
          Repository
 
Method Summary
 void destroy()
          Closes the distributor cleaning up all distributed references.
<T,S extends T>
MeshKeeper.DistributionRef<T>
distribute(String path, boolean sequential, S distributable, Class<?>... serviceInterfaces)
          This is a convenience method to export an Object and register it's proxy, allowing other components in the mesh to discover it.
 MeshKeeper.Eventing eventing()
          Gets the Eventing support interface.
 ScheduledExecutorService getExecutorService()
          Accesses the MeshKeeper's executor.
 String getRegistryConnectUri()
          Gets a uri which can be used to connect to a meshkeeper server
 ClassLoader getUserClassLoader()
          Gets the user class loader.
 String getUUID()
          Gets this meshkeepers unique id, creating one if one has not been set.
 MeshKeeper.Launcher launcher()
          Gets the launcher support interface.
 MeshKeeper.Registry registry()
          Gets the Mesh Registy support interface.
 MeshKeeper.Remoting remoting()
          Gets the Remoting support interface.
 MeshKeeper.Repository repository()
          Gets the Repository support interface.
 void setUserClassLoader(ClassLoader classLoader)
          Sets the user class loader.
 String setUUID(String prefix)
          Sets a unique id for this meshkeeper instance, if not already set.
 void start()
          Starts distributor services.
 void undistribute(Object distributable)
          Called to undistribute a previously distributed object.
 

Method Detail

getRegistryConnectUri

String getRegistryConnectUri()
Gets a uri which can be used to connect to a meshkeeper server

Returns:

start

void start()
           throws Exception
Starts distributor services.

Throws:
Exception

destroy

void destroy()
             throws Exception
Closes the distributor cleaning up all distributed references.

Throws:
Exception

setUUID

String setUUID(String prefix)
Sets a unique id for this meshkeeper instance, if not already set. If the id isn't already set a unique name will be generated using the given prefix followed by a unique id. If the id has already been set this will have no effect. The unique id is used by MeshKeeper services such as MeshKeeper.Eventing and MeshKeeper.Registry to create unique name spaces.

Parameters:
prefix - The prefix.
Returns:
The value of the uuid.

getUUID

String getUUID()
Gets this meshkeepers unique id, creating one if one has not been set.

Returns:
The unique id for this meshkeeper instance.

distribute

<T,S extends T> MeshKeeper.DistributionRef<T> distribute(String path,
                                                         boolean sequential,
                                                         S distributable,
                                                         Class<?>... serviceInterfaces)
                                         throws Exception
This is a convenience method to export an Object and register it's proxy, allowing other components in the mesh to discover it. object. This is equivalent to calling:
Object proxy = registry().export(distributable, serviceInterfaces);
remoting().addRegistryObject(path, true, proxy);

It is best practice to call #undistribute(Object)) once the object is no longer needed.

Parameters:
path - The path at which to register the exported object.
sequential - Whether the registry path should be registered as a unique node at the given path.
distributable - The object.
Returns:
a MeshKeeper.DistributionRef for distributed object.
Throws:
Exception

undistribute

void undistribute(Object distributable)
                  throws Exception
Called to undistribute a previously distributed object. This is equivalent to calling
#unexport(Object);
#removeRegistryObject(String, boolean, Serializable);

Parameters:
distributable - The object that previously distributed.
Throws:
Exception

getExecutorService

ScheduledExecutorService getExecutorService()
Accesses the MeshKeeper's executor. Tasks run on the executor should not block.

Returns:
The executor service.

setUserClassLoader

void setUserClassLoader(ClassLoader classLoader)
Sets the user class loader. Setting the user class loader can assist meshkeeper in resolving user's serialized objects in some cases. This is an advanced option and should be used with extreme caution.

Parameters:
classLoader - The user classloader.

getUserClassLoader

ClassLoader getUserClassLoader()
Gets the user class loader. Setting the user class loader can assist meshkeeper in resolving user's serialized objects in some cases. This is an advanced option and should be used with extreme caution.

Returns:
The user classloader.

registry

MeshKeeper.Registry registry()
Gets the Mesh Registy support interface. Registry support provides a location accessible to all participants in the Mesh where objects and data can be stored, discovered, and retrieved.

Returns:
The registry.

remoting

MeshKeeper.Remoting remoting()
Gets the Remoting support interface. Remoting support allows rmi like export of objects in the mesh.

Returns:
The remoting interface.

eventing

MeshKeeper.Eventing eventing()
Gets the Eventing support interface. Eventing support allows users to create and listen for events in the Mesh.

Returns:
The Eventing interface.

repository

MeshKeeper.Repository repository()
Gets the Repository support interface. Repository support allows the sharing of artifacts amongst mesh participants. Unlike Registry support, Repository support is intended for large artifacts or directory structures, and also allows referencing resources that are outside the mesh for example in a remote webdav server.

Returns:
Repository Support.

launcher

MeshKeeper.Launcher launcher()
Gets the launcher support interface. Launcher support allows launching of remote processes and Runnables on a Mesh agent.

Returns:
The Launcher support interface


Copyright © 2009 Progress Software Inc.. All Rights Reserved.