james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harmeet Bedi" <harm...@kodemuse.com>
Subject Re: CommandMap for Handlers
Date Wed, 07 Aug 2002 01:36:11 GMT
From: "Noel J. Bergman" <noel@devtech.com>
> If I understood your point, the reflection idea can be built by adding a
> specialized subclass of my CommandMap with a method that populates the

A little more than that, methods can be treated as objects and a method can
invoked from another method based on reflection and command name. The idea
was to have the benfits of command map pattern, without any need of creating
additional objects.

so instead of
if ( command.equals("DATA") )
  doData(arg1....)
else if ( command.equals("USER") )
  doUSER(arg1....)
etc. etc.

do
----
Method cmd = methodMap.get(<command>);
cmd.invoke(this,< args..>);
---

methodMap can be built in static initializer or lazily built once, based on
class reflection.

Harmeet
----- Original Message -----
From: "Noel J. Bergman" <noel@devtech.com>


> I addressed the timeout handling addressed in a separate thread.
>
> If I understood your point, the reflection idea can be built by adding a
> specialized subclass of my CommandMap with a method that populates the
> command map with command objects based upon inspecting the class for
methods
> matching a convention.  The command objects would simply invoke the target
> method on the target object using the specified calling convention.
>
> --- Noel
>
>
> --
> To unsubscribe, e-mail:
<mailto:james-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:james-dev-help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:james-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:james-dev-help@jakarta.apache.org>


Mime
View raw message