{@inheritDoc}

@see jcifs.internal.smb2.ServerMessageBlock2#chain(jcifs.internal.smb2.ServerMessageBlock2)
483391
@Override
    public boolean chain ( ServerMessageBlock2 n ) {
        n.setSessionId(Smb2Constants.UNSPECIFIED_SESSIONID);
        return super.chain(n);
    }
1216585
protected RequestSecurityProcessor getLastProcessorInChain(final FilterChain chain) {
        return new RequestSecurityProcessor() {

            public void processRequest(RequestContext context, RequestSecurityProcessorChain processorChain) throws
                Exception {
                chain.doFilter(context.getRequest(), context.getResponse());
            }

        };
    }
1104975
@Override
    public synchronized boolean isChainRunning(ChainData chain) {
        if (null == chain) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "isChainRunning(null): false");
            }
            return false;
        }
        return isChainRunning(chain.getName());
    }
494031
public static <X> ChainedProviderService<X> chain(final String name,
                                                      final ProviderService<X> primary,
                                                      final ProviderService<X> secondary) {

        return new ChainedProviderServiceImpl<X>(name, primary, secondary);
    }
18852
@Override
    public synchronized boolean isChainRunning(String chainName) {
        boolean rc = false;
        if (null != chainName) {
            Chain c = this.chainRunningMap.get(chainName);
            if (null != c) {
                rc = c.getState().equals(RuntimeState.STARTED) || c.getState().equals(RuntimeState.QUIESCED);
            }
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "isChainRunning: " + chainName + " " + rc);
        }
        return rc;
    }
772593
public void terminateConnectionsAssociatedWithChain(String chainName) throws Exception {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.entry(this, tc, "terminateConnectionsAssociatedWithChain", chainName);

        synchronized (endPointToGroupMap) {

            try {
                final HashMap<EndPointDescriptor, ConnectionDataGroup> endPointToGroupMapClone = (HashMap<EndPointDescriptor, ConnectionDataGroup>) endPointToGroupMap.clone();
                Iterator<EndPointDescriptor> it = endPointToGroupMapClone.keySet().iterator();
                while (it.hasNext()) {
                    EndPointDescriptor ed = it.next();

                    if ((((HostPortEndPointDescriptor) ed).chainName).equals(chainName)) {

                        ConnectionDataGroup cdGroup = endPointToGroupMapClone.get(ed);

                        final List connectionData = cdGroup.getConnections();

                        for (final Iterator connectionDataIterator = connectionData.iterator(); connectionDataIterator.hasNext();)
                        {
                            final ConnectionData thisConnectionData = (ConnectionData) connectionDataIterator.next();
                            final OutboundConnection oc = thisConnectionData.getConnection();
                            //close all the conservations associated with the OC
                            Conversation[] conv = oc.getConversations();
                            for (Conversation c : conv) {
                                try {
                                    c.fastClose();
                                } catch (Exception e) {//Don't let the exception mess up closing other remaining conservations
                                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                                        SibTr.debug(tc, "Error while fast closing the conversation", e);
                                }

                            }
                            try {
                                // terminate the physical connection
                                purgeFromInvalidateImpl(oc, false);
                            } catch (Exception e) {//Don't let the exception mess up closing other remaining connection
                                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                                    SibTr.debug(tc, "Error while purging the physical connection", e);
                            }
                        }

                        try {
                            // destroy the OutboundVirtualConnection associated with the chainName
                            cdGroup.getNetworkConnectionFactory().getOutboundVirtualConFactory().destroy();
                        } catch (Exception e) {//Don't let the exception mess up closing other remaining connection
                            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                                SibTr.debug(tc, "Error while destroying the outbound virtual connection", e);
                        }
                        // in fastClose() the entry is removed but still we do a remove 
                        endPointToGroupMap.remove(ed);

                    }
                }

            } catch (Exception e) {
                throw e;
            } finally {
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    Tr.exit(this, tc, "terminateConnectionsAssociatedWithChain");
            }

        }
    }
