Must have been before I joined MINA :) I do alot of application prototyping so I think it would be useful. I will start this in my sandbox and provide status.
Thanks for the feedback. Mark On Nov 14, 2007 8:25 PM, Trustin Lee <[EMAIL PROTECTED]> wrote: > 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 > -- -------------------------------- 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
