• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * $HeadURL: http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/conn/tsccm/BasicPooledConnAdapter.java $
3  * $Revision: 653214 $
4  * $Date: 2008-05-04 07:12:13 -0700 (Sun, 04 May 2008) $
5  *
6  * ====================================================================
7  *
8  *  Licensed to the Apache Software Foundation (ASF) under one or more
9  *  contributor license agreements.  See the NOTICE file distributed with
10  *  this work for additional information regarding copyright ownership.
11  *  The ASF licenses this file to You under the Apache License, Version 2.0
12  *  (the "License"); you may not use this file except in compliance with
13  *  the License.  You may obtain a copy of the License at
14  *
15  *      http://www.apache.org/licenses/LICENSE-2.0
16  *
17  *  Unless required by applicable law or agreed to in writing, software
18  *  distributed under the License is distributed on an "AS IS" BASIS,
19  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  *  See the License for the specific language governing permissions and
21  *  limitations under the License.
22  * ====================================================================
23  *
24  * This software consists of voluntary contributions made by many
25  * individuals on behalf of the Apache Software Foundation.  For more
26  * information on the Apache Software Foundation, please see
27  * <http://www.apache.org/>.
28  *
29  */
30 
31 package org.apache.http.impl.conn.tsccm;
32 
33 
34 import org.apache.http.conn.ClientConnectionManager;
35 import org.apache.http.impl.conn.AbstractPoolEntry;
36 import org.apache.http.impl.conn.AbstractPooledConnAdapter;
37 
38 
39 
40 /**
41  * A connection wrapper and callback handler.
42  * All connections given out by the manager are wrappers which
43  * can be {@link #detach detach}ed to prevent further use on release.
44  *
45  * @deprecated Please use {@link java.net.URL#openConnection} instead.
46  *     Please visit <a href="http://android-developers.blogspot.com/2011/09/androids-http-clients.html">this webpage</a>
47  *     for further details.
48  */
49 @Deprecated
50 public class BasicPooledConnAdapter extends AbstractPooledConnAdapter {
51 
52     /**
53      * Creates a new adapter.
54      *
55      * @param tsccm   the connection manager
56      * @param entry   the pool entry for the connection being wrapped
57      */
BasicPooledConnAdapter(ThreadSafeClientConnManager tsccm, AbstractPoolEntry entry)58     protected BasicPooledConnAdapter(ThreadSafeClientConnManager tsccm,
59                                AbstractPoolEntry entry) {
60         super(tsccm, entry);
61         markReusable();
62     }
63 
64 
65     @Override
getManager()66     protected ClientConnectionManager getManager() {
67         // override needed only to make method visible in this package
68         return super.getManager();
69     }
70 
71 
72     /**
73      * Obtains the pool entry.
74      *
75      * @return  the pool entry, or <code>null</code> if detached
76      */
getPoolEntry()77     protected AbstractPoolEntry getPoolEntry() {
78         return super.poolEntry;
79     }
80 
81 
82     // non-javadoc, see base class
83     @Override
detach()84     protected void detach() {
85         // override needed only to make method visible in this package
86         super.detach();
87     }
88 }
89