Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
   * contributors by the @authors tag. See the copyright.txt in the
   * distribution for a full listing of individual contributors.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
  * http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 package org.jboss.weld.interceptor.builder;
 
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
 
This impl is immutable provided the type of the intercepted entity is immutable as well.

Parameters:
<T> the type of the intercepted entity
Author(s):
Marius Bogoevici
Marko Luksa
Martin Kouba
 
 
 
 
     private final Set<MethodmethodsIgnoringGlobalInterceptors;
 
     private final Set<InterceptorClassMetadata<?>> allInterceptors;
 
     private final boolean hasExternalNonConstructorInterceptors;
 
 
         this. = ImmutableMap.<InterceptionTypeList<InterceptorClassMetadata<?>>>copyOf(builder.getGlobalInterceptors());
         this. = ImmutableSet.<Method>copyOf(builder.getMethodsIgnoringGlobalInterceptors());
         this. = ImmutableSet.<InterceptorClassMetadata<?>>copyOf(builder.getAllInterceptors());
     }
 
     @Override
     public List<InterceptorClassMetadata<?>> getInterceptors(InterceptionType interceptionTypeMethod method) {
         if (..equals(interceptionType)) {
             throw new IllegalStateException("Cannot use getInterceptors() for @AroundConstruct interceptor lookup. Use getConstructorInvocationInterceptors() instead.");
         }
         if (interceptionType.isLifecycleCallback() && method != null) {
             throw new IllegalArgumentException("On a lifecycle callback, the associated method must be null");
         }
 
         if (!interceptionType.isLifecycleCallback() && method == null) {
             throw new IllegalArgumentException("Around-invoke and around-timeout interceptors are defined for a given method");
         }
 
         if (interceptionType.isLifecycleCallback()) {
             if (.containsKey(interceptionType)) {
                 return .get(interceptionType);
             }
         } else {
             ArrayList<InterceptorClassMetadata<?>> returnedInterceptors = new ArrayList<InterceptorClassMetadata<?>>();
             if (!.contains(method) && .containsKey(interceptionType)) {
                 returnedInterceptors.addAll(.get(interceptionType));
             }
             Map<MethodList<InterceptorClassMetadata<?>>> map = .get(interceptionType);
             if (map != null) {
                 List<InterceptorClassMetadata<?>> list = map.get(method);
                 if (list != null) {
                     returnedInterceptors.addAll(list);
                 }
             }
             return returnedInterceptors;
         }
         return Collections.emptyList();
     }
    @Override
        return Collections.unmodifiableSet();
    }
    @Override
        }
        return Collections.emptyList();
    }
    @Override
    public boolean hasExternalConstructorInterceptors() {
        return !getConstructorInvocationInterceptors().isEmpty();
    }
    @Override
    public boolean hasExternalNonConstructorInterceptors() {
    }
    @Override
    public boolean hasTargetClassInterceptors() {
    }
    @Override
        return ;
    }
New to GrepCode? Check out our FAQ X