Re: [basedb-devel] External authentication

2011-02-01 Thread Pawel Sztromwasser
Sorry, just noticed that you mentioned the 
...basedb.util.JarClassLoader, not a regular Java class loader as I 
initially  thought.

On 01/02/11 13:17, Pawel Sztromwasser wrote:
 Thanks for a quick reply. I really wanted to avoid selecting jars and so
 on since BASE has over 50 of them, and maven downloads over 60 for my
 plugin. Lots of manual work that needs to be done every time BASE is
 upgraded.

 I will try to change the Application class as you suggested. I have
 already located the place which needs a fix, but was unsure of playing
 so close to the core of the application. What about using the
 net.sf.basedb.util.JarClassLoader, as regular plugins do?

 I will post a patch when ready and tested.
 Cheers,
 Pawel

 On 01/02/11 13:03, Nicklas Nordborg wrote:
 On 2011-02-01 11:29, Pawel Sztromwasser wrote:s
 Hi,

 I am working on an external authentication plugin for BASE that will use
 an STS Web service to authenticate users. The plugin uses a bunch of
 external jars for WS communication, but with different versions then
 BASE. I was hoping for the same classloading mechanism as for regular
 plugins (separate classloaders), but it looks like external
 authentication plugins uses the default classloader of the webapp. Could
 this be changed? How else could I install my plugin, without messing
 with BASE's jars?
 That part of BASE is not very pluginified. I am not aware of any real
 case that uses external authentication so it would be very interesting
 to see if you succeed.

 It's quite common that there are dependencies to different versions of
 3rd-party JAR files, but it usually works if the latest one is used. But
 of course, it may not work if the API has changed in an incompatible way.

 If you can't get it to work by clever selection of JAR files, then you
 might have to modify the Application.getAuthenticator() method so that
 it uses a different class loader. It shouldn't be too difficult. It
 could for example pick up a JAR path from the base.config file and then
 use the net.sf.basedb.util.JarClassLoader.getInstance(path) to create a
 class loader. Dependencies need to be listed in the MANIFEST.MF in the
 same way as for plug-ins. There is a short notice about this at
 http://base.thep.lu.se/chrome/site/latest/html/developerdoc/plugin_developer/plugin_developer.organize.html
 and
 http://base.thep.lu.se/chrome/site/latest/api/net/sf/basedb/util/JarClassLoader.html

 As always, patches are welcome :)

 /Nicklas

 --
 Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
 Finally, a world-class log management solution at an even better price-free!
 Download using promo code Free_Logger_4_Dev2Dev. Offer expires
 February 28th, so secure your free ArcSight Logger TODAY!
 http://p.sf.net/sfu/arcsight-sfd2d
 ___
 basedb-devel mailing list
 basedb-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/basedb-devel

 --
 Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
 Finally, a world-class log management solution at an even better price-free!
 Download using promo code Free_Logger_4_Dev2Dev. Offer expires
 February 28th, so secure your free ArcSight Logger TODAY!
 http://p.sf.net/sfu/arcsight-sfd2d
 ___
 basedb-devel mailing list
 basedb-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/basedb-devel


--
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
___
basedb-devel mailing list
basedb-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/basedb-devel


Re: [basedb-devel] External authentication

2011-02-01 Thread Nicklas Nordborg
On 2011-02-01 13:24, Pawel Sztromwasser wrote:
 Sorry, just noticed that you mentioned the
 ...basedb.util.JarClassLoader, not a regular Java class loader as I
 initially  thought.

Check the code for DataFileType.getValidator(): 
http://base.thep.lu.se/browser/tags/2.16.1/src/core/net/sf/basedb/core/DataFileType.java#L629

It is more or less something like that that you need.

/Nicklas

--
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
___
basedb-devel mailing list
basedb-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/basedb-devel