|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.perseus.concurrency.pessimistic.PessimisticConcurrencyManager
Nested Class Summary | |
protected static class |
PessimisticConcurrencyManager.ContextInfo
Information associated to a context |
Nested classes inherited from class org.objectweb.perseus.concurrency.api.ConcurrencyManager |
ConcurrencyManager.ResourceProvider |
Field Summary | |
protected java.util.Map |
contextInfos
A map associating a ContextInfo to each context. |
static java.lang.String |
DEPENDENCY_GRAPH_BINDING
|
protected DependencyGraph |
dg
|
protected java.util.Map |
locks
A map associating locks to all oids in all active contexts. |
protected Logger |
logger
|
static short |
POLICY_MUTEX
|
static short |
POLICY_RW_FIFO
|
static short |
POLICY_RW_PRIORITY2READERS
|
static short |
POLICY_UNDEFINED
|
static java.lang.String[] |
policyStringVal
|
protected boolean |
thinLockAllowed
|
Constructor Summary | |
PessimisticConcurrencyManager()
|
Method Summary | |
void |
abort(java.lang.Object ctx)
This method allows to release the resources allocated in a given context. |
void |
begin(java.lang.Object ctx)
This method records the start of an execution context. |
void |
bindFc(java.lang.String s,
java.lang.Object o)
|
void |
closeLock(Lock lock,
java.lang.Object ctx)
|
void |
finalize(java.lang.Object ctx)
This method marks the end of accesses made by the execution context. |
protected PessimisticConcurrencyManager.ContextInfo |
getContextInfo(java.lang.Object ctxt)
|
java.lang.String |
getFcState()
|
protected Lock |
getLock(java.lang.Object oid,
java.lang.Object hints)
Returns the lock associated to the given oid. |
java.lang.String |
getPolicy()
|
boolean |
getThinkLockAllowed()
|
java.lang.String[] |
listFc()
|
java.lang.Object |
lookupFc(java.lang.String s)
|
java.lang.Object |
readIntention(java.lang.Object ctx,
java.lang.Object resourceId,
java.lang.Object thinLock,
ConcurrencyManager.ResourceProvider resProv,
java.lang.Object resourceHints)
This method records an access intention to a data object in read mode. |
void |
setPolicy(java.lang.String policy)
|
void |
setThinkLockAllowed(boolean val)
|
void |
startFc()
|
void |
stopFc()
|
void |
unbindFc(java.lang.String s)
|
boolean |
validate(java.lang.Object ctx)
This method requests the validation of accesses made by the context. |
java.lang.Object |
writeIntention(java.lang.Object ctx,
java.lang.Object resourceId,
java.lang.Object thinLock,
ConcurrencyManager.ResourceProvider resProv,
java.lang.Object resourceHints)
This method records an access intention to a data object in write mode. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final short POLICY_UNDEFINED
public static final short POLICY_MUTEX
public static final short POLICY_RW_PRIORITY2READERS
public static final short POLICY_RW_FIFO
public static final java.lang.String[] policyStringVal
public static final java.lang.String DEPENDENCY_GRAPH_BINDING
protected java.util.Map locks
protected DependencyGraph dg
protected java.util.Map contextInfos
protected Logger logger
protected boolean thinLockAllowed
Constructor Detail |
public PessimisticConcurrencyManager()
Method Detail |
public java.lang.String[] listFc()
public java.lang.Object lookupFc(java.lang.String s) throws NoSuchInterfaceException
NoSuchInterfaceException
public void bindFc(java.lang.String s, java.lang.Object o) throws IllegalBindingException, NoSuchInterfaceException
IllegalBindingException
NoSuchInterfaceException
public void unbindFc(java.lang.String s) throws NoSuchInterfaceException
NoSuchInterfaceException
public java.lang.String getFcState()
public void startFc() throws IllegalLifeCycleException
IllegalLifeCycleException
public void stopFc() throws IllegalLifeCycleException
IllegalLifeCycleException
public void begin(java.lang.Object ctx)
ConcurrencyManager
begin
in interface ConcurrencyManager
ctx
- is the contextpublic boolean validate(java.lang.Object ctx)
ConcurrencyManager
validate
in interface ConcurrencyManager
public void finalize(java.lang.Object ctx)
ConcurrencyManager
finalize
in interface ConcurrencyManager
public void closeLock(Lock lock, java.lang.Object ctx)
public void abort(java.lang.Object ctx)
ConcurrencyManager
abort
in interface ConcurrencyManager
public java.lang.Object readIntention(java.lang.Object ctx, java.lang.Object resourceId, java.lang.Object thinLock, ConcurrencyManager.ResourceProvider resProv, java.lang.Object resourceHints) throws ConcurrencyException
ConcurrencyManager
readIntention
in interface ConcurrencyManager
ctx
- is an identifier of the execution context. It can be a
transaction handle.resourceId
- is the resource identifier (Object used for
synchronization and equals)thinLock
- permit to take smaller lock than on the resource globalyresProv
- is used to retrieve the resource. If not resource provider
is specified (null value), then the method returns a null value.resourceHints
- is a hints helping the ResourceProvider to provide
the resource corresponding to the identier
ConcurrencyException
- if there is a concurrency problem. In this
last case that means the context should be cancelled.public java.lang.Object writeIntention(java.lang.Object ctx, java.lang.Object resourceId, java.lang.Object thinLock, ConcurrencyManager.ResourceProvider resProv, java.lang.Object resourceHints) throws ConcurrencyException
ConcurrencyManager
writeIntention
in interface ConcurrencyManager
ctx
- is an identifier of the execution context. It can be a
transaction handle.resourceId
- is the resource identifier (Object used for
synchronization and equals)thinLock
- permit to take smaller lock than on the resource globalyresProv
- is used to retrieve the resource. If not resource provider
is specified (null value), then the method returns a null value.resourceHints
- is a hints helping the ResourceProvider to provide
the resource corresponding to the identier
ConcurrencyException
- if there is a concurrency problem. In this
last case that means the context should be cancelled.protected Lock getLock(java.lang.Object oid, java.lang.Object hints)
oid
- an object identifier.
protected PessimisticConcurrencyManager.ContextInfo getContextInfo(java.lang.Object ctxt)
public java.lang.String getPolicy()
getPolicy
in interface PessimisticConcurrencyManagerAC
public void setPolicy(java.lang.String policy) throws IllegalLifeCycleException
setPolicy
in interface PessimisticConcurrencyManagerAC
IllegalLifeCycleException
public boolean getThinkLockAllowed()
getThinkLockAllowed
in interface PessimisticConcurrencyManagerAC
public void setThinkLockAllowed(boolean val)
setThinkLockAllowed
in interface PessimisticConcurrencyManagerAC
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |