From nuvem-commits-return-25-apmail-incubator-nuvem-commits-archive=incubator.apache.org@incubator.apache.org Fri Sep 17 22:04:55 2010 Return-Path: Delivered-To: apmail-incubator-nuvem-commits-archive@minotaur.apache.org Received: (qmail 34703 invoked from network); 17 Sep 2010 22:04:55 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 17 Sep 2010 22:04:55 -0000 Received: (qmail 94830 invoked by uid 500); 17 Sep 2010 22:04:55 -0000 Delivered-To: apmail-incubator-nuvem-commits-archive@incubator.apache.org Received: (qmail 94788 invoked by uid 500); 17 Sep 2010 22:04:55 -0000 Mailing-List: contact nuvem-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: nuvem-dev@incubator.apache.org Delivered-To: mailing list nuvem-commits@incubator.apache.org Received: (qmail 94781 invoked by uid 99); 17 Sep 2010 22:04:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Sep 2010 22:04:54 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.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; Fri, 17 Sep 2010 22:04:54 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 32E8023889E2; Fri, 17 Sep 2010 22:04:34 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r998349 - /incubator/nuvem/trunk/store-assets/src/main/java/services/Cart.java Date: Fri, 17 Sep 2010 22:04:34 -0000 To: nuvem-commits@incubator.apache.org From: rfeng@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100917220434.32E8023889E2@eris.apache.org> Author: rfeng Date: Fri Sep 17 22:04:33 2010 New Revision: 998349 URL: http://svn.apache.org/viewvc?rev=998349&view=rev Log: Work around the ClassCastException Modified: incubator/nuvem/trunk/store-assets/src/main/java/services/Cart.java Modified: incubator/nuvem/trunk/store-assets/src/main/java/services/Cart.java URL: http://svn.apache.org/viewvc/incubator/nuvem/trunk/store-assets/src/main/java/services/Cart.java?rev=998349&r1=998348&r2=998349&view=diff ============================================================================== --- incubator/nuvem/trunk/store-assets/src/main/java/services/Cart.java (original) +++ incubator/nuvem/trunk/store-assets/src/main/java/services/Cart.java Fri Sep 17 22:04:33 2010 @@ -19,10 +19,59 @@ package services; -import org.apache.tuscany.sca.data.collection.Collection; +import org.apache.tuscany.sca.data.collection.Entry; +import org.apache.tuscany.sca.data.collection.NotFoundException; import org.oasisopen.sca.annotation.Remotable; @Remotable -public interface Cart extends Collection { +/** + * [rfeng] Tuscany cannot handle subclassing Collection to resolve the type variable. As a workaround, we copy all the methods into this interface directly + */ +public interface Cart { + /** + * Get the whole collection. + * + * @return the whole collection. + */ + Entry[] getAll(); + /** + * Returns a collection resulting from a query. + * + * @return the collection. + */ + Entry[] query(String queryString); + + /** + * Creates a new item. + * + * @param key + * @param item + * @return + */ + String post(String key, Item item); + + /** + * Retrieves an item. + * + * @param key + * @return + */ + Item get(String key) throws NotFoundException; + + /** + * Updates an item. + * + * @param key + * @param item + * @return + */ + void put(String key, Item item) throws NotFoundException; + + /** + * Delete an item. + * + * @param key + */ + void delete(String key) throws NotFoundException; }