📄 enginesregistry.java
字号:
//// ____.// __/\ ______| |__/\. _______// __ .____| | \ | +----+ \// _______| /--| | | - \ _ | : - \_________// \\______: :---| : : | : | \________>// |__\---\_____________:______: :____|____:_____\// /_____|//// . . . i n j a h i a w e t r u s t . . .////// EnginesRegistry// EV 19.11.2000// AK 14.12.2000 temporary solution to catch getEngine() fault.// AK 14.12.2000 add the core engine.// AK 19.12.2000 add the managefield engine.// DJ 07.02.2001 added logout engine.//// init()// getEngine( name )//package org.jahia.registries;import java.util.*; // HashTableimport org.jahia.utils.*; // JahiaConsolepublic class EnginesRegistry { private static EnginesRegistry theObject = null; private Hashtable theRegistry; /*** * constructor * EV 19.11.2000 * */ private EnginesRegistry() { JahiaConsole.println( "Registry", "***** Starting Engines Registry *****" ); } // end constructor /*** * getInstance * EV 19.11.2000 * */ public static synchronized EnginesRegistry getInstance() { if (theObject == null) { theObject = new EnginesRegistry(); } return theObject; } // end getInstance /*** * init * EV 19.11.2000 * FIXME : load registry from database ? * AK 14.12.2000 : add the core engine... * AK 19.12.2000 : add the managefield engine... * * called from init() method in Jahia servlet * */ public void init() { //////////////////////////////////////////////////////////////////////////////////////// // FIXME -Fulco- : // There is not error check in the lines below. An engine getInstance() method // might return a null reference! Trying to add a null object in a hashtable will // raise an NullPointerException !! //////////////////////////////////////////////////////////////////////////////////////// theRegistry = new Hashtable(); theRegistry.put( "core", org.jahia.engines.core.Core_Engine.getInstance() ); theRegistry.put( "updatefield", org.jahia.engines.updatefield.UpdateField_Engine.getInstance() ); theRegistry.put( "addcontainer", org.jahia.engines.addcontainer.AddContainer_Engine.getInstance() ); theRegistry.put( "updatecontainer", org.jahia.engines.updatecontainer.UpdateContainer_Engine.getInstance() ); theRegistry.put( "deletecontainer", org.jahia.engines.deletecontainer.DeleteContainer_Engine.getInstance() ); theRegistry.put( "downloadtemplate", org.jahia.engines.downloadtemplate.DownloadTemplate_Engine.getInstance() ); theRegistry.put( "selectdatasource", org.jahia.engines.selectdatasource.SelectDataSource_Engine.getInstance() ); theRegistry.put( "datasourcefield", org.jahia.engines.datasourcefield.DataSourceField_Engine.getInstance() ); theRegistry.put( "viewdatasourceid", org.jahia.engines.viewdatasourceid.ViewDataSourceID_Engine.getInstance() ); theRegistry.put( "search", org.jahia.engines.search.Search_Engine.getInstance() ); theRegistry.put( "login", org.jahia.engines.login.Login_Engine.getInstance() ); theRegistry.put( "logout", org.jahia.engines.logout.Logout_Engine.getInstance() ); theRegistry.put( "filemanager", org.jahia.engines.filemanager.Filemanager_Engine.getInstance() ); theRegistry.put( "pageproperties", org.jahia.engines.pages.PageProperties_Engine.getInstance() ); theRegistry.put( "containerlistproperties", org.jahia.engines.containerlistproperties.ContainerListProperties_Engine.getInstance() ); theRegistry.put( "sitemap", org.jahia.engines.sitemap.SiteMap_Engine.getInstance() ); theRegistry.put( "applications", org.jahia.engines.applications.Applications_Engine.getInstance() ); theRegistry.put( "copytree", org.jahia.engines.copytree.CopyTree_Engine.getInstance() ); theRegistry.put( "sites", org.jahia.engines.sites.Sites_Engine.getInstance() ); theRegistry.put( "template", org.jahia.engines.template.Template_Engine.getInstance() ); theRegistry.put( "selectUG", org.jahia.engines.users.SelectUG_Engine.getInstance() ); } // end init /*** * getEngine * EV 19.11.2000 * AK 14.12.2000 : temporary solution to catch getEngine() fault. * if the engine doesn't exist, core is selected... * */ public Object getEngine( String engineName ) { Object engineToGet = theRegistry.get( engineName ); if(engineToGet == null) { engineToGet = theRegistry.get( "core" ); } return engineToGet; } // end getEngine} // end EnginesRegistry
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -