Methods Summary |
---|
protected java.lang.String | getPluginIdentifier()
try
{
return script.getName (pluginCtx);
}
catch (UndeclaredThrowableException ute)
{
return "ServletPluginHelper Wrapping script '" + this.scriptName + "'";
}
|
protected java.lang.String | getPluginVersion()
try
{
System.out.println ("Version : " + script.getVersion (pluginCtx));
return script.getVersion (pluginCtx);
}
catch (UndeclaredThrowableException ute)
{
return "unknown version";
}
|
protected org.jboss.console.manager.interfaces.TreeNode | getTreeForResource(java.lang.String profile, org.jboss.console.manager.interfaces.ManageableResource resource)
try
{
TreeNode result = script.getTreeForResource (resource, pluginCtx);
// result = fixUrls (result); // no really necessary now!
return result;
}
catch (UndeclaredThrowableException ute)
{
ute.printStackTrace(); // TODO CHANGE TO LOG.DEBUG!!!
return null; // we decide for the plugin: we don't provide content
}
|
public void | init(javax.servlet.ServletConfig servletConfig)
super.init (servletConfig);
loadScript (this.scriptName);
pluginCtx = new SimplePluginContext ();
|
protected boolean | isResourceToBeManaged(org.jboss.console.manager.interfaces.ManageableResource resource)
if (checker != null)
return super.isResourceToBeManaged(resource);
else
{
try
{
return isResourceToBeManaged_Script (pm, resource);
}
catch (UndeclaredThrowableException ute)
{
ute.printStackTrace();
return false; // we decide for the plugin (not implemented by it)
}
}
|
protected boolean | isResourceToBeManaged_Script(org.jboss.console.manager.PluginManager master, org.jboss.console.manager.interfaces.ManageableResource resource)
return script.isResourceToBeManaged(resource, pluginCtx);
|
protected void | loadScript(java.lang.String scriptName)
URL url = Thread.currentThread().getContextClassLoader().getResource(scriptName);
if (url == null)
throw new IllegalArgumentException("Resource not found: " + scriptName);
interpreter = new Interpreter ();
//System.out.println(Thread.currentThread().getContextClassLoader());
interpreter.setClassLoader(Thread.currentThread().getContextClassLoader());
//interpreter.eval (new java.io.InputStreamReader (url.openStream()), new NameSpace (this.rootContextName), this.rootContextName);
interpreter.eval (new java.io.InputStreamReader (url.openStream()));
//interpreter.source (url.getFile(), new bsh.NameSpace(this.rootContextName));
script = (ScriptPlugin)interpreter.getInterface(ScriptPlugin.class);
|
public void | readConfigurationParameters(javax.servlet.ServletConfig config)
/*
try
{
this.rootContextName = config.getServletContext().getServletContextName();
log.info ("XXXXXXXXXXXXXXXXXX* * " + rootContextName);
log.info ("XXXXXXXXXXXXXXXXXX* * " + rootContextName);
}
catch (Exception ignored) {}
getRealPath("/");
*/
super.readConfigurationParameters(config);
this.scriptName = config.getInitParameter("ScriptName");
|