From deft-commits-return-340-apmail-incubator-deft-commits-archive=incubator.apache.org@incubator.apache.org Mon Feb 13 23:08:22 2012 Return-Path: X-Original-To: apmail-incubator-deft-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-deft-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0F0229B2A for ; Mon, 13 Feb 2012 23:08:22 +0000 (UTC) Received: (qmail 1844 invoked by uid 500); 13 Feb 2012 23:08:22 -0000 Delivered-To: apmail-incubator-deft-commits-archive@incubator.apache.org Received: (qmail 1810 invoked by uid 500); 13 Feb 2012 23:08:21 -0000 Mailing-List: contact deft-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: deft-dev@incubator.apache.org Delivered-To: mailing list deft-commits@incubator.apache.org Received: (qmail 1775 invoked by uid 99); 13 Feb 2012 23:08:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Feb 2012 23:08:21 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Feb 2012 23:08:16 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 0306523888FD; Mon, 13 Feb 2012 23:07:57 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r1243729 [1/7] - in /incubator/deft/trunk: ./ awf-core/ awf-core/src/ awf-core/src/main/ awf-core/src/main/assembly/ awf-core/src/main/java/ awf-core/src/main/java/org/ awf-core/src/main/java/org/apache/ awf-core/src/main/java/org/apache/aw... Date: Mon, 13 Feb 2012 23:07:51 -0000 To: deft-commits@incubator.apache.org From: jmeehan@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120213230757.0306523888FD@eris.apache.org> Author: jmeehan Date: Mon Feb 13 23:07:46 2012 New Revision: 1243729 URL: http://svn.apache.org/viewvc?rev=1243729&view=rev Log: DEFT-198 - New Project: Apache AWF Core Added: incubator/deft/trunk/awf-core/ incubator/deft/trunk/awf-core/CHANGES.txt incubator/deft/trunk/awf-core/LICENSE.txt incubator/deft/trunk/awf-core/NEWS.txt incubator/deft/trunk/awf-core/NOTICE.txt incubator/deft/trunk/awf-core/README.md incubator/deft/trunk/awf-core/pom.xml incubator/deft/trunk/awf-core/src/ incubator/deft/trunk/awf-core/src/main/ incubator/deft/trunk/awf-core/src/main/assembly/ incubator/deft/trunk/awf-core/src/main/assembly/awf-binary-with-deps.xml incubator/deft/trunk/awf-core/src/main/assembly/awf-binary.xml incubator/deft/trunk/awf-core/src/main/assembly/awf-src.xml incubator/deft/trunk/awf-core/src/main/java/ incubator/deft/trunk/awf-core/src/main/java/org/ incubator/deft/trunk/awf-core/src/main/java/org/apache/ incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/ incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/annotation/ incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/annotation/Asynchronous.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/annotation/Authenticated.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/annotation/Path.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/configuration/ incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/configuration/AnnotationsScanner.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/configuration/Configuration.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/io/ incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/io/AsynchronousSocket.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/io/IOHandler.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/io/IOLoop.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/io/IOLoopMXBean.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/io/buffer/ incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/io/buffer/DynamicByteBuffer.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/io/callback/ incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/io/callback/CallbackManager.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/io/callback/CallbackManagerMXBean.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/io/callback/JMXDebuggableCallbackManager.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/io/callback/PeriodicCallback.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/io/timeout/ incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/io/timeout/JMXDebuggableTimeoutManager.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/io/timeout/Timeout.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/io/timeout/TimeoutManager.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/io/timeout/TimeoutManagerMXBean.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/util/ incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/util/AcceptUtil.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/util/ArrayUtil.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/util/Closeables.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/util/CookieUtil.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/util/DateUtil.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/util/HttpUtil.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/util/KnuthMorrisPrattAlgorithm.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/util/MXBeanUtil.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/util/NopAsyncResult.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/util/Pair.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/util/ReflectionTools.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/util/UrlUtil.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/ incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/Application.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/AsyncCallback.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/AsyncResult.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/HttpServer.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/handler/ incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/handler/BadRequestRequestHandler.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/handler/ForbiddenRequestHandler.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/handler/HttpContinueRequestHandler.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/handler/NotFoundRequestHandler.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/handler/RequestHandler.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/handler/RequestHandlerFactory.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/handler/StaticContentHandler.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/http/ incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/http/HttpBufferedLexer.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/http/HttpException.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/http/HttpParsingContext.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/http/HttpProtocol.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/http/HttpRequest.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/http/HttpRequestDispatcher.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/http/HttpRequestImpl.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/http/HttpRequestParser.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/http/HttpResponse.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/http/HttpResponseImpl.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/http/HttpServerDescriptor.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/http/MalFormedHttpRequest.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/http/client/ incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/http/client/AsynchronousHttpClient.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/http/client/Request.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/http/client/Response.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/http/protocol/ incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/http/protocol/ContentType.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/http/protocol/HttpStatus.java incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/web/http/protocol/HttpVerb.java incubator/deft/trunk/awf-core/src/main/resources/ incubator/deft/trunk/awf-core/src/main/resources/logback.xml incubator/deft/trunk/awf-core/src/main/site/ incubator/deft/trunk/awf-core/src/main/site/resources/ incubator/deft/trunk/awf-core/src/main/site/resources/css/ incubator/deft/trunk/awf-core/src/main/site/resources/css/site.css incubator/deft/trunk/awf-core/src/main/site/resources/images/ incubator/deft/trunk/awf-core/src/main/site/resources/images/apache-incubator-logo.png (with props) incubator/deft/trunk/awf-core/src/main/site/resources/images/awf-logo.png (with props) incubator/deft/trunk/awf-core/src/main/site/xdoc/ incubator/deft/trunk/awf-core/src/main/site/xdoc/api-guide.xml incubator/deft/trunk/awf-core/src/main/site/xdoc/configuration-guide.xml incubator/deft/trunk/awf-core/src/main/site/xdoc/contributor-guide.xml incubator/deft/trunk/awf-core/src/main/site/xdoc/faq.xml incubator/deft/trunk/awf-core/src/main/site/xdoc/index.xml incubator/deft/trunk/awf-core/src/main/site/xdoc/irc.xml incubator/deft/trunk/awf-core/src/main/site/xdoc/quick-start-guide.xml incubator/deft/trunk/awf-core/src/main/site/xdoc/release-notes.xml incubator/deft/trunk/awf-core/src/main/site/xdoc/road-map.xml incubator/deft/trunk/awf-core/src/main/site/xdoc/xdoc.xsl incubator/deft/trunk/awf-core/src/test/ incubator/deft/trunk/awf-core/src/test/java/ incubator/deft/trunk/awf-core/src/test/java/org/ incubator/deft/trunk/awf-core/src/test/java/org/apache/ incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/ incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/configuration/ incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/configuration/AnnotationsScannerTest.java incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/configuration/ConfigurationTest.java incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/configuration/TestHandler.java incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/io/ incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/io/AsynchronousSocketTest.java incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/io/buffer/ incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/io/buffer/DynamicByteBufferTest.java incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/io/callback/ incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/io/callback/JMXDebuggableCallbackManagerTest.java incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/io/callback/PeriodicCallbackTest.java incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/io/timeout/ incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/io/timeout/JMXDebuggableTimeoutManagerTest.java incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/io/timeout/TimeoutTest.java incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/util/ incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/util/DateUtilTest.java incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/util/HttpRequestHelper.java incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/util/ReflectionToolsTest.java incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/util/UrlUtilTest.java incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/web/ incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/web/ApplicationTest.java incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/web/HttpServerTest.java incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/web/SystemTest.java incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/web/SystemTestHandlers.java incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/web/handler/ incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/web/handler/RequestHandlerFactoryTest.java incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/web/handler/RequestHandlerTest.java incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/web/http/ incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/web/http/HttpBufferedLexerTest.java incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/web/http/HttpExceptionTest.java incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/web/http/HttpProtocolTest.java incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/web/http/HttpRequestDispatcherTest.java incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/web/http/HttpRequestImplTest.java incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/web/http/HttpRequestParserTest.java incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/web/http/client/ incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/web/http/client/AsynchronousHttpClientTest.java incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/web/http/client/RequestTest.java incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/web/http/protocol/ incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/web/http/protocol/ContentTypeTest.java incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/web/http/protocol/HttpStatusTest.java incubator/deft/trunk/awf-core/src/test/java/org/apache/awf/web/http/protocol/HttpVerbTest.java incubator/deft/trunk/awf-core/src/test/resources/ incubator/deft/trunk/awf-core/src/test/resources/apache_feather.png (with props) incubator/deft/trunk/awf-core/src/test/resources/f4_impact.jpg (with props) incubator/deft/trunk/awf-core/src/test/resources/test.txt Modified: incubator/deft/trunk/ (props changed) Propchange: incubator/deft/trunk/ ------------------------------------------------------------------------------ --- ignore (added) +++ ignore Mon Feb 13 23:07:46 2012 @@ -0,0 +1,6 @@ +.classpath +.settings +.tmp +.class +.project + Added: incubator/deft/trunk/awf-core/CHANGES.txt URL: http://svn.apache.org/viewvc/incubator/deft/trunk/awf-core/CHANGES.txt?rev=1243729&view=auto ============================================================================== --- incubator/deft/trunk/awf-core/CHANGES.txt (added) +++ incubator/deft/trunk/awf-core/CHANGES.txt Mon Feb 13 23:07:46 2012 @@ -0,0 +1,31 @@ +############################################################################# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +############################################################################# +0.4.0 + * 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) + * #55 (Don't set Etag response header if payload is empty) + * #54 (Make parsing of HttpRequest more robust) + * #61 (Wrong 'Cache-Control' header in SCH) Added: incubator/deft/trunk/awf-core/LICENSE.txt URL: http://svn.apache.org/viewvc/incubator/deft/trunk/awf-core/LICENSE.txt?rev=1243729&view=auto ============================================================================== --- incubator/deft/trunk/awf-core/LICENSE.txt (added) +++ incubator/deft/trunk/awf-core/LICENSE.txt Mon Feb 13 23:07:46 2012 @@ -0,0 +1,446 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +========================================================================= +== SLF4J License == +========================================================================= + +SLF4J source code and binaries are distributed under the MIT license. +Copyright (c) 2004-2008 QOS.ch All rights reserved. Permission is hereby +granted, free of charge, to any person obtaining a copy of this software +and associated documentation files (the "Software"), to deal in the +Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above copyright +notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +These terms are identical to those of the MIT License, also called the X License or +the X11 License, which is a simple, permissive non-copyleft free software license. +It is deemed compatible with virtually all types of licenses, commercial or otherwise. +In particular, the Free Software Foundation has declared it compatible with GNU GPL. +It is also known to be approved by the Apache Software Foundation as compatible with +Apache Software License. + + +========================================================================= +== Logback License == +========================================================================= + +As of relase 0.9.18, logback source code and binaries are dual-licensed under +EPL v1.0 and the LGPL 2.1, or more formally: + +Logback: the reliable, generic, fast and flexible logging framework. +Copyright (C) 1999-2009, QOS.ch. All rights reserved. This program and the +accompanying materials are dual-licensed under either the terms of the Eclipse +Public License v1.0 as published by the Eclipse Foundation or +(per the licensee's choosing) under the terms of the GNU Lesser General Public +License version 2.1 as published by the Free Software Foundation. +The EPL/LGPL dual-license serves several purposes. The LGPL license ensures continuity +in terms of licensing of the logback project. Prior to version 0.9.18, logback was +licensed (exlusively) under the LGPL v2.1. Moreover, since the EPL is deemed +incompatible by the Free Software Foundation, the LGPL will allow various licensees, in +particular software distributors who may be already bound by the terms of the GPL or +the LGPL, to distribute our software. +On the other hand, the EPL license will placate organizations which refuse certain +restrictions imposed by the LGPL. +Please note that logback-classic is intended to be used behind the SLF4J API, which is +licensed under the MIT license. + +If you wish to make a significant contribution to the logback project, you are invited +to file Contributor License Agreement. The purpose of this agreement is to formalize the +terms of your contribution and to protect the project in case of litigation. +Upon request, we may exempt open-source projects from LGPL and EPL's reciprocity clauses +so that the said pojects can develop logback extensions under the license of their choice. +Exemptions are granted on a case by case basis. + + +========================================================================= +== Guava License == +========================================================================= + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS Added: incubator/deft/trunk/awf-core/NEWS.txt URL: http://svn.apache.org/viewvc/incubator/deft/trunk/awf-core/NEWS.txt?rev=1243729&view=auto ============================================================================== --- incubator/deft/trunk/awf-core/NEWS.txt (added) +++ incubator/deft/trunk/awf-core/NEWS.txt Mon Feb 13 23:07:46 2012 @@ -0,0 +1,93 @@ +0.4.0 +===== + +Features / Improvements +----------------------- + - Asynchronous HTTP client has configurable redirect support (HTTP status code 301 & 302) (#118) + - Asynchronous HTTP client supports 'Transfer-Encoding: chunked' (#116) + - Multi-threaded web server support (#139) + - Experimental support for large static files. (Nb. will memory map the entire file) (#75) + - Improved documentation for the AsynchronousSocket (#152) + - Using the AsynchronousSocket for server operations is officially supported (#150) + - Bug fix. Non deterministic behaviour when multiple timeouts have exact same deadline (DEFT-156) + - AsynchronousSocket accepts SocketChannel instead of SelectableChannel (DEFT-162) + - Improved error handling in AsynchronousSocket (DEFT-154) + - Bug fix. NPE when using AsynchronousSocket.write (DEFT-155) + - Asynchronous HTTP client supports POST and PUT (DEFT-117) + - Support for HTTP Cookies (DEFT-52) + - Request handlers now configured through annotations (DEFT-100) + +Configuration +------------- + - See org.apache.deft.example.DeftServerExample (or www.deftserver.org) for + configuration and usage hints. + + + +0.3.0 +===== + +Features +-------- + - Authentication support (#83) + - Header names are now case-insensitive (#48) + - Generic callbacks in IOLoop (#93) + - Bug fix. ConcurrentModificationException if a new timeout was added in a timeout callback (#89) + - Http HEAD support (#58) + - Bug fix. RequestHandler not found if query parameters is present. (#104) + - Periodic callbacks. Schedule a job to be executed by the IOLoop every nth ms. (#90) + - Bug Fix. Selector timeout tuning. (#108) + - Asynchronous socket to help third party developers. (#109) + - Asynchronous HTTP client (#97) + - IOLoop.addCallback is thread safe (#103) + - Bug fix. Proper 'keep-alive' management in web server component (#99) + +Configuration +------------ + - See org.deftserver.example.DeftServerExample (or www.deftserver.org) for + configuration and usage hints. + + + +0.2.0 +===== + +Features +-------- + - Asynchronous writes done right (#63). + - Support for third party libraries to work within Deft's IOLoop (#62) + (Thanks to github.com/williame and github.com/sris for inspiration and implementation details). + - Improved write performance (Using the fact that a java.nio socket write buffer is always writable as long + its space left in the write buffer, #74) + - Closed HTTP request premature in HttpResponse.finish() (#72) + - JMX monitoring (read only) for IOLoop (#68) + - Configurable knobs, e.g. keep-alive timeout, read/write buffer sizes. (#57, #67) + - java.nio.ByteBuffer reuse (byte[] allocation is expensive) (#77) + - Timeouts (JMX debuggable) (#80, #85) + - HTTP Post support (#50, #71) + +Configuration +------------ + - See org.deftserver.example.DeftServerExample (or www.deftserver.org) for + configuration and usage hints. + + + +0.1.0 +===== + +Features +-------- + - Date headers are always sent in http response (#29). + - Support for non-blocking, asynchronous requests (#11). + - Regular expressions (with capturing groups) in URL mapping (#10). + - Support for HTTP GET parameters (#35). + - Persistent connections ('Connection: Keep-Alive') (#19). + - Static resources (#21 and #28, thanks to github.com/williame for pointing in right direction). + - JMX api for monitoring 'keep-alive' connections. + +Configuration +------------ + - See org.deftserver.example.DeftServerExample (or www.deftserver.org) for + configuration and usage hints. + \ No newline at end of file Added: incubator/deft/trunk/awf-core/NOTICE.txt URL: http://svn.apache.org/viewvc/incubator/deft/trunk/awf-core/NOTICE.txt?rev=1243729&view=auto ============================================================================== --- incubator/deft/trunk/awf-core/NOTICE.txt (added) +++ incubator/deft/trunk/awf-core/NOTICE.txt Mon Feb 13 23:07:46 2012 @@ -0,0 +1,21 @@ +Deft web server + +Alternative collection types provided by guava-libraries (superset of the old Google Collections Library) +http://code.google.com/p/guava-libraries/ +Copyright (C) 2007 Google Inc. + +Logging library (successor to the popular log4j project). +http://logback.qos.ch/ +Copyright (C) 2010 QOS.ch + +Http client library used by unit tests. +http://hc.apache.org/ +Copyright (C) 2005-2010 Apache Software Foundation + +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 (C) 1993, 2010, Oracle and/or its affiliates. + +Asynchronous Http client library used by unit tests. +https://github.com/AsyncHttpClient/async-http-client +Copyright 2010 Ning Inc \ No newline at end of file Added: incubator/deft/trunk/awf-core/README.md URL: http://svn.apache.org/viewvc/incubator/deft/trunk/awf-core/README.md?rev=1243729&view=auto ============================================================================== --- incubator/deft/trunk/awf-core/README.md (added) +++ incubator/deft/trunk/awf-core/README.md Mon Feb 13 23:07:46 2012 @@ -0,0 +1,18 @@ +Deft has been accepted to the ASF incubator (http://markmail.org/message/qkbl7djiqwg7eofo) +Migration work (jira, wiki, vcs, mailing lists, accounts, cla) has started... + +# Deft +Deft is a single threaded, asynchronous, event driven high performance web server running on the JVM. + +The Deft web server is an open source projected (licensed under [Apache version 2]). Deft was intitially inspired by [facebook/tornado] + +Source and issue tracker: [http://github.com/rschildmeijer/deft] + +Documentation: [http://www.deftserver.org] + +CI Server: [https://builds.apache.org/job/Deft/] + +[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 Added: incubator/deft/trunk/awf-core/pom.xml URL: http://svn.apache.org/viewvc/incubator/deft/trunk/awf-core/pom.xml?rev=1243729&view=auto ============================================================================== --- incubator/deft/trunk/awf-core/pom.xml (added) +++ incubator/deft/trunk/awf-core/pom.xml Mon Feb 13 23:07:46 2012 @@ -0,0 +1,309 @@ + + + + 4.0.0 + + + org.apache.awf + awf-parent + 0.4.0-SNAPSHOT + ../awf-parent + + awf-core + + Apache AWF Core + + + + com.google.guava + guava + + + + junit + junit + + + + org.mockito + mockito-core + test + + + + org.powermock + powermock-module-junit4 + + + + org.powermock + powermock-api-mockito + + + + ch.qos.logback + logback-classic + jar + + + + org.apache.httpcomponents + httpclient + + + + com.ning + async-http-client + + + + javax.activation + activation + + + + + + + org.apache.maven.wagon + wagon-ssh-external + 1.0-beta-6 + + + + + + + org.apache.rat + apache-rat-plugin + + false + + + **/target/**/* + **/cobertura.ser + + **/.classpath + **/.project + **/.settings/**/* + + **/*.iml + **/*.ipr + **/*.iws + + **/MANIFEST.MF + + distribution/src/main/release/licenses/* + src/main/release/licenses/* + + **/dependency-reduced-pom.xml + + **/.gitignore + + src/test/resources/test.txt + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.2 + + UTF-8 + 1.6 + 1.6 + + + + + maven-assembly-plugin + 2.2-beta-5 + + + src/main/assembly/awf-binary.xml + src/main/assembly/awf-binary-with-deps.xml + + src/main/assembly/awf-src.xml + + + + + maven-site-plugin + 3.0 + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.7 + + + + aggregate + + aggregate + + site + + + attach-javadocs + + jar + + + + + + + + + + + org.apache.maven.plugins + maven-project-info-reports-plugin + 2.4 + + + + modules + project-team + mailing-list + issue-tracking + license + dependencies + cim + scm + + + + + + + + + + schildmeijer + Roger Schildmeijer + + Committer + + + + jmeehan + Johnathan Meehan + + Committer + + + + nwhitehead + Nicholas Whitehead + + Committer + + + + slemesle + Séven Le Mesle + + Committer + + + + + + + Adam Lofts + + + Julien Vermillard + + + Michele Zuccalà + + + + + JIRA + http://issues.apache.org/jira/browse/DEFT + + + + + Users + deft-user@incubator.apache.org + deft-users-subscribe@incubator.apache.org + deft-users-unsubscribe@incubator.apache.org + + http://mail-archives.apache.org/mod_mbox/incubator-deft-users/ + + + + Development + deft-dev@incubator.apache.org + deft-dev-subscribe@incubator.apache.org + deft-dev-unsubscribe@incubator.apache.org + http://mail-archives.apache.org/mod_mbox/incubator-deft-dev/ + + + + Commits + deft-commits@incubator.apache.org + deft-commits-subscribe@incubator.apache.org + deft-commits-unsubscribe@incubator.apache.org + + http://mail-archives.apache.org/mod_mbox/incubator-deft-commits/ + + + + + + scm:svn:http://svn.apache.org/repos/asf/incubator/deft/trunk/ + + scm:svn:https://svn.apache.org/repos/asf/incubator/deft/trunk/ + + http://svn.apache.org/viewvc/incubator/deft/trunk/ + + + + Jenkins + https://builds.apache.org/job/Deft/ + + + + + apache.website + scpexe://people.apache.org/www/incubator.apache.org/deft + + + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + + + \ No newline at end of file Added: incubator/deft/trunk/awf-core/src/main/assembly/awf-binary-with-deps.xml URL: http://svn.apache.org/viewvc/incubator/deft/trunk/awf-core/src/main/assembly/awf-binary-with-deps.xml?rev=1243729&view=auto ============================================================================== --- incubator/deft/trunk/awf-core/src/main/assembly/awf-binary-with-deps.xml (added) +++ incubator/deft/trunk/awf-core/src/main/assembly/awf-binary-with-deps.xml Mon Feb 13 23:07:46 2012 @@ -0,0 +1,44 @@ + + + + binary-with-deps + + tar.gz + zip + + + + false + runtime + lib + + + + + + ${project.basedir}/README.md + ${project.basedir}/LICENSE.txt + ${project.basedir}/NOTICE.txt + ${project.basedir}/NEWS.txt + + + + Added: incubator/deft/trunk/awf-core/src/main/assembly/awf-binary.xml URL: http://svn.apache.org/viewvc/incubator/deft/trunk/awf-core/src/main/assembly/awf-binary.xml?rev=1243729&view=auto ============================================================================== --- incubator/deft/trunk/awf-core/src/main/assembly/awf-binary.xml (added) +++ incubator/deft/trunk/awf-core/src/main/assembly/awf-binary.xml Mon Feb 13 23:07:46 2012 @@ -0,0 +1,44 @@ + + + + binary + + tar.gz + zip + + + + + ${project.basedir}/README.md + ${project.basedir}/LICENSE.txt + ${project.basedir}/NOTICE.txt + ${project.basedir}/NEWS.txt + + + + ${project.build.directory} + + *.jar + + lib + + + Added: incubator/deft/trunk/awf-core/src/main/assembly/awf-src.xml URL: http://svn.apache.org/viewvc/incubator/deft/trunk/awf-core/src/main/assembly/awf-src.xml?rev=1243729&view=auto ============================================================================== --- incubator/deft/trunk/awf-core/src/main/assembly/awf-src.xml (added) +++ incubator/deft/trunk/awf-core/src/main/assembly/awf-src.xml Mon Feb 13 23:07:46 2012 @@ -0,0 +1,42 @@ + + + + src + + tar.gz + zip + + + + + ${project.basedir}/README.md + ${project.basedir}/LICENSE.txt + ${project.basedir}/NOTICE.txt + ${project.basedir}/NEWS.txt + ${project.basedir}/pom.xml + + + + ${project.basedir}/src + true + + + Added: incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/annotation/Asynchronous.java URL: http://svn.apache.org/viewvc/incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/annotation/Asynchronous.java?rev=1243729&view=auto ============================================================================== --- incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/annotation/Asynchronous.java (added) +++ incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/annotation/Asynchronous.java Mon Feb 13 23:07:46 2012 @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.awf.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.apache.awf.web.handler.RequestHandler; + +/** + * Annotation used by implementation of {@link RequestHandler} to denote a + * method as asynchronous (i.e don't close the Http connection until the client + * invokes the finish method) + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +public @interface Asynchronous { +} Added: incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/annotation/Authenticated.java URL: http://svn.apache.org/viewvc/incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/annotation/Authenticated.java?rev=1243729&view=auto ============================================================================== --- incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/annotation/Authenticated.java (added) +++ incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/annotation/Authenticated.java Mon Feb 13 23:07:46 2012 @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.awf.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +import org.apache.awf.web.handler.RequestHandler; + +/** + * Annotation used by implementation of {@link RequestHandler} to show that a + * method requires that the request (current user) is authenticated (i.e your + * overridden method {@link RequestHandler#getCurrentUser} returns a non null + * value) + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +public @interface Authenticated { +} Added: incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/annotation/Path.java URL: http://svn.apache.org/viewvc/incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/annotation/Path.java?rev=1243729&view=auto ============================================================================== --- incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/annotation/Path.java (added) +++ incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/annotation/Path.java Mon Feb 13 23:07:46 2012 @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.awf.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.util.regex.Pattern; + +/** + * Defines the request path for which the annotated RequestHandler + * method is applicable. The path is defined from root, and so for example to + * associate a RequestHandler with the top-level directory + * "images": + *

