本文整理了Java中org.aspectj.lang.Aspects.getSingletonOrThreadAspectOf()
方法的一些代码示例,展示了Aspects.getSingletonOrThreadAspectOf()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Aspects.getSingletonOrThreadAspectOf()
方法的具体详情如下:
包路径:org.aspectj.lang.Aspects
类名称:Aspects
方法名:getSingletonOrThreadAspectOf
暂无
代码示例来源:origin: astefanutti/metrics-aspectj
/**
* Returns the singleton aspect or the percflow / percflowbelow associated with the current thread
*
* @param aspectClass
* @return
* @throws NoAspectBoundException if no such aspect
*/
public static <T> T aspectOf(Class<T> aspectClass) throws NoAspectBoundException {
try {
return (T) getSingletonOrThreadAspectOf(aspectClass).invoke(null, EMPTY_OBJECT_ARRAY);
} catch (InvocationTargetException e) {
//FIXME asc Highly temporary change to see what the build makes of it - dont use 1.4 APIs
throw new NoAspectBoundException(aspectClass.getName(), e);//e.getCause());
} catch (Exception e) {
throw new NoAspectBoundException(aspectClass.getName(), e);
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.aspectj
/**
* Returns the singleton aspect or the percflow / percflowbelow associated with the current thread
*
* @param aspectClass
* @return
* @throws NoAspectBoundException if no such aspect
*/
public static <T> T aspectOf(Class<T> aspectClass) throws NoAspectBoundException {
try {
return (T) getSingletonOrThreadAspectOf(aspectClass).invoke(null, EMPTY_OBJECT_ARRAY);
} catch (InvocationTargetException e) {
//FIXME asc Highly temporary change to see what the build makes of it - dont use 1.4 APIs
throw new NoAspectBoundException(aspectClass.getName(), e);//e.getCause());
} catch (Exception e) {
throw new NoAspectBoundException(aspectClass.getName(), e);
}
}
内容来源于网络,如有侵权,请联系作者删除!