Adds a ConnectInterceptor to receive callbacks during the connection process.
Useful for programmatic configuration.
@param interceptor the connect interceptor to add
348507
public void addSignInInterceptor(ProviderSignInInterceptor<?> interceptor) {
		Class<?> serviceApiType = GenericTypeResolver.resolveTypeArgument(interceptor.getClass(), ProviderSignInInterceptor.class);
		signInInterceptors.add(serviceApiType, interceptor);
	}
791815
public void addBOSHClientConnListener(
            final BOSHClientConnListener listener) {
        if (listener == null) {
            throw(new IllegalArgumentException(NULL_LISTENER));
        }
        connListeners.add(listener);
    }
1321284
@Override
    public void addConnectionListener(SICoreConnectionListener listener)
                    throws SIConnectionDroppedException,
                    SIConnectionUnavailableException {

        checkValid();

        _delegateConnection.addConnectionListener(listener);

    }
965169
@Reqiured
    public void setInterceptors(Interceptor[] interceptors) {
        Listener last = null;
        for (int i = interceptors.length - 1; i >= 0; i--) {
            final Interceptor current = interceptors[i];
            final Listener next = last;
            last = new Listener() {
                public void render(Context context) throws IOException, ParseException {
                    if (next == null) {
                        Listener listener = (Listener) context.get(LISTENER_KEY);
                        if (listener != null) {
                            current.render(context, listener);
                        }
                    } else {
                        current.render(context, next);
                    }
                }
            };
        }
        this.chain = last;
    }
193232
private List<HandlerInterceptor> adaptInterceptors(List<Object> interceptors, ApplicationContext context) {
        List<HandlerInterceptor> handlerInterceptors = new ArrayList<HandlerInterceptor>();

        if (context.containsBean(LOGGING_INTERCEPTOR_BEAN_NAME)) {
            LoggingHandlerInterceptor loggingInterceptor = context.getBean(LOGGING_INTERCEPTOR_BEAN_NAME, LoggingHandlerInterceptor.class);
            handlerInterceptors.add(loggingInterceptor);
        }

        if (interceptors != null) {
            for (Object interceptor : interceptors) {
                if (interceptor instanceof MappedInterceptor) {
                    handlerInterceptors.add(new MappedInterceptorAdapter((MappedInterceptor)interceptor,
                            new UrlPathHelper(), new AntPathMatcher()));
                } else if (interceptor instanceof HandlerInterceptor) {
                    handlerInterceptors.add((HandlerInterceptor) interceptor);
                } else if (interceptor instanceof WebRequestInterceptor) {
                    handlerInterceptors.add(new WebRequestHandlerInterceptorAdapter((WebRequestInterceptor) interceptor));
                } else {
                    log.warn("Unsupported interceptor type: {}", interceptor.getClass().getName());
                }
            }
        }

        return handlerInterceptors;
    }
1248126
public boolean addInterceptorBefore(CommandInterceptor toAdd,
                                       Class<? extends CommandInterceptor> beforeInterceptor) {
      return asyncInterceptorChain.addInterceptorBefore(toAdd, beforeInterceptor);
   }
267860
static <WReqT, WRespT> ClientInterceptor wrapClientInterceptor(
      final ClientInterceptor interceptor,
      final Marshaller<WReqT> reqMarshaller,
      final Marshaller<WRespT> respMarshaller) {
    return new ClientInterceptor() {
      @Override
      public <ReqT, RespT> ClientCall<ReqT, RespT> interceptCall(
          final MethodDescriptor<ReqT, RespT> method, CallOptions callOptions, Channel next) {
        final MethodDescriptor<WReqT, WRespT> wrappedMethod =
            method.toBuilder(reqMarshaller, respMarshaller).build();
        final ClientCall<WReqT, WRespT> wrappedCall =
            interceptor.interceptCall(wrappedMethod, callOptions, next);
        return new PartialForwardingClientCall<ReqT, RespT>() {
          @Override
          public void start(final Listener<RespT> responseListener, Metadata headers) {
            wrappedCall.start(new PartialForwardingClientCallListener<WRespT>() {
              @Override
              public void onMessage(WRespT wMessage) {
                InputStream bytes = respMarshaller.stream(wMessage);
                RespT message = method.getResponseMarshaller().parse(bytes);
                responseListener.onMessage(message);
              }

              @Override
              protected Listener<?> delegate() {
                return responseListener;
              }
            }, headers);
          }

          @Override
          public void sendMessage(ReqT message) {
            InputStream bytes = method.getRequestMarshaller().stream(message);
            WReqT wReq = reqMarshaller.parse(bytes);
            wrappedCall.sendMessage(wReq);
          }

          @Override
          protected ClientCall<?, ?> delegate() {
            return wrappedCall;
          }
        };
      }
    };
  }
256257
private ArrayList<String> addMethodLevelInterceptors(Method method, EJBInterceptorBinding methodBinding)
                    throws EJBConfigurationException
    {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
        {
            Tr.entry(tc, "addMethodLevelInterceptors method: " + method.getName());
        }

        // List of method-level interceptor names to return to the caller.
        ArrayList<String> interceptorNames = new ArrayList<String>();

        if (!ivMetadataComplete)
        {
            // Process annotation first since the interceptor classes from
            // annotation are the first ones that need to be called.
            Interceptors methodLevelInterceptors = method.getAnnotation(Interceptors.class);
            String methodName = method.getName();
            if (methodLevelInterceptors != null)
            {
                if (isTraceOn && tc.isDebugEnabled())
                {
                    Tr.debug(tc, "processing @Interceptor annotation for method: " + methodName
                                 + ", EJB name: " + ivEjbName);
                }

                // Get list of interceptor names and classes.
                List<String> names = addLoadedInterceptorClasses(methodLevelInterceptors.value()); // d630717

                // Add to the interceptor names list to be returned to the caller.
                interceptorNames.addAll(names);
            }
        }

        // Now augment this list by processing the class level InterceptorBinding from
        // WCCM for this method of the EJB (if one exists).
        if (methodBinding != null)
        {
            if (isTraceOn && tc.isDebugEnabled())
            {
                Tr.debug(tc, "processing interceptor binding for method: " + method);
            }

            List<String> names = methodBinding.ivInterceptorClassNames; // d453477
            updateNamesToClassMap(names); // d630717

            // Add to the interceptor names list to be returned to the caller.
            interceptorNames.addAll(names);
        }

        if (isTraceOn && tc.isEntryEnabled())
        {
            Tr.exit(tc, "addMethodLevelInterceptors: " + interceptorNames);
        }

        // Return list of method-level interceptor names for this business method.
        return interceptorNames;
    }
928018
private void addProgressInterceptor() {
        httpClient.networkInterceptors().add(new Interceptor() {
            @Override
            public Response intercept(Interceptor.Chain chain) throws IOException {
                final Request request = chain.request();
                final Response originalResponse = chain.proceed(request);
                if (request.tag() instanceof ApiCallback) {
                    final ApiCallback callback = (ApiCallback) request.tag();
                    return originalResponse.newBuilder()
                            .body(new ProgressResponseBody(originalResponse.body(), callback)).build();
                }
                return originalResponse;
            }
        });
    }
608709
public TcpServerInterceptorChain<R, W, RR, WW> next(final Interceptor<RR, WW> next) {
        return new TcpServerInterceptorChain<>(new TransformingInterceptor<R, W, RR, WW>() {
            @Override
            public ConnectionHandler<R, W> intercept(ConnectionHandler<RR, WW> handler) {
                return interceptor.intercept(next.intercept(handler));
            }
        });
    }
