have you looked into jpf - java plugin framework? that should do it.

if you are already using spring then this is trivial - applicationcontext has a getBeansOfType method and if you dont want to use spring's xml config then there is spring-annotations project that like ejb3 lets you annotate classes with @Bean

pico is nice, i used it a lot in the past. nano has always been a big mess. im not sure what you need is covered by nano though - and that is the discovery bit.

what you might also do is what we do for wicket's initializers. we have a specially named fine " wicket.properties" that inside has an attrib that points to the class name. similarly you can have something like plugin.properties with class=com.my.class inside, it is trivial to discover all such plugin.properties files on the classpath.

-igor


On 10/29/06, Karl M. Davis <[EMAIL PROTECTED]> wrote:
Hey there all,
 
Sorry for being slightly off-topic but I was hoping someone here might be able to point me in the right direction.  I'd like my wicket app to support plugins.  What I need is a way to dynamically discover what plugins are available to be instantiated.  A plugin in this case would be anything that implements the IPlugin interface.  Specifically, I'd need a way to do the following:
 
Set<Class<IPlugin>> getAvailablePlugins()
{
    // look through the classpath for all implementations of IPlugin and return the classes...
}
 
I'm hoping for something fairly lightweight that can do this without a bunch of XML config files, etc.  I was looking at Pico which seems to be as lightweight as I'd like but was a little short on documentation (I think its Nano subproject might be able to do it, but there weren't any examples).
 
Anyone have some advice/experience?  Am I going about this all wrong?
 
Thanks!
Karl

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to