private static AsyncEventQueue createAsyncEventQueue(
      AsyncEventQueueDescription aeqd, Cache cache) {
    // configure the factory
    AsyncEventQueueFactory f = cache.createAsyncEventQueueFactory();
    log.info("Configuring async event queue factory");
    aeqd.configure(f);
    log.info("Configured async event queue factory " + f);

    // create the async event queue
    log.info("Creating and starting async event queue " + aeqd.getName());
    AsyncEventQueue queue = f.create(aeqd.getName(), aeqd.getAsyncEventListenerInstance());
    log.info("Created and started async event queue: " + asyncEventQueueToString(queue));
    return queue;
  }
 /**
  * Returns the {@link AsyncEventQueueDescription} with the given configuration name from {@link
  * AsyncEventQueuePrms#names}.
  */
 public static AsyncEventQueueDescription getAsyncEventQueueDescription(
     String asyncEventQueueConfig) {
   if (asyncEventQueueConfig == null) {
     throw new IllegalArgumentException("asyncEventQueueConfig cannot be null");
   }
   log.info("Looking up async event queue config: " + asyncEventQueueConfig);
   AsyncEventQueueDescription aeqd =
       TestConfig.getInstance().getAsyncEventQueueDescription(asyncEventQueueConfig);
   if (aeqd == null) {
     String s =
         asyncEventQueueConfig + " not found in " + BasePrms.nameForKey(AsyncEventQueuePrms.names);
     throw new HydraRuntimeException(s);
   }
   log.info("Looked up async event queue config:\n" + aeqd);
   return aeqd;
 }
Exemple #3
0
 @Override
 public void log(String message) {
   LogWriter logger = getLogWriter();
   if (logger == null) {
     printMessage("info", message);
   } else {
     logger.info(message);
   }
 }
Exemple #4
0
 @Override
 public void info(Throwable th) {
   LogWriter logger = getLogWriter();
   if (logger == null) {
     printMessage("info", getLogMessage());
     th.printStackTrace(System.out);
   } else {
     logger.info(getLogMessage(), th);
   }
 }