| |
|
| java.lang.Object org.compass.gps.device.AbstractGpsDevice org.compass.gps.device.ojb.OjbGpsDevice
All known Subclasses: org.compass.spring.device.ojb.SpringOjbGpsDevice,
OjbGpsDevice | public class OjbGpsDevice extends AbstractGpsDevice implements PassiveMirrorGpsDevice(Code) | | An ObJectRelationalBridge (OJB) device, provides support for using ojb and
ojb mapping files to index a database. The path can be views as: Database <->
OJB <-> Objects <-> Compass::Gps <-> Compass::Core (Search Engine). What it
means is that for every object that has both ojb and compass mappings, you
will be able to index it's data, as well as real time mirroring of data
changes.
Indexing the data (using the index() operation) requires the
batchPersistentBroker property to be set, before the
index() operation is called.
Real-time mirroring of data changes requires to use the
OjbGpsDevice.attachLifecycleListeners(PersistenceBroker) to let the
device listen for any data changes, and
OjbGpsDevice.removeLifecycleListeners(PersistenceBroker) to remove
the listener. Since the lifecycle listener can only be set on the instance
level, and not the factory level (why would you do that, ojb developers?),
attach and remove must be called every time a PersistentBroker is
instantiated. You can use the
OjbGpsDeviceUtils.attachPersistenceBrokerForIndex(org.compass.gps.CompassGpsDeviceorg.apache.ojb.broker.PersistenceBroker) and
OjbGpsDeviceUtils.removePersistenceBrokerForMirror(org.compass.gps.CompassGpsDeviceorg.apache.ojb.broker.PersistenceBroker) as helper methods if attache to a generic device is required (which must be
the OjbGpsDevice).
Since the real time mirroring and the event listener registration sounds like
an aspect for Ojb aware classes/methods, Compass::Spring utilizes spring
support for OJB and aspects for a much simpler event registration, please see
Compass::Spring for more documentation.
author: kimchy |
Field Summary | |
protected static Log | log |
log | protected static Log log(Code) | | |
OjbGpsDevice | public OjbGpsDevice()(Code) | | |
OjbGpsDevice | public OjbGpsDevice(String name, PersistenceBroker indexPersistenceBroker)(Code) | | |
attachLifecycleListeners | public void attachLifecycleListeners(PersistenceBroker pb)(Code) | | Attached the OjbGpsDevice lifecycle listener to the instance of the
persistence broker.
Parameters: pb - The persistence broker |
doGetIndexPersistentBroker | protected PersistenceBroker doGetIndexPersistentBroker() throws CompassGpsException(Code) | | A method which can be used by derived classes to supply the persistent
broker by a means of a centrelized registry (for example).
|
getIndexPersistenceBroker | public PersistenceBroker getIndexPersistenceBroker()(Code) | | Returns the batch persistence broker used for indexing.
|
isMirrorDataChanges | public boolean isMirrorDataChanges()(Code) | | |
removeLifecycleListeners | public void removeLifecycleListeners(PersistenceBroker pb)(Code) | | Removed the OjbGpsDevice lifecycle listener from the instance of the
persistence broker.
Parameters: pb - The persistence broker |
setIndexPersistenceBroker | public void setIndexPersistenceBroker(PersistenceBroker indexPersistenceBroker)(Code) | | Sets the batch persistence broker used for indexing.
|
setMirrorDataChanges | public void setMirrorDataChanges(boolean mirrorDataChanges)(Code) | | |
|
|
|