incubator-deft-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmee...@apache.org
Subject svn commit: r1153959 [1/3] - in /incubator/deft/sandbox: ./ src/main/java/org/apache/ src/main/java/org/apache/deft/ src/main/java/org/apache/deft/annotation/ src/main/java/org/apache/deft/configuration/ src/main/java/org/apache/deft/example/ src/main/...
Date Thu, 04 Aug 2011 18:35:54 GMT
Author: jmeehan
Date: Thu Aug  4 18:35:27 2011
New Revision: 1153959

URL: http://svn.apache.org/viewvc?rev=1153959&view=rev
Log:
DEFT-157 - Renamed package; formatted code.

Added:
    incubator/deft/sandbox/src/main/java/org/apache/
    incubator/deft/sandbox/src/main/java/org/apache/deft/
    incubator/deft/sandbox/src/main/java/org/apache/deft/annotation/
      - copied from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/annotation/
    incubator/deft/sandbox/src/main/java/org/apache/deft/configuration/
      - copied from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/configuration/
    incubator/deft/sandbox/src/main/java/org/apache/deft/example/
    incubator/deft/sandbox/src/main/java/org/apache/deft/example/DeftServerExample.java
      - copied, changed from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/example/DeftServerExample.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/example/client/
      - copied from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/example/client/
    incubator/deft/sandbox/src/main/java/org/apache/deft/example/handler/
      - copied from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/example/handler/
    incubator/deft/sandbox/src/main/java/org/apache/deft/example/keyvalue/
      - copied from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/example/keyvalue/
    incubator/deft/sandbox/src/main/java/org/apache/deft/io/
    incubator/deft/sandbox/src/main/java/org/apache/deft/io/AsynchronousSocket.java
      - copied, changed from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/io/AsynchronousSocket.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/io/IOHandler.java
      - copied, changed from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/io/IOHandler.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/io/IOLoop.java
      - copied, changed from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/io/IOLoop.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/io/IOLoopMXBean.java
      - copied, changed from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/io/IOLoopMXBean.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/io/buffer/
      - copied from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/io/buffer/
    incubator/deft/sandbox/src/main/java/org/apache/deft/io/callback/
      - copied from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/io/callback/
    incubator/deft/sandbox/src/main/java/org/apache/deft/io/timeout/
      - copied from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/io/timeout/
    incubator/deft/sandbox/src/main/java/org/apache/deft/util/
      - copied from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/util/
    incubator/deft/sandbox/src/main/java/org/apache/deft/web/
    incubator/deft/sandbox/src/main/java/org/apache/deft/web/Application.java
      - copied, changed from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/web/Application.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/web/AsyncCallback.java
      - copied, changed from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/web/AsyncCallback.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/web/AsyncResult.java
      - copied, changed from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/web/AsyncResult.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/web/Asynchronous.java
      - copied, changed from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/web/Asynchronous.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/web/Authenticated.java
      - copied, changed from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/web/Authenticated.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/web/HttpServer.java
      - copied, changed from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/web/HttpServer.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/web/HttpVerb.java
      - copied, changed from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/web/HttpVerb.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/web/handler/
      - copied from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/web/handler/
    incubator/deft/sandbox/src/main/java/org/apache/deft/web/http/
    incubator/deft/sandbox/src/main/java/org/apache/deft/web/http/ContentType.java
      - copied, changed from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/web/http/ContentType.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/web/http/HttpException.java
      - copied, changed from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/web/http/HttpException.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/web/http/HttpProtocol.java
      - copied, changed from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/web/http/HttpProtocol.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/web/http/HttpRequest.java
      - copied, changed from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/web/http/HttpRequest.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/web/http/HttpRequestDispatcher.java
      - copied, changed from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/web/http/HttpRequestDispatcher.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/web/http/HttpRequestImpl.java
      - copied, changed from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/web/http/HttpRequestImpl.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/web/http/HttpResponse.java
      - copied, changed from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/web/http/HttpResponse.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/web/http/HttpResponseImpl.java
      - copied, changed from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/web/http/HttpResponseImpl.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/web/http/HttpServerDescriptor.java
      - copied, changed from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/web/http/HttpServerDescriptor.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/web/http/MalFormedHttpRequest.java
      - copied, changed from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/web/http/MalFormedHttpRequest.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/web/http/PartialHttpRequest.java
      - copied, changed from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/web/http/PartialHttpRequest.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/web/http/client/
      - copied from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/web/http/client/
    incubator/deft/sandbox/src/test/java/org/apache/
    incubator/deft/sandbox/src/test/java/org/apache/deft/
    incubator/deft/sandbox/src/test/java/org/apache/deft/configuration/
      - copied from r1153694, incubator/deft/sandbox/src/test/java/org/deftserver/configuration/
    incubator/deft/sandbox/src/test/java/org/apache/deft/io/
    incubator/deft/sandbox/src/test/java/org/apache/deft/io/AsynchronousSocketTest.java
      - copied, changed from r1153694, incubator/deft/sandbox/src/test/java/org/deftserver/io/AsynchronousSocketTest.java
    incubator/deft/sandbox/src/test/java/org/apache/deft/io/buffer/
      - copied from r1153694, incubator/deft/sandbox/src/test/java/org/deftserver/io/buffer/
    incubator/deft/sandbox/src/test/java/org/apache/deft/io/callback/
      - copied from r1153694, incubator/deft/sandbox/src/test/java/org/deftserver/io/callback/
    incubator/deft/sandbox/src/test/java/org/apache/deft/io/timeout/
      - copied from r1153694, incubator/deft/sandbox/src/test/java/org/deftserver/io/timeout/
    incubator/deft/sandbox/src/test/java/org/apache/deft/util/
      - copied from r1153694, incubator/deft/sandbox/src/test/java/org/deftserver/util/
    incubator/deft/sandbox/src/test/java/org/apache/deft/web/
    incubator/deft/sandbox/src/test/java/org/apache/deft/web/ApplicationTest.java
      - copied, changed from r1153694, incubator/deft/sandbox/src/test/java/org/deftserver/web/ApplicationTest.java
    incubator/deft/sandbox/src/test/java/org/apache/deft/web/DeftSystemTest.java
      - copied, changed from r1153694, incubator/deft/sandbox/src/test/java/org/deftserver/web/DeftSystemTest.java
    incubator/deft/sandbox/src/test/java/org/apache/deft/web/HttpServerTest.java
      - copied, changed from r1153694, incubator/deft/sandbox/src/test/java/org/deftserver/web/HttpServerTest.java
    incubator/deft/sandbox/src/test/java/org/apache/deft/web/HttpVerbTest.java
      - copied, changed from r1153694, incubator/deft/sandbox/src/test/java/org/deftserver/web/HttpVerbTest.java
    incubator/deft/sandbox/src/test/java/org/apache/deft/web/handler/
      - copied from r1153694, incubator/deft/sandbox/src/test/java/org/deftserver/web/handler/
    incubator/deft/sandbox/src/test/java/org/apache/deft/web/http/
    incubator/deft/sandbox/src/test/java/org/apache/deft/web/http/ContentTypeTest.java
      - copied, changed from r1153694, incubator/deft/sandbox/src/test/java/org/deftserver/web/http/ContentTypeTest.java
    incubator/deft/sandbox/src/test/java/org/apache/deft/web/http/HttpRequestImplTest.java
      - copied, changed from r1153694, incubator/deft/sandbox/src/test/java/org/deftserver/web/http/HttpRequestTest.java
    incubator/deft/sandbox/src/test/java/org/apache/deft/web/http/client/
      - copied from r1153694, incubator/deft/sandbox/src/test/java/org/deftserver/web/http/client/
Removed:
    incubator/deft/sandbox/src/main/java/org/deftserver/annotation/
    incubator/deft/sandbox/src/main/java/org/deftserver/configuration/
    incubator/deft/sandbox/src/main/java/org/deftserver/example/DeftServerExample.java
    incubator/deft/sandbox/src/main/java/org/deftserver/example/client/
    incubator/deft/sandbox/src/main/java/org/deftserver/example/handler/
    incubator/deft/sandbox/src/main/java/org/deftserver/example/keyvalue/
    incubator/deft/sandbox/src/main/java/org/deftserver/io/AsynchronousSocket.java
    incubator/deft/sandbox/src/main/java/org/deftserver/io/IOHandler.java
    incubator/deft/sandbox/src/main/java/org/deftserver/io/IOLoop.java
    incubator/deft/sandbox/src/main/java/org/deftserver/io/IOLoopMXBean.java
    incubator/deft/sandbox/src/main/java/org/deftserver/io/buffer/
    incubator/deft/sandbox/src/main/java/org/deftserver/io/callback/
    incubator/deft/sandbox/src/main/java/org/deftserver/io/timeout/
    incubator/deft/sandbox/src/main/java/org/deftserver/util/
    incubator/deft/sandbox/src/main/java/org/deftserver/web/Application.java
    incubator/deft/sandbox/src/main/java/org/deftserver/web/AsyncCallback.java
    incubator/deft/sandbox/src/main/java/org/deftserver/web/AsyncResult.java
    incubator/deft/sandbox/src/main/java/org/deftserver/web/Asynchronous.java
    incubator/deft/sandbox/src/main/java/org/deftserver/web/Authenticated.java
    incubator/deft/sandbox/src/main/java/org/deftserver/web/HttpServer.java
    incubator/deft/sandbox/src/main/java/org/deftserver/web/HttpVerb.java
    incubator/deft/sandbox/src/main/java/org/deftserver/web/handler/
    incubator/deft/sandbox/src/main/java/org/deftserver/web/http/ContentType.java
    incubator/deft/sandbox/src/main/java/org/deftserver/web/http/HttpException.java
    incubator/deft/sandbox/src/main/java/org/deftserver/web/http/HttpProtocol.java
    incubator/deft/sandbox/src/main/java/org/deftserver/web/http/HttpRequest.java
    incubator/deft/sandbox/src/main/java/org/deftserver/web/http/HttpRequestDispatcher.java
    incubator/deft/sandbox/src/main/java/org/deftserver/web/http/HttpRequestImpl.java
    incubator/deft/sandbox/src/main/java/org/deftserver/web/http/HttpResponse.java
    incubator/deft/sandbox/src/main/java/org/deftserver/web/http/HttpResponseImpl.java
    incubator/deft/sandbox/src/main/java/org/deftserver/web/http/HttpServerDescriptor.java
    incubator/deft/sandbox/src/main/java/org/deftserver/web/http/MalFormedHttpRequest.java
    incubator/deft/sandbox/src/main/java/org/deftserver/web/http/PartialHttpRequest.java
    incubator/deft/sandbox/src/main/java/org/deftserver/web/http/client/
    incubator/deft/sandbox/src/test/java/org/deftserver/configuration/
    incubator/deft/sandbox/src/test/java/org/deftserver/io/AsynchronousSocketTest.java
    incubator/deft/sandbox/src/test/java/org/deftserver/io/buffer/
    incubator/deft/sandbox/src/test/java/org/deftserver/io/callback/
    incubator/deft/sandbox/src/test/java/org/deftserver/io/timeout/
    incubator/deft/sandbox/src/test/java/org/deftserver/util/
    incubator/deft/sandbox/src/test/java/org/deftserver/web/ApplicationTest.java
    incubator/deft/sandbox/src/test/java/org/deftserver/web/DeftSystemTest.java
    incubator/deft/sandbox/src/test/java/org/deftserver/web/HttpServerTest.java
    incubator/deft/sandbox/src/test/java/org/deftserver/web/HttpVerbTest.java
    incubator/deft/sandbox/src/test/java/org/deftserver/web/handler/
    incubator/deft/sandbox/src/test/java/org/deftserver/web/http/ContentTypeTest.java
    incubator/deft/sandbox/src/test/java/org/deftserver/web/http/HttpRequestTest.java
    incubator/deft/sandbox/src/test/java/org/deftserver/web/http/client/
