javax.enterprise.inject.spi.Interceptor.intercept()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(132)

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

Interceptor.intercept介绍

[英]Invokes the specified InterceptionType upon the given interceptor instance.
[中]对给定的侦听器实例调用指定的侦听类型。

代码示例

代码示例来源:origin: org.apache.openwebbeans/openwebbeans-impl

@Override
public Object proceed() throws Exception
{
  currentInterceptorIdx++;
  return interceptor.intercept(interceptionType, instance, this);
}

代码示例来源:origin: org.apache.openwebbeans/openwebbeans-impl

return interceptor.intercept(type, instances.get(interceptor), this);

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

@SuppressWarnings("unchecked")
Object invoke(InvocationContext ctx) throws Exception {
  return interceptor.intercept(InterceptionType.AROUND_INVOKE, interceptorInstance, ctx);
}

代码示例来源:origin: org.apache.openwebbeans/openwebbeans-impl

return interceptor.intercept(type, instances.get(interceptor), this);

代码示例来源:origin: org.apache.cxf/cxf-rt-rs-mp-client

@SuppressWarnings("unchecked")
Object invoke(InvocationContext ctx) throws Exception {
  return interceptor.intercept(InterceptionType.AROUND_INVOKE, interceptorInstance, ctx);
}

代码示例来源:origin: io.thorntail/microprofile-restclient-api

@SuppressWarnings("unchecked")
Object invoke(InvocationContext ctx) throws Exception {
  return interceptor.intercept(InterceptionType.AROUND_INVOKE, interceptorInstance, ctx);
}

代码示例来源:origin: io.smallrye/smallrye-rest-client

@SuppressWarnings("unchecked")
Object invoke(InvocationContext ctx) throws Exception {
  return interceptor.intercept(InterceptionType.AROUND_INVOKE, interceptorInstance, ctx);
}

代码示例来源:origin: org.jboss.weld.integration/weld-jboss-int-jboss-ejb

public Object proceed() throws Exception
{
 if (!invocationQueue.isEmpty())
 {
   return invocationQueue.remove().intercept(interceptionType, interceptorInstances.remove(), this);
 }
 else
 {
   return delegateInvocationContext.proceed();
 }
}

代码示例来源:origin: weld/core

@Override
public Object intercept(InterceptionType type, T instance, InvocationContext ctx) throws Exception {
  return delegate().intercept(type, instance, ctx);
}

代码示例来源:origin: org.jboss.weld.se/weld-se

@Override
public Object intercept(InterceptionType type, T instance, InvocationContext ctx) throws Exception {
  return delegate().intercept(type, instance, ctx);
}

代码示例来源:origin: com.tomitribe.tribestream/tribestream-container

@Override
public Object proceed() throws Exception {
  if (interceptors.hasNext()) {
    final Object instance = instances.next();
    final Interceptor interceptor = interceptors.next();
    return interceptor.intercept(AROUND_INVOKE, instance, this);
  }
  return root.proceed();
}

代码示例来源:origin: weld/core

@Override
public Object intercept(InterceptionType type, T instance, InvocationContext ctx) throws Exception {
  return delegate().intercept(type, instance, ctx);
}

代码示例来源:origin: weld/core

@Override
public Object intercept(InterceptionType type, T instance, InvocationContext ctx) throws Exception {
  return delegate().intercept(type, instance, ctx);
}

代码示例来源:origin: org.jboss.weld.se/weld-se-shaded

@Override
public Object intercept(InterceptionType type, T instance, InvocationContext ctx) throws Exception {
  return delegate().intercept(type, instance, ctx);
}

代码示例来源:origin: org.jboss.weld.servlet/weld-servlet-shaded

@Override
public Object intercept(InterceptionType type, T instance, InvocationContext ctx) throws Exception {
  return delegate().intercept(type, instance, ctx);
}

代码示例来源:origin: org.jboss.as/jboss-as-weld

public Object proceed() throws Exception {
  int oldPosition = position;
  try {
    if (position < invocationQueue.size()) {
      Object interceptorInstance = interceptorInstances.get(position);
      try {
        return invocationQueue.get(position++).intercept(interceptionType, interceptorInstance, this);
      } catch (Exception e) {
        // Unwrap WeldException
        if (e instanceof WeldException && e.getCause() instanceof Exception) {
          throw ((Exception) e.getCause());
        } else {
          throw e;
        }
      }
    } else {
      return delegateInvocationContext.proceed();
    }
  } finally {
    position = oldPosition;
  }
}

代码示例来源:origin: org.jboss.eap/wildfly-weld-ejb

public Object proceed() throws Exception {
  int oldPosition = position;
  try {
    if (position < invocationQueue.size()) {
      Object interceptorInstance = interceptorInstances.get(position);
      try {
        return invocationQueue.get(position++).intercept(interceptionType, interceptorInstance, this);
      } catch (Exception e) {
        // Unwrap WeldException
        if (e instanceof WeldException && e.getCause() instanceof Exception) {
          throw ((Exception) e.getCause());
        } else {
          throw e;
        }
      }
    } else {
      return delegateInvocationContext.proceed();
    }
  } finally {
    position = oldPosition;
  }
}

代码示例来源:origin: org.jboss.jbossas/weld-int-ejb

try
  return invocationQueue.get(position++).intercept(interceptionType, interceptorInstance, this);

代码示例来源:origin: com.caucho/resin

throw new NullPointerException(i + " index[i]=" + _chainIndex[i] + " " + _type + " " + _chainMethods[i]);
result = _chainMethods[i].intercept(_type,
                  _chainObjects[_chainIndex[i]], 
                  this);

代码示例来源:origin: com.tomitribe.tribestream/tribestream-container

final Iterator<Object> instances = interception.instances.iterator();
final Interceptor next = it.next();
return next.intercept(AROUND_INVOKE, instances.next(), new DelegateInvocationContext(invocationContext, it, instances));

相关文章