congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
InterceptorInvocation
Code IndexAdd Tabnine to your IDE (free)

How to use
InterceptorInvocation
in
org.jboss.interceptor.proxy

Best Java code snippets using org.jboss.interceptor.proxy.InterceptorInvocation (Showing top 4 results out of 315)

origin: org.jboss.interceptor/jboss-interceptor-core

public SimpleInterceptionChain(Collection<InterceptorInvocation<?>> interceptorInvocations, InterceptionType interceptionType, Object target, Method targetMethod)
{
 this.interceptionType = interceptionType;
 this.target = target;
 this.targetMethod = targetMethod;
 this.currentPosition = 0;
 interceptorMethodInvocations = new ArrayList<InterceptorInvocation.InterceptorMethodInvocation>();
 for (InterceptorInvocation<?> interceptorInvocation : interceptorInvocations)
 {
   interceptorMethodInvocations.addAll(interceptorInvocation.getInterceptorMethodInvocations());
 }
}
origin: org.jboss.interceptor/jboss-interceptor-core

private Object executeInterception(Object self, Method proceedingMethod, Method thisMethod, Object[] args, InterceptionType interceptionType) throws Throwable
{
 List<? extends InterceptorMetadata<?>> interceptorList = interceptionModel.getInterceptors(interceptionType, thisMethod);
 Collection<InterceptorInvocation<?>> interceptorInvocations = new ArrayList<InterceptorInvocation<?>>();
 for (InterceptorMetadata interceptorReference : interceptorList)
 {
   interceptorInvocations.add(new InterceptorInvocation(interceptorHandlerInstances.get(interceptorReference), interceptorReference, interceptionType));
 }
 if (targetClassInterceptorMetadata != null && targetClassInterceptorMetadata.getInterceptorMethods(interceptionType) != null && !targetClassInterceptorMetadata.getInterceptorMethods(interceptionType).isEmpty())
 {
   interceptorInvocations.add(new InterceptorInvocation(isProxy() ? targetInstance : self, targetClassInterceptorMetadata, interceptionType));
 }
 SimpleInterceptionChain chain = new SimpleInterceptionChain(interceptorInvocations, interceptionType, isProxy() ? targetInstance : self, isProxy() ? thisMethod : proceedingMethod);
 return chain.invokeNextInterceptor(invocationContextFactory.newInvocationContext(chain, isProxy() ? targetInstance : self, isProxy() ? thisMethod : proceedingMethod, args));
}
origin: org.jboss.managed.beans/managed-beans-impl

@SuppressWarnings("unchecked")
@Override
public Object invoke(ManagedBeanInstance<T> managedBeanInstance, Method method, Object[] args) throws Throwable
{
 Collection<InterceptorMetadata<?>> aroundInvokeInterceptors = this.mbMetaData.getAroundInvokes(method);
 Collection<InterceptorInvocation<?>> interceptorInvocations = new ArrayList<InterceptorInvocation<?>>(aroundInvokeInterceptors.size());
 for (InterceptorMetadata<?> aroundInvokeInterceptor : aroundInvokeInterceptors)
 {
   Object instance = null;
   if (aroundInvokeInterceptor.isTargetClass())
   {
    instance = managedBeanInstance.getInstance();
   }
   else
   {
    String interceptorClassName = aroundInvokeInterceptor.getInterceptorClass().getClassName();
    instance = managedBeanInstance.getInterceptor(interceptorClassName);
   }
   // TODO: Interceptor invocation creation should be simplified in jboss-interceptors project.
   InterceptorInvocation<?> interceptorInvocation = new InterceptorInvocation(instance, aroundInvokeInterceptor, InterceptionType.AROUND_INVOKE);
   interceptorInvocations.add(interceptorInvocation);
 }
 InterceptionChain interceptorChain = new SimpleInterceptionChain(interceptorInvocations,
    InterceptionType.AROUND_INVOKE, managedBeanInstance.getInstance(), method);
 DefaultInvocationContextFactory invocationCtxFactory = new DefaultInvocationContextFactory();
 InvocationContext invocationCtx = invocationCtxFactory.newInvocationContext(interceptorChain, managedBeanInstance.getInstance(), method, args);
 // invoke
 return invocationCtx.proceed();
}
origin: org.jboss.managed.beans/managed-beans-impl

@SuppressWarnings("unchecked")
private void handlePostConstruct(ManagedBeanInstance<T> managedBeanInstance) throws Exception
{
 List<InterceptorMetadata<?>> postConstructs = this.mbMetaData.getPostConstructs();
 Collection<InterceptorInvocation<?>> interceptorInvocations = new ArrayList<InterceptorInvocation<?>>(postConstructs.size());
 for (InterceptorMetadata<?> interceptor : postConstructs)
 {
   Object instance = null;
   if (interceptor.isTargetClass())
   {
    instance = managedBeanInstance.getInstance();
   }
   else
   {
    String interceptorClassName = interceptor.getInterceptorClass().getClassName();
    instance = managedBeanInstance.getInterceptor(interceptorClassName);
   }
   // TODO: Interceptor invocation creation will be simplified in jboss-interceptors project.
   InterceptorInvocation<?> interceptorInvocation = new InterceptorInvocation(instance, interceptor, InterceptionType.POST_CONSTRUCT);
   interceptorInvocations.add(interceptorInvocation);
 }
 InterceptionChain interceptorChain = new SimpleInterceptionChain(interceptorInvocations,
    InterceptionType.POST_CONSTRUCT, managedBeanInstance.getInstance(), null);
 DefaultInvocationContextFactory invocationCtxFactory = new DefaultInvocationContextFactory();
 InvocationContext invocationCtx = invocationCtxFactory.newInvocationContext(interceptorChain, managedBeanInstance.getInstance(), null, null);
 // invoke post-construct
 invocationCtx.proceed();
}
org.jboss.interceptor.proxyInterceptorInvocation

Most used methods

  • <init>
  • getInterceptorMethodInvocations

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSupportFragmentManager (FragmentActivity)
  • getSystemService (Context)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Reference (javax.naming)
  • Option (scala)
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now