resumir.add(((ThreadDeathEvent) event).thread());
}
else if(event instanceof ClassPrepareEvent)
{
ClassPrepareEvent cpe=(ClassPrepareEvent) event;
ReferenceType rt = cpe.referenceType();
//inspeccionar metodos
if(traceFilter.isTraceMethods())
{
for(Method method : rt.methods())
{
if(method.location()!=null)
{
BreakpointRequest br = vm.eventRequestManager().createBreakpointRequest(method.location());
br.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
br.setEnabled(true);
}
}
}
//inspeccion de acceso y modificacionde atributos
if(traceFilter.isTraceFields())
{
for(Field field : rt.fields())
{
AccessWatchpointRequest awr = vm.eventRequestManager().createAccessWatchpointRequest(field);
awr.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
awr.setEnabled(true);
ModificationWatchpointRequest mwr = vm.eventRequestManager().createModificationWatchpointRequest(field);
mwr.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
mwr.setEnabled(true);
}
}
//inspeccionar excepciones
if(traceFilter.isTraceExceptions())
{
ExceptionRequest er = vm.eventRequestManager().createExceptionRequest(null, true, true);
er.addClassFilter(rt);
er.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
er.setEnabled(true);
}
EClassLoadEvent eEvent;
//generar evento
generatedEvents.add(eEvent=dataManager.createClassLoadEvent(cpe));
//resumir hilo
resumir.add(((ClassPrepareEvent) event).thread());
//if(rt.name().equals("one.PruebaStack"))
{
MethodEntryRequest mer = vm.eventRequestManager().createMethodEntryRequest();
mer.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
mer.addThreadFilter(cpe.thread());
mer.putProperty("threadName", cpe.thread().name());
mer.putProperty("eEvent", eEvent);
mer.putProperty("where", "class load");
//mer.addClassFilter("one.PruebaStack");
mer.addClassFilter(rt);
mer.setEnabled(true);
MethodExitRequest mxr = vm.eventRequestManager().createMethodExitRequest();
mxr.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
mxr.addThreadFilter(cpe.thread());
mxr.putProperty("threadName", cpe.thread().name());
mxr.putProperty("eEvent", eEvent);
mxr.putProperty("where", "breakpoint");
mxr.addClassFilter(rt);
mxr.setEnabled(true);
}