public class Bootstrapper extends Object
During the 1. phase an application written on Jiapi framework is bootstrapped. It is loaded with a Jiapi compatible class loader (e.g. net.sf.jiapi.util.InstrumentingClassLoader) and called through Java reflection.
The Jiapi application which was bootstrapped in phase 1. usually does something for a target application. Bootstrapper.launch is a utility method which can be used launch a target application so that the classes are loaded to a proper namespace.
Constructor and Description |
---|
Bootstrapper(String className,
String methodName,
Class<?>[] parameterTypes,
Object[] args,
ClassLoader classLoader) |
Modifier and Type | Method and Description |
---|---|
void |
bootstrap(String className,
String methodName,
Class<?>[] parameterTypes,
Object[] args,
ClassLoader classLoader)
This method is used to bootstrap an application.
|
static void |
launch(String className,
Object[] args,
InstrumentationContext ctx,
ClassLoader classLoader)
A utility method which is usually used from Jiapi applications to launch
a target application for instrumentation.
|
static void |
launch(String className,
String methodName,
Class<?>[] parameterTypes,
Object[] args,
InstrumentationContext ctx,
ClassLoader classLoader)
A utility method which is usually used from Jiapi applications to launch
a target application for instrumentation.
|
static void |
main(String[] args) |
public Bootstrapper(String className, String methodName, Class<?>[] parameterTypes, Object[] args, ClassLoader classLoader)
public void bootstrap(String className, String methodName, Class<?>[] parameterTypes, Object[] args, ClassLoader classLoader)
className
- a fully qualified name of a class to bootstrapmethodName
- name of a method to call (e.g. "main")parameterTypes
- parameter types of a methodargs
- arguments for a methodclassLoader
- to be used, the given classloader should implement setContext
methodpublic static void launch(String className, Object[] args, InstrumentationContext ctx, ClassLoader classLoader)
className
- a fully qualified name of a class to bootstrapargs
- arguments for a methodctx
- InstrumentationContextclassLoader
- which loaded the calling applicationpublic static void launch(String className, String methodName, Class<?>[] parameterTypes, Object[] args, InstrumentationContext ctx, ClassLoader classLoader)
className
- a fully qualified name of a class to bootstrapmethodName
- name of a method to call (e.g. "main")parameterTypes
- parameter types of a methodargs
- arguments for a methodctx
- InstrumentationContextclassLoader
- which loaded the calling applicationpublic static void main(String[] args)
Copyright © 2017. All rights reserved.