org.compass.spring.device.ojb
Class SpringOjbGpsDevice

java.lang.Object
  extended by org.compass.gps.device.AbstractGpsDevice
      extended by org.compass.gps.device.ojb.OjbGpsDevice
          extended by org.compass.spring.device.ojb.SpringOjbGpsDevice
All Implemented Interfaces:
CompassGpsDevice, MirrorDataChangesGpsDevice, PassiveMirrorGpsDevice

public class SpringOjbGpsDevice
extends OjbGpsDevice

An extension of the OjbGpsDevice that utilizes Spring ojb features. Uses Spring PersistenceBrokerTemplate and OjbFactoryUtils to get the current PersistenceBroker for batch indexing (the index() operation).

You can provide the PersistenceBrokerTemplate, though it is not required since it is created the same way the PersistenceBrokerDaoSupport does.

Can be used with SpringOjbGpsDeviceInterceptor to provide real-time data mirroring without the need to write any code.

Author:
kimchy

Field Summary
 
Fields inherited from class org.compass.gps.device.ojb.OjbGpsDevice
log
 
Fields inherited from class org.compass.gps.device.AbstractGpsDevice
compassGps
 
Constructor Summary
SpringOjbGpsDevice()
           
 
Method Summary
protected  org.springframework.orm.ojb.PersistenceBrokerTemplate createPersistenceBrokerTemplate()
           
protected  org.apache.ojb.broker.PersistenceBroker doGetIndexPersistentBroker()
          Uses Spring PersistenceBrokerTemplate and OjbFactoryUtils to get OJB PersistenceBroker
 org.springframework.orm.ojb.PersistenceBrokerTemplate getPersistenceBrokerTemplate()
          Returns the Spring's PersistenceBrokerTemplate.
 void setPersistenceBrokerTemplate(org.springframework.orm.ojb.PersistenceBrokerTemplate persistenceBrokerTemplate)
          Sets Spring's PersistenceBrokerTemplate to be used to fetch OJB PersistenceBroker for batch indexing (the index() operation).
 
Methods inherited from class org.compass.gps.device.ojb.OjbGpsDevice
attachLifecycleListeners, doIndex, doStart, doStop, getIndexPersistenceBroker, isMirrorDataChanges, removeLifecycleListeners, setIndexPersistenceBroker, setMirrorDataChanges
 
Methods inherited from class org.compass.gps.device.AbstractGpsDevice
buildMessage, getGps, getName, index, injectGps, isFilteredForIndex, isPerformingIndexOperation, isRunning, setFilteredEntitiesForIndex, setName, shouldMirrorDataChanges, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.compass.gps.CompassGpsDevice
getGps, getName, index, injectGps, isPerformingIndexOperation, isRunning, setName, shouldMirrorDataChanges, start, stop
 

Constructor Detail

SpringOjbGpsDevice

public SpringOjbGpsDevice()
Method Detail

createPersistenceBrokerTemplate

protected org.springframework.orm.ojb.PersistenceBrokerTemplate createPersistenceBrokerTemplate()

doGetIndexPersistentBroker

protected org.apache.ojb.broker.PersistenceBroker doGetIndexPersistentBroker()
                                                                      throws CompassGpsException
Uses Spring PersistenceBrokerTemplate and OjbFactoryUtils to get OJB PersistenceBroker

Overrides:
doGetIndexPersistentBroker in class OjbGpsDevice
Throws:
CompassGpsException

getPersistenceBrokerTemplate

public org.springframework.orm.ojb.PersistenceBrokerTemplate getPersistenceBrokerTemplate()
Returns the Spring's PersistenceBrokerTemplate.


setPersistenceBrokerTemplate

public void setPersistenceBrokerTemplate(org.springframework.orm.ojb.PersistenceBrokerTemplate persistenceBrokerTemplate)
Sets Spring's PersistenceBrokerTemplate to be used to fetch OJB PersistenceBroker for batch indexing (the index() operation).

This is an optional parameter, since the PersistenceBrokerTemplate can be automatically created.

Parameters:
persistenceBrokerTemplate -


Copyright (c) 2004-2008 The Compass Project.