1 48 49 package org.jpublish.action; 50 51 import com.anthonyeden.lib.config.Configuration; 52 import com.anthonyeden.lib.config.ConfigurationException; 53 54 60 61 public class ScriptHandlerDefinition { 62 63 private Class handlerClass; 64 private Configuration configuration; 65 66 74 75 public ScriptHandler getInstance() throws InstantiationException , 76 IllegalAccessException , ConfigurationException { 77 ScriptHandler scriptHandler = 78 (ScriptHandler) handlerClass.newInstance(); 79 scriptHandler.loadConfiguration(configuration); 80 scriptHandler.init(); 81 return scriptHandler; 82 } 83 84 89 90 public Class getHandlerClass() { 91 return handlerClass; 92 } 93 94 99 100 public void setHandlerClass(Class handlerClass) { 101 this.handlerClass = handlerClass; 102 } 103 104 109 110 public Configuration getConfiguration() { 111 return configuration; 112 } 113 114 119 120 public void loadConfiguration(Configuration configuration) { 121 this.configuration = configuration; 122 } 123 124 } 125 | Popular Tags |