324300
protected void createInterceptorsAndInstance(CallbackContextHelper contextHelper) throws InvocationTargetException {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "createInterceptorsAndInstance : " + contextHelper);

        BeanMetaData bmd = home.beanMetaData;
        ManagedObjectFactory<?> managedObjectFactory = bmd.ivEnterpriseBeanFactory;
        if (managedObjectFactory != null) {
            try {
                ivEjbManagedObjectContext = managedObjectFactory.createContext();
            } catch (ManagedObjectException e) {
                throw ExceptionUtil.EJBException("AroundConstruct interceptors for the " + bmd.enterpriseBeanName +
                                                 " bean in the " + bmd._moduleMetaData.ivName +
                                                 " module in the " + bmd._moduleMetaData.ivAppName +
                                                 " application resulted in an exception being thrown from the ManagedObjectFactory.createContext() method", e);
            }
        }

        InterceptorMetaData imd = bmd.ivInterceptorMetaData;
        if (imd != null && !bmd.managedObjectManagesInjectionAndInterceptors) {
            createInterceptors(imd);
            if (bmd.ivCallbackKind == CallbackKind.InvocationContext) {
                InterceptorProxy[] aroundConstructProxies = imd.ivAroundConstructInterceptors;
                if (aroundConstructProxies != null) {
                    InvocationContextImpl<?> context = callAroundConstructInterceptors(aroundConstructProxies, contextHelper);
                    // If InvocationContext.proceed() was not called, the bean's
                    // constructor was never called and ivEjbInstance will be null.
                    if (ivEjbInstance == null) {
                        // If the interceptor swallowed an exception from
                        // proceed(), we re-throw it now to give a better
                        // error message than a generic "failed to create".
                        if (context.ivAroundConstructException != null) {
                            Throwable t = context.ivAroundConstructException.getCause();
                            if (t == null) {
                                // Don't lose the application exception if it doesn't happen to be nested
                                t = context.ivAroundConstructException;
                            }
                            throw ExceptionUtil.EJBException("AroundConstruct interceptors for the " + bmd.enterpriseBeanName +
                                                             " bean in the " + bmd._moduleMetaData.ivName +
                                                             " module in the " + bmd._moduleMetaData.ivAppName +
                                                             " application resulted in an exception being thrown from the constructor of the " +
                                                             bmd.enterpriseBeanClassName + " class.", t);
                        }

                        // Otherwise, the interceptor must not have called proceed().
                        throw new EJBException("AroundConstruct interceptors for the " + bmd.enterpriseBeanName +
                                               " bean in the " + bmd._moduleMetaData.ivName +
                                               " module in the " + bmd._moduleMetaData.ivAppName +
                                               " application did not call InvocationContext.proceed()");
                    }
                }
            }
        }

        // If no @AroundConstructor interceptor, create the instance now.
        if (ivEjbInstance == null) {
            createInstance();
        }
        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "createInterceptorsAndInstance");
    }
1000404
private void checkInterceptor(Class<? extends AsyncInterceptor> clazz) {
      if (containsInterceptorType(clazz, false))
         throw new CacheConfigurationException("Detected interceptor of type [" + clazz.getName() +
                                                     "] being added to the interceptor chain " +
                                                     System.identityHashCode(this) + " more than once!");
   }
1104578
public void addConnectionEventListener(ConnectionEventListener listener) {
    log.finest("addConnectionEventListener()");
    if (listener == null)
      throw new IllegalArgumentException("Listener is null");
    listeners.add(listener);
  }
108453
function applyRequestInterceptors(config) {
				for (var i = 0; i < interceptors.length; i++) {
					var interceptor = getInterceptor(interceptors[i]);
					if (interceptor.request) {
						config = interceptor.request(config);
					}
				}
				if (config.transformRequest) {
					config.data = applyTransform(config.data, config.headers, undefined, config.transformRequest);
				}
				return config;
			}
62532
protected static void addInterceptors( org.apache.beehive.netui.util.config.bean.InterceptorConfig[] configBeans,
                                           List/*< Interceptor >*/ interceptorsList,
                                           Class baseClassOrInterface )
    {
        if ( configBeans != null )
        {
            for ( int i = 0; i < configBeans.length; i++ )
            {
                org.apache.beehive.netui.util.config.bean.InterceptorConfig configBean = configBeans[i];
                String className = configBean.getInterceptorClass();
                InterceptorConfig config = new InterceptorConfig( className );
                CustomPropertyConfig[] customProps = configBean.getCustomProperties();

                if ( customProps != null )
                {
                    for ( int j = 0; j < customProps.length; j++ )
                    {
                        CustomPropertyConfig customProp = customProps[j];
                        config.addCustomProperty( customProp.getName(), customProp.getValue() );
                    }
                }
                
                addInterceptor( config, baseClassOrInterface, interceptorsList );
            }
        }
    }
41510
public void setInterceptors(Object[] interceptors) // F87720
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.debug(tc, "setInterceptors interceptors = " + interceptors + ", for SFSB: " + this);
        }
        ivInterceptors = interceptors;
    }
918940
public void connectAsynch(Object context) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "connectAsynch");
        }

        this.syncObject = null;

        // reset proxy response object
        if (this.proxy != null) {
            this.proxy.setIsProxyResponseValid(false);
        }

        connectCommon((TCPConnectRequestContext) context);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "connectAsynch");
        }
    }