1209236
@SafeVarargs
    public static <T> CloseableIterable<T> chain(CloseableIterable<? extends T>... iterables) {
        return chain(asList(iterables));
    }
974509
@Override
	public Certificate[] engineGetCertificateChain(String s) {
		CredentialWrapper credential = getKeyEntry(s);
		X509Certificate[] chain = new X509Certificate[0];
		if (credential != null) {
			try {
				chain = credential.getCredential().getCertificateChain();
			} catch (ResourceStoreException e) {
				logger.warn(e.getMessage(), e);
				chain = null;
			}
		}
		return chain;
	}
407893
public <R> Promise<T> chain(final Function<T, Promise<R>> res) {
        final Promise<T> self = this;
        return new Promise<>(resolver -> {
            self.then(t -> {
                Promise<R> chained = res.apply(t);
                chained.then(t2 -> resolver.result(t));
                chained.failure(e -> resolver.error(e));
            });
            self.failure(e -> resolver.error(e));
        });
    }
1073431
def invoke_with_call_chain(task_args, invocation_chain) # :nodoc:
      new_chain = InvocationChain.append(self, invocation_chain)
      @lock.synchronize do
        if application.options.trace
          puts "** Invoke #{name} #{format_trace_flags}"
        end
        return if @already_invoked
        @already_invoked = true
        invoke_prerequisites(task_args, new_chain)
        execute(task_args) if needed?
      end
    end
171883
@Override
    public CommonServerMessageBlockRequest split () {
        ServerMessageBlock2Request<?> n = getNext();
        if ( n != null ) {
            setNext(null);
            n.clearFlags(SMB2_FLAGS_RELATED_OPERATIONS);
        }
        return n;
    }
855973
public static <X> ChainedProviderService<X> chain(final String name,
                                                      final List<ProviderService<X>> services) {

        return new ChainedProviderServiceImpl<X>(name, services);
    }
330361
@Override
  public <S> StreamBuilderImpl<S,U> 
  custom(FunctionSync<ResultStream<S>,ResultStream<T>> builder)
  {
    return new Chain<S,T,U>(this, builder);
  }
169511
@Override
    public ChainableEvent onSuccess(Event onSuccessEvent, Class<? extends IEventService> onSuccessEventService) {
        this.onSuccessChains.add(new ChainLink()
                .onSuccess(linkChainIdentifier(onSuccessEvent), onSuccessEventService));
        return this;
    }
110940
function chain(promise,
               onResolve = idResolveHandler,
               onReject = idRejectHandler) {
  var deferred = getDeferred(promise.constructor);
  switch (promise.status_) {
    case undefined:
      throw TypeError;
    case 0:
      promise.onResolve_.push(onResolve, deferred);
      promise.onReject_.push(onReject, deferred);
      break;
    case +1:
      promiseEnqueue(promise.value_, [onResolve, deferred]);
      break;
    case -1:
      promiseEnqueue(promise.value_, [onReject, deferred]);
      break;
  }
  return deferred.promise;
}
819363
@Override
    public synchronized void chainStarted(ChainData chainData) {
        chainState.set(ChainState.STARTED.val);

        final ActiveConfiguration cfg = currentConfig;
        final int port = cfg.getActivePort();

        if (port > 0) {
            // HOORAY! we have a bound listener.
            // Notify listeners that the chain was started.
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(this, tc, "New configuration started " + cfg);
            }

            VirtualHostMap.notifyStarted(owner, cfg.resolvedHost, port, isHttps);

            // Post an endpoint started event to anyone listening
            String topic = owner.getEventTopic() + HttpServiceConstants.ENDPOINT_STARTED;
            postEvent(topic, cfg, null);
        }
    }
259894
public static <T> Callback<T> chain(Iterable<Callback<T>> callbacks)
    {
        return new ChainCallback<T>(callbacks);
    }