|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jdo.impl.pm.PersistenceManagerFactoryImpl
org.apache.jdo.impl.fostore.FOStorePMF
The File/Object Store's implementation of a PersistenceManagerFactory.
This class is public
so that clients can create instances of it
with new
.
Nested Class Summary |
Nested classes inherited from class org.apache.jdo.impl.pm.PersistenceManagerFactoryImpl |
PersistenceManagerFactoryImpl.PMFAccessor |
Field Summary | |
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. |
Fields inherited from class org.apache.jdo.impl.pm.PersistenceManagerFactoryImpl |
closed, closeLock, password, pmfAccessors, pmSet, propsAccessors |
Constructor Summary | |
FOStorePMF()
|
Method Summary | |
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)
Create a ConnectionFactory for this PMF. |
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. |
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()
Returns an array of Strings indicating which options are supported by this PersistenceManagerFactory. |
static PersistenceManagerFactoryImpl |
getPersistenceManagerFactory(java.util.Properties props)
Construct a Properties instance from the given Properties. |
javax.naming.Reference |
getReference()
Uses StringRefAddr's to store the information |
StoreManager |
getStoreManager(javax.jdo.PersistenceManager pm)
Provides a StoreManager that is ready to accept operations on it such as insert, etc. |
java.lang.Class |
getTrackedClass(java.lang.Class type)
Returns store-specific mapping between Java classes and tracked SCO classes supported by this PMF. |
TranscriberFactory |
getTranscriberFactory()
Provides the factory which can make Transcribers for this PMF. |
static void |
initPropsAccessors()
Initialize fostorePropsAccessors. |
protected boolean |
isConnectionFactoryConfigured()
Verifies that the associated connection factory is configured (at least the URL is specified). |
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)
Allows the PMF to release any resources associated with the given PM's store manager. |
protected void |
setCFProperties(java.util.Properties p)
Set the PMF-specific ConnectionFactory's properties. |
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()
The String representation of this PMF. |
void |
writeExternal(java.io.ObjectOutput out)
Writes this PMF's state to the given object output. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static java.util.HashMap fostorePropsAccessors
protected static java.util.HashMap hashMapByFilteredProperties
Constructor Detail |
public FOStorePMF()
Method Detail |
public static void initPropsAccessors()
public void setJDOQLQueryFactoryClassName(java.lang.String jdoqlQueryFactoryClassName)
jdoqlQueryFactoryClassName
- the name of the JDOQLQueryFactory
class.public JDOQLQueryFactory getJDOQLQueryFactory()
public 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 PersistenceManagerFactoryImpl
protected javax.jdo.PersistenceManager createPersistenceManager(java.lang.String userid, java.lang.String password)
createPersistenceManager
in class PersistenceManagerFactoryImpl
userid
- the user namepassword
- the password
PersistenceManagerFactoryImpl.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.PersistenceManagerFactory
close
in class PersistenceManagerFactoryImpl
public 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.PersistenceManagerFactory
setConnectionFactory
in class PersistenceManagerFactoryImpl
cf
- the connection factorypublic java.lang.Object getConnectionFactory()
getConnectionFactory
in interface javax.jdo.PersistenceManagerFactory
getConnectionFactory
in class PersistenceManagerFactoryImpl
PersistenceManagerFactoryImpl.getConnectionFactory()
protected boolean isConnectionFactoryConfigured()
isConnectionFactoryConfigured
in class PersistenceManagerFactoryImpl
public TranscriberFactory getTranscriberFactory()
PersistenceManagerFactoryInternal
getTranscriberFactory
in interface PersistenceManagerFactoryInternal
PersistenceManagerFactoryInternal.getTranscriberFactory()
public java.lang.Class getObjectIdClass(java.lang.Class cls)
getObjectIdClass
in interface PersistenceManagerFactoryInternal
cls
- the PersistenceCapable Class
PersistenceManagerFactoryInternal.getObjectIdClass(
Class cls)
public StoreManager getStoreManager(javax.jdo.PersistenceManager pm)
PersistenceManagerFactoryInternal
getStoreManager
in interface PersistenceManagerFactoryInternal
pm
- PersistenceManager that is requesting a StoreManager.PersistenceManagerFactoryInternal.getStoreManager(
PersistenceManager pm)
public void releaseStoreManager(javax.jdo.PersistenceManager pm)
PersistenceManagerFactoryInternal
releaseStoreManager
in interface PersistenceManagerFactoryInternal
pm
- PersistenceManager that is releasing a StoreManager.PersistenceManagerFactoryInternal.releaseStoreManager(
PersistenceManager pm)
public java.lang.Class getTrackedClass(java.lang.Class type)
PersistenceManagerFactoryInternal
getTrackedClass
in interface PersistenceManagerFactoryInternal
type
- Class to find mapping for.
PersistenceManagerFactoryInternal.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.Externalizable
out
- ObjectOutput to which this PMF's state is written.
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
in
- ObjectInput from which this PMF's state is read.
java.io.IOException
java.lang.ClassNotFoundException
protected java.lang.String encrypt(java.lang.String s)
encrypt
in class PersistenceManagerFactoryImpl
s
- the String to be encrypted
PersistenceManagerFactoryImpl.encrypt(java.lang.String)
protected java.lang.String decrypt(java.lang.String s)
decrypt
in class PersistenceManagerFactoryImpl
s
- the String to be decrypted
PersistenceManagerFactoryImpl.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)
PersistenceManagerFactoryImpl
setCFProperties
in class PersistenceManagerFactoryImpl
p
- Properties object in which the PMF's ConnectioFactory's
properties are to be set.PersistenceManagerFactoryImpl.setCFProperties(java.util.Properties)
protected void getCFFromProperties(java.util.Properties p)
PersistenceManagerFactoryImpl
getCFFromProperties
in class PersistenceManagerFactoryImpl
p
- Properties from which the ConnectionFactory is to be created.PersistenceManagerFactoryImpl.getCFFromProperties(java.util.Properties)
public javax.naming.Reference getReference() throws javax.naming.NamingException
getReference
in interface javax.naming.Referenceable
javax.naming.NamingException
public java.lang.String toString()
PersistenceManagerFactoryImpl
toString
in class PersistenceManagerFactoryImpl
protected java.lang.String[] getOptionArray()
PersistenceManagerFactoryImpl
getOptionArray
in class PersistenceManagerFactoryImpl
PersistenceManagerFactoryImpl.getOptionArray()
public static 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
protected void setPMFClassProperty(java.util.Properties props)
setPMFClassProperty
in class PersistenceManagerFactoryImpl
props
- the Properties to which to add the PMF class propertyprotected void shutdown()
shutdown
in class PersistenceManagerFactoryImpl
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |