|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Represents a factory of Space instances
| Field Summary | |
static int |
DISPATCH_ALL_CONSUMERS
The dispatch mode where each consumer of the space will get its own copy of each object (assuming it matches whatever filters the consumer may be using). |
static int |
DISPATCH_ONE_CONSUMER
The dispatch mode when only one consumer of the space will see each object. |
static int |
DISPATCH_ONE_CONSUMER_EXCLUSIVE
The dispatch mode which is like DISPATCH_ONE_CONSUMER mode except
that to ensure total ordering across objects put into the space across multiple
consumers in different threads and/or processes we use a sticky-load balancing
stategy where one consumer is chosen per space to process all the objects in order
(assuming it matches the filter) and then if that consumer fails, another one is chosen. |
| Method Summary | |
Space |
createSpace(String destination,
int dispatchMode,
String filter)
Creates a new Space. |
| Field Detail |
public static final int DISPATCH_ONE_CONSUMER
public static final int DISPATCH_ALL_CONSUMERS
public static final int DISPATCH_ONE_CONSUMER_EXCLUSIVE
DISPATCH_ONE_CONSUMER mode except
that to ensure total ordering across objects put into the space across multiple
consumers in different threads and/or processes we use a sticky-load balancing
stategy where one consumer is chosen per space to process all the objects in order
(assuming it matches the filter) and then if that consumer fails, another one is chosen.
Even though spaces using DISPATCH_ONE_CONSUMER will preserve order of objects
put into the space, sometimes in a multi-threaded / multi-process environment one consumer
may actually process an object ahead of the other (e.g. commit on a database first,
schedulers can context switch and so forth).
So this mode of dispatch ensures that only 1 consumer is processing the space at any point
in time to ensure total ordering.
In messaging / MOM worlds this is sometimes referred to as exclusive queue or sticky queue semantics
| Method Detail |
public Space createSpace(String destination,
int dispatchMode,
String filter)
throws SpaceException
destination - the logical destination; this allows you to keep spaces separate
or to build them into hierarchiesdispatchMode - specifies the dispatch mode of the space, whether only once consumer of
the space will get each object, DISPATCH_ONE_CONSUMER,
or whether all consumers of the space will get their own copy of the object,
DISPATCH_ALL_CONSUMERS or whether only one consumer will get each object
and strict ordering is used, DISPATCH_ONE_CONSUMER_EXCLUSIVE
i.e. only one consumer is used until it is decided that
the consumer has failed and then another consumer is chosen so that strict ordering
is maintained across both multi-threaded & multi-process scenarios).filter - an SQL 92 query string to filter the space or null if no filter is required
SpaceException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||