System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>-");
}
private void setEventRequests(VirtualMachine vm)
{
EventRequestManager mgr = vm.eventRequestManager();
/*ClassPrepareRequest cpr = mgr.createClassPrepareRequest();
cpr.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
cpr.addClassFilter("");
cpr.enable();*/
for(String clazz : traceFilter.getClasses())
{
ClassPrepareRequest cpr = mgr.createClassPrepareRequest();
cpr.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
cpr.addClassFilter(clazz);
cpr.enable();
EventRequest req= mgr.createClassUnloadRequest();
req.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
((ClassUnloadRequest)req).addClassFilter(clazz);
req.setEnabled(true);
//TODO NO repertir request usar uno para todas las clases
req = mgr.createMonitorContendedEnteredRequest();
req.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
((MonitorContendedEnteredRequest)req).addClassFilter(clazz);
req.setEnabled(true);
req = mgr.createMonitorContendedEnterRequest();
req.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
((MonitorContendedEnterRequest)req).addClassFilter(clazz);
req.setEnabled(true);
req = mgr.createMonitorWaitedRequest();
req.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
((MonitorWaitedRequest)req).addClassFilter(clazz);
req.setEnabled(true);
req = mgr.createMonitorWaitRequest();
req.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
((MonitorWaitRequest)req).addClassFilter(clazz);
req.setEnabled(true);
}
if(traceFilter.isTraceThreads())
{
//inspeccions creacion hilos
ThreadStartRequest tsr = mgr.createThreadStartRequest();
tsr.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
tsr.setEnabled(true);
//inspeccions destruccion hilos
ThreadDeathRequest tdr = mgr.createThreadDeathRequest();
tdr.setSuspendPolicy(EventRequest.SUSPEND_EVENT_THREAD);
tdr.setEnabled(true);
}
}