[ 
https://issues.apache.org/jira/browse/FELIX-2197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12845360#action_12845360
 ] 

Richard S. Hall commented on FELIX-2197:
----------------------------------------

Yeah, I have no doubt that some people use Equinox specifically for its 
proprietary extensions, but I prefer to not get into that game.

Thanks for the info about the hook. I realize that there is a general need for 
this and the topic has come up in CPEG, which is why I was interested in how 
this patched worked. If I were to extend the framework, I'd like for it to be 
done in a way that provided a general solution, not one specific to Terracotta. 
But I guess if they can use it for this purpose, then other people can too.

At any rate, we'll keep this issue around, since it represents a real need.

> Please implement something like Equinox's 
> org.eclipse.osgi.baseadaptor.hooks.ClassLoadingHook
> ---------------------------------------------------------------------------------------------
>
>                 Key: FELIX-2197
>                 URL: https://issues.apache.org/jira/browse/FELIX-2197
>             Project: Felix
>          Issue Type: New Feature
>          Components: Framework
>    Affects Versions: felix-2.0.4
>         Environment: irrelevant
>            Reporter: Martin Zdila
>         Attachments: framework.patch
>
>
> Please implement something like Equinox's 
> org.eclipse.osgi.baseadaptor.hooks.ClassLoadingHook. We need it for running 
> Felix under Terracotta (there is HOWTO for Equinox: 
> http://www.terracotta.org/confluence/display/wiki/Run+with+Eclipse+Equinox). 
> We patched the Felix Framework for the workaround. The patch is attached. We 
> use it like this:
> ...
> import org.apache.felix.framework.ClassLoaderHook;
> import org.apache.felix.framework.Felix;
> import com.tc.object.bytecode.hook.impl.ClassProcessorHelper;
> import com.tc.object.loaders.NamedClassLoader;
> ...
>       final Properties properties = new Properties();
> ...
>       properties.put("classLoaderHook", new ClassLoaderHook() {
>               @Override
>               public void classLoaderCreared(final ClassLoader classLoader) {
>                       if (classLoader instanceof NamedClassLoader) {
>                               ((NamedClassLoader) 
> classLoader).__tc_setClassLoaderName(classLoader.toString());
>                               
> ClassProcessorHelper.registerGlobalLoader((NamedClassLoader) classLoader, 
> null);
>                       }
>               }
>       });
>               
>       return new Felix(properties);
> ...
> Thanks in advance.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to