private void resume() {

		// create runnable to resume the event context
		Runnable runnable = new Runnable() {
			public void run() {
				if (scheduledFuture == null) {
					// already resumed
					return;
				}
				// cancel timer task
				scheduledFuture.cancel(false);
				scheduledFuture = null;
				// send events frozen to event router again, will be processed only after this one ends (this one is already being executed)
				for (EventContext ec : barriedEvents) {
					ec.getLocalActivityContext().getExecutorService().routeEvent(ec);
				}
				barriedEvents = null;
				// remove barrier on activity event queue
				event.getLocalActivityContext().getEventQueueManager().removeBarrier(transaction);
				// remove suspension
				suspended = false;
				// continue routing the event related with this context
				event.getLocalActivityContext().getCurrentEventRoutingTask().run();				
			}
		};
		// run it using the activity executor service to avoid thread concurrency
		event.getLocalActivityContext().getExecutorService().execute(runnable);
	}
private void resume() {

		
		Runnable runnable = new Runnable() {
			public void run() {
				if (scheduledFuture == null) {
					
					return;
				}
				
				scheduledFuture.cancel(false);
				scheduledFuture = null;
				
				for (EventContext ec : barriedEvents) {
					ec.getLocalActivityContext().getExecutorService().routeEvent(ec);
				}
				barriedEvents = null;
				
				event.getLocalActivityContext().getEventQueueManager().removeBarrier(transaction);
				
				suspended = false;
				
				event.getLocalActivityContext().getCurrentEventRoutingTask().run();				
			}
		};
		
		event.getLocalActivityContext().getExecutorService().execute(runnable);
	}
private void resume ( ) { // create runnable to resume the event context Runnable runnable = new Runnable ( ) { public void run ( ) { if ( scheduledFuture == null ) { // already resumed return ; } // cancel timer task scheduledFuture . cancel ( false ) ; scheduledFuture = null ; // send events frozen to event router again, will be processed only after this one ends (this one is already being executed) for ( EventContext ec : barriedEvents ) { ec . getLocalActivityContext ( ) . getExecutorService ( ) . routeEvent ( ec ) ; } barriedEvents = null ; // remove barrier on activity event queue event . getLocalActivityContext ( ) . getEventQueueManager ( ) . removeBarrier ( transaction ) ; // remove suspension suspended = false ; // continue routing the event related with this context event . getLocalActivityContext ( ) . getCurrentEventRoutingTask ( ) . run ( ) ; } } ; // run it using the activity executor service to avoid thread concurrency event . getLocalActivityContext ( ) . getExecutorService ( ) . execute ( runnable ) ; }
the real logic to resume the event context
the real logic to resume the event context