org.openmdx.base.accessor.jmi.spi
Class PersistenceManagerFactory_1

java.lang.Object
  extended by org.openmdx.base.object.spi.AbstractPersistenceManagerFactory
      extended by org.openmdx.base.accessor.jmi.spi.PersistenceManagerFactory_1
All Implemented Interfaces:
Serializable, JDOConnection, PersistenceManagerFactory, CloseCallback

public class PersistenceManagerFactory_1
extends AbstractPersistenceManagerFactory
implements JDOConnection

ManagerFactory

Since:
openMDX 1.13
See Also:
Serialized Form

Method Summary
 void close()
          Close this PersistenceManagerFactory.
 Object getNativeConnection()
          Returns the native, datastore-specific connection that this connection wraps.
static PersistenceManagerFactory getPersistenceManagerFactory(Map properties)
          Get instance
static String[] getPrincipalChain(String connectionUsername)
          Convert the stringified principal chain into an array
protected  PersistenceManager newPersistenceManager(InstanceLifecycleNotifier notifier)
          Create a new persistence manager
protected  PersistenceManager newPersistenceManager(InstanceLifecycleNotifier notifier, String connectionUsername, String connectionPassword)
          Create a new persistence manager
 
Methods inherited from class org.openmdx.base.object.spi.AbstractPersistenceManagerFactory
addInstanceLifecycleListener, failIfOpened, getConnectionDriverName, getConnectionFactory, getConnectionFactory2, getConnectionFactory2Name, getConnectionFactoryName, getConnectionURL, getConnectionUserName, getDataStoreCache, getDetachAllOnCommit, getIgnoreCache, getMapping, getMultithreaded, getNontransactionalRead, getNontransactionalWrite, getOptimistic, getPersistenceManager, getPersistenceManager, getProperties, getRestoreValues, getRetainValues, isClosed, open, postClose, removeInstanceLifecycleListener, setConnectionDriverName, setConnectionFactory, setConnectionFactory2, setConnectionFactory2Name, setConnectionFactoryName, setConnectionPassword, setConnectionURL, setConnectionUserName, setDetachAllOnCommit, setIgnoreCache, setMapping, setMultithreaded, setNontransactionalRead, setNontransactionalWrite, setOptimistic, setRestoreValues, setRetainValues, supportedOptions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getPersistenceManagerFactory

public static PersistenceManagerFactory getPersistenceManagerFactory(Map properties)
Get instance

Parameters:
properties -
Returns:
a new instance

close

public void close()
Description copied from interface: PersistenceManagerFactory
Close this PersistenceManagerFactory. Check for JDOPermission("closePersistenceManagerFactory") and if not authorized, throw SecurityException.

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.

Specified by:
close in interface JDOConnection
Specified by:
close in interface PersistenceManagerFactory
Overrides:
close in class AbstractPersistenceManagerFactory

getNativeConnection

public Object getNativeConnection()
Description copied from interface: JDOConnection
Returns the native, datastore-specific connection that this connection wraps. In general, it is not recommended that this native connection be used directly, since the JDO implementation has no way to intercept calls to it, so it is quite possible to put the PersistenceManager's connection into an invalid state.

Specified by:
getNativeConnection in interface JDOConnection
Returns:
the native connection

newPersistenceManager

protected PersistenceManager newPersistenceManager(InstanceLifecycleNotifier notifier)
Create a new persistence manager

The parameters may be kept by the instance.

Specified by:
newPersistenceManager in class AbstractPersistenceManagerFactory
Parameters:
notifier -
connectionUsername -
connectionPassword -
Returns:
a new persistence manager

newPersistenceManager

protected PersistenceManager newPersistenceManager(InstanceLifecycleNotifier notifier,
                                                   String connectionUsername,
                                                   String connectionPassword)
Create a new persistence manager

The parameters may be kept by the instance.

Specified by:
newPersistenceManager in class AbstractPersistenceManagerFactory
Parameters:
notifier -
connectionUsername - the procnipal chain
connectionPassword - the correlation id
Returns:
a new persistence manager

getPrincipalChain

public static String[] getPrincipalChain(String connectionUsername)
Convert the stringified principal chain into an array

Parameters:
connectionUsername - a principal or the stringified principal list
Returns:
a principal array


This software is published under the BSD license. Copyright © 2003-2007, OMEX AG, Switzerland, All rights reserved. Use is subject to license terms.