FileDocCategorySizeDatePackage
ServletPluginHelper.javaAPI DocJBoss 4.2.13759Fri Jul 13 21:02:14 BST 2007org.jboss.console.plugins.helpers

ServletPluginHelper

public class ServletPluginHelper extends HttpServlet
see
author
Sacha Labourey.
version
$Revision: 57191 $

Revisions:

23 dec 2002 Sacha Labourey:

  • First implementation

Fields Summary
public static final String
WRAPPER_CLASS_PARAM
protected ServletConfig
config
protected PluginWrapper
wrapper
Constructors Summary
Methods Summary
protected PluginWrappercreatePluginWrapper()

      String tmp = config.getInitParameter(WRAPPER_CLASS_PARAM);
      if (tmp != null && !"".equals(tmp))
      {
         // These plugins do provide their own wrapper implementation
         //
         Class clazz = Thread.currentThread().getContextClassLoader().loadClass(tmp);
         return (PluginWrapper) (clazz.newInstance());
      }
      
      
      // Otherwise we make the hypothesis that the script provides
      // all required information
      //
      return new BasePluginWrapper ();
      
   
public voiddestroy()

      if( wrapper != null )
      {
         wrapper.destroy ();
      }
      super.destroy ();
   
public voidinit(javax.servlet.ServletConfig config)

      

   // Static --------------------------------------------------------
   
   // Constructors --------------------------------------------------
      
   // Public --------------------------------------------------------
   
   // Z implementation ----------------------------------------------
   
   // HttpServlet overrides -----------------------------------------
   
         
   
      try
      {
         super.init (config);      
         
         this.config = config;
         
         wrapper = createPluginWrapper ();      
         wrapper.init (config);      
      }
      catch (Throwable e)
      {
         //throw new ServletException ("Failed to init plugin", e);
         // @todo, cleanup the logic to display an unavailable place holder
         log("Failed to init plugin, "+e.getMessage());
      }