FileDocCategorySizeDatePackage
ServiceFactoryPlugin.javaAPI DocExample771Mon Aug 23 16:37:40 BST 2004com.oreilly.strutsckbk.ch10

ServiceFactoryPlugin.java

package com.oreilly.strutsckbk.ch10;

import javax.servlet.ServletException;

import org.apache.struts.action.ActionServlet;
import org.apache.struts.action.PlugIn;
import org.apache.struts.config.ModuleConfig;

public class ServiceFactoryPlugin implements PlugIn {

    public void init(ActionServlet servlet, ModuleConfig config) throws ServletException {
        ServiceFactory factory = new ServiceFactory();
        factory.setSecurityServiceImpl(securityService);
        servlet.getServletContext().setAttribute("APP_SERVICE_FACTORY", factory);
    }

    public void destroy() {
    }

    public void setSecurityService(String securityService) {
        this.securityService = securityService;
    }
    private String securityService;
}