/** * Checks if the queue is empty.<p> * * @return <code>true</code> if the queue is empty */ protected boolean isEmpty() { return ((OpenCms.getMemoryMonitor() == null) || (OpenCms.getMemoryMonitor().getFirstCachedPublishJob() == null)); }
/** * Checks if the queue is empty.<p> * * @return <code>true</code> if the queue is empty */ protected boolean isEmpty() { return ((OpenCms.getMemoryMonitor() == null) || (OpenCms.getMemoryMonitor().getFirstCachedPublishJob() == null)); }
/** * Returns an object from the cache.<p> * * @param owner the owner class of the cached object (used to ensure keys don't overlap) * @param key the key to lookup the object for * * @return an object from the cache, or <code>null</code> if no object matches the given key */ public Object getCachedObject(Class<?> owner, String key) { key = owner.getName().concat(key); return OpenCms.getMemoryMonitor().getCachedMemObject(key); }
/** * Returns the direct lock of a resource.<p> * * @param resourcename the name of the resource * * @return the direct lock of the resource or <code>null</code> */ private CmsLock getDirectLock(String resourcename) { return OpenCms.getMemoryMonitor().getCachedLock(resourcename); }
/** * @see org.opencms.cache.CmsVfsCache#flush(boolean) */ @Override protected void flush(boolean online) { OpenCms.getMemoryMonitor().flushCache(CmsMemoryMonitor.CacheType.VFS_OBJECT); }
/** * Puts an object into the cache.<p> * * @param owner the owner class of the cached object (used to ensure keys don't overlap) * @param key the key to store the object at * @param value the object to store */ public void putCachedObject(Class<?> owner, String key, Object value) { key = owner.getName().concat(key); OpenCms.getMemoryMonitor().cacheMemObject(key, value); }
/** * Returns an object from the cache.<p> * * @param owner the owner class of the cached object (used to ensure keys don't overlapp) * @param key the key to lookup the object for * * @return an object from the cache, or <code>null</code> if no object matches the given key */ public Object getCachedObject(Class owner, String key) { key = owner.getName().concat(key); return OpenCms.getMemoryMonitor().getCachedMemObject(key); }
/** * Returns the direct lock of a resource.<p> * * @param resourcename the name of the resource * * @return the direct lock of the resource or <code>null</code> */ private CmsLock getDirectLock(String resourcename) { return OpenCms.getMemoryMonitor().getCachedLock(resourcename); }
/** * Puts an object into the cache.<p> * * @param owner the owner class of the cached object (used to ensure keys don't overlapp) * @param key the key to store the object at * @param value the object to store */ public void putCachedObject(Class owner, String key, Object value) { key = owner.getName().concat(key); OpenCms.getMemoryMonitor().cacheMemObject(key, value); }
/** * Returns the next publish job to be published, removing it * from the queue, or <code>null</code> if the queue is empty.<p> * * @return the next publish job to be published */ protected CmsPublishJobInfoBean next() { CmsPublishJobInfoBean publishJob = OpenCms.getMemoryMonitor().getFirstCachedPublishJob(); if (publishJob != null) { OpenCms.getMemoryMonitor().uncachePublishJob(publishJob); } return publishJob; }
/** * Returns the next publish job to be published, removing it * from the queue, or <code>null</code> if the queue is empty.<p> * * @return the next publish job to be published */ protected CmsPublishJobInfoBean next() { CmsPublishJobInfoBean publishJob = OpenCms.getMemoryMonitor().getFirstCachedPublishJob(); if (publishJob != null) { OpenCms.getMemoryMonitor().uncachePublishJob(publishJob); } return publishJob; }
/** * Returns an unmodifiable list representation of this list.<p> * * @return a list of {@link CmsPublishJobFinished} objects */ protected List asList() { List cachedPublishJobs = OpenCms.getMemoryMonitor().getAllCachedPublishJobsInHistory(); List result = new ArrayList(cachedPublishJobs.size()); Iterator it = cachedPublishJobs.iterator(); while (it.hasNext()) { CmsPublishJobInfoBean publishJob = (CmsPublishJobInfoBean)it.next(); result.add(new CmsPublishJobFinished(publishJob)); } return Collections.unmodifiableList(result); }
/** * Puts an object into the cache.<p> * * @param cms the CmsObject * @param rootPath the rootPath of the VFS resource to store the object for * @param value the object to store */ public void putCachedObject(CmsObject cms, String rootPath, Object value) { String key = getCacheKeyForCurrentProject(cms, rootPath); OpenCms.getMemoryMonitor().cacheVfsObject(key, value); }
/** * Return an object from the cache.<p> * * @param cms the current users OpenCms context * @param rootPath the rootPath of the VFS resource to get the object for * @return object form cache or null */ public Object getCachedObject(CmsObject cms, String rootPath) { String key = getCacheKeyForCurrentProject(cms, rootPath); return OpenCms.getMemoryMonitor().getCachedVfsObject(key); }
/** * Clean up at shutdown time. Only intended to be called at system shutdown.<p> * * @see org.opencms.main.OpenCmsCore#shutDown */ public void shutdown() { if (OpenCms.getMemoryMonitor() != null) { // prevent accidental calls return; } flush(true); flush(false); }
/** * Return an object from the cache.<p> * * @param cms the current users OpenCms context * @param rootPath the rootPath of the VFS resource to get the object for * @return object form cache or null */ public Object getCachedObject(CmsObject cms, String rootPath) { String key = getCacheKeyForCurrentProject(cms, rootPath); return OpenCms.getMemoryMonitor().getCachedVfsObject(key); }
/** * Puts an object into the cache.<p> * * @param cms the CmsObject * @param rootPath the rootPath of the VFS resource to store the object for * @param value the object to store */ public void putCachedObject(CmsObject cms, String rootPath, Object value) { String key = getCacheKeyForCurrentProject(cms, rootPath); OpenCms.getMemoryMonitor().cacheVfsObject(key, value); }
/** * Aborts the given publish job.<p> * * @param publishJob the publish job to abort * * @return <code>true</code> if the publish job was found */ protected boolean abortPublishJob(CmsPublishJobInfoBean publishJob) { if (OpenCms.getMemoryMonitor().getCachedPublishJob(publishJob.getPublishHistoryId().toString()) != null) { // remove publish job from cache OpenCms.getMemoryMonitor().uncachePublishJob(publishJob); return true; } else { return false; } }
/** * Clears the caches in the locale manager.<p> */ private void clearCaches() { // flush all caches OpenCms.getMemoryMonitor().flushCache(CmsMemoryMonitor.CacheType.LOCALE); CmsResourceBundleLoader.flushBundleCache(); if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_LOCALE_MANAGER_FLUSH_CACHE_1, "EVENT_CLEAR_CACHES")); } }
/** * Clears the caches in the locale manager.<p> */ private void clearCaches() { // flush all caches OpenCms.getMemoryMonitor().flushCache(CmsMemoryMonitor.CacheType.LOCALE); CmsResourceBundleLoader.flushBundleCache(); if (LOG.isDebugEnabled()) { LOG.debug(Messages.get().getBundle().key(Messages.LOG_LOCALE_MANAGER_FLUSH_CACHE_1, "EVENT_CLEAR_CACHES")); } }