hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r805956 - in /httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio: NHttpConnectionBase.java SessionHttpContext.java
Date Wed, 19 Aug 2009 20:02:26 GMT
Author: olegk
Date: Wed Aug 19 20:02:25 2009
New Revision: 805956

URL: http://svn.apache.org/viewvc?rev=805956&view=rev
Log:
HttpContext backed by IOSession context

Added:
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/SessionHttpContext.java
  (with props)
Modified:
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/NHttpConnectionBase.java

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/NHttpConnectionBase.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/NHttpConnectionBase.java?rev=805956&r1=805955&r2=805956&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/NHttpConnectionBase.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/NHttpConnectionBase.java
Wed Aug 19 20:02:25 2009
@@ -70,7 +70,6 @@
 import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.HTTP;
 import org.apache.http.protocol.HttpContext;
-import org.apache.http.protocol.SyncBasicHttpContext;
 
 /**
  * This class serves as a base for all {@link NHttpConnection} implementations
@@ -130,7 +129,7 @@
             throw new IllegalArgumentException("HTTP params may not be null");
         }
         this.session = session;
-        this.context = new SyncBasicHttpContext(null);
+        this.context = new SessionHttpContext(session);
         
         int buffersize = HttpConnectionParams.getSocketBufferSize(params);
         int linebuffersize = buffersize;

Added: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/SessionHttpContext.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/SessionHttpContext.java?rev=805956&view=auto
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/SessionHttpContext.java
(added)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/SessionHttpContext.java
Wed Aug 19 20:02:25 2009
@@ -0,0 +1,54 @@
+/*
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
+
+package org.apache.http.impl.nio;
+
+import org.apache.http.nio.reactor.IOSession;
+import org.apache.http.protocol.HttpContext;
+
+class SessionHttpContext implements HttpContext {
+
+    private final IOSession iosession;
+    
+    public SessionHttpContext(final IOSession iosession) {
+        super();
+        this.iosession = iosession;
+    }
+    
+    public Object getAttribute(final String id) {
+        return this.iosession.getAttribute(id);
+    }
+
+    public Object removeAttribute(final String id) {
+        return this.iosession.removeAttribute(id);
+    }
+
+    public void setAttribute(final String id, final Object obj) {
+        this.iosession.setAttribute(id, obj);
+    }
+    
+}

Propchange: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/SessionHttpContext.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/SessionHttpContext.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/SessionHttpContext.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message