> What interface should I implement?
The interface for L2 cache is org.apache.openjpa.datacache.DataCache.

> How can I tell openjpa to use my implementation?
In META-INF/persistence.xml
<property name="openjpa.DataCache" value="acme.org.MyL2DataCache"/>

> Which class has an implementation of that interface so I can use that as
> an example?
The basic abstract implementation is available in
org.apache.openjpa.datacache.AbstractDataCache.

> Is this plugin managed by openjpa? By that I mean - I am guarranted that
> the plugin will be called at the appropriate time by openjpa and therefore
> all I would need to worry about is making the call to the cache?

Yes.

Access to OpenJPA internal information is available through
org.apache.openjpa.conf.OpenJPAConfiguration instance. When your
implementation implements org.apache.openjpa.lib.conf.Configurable (which
AbstractDataCache does) -- you have access to OpenJPAConfiguration in right
points of initialization life-cyle. Once you have access to configuration,
you can navigate to  OpenJPAConfiguration.getMetaDataRepositoryInstance()
which will tell whatever you want to know of the class level
meta-information.


-- 
View this message in context: 
http://www.nabble.com/How-to-set-a-tangosol-cache-per-entity--tp16336199p16361757.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to