I see your point. Maybe I should clarify myself a bit.
Each handler has it's own configuration.
For instance there is an email-handler. Which sends an email to a specific
email-address when a file arrives in the 'watched' directory.
The handler also has some other attributes such as the subject of the
email message, reply-to address and so on....
Therefore I would like to make my Handler class a MBean. So I can easily
set these properties using the JMXConsole. (Also taking advantage of
persistent attributes, etc)...
That is why I would like to lookup the Handler class using the
MBeanServer.
But, from the documentation I only see a way to get the class over RMI.
(RMIAdaptor).
But, since I'm on the same VM, I think this will not be nessecary.
What would be the way to go here?
Thanks in advance,
Harm de Laat
Informatiefabriek
[EMAIL PROTECTED]
Sent by: [EMAIL PROTECTED]
07/01/2003 09:35 AM
Please respond to
[EMAIL PROTECTED]
To
[EMAIL PROTECTED]
cc
Subject
RE: [JBoss-user] JMX MBean question
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
-------------------------------------------------------
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