You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Romain Manni-Bucau (JIRA)" <ji...@apache.org> on 2012/09/19 16:34:07 UTC
[jira] [Closed] (TOMEE-420) install a ClassLoaderEnricher
[ https://issues.apache.org/jira/browse/TOMEE-420?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Romain Manni-Bucau closed TOMEE-420.
------------------------------------
Resolution: Fixed
> install a ClassLoaderEnricher
> -----------------------------
>
> Key: TOMEE-420
> URL: https://issues.apache.org/jira/browse/TOMEE-420
> Project: TomEE
> Issue Type: New Feature
> Reporter: Romain Manni-Bucau
> Fix For: 1.1.0
>
>
> ClassLoaderEnricher component (manage a list of url to add to app classloaders)
> Common usage: SystemInstance.get().getComponent(ClassLoaderEnricher.class).addUrl(url);
> Designed to be used with Services:
> public void initEnricher(@Observes final ObserverAdded event) {
> File dir = new File(path);
> if (dir.exists()) {
> final File[] libs = dir.listFiles();
> if (libs != null) {
> final ClassLoaderEnricher enricher = SystemInstance.get().getComponent(ClassLoaderEnricher.class);
> for (File lib : libs) {
> try {
> enricher.addUrl(lib.toURI().toURL());
> } catch (MalformedURLException e) {
> throw new OpenEJBRuntimeException(e);
> }
> }
> }
> }
> }
> This one is provided by default for instance:
> enricher = new://Service?class-name=org.apache.openejb.assembler.classic.AdditionalLibClassLoaderEnricherObserver
> enricher.path = /my/additional-lib/
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira