
Classes | |
| class | MultiOSCFactory |
Public Member Functions | |
| EOObjectStore | currentRootObjectStore () |
| EOObjectStore | nextObjectStore () |
| void | sessionDidCreate (NSNotification n) |
| void | sessionDidTimeout (NSNotification n) |
| EOSharedEditingContext | sharedEditingContextForObjectStore (EOObjectStore os) |
Static Public Member Functions | |
| static ERXObjectStoreCoordinatorPool | _pool () |
| static void | initialize () |
| static void | initializeIfNecessary () |
Protected Member Functions | |
| EOObjectStore | currentThreadObjectStore () |
| String | sessionID () |
Static Protected Attributes | |
| static ERXObjectStoreCoordinatorPool | _pool |
Private Member Functions | |
| void | _initObjectStores () |
| ERXObjectStoreCoordinatorPool () | |
Private Attributes | |
| int | _currentObjectStoreIndex |
| Object | _lock = new Object() |
| int | _maxOS |
| List | _objectStores |
| Observer | _observer |
| Hashtable | _oscForSession |
| List | _sharedEditingContexts |
Static Private Attributes | |
| static final Logger | log = Logger.getLogger(ERXObjectStoreCoordinatorPool.class) |
| static final String | THREAD_OSC_KEY = "er.extensions.ERXObjectStoreCoordinatorPool.threadOSC" |
er.extensions.ERXObjectStoreCoordinatorPool.maxCoordinators. Each Session will become one EOObjectStoreCoordinator and the method newEditingContext will always return an EOEditingContext with the same EOObjectStoreCoordinator for the same WOSession. This first release uses round-robin pooling, future versions might use better algorithms to decide which EOObjectStoreCoordinator will be used for the next new WOSession.
| ERXObjectStoreCoordinatorPool | ( | ) | [private] |
Creates a new ERXObjectStoreCoordinatorPool. This object is a singleton. This object is responsible to provide EOObjectStoreCoordinators based on the current Threads' session. It is used by MultiOSCFactory to get a rootObjectStore if the MultiOSCFactory is asked for a new EOEditingContext.
| void _initObjectStores | ( | ) | [private] |
| static ERXObjectStoreCoordinatorPool _pool | ( | ) | [static] |
| EOObjectStore currentRootObjectStore | ( | ) |
returns the session related EOObjectStoreCoordinator. If session is null then it returns the nextObjectStore. This method is used to create new EOEditingContexts with the MultiOSCFactory
| EOObjectStore currentThreadObjectStore | ( | ) | [protected] |
Returns the object store for the current thread (or requests one and sets it if there isn't one).
| static void initialize | ( | ) | [static] |
Creates the singleton and registers the multi factory.
| static void initializeIfNecessary | ( | ) | [static] |
Calls initialize() if the required system properties exist.
| EOObjectStore nextObjectStore | ( | ) |
Lazy initialises the objectStores and then returns the next one, this is based on round robin.
| void sessionDidCreate | ( | NSNotification | n | ) |
checks if the new Session has already a EOObjectStoreCoordinator assigned, if not it assigns a EOObjectStoreCoordinator to the session.
| n | WOSession#SessionDidCreateNotification |
| void sessionDidTimeout | ( | NSNotification | n | ) |
Removes the timed out session from the internal array. session.
| n | WOSession#SessionDidTimeOutNotification |
| String sessionID | ( | ) | [protected] |
| EOSharedEditingContext sharedEditingContextForObjectStore | ( | EOObjectStore | os | ) |
int _currentObjectStoreIndex [private] |
Object _lock = new Object() [private] |
int _maxOS [private] |
List _objectStores [private] |
Observer _observer [private] |
Hashtable _oscForSession [private] |
ERXObjectStoreCoordinatorPool _pool [static, protected] |
List _sharedEditingContexts [private] |
final Logger log = Logger.getLogger(ERXObjectStoreCoordinatorPool.class) [static, private] |
final String THREAD_OSC_KEY = "er.extensions.ERXObjectStoreCoordinatorPool.threadOSC" [static, private] |
1.5.8