You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Jean-Louis MONTEIRO (JIRA)" <ji...@apache.org> on 2012/10/08 10:02:04 UTC

[jira] [Updated] (TOMEE-420) install a ClassLoaderEnricher

     [ https://issues.apache.org/jira/browse/TOMEE-420?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jean-Louis MONTEIRO updated TOMEE-420:
--------------------------------------

    Fix Version/s:     (was: 1.5.0)
                   1.5.1
    
> install a ClassLoaderEnricher
> -----------------------------
>
>                 Key: TOMEE-420
>                 URL: https://issues.apache.org/jira/browse/TOMEE-420
>             Project: TomEE
>          Issue Type: Improvement
>            Reporter: Romain Manni-Bucau
>             Fix For: 1.5.1
>
>
> 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