public void start(BootstrapContext bootstrapContext) throws ResourceAdapterInternalException {
   assertFalse("Already started", started);
   assertNotNull("bootstrapContext is null", bootstrapContext);
   assertNotNull("bootstrapContext.getWorkManager() is null", bootstrapContext.getWorkManager());
   assertNotNull(
       "bootstrapContext.getXATerminator() is null", bootstrapContext.getXATerminator());
   try {
     assertNotNull("bootstrapContext.createTimer() is null", bootstrapContext.createTimer());
   } catch (UnavailableException e) {
     throw new ResourceAdapterInternalException(
         "bootstrapContext.createTimer() threw an exception", e);
   }
 }
 public void start(BootstrapContext ctx) throws ResourceAdapterInternalException {
   log.debug("start quartz!!!");
   // First we must get a reference to a scheduler
   SchedulerFactory sf = new StdSchedulerFactory();
   try {
     holder.set(ctx.getWorkManager());
     sched = sf.getScheduler();
     SecurityActions.startScheduler(sched);
   } catch (SchedulerException e) {
     throw new ResourceAdapterInternalException(e);
   } finally {
     holder.set(null);
   }
 }
 /** Specify the JCA BootstrapContext that contains the WorkManager to delegate to. */
 @Override
 public void setBootstrapContext(BootstrapContext bootstrapContext) {
   Assert.notNull(bootstrapContext, "BootstrapContext must not be null");
   this.workManager = bootstrapContext.getWorkManager();
 }
Пример #4
0
 /**
  * This is called when a resource adapter instance is bootstrapped.
  *
  * @param ctx A bootstrap context containing references
  * @throws ResourceAdapterInternalException indicates bootstrap failure.
  */
 public void start(BootstrapContext ctx) throws ResourceAdapterInternalException {
   this.workManager = ctx.getWorkManager();
 }