| Namespace | http://www.mulesoft.org/schema/mule/objectstore |
|---|---|
| Schema Location | http://www.mulesoft.org/schema/mule/objectstore/current/mule-objectstore.xsd (View Schema) |
| Schema Version | 1.0 |
| Minimum Mule Version | 3.2 |
Generic module for accessing Object Stores.
Can be used with Mule default implementations or one can be passed via ref. It allows to store, retrieve and remove objects from the store.| Configuration | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Configure an instance of this module
| |||||||||||
| Message Processors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Returns a list of all the keys in the store.
| |||||||||||
Store value using key, and also store key using value.
| |||||||||||
Remove the object with key.
| |||||||||||
Retrieve the given Object.
| |||||||||||
Store object
| |||||||||||
To use the this module within a flow the namespace to the module must be included. The resulting flow will look similar to the following:
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:objectstore="http://www.mulesoft.org/schema/mule/objectstore"
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/core
http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/objectstore
http://www.mulesoft.org/schema/mule/objectstore/current/mule-objectstore.xsd">
<!-- here goes your flows and configuration elements -->
</mule>
This module is configured using the config element. This element must be placed outside of your flows and at the root of your Mule application. You can create as many configurations as you deem necessary as long as each carries its own name.
Each message processor, message source or transformer carries a config-ref attribute that allows the invoker to specify which configuration to use.
| Attributes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Type | Name | Default Value | Description | Optional. Give a name to this configuration so it can be later referenced. | |||||||
| Optional. Reference to an Object Store bean. | |||||||||||
| Optional. Name of the partition in the default in-memory or persistent object stores (this argument has no meaning if the object store is passed by ref using objectStore-ref) | |||||||||||
| false | Optional. Specified whenever the required store needs to be persistent or not (this argument has no meaning if the object store is passed by ref using objectStore-ref) | ||||||||||
Returns a list of all the keys in the store.
IMPORTANT: Not all stores support this method. If the method is not supported a java.lang.UnsupportedOperationException is thrownINCLUDE_ERROR
| Name | Default Value | Description |
|---|---|---|
| Optional. Specify which configuration to use. |
| Payload Class | Description |
|---|---|
| ObjectStoreException |
Store value using key, and also store key using value.
INCLUDE_ERROR
| Name | Default Value | Description |
|---|---|---|
| Optional. Specify which configuration to use. | ||
| The identifier of the object to store | ||
| The object to store. If you want this to be the payload then use value-ref="#[payload]". | ||
| false | Optional. True if you want to overwrite the existing object. |
| Payload Class | Description |
|---|---|
| ObjectStoreException | if the given key cannot be stored or is null. |
| ObjectStoreNotAvaliableException | if the store is not available or any other implementation-specific error occured. |
| ObjectAlreadyExistsException | if an attempt is made to store an object for a key that already has an object associated. Only thrown if overwrite is false. |
Remove the object with key.
INCLUDE_ERROR
| Name | Default Value | Description |
|---|---|---|
| Optional. Specify which configuration to use. | ||
| The identifier of the object to remove. |
| Payload Class | Description |
|---|---|
| ObjectStoreException | if the given key is null or if the store is not
available or any other implementation-specific error occurred |
| ObjectDoesNotExistException | if no value for the given key was previously stored. |
Retrieve the given Object.
INCLUDE_ERROR
| Name | Default Value | Description |
|---|---|---|
| Optional. Specify which configuration to use. | ||
| The identifier of the object to retrieve. | ||
| Optional. The default value if the key does not exists. |
| Payload Class | Description |
|---|---|
| ObjectStoreException | if the given key is null. |
| ObjectStoreNotAvaliableException | if the store is not available or any other implementation-specific error occured. |
| ObjectDoesNotExistException | if no value for the given key was previously stored. |
Store object
INCLUDE_ERROR
| Name | Default Value | Description |
|---|---|---|
| Optional. Specify which configuration to use. | ||
| The identifier of the object to store | ||
| The object to store. If you want this to be the payload then use value-ref="#[payload]". | ||
| false | Optional. True if you want to overwrite the existing object. |
| Payload Class | Description |
|---|---|
| ObjectStoreException | if the given key cannot be stored or is null. |
| ObjectStoreNotAvaliableException | if the store is not available or any other implementation-specific error occured. |
| ObjectAlreadyExistsException | if an attempt is made to store an object for a key that already has an object associated. Only thrown if overwrite is false. |