|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sofya.ed.semantic.AbstractEventSpecification sofya.ed.semantic.AllEvents
public class AllEvents
Specification which instructs an SemanticEventDispatcher
to
generate all possible events.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface sofya.ed.semantic.EventSpecification |
---|
EventSpecification.CallType, EventSpecification.FieldType, EventSpecification.MethodAction, EventSpecification.MonitorType |
Field Summary |
---|
Fields inherited from interface sofya.ed.semantic.EventSpecification |
---|
FIELD_WITNESS_NONE, FIELD_WITNESS_READ, FIELD_WITNESS_WRITE |
Constructor Summary | |
---|---|
protected |
AllEvents()
Creates a new all events specification. |
|
AllEvents(java.util.List systemClassList,
java.util.List moduleClassList)
Creates a new all events specification. |
Method Summary | |
---|---|
EventSpecification |
deserialize(java.io.DataInputStream stream)
Deserializes the specification from binary data. |
java.util.Set |
getModuleClasses(boolean asStrings)
Gets the set of classes comprising the module. |
java.util.Set |
getSystemClasses(boolean asStrings)
Gets the set of classes comprising the entire system. |
void |
serialize(java.io.DataOutputStream stream)
Serializes the specification as binary data. |
boolean |
useCallInterceptor(org.apache.bcel.generic.InvokeInstruction call,
org.apache.bcel.generic.ConstantPoolGen cpg)
Checks whether a method call should be observed using an "interceptor" that can provide additional data about the call. |
boolean |
witnessAnyMonitor(EventSpecification.MonitorType type,
org.apache.bcel.generic.MethodGen inMethod)
Checks whether any monitor events of a given type occurring in a given location are included in the specification. |
boolean |
witnessCall(org.apache.bcel.generic.InvokeInstruction call,
org.apache.bcel.generic.ConstantPoolGen cpg,
org.apache.bcel.generic.MethodGen inMethod)
Checks whether a method call in a given location is included in the specification. |
boolean |
witnessCatch(java.lang.String exceptionClass)
Checks whether the catching of an exception of a given class is included in the specification; that is, there is some location at which catching an exception of the given class is considered an observable event. |
boolean |
witnessCatch(java.lang.String exceptionClass,
org.apache.bcel.generic.MethodGen inMethod)
Checks whether the catching of an exception of a given class at a given location is included in the specification. |
boolean |
witnessConstructorEntry(org.apache.bcel.generic.MethodGen mg)
Checks whether entry into a constructor is included in the specification. |
boolean |
witnessConstructorExit(org.apache.bcel.generic.MethodGen mg)
Checks whether exit from a constructor is included in the specification. |
boolean |
witnessField(org.apache.bcel.generic.FieldInstruction fi,
org.apache.bcel.generic.ConstantPoolGen cpg,
org.apache.bcel.generic.MethodGen inMethod)
Checks whether the field referenced by a field instruction in a given location is part of the specification and should be witnessed. |
int |
witnessField(java.lang.String fieldName,
boolean isStatic)
Checks whether a named field is included in the specification. |
boolean |
witnessField(java.lang.String fieldName,
EventSpecification.FieldType fType,
java.lang.String className,
java.lang.String methodName,
java.lang.String signature)
Checks whether a field event occurring in a given location is included in the specification. |
boolean |
witnessMethodEntry(org.apache.bcel.generic.MethodGen mg)
Checks whether entry into a method is included in the specification. |
boolean |
witnessMethodExit(org.apache.bcel.generic.MethodGen mg)
Checks whether exit from a method is included in the specification. |
boolean |
witnessMonitor(java.lang.String className,
EventSpecification.MonitorType type)
Checks whether events associated with monitors on instances of a given class should be witnessed. |
boolean |
witnessNewObject(java.lang.String newClass,
org.apache.bcel.generic.MethodGen inMethod)
Checks whether an allocation of a class by a NEW instruction in a given location should be witnessed (is part of the specification). |
boolean |
witnessStaticInitializerEntry(java.lang.String className)
Checks whether entry into a static intializer is included in the specification. |
boolean |
witnessThrow(java.lang.String exceptionClass)
Checks whether the throwing of an exception of a given class is included in the specification; that is, there is some location from which throwing an exception of the given class is considered an observable event. |
boolean |
witnessThrow(java.lang.String exceptionClass,
java.lang.String className,
java.lang.String methodName,
java.lang.String signature)
Checks whether the throwing of an exception of a given class from a given location is included in the specification. |
Methods inherited from class sofya.ed.semantic.AbstractEventSpecification |
---|
deserializeObjectIntMap, deserializeProgramUnit, deserializeStrings, serializeObjectIntMap, serializeProgramUnit, serializeStrings |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AllEvents()
The resulting specification will not define any classes comprising the system or module. This constructor is provided only to support deserialization.
public AllEvents(java.util.List systemClassList, java.util.List moduleClassList)
systemClassList
- List of classes comprising the entire sytem.moduleClassList
- List of classes comprising the module
on which all events are to be observed (this can be the same as
the system class list).Method Detail |
---|
public java.util.Set getSystemClasses(boolean asStrings)
EventSpecification
asStrings
- Specifies whether the returned set should directly
contain the class names as strings. If false
, the set
will contain ProgramUnit
s containing the
classes.
public java.util.Set getModuleClasses(boolean asStrings)
EventSpecification
asStrings
- Specifies whether the returned set should directly
contain the class names as strings. If false
, the set
will contain ProgramUnit
s containing the
classes.
public boolean witnessNewObject(java.lang.String newClass, org.apache.bcel.generic.MethodGen inMethod)
EventSpecification
newClass
- Name of the class to check for inclusion.inMethod
- Method in which the NEW instruction is executed.
true
if the NEW instruction is included in the
specification and should be observed.public boolean witnessConstructorEntry(org.apache.bcel.generic.MethodGen mg)
EventSpecification
mg
- Constructor to be checked for inclusion in the
specification.
true
if entry into the constructor is included
in the specification.public boolean witnessConstructorExit(org.apache.bcel.generic.MethodGen mg)
EventSpecification
mg
- Constructor to be checked for inclusion in the
specification.
true
if exit from the constructor is included
in the specification.public boolean witnessField(org.apache.bcel.generic.FieldInstruction fi, org.apache.bcel.generic.ConstantPoolGen cpg, org.apache.bcel.generic.MethodGen inMethod)
EventSpecification
fi
- Field instruction to be checked for inclusion in the
specification.cpg
- Constant pool for the class containing the instruction.inMethod
- Method in which the field instruction is executed.
true
if the field is part of the specification.public boolean witnessField(java.lang.String fieldName, EventSpecification.FieldType fType, java.lang.String className, java.lang.String methodName, java.lang.String signature)
EventSpecification
fieldName
- Fully qualified name of the field to be checked for
inclusion in the specification.fType
- Type of the field to be checked for inclusion.className
- Name of the class in which the field instruction
is executed.methodName
- Name of the the method in which the field
instruction is executed.signature
- JDI-style signature of the method in which the
instruction is executed.
true
if the specified field event occurring in
the given method should be observed.public int witnessField(java.lang.String fieldName, boolean isStatic)
EventSpecification
This method is permitted to be heuristic, in the sense that it may in some circumstances indicate that a field is observable in some way when in fact it is not. A correct response should be attempted on a best-effort basis.
fieldName
- Fully qualified name of the field to be checked for
inclusion in the specification.isStatic
- Specifies whether it is a static field.
public boolean witnessCall(org.apache.bcel.generic.InvokeInstruction call, org.apache.bcel.generic.ConstantPoolGen cpg, org.apache.bcel.generic.MethodGen inMethod)
EventSpecification
call
- Invoke instruction to be checked for exclusion in the
specification.cpg
- Constant pool for the class containing the invoke instruction.inMethod
- Method in which the call is executed.
true
if the call is to a method included in the
specification.public boolean useCallInterceptor(org.apache.bcel.generic.InvokeInstruction call, org.apache.bcel.generic.ConstantPoolGen cpg)
EventSpecification
The principle benefit of witnessing a call using an interceptor
is that the values of the arguments to the method can be obtained.
Important information can be obtained about calls for which subsequent
EventListener.virtualMethodEnterEvent(sofya.ed.semantic.EventListener.ThreadData, sofya.ed.semantic.EventListener.ObjectData, sofya.ed.semantic.EventListener.MethodData)
s cannot be raised, either
because it is not possible (such as with native
methods),
or desirable (such as with Thread.start()
or
Thread.join()
methods). However, there is considerable
extra cost and potential interference associated with an interceptor,
so they generally should not be used for other method calls.
call
- Invoke instruction to be checked for observation using
an interceptor.cpg
- Constant pool for the class containing the invoke instruction.
true
if the call is to a method that should be
witnessed using an interceptor.public boolean witnessMethodEntry(org.apache.bcel.generic.MethodGen mg)
EventSpecification
This query treats interface methods as virtual methods since they are also dynamically bound, a behavior that distinguishes this query from the call invocation events where interface method calls and other virtual calls are treated as distinct events.
mg
- Virtual method to be checked for inclusion in the
specification.
true
if entry into the virtual method is included
in the specification.public boolean witnessMethodExit(org.apache.bcel.generic.MethodGen mg)
EventSpecification
This query treats interface methods as virtual methods since they are also dynamically bound, a behavior that distinguishes this query from the call invocation events where interface method calls and other virtual calls are treated as distinct events.
mg
- Virtual method to be checked for inclusion in the
specification.
true
if exit from the virtual method is included
in the specification.public boolean witnessAnyMonitor(EventSpecification.MonitorType type, org.apache.bcel.generic.MethodGen inMethod)
EventSpecification
This is a helper method which is used by the instrumentor to optimize away the associated instrumentation if no monitor events of a certain type are to be witnessed at all.
type
- Monitor event type for which the check should be performed.inMethod
- Method in which the monitor events are executed.
true
if monitor events of the specified type
may be witnessed, false
otherwise.public boolean witnessMonitor(java.lang.String className, EventSpecification.MonitorType type)
EventSpecification
className
- Fully qualified name of the class to be checked for
monitor event inclusion in the specification.type
- Type of monitor event.
true
if the given monitor events should be
witnessed for monitors on instances of the given class,
false
otherwise.public boolean witnessThrow(java.lang.String exceptionClass, java.lang.String className, java.lang.String methodName, java.lang.String signature)
EventSpecification
exceptionClass
- Fully qualified name of the exception class
to be checked for inclusion in the specification.className
- Name of the class in which the throw occurs.methodName
- Name of the the method in which the throw occurs.signature
- JDI-style signature of the method in which the
throw occurs.
true
if the throwing of the given exception
from the specified location should be observed, false
otherwise.public boolean witnessThrow(java.lang.String exceptionClass)
EventSpecification
exceptionClass
- Fully qualified name of the exception class
to be checked for inclusion in the specification.
true
if the throwing of the given exception
from some location in the program should be observed,
false
otherwise.public boolean witnessCatch(java.lang.String exceptionClass, org.apache.bcel.generic.MethodGen inMethod)
EventSpecification
exceptionClass
- Fully qualified name of the exception class
to be checked for inclusion in the specification.inMethod
- Method in which the catch occurs.
true
if the catching of the given exception
at the specified location should be observed, false
otherwise.public boolean witnessCatch(java.lang.String exceptionClass)
EventSpecification
exceptionClass
- Fully qualified name of the exception class
to be checked for inclusion in the specification.
true
if the catching of the given exception
at some location in the program should be observed,
false
otherwise.public boolean witnessStaticInitializerEntry(java.lang.String className)
EventSpecification
className
- Fully qualified name of the class containing
the static initializer to be checked for inclusion in the
specification.
true
if entry into the static initializer is
included in the specification.public void serialize(java.io.DataOutputStream stream) throws java.io.IOException
EventSpecification
stream
- Stream to which the specification is serialized.
java.io.IOException
- On any I/O error that prevents serialization.public EventSpecification deserialize(java.io.DataInputStream stream) throws java.io.IOException
EventSpecification
An instance of the class will need to be instantiated first, likely by reflection. If called on an existing instance, that specification will be destroyed (overwritten).
stream
- Stream from which the specification is deserialized.
java.io.IOException
- On any I/O error that prevents deserialization.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |