org.compass.gps.device.jpa.embedded.openjpa
Class CompassProductDerivation
java.lang.Object
org.apache.openjpa.lib.conf.AbstractProductDerivation
org.compass.gps.device.jpa.embedded.openjpa.CompassProductDerivation
- All Implemented Interfaces:
- org.apache.openjpa.lib.conf.ProductDerivation
public class CompassProductDerivation
- extends org.apache.openjpa.lib.conf.AbstractProductDerivation
An OpenJPA Compass product derivation. Simply by adding the Compass jar to the class path this product
derivation will be registered with OpenJPA. This derivation will not add Compass support to OpenJPA if
no Compass setting is set. The single required setting (for example, within the persistence.xml) is
Compass engine connection setting (CompassEnvironment.CONNECTION.
The embedded Open JPA support uses Compass GPS and adds an "embedded" Compass, or adds a searchable
feature to Open JPA by registering a Compass instance and a JpaGpsDevice
instance with OpenJPA. It registers mirroring listeners (after delete/store/persist) to automatically
mirror changes done through OpenJPA to the Compass index. It also registeres transaction listeners
to synchronize between Compass transactions and Open JPA transactions.
Use OpenJPAHelper in order to access the registered
Compass instnace and JpaGpsDevice instance assigned
to the EntityManagerFactory. Also use it to get CompassSession
assigned to an EntityManager.
The Compass instnace used for mirroring can be configured by adding compass prefixed settings.
Additional settings that only control the Compass instnace created for indexing should be set using
gps.index.compass.. For more information on indexing and mirroring Compass please check
SingleCompassGps.
Specific properties that this plugin can use:
- compass.openjpa.reindexOnStartup: Set it to
true in order to perform full reindex of the database on startup.
Defaults to false.
- compass.openjpa.registerRemoteCommitListener: Set it to
true in order to register for remote commits
notifications. Defaults to false.
- compass.openjpa.indexQuery.[entity name/class]: Specific select query that will be used to perform the indexing
for the mentioned specific entity name / class. Note, before calling
CompassGps.index() there
is an option the programmatically control this.
- compass.openjpa.config: A classpath that points to Compass configuration.
- Author:
- kimchy
| Fields inherited from interface org.apache.openjpa.lib.conf.ProductDerivation |
TYPE_FEATURE, TYPE_PRODUCT |
| Methods inherited from class org.apache.openjpa.lib.conf.AbstractProductDerivation |
afterSpecificationSet, getAnchorsInFile, getAnchorsInResource, getConfigurationPrefix, getDefaultResourceLocation, load, load, loadDefaults, loadGlobals, validate |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
COMPASS_USER_OBJECT_KEY
public static final String COMPASS_USER_OBJECT_KEY
COMPASS_SESSION_USER_OBJECT_KEY
public static final String COMPASS_SESSION_USER_OBJECT_KEY
COMPASS_TRANSACTION_USER_OBJECT_KEY
public static final String COMPASS_TRANSACTION_USER_OBJECT_KEY
COMPASS_GPS_USER_OBJECT_KEY
public static final String COMPASS_GPS_USER_OBJECT_KEY
COMPASS_INDEX_SETTINGS_USER_OBJECT_KEY
public static final String COMPASS_INDEX_SETTINGS_USER_OBJECT_KEY
REINDEX_ON_STARTUP
public static final String REINDEX_ON_STARTUP
- See Also:
- Constant Field Values
REGISTER_REMOTE_COMMIT_LISTENER
public static final String REGISTER_REMOTE_COMMIT_LISTENER
- See Also:
- Constant Field Values
INDEX_QUERY_PREFIX
public static final String INDEX_QUERY_PREFIX
- See Also:
- Constant Field Values
COMPASS_CONFIG_LOCATION
public static final String COMPASS_CONFIG_LOCATION
- See Also:
- Constant Field Values
CompassProductDerivation
public CompassProductDerivation()
getType
public int getType()
beforeConfigurationLoad
public boolean beforeConfigurationLoad(org.apache.openjpa.lib.conf.Configuration config)
- Specified by:
beforeConfigurationLoad in interface org.apache.openjpa.lib.conf.ProductDerivation- Overrides:
beforeConfigurationLoad in class org.apache.openjpa.lib.conf.AbstractProductDerivation
installCompass
public static void installCompass(org.apache.openjpa.kernel.BrokerFactory factory)
- Deprecated. This is only needed for pre-1.0 versions of OpenJPA.
beforeConfigurationConstruct
public boolean beforeConfigurationConstruct(org.apache.openjpa.lib.conf.ConfigurationProvider cp)
- Specified by:
beforeConfigurationConstruct in interface org.apache.openjpa.lib.conf.ProductDerivation- Overrides:
beforeConfigurationConstruct in class org.apache.openjpa.lib.conf.AbstractProductDerivation
registerListeners
protected void registerListeners(org.apache.openjpa.kernel.BrokerFactory brokerFactory)
beforeConfigurationClose
public void beforeConfigurationClose(org.apache.openjpa.lib.conf.Configuration configuration)
- Specified by:
beforeConfigurationClose in interface org.apache.openjpa.lib.conf.ProductDerivation- Overrides:
beforeConfigurationClose in class org.apache.openjpa.lib.conf.AbstractProductDerivation
isReleasedVersion
public static boolean isReleasedVersion()
Copyright (c) 2004-2008 The Compass Project.