Harm, > I want to be able to configure which handler a particular directory watcher MBean uses. > Therefore I thought it might be a good idea to make the Handler class a MBean aswel.
One simple solution might be to create a HandlerFactory that knows the mapping of the different file types to the Handlers that handle them. Your code might look like this: Handler handler = HandlerFactory.createHandler(File file); But I'm confused about your wish to be able to specify which kind of Handler is used by a specific Watcher. If that is the case, why not just give the Watcher the name of the class it has to instantiate as a parameter? -- Jeroen > > There are about 20 different handlers but they all implement > the interface > Handler.java: > > public interface Handler { > public void handle(File file); > } > > I have written all the code... But don't know where to go > from here.... > How can I instantiate the right Handler and call its > 'handle()' method? > > All ideas are more then welcome, > > Thanks, > > Harm de Laat > Informatiefabriek > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_06 1203_01/01 _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01 _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user