+ * @Path("/images/") + *

+ *

+ * Values are a combination of paths and regular expressions as understood by + * {@link Pattern}. For example: + *

+ *
    + *
  • @Path("/path/([\\w]+)") matches any word character after + * the path such as "/path/123", "/path/abc" or "/path/12ab". + *
  • @Path("/matchThis") matches on the path itself, that is + * "http://host/matchThis". + *
+ */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface Path { + + String value(); +} Added: incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/configuration/AnnotationsScanner.java URL: http://svn.apache.org/viewvc/incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/configuration/AnnotationsScanner.java?rev=1243729&view=auto ============================================================================== --- incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/configuration/AnnotationsScanner.java (added) +++ incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/configuration/AnnotationsScanner.java Mon Feb 13 23:07:46 2012 @@ -0,0 +1,151 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.awf.configuration; + +import java.io.File; +import java.io.IOException; +import java.net.URL; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.awf.annotation.Path; +import org.apache.awf.util.ReflectionTools; +import org.apache.awf.web.handler.RequestHandler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.common.base.Strings; + +/** + * Provides functionality to retrieve known Annotation types and + * associated values. + */ +public class AnnotationsScanner { + + private final static Logger logger = LoggerFactory.getLogger(AnnotationsScanner.class); + + /** + * A Map of RequestHandlers associated with + * {@link Path}s. + */ + private Map pathHandlers = new HashMap(); + + /** + * Recursively iterate the given package, and attempt to resolve all + * annotated references for RequestHandler implementations. + * + * @param handlerPackage the base package to scan, for example + * "org.apache.awf". + * @return a Map<String, RequestHandler> of handlers, + * which may be empty but not null. + */ + public Map findHandlers(String handlerPackage) { + + if (Strings.isNullOrEmpty(handlerPackage)) { + logger.warn("No RequestHandler package defined"); + return pathHandlers; + } + + List> classes = findClasses(handlerPackage); + for (Class clazz : classes) { + if (clazz.isAnnotationPresent(Path.class)) { + + RequestHandler handler = (RequestHandler) ReflectionTools.createInstance(clazz.getCanonicalName()); + Path path = clazz.getAnnotation(Path.class); + pathHandlers.put(path.value(), handler); + + logger.info("Added RequestHandler [" + clazz.getCanonicalName() + "] for Path [" + path.value() + "]"); + } + } + + return pathHandlers; + } + + /** + * Recursively finds all classes available to the context + * ClassLoader from the given package. + * + * @param packageName the package from which to commence the scan. + * @return A List of Class references. + */ + private List> findClasses(String packageName) { + + List> classes = new ArrayList>(); + + ClassLoader loader = Thread.currentThread().getContextClassLoader(); + if (loader == null) { + logger.error("Context ClassLoader was not available"); + return classes; + } + + String path = packageName.replace('.', '/'); + try { + List directories = new ArrayList(); + + Enumeration resources = loader.getResources(path); + while (resources.hasMoreElements()) { + URL resource = resources.nextElement(); + directories.add(new File(resource.getFile())); + } + + for (File directory : directories) { + classes.addAll(findClasses(directory, packageName)); + } + } catch (IOException e) { + logger.error("Exception accessing resources for [" + path + "]", e); + } + + return classes; + } + + /** + * Recursively finds all class files available for the given package from + * the passed directory. + * + * @param packageName the package from which to commence the scan. + * @return A List of Class references. + */ + private List> findClasses(File directory, String packageName) { + + List> classes = new ArrayList>(); + if (directory == null || !directory.exists()) { + logger.error("Directory is null value or non-existent, [" + directory + "]"); + return classes; + } + + for (File file : directory.listFiles()) { + try { + if (file.isDirectory()) { + classes.addAll(findClasses(file, packageName + "." + file.getName())); + } else if (file.getName().endsWith(".class")) { + classes.add(Class.forName(packageName + '.' + + file.getName().substring(0, file.getName().length() - 6))); + } + } catch (ClassNotFoundException e) { + logger.error("ClassNotFoundException", e); + } + } + + return classes; + } +} Added: incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/configuration/Configuration.java URL: http://svn.apache.org/viewvc/incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/configuration/Configuration.java?rev=1243729&view=auto ============================================================================== --- incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/configuration/Configuration.java (added) +++ incubator/deft/trunk/awf-core/src/main/java/org/apache/awf/configuration/Configuration.java Mon Feb 13 23:07:46 2012 @@ -0,0 +1,112 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.awf.configuration; + +import org.apache.awf.web.HttpServer; + +import com.google.common.base.Strings; + +/** + * Simple type to hold configuration options, to be passed to {@link HttpServer} + * . + */ +public class Configuration { + + /** + * The default directory for static content. + */ + static final String DEFAULT_STATIC_DIRECTORY = "static"; + + /** + * The package under which RequestHandler implementations are + * to be found, for example "org.apache.awf". + */ + private String handlerPacakge; + + /** + * The directory from which static content should be retrieved. + */ + private String staticDirectory; + + /** + * Indicates whether ETags should be generated and applied. + */ + private boolean createETags; + + /** + * Retrieve the package under which RequestHandler + * implementations are to be found, for example "org.apache.awf". + * + * @return the current package name. + */ + public String getHandlerPackage() { + return Strings.nullToEmpty(handlerPacakge).trim().isEmpty() ? "" : handlerPacakge; + } + + /** + * Set package under which RequestHandler implementations are + * to be found, for example "org.apache.awf". + * + * @param handlerPackage the name of the package. + */ + public void setHandlerPackage(String handlerPackage) { + handlerPacakge = handlerPackage; + } + + /** + * Retrieve directory from which static content should be retrieved. + * Defaults to the value of {@link #DEFAULT_STATIC_DIRECTORY} where empty or + * null. + * + * @return the current name of the static directory. + */ + public String getStaticDirectory() { + return Strings.nullToEmpty(staticDirectory).trim().isEmpty() ? "static" : staticDirectory; + } + + /** + * Set the directory from which static content should be retrieved. + * + * @param staticDirectory the directory name for use. + */ + public void setStaticDirectory(String staticDirectory) { + this.staticDirectory = staticDirectory; + } + + /** + * Determine whether ETags should currently be generated and applied. + * + * @return true if they are to be created; false + * otherwise. + */ + public boolean shouldCreateETags() { + return createETags; + } + + /** + * Set whether ETags should be generated and applied. + * + * @param createETags true to create them; false + * otherwise. + */ + public void setCreateETags(boolean createETags) { + this.createETags = createETags; + } +}