SHARE
TWEET

Untitled

a guest Aug 20th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class JobModule extends AbstractModule implements ServiceGuiceSupport {
  2.  
  3.         @Override
  4.         protected void configure() {
  5.             //Akka Quartz Scheduler
  6.             bind(QuartzSchedulerExtension.class).toProvider(SchedulerJobInitializer.class);
  7.  
  8.         }
  9.  
  10.         private static class SchedulerJobInitializer implements Provider<QuartzSchedulerExtension> {
  11.             private QuartzSchedulerExtension quartzSchedulerExtension;
  12.  
  13.             @Inject
  14.             public SchedulerJobInitializer(ActorSystem actorSystem) {
  15.                     this.quartzSchedulerExtension = new QuartzSchedulerExtension((ExtendedActorSystem) actorSystem);
  16.             }
  17.             @Override
  18.             public QuartzSchedulerExtension get() {
  19.                 return quartzSchedulerExtension;
  20.             }
  21.         }
  22.     }
  23.  
  24.  
  25.    //Injecting in below class and it is failing
  26.  
  27.  
  28.     public class JobScheduler {
  29.         private final ActorSystem system;
  30.         private final QuartzSchedulerExtension quartzSchedulerExtension;
  31.  
  32.         @Inject
  33.         public JobScheduler(QuartzSchedulerExtension quartzSchedulerExtension,
  34.                              ActorSystem system) {
  35.             this.quartzSchedulerExtension = quartzSchedulerExtension;
  36.             this.system=system;
  37.         }
  38.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top