SlideShare a Scribd company logo
Creating Custom Object
Store
- By Rahul Kumar
Custom Object Store
An object store is a facility for storing objects in Mule. Mule uses object stores
whenever it needs data to persist for later retrieval. Internally, Mule uses object
stores in various filters, routers, and other message processors that need to
store their state between messages. In most cases, Mule creates and manages
object stores automatically, so no user configuration is necessary.
Creating Custom Object
Store
Create your own object Store by:
Implementing org.mule.api.store.ObjectStore interface
Overriding the standard implementations of Object Stores like
org.mule.api.store.ListableObjectStore, org.mule.api.store.PartitionableObjectStore
org.mule.api.store.PartitionableExpirableObjectStore and many more
Snippet for Custom
Object Store
package org.rahul.objectstore;
import java.io.Serializable;
import java.util.Hashtable;
import org.mule.api.store.ObjectStore;
import org.mule.api.store.ObjectStoreException;
public class MyObjectStore implements ObjectStore {
private static Hashtable<String,String> myStore= new Hashtable<String,String>();
public static Hashtable<String, String> getMyStore() {
return myStore;
}
public static void setMyStore(Hashtable<String, String> myStore) {
MyObjectStore.myStore = myStore;
}
Snippet for Custom
Object Store
@Override
public boolean contains(Serializable key) throws ObjectStoreException {
return getMyStore().containsKey(key);
}
@Override
public void store(Serializable key, Serializable value)
throws ObjectStoreException {
getMyStore().put(key.toString(), value.toString());
}
@Override
public Serializable retrieve(Serializable key) throws ObjectStoreException {
return getMyStore().get(key);
}
Snippet for Custom
Object Store
@Override
public Serializable remove(Serializable key) throws ObjectStoreException {
return getMyStore().remove(key);
}
@Override
public boolean isPersistent() {
return false;
}
@Override
public void clear() throws ObjectStoreException {
getMyStore().clear();
}
}
Snippet for Custom
Object Store
The above provided snippet can be used to create a custom Onject store.
This object store is storing objects inside a HashTable
Configuration
Provide this object store in the components which requires object stores like
idempotent filter, Until Successful scope etc.
Thank You

More Related Content

PPTX
Mule object store
PPTX
Object store
PPTX
Creating global functions
PPTX
Mule object stores
PPT
Object Store in Mule
PPTX
Object store
PPTX
Object store
ODP
Idempotent filter
Mule object store
Object store
Creating global functions
Mule object stores
Object Store in Mule
Object store
Object store
Idempotent filter

Similar to Creating custom object store (20)

PPT
Hibernate Session 1
DOC
EMF Tips n Tricks
PPT
Distributed Locking in Mule
DOCX
02 java spring-hibernate-experience-questions
DOC
Advanced Hibernate Notes
PPTX
Google cloud datastore driver for Google Apps Script DB abstraction
PPS
Patterns in Eclipse
DOC
( 12 ) Office 2007 Features Custom List
PPT
Caching for J2ee Enterprise Applications
PDF
CoreData
DOC
Qtp stuff
DOC
Qtp basic stuff
PPTX
QTP Automation Testing Tutorial 5
PDF
Nuxeo - OpenSocial
KEY
PPTX
Odoo (Build module, Security, ORM)
PDF
UiPath Studio Web workshop series - Day 7
PDF
SAP Testing Training
PDF
QTP Faqs
PPTX
Java Components and their applicability in Mule Anypoint Studio
Hibernate Session 1
EMF Tips n Tricks
Distributed Locking in Mule
02 java spring-hibernate-experience-questions
Advanced Hibernate Notes
Google cloud datastore driver for Google Apps Script DB abstraction
Patterns in Eclipse
( 12 ) Office 2007 Features Custom List
Caching for J2ee Enterprise Applications
CoreData
Qtp stuff
Qtp basic stuff
QTP Automation Testing Tutorial 5
Nuxeo - OpenSocial
Odoo (Build module, Security, ORM)
UiPath Studio Web workshop series - Day 7
SAP Testing Training
QTP Faqs
Java Components and their applicability in Mule Anypoint Studio
Ad

More from Rahul Kumar (20)