Modified:
    incubator/deft/sandbox/CHANGES.txt
    incubator/deft/sandbox/NEWS.txt
    incubator/deft/sandbox/NOTICE.txt
    incubator/deft/sandbox/README.md
    incubator/deft/sandbox/pom.xml
    incubator/deft/sandbox/src/main/java/org/apache/deft/annotation/Path.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/configuration/AnnotationsScanner.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/configuration/Configuration.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/example/client/AsynchronousHttpClientGetExample.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/example/client/AsynchronousHttpClientPostExample.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/example/handler/BasicHandlerExample.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/example/handler/CookieHandlerExample.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/example/handler/PatternHandlerExample.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/example/keyvalue/KeyValueStore.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/example/keyvalue/KeyValueStoreClient.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/example/keyvalue/KeyValueStoreExample.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/example/keyvalue/KeyValueStoreHandler.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/io/buffer/DynamicByteBuffer.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/io/callback/CallbackManager.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/io/callback/CallbackManagerMXBean.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/io/callback/JMXDebuggableCallbackManager.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/io/callback/PeriodicCallback.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/io/timeout/JMXDebuggableTimeoutManager.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/io/timeout/Timeout.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/io/timeout/TimeoutManager.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/io/timeout/TimeoutManagerMXBean.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/util/AcceptUtil.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/util/ArrayUtil.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/util/Closeables.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/util/CookieUtil.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/util/DateUtil.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/util/HttpUtil.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/util/KnuthMorrisPrattAlgorithm.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/util/MXBeanUtil.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/util/NopAsyncResult.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/util/Pair.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/util/ReflectionTools.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/util/UrlUtil.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/web/handler/BadRequestRequestHandler.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/web/handler/ForbiddenRequestHandler.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/web/handler/NotFoundRequestHandler.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/web/handler/RequestHandler.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/web/handler/StaticContentHandler.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/web/http/client/AsynchronousHttpClient.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/web/http/client/Request.java
    incubator/deft/sandbox/src/main/java/org/apache/deft/web/http/client/Response.java
    incubator/deft/sandbox/src/main/resources/logback.xml
    incubator/deft/sandbox/src/test/java/org/apache/deft/configuration/AnnotationsScannerTest.java
    incubator/deft/sandbox/src/test/java/org/apache/deft/configuration/ConfigurationTest.java
    incubator/deft/sandbox/src/test/java/org/apache/deft/io/buffer/DynamicByteBufferTest.java
    incubator/deft/sandbox/src/test/java/org/apache/deft/io/callback/JMXDebuggableCallbackManagerTest.java
    incubator/deft/sandbox/src/test/java/org/apache/deft/io/callback/PeriodicCallbackTest.java
    incubator/deft/sandbox/src/test/java/org/apache/deft/io/timeout/JMXDebuggableTimeoutManagerTest.java
    incubator/deft/sandbox/src/test/java/org/apache/deft/io/timeout/TimeoutTest.java
    incubator/deft/sandbox/src/test/java/org/apache/deft/util/DateUtilTest.java
    incubator/deft/sandbox/src/test/java/org/apache/deft/util/HttpRequestHelper.java
    incubator/deft/sandbox/src/test/java/org/apache/deft/util/ReflectionToolsTest.java
    incubator/deft/sandbox/src/test/java/org/apache/deft/util/UrlUtilTest.java
    incubator/deft/sandbox/src/test/java/org/apache/deft/web/handler/RequestHandlerTest.java
    incubator/deft/sandbox/src/test/java/org/apache/deft/web/http/client/AsynchronousHttpClientTest.java
    incubator/deft/sandbox/src/test/java/org/apache/deft/web/http/client/RequestTest.java

Modified: incubator/deft/sandbox/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/deft/sandbox/CHANGES.txt?rev=1153959&r1=1153958&r2=1153959&view=diff
==============================================================================
--- incubator/deft/sandbox/CHANGES.txt (original)
+++ incubator/deft/sandbox/CHANGES.txt Thu Aug  4 18:35:27 2011
@@ -15,13 +15,14 @@
 #    limitations under the License.
 #############################################################################
 0.4.0
- * Renaming org.deftserver.web.http.client.{HttpRequest.java -> Request.java} and
-   org.deftserver.web.http.client.{HttpResponse.java -> Response.java}.
+ * Renaming org.apache.web.http.client.{HttpRequest.java -> Request.java} and
+   org.apache.web.http.client.{HttpResponse.java -> Response.java}.
  * o.d.io.timeout.Timeout.newKeepAliveTimeout now requires that you specifies an ioloop explicitly (previously the 
    global singleton was used implicitly.)
  * AsynchronousSocket no longer accepts SelectableChannel. Instead SocketChannel is used.
  * AsynchronousSocket's read methods (readUntil and readBytes) returns raw byte[] instead of String. (DEFT-115)
  * RequestHandler implementations are now configured through annotation (DEFT-100).
+ * Package renamed "org.apache.deft", from "org.deftserver" (DEFT-157).
 
 0.1.1
  * #56 (Support for all response status codes)

Modified: incubator/deft/sandbox/NEWS.txt
URL: http://svn.apache.org/viewvc/incubator/deft/sandbox/NEWS.txt?rev=1153959&r1=1153958&r2=1153959&view=diff
==============================================================================
--- incubator/deft/sandbox/NEWS.txt (original)
+++ incubator/deft/sandbox/NEWS.txt Thu Aug  4 18:35:27 2011
@@ -19,7 +19,7 @@ Features / Improvements
     
 Configuration
 -------------
-     - See org.deftserver.example.DeftServerExample (or www.deftserver.org) for
+     - See org.apache.deft.example.DeftServerExample (or www.deftserver.org) for
        configuration and usage hints.
 
 

Modified: incubator/deft/sandbox/NOTICE.txt
URL: http://svn.apache.org/viewvc/incubator/deft/sandbox/NOTICE.txt?rev=1153959&r1=1153958&r2=1153959&view=diff
==============================================================================
--- incubator/deft/sandbox/NOTICE.txt (original)
+++ incubator/deft/sandbox/NOTICE.txt Thu Aug  4 18:35:27 2011
@@ -14,7 +14,7 @@ Copyright (C) 2005-2010 Apache Software 
 
 javax.activation (using javax.activation.MimetypesFileTypeMap for mime-type header deduction)
 http://download.oracle.com/javase/6/docs/api/javax/activation/package-summary.html
-Copyright © 1993, 2010, Oracle and/or its affiliates. 
+Copyright (C) 1993, 2010, Oracle and/or its affiliates. 
 
 Asynchronous Http client library used by unit tests.
 https://github.com/AsyncHttpClient/async-http-client

