本文整理了Java中javax.enterprise.inject.spi.Interceptor.getBeanClass()
方法的一些代码示例,展示了Interceptor.getBeanClass()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Interceptor.getBeanClass()
方法的具体详情如下:
包路径:javax.enterprise.inject.spi.Interceptor
类名称:Interceptor
方法名:getBeanClass
暂无
代码示例来源:origin: wildfly/wildfly
protected Object delegateInterception(InvocationContext invocationContext, InterceptionType interceptionType, List<Interceptor<?>> currentInterceptors, InterceptorInstances interceptorInstances)
throws Exception {
List<Object> currentInterceptorInstances = new ArrayList<Object>();
for (Interceptor<?> interceptor : currentInterceptors) {
currentInterceptorInstances.add(interceptorInstances.getInstances().get(interceptor.getBeanClass().getName()).getInstance());
}
if (currentInterceptorInstances.size() > 0) {
return interceptorSupport.delegateInterception(invocationContext, interceptionType, currentInterceptors, currentInterceptorInstances);
} else {
return invocationContext.proceed();
}
}
代码示例来源:origin: wildfly/wildfly
private void addInterceptorInstance(Interceptor<Object> interceptor, BeanManagerImpl beanManager, Map<String, SerializableContextualInstance<Interceptor<Object>, Object>> instances, final CreationalContext<Object> creationalContext) {
Object instance = beanManager.getReference(interceptor, interceptor.getBeanClass(), creationalContext, true);
SerializableContextualInstance<Interceptor<Object>, Object> serializableContextualInstance
= beanManager.getServices().get(ContextualStore.class).<Interceptor<Object>, Object>getSerializableContextualInstance(interceptor, instance, creationalContext);
instances.put(interceptor.getBeanClass().getName(), serializableContextualInstance);
}
代码示例来源:origin: org.jboss.eap/wildfly-weld-common
protected Object delegateInterception(InvocationContext invocationContext, InterceptionType interceptionType, List<Interceptor<?>> currentInterceptors, InterceptorInstances interceptorInstances)
throws Exception {
List<Object> currentInterceptorInstances = new ArrayList<Object>();
for (Interceptor<?> interceptor : currentInterceptors) {
currentInterceptorInstances.add(interceptorInstances.getInstances().get(interceptor.getBeanClass().getName()).getInstance());
}
if (currentInterceptorInstances.size() > 0) {
return interceptorSupport.delegateInterception(invocationContext, interceptionType, currentInterceptors, currentInterceptorInstances);
} else {
return invocationContext.proceed();
}
}
代码示例来源:origin: org.jboss.as/jboss-as-weld
protected Object delegateInterception(InvocationContext invocationContext, InterceptionType interceptionType, List<Interceptor<?>> currentInterceptors)
throws Exception {
List<Object> currentInterceptorInstances = new ArrayList<Object>();
for (Interceptor<?> interceptor : currentInterceptors) {
currentInterceptorInstances.add(interceptorInstances.get(interceptor.getBeanClass().getName()).getInstance());
}
if (currentInterceptorInstances.size() > 0) {
return new DelegatingInterceptorInvocationContext(invocationContext, currentInterceptors, currentInterceptorInstances, interceptionType).proceed();
} else {
return invocationContext.proceed();
}
}
代码示例来源:origin: org.glassfish.main.web/weld-integration
private Interceptor findEjbInterceptor( Class interceptorClass,
Set<EjbInterceptor> ejbInterceptors ) {
for ( EjbInterceptor oneInterceptor : ejbInterceptors ) {
Interceptor interceptor = oneInterceptor.getInterceptor();
if ( interceptor != null ) {
if ( interceptor.getBeanClass().equals( interceptorClass ) ) {
return oneInterceptor.getInterceptor();
}
}
}
return null;
}
代码示例来源:origin: org.jboss.jbossas/weld-int-ejb
@SuppressWarnings("unchecked")
private void addInterceptorInstance(Interceptor<Object> interceptor, InvocationContext invocationContext)
{
CreationalContext<Object> creationalContext = (CreationalContext<Object>) invocationContext.getContextData().get(SessionBeanInterceptor.CREATIONAL_CONTEXT);
Object instance = beanManager.getContext(interceptor.getScope()).get(interceptor, creationalContext);
SerializableContextualInstance<Interceptor<Object>,Object> serializableContextualInstance
= beanManager.getServices().get(ContextualStore.class).<Interceptor<Object>,Object>getSerializableContextualInstance(interceptor, instance, creationalContext);
interceptorInstances.put(interceptor.getBeanClass().getName(), serializableContextualInstance);
}
代码示例来源:origin: org.jboss.weld.integration/weld-jboss-int-jboss-ejb
@SuppressWarnings("unchecked")
private void addInterceptorInstance(Interceptor<Object> interceptor, InvocationContext invocationContext)
{
CreationalContext<Object> creationalContext = (CreationalContext<Object>) invocationContext.getContextData().get(SessionBeanInterceptor.CREATIONAL_CONTEXT);
Object instance = beanManager.getContext(interceptor.getScope()).get(interceptor, creationalContext);
SerializableContextualInstance<Interceptor<Object>,Object> serializableContextualInstance
= beanManager.getServices().get(ContextualStore.class).getSerializableContextualInstance(interceptor, instance, creationalContext);
interceptorInstances.put(interceptor.getBeanClass().getName(), serializableContextualInstance);
}
代码示例来源:origin: org.jboss.as/jboss-as-weld
@SuppressWarnings("unchecked")
private void addInterceptorInstance(Interceptor<Object> interceptor, BeanManagerImpl beanManager, Map<String, SerializableContextualInstance<Interceptor<Object>, Object>> instances) {
Object instance = beanManager.getContext(interceptor.getScope()).get(interceptor, creationalContext);
SerializableContextualInstance<Interceptor<Object>, Object> serializableContextualInstance
= beanManager.getServices().get(ContextualStore.class).<Interceptor<Object>, Object>getSerializableContextualInstance(interceptor, instance, creationalContext);
instances.put(interceptor.getBeanClass().getName(), serializableContextualInstance);
}
代码示例来源:origin: org.glassfish.main.web/weld-integration
private EjbInterceptor makeEjbInterceptor(Interceptor<?> interceptor, EjbBundleDescriptor bundle) {
EjbInterceptor ejbInt = new EjbInterceptor();
ejbInt.setBundleDescriptor(bundle);
ejbInt.setInterceptorClassName(interceptor.getBeanClass().getName());
ejbInt.setCDIInterceptor(true);
ejbInt.setInterceptor( interceptor );
return ejbInt;
}
代码示例来源:origin: weld/core
@SuppressWarnings("unchecked")
public static <T> CustomInterceptorMetadata<T> of(Interceptor<T> interceptor) {
return new CustomInterceptorMetadata<T>(new CdiInterceptorFactory<T>(interceptor), (Class<T>) interceptor.getBeanClass(),
interceptor.getName() != null && !interceptor.getName().isEmpty() ? interceptor.getName() : null);
}
代码示例来源:origin: weld/core
@SuppressWarnings("unchecked")
public static <T> CustomInterceptorMetadata<T> of(Interceptor<T> interceptor) {
return new CustomInterceptorMetadata<T>(new CdiInterceptorFactory<T>(interceptor), (Class<T>) interceptor.getBeanClass(),
interceptor.getName() != null && !interceptor.getName().isEmpty() ? interceptor.getName() : null);
}
代码示例来源:origin: weld/core
@SuppressWarnings("unchecked")
public static <T> CustomInterceptorMetadata<T> of(Interceptor<T> interceptor) {
return new CustomInterceptorMetadata<T>(new CdiInterceptorFactory<T>(interceptor), (Class<T>) interceptor.getBeanClass(),
interceptor.getName() != null && !interceptor.getName().isEmpty() ? interceptor.getName() : null);
}
代码示例来源:origin: org.jboss.weld.se/weld-se-shaded
@SuppressWarnings("unchecked")
public static <T> CustomInterceptorMetadata<T> of(Interceptor<T> interceptor) {
return new CustomInterceptorMetadata<T>(new CdiInterceptorFactory<T>(interceptor), (Class<T>) interceptor.getBeanClass(),
interceptor.getName() != null && !interceptor.getName().isEmpty() ? interceptor.getName() : null);
}
代码示例来源:origin: org.jboss.weld.servlet/weld-servlet-shaded
@SuppressWarnings("unchecked")
public static <T> CustomInterceptorMetadata<T> of(Interceptor<T> interceptor) {
return new CustomInterceptorMetadata<T>(new CdiInterceptorFactory<T>(interceptor), (Class<T>) interceptor.getBeanClass(),
interceptor.getName() != null && !interceptor.getName().isEmpty() ? interceptor.getName() : null);
}
代码示例来源:origin: org.jboss.weld.se/weld-se
@Override
protected boolean matches(InterceptorResolvable resolvable, Interceptor<?> bean) {
return bean.intercepts(resolvable.getInterceptionType())
&& bean.getInterceptorBindings().size() > 0
&& Beans.containsAllInterceptionBindings(bean.getInterceptorBindings(), resolvable.getQualifiers(), getManager())
&& manager.getEnabled().isInterceptorEnabled(bean.getBeanClass());
}
代码示例来源:origin: weld/core
@Override
protected boolean matches(InterceptorResolvable resolvable, Interceptor<?> bean) {
return bean.intercepts(resolvable.getInterceptionType())
&& Beans.containsAllInterceptionBindings(bean.getInterceptorBindings(), resolvable.getQualifiers(), getManager())
&& manager.getEnabled().isInterceptorEnabled(bean.getBeanClass());
}
代码示例来源:origin: weld/core
@Override
protected boolean matches(InterceptorResolvable resolvable, Interceptor<?> bean) {
return bean.intercepts(resolvable.getInterceptionType())
&& Beans.containsAllInterceptionBindings(bean.getInterceptorBindings(), resolvable.getQualifiers(), getManager())
&& manager.getEnabled().isInterceptorEnabled(bean.getBeanClass());
}
代码示例来源:origin: weld/core
@Override
protected boolean matches(InterceptorResolvable resolvable, Interceptor<?> bean) {
return bean.intercepts(resolvable.getInterceptionType())
&& Beans.containsAllInterceptionBindings(bean.getInterceptorBindings(), resolvable.getQualifiers(), getManager())
&& manager.getEnabled().isInterceptorEnabled(bean.getBeanClass());
}
代码示例来源:origin: org.jboss.weld.se/weld-se-shaded
@Override
protected boolean matches(InterceptorResolvable resolvable, Interceptor<?> bean) {
return bean.intercepts(resolvable.getInterceptionType())
&& Beans.containsAllInterceptionBindings(bean.getInterceptorBindings(), resolvable.getQualifiers(), getManager())
&& manager.getEnabled().isInterceptorEnabled(bean.getBeanClass());
}
代码示例来源:origin: org.jboss.weld.servlet/weld-servlet-shaded
@Override
protected boolean matches(InterceptorResolvable resolvable, Interceptor<?> bean) {
return bean.intercepts(resolvable.getInterceptionType())
&& Beans.containsAllInterceptionBindings(bean.getInterceptorBindings(), resolvable.getQualifiers(), getManager())
&& manager.getEnabled().isInterceptorEnabled(bean.getBeanClass());
}
内容来源于网络,如有侵权,请联系作者删除!