hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1142715 [3/3] - in /httpcomponents/httpcore/trunk: httpcore-nio/src/main/java/org/apache/http/impl/nio/ httpcore-nio/src/main/java/org/apache/http/impl/nio/codecs/ httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/ httpcore-nio/s...
Date Mon, 04 Jul 2011 15:26:16 GMT
Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/HttpRequestExecutor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/HttpRequestExecutor.java?rev=1142715&r1=1142714&r2=1142715&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/HttpRequestExecutor.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/HttpRequestExecutor.java
Mon Jul  4 15:26:11 2011
@@ -39,6 +39,7 @@ import org.apache.http.HttpResponse;
 import org.apache.http.HttpStatus;
 import org.apache.http.HttpVersion;
 import org.apache.http.ProtocolVersion;
+import org.apache.http.annotation.Immutable;
 import org.apache.http.params.CoreProtocolPNames;
 
 /**
@@ -60,6 +61,7 @@ import org.apache.http.params.CoreProtoc
  *
  * @since 4.0
  */
+@Immutable
 public class HttpRequestExecutor {
 
     /**
@@ -313,7 +315,7 @@ public class HttpRequestExecutor {
      * <p>
      * This method does <i>not</i> read the response entity, if any.
      * The connection over which content of the response entity is being
-     * streamed from cannot be reused until 
+     * streamed from cannot be reused until
      * {@link org.apache.http.util.EntityUtils#consume(HttpEntity)}
      * has been invoked.
      *

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/HttpRequestHandlerRegistry.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/HttpRequestHandlerRegistry.java?rev=1142715&r1=1142714&r2=1142715&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/HttpRequestHandlerRegistry.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/HttpRequestHandlerRegistry.java
Mon Jul  4 15:26:11 2011
@@ -29,6 +29,8 @@ package org.apache.http.protocol;
 
 import java.util.Map;
 
+import org.apache.http.annotation.ThreadSafe;
+
 /**
  * Maintains a map of HTTP request handlers keyed by a request URI pattern.
  * <br>
@@ -46,6 +48,7 @@ import java.util.Map;
  *
  * @since 4.0
  */
+@ThreadSafe // provided injected dependencies are thread-safe
 public class HttpRequestHandlerRegistry implements HttpRequestHandlerResolver {
 
     private final UriPatternMatcher matcher;

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/HttpService.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/HttpService.java?rev=1142715&r1=1142714&r2=1142715&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/HttpService.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/HttpService.java
Mon Jul  4 15:26:11 2011
@@ -43,6 +43,7 @@ import org.apache.http.MethodNotSupporte
 import org.apache.http.ProtocolException;
 import org.apache.http.ProtocolVersion;
 import org.apache.http.UnsupportedHttpVersionException;
+import org.apache.http.annotation.Immutable;
 import org.apache.http.entity.ByteArrayEntity;
 import org.apache.http.params.HttpParams;
 import org.apache.http.params.DefaultedHttpParams;
@@ -68,6 +69,7 @@ import org.apache.http.util.EntityUtils;
  *
  * @since 4.0
  */
+@Immutable // provided injected dependencies are immutable and deprecated methods are not
used
 public class HttpService {
 
     /**

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/ImmutableHttpProcessor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/ImmutableHttpProcessor.java?rev=1142715&r1=1142714&r2=1142715&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/ImmutableHttpProcessor.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/ImmutableHttpProcessor.java
Mon Jul  4 15:26:11 2011
@@ -33,13 +33,14 @@ import org.apache.http.HttpRequest;
 import org.apache.http.HttpRequestInterceptor;
 import org.apache.http.HttpResponse;
 import org.apache.http.HttpResponseInterceptor;
+import org.apache.http.annotation.ThreadSafe;
 
 /**
  * Immutable {@link HttpProcessor}.
  *
  * @since 4.1
  */
-//@ThreadSafe
+@ThreadSafe // provided injected dependencies are immutable
 public final class ImmutableHttpProcessor implements HttpProcessor {
 
     private final HttpRequestInterceptor[] requestInterceptors;

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestConnControl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestConnControl.java?rev=1142715&r1=1142714&r2=1142715&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestConnControl.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestConnControl.java
Mon Jul  4 15:26:11 2011
@@ -32,6 +32,7 @@ import java.io.IOException;
 import org.apache.http.HttpException;
 import org.apache.http.HttpRequest;
 import org.apache.http.HttpRequestInterceptor;
+import org.apache.http.annotation.Immutable;
 
 /**
  * RequestConnControl is responsible for adding <code>Connection</code> header
@@ -41,6 +42,7 @@ import org.apache.http.HttpRequestInterc
  *
  * @since 4.0
  */
+@Immutable
 public class RequestConnControl implements HttpRequestInterceptor {
 
     public RequestConnControl() {

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestContent.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestContent.java?rev=1142715&r1=1142714&r2=1142715&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestContent.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestContent.java
Mon Jul  4 15:26:11 2011
@@ -37,6 +37,7 @@ import org.apache.http.HttpRequestInterc
 import org.apache.http.HttpVersion;
 import org.apache.http.ProtocolVersion;
 import org.apache.http.ProtocolException;
+import org.apache.http.annotation.Immutable;
 
 /**
  * RequestContent is the most important interceptor for outgoing requests.
@@ -48,6 +49,7 @@ import org.apache.http.ProtocolException
  *
  * @since 4.0
  */
+@Immutable
 public class RequestContent implements HttpRequestInterceptor {
 
     public RequestContent() {

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestDate.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestDate.java?rev=1142715&r1=1142714&r2=1142715&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestDate.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestDate.java
Mon Jul  4 15:26:11 2011
@@ -33,6 +33,7 @@ import org.apache.http.HttpException;
 import org.apache.http.HttpRequest;
 import org.apache.http.HttpEntityEnclosingRequest;
 import org.apache.http.HttpRequestInterceptor;
+import org.apache.http.annotation.ThreadSafe;
 
 /**
  * RequestDate interceptor is responsible for adding <code>Date</code> header
@@ -41,6 +42,7 @@ import org.apache.http.HttpRequestInterc
  *
  * @since 4.0
  */
+@ThreadSafe
 public class RequestDate implements HttpRequestInterceptor {
 
     private static final HttpDateGenerator DATE_GENERATOR = new HttpDateGenerator();

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestExpectContinue.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestExpectContinue.java?rev=1142715&r1=1142714&r2=1142715&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestExpectContinue.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestExpectContinue.java
Mon Jul  4 15:26:11 2011
@@ -36,6 +36,7 @@ import org.apache.http.HttpRequest;
 import org.apache.http.HttpRequestInterceptor;
 import org.apache.http.HttpVersion;
 import org.apache.http.ProtocolVersion;
+import org.apache.http.annotation.Immutable;
 import org.apache.http.params.HttpProtocolParams;
 
 /**
@@ -51,6 +52,7 @@ import org.apache.http.params.HttpProtoc
  *
  * @since 4.0
  */
+@Immutable
 public class RequestExpectContinue implements HttpRequestInterceptor {
 
     public RequestExpectContinue() {

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestTargetHost.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestTargetHost.java?rev=1142715&r1=1142714&r2=1142715&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestTargetHost.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestTargetHost.java
Mon Jul  4 15:26:11 2011
@@ -39,6 +39,7 @@ import org.apache.http.HttpRequestInterc
 import org.apache.http.HttpVersion;
 import org.apache.http.ProtocolVersion;
 import org.apache.http.ProtocolException;
+import org.apache.http.annotation.Immutable;
 
 /**
  * RequestTargetHost is responsible for adding <code>Host</code> header. This
@@ -46,6 +47,7 @@ import org.apache.http.ProtocolException
  *
  * @since 4.0
  */
+@Immutable
 public class RequestTargetHost implements HttpRequestInterceptor {
 
     public RequestTargetHost() {

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestUserAgent.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestUserAgent.java?rev=1142715&r1=1142714&r2=1142715&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestUserAgent.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestUserAgent.java
Mon Jul  4 15:26:11 2011
@@ -32,6 +32,7 @@ import java.io.IOException;
 import org.apache.http.HttpException;
 import org.apache.http.HttpRequest;
 import org.apache.http.HttpRequestInterceptor;
+import org.apache.http.annotation.Immutable;
 import org.apache.http.params.HttpProtocolParams;
 
 /**
@@ -46,6 +47,7 @@ import org.apache.http.params.HttpProtoc
  *
  * @since 4.0
  */
+@Immutable
 public class RequestUserAgent implements HttpRequestInterceptor {
 
     public RequestUserAgent() {

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/ResponseConnControl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/ResponseConnControl.java?rev=1142715&r1=1142714&r2=1142715&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/ResponseConnControl.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/ResponseConnControl.java
Mon Jul  4 15:26:11 2011
@@ -38,6 +38,7 @@ import org.apache.http.HttpResponseInter
 import org.apache.http.HttpStatus;
 import org.apache.http.HttpVersion;
 import org.apache.http.ProtocolVersion;
+import org.apache.http.annotation.Immutable;
 
 /**
  * ResponseConnControl is responsible for adding <code>Connection</code> header
@@ -47,6 +48,7 @@ import org.apache.http.ProtocolVersion;
  *
  * @since 4.0
  */
+@Immutable
 public class ResponseConnControl implements HttpResponseInterceptor {
 
     public ResponseConnControl() {

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/ResponseContent.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/ResponseContent.java?rev=1142715&r1=1142714&r2=1142715&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/ResponseContent.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/ResponseContent.java
Mon Jul  4 15:26:11 2011
@@ -37,6 +37,7 @@ import org.apache.http.HttpStatus;
 import org.apache.http.HttpVersion;
 import org.apache.http.ProtocolVersion;
 import org.apache.http.ProtocolException;
+import org.apache.http.annotation.Immutable;
 
 /**
  * ResponseContent is the most important interceptor for outgoing responses.
@@ -48,6 +49,7 @@ import org.apache.http.ProtocolException
  *
  * @since 4.0
  */
+@Immutable
 public class ResponseContent implements HttpResponseInterceptor {
 
     public ResponseContent() {

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/ResponseDate.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/ResponseDate.java?rev=1142715&r1=1142714&r2=1142715&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/ResponseDate.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/ResponseDate.java
Mon Jul  4 15:26:11 2011
@@ -33,6 +33,7 @@ import org.apache.http.HttpException;
 import org.apache.http.HttpResponse;
 import org.apache.http.HttpResponseInterceptor;
 import org.apache.http.HttpStatus;
+import org.apache.http.annotation.ThreadSafe;
 
 /**
  * ResponseDate is responsible for adding <code>Date<c/ode> header to the
@@ -41,6 +42,7 @@ import org.apache.http.HttpStatus;
  *
  * @since 4.0
  */
+@ThreadSafe
 public class ResponseDate implements HttpResponseInterceptor {
 
     private static final HttpDateGenerator DATE_GENERATOR = new HttpDateGenerator();

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/ResponseServer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/ResponseServer.java?rev=1142715&r1=1142714&r2=1142715&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/ResponseServer.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/ResponseServer.java
Mon Jul  4 15:26:11 2011
@@ -32,6 +32,7 @@ import java.io.IOException;
 import org.apache.http.HttpException;
 import org.apache.http.HttpResponse;
 import org.apache.http.HttpResponseInterceptor;
+import org.apache.http.annotation.Immutable;
 import org.apache.http.params.CoreProtocolPNames;
 
 /**
@@ -46,6 +47,7 @@ import org.apache.http.params.CoreProtoc
  *
  * @since 4.0
  */
+@Immutable
 public class ResponseServer implements HttpResponseInterceptor {
 
     public ResponseServer() {

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/SyncBasicHttpContext.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/SyncBasicHttpContext.java?rev=1142715&r1=1142714&r2=1142715&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/SyncBasicHttpContext.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/SyncBasicHttpContext.java
Mon Jul  4 15:26:11 2011
@@ -27,11 +27,14 @@
 
 package org.apache.http.protocol;
 
+import org.apache.http.annotation.ThreadSafe;
+
 /**
  * Thread-safe extension of the {@link BasicHttpContext}.
  *
  * @since 4.0
  */
+@ThreadSafe
 public class SyncBasicHttpContext extends BasicHttpContext {
 
     public SyncBasicHttpContext(final HttpContext parentContext) {

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/UriPatternMatcher.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/UriPatternMatcher.java?rev=1142715&r1=1142714&r2=1142715&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/UriPatternMatcher.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/UriPatternMatcher.java
Mon Jul  4 15:26:11 2011
@@ -31,6 +31,9 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 
+import org.apache.http.annotation.GuardedBy;
+import org.apache.http.annotation.ThreadSafe;
+
 /**
  * Maintains a map of objects keyed by a request URI pattern.
  * <br>
@@ -46,11 +49,10 @@ import java.util.Map;
  *
  * @since 4.0
  */
+@ThreadSafe
 public class UriPatternMatcher {
 
-    /**
-     * TODO: Replace with ConcurrentHashMap
-     */
+    @GuardedBy("this")
     private final Map<String, Object> map;
 
     public UriPatternMatcher() {

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/ByteArrayBuffer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/ByteArrayBuffer.java?rev=1142715&r1=1142714&r2=1142715&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/ByteArrayBuffer.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/ByteArrayBuffer.java
Mon Jul  4 15:26:11 2011
@@ -29,11 +29,14 @@ package org.apache.http.util;
 
 import java.io.Serializable;
 
+import org.apache.http.annotation.NotThreadSafe;
+
 /**
  * A resizable byte array.
  *
  * @since 4.0
  */
+@NotThreadSafe
 public final class ByteArrayBuffer implements Serializable {
 
     private static final long serialVersionUID = 4359112959524048036L;

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/CharArrayBuffer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/CharArrayBuffer.java?rev=1142715&r1=1142714&r2=1142715&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/CharArrayBuffer.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/util/CharArrayBuffer.java
Mon Jul  4 15:26:11 2011
@@ -29,6 +29,7 @@ package org.apache.http.util;
 
 import java.io.Serializable;
 
+import org.apache.http.annotation.NotThreadSafe;
 import org.apache.http.protocol.HTTP;
 
 /**
@@ -36,6 +37,7 @@ import org.apache.http.protocol.HTTP;
  *
  * @since 4.0
  */
+@NotThreadSafe
 public final class CharArrayBuffer implements Serializable {
 
     private static final long serialVersionUID = -6208952725094867135L;

Modified: httpcomponents/httpcore/trunk/src/docbkx/fundamentals.xml
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/src/docbkx/fundamentals.xml?rev=1142715&r1=1142714&r2=1142715&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/src/docbkx/fundamentals.xml (original)
+++ httpcomponents/httpcore/trunk/src/docbkx/fundamentals.xml Mon Jul  4 15:26:11 2011
@@ -493,49 +493,6 @@ HttpEntity entity = new FileEntity(stati
     "application/java-archive");
 ]]></programlisting>
             </section>
-            <section id="entity-template">
-                <title><classname>EntityTemplate</classname></title>
-                <para>
-                This is an entity which receives its content from a 
-                <interfacename>ContentProducer</interfacename> interface. Content
producers are 
-                objects which produce their content on demand, by writing it out to an output

-                stream. They are expected to be able produce their content every time they
are 
-                requested to do so. So creating a <classname>EntityTemplate</classname>,
one is 
-                expected to supply a reference to a content producer, which effectively creates

-                a repeatable entity.
-                </para>
-                <para>
-                There are no standard content producers in HttpCore. It is basically just
a 
-                convenience interface to allow wrapping up complex logic into an entity.
To use 
-                this entity one needs to create a class that implements <interfacename>
-                ContentProducer</interfacename> and override the <methodname>
-                ContentProducer#writeTo(OutputStream)</methodname> method. Then, an
instance of 
-                custom <interfacename>ContentProducer</interfacename> will be
used to write the 
-                full content body to the output stream. For instance, an HTTP server would
serve 
-                static files with the <classname>FileEntity</classname>, but
running CGI programs 
-                could be done with a <interfacename>ContentProducer</interfacename>,
inside which 
-                one could implement custom logic to supply the content as it becomes available.

-                This way one does not need to buffer it in a string and then use a <classname>
-                StringEntity</classname> or <classname>ByteArrayEntity</classname>.
-                </para>
-                <programlisting><![CDATA[
-ContentProducer myContentProducer = new ContentProducer() {
-
-    public void writeTo(OutputStream out) throws IOException {
-      out.write("ContentProducer rocks! ".getBytes());
-      out.write(("Time requested: " + new Date()).getBytes());
-    }
-    
-};
-
-HttpEntity myEntity = new EntityTemplate(myContentProducer);
-myEntity.writeTo(System.out);
-]]></programlisting>
-                <para>stdout &gt;</para>
-                <programlisting><![CDATA[
-ContentProducer rocks! Time requested: Fri Sep 05 12:20:22 CEST 2008
-]]></programlisting>
-</section>
             <section id="entity-wrapper">
                 <title><classname>HttpEntityWrapper</classname></title>
                 <para>



Mime
View raw message