Class SpaceFactory
java.lang.Object
org.jpos.space.SpaceFactory
Creates a space based on a space URI.
A space URI has three parts:
- scheme
- name
- optional parameter
Examples:
// default unnamed space (tspace:default)
Space sp = SpaceFactory.getSpace ();
// transient space named "test"
Space sp = SpaceFactory.getSpace ("transient:test");
// lspace (Loom-optimized) named "test"
Space sp = SpaceFactory.getSpace ("lspace:test");
// persistent space named "test"
Space sp = SpaceFactory.getSpace ("persistent:test");
// jdbm space named test
Space sp = SpaceFactory.getSpace ("jdbm:test");
// jdbm space named test, storage located in /tmp/test
Space sp = SpaceFactory.getSpace ("jdbm:test:/tmp/test");
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault name used for unnamed spaces.static final StringScheme constant for JDBM-backed spaces.static final StringScheme constant for Berkeley DB (JE) backed spaces.static final StringScheme constant for L-space (Loom-optimized) transient spaces.static final StringScheme constant for persistent (jdbm-backed) spaces.static final StringScheme constant used to look up an externally-registered spacelet.static final StringScheme alias forTSPACE.static final StringScheme constant for transient (in-memory) spaces. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ScheduledThreadPoolExecutorReturns the shared executor used by spaces to run lease-expiry/GC tasks.static SpacegetSpace()Returns the default transient space (equivalent totspace:default).static SpaceResolves a space URI of the formscheme:name[:param].static SpaceResolves the space identified byscheme,name, and optionalparam, registering a newly-created space inNameRegistraron first use.
-
Field Details
-
TSPACE
-
LSPACE
-
TRANSIENT
-
PERSISTENT
Scheme constant for persistent (jdbm-backed) spaces.- See Also:
-
SPACELET
-
JDBM
-
JE
-
DEFAULT
-
-
Constructor Details
-
SpaceFactory
public SpaceFactory()Default constructor; no instance state to initialise.
-
-
Method Details
-
getSpace
-
getSpace
-
getSpace
Resolves the space identified byscheme,name, and optionalparam, registering a newly-created space inNameRegistraron first use.- Parameters:
scheme- space scheme (one of theTSPACE/LSPACE/... constants)name- space nameparam- optional scheme-specific parameter (e.g. file path forjdbm:)- Returns:
- the resolved space
- Throws:
SpaceError- if the scheme is unknown or registration fails
-
getGCExecutor
Returns the shared executor used by spaces to run lease-expiry/GC tasks.- Returns:
- the shared GC executor
-