org.jacoco.core.runtime
Class URLStreamHandlerRuntime
java.lang.Object
org.jacoco.core.runtime.AbstractRuntime
org.jacoco.core.runtime.URLStreamHandlerRuntime
- All Implemented Interfaces:
- IExecutionDataAccessorGenerator, IRuntime
public class URLStreamHandlerRuntime
- extends AbstractRuntime
This IRuntime
implementation registers a special
URLStreamHandler
to process coverage data. The handler is not
actually used for opening a URL, but to get access to the runtime object.
Method Summary |
int |
generateDataAccessor(long classid,
String classname,
int probecount,
org.objectweb.asm.MethodVisitor mv)
This method generates the byte code required to obtain the coverage data
structure for the class with the given id. |
void |
shutdown()
Allows the coverage runtime to cleanup internals. |
void |
startup()
Starts the coverage runtime. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
URLStreamHandlerRuntime
public URLStreamHandlerRuntime()
- Creates a new runtime.
startup
public void startup()
throws Exception
- Description copied from interface:
IRuntime
- Starts the coverage runtime. This method MUST be called before any class
instrumented for this runtime is loaded.
- Throws:
Exception
- any internal problem during startup
shutdown
public void shutdown()
- Description copied from interface:
IRuntime
- Allows the coverage runtime to cleanup internals. This class should be
called when classes instrumented for this runtime are not used any more.
generateDataAccessor
public int generateDataAccessor(long classid,
String classname,
int probecount,
org.objectweb.asm.MethodVisitor mv)
- Description copied from interface:
IExecutionDataAccessorGenerator
- This method generates the byte code required to obtain the coverage data
structure for the class with the given id. Typically the instrumentation
process will embed this code into a method that is called on class
initialization. This method can be called at any time even outside the
target VM.
The generated code must push a
boolean[]
instance to the
operand stack. Except this result object the generated code must not make
any assumptions about the structure of the embedding method or class. The
generated code must not use or allocate local variables.
- Parameters:
classid
- identifier of the classclassname
- VM class nameprobecount
- probe count for this classmv
- code output
- Returns:
- additional stack size required by the implementation, including
the instance pushed to the stack
Copyright © 2009-2011 Mountainminds GmbH & Co. KG. All Rights Reserved.