• Post Reply Bookmark Topic Watch Topic
  • New Topic

creating plug-ins in java  RSS feed

 
mythily prakash
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Can any one help me to create a plug in tool in java[sample].Or tell me any sites which will teach me abt plug in creation in java.

Thanks in advance,
Mythily.S
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That depends a good deal on what the plugin is supposed to do. Generally speaking, you would define an interface which the plugin needs to implement. If you want to keep all plugins in a separate directory (e.g., a "plugins" directory in your applications main directory), the app can load all Java classes in that directory which implement that interface. You would need to create your own ClassLoader (which loads classes out of that directory), and a SecurityManager that checks what those plugins are doing (since you don't necessarily know where a plugin comes from and what it does, you need to be careful in granting it privileges). So in short:
1) define an interface for the plugin to implement
2) define where the plugins are coming from (e.g. a plugins directory)
3) write a ClassLoader that loads the plugin classes
4) write a SecurityManager that governs what they are allowed to do
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think Ulf's comments above were about creating an application that will allow other developers to create plugins for it. However, the way I read your qeustion, you want to create a plug in for another application that already exists. So what do you want to write a plug-in for? Each application that allows you to add plugins has its own API for doing so. I think the best place to start is to pick an application that allows plugins developed in Java then research how to use the API for that application.

Layne
[ January 31, 2006: Message edited by: Layne Lund ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!