/** * Returns the publish history list with already publish jobs.<p> * * @return a list of {@link CmsPublishJobFinished} objects */ public List<CmsPublishJobFinished> getPublishHistory() { return m_publishEngine.getPublishHistory().asList(); }
/** * Initializes the publish engine.<p> * * @param adminCms the admin cms * @param publishQueuePersistance flag if the queue is persisted * @param publishQueueShutdowntime amount of time to wait for a publish job during shutdown * * @throws CmsException if something goes wrong */ protected void initialize(CmsObject adminCms, boolean publishQueuePersistance, int publishQueueShutdowntime) throws CmsException { // check the driver manager if ((m_driverManager == null) || (m_dbContextFactory == null)) { throw new CmsPublishException(Messages.get().container(Messages.ERR_PUBLISH_ENGINE_NOT_INITIALIZED_0)); } m_publishQueueShutdowntime = publishQueueShutdowntime; // initially the engine is stopped, must be restartet after full system initialization m_engineState = CmsPublishEngineState.ENGINE_STOPPED; // read the publish history from the repository m_publishHistory.initialize(); // read the queue from the repository m_publishQueue.initialize(adminCms, publishQueuePersistance); }
/** * Called when the queue is full to remove the oldest element.<p> * * @see org.apache.commons.collections.buffer.BoundedFifoBuffer#remove() */ @Override public Object remove() { CmsPublishJobInfoBean publishJob = (CmsPublishJobInfoBean)super.remove(); try { OpenCms.getPublishManager().getEngine().getPublishHistory().remove(publishJob); } catch (CmsException exc) { if (LOG.isErrorEnabled()) { LOG.error(exc.getLocalizedMessage(), exc); } } return publishJob; } }, CmsPublishJobInfoBean.class));
m_publishHistory.add(publishJob); } catch (Throwable t) {
m_publishHistory = new CmsPublishHistory(this);
Buffer buffer = CmsPublishHistory.getQueue(size); m_publishHistory = SynchronizedBuffer.decorate(buffer); register(CmsPublishHistory.class.getName() + ".publishHistory", buffer);
m_publishHistory.add(publishJob);
m_publishHistory = new CmsPublishHistory(this);
Buffer buffer = CmsPublishHistory.getQueue(size); m_publishHistory = SynchronizedBuffer.decorate(buffer); register(CmsPublishHistory.class.getName() + ".publishHistory", buffer);
m_publishEngine.unlockPublishList(job); new CmsPublishJobEnqueued(job).m_publishJob.finish(); m_publishEngine.getPublishHistory().add(job); } catch (CmsException exc) { LOG.error(exc.getLocalizedMessage(), exc);
/** * Returns the publish history list with already publish jobs.<p> * * @return a list of {@link CmsPublishJobFinished} objects */ public List getPublishHistory() { return m_publishEngine.getPublishHistory().asList(); }
/** * Called when the queue is full to remove the oldest element.<p> * * @see org.apache.commons.collections.buffer.BoundedFifoBuffer#remove() */ @Override public Object remove() { CmsPublishJobInfoBean publishJob = (CmsPublishJobInfoBean)super.remove(); try { OpenCms.getPublishManager().getEngine().getPublishHistory().remove(publishJob); } catch (CmsException exc) { if (LOG.isErrorEnabled()) { LOG.error(exc.getLocalizedMessage(), exc); } } return publishJob; } }, CmsPublishJobInfoBean.class));
/** * Initializes the publish engine.<p> * * @param adminCms the admin cms * @param publishQueuePersistance flag if the queue is persisted * @param publishQueueShutdowntime amount of time to wait for a publish job during shutdown * * @throws CmsException if something goes wrong */ protected void initialize(CmsObject adminCms, boolean publishQueuePersistance, int publishQueueShutdowntime) throws CmsException { // check the driver manager if ((m_driverManager == null) || (m_dbContextFactory == null)) { throw new CmsPublishException(Messages.get().container(Messages.ERR_PUBLISH_ENGINE_NOT_INITIALIZED_0)); } m_publishQueueShutdowntime = publishQueueShutdowntime; // initially the engine is stopped, must be restartet after full system initialization m_engineState = CmsPublishEngineState.ENGINE_STOPPED; // read the publish history from the repository m_publishHistory.initialize(); // read the queue from the repository m_publishQueue.initialize(adminCms, publishQueuePersistance); }
m_publishEngine.unlockPublishList(job); new CmsPublishJobEnqueued(job).m_publishJob.finish(); m_publishEngine.getPublishHistory().add(job); } catch (CmsException exc) { dbc.rollback();
Iterator<CmsPublishJobFinished> itFinishedJobs = getPublishHistory().asList().iterator(); while (itFinishedJobs.hasNext()) { CmsPublishJobFinished finishedJob = itFinishedJobs.next();
getPublishHistory().add(publishJob.m_publishJob); } else { getPublishQueue().remove(publishJob.m_publishJob);
Iterator itFinishedJobs = getPublishHistory().asList().iterator(); while (itFinishedJobs.hasNext()) { CmsPublishJobFinished finishedJob = (CmsPublishJobFinished)itFinishedJobs.next();
getPublishHistory().add(publishJob.m_publishJob); } else { getPublishQueue().remove(publishJob.m_publishJob);