Hi Mark,

On Nov 15, 2007 9:25 AM, Mark <[EMAIL PROTECTED]> wrote:
> Community,
>
> I was thinking about creating a factory class that would generate some basic
> MINA-based servers.  This system would be something analogous to the
> java.util.concurrent.Executors class and the
> java.util.concurrent.ExecutorService interface.  What I propose is to write
> a class called MinaApplicationFactory which has a bunch of static methods
> that return MinaApplication objects.  These MinaApplication objects would
> represent basic, functional MINA-based servers that could be further
> customized or just run as is.  Here is some prototype methods in the
> MinaApplicationFactory class:
>
> // would return a MinaApplication with no filters and no network protocol
> handlers
> public static MinaApplication createSimpleDataServer( int port,
> IoHandlerAdapter handler );
>
> // would return a MinaApplication binding to the specified, using no filters
> and utilize the TextLineProtocol
> public static MinaApplication createSimpleTextServer( int port,
> IoHandlerAdapter handler );
>
> // create a MinaApplication that sends data to the specified port.
> public static MinaApplication createSimpleHttpClient( int port,
> IoHandlerAdapter handler );
>
>
> The list could go on-and-on, but I thought that this might be a good idea
> for people just prototyping or for people who just want to experiment with
> simple MINA programs.  I think this could also be used for when someone
> wanted to create a client-side application.  The MinaApplication interface
> would look something like:
>
> public void startup() throws Exception;
> public int getPort();
> public IoHandlerAdapter getHandler();
>
> There would probably be a MinaApplicationImpl class that actually was
> returned from the factory class.
>
> So that is an idea I was thinking about today.  Let me know if anyone sees
> this as having any use in the MINA project.

Actually we had somewhat similar helper classes long time ago but they
were removed because they brought some complication when a user want
to customize the application.  However, we could try again from a
different viewpoint.  What do you think about starting implementation
in sandbox, show it to people and get feed back?

Cheers,
Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6

Reply via email to