PPTX
Combine collections transformer
PPTX
Using parse template component
PPTX
Using groovy component
PPTX
Using expression component
PPTX
Creating custom transformer
PPTX
Creating custom aggregation strategy
PPTX
Creating custom aggregator
PPTX
Byte array to hex string transformer
PPTX
Creating custom filter
PPTX
Hex string to byte array transformer
PPTX
XML to DOM Transformer
PPTX
Dom to xml transformer
PPTX
Object to input stream transformer
PPTX
Byte array to object transformer
PPTX
Byte array to string transformer
PPTX
Object to string transformer
PPTX
Csv to json transform in simple steps
PPTX
Using scatter gather
PPTX
Choice router
PPTX
Using idempotent filter
Combine collections transformer
Using parse template component
Using groovy component
Using expression component
Creating custom transformer
Creating custom aggregation strategy
Creating custom aggregator
Byte array to hex string transformer
Creating custom filter
Hex string to byte array transformer
XML to DOM Transformer
Dom to xml transformer
Object to input stream transformer
Byte array to object transformer
Byte array to string transformer
Object to string transformer
Csv to json transform in simple steps
Using scatter gather
Choice router
Using idempotent filter
Ad

Recently uploaded (20)

PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
Download FL Studio Crack Latest version 2025 ?
PDF
Designing Intelligence for the Shop Floor.pdf
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PDF
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by AndrĂŠ Kraus
PPTX
Patient Appointment Booking in Odoo with online payment
DOCX
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
PPTX
Why Generative AI is the Future of Content, Code & Creativity?
PDF
Autodesk AutoCAD Crack Free Download 2025
PDF
medical staffing services at VALiNTRY
PPTX
Monitoring Stack: Grafana, Loki & Promtail
PDF
Odoo Companies in India – Driving Business Transformation.pdf
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
Download FL Studio Crack Latest version 2025 ?
Designing Intelligence for the Shop Floor.pdf
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Design an Analysis of Algorithms II-SECS-1021-03
Navsoft: AI-Powered Business Solutions & Custom Software Development
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
Internet Downloader Manager (IDM) Crack 6.42 Build 41
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
T3DD25 TYPO3 Content Blocks - Deep Dive by AndrĂŠ Kraus
Patient Appointment Booking in Odoo with online payment
Greta — No-Code AI for Building Full-Stack Web & Mobile Apps
Why Generative AI is the Future of Content, Code & Creativity?
Autodesk AutoCAD Crack Free Download 2025
medical staffing services at VALiNTRY
Monitoring Stack: Grafana, Loki & Promtail
Odoo Companies in India – Driving Business Transformation.pdf

Creating custom object store

  • 2. Custom Object Store An object store is a facility for storing objects in Mule. Mule uses object stores whenever it needs data to persist for later retrieval. Internally, Mule uses object stores in various filters, routers, and other message processors that need to store their state between messages. In most cases, Mule creates and manages object stores automatically, so no user configuration is necessary.
  • 3. Creating Custom Object Store Create your own object Store by: Implementing org.mule.api.store.ObjectStore interface Overriding the standard implementations of Object Stores like org.mule.api.store.ListableObjectStore, org.mule.api.store.PartitionableObjectStore org.mule.api.store.PartitionableExpirableObjectStore and many more
  • 4. Snippet for Custom Object Store package org.rahul.objectstore; import java.io.Serializable; import java.util.Hashtable; import org.mule.api.store.ObjectStore; import org.mule.api.store.ObjectStoreException; public class MyObjectStore implements ObjectStore { private static Hashtable<String,String> myStore= new Hashtable<String,String>(); public static Hashtable<String, String> getMyStore() { return myStore; } public static void setMyStore(Hashtable<String, String> myStore) { MyObjectStore.myStore = myStore; }
  • 5. Snippet for Custom Object Store @Override public boolean contains(Serializable key) throws ObjectStoreException { return getMyStore().containsKey(key); } @Override public void store(Serializable key, Serializable value) throws ObjectStoreException { getMyStore().put(key.toString(), value.toString()); } @Override public Serializable retrieve(Serializable key) throws ObjectStoreException { return getMyStore().get(key); }
  • 6. Snippet for Custom Object Store @Override public Serializable remove(Serializable key) throws ObjectStoreException { return getMyStore().remove(key); } @Override public boolean isPersistent() { return false; } @Override public void clear() throws ObjectStoreException { getMyStore().clear(); } }
  • 7. Snippet for Custom Object Store The above provided snippet can be used to create a custom Onject store. This object store is storing objects inside a HashTable
  • 8. Configuration Provide this object store in the components which requires object stores like idempotent filter, Until Successful scope etc.