Modified: incubator/deft/sandbox/README.md
URL: http://svn.apache.org/viewvc/incubator/deft/sandbox/README.md?rev=1153959&r1=1153958&r2=1153959&view=diff
==============================================================================
--- incubator/deft/sandbox/README.md (original)
+++ incubator/deft/sandbox/README.md Thu Aug  4 18:35:27 2011
@@ -10,10 +10,7 @@ Source and issue tracker: [http://github
  
 Documentation: [http://www.deftserver.org]
 
-Continuous Integration: [http://savagesprout.com:8180/jenkins/]
-
 [Apache version 2]: http://www.apache.org/licenses/LICENSE-2.0.html
 [facebook/tornado]: http://github.com/facebook/tornado
 [http://github.com/rschildmeijer/deft]: http://github.com/rschildmeijer/deft
 [http://www.deftserver.org]: http://www.deftserver.org
-[http://savagesprout.com:8180/jenkins/]: http://savagesprout.com:8180/jenkins/

Modified: incubator/deft/sandbox/pom.xml
URL: http://svn.apache.org/viewvc/incubator/deft/sandbox/pom.xml?rev=1153959&r1=1153958&r2=1153959&view=diff
==============================================================================
--- incubator/deft/sandbox/pom.xml (original)
+++ incubator/deft/sandbox/pom.xml Thu Aug  4 18:35:27 2011
@@ -17,7 +17,7 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 	<modelVersion>4.0.0</modelVersion>
-	<groupId>org.deftserver</groupId>
+	<groupId>org.apache.deft</groupId>
 	<artifactId>deft</artifactId>
 	<version>0.4.0-SNAPSHOT</version>
 
@@ -144,7 +144,6 @@
 				<artifactId>maven-javadoc-plugin</artifactId>
 				<version>2.7</version>
 				<configuration />
-
 				<executions>
 					<execution>
 						<id>aggregate</id>

Modified: incubator/deft/sandbox/src/main/java/org/apache/deft/annotation/Path.java
URL: http://svn.apache.org/viewvc/incubator/deft/sandbox/src/main/java/org/apache/deft/annotation/Path.java?rev=1153959&r1=1153694&r2=1153959&view=diff
==============================================================================
--- incubator/deft/sandbox/src/main/java/org/apache/deft/annotation/Path.java (original)
+++ incubator/deft/sandbox/src/main/java/org/apache/deft/annotation/Path.java Thu Aug  4 18:35:27 2011
@@ -17,7 +17,7 @@
  *  under the License. 
  *  
  */
-package org.deftserver.annotation;
+package org.apache.deft.annotation;
 
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;

Modified: incubator/deft/sandbox/src/main/java/org/apache/deft/configuration/AnnotationsScanner.java
URL: http://svn.apache.org/viewvc/incubator/deft/sandbox/src/main/java/org/apache/deft/configuration/AnnotationsScanner.java?rev=1153959&r1=1153694&r2=1153959&view=diff
==============================================================================
--- incubator/deft/sandbox/src/main/java/org/apache/deft/configuration/AnnotationsScanner.java (original)
+++ incubator/deft/sandbox/src/main/java/org/apache/deft/configuration/AnnotationsScanner.java Thu Aug  4 18:35:27 2011
@@ -17,7 +17,7 @@
  *  under the License. 
  *  
  */
-package org.deftserver.configuration;
+package org.apache.deft.configuration;
 
 import java.io.File;
 import java.io.IOException;
@@ -28,9 +28,9 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.deftserver.annotation.Path;
-import org.deftserver.util.ReflectionTools;
-import org.deftserver.web.handler.RequestHandler;
+import org.apache.deft.annotation.Path;
+import org.apache.deft.util.ReflectionTools;
+import org.apache.deft.web.handler.RequestHandler;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: incubator/deft/sandbox/src/main/java/org/apache/deft/configuration/Configuration.java
URL: http://svn.apache.org/viewvc/incubator/deft/sandbox/src/main/java/org/apache/deft/configuration/Configuration.java?rev=1153959&r1=1153694&r2=1153959&view=diff
==============================================================================
--- incubator/deft/sandbox/src/main/java/org/apache/deft/configuration/Configuration.java (original)
+++ incubator/deft/sandbox/src/main/java/org/apache/deft/configuration/Configuration.java Thu Aug  4 18:35:27 2011
@@ -17,9 +17,9 @@
  *  under the License. 
  *  
  */
-package org.deftserver.configuration;
+package org.apache.deft.configuration;
 
-import org.deftserver.web.HttpServer;
+import org.apache.deft.web.HttpServer;
 
 import com.google.common.base.Strings;
 

Copied: incubator/deft/sandbox/src/main/java/org/apache/deft/example/DeftServerExample.java (from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/example/DeftServerExample.java)
URL: http://svn.apache.org/viewvc/incubator/deft/sandbox/src/main/java/org/apache/deft/example/DeftServerExample.java?p2=incubator/deft/sandbox/src/main/java/org/apache/deft/example/DeftServerExample.java&p1=incubator/deft/sandbox/src/main/java/org/deftserver/example/DeftServerExample.java&r1=1153694&r2=1153959&rev=1153959&view=diff
==============================================================================
--- incubator/deft/sandbox/src/main/java/org/deftserver/example/DeftServerExample.java (original)
+++ incubator/deft/sandbox/src/main/java/org/apache/deft/example/DeftServerExample.java Thu Aug  4 18:35:27 2011
@@ -17,11 +17,11 @@
  *  under the License. 
  *  
  */
-package org.deftserver.example;
+package org.apache.deft.example;
 
-import org.deftserver.configuration.Configuration;
-import org.deftserver.io.IOLoop;
-import org.deftserver.web.HttpServer;
+import org.apache.deft.configuration.Configuration;
+import org.apache.deft.io.IOLoop;
+import org.apache.deft.web.HttpServer;
 
 /**
  * A simple example of how to configure and instantiate a server.
@@ -36,7 +36,7 @@ public class DeftServerExample {
          * and how to view them as part of this example application.
          */
         Configuration configuration = new Configuration();
-        configuration.setHandlerPackage("org.deftserver.example.handler");
+        configuration.setHandlerPackage("org.apache.deft.example.handler");
 
         /*
          * Create an instance of HttpServer with the given Configuration, bind

Modified: incubator/deft/sandbox/src/main/java/org/apache/deft/example/client/AsynchronousHttpClientGetExample.java
URL: http://svn.apache.org/viewvc/incubator/deft/sandbox/src/main/java/org/apache/deft/example/client/AsynchronousHttpClientGetExample.java?rev=1153959&r1=1153694&r2=1153959&view=diff
==============================================================================
--- incubator/deft/sandbox/src/main/java/org/apache/deft/example/client/AsynchronousHttpClientGetExample.java (original)
+++ incubator/deft/sandbox/src/main/java/org/apache/deft/example/client/AsynchronousHttpClientGetExample.java Thu Aug  4 18:35:27 2011
@@ -1,11 +1,11 @@
-package org.deftserver.example.client;
+package org.apache.deft.example.client;
  
-import org.deftserver.io.IOLoop;
-import org.deftserver.io.timeout.Timeout;
-import org.deftserver.web.AsyncCallback;
-import org.deftserver.web.AsyncResult;
-import org.deftserver.web.http.client.AsynchronousHttpClient;
-import org.deftserver.web.http.client.Response;
+import org.apache.deft.io.IOLoop;
+import org.apache.deft.io.timeout.Timeout;
+import org.apache.deft.web.AsyncCallback;
+import org.apache.deft.web.AsyncResult;
+import org.apache.deft.web.http.client.AsynchronousHttpClient;
+import org.apache.deft.web.http.client.Response;
  
 /**
  * Example class to demonstrate usage of <code>AsynchronousHttpClient</code>.

Modified: incubator/deft/sandbox/src/main/java/org/apache/deft/example/client/AsynchronousHttpClientPostExample.java
URL: http://svn.apache.org/viewvc/incubator/deft/sandbox/src/main/java/org/apache/deft/example/client/AsynchronousHttpClientPostExample.java?rev=1153959&r1=1153694&r2=1153959&view=diff
==============================================================================
--- incubator/deft/sandbox/src/main/java/org/apache/deft/example/client/AsynchronousHttpClientPostExample.java (original)
+++ incubator/deft/sandbox/src/main/java/org/apache/deft/example/client/AsynchronousHttpClientPostExample.java Thu Aug  4 18:35:27 2011
@@ -17,17 +17,17 @@
  *  under the License. 
  *  
  */
-package org.deftserver.example.client;
+package org.apache.deft.example.client;
 
-import org.deftserver.io.IOLoop;
-import org.deftserver.io.timeout.Timeout;
-import org.deftserver.web.AsyncCallback;
-import org.deftserver.web.AsyncResult;
-import org.deftserver.web.HttpVerb;
-import org.deftserver.web.http.ContentType;
-import org.deftserver.web.http.client.AsynchronousHttpClient;
-import org.deftserver.web.http.client.Request;
-import org.deftserver.web.http.client.Response;
+import org.apache.deft.io.IOLoop;
+import org.apache.deft.io.timeout.Timeout;
+import org.apache.deft.web.AsyncCallback;
+import org.apache.deft.web.AsyncResult;
+import org.apache.deft.web.HttpVerb;
+import org.apache.deft.web.http.ContentType;
+import org.apache.deft.web.http.client.AsynchronousHttpClient;
+import org.apache.deft.web.http.client.Request;
+import org.apache.deft.web.http.client.Response;
 
 /**
  * Example class to demonstrate usage of <code>AsynchronousHttpClient</code>.

Modified: incubator/deft/sandbox/src/main/java/org/apache/deft/example/handler/BasicHandlerExample.java
URL: http://svn.apache.org/viewvc/incubator/deft/sandbox/src/main/java/org/apache/deft/example/handler/BasicHandlerExample.java?rev=1153959&r1=1153694&r2=1153959&view=diff
==============================================================================
--- incubator/deft/sandbox/src/main/java/org/apache/deft/example/handler/BasicHandlerExample.java (original)
+++ incubator/deft/sandbox/src/main/java/org/apache/deft/example/handler/BasicHandlerExample.java Thu Aug  4 18:35:27 2011
@@ -17,13 +17,13 @@
  *  under the License. 
  *  
  */
-package org.deftserver.example.handler;
+package org.apache.deft.example.handler;
 
-import org.deftserver.annotation.Path;
-import org.deftserver.example.DeftServerExample;
-import org.deftserver.web.handler.RequestHandler;
-import org.deftserver.web.http.HttpRequest;
-import org.deftserver.web.http.HttpResponse;
+import org.apache.deft.annotation.Path;
+import org.apache.deft.example.DeftServerExample;
+import org.apache.deft.web.handler.RequestHandler;
+import org.apache.deft.web.http.HttpRequest;
+import org.apache.deft.web.http.HttpResponse;
 
 /**
  * This is a basic handler, which does nothing more than write output and associate itself with a path. The {@link Path}

Modified: incubator/deft/sandbox/src/main/java/org/apache/deft/example/handler/CookieHandlerExample.java
URL: http://svn.apache.org/viewvc/incubator/deft/sandbox/src/main/java/org/apache/deft/example/handler/CookieHandlerExample.java?rev=1153959&r1=1153694&r2=1153959&view=diff
==============================================================================
--- incubator/deft/sandbox/src/main/java/org/apache/deft/example/handler/CookieHandlerExample.java (original)
+++ incubator/deft/sandbox/src/main/java/org/apache/deft/example/handler/CookieHandlerExample.java Thu Aug  4 18:35:27 2011
@@ -17,15 +17,15 @@
  *  under the License. 
  *  
  */
-package org.deftserver.example.handler;
+package org.apache.deft.example.handler;
 
 import java.util.UUID;
 
-import org.deftserver.annotation.Path;
-import org.deftserver.example.DeftServerExample;
-import org.deftserver.web.handler.RequestHandler;
-import org.deftserver.web.http.HttpRequest;
-import org.deftserver.web.http.HttpResponse;
+import org.apache.deft.annotation.Path;
+import org.apache.deft.example.DeftServerExample;
+import org.apache.deft.web.handler.RequestHandler;
+import org.apache.deft.web.http.HttpRequest;
+import org.apache.deft.web.http.HttpResponse;
 
 /**
  * This handler demonstrates usage of cookie-related functionality. The {@link Path} annotation below defines the path

Modified: incubator/deft/sandbox/src/main/java/org/apache/deft/example/handler/PatternHandlerExample.java
URL: http://svn.apache.org/viewvc/incubator/deft/sandbox/src/main/java/org/apache/deft/example/handler/PatternHandlerExample.java?rev=1153959&r1=1153694&r2=1153959&view=diff
==============================================================================
--- incubator/deft/sandbox/src/main/java/org/apache/deft/example/handler/PatternHandlerExample.java (original)
+++ incubator/deft/sandbox/src/main/java/org/apache/deft/example/handler/PatternHandlerExample.java Thu Aug  4 18:35:27 2011
@@ -17,26 +17,27 @@
  *  under the License. 
  *  
  */
-package org.deftserver.example.handler;
+package org.apache.deft.example.handler;
 
 import java.util.regex.Pattern;
 
-import org.deftserver.annotation.Path;
-import org.deftserver.example.DeftServerExample;
-import org.deftserver.web.handler.RequestHandler;
-import org.deftserver.web.http.HttpRequest;
-import org.deftserver.web.http.HttpResponse;
+import org.apache.deft.annotation.Path;
+import org.apache.deft.example.DeftServerExample;
+import org.apache.deft.web.handler.RequestHandler;
+import org.apache.deft.web.http.HttpRequest;
+import org.apache.deft.web.http.HttpResponse;
 
 /**
- * This handler is invoked as a result of the combination of path and Regular Expression. When executed as part of the
- * server example:
+ * This handler is invoked as a result of the combination of path and Regular
+ * Expression. When executed as part of the server example:
  * <p>
- * <code>http://localhost:8080/pattern/123</code> will be found. <code>http://localhost:8080/pattern/abc</code> will not
- * be found.
+ * <code>http://localhost:8080/pattern/123</code> will be found.<br/>
+ * <code>http://localhost:8080/pattern/abc</code> will not be found.
  * </p>
  * <p>
- * In the annotation below, the regular expression is "[0-9]+" which indicates that any number will be matched. Any
- * pattern as understood by {@link Pattern} is suitable, and the handler will be invoked only when this pattern is
+ * In the annotation below, the regular expression is "[0-9]+" which indicates
+ * that any number will be matched. Any pattern as understood by {@link Pattern}
+ * is suitable, and the handler will be invoked only when this pattern is
  * matched.
  * </p>
  * 

Modified: incubator/deft/sandbox/src/main/java/org/apache/deft/example/keyvalue/KeyValueStore.java
URL: http://svn.apache.org/viewvc/incubator/deft/sandbox/src/main/java/org/apache/deft/example/keyvalue/KeyValueStore.java?rev=1153959&r1=1153694&r2=1153959&view=diff
==============================================================================
--- incubator/deft/sandbox/src/main/java/org/apache/deft/example/keyvalue/KeyValueStore.java (original)
+++ incubator/deft/sandbox/src/main/java/org/apache/deft/example/keyvalue/KeyValueStore.java Thu Aug  4 18:35:27 2011
@@ -17,7 +17,7 @@
  *  under the License. 
  *  
  */
-package org.deftserver.example.keyvalue;
+package org.apache.deft.example.keyvalue;
 
 import java.io.BufferedReader;
 import java.io.BufferedWriter;
@@ -37,6 +37,7 @@ import org.slf4j.LoggerFactory;
  * input)
  * 
  */
+@SuppressWarnings("serial")
 public class KeyValueStore extends Thread {
 
     private final static Logger logger = LoggerFactory.getLogger(KeyValueStore.class);

Modified: incubator/deft/sandbox/src/main/java/org/apache/deft/example/keyvalue/KeyValueStoreClient.java
URL: http://svn.apache.org/viewvc/incubator/deft/sandbox/src/main/java/org/apache/deft/example/keyvalue/KeyValueStoreClient.java?rev=1153959&r1=1153694&r2=1153959&view=diff
==============================================================================
--- incubator/deft/sandbox/src/main/java/org/apache/deft/example/keyvalue/KeyValueStoreClient.java (original)
+++ incubator/deft/sandbox/src/main/java/org/apache/deft/example/keyvalue/KeyValueStoreClient.java Thu Aug  4 18:35:27 2011
@@ -17,7 +17,7 @@
  *  under the License. 
  *  
  */
-package org.deftserver.example.keyvalue;
+package org.apache.deft.example.keyvalue;
 
 import java.io.IOException;
 import java.net.InetSocketAddress;
@@ -25,10 +25,10 @@ import java.nio.ByteBuffer;
 import java.nio.channels.SelectionKey;
 import java.nio.channels.SocketChannel;
 
-import org.deftserver.io.AsynchronousSocket;
-import org.deftserver.io.IOLoop;
-import org.deftserver.web.AsyncCallback;
-import org.deftserver.web.AsyncResult;
+import org.apache.deft.io.AsynchronousSocket;
+import org.apache.deft.io.IOLoop;
+import org.apache.deft.web.AsyncCallback;
+import org.apache.deft.web.AsyncResult;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: incubator/deft/sandbox/src/main/java/org/apache/deft/example/keyvalue/KeyValueStoreExample.java
URL: http://svn.apache.org/viewvc/incubator/deft/sandbox/src/main/java/org/apache/deft/example/keyvalue/KeyValueStoreExample.java?rev=1153959&r1=1153694&r2=1153959&view=diff
==============================================================================
--- incubator/deft/sandbox/src/main/java/org/apache/deft/example/keyvalue/KeyValueStoreExample.java (original)
+++ incubator/deft/sandbox/src/main/java/org/apache/deft/example/keyvalue/KeyValueStoreExample.java Thu Aug  4 18:35:27 2011
@@ -17,57 +17,23 @@
  *  under the License. 
  *  
  */
-package org.deftserver.example.keyvalue;
+package org.apache.deft.example.keyvalue;
 
-import org.deftserver.configuration.Configuration;
-import org.deftserver.io.IOLoop;
-import org.deftserver.web.AsyncResult;
-import org.deftserver.web.Asynchronous;
-import org.deftserver.web.HttpServer;
-import org.deftserver.web.handler.RequestHandler;
-import org.deftserver.web.http.HttpRequest;
-import org.deftserver.web.http.HttpResponse;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.deft.configuration.Configuration;
+import org.apache.deft.io.IOLoop;
+import org.apache.deft.web.HttpServer;
 
 public class KeyValueStoreExample {
 
-    private final static Logger logger = LoggerFactory.getLogger(KeyValueStoreExample.class);
     private final static int PORT = 8080;
 
-    private static class KeyValueStoreExampleRequestHandler extends RequestHandler {
-
-        private final KeyValueStoreClient client = new KeyValueStoreClient(KeyValueStore.HOST, KeyValueStore.PORT);
-
-        public KeyValueStoreExampleRequestHandler() {
-            new KeyValueStore().start();
-            client.connect();
-        }
-
-        @Override
-        @Asynchronous
-        public void get(HttpRequest request, final HttpResponse response) {
-            client.get("deft", new AsyncResult<byte[]>() {
-                @Override
-                public void onFailure(Throwable caught) { /* ignore */
-                }
-
-                @Override
-                public void onSuccess(byte[] result) {
-                    response.write(new String(result)).finish();
-                }
-            });
-        }
-    }
-
     public static void main(String[] args) {
 
         Configuration configuration = new Configuration();
-        configuration.setHandlerPackage("org.deftserver.example.kv");
+        configuration.setHandlerPackage("org.apache.deft.example.keyvalue");
 
         HttpServer server = new HttpServer(configuration);
         server.listen(PORT);
         IOLoop.INSTANCE.start();
     }
-
 }

Modified: incubator/deft/sandbox/src/main/java/org/apache/deft/example/keyvalue/KeyValueStoreHandler.java
URL: http://svn.apache.org/viewvc/incubator/deft/sandbox/src/main/java/org/apache/deft/example/keyvalue/KeyValueStoreHandler.java?rev=1153959&r1=1153694&r2=1153959&view=diff
==============================================================================
--- incubator/deft/sandbox/src/main/java/org/apache/deft/example/keyvalue/KeyValueStoreHandler.java (original)
+++ incubator/deft/sandbox/src/main/java/org/apache/deft/example/keyvalue/KeyValueStoreHandler.java Thu Aug  4 18:35:27 2011
@@ -17,14 +17,14 @@
  *  under the License. 
  *  
  */
-package org.deftserver.example.keyvalue;
+package org.apache.deft.example.keyvalue;
 
-import org.deftserver.annotation.Path;
-import org.deftserver.web.AsyncResult;
-import org.deftserver.web.Asynchronous;
-import org.deftserver.web.handler.RequestHandler;
-import org.deftserver.web.http.HttpRequest;
-import org.deftserver.web.http.HttpResponse;
+import org.apache.deft.annotation.Path;
+import org.apache.deft.web.AsyncResult;
+import org.apache.deft.web.Asynchronous;
+import org.apache.deft.web.handler.RequestHandler;
+import org.apache.deft.web.http.HttpRequest;
+import org.apache.deft.web.http.HttpResponse;
 
 /**
  * 

Copied: incubator/deft/sandbox/src/main/java/org/apache/deft/io/AsynchronousSocket.java (from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/io/AsynchronousSocket.java)
URL: http://svn.apache.org/viewvc/incubator/deft/sandbox/src/main/java/org/apache/deft/io/AsynchronousSocket.java?p2=incubator/deft/sandbox/src/main/java/org/apache/deft/io/AsynchronousSocket.java&p1=incubator/deft/sandbox/src/main/java/org/deftserver/io/AsynchronousSocket.java&r1=1153694&r2=1153959&rev=1153959&view=diff
==============================================================================
--- incubator/deft/sandbox/src/main/java/org/deftserver/io/AsynchronousSocket.java (original)
+++ incubator/deft/sandbox/src/main/java/org/apache/deft/io/AsynchronousSocket.java Thu Aug  4 18:35:27 2011
@@ -17,7 +17,7 @@
  *  under the License. 
  *  
  */
-package org.deftserver.io;
+package org.apache.deft.io;
 
 import java.io.EOFException;
 import java.io.IOException;
@@ -30,330 +30,350 @@ import java.nio.channels.ServerSocketCha
 import java.nio.channels.SocketChannel;
 import java.nio.channels.UnresolvedAddressException;
 
-import org.deftserver.io.buffer.DynamicByteBuffer;
-import org.deftserver.util.Closeables;
-import org.deftserver.util.KnuthMorrisPrattAlgorithm;
-import org.deftserver.util.NopAsyncResult;
-import org.deftserver.web.AsyncCallback;
-import org.deftserver.web.AsyncResult;
+import org.apache.deft.io.buffer.DynamicByteBuffer;
+import org.apache.deft.util.Closeables;
+import org.apache.deft.util.KnuthMorrisPrattAlgorithm;
+import org.apache.deft.util.NopAsyncResult;
+import org.apache.deft.web.AsyncCallback;
+import org.apache.deft.web.AsyncResult;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Charsets;
-
 public class AsynchronousSocket implements IOHandler {
-	
-	private static final Logger logger = LoggerFactory.getLogger(AsynchronousSocket.class);
-	
-	private final IOLoop ioLoop;
-	
-	private static final int DEFAULT_BYTEBUFFER_SIZE = 1024;
-	private static final int DEFAULT_INITIAL_READ_BYTEBUFFER_SIZE = 1024;
-	private static final int DEFAULT_INITIAL_WRITE_BYTEBUFFER_SIZE = 1024;
-	
-	private final AsyncResult<byte[]> nopAsyncByteArrayResult = NopAsyncResult.of(byte[].class).nopAsyncResult;
-	private final AsyncResult<Boolean> nopAsyncBooleanResult = NopAsyncResult.of(Boolean.class).nopAsyncResult;
-	
-	private final SocketChannel channel;
-	private int interestOps;
-	
-	private byte[] readDelimiter = "".getBytes();
-	private int readBytes = Integer.MAX_VALUE;
-	
-	private AsyncResult<Boolean> connectCallback = nopAsyncBooleanResult;
-	private AsyncCallback closeCallback = AsyncCallback.nopCb;
-	private AsyncResult<byte[]> readCallback = nopAsyncByteArrayResult;
-	private AsyncCallback writeCallback = AsyncCallback.nopCb;
-	
-	private final DynamicByteBuffer readBuffer = DynamicByteBuffer.allocate(DEFAULT_INITIAL_READ_BYTEBUFFER_SIZE);
-	private final DynamicByteBuffer writeBuffer = DynamicByteBuffer.allocate(DEFAULT_INITIAL_WRITE_BYTEBUFFER_SIZE);
-	
-	private boolean reachedEOF = false;
-	
-	/**
-	 * Creates a new {@code AsynchronousSocket} that will delegate its io operations to the given 
-	 * {@link SelectableChannel}. 
-	 * <p>
-	 * Support for three non-blocking asynchronous methods that take callbacks:
-	 * <p> 
-	 * {@link #readUntil(String, AsyncResult)}
-	 * <p>  
-	 * {@link #readBytes(int, AsyncResult)} and
-	 * <p>
-	 * {@link #write(String, AsyncCallback)} 
-	 * <p>
-	 * The {@link SelectableChannel} should be the result of either {@link SocketChannel#open()} (client operations, 
-	 * connected or  unconnected) or {@link ServerSocketChannel#accept()} (server operations).
-	 * <p> 
-	 * The given {@code SelectableChannel} will be configured to be in non-blocking mode, even if it is non-blocking
-	 * already. 
-	 * 
-	 * <p>Below is an example of how a simple server could be implemented.
-	 * <pre>
+
+    private static final Logger logger = LoggerFactory.getLogger(AsynchronousSocket.class);
+
+    private final IOLoop ioLoop;
+
+    private static final int DEFAULT_BYTEBUFFER_SIZE = 1024;
+    private static final int DEFAULT_INITIAL_READ_BYTEBUFFER_SIZE = 1024;
+    private static final int DEFAULT_INITIAL_WRITE_BYTEBUFFER_SIZE = 1024;
+
+    private final AsyncResult<byte[]> nopAsyncByteArrayResult = NopAsyncResult.of(byte[].class).nopAsyncResult;
+    private final AsyncResult<Boolean> nopAsyncBooleanResult = NopAsyncResult.of(Boolean.class).nopAsyncResult;
+
+    private final SocketChannel channel;
+    private int interestOps;
+
+    private byte[] readDelimiter = "".getBytes();
+    private int readBytes = Integer.MAX_VALUE;
+
+    private AsyncResult<Boolean> connectCallback = nopAsyncBooleanResult;
+    private AsyncCallback closeCallback = AsyncCallback.nopCb;
+    private AsyncResult<byte[]> readCallback = nopAsyncByteArrayResult;
+    private AsyncCallback writeCallback = AsyncCallback.nopCb;
+
+    private final DynamicByteBuffer readBuffer = DynamicByteBuffer.allocate(DEFAULT_INITIAL_READ_BYTEBUFFER_SIZE);
+    private final DynamicByteBuffer writeBuffer = DynamicByteBuffer.allocate(DEFAULT_INITIAL_WRITE_BYTEBUFFER_SIZE);
+
+    private boolean reachedEOF = false;
+
+    /**
+     * Creates a new {@code AsynchronousSocket} that will delegate its io
+     * operations to the given {@link SelectableChannel}.
+     * <p>
+     * Support for three non-blocking asynchronous methods that take callbacks:
+     * <p>
+     * {@link #readUntil(String, AsyncResult)}
+     * <p>
+     * {@link #readBytes(int, AsyncResult)} and
+     * <p>
+     * {@link #write(String, AsyncCallback)}
+     * <p>
+     * The {@link SelectableChannel} should be the result of either
+     * {@link SocketChannel#open()} (client operations, connected or
+     * unconnected) or {@link ServerSocketChannel#accept()} (server operations).
+     * <p>
+     * The given {@code SelectableChannel} will be configured to be in
+     * non-blocking mode, even if it is non-blocking already.
+     * 
+     * <p>
+     * Below is an example of how a simple server could be implemented.
+     * 
+     * <pre>
      *   final ServerSocketChannel server = ServerSocketChannel.open();
      *   server.socket().bind(new InetSocketAddress(9090));
      * 	
      *   AcceptUtil.accept(server, new AsyncCallback() { public void onCallback() { onAccept(server);} });
      *   IOLoop.INSTANCE.start();
-	 * 
+     * 
      *   private static void onAccept(ServerSocketChannel channel) {
      *       SocketChannel client = channel.accept();
      *       AsynchronousSocket socket = new AsynchronousSocket(client);
      *       // use socket
      *   }
-	 * </pre>
-	 */
-	public AsynchronousSocket(SocketChannel channel) {
-		this(IOLoop.INSTANCE, channel);
-	}
-	
-	public AsynchronousSocket(IOLoop ioLoop, SocketChannel channel) {
-		this.ioLoop = ioLoop;
-		this.channel = channel;
-		try {
-			channel.configureBlocking(false);
-		} catch (IOException e) {
-			logger.error("Could not configure SocketChannel to be non-blocking");
-		}
-		if (channel.isConnected()) {
-			interestOps |= SelectionKey.OP_READ;
-		}
-		ioLoop.addHandler(channel, this, interestOps, null);
-	}
-	
-	/**
-	 * Connects to the given host port tuple and invokes the given callback when a successful connection is established.
-	 * <p>
-	 * You can both read and write on the {@code AsynchronousSocket} before it is connected
-	 * (in which case the data will be written/read as soon as the connection is ready).
-	 */
-	public void connect(String host, int port, AsyncResult<Boolean> ccb) {
-		ioLoop.updateHandler(channel, interestOps |= SelectionKey.OP_CONNECT);
-		connectCallback = ccb;
-		try {
-			channel.connect(new InetSocketAddress(host, port));
-		} catch (IOException e) {
-			logger.error("Failed to connect to: {}, message: {} ", host, e.getMessage());
-			invokeConnectFailureCallback(e);
-		} catch (UnresolvedAddressException e) {
-			logger.warn("Unresolvable host: {}", host);
-			invokeConnectFailureCallback(e);
-		}
-	}
-	
-	/**
-	 * Close the socket.
-	 */
-	public void close() {
-		Closeables.closeQuietly(ioLoop, channel);
-		invokeCloseCallback();
-	}
-	
-	/**
-	 * The given callback will invoked when the underlaying {@code SelectableChannel} is closed. 
-	 */
-	public void setCloseCallback(AsyncCallback ccb) {
-		closeCallback = ccb;
-	}
-	
-	/**
-	 * Should only be invoked by the IOLoop
-	 */
-	@Override
-	public void handleAccept(SelectionKey key) throws IOException {
-		logger.debug("handle accept...");
-	}
-
-	/**
-	 * Should only be invoked by the IOLoop
-	 */
-	@Override
-	public void handleConnect(SelectionKey key) throws IOException {
-		logger.debug("handle connect...");
-		if (channel.isConnectionPending()) {
-			try {
-				channel.finishConnect();
-				invokeConnectSuccessfulCallback();
-				interestOps &= ~SelectionKey.OP_CONNECT;
-				ioLoop.updateHandler(channel, interestOps |= SelectionKey.OP_READ);
-			} catch (ConnectException e) {
-				logger.warn("Connect failed: {}", e.getMessage());
-				invokeConnectFailureCallback(e);
-			}
-		}
-	}
-	
-	/**
-	 * Should only be invoked by the IOLoop
-	 */
-	@Override
-	public void handleRead(SelectionKey key) throws IOException {
-		logger.debug("handle read...");
-		ByteBuffer buffer = ByteBuffer.allocate(DEFAULT_BYTEBUFFER_SIZE);	// TODO RS 110723 reuse byte buffers
-		int read = 0;
-		try {
-		    read = channel.read(buffer);
-		} catch (IOException e) {
-		    logger.error("IOException during read: {}", e.getMessage());
-		    invokeCloseCallback();
-		    Closeables.closeQuietly(ioLoop, channel);
-		    return;
-		}
-
-		if (read == -1) {	// EOF
-			reachedEOF = true;
-			ioLoop.updateHandler(channel, interestOps &= ~SelectionKey.OP_READ);
-			return;
-		}
-		buffer.flip();
-		readBuffer.put(buffer);
-		logger.debug("readBuffer size: {}", readBuffer.position());
-		checkReadState();
-	}
-
-	/**
-	 * Should only be invoked by the IOLoop
-	 */
-	@Override
-	public void handleWrite(SelectionKey key) {
-		logger.debug("handle write...");
-		doWrite();
-	}
-
-	/**
-	 * Reads from the underlaying SelectableChannel until delimiter is reached. When it its, the given
-	 * AsyncResult will be invoked.
-	 */
-	public void readUntil(byte[] delimiter, AsyncResult<byte[]> rcb) {
-		logger.debug("readUntil delimiter: {}", new String(delimiter));
-		readDelimiter = delimiter;
-		readCallback = rcb;
-		checkReadState();
-	}
-
-	/**
-	 * Reads from the underlaying SelectableChannel until n bytes are read. When it its, the given
-	 * AsyncResult will be invoked.
-	 */
-	public void readBytes(int n, AsyncResult<byte[]> rcb) {
-		logger.debug("readBytes #bytes: {}", n);
-		readBytes = n;
-		readCallback = rcb;
-		checkReadState();
-	}
-	
-	/**
-	 *  If readBuffer contains readDelimiter, client read is finished => invoke readCallback (onSuccess)
-	 *  Or if readBytes bytes are read, client read is finished => invoke readCallback (onSuccess)
-	 *  Of if end-of-stream is reached => invoke readCallback (onFailure)
-	 */
-	private void checkReadState() {
-		if (reachedEOF) {
-			invokeReadFailureCallback(new EOFException("Reached end-of-stream"));
-			return;
-		}
-		int index = KnuthMorrisPrattAlgorithm.indexOf(readBuffer.array(), 0, readBuffer.position(), readDelimiter);
-		if (index != -1 && readDelimiter.length > 0) {
-			byte[] result = getResult(index, readDelimiter.length);
-			readDelimiter = "".getBytes();
-			invokeReadSuccessfulCallback(result);
-		} else if (readBuffer.position() >= readBytes) {
-			byte[] result = getResult(readBytes, 0);
-			readBytes = Integer.MAX_VALUE;
-			invokeReadSuccessfulCallback(result);
-		}
-	}
-	
-	/**
-	 * Returns the resulting byte[] data that was requested by the client through readUntil(..) or readBytes(..)
-	 * 
-	 * @param size Number of bytes to fetch and remove from the read buffer.
-	 * @param advance The number of bytes the read buffer's position should move forward after the data has been fetched. 
-	 *        (To ignore the readDelimiter.)
-	 */
-	private byte[] getResult(int size, int advance) {
-		readBuffer.flip();
-		byte[] result = new byte[size]; 
-		readBuffer.get(result, 0, size);
-		readBuffer.position(readBuffer.position() + advance);	// ignore the delimiter (if it was a readUntil(..) call)
-		readBuffer.compact();	// "delete" the result data (data after result is left intact and will not be overwritten)
-		logger.debug("readBuffer size: {}", readBuffer.position());
-		return result;
-	}
-
-	private void invokeReadSuccessfulCallback(byte[] result) {
-		AsyncResult<byte[]> cb = readCallback;
-		readCallback = nopAsyncByteArrayResult;
-		cb.onSuccess(result);
-	}
-	
-	private void invokeReadFailureCallback(Exception e) {
-		AsyncResult<byte[]> cb = readCallback;
-		readCallback = nopAsyncByteArrayResult;
-		cb.onFailure(e);
-	}
-	
-	private void invokeWriteCallback() {
-		AsyncCallback cb = writeCallback;
-		writeCallback = AsyncCallback.nopCb;
-		cb.onCallback();
-	}
-	
-	private void invokeCloseCallback() {
-		AsyncCallback cb = closeCallback;
-		closeCallback = AsyncCallback.nopCb;
-		cb.onCallback();
-	}
-	
-	private void invokeConnectSuccessfulCallback() {
-		AsyncResult<Boolean> cb = connectCallback;
-		connectCallback = nopAsyncBooleanResult;
-		cb.onSuccess(true);
-	}
-	
-	private void invokeConnectFailureCallback(Exception e) {
-		AsyncResult<Boolean> cb = connectCallback;
-		connectCallback = nopAsyncBooleanResult;
-		cb.onFailure(e);;
-	}
-
-	/**
-	 * Writes the given data to the underlaying SelectableChannel. When all data is successfully transmitted, the given 
-	 * AsyncCallback will be invoked 
-	 */
-	public void write(byte[] data, AsyncCallback wcb) {
-		logger.debug("write data: {}", new String(data));
-		writeBuffer.put(data);
-		logger.debug("writeBuffer size: {}", writeBuffer.position());
-		writeCallback = wcb;
-		doWrite();
-	}
-	
-	/**
-	 * If we succeed to write everything in writeBuffer, client write is finished => invoke writeCallback
-	 */
-	private void doWrite() {
-		int written = 0;
-		try {
-			if (channel.isConnected()) {
-				writeBuffer.flip(); 	// prepare for write
-				written = channel.write(writeBuffer.getByteBuffer());
-				writeBuffer.compact();	// // make room for more data be "read" in
-			}
-		} catch (IOException e) {
-			logger.error("IOException during write: {}", e.getMessage());
-			invokeCloseCallback();
-			Closeables.closeQuietly(ioLoop, channel);
-			return;
-		}
-		logger.debug("wrote: {} bytes", written);
-		logger.debug("writeBuffer size: {}", writeBuffer.position());
-		if (writeBuffer.position() > 0) {
-			ioLoop.updateHandler(channel, interestOps |= SelectionKey.OP_WRITE);
-		} else {
-			ioLoop.updateHandler(channel, interestOps &= ~SelectionKey.OP_WRITE);
-			invokeWriteCallback();
-		}
-	}
+     * </pre>
+     */
+    public AsynchronousSocket(SocketChannel channel) {
+        this(IOLoop.INSTANCE, channel);
+    }
+
+    public AsynchronousSocket(IOLoop ioLoop, SocketChannel channel) {
+        this.ioLoop = ioLoop;
+        this.channel = channel;
+        try {
+            channel.configureBlocking(false);
+        } catch (IOException e) {
+            logger.error("Could not configure SocketChannel to be non-blocking");
+        }
+        if (channel.isConnected()) {
+            interestOps |= SelectionKey.OP_READ;
+        }
+        ioLoop.addHandler(channel, this, interestOps, null);
+    }
+
+    /**
+     * Connects to the given host port tuple and invokes the given callback when
+     * a successful connection is established.
+     * <p>
+     * You can both read and write on the {@code AsynchronousSocket} before it
+     * is connected (in which case the data will be written/read as soon as the
+     * connection is ready).
+     */
+    public void connect(String host, int port, AsyncResult<Boolean> ccb) {
+        ioLoop.updateHandler(channel, interestOps |= SelectionKey.OP_CONNECT);
+        connectCallback = ccb;
+        try {
+            channel.connect(new InetSocketAddress(host, port));
+        } catch (IOException e) {
+            logger.error("Failed to connect to: {}, message: {} ", host, e.getMessage());
+            invokeConnectFailureCallback(e);
+        } catch (UnresolvedAddressException e) {
+            logger.warn("Unresolvable host: {}", host);
+            invokeConnectFailureCallback(e);
+        }
+    }
+
+    /**
+     * Close the socket.
+     */
+    public void close() {
+        Closeables.closeQuietly(ioLoop, channel);
+        invokeCloseCallback();
+    }
+
+    /**
+     * The given callback will invoked when the underlaying {@code
+     * SelectableChannel} is closed.
+     */
+    public void setCloseCallback(AsyncCallback ccb) {
+        closeCallback = ccb;
+    }
+
+    /**
+     * Should only be invoked by the IOLoop
+     */
+    @Override
+    public void handleAccept(SelectionKey key) throws IOException {
+        logger.debug("handle accept...");
+    }
+
+    /**
+     * Should only be invoked by the IOLoop
+     */
+    @Override
+    public void handleConnect(SelectionKey key) throws IOException {
+        logger.debug("handle connect...");
+        if (channel.isConnectionPending()) {
+            try {
+                channel.finishConnect();
+                invokeConnectSuccessfulCallback();
+                interestOps &= ~SelectionKey.OP_CONNECT;
+                ioLoop.updateHandler(channel, interestOps |= SelectionKey.OP_READ);
+            } catch (ConnectException e) {
+                logger.warn("Connect failed: {}", e.getMessage());
+                invokeConnectFailureCallback(e);
+            }
+        }
+    }
+
+    /**
+     * Should only be invoked by the IOLoop
+     */
+    @Override
+    public void handleRead(SelectionKey key) throws IOException {
+        logger.debug("handle read...");
+        ByteBuffer buffer = ByteBuffer.allocate(DEFAULT_BYTEBUFFER_SIZE); // TODO
+                                                                          // RS
+                                                                          // 110723
+                                                                          // reuse
+                                                                          // byte
+                                                                          // buffers
+        int read = 0;
+        try {
+            read = channel.read(buffer);
+        } catch (IOException e) {
+            logger.error("IOException during read: {}", e.getMessage());
+            invokeCloseCallback();
+            Closeables.closeQuietly(ioLoop, channel);
+            return;
+        }
+
+        if (read == -1) { // EOF
+            reachedEOF = true;
+            ioLoop.updateHandler(channel, interestOps &= ~SelectionKey.OP_READ);
+            return;
+        }
+        buffer.flip();
+        readBuffer.put(buffer);
+        logger.debug("readBuffer size: {}", readBuffer.position());
+        checkReadState();
+    }
+
+    /**
+     * Should only be invoked by the IOLoop
+     */
+    @Override
+    public void handleWrite(SelectionKey key) {
+        logger.debug("handle write...");
+        doWrite();
+    }
+
+    /**
+     * Reads from the underlaying SelectableChannel until delimiter is reached.
+     * When it its, the given AsyncResult will be invoked.
+     */
+    public void readUntil(byte[] delimiter, AsyncResult<byte[]> rcb) {
+        logger.debug("readUntil delimiter: {}", new String(delimiter));
+        readDelimiter = delimiter;
+        readCallback = rcb;
+        checkReadState();
+    }
+
+    /**
+     * Reads from the underlaying SelectableChannel until n bytes are read. When
+     * it its, the given AsyncResult will be invoked.
+     */
+    public void readBytes(int n, AsyncResult<byte[]> rcb) {
+        logger.debug("readBytes #bytes: {}", n);
+        readBytes = n;
+        readCallback = rcb;
+        checkReadState();
+    }
+
+    /**
+     * If readBuffer contains readDelimiter, client read is finished => invoke
+     * readCallback (onSuccess) Or if readBytes bytes are read, client read is
+     * finished => invoke readCallback (onSuccess) Of if end-of-stream is
+     * reached => invoke readCallback (onFailure)
+     */
+    private void checkReadState() {
+        if (reachedEOF) {
+            invokeReadFailureCallback(new EOFException("Reached end-of-stream"));
+            return;
+        }
+        int index = KnuthMorrisPrattAlgorithm.indexOf(readBuffer.array(), 0, readBuffer.position(), readDelimiter);
+        if (index != -1 && readDelimiter.length > 0) {
+            byte[] result = getResult(index, readDelimiter.length);
+            readDelimiter = "".getBytes();
+            invokeReadSuccessfulCallback(result);
+        } else if (readBuffer.position() >= readBytes) {
+            byte[] result = getResult(readBytes, 0);
+            readBytes = Integer.MAX_VALUE;
+            invokeReadSuccessfulCallback(result);
+        }
+    }
+
+    /**
+     * Returns the resulting byte[] data that was requested by the client
+     * through readUntil(..) or readBytes(..)
+     * 
+     * @param size Number of bytes to fetch and remove from the read buffer.
+     * @param advance The number of bytes the read buffer's position should move
+     *            forward after the data has been fetched. (To ignore the
+     *            readDelimiter.)
+     */
+    private byte[] getResult(int size, int advance) {
+        readBuffer.flip();
+        byte[] result = new byte[size];
+        readBuffer.get(result, 0, size);
+        readBuffer.position(readBuffer.position() + advance); // ignore the
+                                                              // delimiter (if
+                                                              // it was a
+                                                              // readUntil(..)
+                                                              // call)
+        readBuffer.compact(); // "delete" the result data (data after result is
+                              // left intact and will not be overwritten)
+        logger.debug("readBuffer size: {}", readBuffer.position());
+        return result;
+    }
+
+    private void invokeReadSuccessfulCallback(byte[] result) {
+        AsyncResult<byte[]> cb = readCallback;
+        readCallback = nopAsyncByteArrayResult;
+        cb.onSuccess(result);
+    }
+
+    private void invokeReadFailureCallback(Exception e) {
+        AsyncResult<byte[]> cb = readCallback;
+        readCallback = nopAsyncByteArrayResult;
+        cb.onFailure(e);
+    }
+
+    private void invokeWriteCallback() {
+        AsyncCallback cb = writeCallback;
+        writeCallback = AsyncCallback.nopCb;
+        cb.onCallback();
+    }
+
+    private void invokeCloseCallback() {
+        AsyncCallback cb = closeCallback;
+        closeCallback = AsyncCallback.nopCb;
+        cb.onCallback();
+    }
+
+    private void invokeConnectSuccessfulCallback() {
+        AsyncResult<Boolean> cb = connectCallback;
+        connectCallback = nopAsyncBooleanResult;
+        cb.onSuccess(true);
+    }
+
+    private void invokeConnectFailureCallback(Exception e) {
+        AsyncResult<Boolean> cb = connectCallback;
+        connectCallback = nopAsyncBooleanResult;
+        cb.onFailure(e);
+        ;
+    }
+
+    /**
+     * Writes the given data to the underlaying SelectableChannel. When all data
+     * is successfully transmitted, the given AsyncCallback will be invoked
+     */
+    public void write(byte[] data, AsyncCallback wcb) {
+        logger.debug("write data: {}", new String(data));
+        writeBuffer.put(data);
+        logger.debug("writeBuffer size: {}", writeBuffer.position());
+        writeCallback = wcb;
+        doWrite();
+    }
+
+    /**
+     * If we succeed to write everything in writeBuffer, client write is
+     * finished => invoke writeCallback
+     */
+    private void doWrite() {
+        int written = 0;
+        try {
+            if (channel.isConnected()) {
+                writeBuffer.flip(); // prepare for write
+                written = channel.write(writeBuffer.getByteBuffer());
+                writeBuffer.compact(); // // make room for more data be "read"
+                                       // in
+            }
+        } catch (IOException e) {
+            logger.error("IOException during write: {}", e.getMessage());
+            invokeCloseCallback();
+            Closeables.closeQuietly(ioLoop, channel);
+            return;
+        }
+        logger.debug("wrote: {} bytes", written);
+        logger.debug("writeBuffer size: {}", writeBuffer.position());
+        if (writeBuffer.position() > 0) {
+            ioLoop.updateHandler(channel, interestOps |= SelectionKey.OP_WRITE);
+        } else {
+            ioLoop.updateHandler(channel, interestOps &= ~SelectionKey.OP_WRITE);
+            invokeWriteCallback();
+        }
+    }
 
 }

Copied: incubator/deft/sandbox/src/main/java/org/apache/deft/io/IOHandler.java (from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/io/IOHandler.java)
URL: http://svn.apache.org/viewvc/incubator/deft/sandbox/src/main/java/org/apache/deft/io/IOHandler.java?p2=incubator/deft/sandbox/src/main/java/org/apache/deft/io/IOHandler.java&p1=incubator/deft/sandbox/src/main/java/org/deftserver/io/IOHandler.java&r1=1153694&r2=1153959&rev=1153959&view=diff
==============================================================================
--- incubator/deft/sandbox/src/main/java/org/deftserver/io/IOHandler.java (original)
+++ incubator/deft/sandbox/src/main/java/org/apache/deft/io/IOHandler.java Thu Aug  4 18:35:27 2011
@@ -17,24 +17,25 @@
  *  under the License. 
  *  
  */
-package org.deftserver.io;
+package org.apache.deft.io;
 
 import java.io.IOException;
 import java.nio.channels.SelectionKey;
 
 /**
- * {@code IOHandler}s are added to the IOLoop via {@link IOLoop#addHandler} method.
- * The callbacks defined in the {@code IOHandler} will be invoked by the {@code IOLoop} when io is ready.
- *
+ * {@code IOHandler}s are added to the IOLoop via {@link IOLoop#addHandler}
+ * method. The callbacks defined in the {@code IOHandler} will be invoked by the
+ * {@code IOLoop} when io is ready.
+ * 
  */
 public interface IOHandler {
 
-	void handleAccept(SelectionKey key) throws IOException;
+    void handleAccept(SelectionKey key) throws IOException;
+
+    void handleConnect(SelectionKey key) throws IOException;
+
+    void handleRead(SelectionKey key) throws IOException;
+
+    void handleWrite(SelectionKey key);
 
-	void handleConnect(SelectionKey key) throws IOException;
-	
-	void handleRead(SelectionKey key) throws IOException;
-	
-	void handleWrite(SelectionKey key);
-	
 }

Copied: incubator/deft/sandbox/src/main/java/org/apache/deft/io/IOLoop.java (from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/io/IOLoop.java)
URL: http://svn.apache.org/viewvc/incubator/deft/sandbox/src/main/java/org/apache/deft/io/IOLoop.java?p2=incubator/deft/sandbox/src/main/java/org/apache/deft/io/IOLoop.java&p1=incubator/deft/sandbox/src/main/java/org/deftserver/io/IOLoop.java&r1=1153694&r2=1153959&rev=1153959&view=diff
==============================================================================
--- incubator/deft/sandbox/src/main/java/org/deftserver/io/IOLoop.java (original)
+++ incubator/deft/sandbox/src/main/java/org/apache/deft/io/IOLoop.java Thu Aug  4 18:35:27 2011
@@ -17,7 +17,7 @@
  *  under the License. 
  *  
  */
-package org.deftserver.io;
+package org.apache.deft.io;
 
 import static com.google.common.collect.Collections2.transform;
 
@@ -33,13 +33,13 @@ import java.util.List;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicInteger;
 
-import org.deftserver.io.callback.CallbackManager;
-import org.deftserver.io.callback.JMXDebuggableCallbackManager;
-import org.deftserver.io.timeout.JMXDebuggableTimeoutManager;
-import org.deftserver.io.timeout.Timeout;
-import org.deftserver.io.timeout.TimeoutManager;
-import org.deftserver.util.MXBeanUtil;
-import org.deftserver.web.AsyncCallback;
+import org.apache.deft.io.callback.CallbackManager;
+import org.apache.deft.io.callback.JMXDebuggableCallbackManager;
+import org.apache.deft.io.timeout.JMXDebuggableTimeoutManager;
+import org.apache.deft.io.timeout.Timeout;
+import org.apache.deft.io.timeout.TimeoutManager;
+import org.apache.deft.util.MXBeanUtil;
+import org.apache.deft.web.AsyncCallback;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -48,179 +48,189 @@ import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
 
 public class IOLoop implements IOLoopMXBean {
-	
-	/* IOLoop singleton to use for convenience (otherwise you would have to pass around the 
-	 * IOLoop instance explicitly, now you can simply use IOLoop.INSTANCE) */
-	public static final IOLoop INSTANCE = new IOLoop();
-	
-	private boolean running = false;
-	
-	private final Logger logger = LoggerFactory.getLogger(IOLoop.class);
-
-	private Selector selector;
-	
-	private final Map<SelectableChannel, IOHandler> handlers = Maps.newHashMap();
-	
-	private final TimeoutManager tm = new JMXDebuggableTimeoutManager();
-	private final CallbackManager cm = new JMXDebuggableCallbackManager();
-	
-	private static final AtomicInteger sequence = new AtomicInteger();
-	
-	public IOLoop() {
-		try {
-			selector = Selector.open();
-		} catch (IOException e) {
-			logger.error("Could not open selector: {}", e.getMessage());
-		}
-		MXBeanUtil.registerMXBean(this, "IOLoop");
-	}
-	/**
-	 * Start the io loop. The thread that invokes this method will be blocked (until {@link IOLoop#stop} is invoked) 
-	 * and will be the io loop thread.
-	 */
-	public void start() {
-		Thread.currentThread().setName("I/O-LOOP" + sequence.incrementAndGet());
-		running = true;
-		
-		long selectorTimeout = 250; // 250 ms
-		while (running) {
-			try {
-				if (selector.select(selectorTimeout) == 0) {
-					long ms = tm.execute();
-					selectorTimeout = Math.min(ms, /*selectorTimeout*/ 250);
-					if (cm.execute()) {
-						selectorTimeout = 1;
-					}
-					continue;
-				}
-
-				Iterator<SelectionKey> keys = selector.selectedKeys().iterator();
-				while (keys.hasNext()) {
-					SelectionKey key = keys.next();
-					IOHandler handler = handlers.get(key.channel());
-					if (key.isAcceptable()) {
-						handler.handleAccept(key);
-					}
-					if (key.isConnectable()) {
-						handler.handleConnect(key);
-					}
-					if (key.isValid() && key.isReadable()) {
-						handler.handleRead(key);
-					}
-					if (key.isValid() && key.isWritable()) {
-						handler.handleWrite(key);
-					}
-					keys.remove();
-				}
-				long ms = tm.execute();
-				selectorTimeout = Math.min(ms, /*selectorTimeout*/ 250);
-				if (cm.execute()) { 
-					selectorTimeout = 1; 
-				}
-
-			} catch (IOException e) {
-				logger.error("Exception received in IOLoop: {}", e);			
-			}
-		}
-	}
-	
-	/**
-	 * Stop the io loop and release the thread (io loop thread) that invoked the {@link IOLoop#start} method.
-	 */
-	public void stop() {
-		running = false;
-		logger.debug("Stopping IOLoop...");
-	}
-	
-	/**
-	 * Registers a new {@code IOHandler} with this {@code IOLoop}.
-	 * 
-	 * @param channel The {@code SelectableChannel}
-	 * @param handler {@code IOHandler that will receive the io callbacks.}
-	 * @param interestOps See {@link SelectionKey} for valid values. (Xor for multiple interests).
-	 * @param attachment The {@code attachment} that will be accessible from the returning {@code SelectionKey}s 
-	 * attachment.
-	 * 
-	 */
-	public SelectionKey addHandler(SelectableChannel channel, IOHandler handler, int interestOps, Object attachment) {
-		handlers.put(channel, handler);
-		return registerChannel(channel, interestOps, attachment);		
-	}
-	
-	/**
-	 * Unregisters the previously registered {@code IOHandler}.
-
-	 * @param channel The {@code SelectableChannel} that was registered with a user defined {@code IOHandler}
-	 */
-	public void removeHandler(SelectableChannel channel) {
-		handlers.remove(channel);
-	}
-	
-	/**
-	 * Update an earlier registered {@code SelectableChannel}
-	 * 
-	 * @param channel The {@code SelectableChannel}
-	 * @param newInterestOps The complete new set of interest operations.
-	 */
-	public void updateHandler(SelectableChannel channel, int newInterestOps) {
-		if (handlers.containsKey(channel)) {
-			channel.keyFor(selector).interestOps(newInterestOps);
-		} else {
-			logger.warn("Tried to update interestOps for an unknown SelectableChannel.");
-		}
-	}
-	
-	/**
-	 * 
-	 * @param channel
-	 * @param interestOps
-	 * @param attachment
-	 * @return
-	 */
-	private SelectionKey registerChannel(SelectableChannel channel, int interestOps, Object attachment) {
-		try {
-			return channel.register(selector, interestOps, attachment);
-		} catch (ClosedChannelException e) {
-			removeHandler(channel);
-			logger.error("Could not register channel: {}", e.getMessage());		
-		}		
-		return null;
-	}
-	
-	public void addKeepAliveTimeout(SelectableChannel channel, Timeout keepAliveTimeout) {
-		tm.addKeepAliveTimeout(channel, keepAliveTimeout);
-	}
-	
-	public boolean hasKeepAliveTimeout(SelectableChannel channel) {
-		return tm.hasKeepAliveTimeout(channel);
-	}
-	
-	public void addTimeout(Timeout timeout) {
-		tm.addTimeout(timeout);
-	}
-
-	/**
-	 * The callback will be invoked in the next iteration in the io loop. This is the only thread safe method that is
-	 * exposed by Deft. 
-	 * This is a convenient way to return control to the io loop.
-	 */
-	public void addCallback(AsyncCallback callback) {
-		cm.addCallback(callback);
-	}
-	
-// implements IOLoopMXBean
-	@Override
-	public int getNumberOfRegisteredIOHandlers() {
-		return handlers.size();
-	}
-
-	@Override
-	public List<String> getRegisteredIOHandlers() {
-		Map<SelectableChannel, IOHandler> defensive = new HashMap<SelectableChannel, IOHandler>(handlers);
-		Collection<String> readables = transform(defensive.values(), new Function<IOHandler, String>() {
-			@Override public String apply(IOHandler handler) { return handler.toString(); }
-		});
-		return Lists.newLinkedList(readables);
-	}
+
+    /*
+     * IOLoop singleton to use for convenience (otherwise you would have to pass
+     * around the IOLoop instance explicitly, now you can simply use
+     * IOLoop.INSTANCE)
+     */
+    public static final IOLoop INSTANCE = new IOLoop();
+
+    private boolean running = false;
+
+    private final Logger logger = LoggerFactory.getLogger(IOLoop.class);
+
+    private Selector selector;
+
+    private final Map<SelectableChannel, IOHandler> handlers = Maps.newHashMap();
+
+    private final TimeoutManager tm = new JMXDebuggableTimeoutManager();
+    private final CallbackManager cm = new JMXDebuggableCallbackManager();
+
+    private static final AtomicInteger sequence = new AtomicInteger();
+
+    public IOLoop() {
+        try {
+            selector = Selector.open();
+        } catch (IOException e) {
+            logger.error("Could not open selector: {}", e.getMessage());
+        }
+        MXBeanUtil.registerMXBean(this, "IOLoop");
+    }
+
+    /**
+     * Start the io loop. The thread that invokes this method will be blocked
+     * (until {@link IOLoop#stop} is invoked) and will be the io loop thread.
+     */
+    public void start() {
+        Thread.currentThread().setName("I/O-LOOP" + sequence.incrementAndGet());
+        running = true;
+
+        long selectorTimeout = 250; // 250 ms
+        while (running) {
+            try {
+                if (selector.select(selectorTimeout) == 0) {
+                    long ms = tm.execute();
+                    selectorTimeout = Math.min(ms, /* selectorTimeout */250);
+                    if (cm.execute()) {
+                        selectorTimeout = 1;
+                    }
+                    continue;
+                }
+
+                Iterator<SelectionKey> keys = selector.selectedKeys().iterator();
+                while (keys.hasNext()) {
+                    SelectionKey key = keys.next();
+                    IOHandler handler = handlers.get(key.channel());
+                    if (key.isAcceptable()) {
+                        handler.handleAccept(key);
+                    }
+                    if (key.isConnectable()) {
+                        handler.handleConnect(key);
+                    }
+                    if (key.isValid() && key.isReadable()) {
+                        handler.handleRead(key);
+                    }
+                    if (key.isValid() && key.isWritable()) {
+                        handler.handleWrite(key);
+                    }
+                    keys.remove();
+                }
+                long ms = tm.execute();
+                selectorTimeout = Math.min(ms, /* selectorTimeout */250);
+                if (cm.execute()) {
+                    selectorTimeout = 1;
+                }
+
+            } catch (IOException e) {
+                logger.error("Exception received in IOLoop: {}", e);
+            }
+        }
+    }
+
+    /**
+     * Stop the io loop and release the thread (io loop thread) that invoked the
+     * {@link IOLoop#start} method.
+     */
+    public void stop() {
+        running = false;
+        logger.debug("Stopping IOLoop...");
+    }
+
+    /**
+     * Registers a new {@code IOHandler} with this {@code IOLoop}.
+     * 
+     * @param channel The {@code SelectableChannel}
+     * @param handler {@code IOHandler that will receive the io callbacks.}
+     * @param interestOps See {@link SelectionKey} for valid values. (Xor for
+     *            multiple interests).
+     * @param attachment The {@code attachment} that will be accessible from the
+     *            returning {@code SelectionKey}s attachment.
+     * 
+     */
+    public SelectionKey addHandler(SelectableChannel channel, IOHandler handler, int interestOps, Object attachment) {
+        handlers.put(channel, handler);
+        return registerChannel(channel, interestOps, attachment);
+    }
+
+    /**
+     * Unregisters the previously registered {@code IOHandler}.
+     * 
+     * @param channel The {@code SelectableChannel} that was registered with a
+     *            user defined {@code IOHandler}
+     */
+    public void removeHandler(SelectableChannel channel) {
+        handlers.remove(channel);
+    }
+
+    /**
+     * Update an earlier registered {@code SelectableChannel}
+     * 
+     * @param channel The {@code SelectableChannel}
+     * @param newInterestOps The complete new set of interest operations.
+     */
+    public void updateHandler(SelectableChannel channel, int newInterestOps) {
+        if (handlers.containsKey(channel)) {
+            channel.keyFor(selector).interestOps(newInterestOps);
+        } else {
+            logger.warn("Tried to update interestOps for an unknown SelectableChannel.");
+        }
+    }
+
+    /**
+     * 
+     * @param channel
+     * @param interestOps
+     * @param attachment
+     * @return
+     */
+    private SelectionKey registerChannel(SelectableChannel channel, int interestOps, Object attachment) {
+        try {
+            return channel.register(selector, interestOps, attachment);
+        } catch (ClosedChannelException e) {
+            removeHandler(channel);
+            logger.error("Could not register channel: {}", e.getMessage());
+        }
+        return null;
+    }
+
+    public void addKeepAliveTimeout(SelectableChannel channel, Timeout keepAliveTimeout) {
+        tm.addKeepAliveTimeout(channel, keepAliveTimeout);
+    }
+
+    public boolean hasKeepAliveTimeout(SelectableChannel channel) {
+        return tm.hasKeepAliveTimeout(channel);
+    }
+
+    public void addTimeout(Timeout timeout) {
+        tm.addTimeout(timeout);
+    }
+
+    /**
+     * The callback will be invoked in the next iteration in the io loop. This
+     * is the only thread safe method that is exposed by Deft. This is a
+     * convenient way to return control to the io loop.
+     */
+    public void addCallback(AsyncCallback callback) {
+        cm.addCallback(callback);
+    }
+
+    // implements IOLoopMXBean
+    @Override
+    public int getNumberOfRegisteredIOHandlers() {
+        return handlers.size();
+    }
+
+    @Override
+    public List<String> getRegisteredIOHandlers() {
+        Map<SelectableChannel, IOHandler> defensive = new HashMap<SelectableChannel, IOHandler>(handlers);
+        Collection<String> readables = transform(defensive.values(), new Function<IOHandler, String>() {
+            @Override
+            public String apply(IOHandler handler) {
+                return handler.toString();
+            }
+        });
+        return Lists.newLinkedList(readables);
+    }
 
 }

Copied: incubator/deft/sandbox/src/main/java/org/apache/deft/io/IOLoopMXBean.java (from r1153694, incubator/deft/sandbox/src/main/java/org/deftserver/io/IOLoopMXBean.java)
URL: http://svn.apache.org/viewvc/incubator/deft/sandbox/src/main/java/org/apache/deft/io/IOLoopMXBean.java?p2=incubator/deft/sandbox/src/main/java/org/apache/deft/io/IOLoopMXBean.java&p1=incubator/deft/sandbox/src/main/java/org/deftserver/io/IOLoopMXBean.java&r1=1153694&r2=1153959&rev=1153959&view=diff
==============================================================================
--- incubator/deft/sandbox/src/main/java/org/deftserver/io/IOLoopMXBean.java (original)
+++ incubator/deft/sandbox/src/main/java/org/apache/deft/io/IOLoopMXBean.java Thu Aug  4 18:35:27 2011
@@ -17,16 +17,14 @@
  *  under the License. 
  *  
  */
-package org.deftserver.io;
+package org.apache.deft.io;
 
 import java.util.List;
 
+public interface IOLoopMXBean {
 
+    int getNumberOfRegisteredIOHandlers();
+
+    List<String> getRegisteredIOHandlers();
 
-public interface IOLoopMXBean {
-	
-	int getNumberOfRegisteredIOHandlers();
-	
-	List<String> getRegisteredIOHandlers();
-	
 }

Modified: incubator/deft/sandbox/src/main/java/org/apache/deft/io/buffer/DynamicByteBuffer.java
URL: http://svn.apache.org/viewvc/incubator/deft/sandbox/src/main/java/org/apache/deft/io/buffer/DynamicByteBuffer.java?rev=1153959&r1=1153694&r2=1153959&view=diff
==============================================================================
--- incubator/deft/sandbox/src/main/java/org/apache/deft/io/buffer/DynamicByteBuffer.java (original)
+++ incubator/deft/sandbox/src/main/java/org/apache/deft/io/buffer/DynamicByteBuffer.java Thu Aug  4 18:35:27 2011
@@ -17,7 +17,7 @@
  *  under the License. 
  *  
  */
-package org.deftserver.io.buffer;
+package org.apache.deft.io.buffer;
 
 import java.nio.ByteBuffer;
 

Modified: incubator/deft/sandbox/src/main/java/org/apache/deft/io/callback/CallbackManager.java
URL: http://svn.apache.org/viewvc/incubator/deft/sandbox/src/main/java/org/apache/deft/io/callback/CallbackManager.java?rev=1153959&r1=1153694&r2=1153959&view=diff
==============================================================================
--- incubator/deft/sandbox/src/main/java/org/apache/deft/io/callback/CallbackManager.java (original)
+++ incubator/deft/sandbox/src/main/java/org/apache/deft/io/callback/CallbackManager.java Thu Aug  4 18:35:27 2011
@@ -17,9 +17,9 @@
  *  under the License. 
  *  
  */
-package org.deftserver.io.callback;
+package org.apache.deft.io.callback;
 
-import org.deftserver.web.AsyncCallback;
+import org.apache.deft.web.AsyncCallback;
 
 public interface CallbackManager {
 

Modified: incubator/deft/sandbox/src/main/java/org/apache/deft/io/callback/CallbackManagerMXBean.java
URL: http://svn.apache.org/viewvc/incubator/deft/sandbox/src/main/java/org/apache/deft/io/callback/CallbackManagerMXBean.java?rev=1153959&r1=1153694&r2=1153959&view=diff
==============================================================================
--- incubator/deft/sandbox/src/main/java/org/apache/deft/io/callback/CallbackManagerMXBean.java (original)
+++ incubator/deft/sandbox/src/main/java/org/apache/deft/io/callback/CallbackManagerMXBean.java Thu Aug  4 18:35:27 2011
@@ -17,7 +17,7 @@
  *  under the License. 
  *  
  */
-package org.deftserver.io.callback;
+package org.apache.deft.io.callback;
 
 public interface CallbackManagerMXBean {
 

Modified: incubator/deft/sandbox/src/main/java/org/apache/deft/io/callback/JMXDebuggableCallbackManager.java
URL: http://svn.apache.org/viewvc/incubator/deft/sandbox/src/main/java/org/apache/deft/io/callback/JMXDebuggableCallbackManager.java?rev=1153959&r1=1153694&r2=1153959&view=diff
==============================================================================
--- incubator/deft/sandbox/src/main/java/org/apache/deft/io/callback/JMXDebuggableCallbackManager.java (original)
+++ incubator/deft/sandbox/src/main/java/org/apache/deft/io/callback/JMXDebuggableCallbackManager.java Thu Aug  4 18:35:27 2011
@@ -17,14 +17,14 @@
  *  under the License. 
  *  
  */
-package org.deftserver.io.callback;
+package org.apache.deft.io.callback;
 
 import java.util.AbstractCollection;
 import java.util.List;
 import java.util.concurrent.ConcurrentLinkedQueue;
 
-import org.deftserver.util.MXBeanUtil;
-import org.deftserver.web.AsyncCallback;
+import org.apache.deft.util.MXBeanUtil;
+import org.apache.deft.web.AsyncCallback;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: incubator/deft/sandbox/src/main/java/org/apache/deft/io/callback/PeriodicCallback.java
URL: http://svn.apache.org/viewvc/incubator/deft/sandbox/src/main/java/org/apache/deft/io/callback/PeriodicCallback.java?rev=1153959&r1=1153694&r2=1153959&view=diff
==============================================================================
--- incubator/deft/sandbox/src/main/java/org/apache/deft/io/callback/PeriodicCallback.java (original)
+++ incubator/deft/sandbox/src/main/java/org/apache/deft/io/callback/PeriodicCallback.java Thu Aug  4 18:35:27 2011
@@ -17,11 +17,11 @@
  *  under the License. 
  *  
  */
-package org.deftserver.io.callback;
+package org.apache.deft.io.callback;
 
-import org.deftserver.io.IOLoop;
-import org.deftserver.io.timeout.Timeout;
-import org.deftserver.web.AsyncCallback;
+import org.apache.deft.io.IOLoop;
+import org.apache.deft.io.timeout.Timeout;
+import org.apache.deft.web.AsyncCallback;
 
 public class PeriodicCallback {
 	

Modified: incubator/deft/sandbox/src/main/java/org/apache/deft/io/timeout/JMXDebuggableTimeoutManager.java
URL: http://svn.apache.org/viewvc/incubator/deft/sandbox/src/main/java/org/apache/deft/io/timeout/JMXDebuggableTimeoutManager.java?rev=1153959&r1=1153694&r2=1153959&view=diff
==============================================================================
--- incubator/deft/sandbox/src/main/java/org/apache/deft/io/timeout/JMXDebuggableTimeoutManager.java (original)
+++ incubator/deft/sandbox/src/main/java/org/apache/deft/io/timeout/JMXDebuggableTimeoutManager.java Thu Aug  4 18:35:27 2011
@@ -17,7 +17,7 @@
  *  under the License. 
  *  
  */
-package org.deftserver.io.timeout;
+package org.apache.deft.io.timeout;
 
 import java.nio.channels.SelectableChannel;
 import java.util.Comparator;
@@ -25,7 +25,7 @@ import java.util.Iterator;
 import java.util.Map;
 import java.util.TreeSet;
 
-import org.deftserver.util.MXBeanUtil;
+import org.apache.deft.util.MXBeanUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 



Mime
View raw message