RE: [PlugIn] @@#@ing ApplicationConfig changes

2002-10-22 Thread Andrew Hill
snip
In order to make org.apache.struts.config.ApplicationConfig live up to the
contract for implements Serializable, it was necessary to remove
references
to non-Serializable objects (in particular, the ActionServlet and
RequestProcessor objects).  An additional change will be necessary to the
way that plug-ins are initialized, so that the config tree is pure
configuration data, and thus can be serialized and deserialized on
containers
that do this to servlet context attributes.
WARNING:  THIS REQUIRED A SMALL CHANGE TO THE PlugIn API!  Now, the init
method signature takes two arguments (ActionServlet and ApplicationConfig)
instead of just the ApplicationConfig.  Sorry about the breakage, but it
is important to get this right before a 1.1 final release.
/snip

whinge
No wonder I was able tp see the getServlet() method in jbuilder's tooltips,
but not in the nightly build docs or my copy of the 1.1b2 source. I figured
it had been removed in the later version, but there were no comments in the
source code to indicate how the heck I could get the servlet anymore. (Didnt
occur to me till later to check the new version of the interface and the cvs
comments)

Your trying to make me get of my lazy backside and upgrade to 1.1b2 aren't
you so that I wont have to go back later and fix my code when I finally do
upgrade from b1?

Couldn't you just make getServlet() throw an UnsupportedOperation exception
then I could implement both signatures with one init() delegating to the
other?
/whinge


--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




RE: [PlugIn] @@#@ing ApplicationConfig changes

2002-10-22 Thread Andrew Hill
Not wanting to have to rewrite my code when I upgrade by struts build from
1.1b1 to 1.1b2 I have used this workaround in my plugin. In theory it should
work ok in both without having to edit my source after I upgrade:

  public void init(ApplicationConfig config) throws ServletException
  {
try
{
  Object servlet = PropertyUtils.getProperty(config,servlet);
  init((ActionServlet)servlet,config);
}
catch(Throwable t)
{
  throw new ServletException(Error in init() method,t);
}
  }

  public void init(ActionServlet servlet, ApplicationConfig config) throws
ServletException
  {
//etc...

:-)

-Original Message-
From: Andrew Hill [mailto:andrew.david.hill;gridnode.com]
Sent: Tuesday, October 22, 2002 20:09
To: Struts Users Mailing List
Subject: RE: [PlugIn] #ing ApplicationConfig changes


snip
In order to make org.apache.struts.config.ApplicationConfig live up to the
contract for implements Serializable, it was necessary to remove
references
to non-Serializable objects (in particular, the ActionServlet and
RequestProcessor objects).  An additional change will be necessary to the
way that plug-ins are initialized, so that the config tree is pure
configuration data, and thus can be serialized and deserialized on
containers
that do this to servlet context attributes.
WARNING:  THIS REQUIRED A SMALL CHANGE TO THE PlugIn API!  Now, the init
method signature takes two arguments (ActionServlet and ApplicationConfig)
instead of just the ApplicationConfig.  Sorry about the breakage, but it
is important to get this right before a 1.1 final release.
/snip

whinge
No wonder I was able tp see the getServlet() method in jbuilder's tooltips,
but not in the nightly build docs or my copy of the 1.1b2 source. I figured
it had been removed in the later version, but there were no comments in the
source code to indicate how the heck I could get the servlet anymore. (Didnt
occur to me till later to check the new version of the interface and the cvs
comments)

Your trying to make me get of my lazy backside and upgrade to 1.1b2 aren't
you so that I wont have to go back later and fix my code when I finally do
upgrade from b1?

Couldn't you just make getServlet() throw an UnsupportedOperation exception
then I could implement both signatures with one init() delegating to the
other?
/whinge


--
To unsubscribe, e-mail:
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail:
mailto:struts-user-help;jakarta.apache.org


--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org