[
https://issues.apache.org/jira/browse/FELIX-2197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12844888#action_12844888
]
Richard S. Hall commented on FELIX-2197:
----------------------------------------
Well, why we shouldn't is because it is a containerism that adds additional API
to the framework beyond the OSGi API, which then constrains us further when it
comes to making future changes.
Still, I guess I wasn't clear. I was wondering what capability this patch
enables. Typically, a class loader hook is need to intercept byte code
definitions to rewrite them. This patch appears to simply notify someone that a
class loader was created.
BTW, should that be classLoaderCreated() rather than classLoaderCreared()?
> 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.