|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.tc.object.bytecode.rwsync.LockingMethodStrategy
com.tc.object.bytecode.rwsync.SimpleLockMethodStrategy
public class SimpleLockMethodStrategy
Instrument a method by renaming it and then calling it inside a wrapper method that takes a
ReadLock or
WriteLock.
MethodStrategy instances are kept in statically initialized tables and reused, so implementations should not contain any mutable state.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.tc.object.bytecode.rwsync.LockingMethodStrategy |
|---|
LockingMethodStrategy.LockType |
| Field Summary |
|---|
| Fields inherited from class com.tc.object.bytecode.rwsync.LockingMethodStrategy |
|---|
lockField, lockTypeDesc, lockTypeName, THIS$0 |
| Constructor Summary | |
|---|---|
SimpleLockMethodStrategy(LockingMethodStrategy.LockType lockType)
|
|
| Method Summary | |
|---|---|
MethodVisitor |
visitMethod(ClassVisitor cv,
java.lang.String ownerType,
java.lang.String outerType,
java.lang.String outerDesc,
int access,
java.lang.String name,
java.lang.String desc,
java.lang.String signature,
java.lang.String[] exceptions)
Instrument a method, possibly creating other methods in the process. |
| Methods inherited from class com.tc.object.bytecode.rwsync.LockingMethodStrategy |
|---|
callRenamedMethod, getWrappedAttributes, getWrappedName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleLockMethodStrategy(LockingMethodStrategy.LockType lockType)
lockField - the name of the field that is the lock. If the method owner is an inner class, the read lock field
is assumed to belong to the outer class.| Method Detail |
|---|
public MethodVisitor visitMethod(ClassVisitor cv,
java.lang.String ownerType,
java.lang.String outerType,
java.lang.String outerDesc,
int access,
java.lang.String name,
java.lang.String desc,
java.lang.String signature,
java.lang.String[] exceptions)
MethodStrategy
visitMethod(...) {
return cv.visitMethod(access, name, desc, signature, exceptions);
}
This would delegate the visitMethod() call to the next class adapter in the chain, returning a method visitor which
could then be visited with the method's contents.
cv - a way of calling the next class adapter in the chain. Do not pass in the samed ClassVisitor that
is invoking the method strategy, or you'll recurse endlessly! Note that cv.visitMethod may be called more
than once during a single call to this method, and must return a distinct MethodVisitor instance for each
call.ownerType - the internal type name of the class that contains the method, e.g., "org/xyz/Foo$Bar"outerType - null if ownerType is a top-level type, or else the internal type name of its outer class e.g.
"org/xyz/Foo"outerDesc - null if ownerType is a top-level type, or else the type descriptor of its outer class, e.g.
"Lorg/xyz/Foo;"
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||