1 // Copyright (c) 2003-2007, Jodd Team (jodd.sf.net). All Rights Reserved.2 3 package jodd.madvoc;4 5 import jodd.petite.PetiteContainer;6 import jodd.petite.config.AutomagicPetiteConfig;7 import jodd.madvoc.interceptor.ActionInterceptor;8 9 import javax.servlet.ServletContext ;10 11 /**12 * {@link WebApplication} that uses {@link jodd.petite.PetiteContainer} for13 * retreiving all instances.14 */15 public class PetiteWebApplication extends WebApplication {16 17 protected PetiteContainer pc;18 19 public PetiteContainer getPetiteContainer() {20 return pc;21 }22 23 public PetiteWebApplication(ServletContext servletContext) {24 super(servletContext);25 pc = new PetiteContainer();26 AutomagicPetiteConfig configurator = new AutomagicPetiteConfig();27 configurator.configure(pc);28 }29 30 @Override 31 public ActionInterceptor buildInterceptor(Class <? extends ActionInterceptor> actionInterceptorClass) {32 return (ActionInterceptor) pc.create(actionInterceptorClass);33 }34 35 @Override 36 public Object buildAction(ActionConfig actionConfig) {37 return pc.create(actionConfig.actionClass);38 }39 }40