Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 74898 invoked from network); 27 Apr 2009 15:02:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Apr 2009 15:02:56 -0000 Received: (qmail 23713 invoked by uid 500); 27 Apr 2009 15:02:56 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 23676 invoked by uid 500); 27 Apr 2009 15:02:56 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 23668 invoked by uid 99); 27 Apr 2009 15:02:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Apr 2009 15:02:55 +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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Apr 2009 15:02:54 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id D3CD8234C4B1 for ; Mon, 27 Apr 2009 08:02:32 -0700 (PDT) Message-ID: <330544529.1240844552866.JavaMail.jira@brutus> Date: Mon, 27 Apr 2009 08:02:32 -0700 (PDT) From: "Jukka Zitting (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Moved: (OCM-5) No Filter on method finalize for Proxy In-Reply-To: <1400424376.1238279570976.JavaMail.jira@brutus> 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/OCM-5?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jukka Zitting moved JCR-2046 to OCM-5: -------------------------------------- Component/s: (was: jackrabbit-ocm) Workflow: no-reopen-closed, patch-avail (was: jira) Key: OCM-5 (was: JCR-2046) Project: Jackrabbit OCM (was: Jackrabbit Content Repository) > No Filter on method finalize for Proxy > -------------------------------------- > > Key: OCM-5 > URL: https://issues.apache.org/jira/browse/OCM-5 > Project: Jackrabbit OCM > Issue Type: Bug > Reporter: Sandrine Raffalli > > The InvocationHandler of a proxy is called when the method finalize() is called, that means the proxy loads the object when the GC tries to delete it. > Adding a CallbackFilter to the Enhancer could be a solution to avoid that : > public class ProxyManagerImpl implements ProxyManager { > private static final CallbackFilter FINALIZE_FILTER = new CallbackFilter() { > public int accept(Method method) { > if (method.getParameterTypes().length == 0 && method.getName().equals("finalize")) { > return 1; > } else { > return 0; > } > } > }; > ... > public Object createBeanProxy(BeanConverter beanConverter, String path, Session session, Node parentNode, BeanDescriptor beanDescriptor, > ClassDescriptor beanClassDescriptor, Class beanClass, Object parent) { > ... > return Enhancer.create(beanClass, getInterfaces(beanClass), FINALIZE_FILTER, new Callback[] { loader , NoOp.INSTANCE}); > } > ... > public Object createCollectionProxy(Session session, CollectionConverter collectionConverter, Node parentNode, > CollectionDescriptor collectionDescriptor, Class collectionFieldClass) { > .... > return Enhancer.create(collectionFieldClass, getInterfaces(collectionFieldClass), FINALIZE_FILTER, new Callback[] { loader , NoOp.INSTANCE}); > } > ... > } > Maybe you may consider other methods such as "equals", "hashCode"... -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.