You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

For Ignite marshaling to support OSGI containers, we need to make sure that on the deserializing side we use proper bundle-aware class loaders. 

ClassLoaderResolver

 

The ClassLoaderResolver should be called for every Object during serialization and deserialization and should be part of the IgniteConfiguraiton:

public interface ClassLoaderResolver {
    public Object encodeClassLoader(ClassLoader clsLdr) throws IgniteException;
    public ClassLoader decodeClassLoader(Object obj) throws IgniteException;
}

We should also provide OSGI class loader resolver out of the box: 

public class OsgiClassLoaderResolver {
    // Manifest entry names to look up bundles during deserialization.
    private Collection<String> mfEntryNames;
 
    public OsgiClassLoaderResolver() {}

    public OsgiClassLoaderResolver(Collection<String> mfEntryNames) {
        ...
    }
 
    public Object encodeClassLoader(ClassLoader clsLdr) throws IgniteException {
        // TODO
    }
    public ClassLoader decodeClassLoader(Object obj) throws IgniteException {
        // TODO
    }
}

Ignite Optional Dependencies

We need a clear path to support Ignite optional dependencies in OSGI environments.

TODO: use OSGI fragments?

Example

TODO

  • No labels