com.zfabrik.workers.home
Interface IHomeLayout


public interface IHomeLayout

Interface supported by a component of type com.zfabrik.homeLayout.

When starting a z2 environment in server mode (as compared to embedded, see ProcessRunner) the home layout determines the worker processes (see IWorkerProcess) to be started and managed by the home process.

A home layout component has no further resources. Typically a home layout definition looks like the following properties set:

 com.zfabrik.component.type=com.zfabrik.homeLayout
 home.workers=<name of worker process component 1>, <name of worker process component 2>, ... 
 
During startup, the home process identifies its home layout via the system property com.zfabrik.home.layout (see also Foundation.HOME_LAYOUT_COMPONENT). The home layout (see above) provides the list of worker processes to manage. See IWorkerProcess for more information about worker processes.

This interface allows to send messages to worker processes from the home process. It is hence mostly used internally and should not be used be applications.

See HomeHandle for a worker process perspective onto the running home layout.


Field Summary
static int SCOPE_CLUSTER
          broadcast scope: send invalidation out to the cluster
static int SCOPE_GLOBAL
          broadcast scope: local home process
static int SCOPE_HOME
          broadcast scope: local home process
static int SCOPE_OTHERS
          broadcast scope: exclude the sending worker process
static int SCOPE_WORKERS
          broadcast scope: all worker processes in home
static String TYPE
           
 
Method Summary
 void broadcastInvalidations(Collection<String> invs, long timeout, int scope, String senderWorker)
          broadcast resource invalidations to all worker processes of a home and, if specified, to all homes and workers in a cluster.
 void broadcastMessage(Map<String,Serializable> args, long timeout)
          broadcast a message to all worker processes of a home.
 void broadcastMessage(Map<String,Serializable> args, long timeout, boolean killOnTimeOut)
          broadcast a message to all worker processes of a home
 void start()
           
 

Field Detail

TYPE

static final String TYPE
See Also:
Constant Field Values

SCOPE_HOME

static final int SCOPE_HOME
broadcast scope: local home process

See Also:
Constant Field Values

SCOPE_WORKERS

static final int SCOPE_WORKERS
broadcast scope: all worker processes in home

See Also:
Constant Field Values

SCOPE_OTHERS

static final int SCOPE_OTHERS
broadcast scope: exclude the sending worker process

See Also:
Constant Field Values

SCOPE_CLUSTER

static final int SCOPE_CLUSTER
broadcast scope: send invalidation out to the cluster

See Also:
Constant Field Values

SCOPE_GLOBAL

static final int SCOPE_GLOBAL
broadcast scope: local home process

See Also:
Constant Field Values
Method Detail

broadcastMessage

void broadcastMessage(Map<String,Serializable> args,
                      long timeout)
                      throws IOException
broadcast a message to all worker processes of a home. Timeouts will result in exceptions

Parameters:
args -
timeout - timeout per worker or -1 for default
Throws:
IOException

broadcastMessage

void broadcastMessage(Map<String,Serializable> args,
                      long timeout,
                      boolean killOnTimeOut)
                      throws IOException
broadcast a message to all worker processes of a home

Parameters:
args -
timeout - timeout per worker or -1 for default
killOnTimeOut - if true a time out will lead to a worker process termination.
Throws:
IOException

broadcastInvalidations

void broadcastInvalidations(Collection<String> invs,
                            long timeout,
                            int scope,
                            String senderWorker)
                            throws IOException
broadcast resource invalidations to all worker processes of a home and, if specified, to all homes and workers in a cluster. Invalidations will be processed on the home process as well and before distribution to worker processes.

Parameters:
args -
timeout - timeout per worker or -1 for default
Throws:
IOException

start

void start()