Return-Path: X-Original-To: apmail-cayenne-commits-archive@www.apache.org Delivered-To: apmail-cayenne-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B7B8479D2 for ; Thu, 6 Oct 2011 20:39:53 +0000 (UTC) Received: (qmail 51818 invoked by uid 500); 6 Oct 2011 20:39:53 -0000 Delivered-To: apmail-cayenne-commits-archive@cayenne.apache.org Received: (qmail 51797 invoked by uid 500); 6 Oct 2011 20:39:53 -0000 Mailing-List: contact commits-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cayenne.apache.org Delivered-To: mailing list commits@cayenne.apache.org Received: (qmail 51789 invoked by uid 99); 6 Oct 2011 20:39:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Oct 2011 20:39:53 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Oct 2011 20:39:51 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id C1B192ACE3A for ; Thu, 6 Oct 2011 20:39:29 +0000 (UTC) Date: Thu, 6 Oct 2011 20:39:29 +0000 (UTC) From: "John Huss (Updated) (JIRA)" To: commits@cayenne.apache.org Message-ID: <1169873022.5097.1317933569794.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1516717784.5095.1317933569743.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (CAY-1629) [PATCH] Can't add custom Hessian serializers to the client MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CAY-1629?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] John Huss updated CAY-1629: --------------------------- Attachment: client_custom_serializers_patch.txt Patch to expose the serializer factory on the client > [PATCH] Can't add custom Hessian serializers to the client > ---------------------------------------------------------- > > Key: CAY-1629 > URL: https://issues.apache.org/jira/browse/CAY-1629 > Project: Cayenne > Issue Type: Improvement > Components: ROP > Affects Versions: 3.1M4 > Environment: Mac 10.6 > Reporter: John Huss > Priority: Minor > Labels: patch > Attachments: client_custom_serializers_patch.txt > > Original Estimate: 0.5h > Remaining Estimate: 0.5h > > There isn't any way to register custom Hessian serializers to the client in an ROP setup. They can be registered with the server by doing this: > public class SampleServlet extends ROPHessianServlet { > public void init(ServletConfig configuration) throws ServletException { > super.init(configuration); > getSerializerFactory().addFactory(new MySerializerFactory()); > } > } > The attached patch saves and exposes a reference to the serializerFactory on the client so that the same thing can be done there as well, like so: > ClientRuntime clientRuntime = new ClientRuntime(...); > ((HessianConnection) clientRuntime.getConnection()).getSerializerFactory().addFactory(new MySerializerFactory()); > In either case these custom serializers will not be reflected when using the static methods in HessianUtil since those factories are completely internal. This could be considered an existing bug since the server already supports adding custom factories. Perhaps the better solution would be to make the CLIENT_SERIALIZER_FACTORIES and SERVER_SERIALIZER_FACTORIES variables modifiable, but that feels ugly. > For the time being though, the patch provides some essential functionality that is missing. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira