JBoss development,
A new message was posted in the thread "Native library mapping at jboss-cl
level":
http://community.jboss.org/message/521436#521436
Author : Adrian Brock
Profile :
http://community.jboss.org/people/adrian@jboss.org
Message:
--------------------------------------------------------------
I tidied up your commit a bit.
1) The NativeLibraryProvider should be a top level interface since it is a public spi.
2) I made the map in the ClassLoaderPolicy thread safe, i.e. I made it volatile and used
locals to get a consistent view.
The way you had it, one thread could continue to see it as null for some time after
another thread sets it.
3) I made the getNativeLibraries() method return an UnmodiableSet so that callers
can't modify the map in unpredicatble ways.
Some things that still need looking at:
1) Why are the getters public and what are they for? I'm a bit worried that somebody
could use this api to find out the location
of the native code and overwrite the file with their own dodgy code. :-)
2) I don't see any use of NativeLibraryProvider, but I am guessing you are not doing
it correctly?
They should be constructed against the ClassLoading Module and it (they) should be what
initialises the ClassLoaderPolicy.
3) What's the point of the metadata in the base code if there is nothing that actually
uses it? I expected to see something like a
NativeLibraryProviderFactory on the ClassLoading object, which the Module then uses to
turn the MetaData into Provider(s).
You could create a default one that just copies the library into ${java.io.tmpdir},
although if that is a shared temporary directory,
its not a good place to put code. ;-)
4) The xml parsing (including the xsds) and managed object annotations need adding and
testing.
--------------------------------------------------------------
To reply to this message visit the message page:
http://community.jboss.org/message/521436#521436