opencmscore.java
来自「找了很久才找到到源代码」· Java 代码 · 共 1,617 行 · 第 1/5 页
JAVA
1,617 行
}
LOG.error(errorCondition.key(), new CmsException(errorCondition));
m_instance = null;
} else if (m_instance != null) {
// OpenCms already was successfull initialized
LOG.warn(Messages.get().getBundle().key(
Messages.LOG_INIT_INVALID_ERROR_2,
new Integer(m_instance.getRunLevel()),
errorCondition.key()));
}
}
/**
* Adds the specified request handler to the Map of OpenCms request handlers. <p>
*
* @param handler the handler to add
*/
protected void addRequestHandler(I_CmsRequestHandler handler) {
if (handler == null) {
return;
}
String[] names = handler.getHandlerNames();
for (int i = 0; i < names.length; i++) {
String name = names[i];
if (m_requestHandlers.get(name) != null) {
CmsLog.INIT.error(Messages.get().getBundle().key(Messages.LOG_DUPLICATE_REQUEST_HANDLER_1, name));
continue;
}
m_requestHandlers.put(name, handler);
if (CmsLog.INIT.isInfoEnabled()) {
CmsLog.INIT.info(Messages.get().getBundle().key(
Messages.INIT_ADDED_REQUEST_HANDLER_2,
name,
handler.getClass().getName()));
}
}
}
/**
* Returns the configured authorization handler.<p>
*
* @return the configured authorization handler
*/
protected I_CmsAuthorizationHandler getAuthorizationHandler() {
return m_authorizationHandler;
}
/**
* Returns the initialized OpenCms configuration manager.<p>
*
* @return the initialized OpenCms configuration manager
*/
protected CmsConfigurationManager getConfigurationManager() {
return m_configurationManager;
}
/**
* Returns the configured list of default directory file names.<p>
*
* @return the configured list of default directory file names
*/
protected List getDefaultFiles() {
return m_defaultFiles;
}
/**
* Returns the default user and group name configuration.<p>
*
* @return the default user and group name configuration
*/
protected CmsDefaultUsers getDefaultUsers() {
return m_defaultUsers;
}
/**
* Returns the OpenCms event manager.<p>
*
* @return the OpenCms event manager
*/
protected CmsEventManager getEventManager() {
return m_eventManager;
}
/**
* Returns the configured export points,
* the returned set being an unmodifiable set.<p>
*
* @return an unmodifiable set of the configured export points
*/
protected Set getExportPoints() {
return m_exportPoints;
}
/**
* Returns the initialized import/export manager,
* which contains information about the Cms import/export.<p>
*
* @return the initialized import/export manager
*/
protected CmsImportExportManager getImportExportManager() {
return m_importExportManager;
}
/**
* Returns the link manager to resolve links in <link> tags.<p>
*
* @return the link manager to resolve links in <link> tags
*/
protected CmsLinkManager getLinkManager() {
return m_linkManager;
}
/**
* Returns the locale manager used for obtaining the current locale.<p>
*
* @return the locale manager
*/
protected CmsLocaleManager getLocaleManager() {
return m_localeManager;
}
/**
* Returns the lock manager used for the locking mechanism.<p>
*
* @return the lock manager used for the locking mechanism
*/
protected CmsLockManager getLockManager() {
return m_securityManager.getLockManager();
}
/**
* Returns the login manager used to check the validity of a login.<p>
*
* @return the login manager
*/
protected CmsLoginManager getLoginManager() {
return m_loginManager;
}
/**
* Returns the memory monitor.<p>
*
* @return the memory monitor
*/
protected CmsMemoryMonitor getMemoryMonitor() {
return m_memoryMonitor;
}
/**
* Returns the module manager.<p>
*
* @return the module manager
*/
protected CmsModuleManager getModuleManager() {
return m_moduleManager;
}
/**
* Returns the organizational unit manager.<p>
*
* @return the organizational unit manager
*/
protected CmsOrgUnitManager getOrgUnitManager() {
return m_orgUnitManager;
}
/**
* Return the password handler.<p>
*
* @return the password handler
*/
protected I_CmsPasswordHandler getPasswordHandler() {
return m_passwordHandler;
}
/**
* Returns the path for the request.<p>
*
* First checks the {@link HttpServletRequest#getPathInfo()}, then
* the configured request error page attribute (if set), and then
* if still undefined the <code>/</code> is returned as path info.<p>
*
* This is only needed when the {@link HttpServletRequest#getPathInfo()}
* is not really working as expected like in BEA WLS 9.x, where you have
* to use the 'weblogic.servlet.errorPage' attribute.<p>
*
* @param req the hhtp request context
*
* @return the path for the request
*/
protected String getPathInfo(HttpServletRequest req) {
String path = req.getPathInfo();
if ((path == null) && (m_requestErrorPageAttribute != null)) {
// this is needed since the HttpServletRequest#getPathInfo()
path = (String)req.getAttribute(m_requestErrorPageAttribute);
if (path != null) {
int pos = path.indexOf("/", 1);
if (pos > 0) {
// cut off the servlet name
path = path.substring(pos);
}
}
}
if (path == null) {
path = "/";
}
return path;
}
/**
* Returns the publish manager instance.<p>
*
* @return the publish manager instance
*/
protected CmsPublishManager getPublishManager() {
return m_publishManager;
}
/**
* Returns the repository manager.<p>
*
* @return the repository manager
*/
protected CmsRepositoryManager getRepositoryManager() {
return m_repositoryManager;
}
/**
* Returns the handler instance for the specified name,
* or null if the name does not match any handler name.<p>
*
* @param name the name of the handler instance to return
* @return the handler instance for the specified name
*/
protected I_CmsRequestHandler getRequestHandler(String name) {
return (I_CmsRequestHandler)m_requestHandlers.get(name);
}
/**
* Returns the resource manager.<p>
*
* @return the resource manager
*/
protected CmsResourceManager getResourceManager() {
return m_resourceManager;
}
/**
* Returns the role manager.<p>
*
* @return the role manager
*/
protected CmsRoleManager getRoleManager() {
return m_roleManager;
}
/**
* Returns the runlevel of this OpenCmsCore object instance.<p>
*
* For a detailed description about the possible run levels,
* please see {@link OpenCms#getRunLevel()}.<p>
*
* @return the runlevel of this OpenCmsCore object instance
*
* @see OpenCms#getRunLevel()
*/
protected int getRunLevel() {
return m_runLevel;
}
/**
* Looks up a value in the runtime property Map.<p>
*
* @param key the key to look up in the runtime properties
* @return the value for the key, or null if the key was not found
*/
protected Object getRuntimeProperty(Object key) {
return m_runtimeProperties.get(key);
}
/**
* Returns the configured schedule manager.<p>
*
* @return the configured schedule manager
*/
protected CmsScheduleManager getScheduleManager() {
return m_scheduleManager;
}
/**
* Returns the initialized search manager,
* which provides indexing and searching operations.<p>
*
* @return the initialized search manager
*/
protected CmsSearchManager getSearchManager() {
return m_searchManager;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?