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.
Thanks
Mark
--
--------------------------------
The adjuration to be "normal" seems shockingly repellent to me; I see
neither hope nor comfort in sinking to that low level. I think it is
ignorance that makes people think of abnormality only with horror and allows
them to remain undismayed at the proximity of "normal" to average and
mediocre. For surely anyone who achieves anything is, essentially, abnormal.
Dr. Karl Menninger