Esempio n. 1
0
 protected void doStart() throws ResourceManagerSystemException {
   if (persistenceStrategy != null) {
     try {
       persistenceStrategy.open();
     } catch (IOException e) {
       throw new ResourceManagerSystemException(e);
     }
   }
 }
Esempio n. 2
0
 protected boolean shutdown(int mode, long timeoutMSecs) {
   try {
     if (persistenceStrategy != null) {
       persistenceStrategy.close();
     }
   } catch (IOException e) {
     logger.error("Error closing persistent store", e);
   }
   return super.shutdown(mode, timeoutMSecs);
 }
Esempio n. 3
0
 protected void recover() throws ResourceManagerSystemException {
   if (persistenceStrategy != null) {
     try {
       List msgs = persistenceStrategy.restore();
       for (Iterator it = msgs.iterator(); it.hasNext(); ) {
         Holder h = (Holder) it.next();
         getQueue(h.getQueue()).putNow(h.getId());
       }
     } catch (Exception e) {
       throw new ResourceManagerSystemException(e);
     }
   }
 }
Esempio n. 4
0
 protected Object doLoad(QueueInfo queue, Object id) throws IOException {
   QueuePersistenceStrategy ps =
       (queue.config.persistent) ? persistenceStrategy : memoryPersistenceStrategy;
   Object obj = ps.load(queue.name, id);
   return obj;
 }
Esempio n. 5
0
 protected void doRemove(QueueInfo queue, Object id) throws IOException {
   QueuePersistenceStrategy ps =
       (queue.config.persistent) ? persistenceStrategy : memoryPersistenceStrategy;
   ps.remove(queue.name, id);
 }
Esempio n. 6
0
 protected Object doStore(QueueInfo queue, Object object) throws IOException {
   QueuePersistenceStrategy ps =
       (queue.config.persistent) ? persistenceStrategy : memoryPersistenceStrategy;
   Object id = ps.store(queue.name, object);
   return id;
 }