/** * Returns the current running publish job.<p> * * @return the current running publish job */ public CmsPublishJobRunning getCurrentPublishJob() { if (m_publishEngine.getCurrentPublishJob() == null) { return null; } return new CmsPublishJobRunning(m_publishEngine.getCurrentPublishJob().getPublishJob()); }
/** * @see org.opencms.report.A_CmsReportThread#getReportUpdate() */ @Override public String getReportUpdate() { return getReport().getReportUpdate(); }
/** * Abandons the given publish thread.<p> */ public void abandonThread() { if (!m_currentPublishThread.isAlive()) { // thread is dead if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_PUBLISH_ENGINE_DEAD_JOB_0)); } } else { // thread is not dead, and we suppose it hangs :( if (LOG.isWarnEnabled()) { LOG.warn( Messages.get().getBundle().key( Messages.LOG_THREADSTORE_PUBLISH_THREAD_INTERRUPT_2, m_currentPublishThread.getName(), m_currentPublishThread.getUUID())); } m_currentPublishThread.interrupt(); } // just throw it away m_currentPublishThread = null; // and try again checkCurrentPublishJobThread(); }
m_publishJob.start(getUUID()); if (isAborted()) { return; includingFiles = getStrongLinkReferences(); CmsDbContext dbc = m_publishEngine.getDbContext(getCms().getRequestContext()); try { m_publishEngine.getDriverManager().publishJob(getCms(), dbc, m_publishJob.getPublishList(), m_report); } catch (Throwable e) { dbc = null; if (m_updateSessionInfo) { OpenCms.getSessionManager().updateSessionInfos(getCms()); m_publishEngine.publishJobFinished(getPublishJob()); } catch (Throwable e) { LOG.error(e.getMessage(), e);
m_currentPublishThread = new CmsPublishThread(this, publishJob); m_currentPublishThread.start(); } else { if (m_currentPublishThread.isAlive()) { if (m_currentPublishThread.isInterrupted()) { unlockPublishList(m_currentPublishThread.getPublishJob()); } catch (CmsException exc) { LOG.error(exc.getLocalizedMessage(), exc);
|| !publishJob.m_publishJob.equals(m_currentPublishThread.getPublishJob())) { m_currentPublishThread.abort(); } else if (m_shuttingDown && (m_currentPublishThread != null)) { I_CmsReport report = m_currentPublishThread.getReport(); report.println(); report.println();
m_currentPublishThread = new CmsPublishThread(this, publishJob); m_currentPublishThread.start(); } else { if (m_currentPublishThread.isAlive()) {
/** * Creates a thread that start a new publish job with the given information.<p> * * @param publishEngine the publish engine instance * @param publishJob the publish job to process * * @see org.opencms.publish.CmsPublishManager#getPublishList(org.opencms.file.CmsObject, org.opencms.file.CmsResource, boolean) * @see org.opencms.publish.CmsPublishManager#getPublishList(org.opencms.file.CmsObject) */ protected CmsPublishThread(CmsPublishEngine publishEngine, CmsPublishJobInfoBean publishJob) { super(publishJob.getCmsObject(), Messages.get().getBundle().key(Messages.GUI_PUBLISH_TRHEAD_NAME_0)); m_publishJob = publishJob; m_publishEngine = publishEngine; // if the project to publish is a temporary project if (getCms().getRequestContext().getCurrentProject().getType() == CmsProject.PROJECT_TYPE_TEMPORARY) { // we have to update the user info after publishing m_updateSessionInfo = true; } else { m_updateSessionInfo = false; } try { m_jspLoader = (CmsJspLoader)OpenCms.getResourceManager().getLoader(CmsJspLoader.RESOURCE_LOADER_ID); } catch (ArrayIndexOutOfBoundsException e) { // ignore, loader not configured } }
if ((m_currentPublishThread != null) && (m_currentPublishThread.isAborted())) {
m_publishJob.start(getUUID()); if (isAborted()) { return; CmsDbContext dbc = m_publishEngine.getDbContextFactory().getDbContext(getCms().getRequestContext()); try { CmsDbContext dbc = m_publishEngine.getDbContextFactory().getDbContext(getCms().getRequestContext()); try { m_publishEngine.getDriverManager().publishJob(getCms(), dbc, m_publishJob.getPublishList(), m_report); dbc = null; if (m_updateSessionInfo) { OpenCms.getSessionManager().updateSessionInfos(getCms()); m_publishEngine.publishJobFinished(getPublishJob()); } catch (CmsException exc) { LOG.error(exc.getLocalizedMessage(), exc);
if ((m_currentPublishThread == null) || !publishJob.m_publishJob.equals(m_currentPublishThread.getPublishJob())) { m_currentPublishThread.abort(); } else if (m_shuttingDown && (m_currentPublishThread != null)) { I_CmsReport report = m_currentPublishThread.getReport(); report.println(); report.println();
/** * Creates a thread that start a new publish job with the given information.<p> * * @param publishEngine the publish engine instance * @param publishJob the publish job to process * * @see org.opencms.publish.CmsPublishManager#getPublishList(org.opencms.file.CmsObject, org.opencms.file.CmsResource, boolean) * @see org.opencms.publish.CmsPublishManager#getPublishList(org.opencms.file.CmsObject) */ protected CmsPublishThread(CmsPublishEngine publishEngine, CmsPublishJobInfoBean publishJob) { super(publishJob.getCmsObject(), Messages.get().getBundle().key(Messages.GUI_PUBLISH_TRHEAD_NAME_0)); m_publishJob = publishJob; m_publishEngine = publishEngine; // if the project to publish is a temporary project if (getCms().getRequestContext().currentProject().getType() == CmsProject.PROJECT_TYPE_TEMPORARY) { // we have to update the user info after publishing m_updateSessionInfo = true; } else { m_updateSessionInfo = false; } try { m_jspLoader = (CmsJspLoader)OpenCms.getResourceManager().getLoader(CmsJspLoader.RESOURCE_LOADER_ID); } catch (ArrayIndexOutOfBoundsException e) { // ignore, loader not configured } }
/** * Returns the current running publish job.<p> * * @return the current running publish job */ public CmsPublishJobRunning getCurrentPublishJob() { if (m_publishEngine.getCurrentPublishJob() == null) { return null; } return new CmsPublishJobRunning(m_publishEngine.getCurrentPublishJob().getPublishJob()); }
CmsDbContext dbc = m_publishEngine.getDbContext(getCms().getRequestContext()); try {
/** * @see org.opencms.report.A_CmsReportThread#getReportUpdate() */ @Override public String getReportUpdate() { return getReport().getReportUpdate(); }
CmsPublishJobInfoBean publishJob = m_currentPublishThread.getPublishJob(); try { abortPublishJob(m_adminUserId, new CmsPublishJobEnqueued(publishJob), false);
&& m_currentPublishThread.getPublishJob().getPublishHistoryId().equals(publishHistoryId)) { return new CmsPublishJobRunning(m_currentPublishThread.getPublishJob());
&& m_currentPublishThread.getPublishJob().getPublishHistoryId().equals(publishHistoryId)) { return new CmsPublishJobRunning(m_currentPublishThread.getPublishJob());
CmsPublishJobInfoBean publishJob = m_currentPublishThread.getPublishJob(); try { abortPublishJob(m_adminUserId, new CmsPublishJobEnqueued(publishJob), false);