gpt4 book ai didi

org.osgi.framework.hooks.weaving.WovenClassListener类的使用及代码示例

转载 作者:知者 更新时间:2024-03-23 15:33:05 25 4
gpt4 key购买 nike

本文整理了Java中org.osgi.framework.hooks.weaving.WovenClassListener类的一些代码示例,展示了WovenClassListener类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WovenClassListener类的具体详情如下:
包路径:org.osgi.framework.hooks.weaving.WovenClassListener
类名称:WovenClassListener

WovenClassListener介绍

[英]Woven Class Listener Service.

Bundles registering this service will receive notifications whenever a WovenClass completes a WovenClass#getState() transition. Woven Class Listeners are not able to modify the woven class in contrast with WeavingHook.

Receiving a woven class in the WovenClass#TRANSFORMEDstate allows listeners to observe the modified WovenClass#getBytes() before the class has been WovenClass#DEFINED as well as the additional WovenClass#getDynamicImports()before the WovenClass#getBundleWiring() has been updated.

Woven class listeners are synchronously #modified(WovenClass)when a woven class completes a state transition. The woven class processing will not proceed until all woven class listeners are done.

If the Java runtime environment supports permissions, the caller must have ServicePermission[WovenClassListener,REGISTER] in order to register a listener.
[中]

代码示例

代码示例来源:origin: apache/felix

public void invokeWovenClassListener(
    org.osgi.framework.hooks.weaving.WovenClassListener wcl,
    org.osgi.framework.hooks.weaving.WovenClass wc)
    throws Exception
{
  if (System.getSecurityManager() != null)
  {
    Actions actions = (Actions) m_actions.get();
    actions.set(Actions.INVOKE_WOVEN_CLASS_LISTENER, wcl, wc);
    try
    {
      AccessController.doPrivileged(actions, m_acc);
    }
    catch (PrivilegedActionException e)
    {
      throw e.getException();
    }
  }
  else
  {
    wcl.modified(wc);
  }
}

代码示例来源:origin: org.eclipse/osgi

@Override
public void call(Object hook, ServiceRegistration<?> hookRegistration) throws Exception {
  if (!(hook instanceof WovenClassListener))
    return;
  try {
    ((WovenClassListener) hook).modified(WovenClassImpl.this);
  } catch (Exception e) {
    WovenClassImpl.this.container.getEventPublisher().publishFrameworkEvent(FrameworkEvent.ERROR, hookRegistration.getReference().getBundle(), e);
  }
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.osgi

@Override
public void call(Object hook, ServiceRegistration<?> hookRegistration) throws Exception {
  if (!(hook instanceof WovenClassListener))
    return;
  try {
    ((WovenClassListener) hook).modified(WovenClassImpl.this);
  } catch (Exception e) {
    WovenClassImpl.this.container.getEventPublisher().publishFrameworkEvent(FrameworkEvent.ERROR, hookRegistration.getReference().getBundle(), e);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.osgi

@Override
public void call(Object hook, ServiceRegistration<?> hookRegistration) throws Exception {
  if (!(hook instanceof WovenClassListener))
    return;
  try {
    ((WovenClassListener) hook).modified(WovenClassImpl.this);
  } catch (Exception e) {
    WovenClassImpl.this.container.getEventPublisher().publishFrameworkEvent(FrameworkEvent.ERROR, hookRegistration.getReference().getBundle(), e);
  }
}

代码示例来源:origin: com.github.veithen.cosmos/cosmos-equinox

@Override
public void call(Object hook, ServiceRegistration<?> hookRegistration) throws Exception {
  if (!(hook instanceof WovenClassListener))
    return;
  try {
    ((WovenClassListener) hook).modified(WovenClassImpl.this);
  } catch (Exception e) {
    WovenClassImpl.this.container.getEventPublisher().publishFrameworkEvent(FrameworkEvent.ERROR, hookRegistration.getReference().getBundle(), e);
  }
}

代码示例来源:origin: org.eclipse.tycho/org.eclipse.osgi

@Override
public void call(Object hook, ServiceRegistration<?> hookRegistration) throws Exception {
  if (!(hook instanceof WovenClassListener))
    return;
  try {
    ((WovenClassListener) hook).modified(WovenClassImpl.this);
  } catch (Exception e) {
    WovenClassImpl.this.container.getEventPublisher().publishFrameworkEvent(FrameworkEvent.ERROR, hookRegistration.getReference().getBundle(), e);
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.osgi

@Override
public void call(Object hook, ServiceRegistration<?> hookRegistration) throws Exception {
  if (!(hook instanceof WovenClassListener))
    return;
  try {
    ((WovenClassListener) hook).modified(WovenClassImpl.this);
  } catch (Exception e) {
    WovenClassImpl.this.container.getEventPublisher().publishFrameworkEvent(FrameworkEvent.ERROR, hookRegistration.getReference().getBundle(), e);
  }
}

代码示例来源:origin: apache/felix

return null;
case INVOKE_WOVEN_CLASS_LISTENER:
  ((org.osgi.framework.hooks.weaving.WovenClassListener) arg1).modified(
    (org.osgi.framework.hooks.weaving.WovenClass) arg2);
  return null;

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com