📄 storefrontmemorydatabaseplugin.java
字号:
package com.free.struts.storefront.service;import javax.servlet.ServletException;import org.apache.commons.logging.Log;import org.apache.commons.logging.LogFactory;import org.apache.struts.action.ActionServlet;import org.apache.struts.action.PlugIn;import org.apache.struts.config.ModuleConfig;import com.free.struts.storefront.framework.util.IConstants;/** * <p>Title: Eclipse Plugin Development</p> * <p>Description: Free download</p> * <p>Copyright: Copyright (c) 2006</p> * <p>Company: Free</p> * @author gan.shu.man * @version 1.0 */public final class StorefrontMemoryDatabasePlugInimplements PlugIn { private ModuleConfig config = null; private Log log = LogFactory.getLog(this.getClass()); private ActionServlet servlet = null; private String serviceClassname = null; /** * Gracefully shut down this database, releasing any resources * that were allocated at initialization. */ public void destroy() { // Do Nothing } /** * Initialize and load our initial database from persistent storage. * * @param servlet The ActionServlet for this web application * @param config The ModuleConfig for our owning module * * @exception ServletException if we cannot configure ourselves correctly */ public void init(ActionServlet servlet, ModuleConfig config) throws ServletException { log.info( "Initializing memory database plug in for '" + serviceClassname + "'"); // Remember our associated configuration and servlet this.config = config; this.servlet = servlet; IStorefrontServiceFactory factory = null; try { factory = StorefrontServiceFactory.getInstance(); } catch (Exception ex) { throw new ServletException(ex.getMessage()); } // Put the Factory in the ServletContent so that it's available for client servlet.getServletContext().setAttribute( IConstants.SERVICE_FACTORY_KEY, factory); } public String getServiceClassname() { return serviceClassname; } public void setServiceClassname(String string) { serviceClassname = string; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -