Exemple #1
0
  @Override
  public BundleFile wrapBundleFile(
      final BundleFile bundleFile, final Object content, final BaseData data, final boolean base)
      throws IOException {
    BundleFile wrapped = null;
    if (Debug.DEBUG_BUNDLE)
      Debug.println(
          "> AspectJBundleFileWrapperFactoryHook.wrapBundleFile() bundle="
              + data.getSymbolicName()
              + " bundleFile="
              + bundleFile
              + ", content="
              + content
              + ", data="
              + data
              + ", base="
              + base
              + ", baseFile="
              + bundleFile.getBaseFile());

    if (base) {
      wrapped = new BaseWeavingBundleFile(new BundleAdaptorProvider(data, this), bundleFile);
    } else {
      wrapped = new WeavingBundleFile(new BundleAdaptorProvider(data, this), bundleFile);
    }
    if (Debug.DEBUG_BUNDLE)
      Debug.println("< AspectJBundleFileWrapperFactoryHook.wrapBundleFile() wrapped=" + wrapped);
    return wrapped;
  }
Exemple #2
0
  /**
   * @see
   *     org.eclipse.equinox.weaving.hooks.AbstractWeavingHook#initializedClassLoader(org.eclipse.osgi.baseadaptor.loader.BaseClassLoader,
   *     org.eclipse.osgi.baseadaptor.BaseData)
   */
  @Override
  public void initializedClassLoader(final BaseClassLoader baseClassLoader, final BaseData data) {
    if (Debug.DEBUG_GENERAL)
      Debug.println(
          "> AspectJHook.initializedClassLoader() bundle="
              + data.getSymbolicName()
              + ", loader="
              + baseClassLoader
              + ", data="
              + data
              + ", bundleFile="
              + data.getBundleFile());

    final IWeavingAdaptor adaptor = createAspectJAdaptor(data);
    adaptor.setBaseClassLoader(baseClassLoader);
    adaptor.initialize();
    this.adaptors.put(data.getBundleID(), adaptor);

    if (Debug.DEBUG_GENERAL)
      Debug.println("< AspectJHook.initializedClassLoader() adaptor=" + adaptor);
  }