1 16 package org.apache.cocoon.components.language.programming.java; 17 18 import org.apache.avalon.framework.configuration.DefaultConfiguration; 19 import org.apache.avalon.framework.component.ComponentManager; 20 import org.apache.avalon.framework.context.Context; 21 22 import org.apache.avalon.excalibur.component.ComponentHandler; 23 import org.apache.avalon.excalibur.component.RoleManager; 24 import org.apache.avalon.excalibur.component.LogkitLoggerManager; 25 26 import org.apache.cocoon.components.language.generator.CompiledComponent; 27 import org.apache.cocoon.components.language.programming.Program; 28 29 36 public class JavaProgram implements Program { 37 38 protected Class program; 39 40 public JavaProgram(Class program) { 41 this.program = program; 42 } 43 44 public String getName() { 45 return program.getName(); 46 } 47 48 public ComponentHandler getHandler(ComponentManager manager, 49 Context context, 50 RoleManager roles, 51 LogkitLoggerManager logKitManager) 52 throws Exception { 53 54 return ComponentHandler.getComponentHandler( 55 program, 56 new DefaultConfiguration("", "GeneratorSelector"), 57 manager, context, roles, logKitManager, null, "N/A"); 58 } 59 60 public CompiledComponent newInstance() throws Exception { 61 return (CompiledComponent)this.program.newInstance(); 62 } 63 } 64 | Popular Tags |