View Javadoc

1   //
2   //  ========================================================================
3   //  Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd.
4   //  ------------------------------------------------------------------------
5   //  All rights reserved. This program and the accompanying materials
6   //  are made available under the terms of the Eclipse Public License v1.0
7   //  and Apache License v2.0 which accompanies this distribution.
8   //
9   //      The Eclipse Public License is available at
10  //      http://www.eclipse.org/legal/epl-v10.html
11  //
12  //      The Apache License v2.0 is available at
13  //      http://www.opensource.org/licenses/apache2.0.php
14  //
15  //  You may elect to redistribute this code under either of these licenses.
16  //  ========================================================================
17  //
18  
19  package org.eclipse.jetty.client;
20  
21  import java.io.IOException;
22  import java.io.InputStream;
23  import java.net.UnknownHostException;
24  import java.util.Collection;
25  import java.util.Collections;
26  import java.util.Enumeration;
27  import java.util.LinkedList;
28  import java.util.Set;
29  import java.util.concurrent.ConcurrentHashMap;
30  import java.util.concurrent.ConcurrentMap;
31  
32  import javax.net.ssl.SSLContext;
33  
34  import org.eclipse.jetty.client.security.Authentication;
35  import org.eclipse.jetty.client.security.RealmResolver;
36  import org.eclipse.jetty.client.security.SecurityListener;
37  import org.eclipse.jetty.http.HttpBuffers;
38  import org.eclipse.jetty.http.HttpBuffersImpl;
39  import org.eclipse.jetty.http.HttpSchemes;
40  import org.eclipse.jetty.io.Buffers;
41  import org.eclipse.jetty.io.Buffers.Type;
42  import org.eclipse.jetty.util.Attributes;
43  import org.eclipse.jetty.util.AttributesMap;
44  import org.eclipse.jetty.util.component.AggregateLifeCycle;
45  import org.eclipse.jetty.util.component.Dumpable;
46  import org.eclipse.jetty.util.component.LifeCycle;
47  import org.eclipse.jetty.util.ssl.SslContextFactory;
48  import org.eclipse.jetty.util.thread.QueuedThreadPool;
49  import org.eclipse.jetty.util.thread.ThreadPool;
50  import org.eclipse.jetty.util.thread.Timeout;
51  
52  /**
53   * Http Client.
54   * <p/>
55   * HttpClient is the main active component of the client API implementation.
56   * It is the opposite of the Connectors in standard Jetty, in that it listens
57   * for responses rather than requests.   Just like the connectors, there is a
58   * blocking socket version and a non-blocking NIO version (implemented as nested classes
59   * selected by {@link #setConnectorType(int)}).
60   * <p/>
61   * The an instance of {@link HttpExchange} is passed to the {@link #send(HttpExchange)} method
62   * to send a request.  The exchange contains both the headers and content (source) of the request
63   * plus the callbacks to handle responses.   A HttpClient can have many exchanges outstanding
64   * and they may be queued on the {@link HttpDestination} waiting for a {@link AbstractHttpConnection},
65   * queued in the {@link AbstractHttpConnection} waiting to be transmitted or pipelined on the actual
66   * TCP/IP connection waiting for a response.
67   * <p/>
68   * The {@link HttpDestination} class is an aggregation of {@link AbstractHttpConnection}s for the
69   * same host, port and protocol.   A destination may limit the number of connections
70   * open and they provide a pool of open connections that may be reused.   Connections may also
71   * be allocated from a destination, so that multiple request sources are not multiplexed
72   * over the same connection.
73   *
74   * @see HttpExchange
75   * @see HttpDestination
76   */
77  public class HttpClient extends AggregateLifeCycle implements HttpBuffers, Attributes, Dumpable
78  {
79      public static final int CONNECTOR_SOCKET = 0;
80      public static final int CONNECTOR_SELECT_CHANNEL = 2;
81  
82      private int _connectorType = CONNECTOR_SELECT_CHANNEL;
83      private boolean _useDirectBuffers = true;
84      private boolean _connectBlocking = true;
85      private boolean _removeIdleDestinations=false;
86      private int _maxConnectionsPerAddress = Integer.MAX_VALUE;
87      private int _maxQueueSizePerAddress = Integer.MAX_VALUE;
88      private ConcurrentMap<Address, HttpDestination> _destinations = new ConcurrentHashMap<Address, HttpDestination>();
89      ThreadPool _threadPool;
90      Connector _connector;
91      private long _idleTimeout = 20000;
92      private long _timeout = 320000;
93      private int _connectTimeout = 75000;
94      private Timeout _timeoutQ = new Timeout();
95      private Timeout _idleTimeoutQ = new Timeout();
96      private Address _proxy;
97      private Authentication _proxyAuthentication;
98      private Set<String> _noProxy;
99      private int _maxRetries = 3;
100     private int _maxRedirects = 20;
101     private LinkedList<String> _registeredListeners;
102 
103     private final SslContextFactory _sslContextFactory;
104 
105     private RealmResolver _realmResolver;
106 
107     private AttributesMap _attributes=new AttributesMap();
108 
109     private final HttpBuffersImpl _buffers= new HttpBuffersImpl();
110 
111     /* ------------------------------------------------------------------------------- */
112     private void setBufferTypes()
113     {
114         if (_connectorType==CONNECTOR_SOCKET)
115         {
116             _buffers.setRequestBufferType(Type.BYTE_ARRAY);
117             _buffers.setRequestHeaderType(Type.BYTE_ARRAY);
118             _buffers.setResponseBufferType(Type.BYTE_ARRAY);
119             _buffers.setResponseHeaderType(Type.BYTE_ARRAY);
120         }
121         else
122         {
123             _buffers.setRequestBufferType(Type.DIRECT);
124             _buffers.setRequestHeaderType(_useDirectBuffers?Type.DIRECT:Type.INDIRECT);
125             _buffers.setResponseBufferType(Type.DIRECT);
126             _buffers.setResponseHeaderType(_useDirectBuffers?Type.DIRECT:Type.INDIRECT);
127         }
128 
129     }
130 
131     /* ------------------------------------------------------------------------------- */
132     public HttpClient()
133     {
134         this(new SslContextFactory());
135     }
136 
137     /* ------------------------------------------------------------------------------- */
138     public HttpClient(SslContextFactory sslContextFactory)
139     {
140         _sslContextFactory = sslContextFactory;
141         addBean(_sslContextFactory);
142         addBean(_buffers);
143     }
144 
145     /* ------------------------------------------------------------------------------- */
146     /**
147      * @return True if connects will be in blocking mode.
148      */
149     public boolean isConnectBlocking()
150     {
151         return _connectBlocking;
152     }
153 
154     /* ------------------------------------------------------------------------------- */
155     /**
156      * @param connectBlocking True if connects will be in blocking mode.
157      */
158     public void setConnectBlocking(boolean connectBlocking)
159     {
160         _connectBlocking = connectBlocking;
161     }
162 
163     /* ------------------------------------------------------------------------------- */
164     public boolean isRemoveIdleDestinations()
165     {
166         return _removeIdleDestinations;
167     }
168 
169     /* ------------------------------------------------------------------------------- */
170     public void setRemoveIdleDestinations(boolean removeIdleDestinations)
171     {
172         _removeIdleDestinations = removeIdleDestinations;
173     }
174 
175     /* ------------------------------------------------------------------------------- */
176     public void send(HttpExchange exchange) throws IOException
177     {
178         boolean ssl = HttpSchemes.HTTPS_BUFFER.equalsIgnoreCase(exchange.getScheme());
179         HttpDestination destination = getDestination(exchange.getAddress(), ssl);
180         destination.send(exchange);
181     }
182 
183     /* ------------------------------------------------------------ */
184     /**
185      * @return the threadpool
186      */
187     public ThreadPool getThreadPool()
188     {
189         return _threadPool;
190     }
191 
192     /* ------------------------------------------------------------ */
193     /** Set the ThreadPool.
194      * The threadpool passed is added via {@link #addBean(Object)} so that
195      * it's lifecycle may be managed as a {@link AggregateLifeCycle}.
196      * @param threadPool the threadPool to set
197      */
198     public void setThreadPool(ThreadPool threadPool)
199     {
200         removeBean(_threadPool);
201         _threadPool = threadPool;
202         addBean(_threadPool);
203     }
204 
205 
206     /* ------------------------------------------------------------ */
207     /**
208      * @param name
209      * @return Attribute associated with client
210      */
211     public Object getAttribute(String name)
212     {
213         return _attributes.getAttribute(name);
214     }
215 
216     /* ------------------------------------------------------------ */
217     /**
218      * @return names of attributes associated with client
219      */
220     public Enumeration getAttributeNames()
221     {
222         return _attributes.getAttributeNames();
223     }
224 
225     /* ------------------------------------------------------------ */
226     /**
227      * @param name
228      */
229     public void removeAttribute(String name)
230     {
231         _attributes.removeAttribute(name);
232     }
233 
234     /* ------------------------------------------------------------ */
235     /**
236      * Set an attribute on the HttpClient.
237      * Attributes are not used by the client, but are provided for
238      * so that users of a shared HttpClient may share other structures.
239      * @param name
240      * @param attribute
241      */
242     public void setAttribute(String name, Object attribute)
243     {
244         _attributes.setAttribute(name,attribute);
245     }
246 
247     /* ------------------------------------------------------------ */
248     public void clearAttributes()
249     {
250         _attributes.clearAttributes();
251     }
252 
253     /* ------------------------------------------------------------------------------- */
254     public HttpDestination getDestination(Address remote, boolean ssl) throws IOException
255     {
256         return getDestination(remote, ssl, getSslContextFactory());
257     }
258 
259     /* ------------------------------------------------------------------------------- */
260     public HttpDestination getDestination(Address remote, boolean ssl, SslContextFactory sslContextFactory) throws IOException
261     {
262         if (remote == null)
263             throw new UnknownHostException("Remote socket address cannot be null.");
264 
265         HttpDestination destination = _destinations.get(remote);
266         if (destination == null)
267         {
268             destination = new HttpDestination(this, remote, ssl, sslContextFactory);
269             if (_proxy != null && (_noProxy == null || !_noProxy.contains(remote.getHost())))
270             {
271                 destination.setProxy(_proxy);
272                 if (_proxyAuthentication != null)
273                     destination.setProxyAuthentication(_proxyAuthentication);
274             }
275             HttpDestination other =_destinations.putIfAbsent(remote, destination);
276             if (other!=null)
277                 destination=other;
278         }
279         return destination;
280     }
281     
282     /* ------------------------------------------------------------------------------- */
283     public Collection<Address> getDestinations()
284     {
285         return Collections.unmodifiableCollection(_destinations.keySet());
286     }
287     
288     /* ------------------------------------------------------------------------------- */
289     public void removeDestination(HttpDestination destination)
290     {
291         _destinations.remove(destination.getAddress(),destination);
292     }
293     
294     /* ------------------------------------------------------------ */
295     public void schedule(Timeout.Task task)
296     {
297         _timeoutQ.schedule(task);
298     }
299 
300     /* ------------------------------------------------------------ */
301     public void schedule(Timeout.Task task, long timeout)
302     {
303         _timeoutQ.schedule(task, timeout - _timeoutQ.getDuration());
304     }
305 
306     /* ------------------------------------------------------------ */
307     public void scheduleIdle(Timeout.Task task)
308     {
309         _idleTimeoutQ.schedule(task);
310     }
311 
312     /* ------------------------------------------------------------ */
313     public void cancel(Timeout.Task task)
314     {
315         task.cancel();
316     }
317 
318     /* ------------------------------------------------------------ */
319     /**
320      * Get whether the connector can use direct NIO buffers.
321      */
322     public boolean getUseDirectBuffers()
323     {
324         return _useDirectBuffers;
325     }
326 
327     /* ------------------------------------------------------------ */
328     /** Set a RealmResolver for client Authentication.
329      * If a realmResolver is set, then the HttpDestinations created by
330      * this client will instantiate a {@link SecurityListener} so that
331      * BASIC and DIGEST authentication can be performed.
332      * @param resolver
333      */
334     public void setRealmResolver(RealmResolver resolver)
335     {
336         _realmResolver = resolver;
337     }
338 
339     /* ------------------------------------------------------------ */
340     /**
341      * returns the SecurityRealmResolver reg_realmResolveristered with the HttpClient or null
342      *
343      * @return the SecurityRealmResolver reg_realmResolveristered with the HttpClient or null
344      */
345     public RealmResolver getRealmResolver()
346     {
347         return _realmResolver;
348     }
349 
350     /* ------------------------------------------------------------ */
351     public boolean hasRealms()
352     {
353         return _realmResolver == null ? false : true;
354     }
355 
356 
357     /* ------------------------------------------------------------ */
358     /**
359      * Registers a listener that can listen to the stream of execution between the client and the
360      * server and influence events.  Sequential calls to the method wrapper sequentially wrap the preceding
361      * listener in a delegation model.
362      * <p/>
363      * NOTE: the SecurityListener is a special listener which doesn't need to be added via this
364      * mechanic, if you register security realms then it will automatically be added as the top listener of the
365      * delegation stack.
366      *
367      * @param listenerClass
368      */
369     public void registerListener(String listenerClass)
370     {
371         if (_registeredListeners == null)
372         {
373             _registeredListeners = new LinkedList<String>();
374         }
375         _registeredListeners.add(listenerClass);
376     }
377 
378     /* ------------------------------------------------------------ */
379     public LinkedList<String> getRegisteredListeners()
380     {
381         return _registeredListeners;
382     }
383 
384 
385     /* ------------------------------------------------------------ */
386     /**
387      * Set to use NIO direct buffers.
388      *
389      * @param direct If True (the default), the connector can use NIO direct
390      *               buffers. Some JVMs have memory management issues (bugs) with
391      *               direct buffers.
392      */
393     public void setUseDirectBuffers(boolean direct)
394     {
395         _useDirectBuffers = direct;
396         setBufferTypes();
397     }
398 
399     /* ------------------------------------------------------------ */
400     /**
401      * Get the type of connector (socket, blocking or select) in use.
402      */
403     public int getConnectorType()
404     {
405         return _connectorType;
406     }
407 
408     /* ------------------------------------------------------------ */
409     public void setConnectorType(int connectorType)
410     {
411         this._connectorType = connectorType;
412         setBufferTypes();
413     }
414 
415     /* ------------------------------------------------------------ */
416     public int getMaxConnectionsPerAddress()
417     {
418         return _maxConnectionsPerAddress;
419     }
420 
421     /* ------------------------------------------------------------ */
422     public void setMaxConnectionsPerAddress(int maxConnectionsPerAddress)
423     {
424         _maxConnectionsPerAddress = maxConnectionsPerAddress;
425     }
426 
427     public int getMaxQueueSizePerAddress()
428     {
429         return _maxQueueSizePerAddress;
430     }
431 
432     public void setMaxQueueSizePerAddress(int maxQueueSizePerAddress)
433     {
434         this._maxQueueSizePerAddress = maxQueueSizePerAddress;
435     }
436 
437     /* ------------------------------------------------------------ */
438     @Override
439     protected void doStart() throws Exception
440     {
441         setBufferTypes();
442 
443         _timeoutQ.setDuration(_timeout);
444         _timeoutQ.setNow();
445         _idleTimeoutQ.setDuration(_idleTimeout);
446         _idleTimeoutQ.setNow();
447 
448         if (_threadPool==null)
449         {
450             QueuedThreadPool pool = new LocalQueuedThreadPool();
451             pool.setMaxThreads(16);
452             pool.setDaemon(true);
453             pool.setName("HttpClient");
454             _threadPool = pool;
455             addBean(_threadPool,true);
456         }
457 
458         _connector=(_connectorType == CONNECTOR_SELECT_CHANNEL)?new SelectConnector(this):new SocketConnector(this);
459         addBean(_connector,true);
460 
461         super.doStart();
462 
463         _threadPool.dispatch(new Runnable()
464         {
465             public void run()
466             {
467                 while (isRunning())
468                 {
469                     _timeoutQ.tick(System.currentTimeMillis());
470                     _idleTimeoutQ.tick(_timeoutQ.getNow());
471                     try
472                     {
473                         Thread.sleep(200);
474                     }
475                     catch (InterruptedException ignored)
476                     {
477                     }
478                 }
479             }
480         });
481     }
482 
483     /* ------------------------------------------------------------ */
484     @Override
485     protected void doStop() throws Exception
486     {
487         for (HttpDestination destination : _destinations.values())
488             destination.close();
489 
490         _timeoutQ.cancelAll();
491         _idleTimeoutQ.cancelAll();
492 
493         super.doStop();
494 
495         if (_threadPool instanceof LocalQueuedThreadPool)
496         {
497             removeBean(_threadPool);
498             _threadPool = null;
499         }
500 
501         removeBean(_connector);
502     }
503 
504     /* ------------------------------------------------------------ */
505     interface Connector extends LifeCycle
506     {
507         public void startConnection(HttpDestination destination) throws IOException;
508     }
509 
510     /* ------------------------------------------------------------ */
511     /**
512      * if a keystore location has been provided then client will attempt to use it as the keystore,
513      * otherwise we simply ignore certificates and run with a loose ssl context.
514      *
515      * @return the SSL context
516      */
517     protected SSLContext getSSLContext()
518     {
519         return _sslContextFactory.getSslContext();
520     }
521 
522     /* ------------------------------------------------------------ */
523     /**
524      * @return the instance of SslContextFactory associated with the client
525      */
526     public SslContextFactory getSslContextFactory()
527     {
528         return _sslContextFactory;
529     }
530 
531     /* ------------------------------------------------------------ */
532     /**
533      * @return the period in milliseconds a {@link AbstractHttpConnection} can be idle for before it is closed.
534      */
535     public long getIdleTimeout()
536     {
537         return _idleTimeout;
538     }
539 
540     /* ------------------------------------------------------------ */
541     /**
542      * @param ms the period in milliseconds a {@link AbstractHttpConnection} can be idle for before it is closed.
543      */
544     public void setIdleTimeout(long ms)
545     {
546         _idleTimeout = ms;
547     }
548 
549     /* ------------------------------------------------------------ */
550     /**
551      * @return the period in ms that an exchange will wait for a response from the server.
552      * @deprecated use {@link #getTimeout()} instead.
553      */
554     @Deprecated
555     public int getSoTimeout()
556     {
557         return Long.valueOf(getTimeout()).intValue();
558     }
559 
560     /* ------------------------------------------------------------ */
561     /**
562      * @deprecated use {@link #setTimeout(long)} instead.
563      * @param timeout the period in ms that an exchange will wait for a response from the server.
564      */
565     @Deprecated
566     public void setSoTimeout(int timeout)
567     {
568         setTimeout(timeout);
569     }
570 
571     /* ------------------------------------------------------------ */
572     /**
573      * @return the period in ms that an exchange will wait for a response from the server.
574      */
575     public long getTimeout()
576     {
577         return _timeout;
578     }
579 
580     /* ------------------------------------------------------------ */
581     /**
582      * @param timeout the period in ms that an exchange will wait for a response from the server.
583      */
584     public void setTimeout(long timeout)
585     {
586         _timeout = timeout;
587     }
588 
589     /* ------------------------------------------------------------ */
590     /**
591      * @return the period in ms before timing out an attempt to connect
592      */
593     public int getConnectTimeout()
594     {
595         return _connectTimeout;
596     }
597 
598     /* ------------------------------------------------------------ */
599     /**
600      * @param connectTimeout the period in ms before timing out an attempt to connect
601      */
602     public void setConnectTimeout(int connectTimeout)
603     {
604         this._connectTimeout = connectTimeout;
605     }
606 
607     /* ------------------------------------------------------------ */
608     public Address getProxy()
609     {
610         return _proxy;
611     }
612 
613     /* ------------------------------------------------------------ */
614     public void setProxy(Address proxy)
615     {
616         this._proxy = proxy;
617     }
618 
619     /* ------------------------------------------------------------ */
620     public Authentication getProxyAuthentication()
621     {
622         return _proxyAuthentication;
623     }
624 
625     /* ------------------------------------------------------------ */
626     public void setProxyAuthentication(Authentication authentication)
627     {
628         _proxyAuthentication = authentication;
629     }
630 
631     /* ------------------------------------------------------------ */
632     public boolean isProxied()
633     {
634         return this._proxy != null;
635     }
636 
637     /* ------------------------------------------------------------ */
638     public Set<String> getNoProxy()
639     {
640         return _noProxy;
641     }
642 
643     /* ------------------------------------------------------------ */
644     public void setNoProxy(Set<String> noProxyAddresses)
645     {
646         _noProxy = noProxyAddresses;
647     }
648 
649     /* ------------------------------------------------------------ */
650     public int maxRetries()
651     {
652         return _maxRetries;
653     }
654 
655     /* ------------------------------------------------------------ */
656     public void setMaxRetries(int retries)
657     {
658         _maxRetries = retries;
659     }
660 
661     /* ------------------------------------------------------------ */
662     public int maxRedirects()
663     {
664         return _maxRedirects;
665     }
666 
667     /* ------------------------------------------------------------ */
668     public void setMaxRedirects(int redirects)
669     {
670         _maxRedirects = redirects;
671     }
672 
673     public int getRequestBufferSize()
674     {
675         return _buffers.getRequestBufferSize();
676     }
677 
678     public void setRequestBufferSize(int requestBufferSize)
679     {
680         _buffers.setRequestBufferSize(requestBufferSize);
681     }
682 
683     public int getRequestHeaderSize()
684     {
685         return _buffers.getRequestHeaderSize();
686     }
687 
688     public void setRequestHeaderSize(int requestHeaderSize)
689     {
690         _buffers.setRequestHeaderSize(requestHeaderSize);
691     }
692 
693     public int getResponseBufferSize()
694     {
695         return _buffers.getResponseBufferSize();
696     }
697 
698     public void setResponseBufferSize(int responseBufferSize)
699     {
700         _buffers.setResponseBufferSize(responseBufferSize);
701     }
702 
703     public int getResponseHeaderSize()
704     {
705         return _buffers.getResponseHeaderSize();
706     }
707 
708     public void setResponseHeaderSize(int responseHeaderSize)
709     {
710         _buffers.setResponseHeaderSize(responseHeaderSize);
711     }
712 
713     public Type getRequestBufferType()
714     {
715         return _buffers.getRequestBufferType();
716     }
717 
718     public Type getRequestHeaderType()
719     {
720         return _buffers.getRequestHeaderType();
721     }
722 
723     public Type getResponseBufferType()
724     {
725         return _buffers.getResponseBufferType();
726     }
727 
728     public Type getResponseHeaderType()
729     {
730         return _buffers.getResponseHeaderType();
731     }
732 
733     public void setRequestBuffers(Buffers requestBuffers)
734     {
735         _buffers.setRequestBuffers(requestBuffers);
736     }
737 
738     public void setResponseBuffers(Buffers responseBuffers)
739     {
740         _buffers.setResponseBuffers(responseBuffers);
741     }
742 
743     public Buffers getRequestBuffers()
744     {
745         return _buffers.getRequestBuffers();
746     }
747 
748     public Buffers getResponseBuffers()
749     {
750         return _buffers.getResponseBuffers();
751     }
752 
753     public void setMaxBuffers(int maxBuffers)
754     {
755         _buffers.setMaxBuffers(maxBuffers);
756     }
757 
758     public int getMaxBuffers()
759     {
760         return _buffers.getMaxBuffers();
761     }
762 
763     /* ------------------------------------------------------------ */
764     @Deprecated
765     public String getTrustStoreLocation()
766     {
767         return _sslContextFactory.getTrustStore();
768     }
769 
770     /* ------------------------------------------------------------ */
771     @Deprecated
772     public void setTrustStoreLocation(String trustStoreLocation)
773     {
774         _sslContextFactory.setTrustStore(trustStoreLocation);
775     }
776 
777     /* ------------------------------------------------------------ */
778     @Deprecated
779     public InputStream getTrustStoreInputStream()
780     {
781         return _sslContextFactory.getTrustStoreInputStream();
782     }
783 
784     /* ------------------------------------------------------------ */
785     @Deprecated
786     public void setTrustStoreInputStream(InputStream trustStoreInputStream)
787     {
788         _sslContextFactory.setTrustStoreInputStream(trustStoreInputStream);
789     }
790 
791     /* ------------------------------------------------------------ */
792     @Deprecated
793     public String getKeyStoreLocation()
794     {
795         return _sslContextFactory.getKeyStorePath();
796     }
797 
798     /* ------------------------------------------------------------ */
799     @Deprecated
800     public void setKeyStoreLocation(String keyStoreLocation)
801     {
802         _sslContextFactory.setKeyStorePath(keyStoreLocation);
803     }
804 
805     @Deprecated
806     public InputStream getKeyStoreInputStream()
807     {
808         return _sslContextFactory.getKeyStoreInputStream();
809     }
810 
811     @Deprecated
812     public void setKeyStoreInputStream(InputStream keyStoreInputStream)
813     {
814         _sslContextFactory.setKeyStoreInputStream(keyStoreInputStream);
815     }
816 
817     /* ------------------------------------------------------------ */
818     @Deprecated
819     public void setKeyStorePassword(String keyStorePassword)
820     {
821         _sslContextFactory.setKeyStorePassword(keyStorePassword);
822     }
823 
824     /* ------------------------------------------------------------ */
825     @Deprecated
826     public void setKeyManagerPassword(String keyManagerPassword)
827     {
828         _sslContextFactory.setKeyManagerPassword(keyManagerPassword);
829     }
830 
831     /* ------------------------------------------------------------ */
832     @Deprecated
833     public void setTrustStorePassword(String trustStorePassword)
834     {
835         _sslContextFactory.setTrustStorePassword(trustStorePassword);
836     }
837 
838     /* ------------------------------------------------------------ */
839     @Deprecated
840     public String getKeyStoreType()
841     {
842         return _sslContextFactory.getKeyStoreType();
843     }
844 
845     /* ------------------------------------------------------------ */
846     @Deprecated
847     public void setKeyStoreType(String keyStoreType)
848     {
849         _sslContextFactory.setKeyStoreType(keyStoreType);
850     }
851 
852     /* ------------------------------------------------------------ */
853     @Deprecated
854     public String getTrustStoreType()
855     {
856         return _sslContextFactory.getTrustStoreType();
857     }
858 
859     /* ------------------------------------------------------------ */
860     @Deprecated
861     public void setTrustStoreType(String trustStoreType)
862     {
863         _sslContextFactory.setTrustStoreType(trustStoreType);
864     }
865 
866     /* ------------------------------------------------------------ */
867     @Deprecated
868     public String getKeyManagerAlgorithm()
869     {
870         return _sslContextFactory.getSslKeyManagerFactoryAlgorithm();
871     }
872 
873     /* ------------------------------------------------------------ */
874     @Deprecated
875     public void setKeyManagerAlgorithm(String keyManagerAlgorithm)
876     {
877         _sslContextFactory.setSslKeyManagerFactoryAlgorithm(keyManagerAlgorithm);
878     }
879 
880     /* ------------------------------------------------------------ */
881     @Deprecated
882     public String getTrustManagerAlgorithm()
883     {
884         return _sslContextFactory.getTrustManagerFactoryAlgorithm();
885     }
886 
887     /* ------------------------------------------------------------ */
888     @Deprecated
889     public void setTrustManagerAlgorithm(String trustManagerAlgorithm)
890     {
891         _sslContextFactory.setTrustManagerFactoryAlgorithm(trustManagerAlgorithm);
892     }
893 
894     /* ------------------------------------------------------------ */
895     @Deprecated
896     public String getProtocol()
897     {
898         return _sslContextFactory.getProtocol();
899     }
900 
901     /* ------------------------------------------------------------ */
902     @Deprecated
903     public void setProtocol(String protocol)
904     {
905         _sslContextFactory.setProtocol(protocol);
906     }
907 
908     /* ------------------------------------------------------------ */
909     @Deprecated
910     public String getProvider()
911     {
912         return _sslContextFactory.getProvider();
913     }
914 
915     /* ------------------------------------------------------------ */
916     @Deprecated
917     public void setProvider(String provider)
918     {
919         _sslContextFactory.setProvider(provider);
920     }
921 
922     /* ------------------------------------------------------------ */
923     @Deprecated
924     public String getSecureRandomAlgorithm()
925     {
926         return _sslContextFactory.getSecureRandomAlgorithm();
927     }
928 
929     /* ------------------------------------------------------------ */
930     @Deprecated
931     public void setSecureRandomAlgorithm(String secureRandomAlgorithm)
932     {
933         _sslContextFactory.setSecureRandomAlgorithm(secureRandomAlgorithm);
934     }
935 
936     private static class LocalQueuedThreadPool extends QueuedThreadPool
937     {
938     }
939 
940 }