com.bea.jvm.event
Class CompilationEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--com.bea.jvm.event.CompilationEvent
All Implemented Interfaces:
java.io.Serializable

public class CompilationEvent
extends java.util.EventObject

An event delivered when a Method is compiled by the JVM.

Author:
Calle Wilund, Marcus Hirt
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
CompilationEvent(java.lang.reflect.Constructor constructor, CodeGenerationStrategy strategy, long compilationTime)
          Constructor.
CompilationEvent(java.lang.reflect.Constructor constructor, OptimizationLevel optimizationlevel, long compilationTime)
          Deprecated. Replaced. @see CompilationEvent#CompilationEvent(Constructor, CodeGenerationStrategy, long)
CompilationEvent(java.lang.reflect.Method method, CodeGenerationStrategy strategy, long compilationTime)
          Constructor.
CompilationEvent(java.lang.reflect.Method method, OptimizationLevel optimizationlevel, long compilationTime)
          Deprecated. Replaced. @see CompilationEvent#CompilationEvent(Method, CodeGenerationStrategy, long)
CompilationEvent(java.lang.Object constructorOrMethod, CodeGenerationStrategy strategy, OptimizationLevel optimizationLevel, long compilationTime)
          Temporary Constructor that will be removed with all the other deprecated methods in the next release.
 
Method Summary
 CodeGenerationStrategy getCodeGenerationStrategy()
          Returns the CodeGenerationStrategy that was used to compile the Method.
 long getCompilationTime()
          Returns the time, in nanoseconds, it took to compile this method.
 java.lang.reflect.Constructor getConstructor()
          Returns the Constructor that was compiled, which ultimately caused this event to be created.
 java.lang.reflect.Method getMethod()
          Returns the Method that was compiled, which ultimately caused this event to be created.
 OptimizationLevel getOptimizationLevel()
          Deprecated. Replaced. @see CompilationEvent#getCodeGenerationStrategy().
 boolean hasConstructor()
          Returns true if this event has a Constructor, and not a Method.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompilationEvent

public CompilationEvent(java.lang.reflect.Method method,
                        OptimizationLevel optimizationlevel,
                        long compilationTime)
Deprecated. Replaced. @see CompilationEvent#CompilationEvent(Method, CodeGenerationStrategy, long)

Constructor.

Parameters:
method - the method that was compiled.
optimizationlevel - level of optimization used.
compilationTime - the time it took to compile the method in ns.

CompilationEvent

public CompilationEvent(java.lang.reflect.Method method,
                        CodeGenerationStrategy strategy,
                        long compilationTime)
Constructor.

Parameters:
method - the method that was compiled.
strategy - the code generation strategy used.
compilationTime - the time it took to compile the method in ns.

CompilationEvent

public CompilationEvent(java.lang.reflect.Constructor constructor,
                        OptimizationLevel optimizationlevel,
                        long compilationTime)
Deprecated. Replaced. @see CompilationEvent#CompilationEvent(Constructor, CodeGenerationStrategy, long)

Constructor.

Parameters:
constructor - the constructor that was compiled.
optimizationlevel - level of optimization used.
compilationTime - the time it took to compile the method in ns.

CompilationEvent

public CompilationEvent(java.lang.reflect.Constructor constructor,
                        CodeGenerationStrategy strategy,
                        long compilationTime)
Constructor.

Parameters:
constructor - the constructor that was compiled.
strategy - the code generation strategy used.
compilationTime - the time it took to compile the method in ns.

CompilationEvent

public CompilationEvent(java.lang.Object constructorOrMethod,
                        CodeGenerationStrategy strategy,
                        OptimizationLevel optimizationLevel,
                        long compilationTime)
Temporary Constructor that will be removed with all the other deprecated methods in the next release.

Parameters:
strategy - the code generation strategy used.
compilationTime - the time it took to compile the method in ns.
Method Detail

getOptimizationLevel

public OptimizationLevel getOptimizationLevel()
Deprecated. Replaced. @see CompilationEvent#getCodeGenerationStrategy().

Returns the OptimizationLevel that was used when compiling the Method.

Returns:
the OptimizationLevel used when compiling the Method.

getMethod

public java.lang.reflect.Method getMethod()
                                   throws NotAvailableException
Returns the Method that was compiled, which ultimately caused this event to be created. Will return null if a Constructor was compiled.

Returns:
the Method that was compiled.
Throws:
NotAvailableException - if this functionality isn't available in this JVM.

getConstructor

public java.lang.reflect.Constructor getConstructor()
                                             throws NotAvailableException
Returns the Constructor that was compiled, which ultimately caused this event to be created. Will return null if a Method was compiled.

Returns:
the Constructor that was compiled.
Throws:
NotAvailableException - if this functionality isn't available in this JVM.

hasConstructor

public boolean hasConstructor()
Returns true if this event has a Constructor, and not a Method. (As a result of a Constructor being compiled.)

Returns:
true if this event has a Constructor.

getCompilationTime

public long getCompilationTime()
Returns the time, in nanoseconds, it took to compile this method.

Returns:
the time, in nanoseconds, it took to compile this method.

getCodeGenerationStrategy

public CodeGenerationStrategy getCodeGenerationStrategy()
Returns the CodeGenerationStrategy that was used to compile the Method.

Returns:
the CodeGenerationStrategy that was used to compile the Method.