Hi all,
I'm trying to implement some plug-in mechanism for my app, but I do not have
a whole picture in mind.
I hava an abstract class defined in my app's classpath for a plug-in to extend.
A plug-in also needs to access some global objects and to use some helper class
in my app. A plug-in implementation may require several related classes and users may organize them in a package hierarchy. Plug-ins can be loaded dynamically.
My questions are:
1) How am I supposed to present those global objects and those helper classes
in my app to a plug-in?
2) Use reflections to check a plug-in implements rigth abstract functions?
2) If I want to group plug-in implementation classes into a JAR and then use
URLClassLoader to load it in, is there anything I need to pay attention to?
I'm asking because I heard other people have trouble with ClassNotFoundException or NoClassDefFoundError.
Thanks
I'm trying to implement some plug-in mechanism for my app, but I do not have
a whole picture in mind.
I hava an abstract class defined in my app's classpath for a plug-in to extend.
A plug-in also needs to access some global objects and to use some helper class
in my app. A plug-in implementation may require several related classes and users may organize them in a package hierarchy. Plug-ins can be loaded dynamically.
My questions are:
1) How am I supposed to present those global objects and those helper classes
in my app to a plug-in?
2) Use reflections to check a plug-in implements rigth abstract functions?
2) If I want to group plug-in implementation classes into a JAR and then use
URLClassLoader to load it in, is there anything I need to pay attention to?
I'm asking because I heard other people have trouble with ClassNotFoundException or NoClassDefFoundError.
Thanks