/** * Add all default handlers to the chain and the given {@link Hook}'s. After that {@link #wireExtensibleHandlers()} is called * * @param hooks * @throws WiringException */ public SMTPProtocolHandlerChain(MetricFactory metricFactory, Hook... hooks) throws WiringException { this(metricFactory, true); for (Hook hook : hooks) { add(hook); } wireExtensibleHandlers(); }
private Protocol createProtocol(Optional<ProtocolHandler> handler) throws WiringException { SMTPProtocolHandlerChain chain = new SMTPProtocolHandlerChain(new NoopMetricFactory()); if (handler.isPresent()) { chain.add(handler.get()); } chain.wireExtensibleHandlers(); return new SMTPProtocol(chain, new SMTPConfigurationImpl()); }
private Protocol createProtocol(Optional<ProtocolHandler> handler) throws WiringException { SMTPProtocolHandlerChain chain = new SMTPProtocolHandlerChain(new NoopMetricFactory()); if (handler.isPresent()) { chain.add(handler.get()); } chain.wireExtensibleHandlers(); return new SMTPProtocol(chain, new SMTPConfigurationImpl()); }
protected Protocol createProtocol(ProtocolHandler... handlers) throws WiringException { SMTPProtocolHandlerChain chain = new SMTPProtocolHandlerChain(new NoopMetricFactory()); chain.addAll(0, Arrays.asList(handlers)); chain.wireExtensibleHandlers(); return new SMTPProtocol(chain, new SMTPConfigurationImpl()); }
protected Protocol createProtocol(ProtocolHandler... handlers) throws WiringException { SMTPProtocolHandlerChain chain = new SMTPProtocolHandlerChain(new NoopMetricFactory()); chain.addAll(0, Arrays.asList(handlers)); chain.wireExtensibleHandlers(); return new SMTPProtocol(chain, new SMTPConfigurationImpl()); }