Timer timer = new Timer();
try
{
//use http connector
MBeanServerConnection mbsc = getMBeanServerConnection(host, port, user, password);
final DomainRoot domainRoot = ProxyFactory.getInstance(mbsc).getDomainRoot();
verifyTargetInstance(domainRoot, instanceName);
final ServerRootMonitor srm = getServerRootMonitor(domainRoot, instanceName);
MonitorTask monitorTask = getTask(monitorType, srm, filterName, timer, verbose, fileName);
timer.scheduleAtFixedRate(monitorTask, 0, interval);