public class FOStorePMF
extends org.apache.jdo.impl.pm.PersistenceManagerFactoryImpl
implements java.io.Externalizable, javax.naming.Referenceable
This class is public so that clients can create instances of it
with new.
| Modifier and Type | Field and Description |
|---|---|
protected static java.util.HashMap |
fostorePropsAccessors
Properties accessors hash map for fostore-specific properties.
|
protected static java.util.HashMap |
hashMapByFilteredProperties
A HashMap that associates PersistenceManagerFactory instances with a
Properties instance.
|
| Constructor and Description |
|---|
FOStorePMF() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close this PersistenceManagerFactory.
|
boolean |
close(boolean force)
Closes the database unless there are any active store managers.
|
protected javax.jdo.PersistenceManager |
createPersistenceManager(java.lang.String userid,
java.lang.String password)
Create a new instance of PersistenceManager with
the specific user name and password.
|
protected java.lang.String |
decrypt(java.lang.String s)
Uses rot13 algorithm.
|
protected java.lang.String |
encrypt(java.lang.String s)
Uses rot13 algorithm.
|
protected void |
getCFFromProperties(java.util.Properties p) |
boolean |
getConnectionCreate() |
java.lang.Object |
getConnectionFactory()
Override PersistenceManagerFactoryImpl's method so that we can get a
handle on the connection factory to close the database at close() time.
|
org.apache.jdo.jdoql.JDOQLQueryFactory |
getJDOQLQueryFactory()
Returns the JDOQLQueryFactory bound to this FOStorePMF.
|
protected java.util.HashMap |
getLocalAccessors()
Return the FOStore-specific accessors (the
properties that are not in the JDO specification).
|
org.apache.jdo.impl.fostore.FOStoreModel |
getModel()
Returns metadata associated with this PersistenceManagerFactory.
|
java.lang.Class |
getObjectIdClass(java.lang.Class cls)
If parameter is non-null and implements PersistenceCapable, returns
OID.class.
|
protected java.lang.String[] |
getOptionArray() |
static org.apache.jdo.impl.pm.PersistenceManagerFactoryImpl |
getPersistenceManagerFactory(java.util.Map props)
This is a hack until a proper implementation of the method
can be done.
|
static org.apache.jdo.impl.pm.PersistenceManagerFactoryImpl |
getPersistenceManagerFactory(java.util.Properties props)
Construct a PersistenceManagerFactory instance from the given Properties.
|
javax.naming.Reference |
getReference()
Uses StringRefAddr's to store the information
|
org.apache.jdo.store.StoreManager |
getStoreManager(javax.jdo.PersistenceManager pm) |
java.lang.Class |
getTrackedClass(java.lang.Class type) |
org.apache.jdo.store.TranscriberFactory |
getTranscriberFactory() |
static void |
initPropsAccessors()
Initialize fostorePropsAccessors.
|
protected boolean |
isConnectionFactoryConfigured()
Verifies that the associated connection factory
is configured (at least the URL is specified).
|
org.apache.jdo.jdoql.tree.QueryTree |
newQueryTree()
Returns a new QueryTree instance.
|
void |
readExternal(java.io.ObjectInput in)
Reads this PMF's state from the given object input.
|
void |
releaseStoreManager(javax.jdo.PersistenceManager pm) |
protected void |
setCFProperties(java.util.Properties p) |
void |
setConnectionCreate(boolean create) |
void |
setConnectionCreate(java.lang.String create) |
void |
setConnectionFactory(java.lang.Object cf)
Override PersistenceManagerFactoryImpl's method so we can use our
own cf variable.
|
void |
setJDOQLQueryFactoryClassName(java.lang.String jdoqlQueryFactoryClassName)
Sets the JDOQLQueryFactory class name used by getJDOQLQueryFactory.
|
protected void |
setPMFClassProperty(java.util.Properties props)
Set the PMF class property for this PMF.
|
protected void |
shutdown()
Method called by the shudown hook to close pmf instances left open
when the JVM exits.
|
java.lang.String |
toString() |
void |
writeExternal(java.io.ObjectOutput out)
Writes this PMF's state to the given object output.
|
addInstanceLifecycleListener, assertNotClosed, closeOpenPersistenceManagers, deregisterPersistenceManager, doReadObject, doWriteObject, equals, filterProperties, getActivePersistenceManagers, getAsProperties, getAsPropertiesInternal, getConnectionDriverName, getConnectionFactory2, getConnectionFactory2Name, getConnectionFactoryName, getConnectionPassword, getConnectionURL, getConnectionUserName, getDataStoreCache, getDetachAllOnCommit, getIgnoreCache, getMapping, getMaxPool, getMinPool, getMsWait, getMultithreaded, getNontransactionalRead, getNontransactionalWrite, getOptimistic, getPersistenceManager, getPersistenceManager, getProperties, getQueryTimeout, getRestoreValues, getRetainValues, getUpdateTimeout, hashCode, isClosed, registerPersistenceManager, releasePersistenceManager, removeInstanceLifecycleListener, setConfigured, setConnectionDriverName, setConnectionFactory2, setConnectionFactory2Name, setConnectionFactoryName, setConnectionPassword, setConnectionURL, setConnectionUserName, setDetachAllOnCommit, setFromProperties, setIgnoreCache, setMapping, setMaxPool, setMinPool, setMsWait, setMultithreaded, setNonconfigured, setNontransactionalRead, setNontransactionalWrite, setOptimistic, setQueryTimeout, setRestoreValues, setRetainValues, setUpdateTimeout, supportedOptions, toInt, verifyConfigurationprotected static java.util.HashMap fostorePropsAccessors
protected static java.util.HashMap hashMapByFilteredProperties
public static void initPropsAccessors()
public void setJDOQLQueryFactoryClassName(java.lang.String jdoqlQueryFactoryClassName)
jdoqlQueryFactoryClassName - the name of the JDOQLQueryFactory
class.public org.apache.jdo.jdoql.JDOQLQueryFactory getJDOQLQueryFactory()
public org.apache.jdo.jdoql.tree.QueryTree newQueryTree()
QueryTree and
ExpressionFactory) rather than as JDOQL
strings. To run you create a query object from the QueryTree (see
PersistenceManager.newQuery(Object compiled))
and call the execute method on the Query object.protected java.util.HashMap getLocalAccessors()
getLocalAccessors in class org.apache.jdo.impl.pm.PersistenceManagerFactoryImplprotected javax.jdo.PersistenceManager createPersistenceManager(java.lang.String userid,
java.lang.String password)
createPersistenceManager in class org.apache.jdo.impl.pm.PersistenceManagerFactoryImpluserid - the user namepassword - the passwordPersistenceManagerFactoryImpl.createPersistenceManager(String userid, String password)public void close()
If the authorization check succeeds, check to see that all PersistenceManager instances obtained from this PersistenceManagerFactory have no active transactions. If any PersistenceManager instances have an active transaction, throw a JDOUserException, with one nested JDOUserException for each PersistenceManager with an active Transaction.
If there are no active transactions, then close all PersistenceManager instances obtained from this PersistenceManagerFactory, mark this PersistenceManagerFactory as closed, disallow getPersistenceManager methods, and allow all other get methods. If a set method or getPersistenceManager method is called after close, then JDOUserException is thrown.
close in interface javax.jdo.PersistenceManagerFactoryclose in class org.apache.jdo.impl.pm.PersistenceManagerFactoryImplpublic boolean close(boolean force)
force - If true, forces the database to close anyway, regardless of
whether or not any store managers are still active.PersistenceManagerFactory.getPersistenceManager()public void setConnectionFactory(java.lang.Object cf)
setConnectionFactory in interface javax.jdo.PersistenceManagerFactorysetConnectionFactory in class org.apache.jdo.impl.pm.PersistenceManagerFactoryImplcf - the connection factorypublic java.lang.Object getConnectionFactory()
getConnectionFactory in interface javax.jdo.PersistenceManagerFactorygetConnectionFactory in class org.apache.jdo.impl.pm.PersistenceManagerFactoryImplPersistenceManagerFactoryImpl.getConnectionFactory()protected boolean isConnectionFactoryConfigured()
isConnectionFactoryConfigured in class org.apache.jdo.impl.pm.PersistenceManagerFactoryImplpublic org.apache.jdo.store.TranscriberFactory getTranscriberFactory()
getTranscriberFactory in interface org.apache.jdo.pm.PersistenceManagerFactoryInternalPersistenceManagerFactoryInternal.getTranscriberFactory()public java.lang.Class getObjectIdClass(java.lang.Class cls)
getObjectIdClass in interface org.apache.jdo.pm.PersistenceManagerFactoryInternalPersistenceManagerFactoryInternal.getObjectIdClass(
Class cls)public org.apache.jdo.store.StoreManager getStoreManager(javax.jdo.PersistenceManager pm)
getStoreManager in interface org.apache.jdo.pm.PersistenceManagerFactoryInternalPersistenceManagerFactoryInternal.getStoreManager(
PersistenceManager pm)public void releaseStoreManager(javax.jdo.PersistenceManager pm)
releaseStoreManager in interface org.apache.jdo.pm.PersistenceManagerFactoryInternalPersistenceManagerFactoryInternal.releaseStoreManager(
PersistenceManager pm)public java.lang.Class getTrackedClass(java.lang.Class type)
getTrackedClass in interface org.apache.jdo.pm.PersistenceManagerFactoryInternalPersistenceManagerFactoryInternal.getTrackedClass(
Class type)public org.apache.jdo.impl.fostore.FOStoreModel getModel()
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizableout - ObjectOutput to which this PMF's state is written.java.io.IOExceptionpublic void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablein - ObjectInput from which this PMF's state is read.java.io.IOExceptionjava.lang.ClassNotFoundExceptionprotected java.lang.String encrypt(java.lang.String s)
encrypt in class org.apache.jdo.impl.pm.PersistenceManagerFactoryImplPersistenceManagerFactoryImpl.encrypt(java.lang.String)protected java.lang.String decrypt(java.lang.String s)
decrypt in class org.apache.jdo.impl.pm.PersistenceManagerFactoryImplPersistenceManagerFactoryImpl.decrypt(java.lang.String)public void setConnectionCreate(boolean create)
create - specifies whether to create the databasepublic void setConnectionCreate(java.lang.String create)
create - tells whether to create the databasepublic boolean getConnectionCreate()
protected void setCFProperties(java.util.Properties p)
setCFProperties in class org.apache.jdo.impl.pm.PersistenceManagerFactoryImplPersistenceManagerFactoryImpl.setCFProperties(java.util.Properties)protected void getCFFromProperties(java.util.Properties p)
getCFFromProperties in class org.apache.jdo.impl.pm.PersistenceManagerFactoryImplPersistenceManagerFactoryImpl.getCFFromProperties(java.util.Properties)public javax.naming.Reference getReference()
throws javax.naming.NamingException
getReference in interface javax.naming.Referenceablejavax.naming.NamingExceptionpublic java.lang.String toString()
toString in class org.apache.jdo.impl.pm.PersistenceManagerFactoryImplprotected java.lang.String[] getOptionArray()
getOptionArray in class org.apache.jdo.impl.pm.PersistenceManagerFactoryImplPersistenceManagerFactoryImpl.getOptionArray()public static org.apache.jdo.impl.pm.PersistenceManagerFactoryImpl getPersistenceManagerFactory(java.util.Map props)
public static org.apache.jdo.impl.pm.PersistenceManagerFactoryImpl getPersistenceManagerFactory(java.util.Properties props)
This method attempts to find an existing PersistenceManagerFactory with the properties as specified in the parameter. Only the non-default properties are considered when trying to find a match.
This method cannot be implemented by the superclass because it doesn't have any information about the implementation.
protected void setPMFClassProperty(java.util.Properties props)
setPMFClassProperty in class org.apache.jdo.impl.pm.PersistenceManagerFactoryImplprotected void shutdown()
shutdown in class org.apache.jdo.impl.pm.PersistenceManagerFactoryImplCopyright © 2005-2012 Apache Software Foundation. All Rights Reserved.