🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #1616

Re: Making plug in modules

#1616
From: John Baker
Date: Tue, 06 Nov 2001 17:45
44 lines
2788 bytes
As other people wrote to ask more questions about this personally, I found a
few moments to knock up an example plugin loader for an app that requires
adding plugins without too much configuration hassle.... There is a
jbuilder4 project in there for convenience.

http://www.softcomms.com/java/plugin.zip

It only does the first part of the job which is scanning a plugins directory
for plugin config files and the calling back the PluginContext (which in
reality would be the host applications that needs plugins). From this point
on it would get very application specific and more complex. There is a demo
app class which uses the loader but doesn't do anything interesting with the
config info. Any zip or directory placed in the plugins directory that has a
META-INF/plugin.properties file will be assumed to be a plugin and the host
app will get notified.

Just unzip into a new directory and run the demo class
com.softcomms.plugin.PluginDemo

You should see some output which indicates finding the extra 2 zip files in
the plugins directory (which would in reality contain more classes and
resources etc)... i.e

D:\JBuilder4\jdk1.3\bin\javaw -classpath
"C:\dev\Plugin\lib;D:\JBuilder4\jdk1.3\demo\jfc\Java2D\Java2Demo.jar;D:\JBui
lder4\jdk1.3\jre\lib\i18n.jar;D:\JBuilder4\jdk1.3\jre\lib\jaws.jar;D:\JBuild
er4\jdk1.3\jre\lib\rt.jar;D:\JBuilder4\jdk1.3\jre\lib\sunrsasign.jar;D:\JBui
lder4\jdk1.3\lib\dt.jar;D:\JBuilder4\jdk1.3\lib\tools.jar"
com.softcomms.plugin.PluginDemo

Plugin found by loader com.softcomms.plugin.PluginLoader@55af5
Plugin properties: {my.plugin.name=My Plugin!, my.plugin.class=MyPluginImpl}
Plugin found by loader com.softcomms.plugin.PluginLoader@55af5
Plugin properties: {my.plugin.name=My Plugin!, my.plugin.class=MyPluginImpl}

Hope this helps,
John
----------------------------
SoftComms Ltd.
110 Bonchurch Road
Brighton BN2 3PH
UK
Tel/Fax: + 44 (0)1273 600 785
http://www.softcomms.com
Technical Details
Message-ID: <3be81ef4_2@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!130.133.1.3!fu-berlin.de!news.boerde.de!dnews
References: <3be61f09_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,7c97ac1429a802dc
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2001-11-06 09:40:34 PST
From: "John Baker" <jbaker@SoftComms.com>
Newsgroups: borland.public.jbuilder.java.api
References: <3be61f09_1@dnews>
Subject: Re: Making plug in modules
Date: Tue, 6 Nov 2001 17:45:53 -0000
Lines: 49
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MIMEOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
NNTP-Posting-Host: 217.134.199.229
Message-ID: <3be81ef4_2@dnews>
X-Trace: dnews 1005068020 217.134.199.229 (6 Nov 2001 09:33:40 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!130.133.1.3!fu-berlin.de!news.boerde.de!dnews