|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.openjpa.kernel.BrokerImpl org.apache.openjpa.kernel.FinalizingBrokerImpl org.apache.openjpa.slice.DistributedBrokerImpl
public class DistributedBrokerImpl
A specialized Broker to associate slice identifiers with the StateManagers as they are persisted in a cascade. This intervention helps the user to define distribution policy only for root instances i.e. the instances that are explicit argument to persist() call. The cascaded instances are assigned the same slice to honor collocation constraint.
Field Summary |
---|
Fields inherited from class org.apache.openjpa.kernel.BrokerImpl |
---|
FLUSH_COMMIT, FLUSH_INC, FLUSH_LOGICAL, FLUSH_ROLLBACK |
Fields inherited from interface org.apache.openjpa.kernel.StoreContext |
---|
EXCLUDE_ALL, OID_ALLOW_NEW, OID_COPY, OID_NODELETED, OID_NOVALIDATE |
Fields inherited from interface org.apache.openjpa.kernel.ConnectionRetainModes |
---|
CONN_RETAIN_ALWAYS, CONN_RETAIN_DEMAND, CONN_RETAIN_TRANS |
Fields inherited from interface org.apache.openjpa.kernel.DetachState |
---|
DETACH_ALL, DETACH_FETCH_GROUPS, DETACH_FGS, DETACH_LOADED |
Fields inherited from interface org.apache.openjpa.kernel.LockLevels |
---|
LOCK_NONE, LOCK_READ, LOCK_WRITE |
Fields inherited from interface org.apache.openjpa.kernel.RestoreState |
---|
RESTORE_ALL, RESTORE_IMMUTABLE, RESTORE_NONE |
Fields inherited from interface org.apache.openjpa.kernel.AutoClear |
---|
CLEAR_ALL, CLEAR_DATASTORE |
Fields inherited from interface org.apache.openjpa.kernel.AutoDetach |
---|
DETACH_CLOSE, DETACH_COMMIT, DETACH_NONE, DETACH_NONTXREAD, DETACH_ROLLBACK, names, values |
Fields inherited from interface org.apache.openjpa.event.CallbackModes |
---|
CALLBACK_FAIL_FAST, CALLBACK_IGNORE, CALLBACK_LOG, CALLBACK_RETHROW, CALLBACK_ROLLBACK |
Constructor Summary | |
---|---|
DistributedBrokerImpl()
|
Method Summary | |
---|---|
void |
beginStore()
A virtual datastore need not be opened. |
boolean |
endOperation()
Mark the operation over. |
DistributedConfiguration |
getConfiguration()
Return the configuration associated with this context. |
DistributedStoreManager |
getDistributedStoreManager()
Gets the distributed store manager used by this receiver. |
TargetFetchConfiguration |
getFetchConfiguration()
Return the (mutable) fetch configuration for loading objects from this context. |
void |
lock()
Always uses lock irrespective of super's multi-threaded settings. |
protected QueryImpl |
newQueryImpl(String lang,
StoreQuery sq)
Create a new query. |
OpenJPAStateManager |
persist(Object pc,
Object id,
boolean explicit,
OpCallbacks call)
Assigns slice identifier to the resultant StateManager as initialized by the super class implementation. |
Object |
processArgument(Object oid)
Overrides to target specific slices for find() calls. |
protected void |
setStateManager(Object id,
StateManagerImpl sm,
int status)
Set the cached StateManager for the instance that had the given oid. |
void |
unlock()
Releases the internal lock. |
Methods inherited from class org.apache.openjpa.kernel.FinalizingBrokerImpl |
---|
finalize |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.transaction.Synchronization |
---|
afterCompletion, beforeCompletion |
Constructor Detail |
---|
public DistributedBrokerImpl()
Method Detail |
---|
public DistributedConfiguration getConfiguration()
StoreContext
getConfiguration
in interface StoreContext
getConfiguration
in class BrokerImpl
public DistributedStoreManager getDistributedStoreManager()
DistributedBroker
getDistributedStoreManager
in interface DistributedBroker
public TargetFetchConfiguration getFetchConfiguration()
StoreContext
getFetchConfiguration
in interface StoreContext
getFetchConfiguration
in interface DistributedBroker
getFetchConfiguration
in class BrokerImpl
public OpenJPAStateManager persist(Object pc, Object id, boolean explicit, OpCallbacks call)
DistributionPolicy
for given pc
if it is a root
instance i.e. the argument of the user application's persist() call. The
cascaded instances are detected by non-empty status of the current
operating set. The slice is assigned only if a StateManager has never
been assigned before.
persist
in class BrokerImpl
protected void setStateManager(Object id, StateManagerImpl sm, int status)
BrokerImpl
setStateManager
in class BrokerImpl
id
- the id previously used by the instancesm
- the state manager for the instance; if the state
manager is transient, we'll stop managing the instance;
if it has updated its oid, we'll re-cache under the new oidstatus
- one of our STATUS constants describing why we're
setting the state managerpublic boolean endOperation()
BrokerImpl
endOperation
in interface Broker
endOperation
in class BrokerImpl
protected QueryImpl newQueryImpl(String lang, StoreQuery sq)
newQueryImpl
in class BrokerImpl
public void lock()
lock
in interface StoreContext
lock
in class BrokerImpl
public void unlock()
StoreContext
unlock
in interface StoreContext
unlock
in class BrokerImpl
public void beginStore()
beginStore
in interface StoreContext
beginStore
in class BrokerImpl
public Object processArgument(Object oid)
processArgument
in interface FindCallbacks
processArgument
in class BrokerImpl
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |