public MonitoredExertDispatcher( Exertion exertion, Set<Context> sharedContext, boolean isSpawned, Provider provider) throws Exception { super(exertion, sharedContext, isSpawned, provider, null); if (sessionMonitor == null) sessionMonitor = (MonitoringManagement) ProviderAccessor.getProvider( Sorcer.getActualName(Sorcer.getExertMonitorName()), MonitoringManagement.class); if (lrm == null) lrm = new LeaseRenewalManager(); // get the exertion with the monitor session this.xrt = (ServiceExertion) register(exertion); // make the monitor session of this exertion active logger.log(Level.FINER, "Dispatching task now: " + xrt.getName()); MonitoringSession session = (MonitoringSession) (xrt.getMonitorSession()); session.init((Monitorable) provider.getProxy(), LEASE_RENEWAL_PERIOD, DEFAULT_TIMEOUT_PERIOD); lrm.renewUntil(session.getLease(), Lease.ANY, null); dThread = new DispatchThread(); try { dThread.start(); dThread.join(); } catch (InterruptedException ie) { ie.printStackTrace(); state = FAILED; } }