GitHub user arturchyzy opened a pull request: https://github.com/apache/camel/pull/375
CAMEL-6698: Component camel-cache to support non-serializable objects Ability to store non-serialiable objects into ehcache cache - i called it objectCache. What i modified: - new configuration param to turn on non-serializable cache - objectCache - validation to not allow to create object cache which will use object serialization (overflowToDisk and diskPersistence) - overflowToDisk is default - storing object into cache without using type converters Things to consider: ```java else if (body instanceof Serializable) { element = new Element(key, body); } else if (config.isObjectCache()) { element = new Element(key, body); } ``` can be optimized to ```java else if (body instanceof Serializable || config.isObjectCache()) { element = new Element(key, body); } ``` as the same contructor using java.lang.Object will be taken as body is of java.lang.Object Usage To use object cache you have to set objectCache param and disable disk cach i.e. ``` cache://TestCache1?objectCache=true&overflowToDisk=false&diskPersistent=false ``` You can merge this pull request into a Git repository by running: $ git pull https://github.com/arturchyzy/camel CAMEL-6698 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/camel/pull/375.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #375 ---- commit 4d6c7d52b79b44198ba16f5e90cf849db81789c0 Author: Artur Chyży <artur.ch...@gmail.com> Date: 2015-01-22T13:43:49Z CAMEL-6698: Component camel-cache to support non-serializable objects ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---