1 16 19 20 package org.apache.pluto.portalImpl.core; 21 22 import org.apache.pluto.portalImpl.factory.InformationProviderFactory; 23 import org.apache.pluto.services.information.DynamicInformationProvider; 24 import org.apache.pluto.services.information.InformationProviderService; 25 import org.apache.pluto.services.information.StaticInformationProvider; 26 27 public class InformationProviderServiceFactoryImpl implements InformationProviderFactory, InformationProviderService { 28 29 private javax.servlet.ServletConfig servletConfig; 30 31 34 public StaticInformationProvider getStaticProvider() 35 { 36 javax.servlet.ServletContext context = servletConfig.getServletContext(); 37 38 StaticInformationProvider provider = (StaticInformationProvider)context.getAttribute( 39 "org.apache.pluto.portalImpl.StaticInformationProvider" 40 ); 41 42 if (provider == null) { 43 provider = new StaticInformationProviderImpl(servletConfig); 44 context.setAttribute("org.apache.pluto.portalImpl.StaticInformationProvider", provider); 45 } 46 47 return provider; 48 } 49 50 public DynamicInformationProvider getDynamicProvider(javax.servlet.http.HttpServletRequest request) 51 { 52 DynamicInformationProvider provider = 53 (DynamicInformationProvider)request.getAttribute("org.apache.pluto.portalImpl.DynamicInformationProvider"); 54 55 if (provider == null) { 56 provider = new DynamicInformationProviderImpl(request, 57 servletConfig); 58 request.setAttribute("org.apache.pluto.portalImpl.DynamicInformationProvider", provider); 59 } 60 61 return provider; 62 } 63 64 65 67 public void init(javax.servlet.ServletConfig config, java.util.Map properties) throws Exception 68 { 69 servletConfig = config; 70 } 71 72 public void destroy() throws Exception 73 { 74 } 75 76 } 77 | Popular Tags |