net.sf.cglib.proxy.Factory.getCallbacks()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(83)

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

Factory.getCallbacks介绍

[英]Get the current set of callbacks for ths object.
[中]获取对象的当前回调集。

代码示例

代码示例来源:origin: com.thoughtworks.xstream/xstream

private Map createCallbackIndexMap(Factory source) {
  Callback[] originalCallbacks = source.getCallbacks();
  Callback[] reverseEngineeringCallbacks = new Callback[originalCallbacks.length];
  Map callbackIndexMap = new HashMap();

代码示例来源:origin: com.thoughtworks.xstream/xstream

Map callbackIndexMap = null;
Callback[] callbacks = hasFactory
  ? ((Factory)source).getCallbacks()
  : getCallbacks(source);
if (callbacks.length > 1) {

代码示例来源:origin: KleeGroup/vertigo

@Override
public <C extends Component> C unwrap(final C component) {
  if (isWrapped(component)) {
    return (C) Stream.of(((Factory) component).getCallbacks())
        .filter(callback -> CGLIBInvocationHandler.class.isAssignableFrom(callback.getClass()))
        .map(ourCallBack -> (CGLIBInvocationHandler) ourCallBack)
        .findFirst()
        .orElseThrow(() -> new IllegalArgumentException("the component " + component.getClass() + " is not unwrappable"))
        // we return the unwrapped instance
        .getInstance();
  }
  return component;
}

代码示例来源:origin: org.apache.tuscany.sca/tuscany-base-runtime

@SuppressWarnings("unchecked")
public <B, R extends ServiceReference<B>> R cast(B target) throws IllegalArgumentException {
  if (isProxyClass(target.getClass())) {
    Factory factory = (Factory)target;
    Callback[] callbacks = factory.getCallbacks();
    if (callbacks.length != 1 || !(callbacks[0] instanceof CglibMethodInterceptor)) {
      throw new IllegalArgumentException("The object is not a known proxy.");
    }
    CglibMethodInterceptor interceptor = (CglibMethodInterceptor)callbacks[0];
    return (R)interceptor.invocationHandler.getCallableReference();
  } else {
    throw new IllegalArgumentException("The object is not a known proxy.");
  }
}

代码示例来源:origin: de.javakaffee/kryo-serializers

@Override
public void write(final Kryo kryo, final Output output, final Object obj) {
  kryo.writeClass( output, obj.getClass().getSuperclass() );
  kryo.writeObject( output, obj.getClass().getInterfaces() );
  kryo.writeObject( output, ((Factory)obj).getCallbacks() );
}

代码示例来源:origin: magro/kryo-serializers

@Override
public void write(final Kryo kryo, final Output output, final Object obj) {
  kryo.writeClass( output, obj.getClass().getSuperclass() );
  kryo.writeObject( output, obj.getClass().getInterfaces() );
  kryo.writeObject( output, ((Factory)obj).getCallbacks() );
}

代码示例来源:origin: org.jvnet.hudson/xstream

private Map createCallbackIndexMap(Factory source) {
  Callback[] originalCallbacks = source.getCallbacks();
  Callback[] reverseEngineeringCallbacks = new Callback[originalCallbacks.length];
  Map callbackIndexMap = new HashMap();

代码示例来源:origin: com.haulmont.thirdparty/xstream

private Map createCallbackIndexMap(Factory source) {
  Callback[] originalCallbacks = source.getCallbacks();
  Callback[] reverseEngineeringCallbacks = new Callback[originalCallbacks.length];
  Map callbackIndexMap = new HashMap();

代码示例来源:origin: ovea-deprecated/jetty-session-redis

private Map createCallbackIndexMap(Factory source) {
  Callback[] originalCallbacks = source.getCallbacks();
  Callback[] reverseEngineeringCallbacks = new Callback[originalCallbacks.length];
  Map callbackIndexMap = new HashMap();

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xstream-java8

private Map createCallbackIndexMap(Factory source) {
  Callback[] originalCallbacks = source.getCallbacks();
  Callback[] reverseEngineeringCallbacks = new Callback[originalCallbacks.length];
  Map callbackIndexMap = new HashMap();

代码示例来源:origin: x-stream/xstream

private Map<? super Object, ? super Object> createCallbackIndexMap(final Factory source) {
  final Callback[] originalCallbacks = source.getCallbacks();
  final Callback[] reverseEngineeringCallbacks = new Callback[originalCallbacks.length];
  final Map<? super Object, ? super Object> callbackIndexMap = new HashMap<>();

代码示例来源:origin: apache/servicemix-bundles

private Map createCallbackIndexMap(Factory source) {
  Callback[] originalCallbacks = source.getCallbacks();
  Callback[] reverseEngineeringCallbacks = new Callback[originalCallbacks.length];
  Map callbackIndexMap = new HashMap();

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xstream

private Map createCallbackIndexMap(Factory source) {
  Callback[] originalCallbacks = source.getCallbacks();
  Callback[] reverseEngineeringCallbacks = new Callback[originalCallbacks.length];
  Map callbackIndexMap = new HashMap();

代码示例来源:origin: edu.internet2.middleware.grouper/grouperClient

writer.setValue(String.valueOf(hasFactory && type.getSuperclass() != Object.class));
writer.endNode();
Callback[] callbacks = hasFactory ? ((Factory)source).getCallbacks() : getCallbacks(source);
if (callbacks.length > 1) {
  throw new ConversionException("Cannot handle CGLIB enhanced proxies with multiple callbacks");

代码示例来源:origin: x-stream/xstream

writer.endNode();
Map<?, ?> callbackIndexMap = null;
final Callback[] callbacks = hasFactory ? ((Factory)source).getCallbacks() : getCallbacks(source);
if (callbacks.length > 1) {
  if (hasFactory) {

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xstream-java8

Map callbackIndexMap = null;
Callback[] callbacks = hasFactory
  ? ((Factory)source).getCallbacks()
  : getCallbacks(source);
if (callbacks.length > 1) {

代码示例来源:origin: apache/servicemix-bundles

Map callbackIndexMap = null;
Callback[] callbacks = hasFactory
  ? ((Factory)source).getCallbacks()
  : getCallbacks(source);
if (callbacks.length > 1) {

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.xstream

Map callbackIndexMap = null;
Callback[] callbacks = hasFactory
  ? ((Factory)source).getCallbacks()
  : getCallbacks(source);
if (callbacks.length > 1) {

代码示例来源:origin: org.jvnet.hudson/xstream

Map callbackIndexMap = null;
Callback[] callbacks = hasFactory
  ? ((Factory)source).getCallbacks()
  : getCallbacks(source);
if (callbacks.length > 1) {

代码示例来源:origin: com.haulmont.thirdparty/xstream

Map callbackIndexMap = null;
Callback[] callbacks = hasFactory
  ? ((Factory)source).getCallbacks()
  : getCallbacks(source);
if (callbacks.length > 1) {

相关文章