|
||||||||||
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 |
org.apache.jdo.impl.pm.PersistenceManagerFactoryImpl.PMFAccessor |
Field Summary | |
(package private) static java.lang.String |
addrType
JNDI property type |
private FOStoreConnectionFactory |
cf
|
private java.util.Properties |
configuredFrom
The Properties instance from which this PersistenceManagerFactory was configured. |
private boolean |
create
Flag to tell whether to create. |
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. |
private static org.apache.jdo.impl.model.java.runtime.RuntimeJavaModelFactory |
javaModelFactory
RuntimeJavaModelFactory. |
private org.apache.jdo.jdoql.JDOQLQueryFactory |
jdoqlQueryFactory
The query factory for JDOQL. |
private java.lang.String |
jdoqlQueryFactoryClassName
The name of the JDOQLQueryFactory class |
(package private) static org.apache.commons.logging.Log |
logger
Logger |
private FOStoreModel |
model
Model associated with this PMF. |
private static org.apache.jdo.util.I18NHelper |
msg
I18N support. |
private java.lang.String[] |
optionArray
Supported list of options for this implementation. |
private java.util.WeakHashMap |
provisionalOIDs
Map provisional id's that were created on behalf of this PMF to the real id's that have been returned by various StoreManager instances that are bound to this PMF. |
private java.util.HashMap |
storeManagers
StoreManagers provided by this PMF, one per-PM. |
private static java.util.HashMap |
trackedClasses
Mapping of supported java.util classes to the tracked SCO classes in org.apache.jdo.impl.sco package |
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. |
(package private) static java.lang.String |
doDecrypt(java.lang.String s)
Use same encryption for others in this package (e.g. |
(package private) static java.lang.String |
doEncrypt(java.lang.String s)
Use same encryption for others in this package (e.g. |
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). |
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. |
(package private) OID |
getRealOIDFromProvisional(OID pOID)
Provides the real OID for the given provisional OID. |
javax.naming.Reference |
getReference()
Uses StringRefAddr's to store the information |
(package private) RequestFactory |
getRequestFactory()
Provides the request factory. |
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. |
private void |
initTrackedClasses()
Initialize trackedClasses. |
protected boolean |
isConnectionFactoryConfigured()
Verifies that the associated connection factory is configured (at least the URL is specified). |
(package private) void |
mapProvisionalOIDToReal(OID pOID,
OID rOID)
Sets up a mapping from the given provisional OID to real OID. |
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)
|
private static java.lang.String |
rot13(java.lang.String s)
|
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. |
Methods inherited from class org.apache.jdo.impl.pm.PersistenceManagerFactoryImpl |
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, verifyConfiguration |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
private final transient java.util.HashMap storeManagers
private final transient java.util.WeakHashMap provisionalOIDs
private transient FOStoreConnectionFactory cf
private final transient FOStoreModel model
private boolean create
private java.util.Properties configuredFrom
private java.lang.String jdoqlQueryFactoryClassName
private org.apache.jdo.jdoql.JDOQLQueryFactory jdoqlQueryFactory
private static final org.apache.jdo.impl.model.java.runtime.RuntimeJavaModelFactory javaModelFactory
private static final org.apache.jdo.util.I18NHelper msg
static final org.apache.commons.logging.Log logger
static final java.lang.String addrType
private final java.lang.String[] optionArray
protected static java.util.HashMap fostorePropsAccessors
private static java.util.HashMap trackedClasses
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 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()
private void initTrackedClasses()
protected javax.jdo.PersistenceManager createPersistenceManager(java.lang.String userid, java.lang.String password)
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
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
cf
- the connection factorypublic java.lang.Object getConnectionFactory()
getConnectionFactory
in interface javax.jdo.PersistenceManagerFactory
PersistenceManagerFactoryImpl.getConnectionFactory()
protected boolean isConnectionFactoryConfigured()
public org.apache.jdo.store.TranscriberFactory getTranscriberFactory()
getTranscriberFactory
in interface org.apache.jdo.pm.PersistenceManagerFactoryInternal
PersistenceManagerFactoryInternal.getTranscriberFactory()
public java.lang.Class getObjectIdClass(java.lang.Class cls)
getObjectIdClass
in interface org.apache.jdo.pm.PersistenceManagerFactoryInternal
PersistenceManagerFactoryInternal.getObjectIdClass(
Class cls)
public org.apache.jdo.store.StoreManager getStoreManager(javax.jdo.PersistenceManager pm)
getStoreManager
in interface org.apache.jdo.pm.PersistenceManagerFactoryInternal
PersistenceManagerFactoryInternal.getStoreManager(
PersistenceManager pm)
public void releaseStoreManager(javax.jdo.PersistenceManager pm)
releaseStoreManager
in interface org.apache.jdo.pm.PersistenceManagerFactoryInternal
PersistenceManagerFactoryInternal.releaseStoreManager(
PersistenceManager pm)
public java.lang.Class getTrackedClass(java.lang.Class type)
getTrackedClass
in interface org.apache.jdo.pm.PersistenceManagerFactoryInternal
PersistenceManagerFactoryInternal.getTrackedClass(
Class type)
public FOStoreModel getModel()
RequestFactory getRequestFactory()
BufferedRequestFactory
. In the future, this could be
configurable.
void mapProvisionalOIDToReal(OID pOID, OID rOID)
javax.jdo.JDOFatalException
- Thrown if the given OID is not provisional, or if
the given provisional OID is already mapped to a real OID.OID getRealOIDFromProvisional(OID pOID)
javax.jdo.JDOFatalException
- Thrown if the given OID is not provisional.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)
PersistenceManagerFactoryImpl.encrypt(java.lang.String)
protected java.lang.String decrypt(java.lang.String s)
PersistenceManagerFactoryImpl.decrypt(java.lang.String)
static java.lang.String doEncrypt(java.lang.String s)
static java.lang.String doDecrypt(java.lang.String s)
private static java.lang.String rot13(java.lang.String s)
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(java.util.Properties)
protected void getCFFromProperties(java.util.Properties p)
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()
protected java.lang.String[] getOptionArray()
PersistenceManagerFactoryImpl.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)
protected void shutdown()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |