You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Sandrine Raffalli (JIRA)" <ji...@apache.org> on 2009/03/28 23:32:50 UTC
[jira] Created: (JCR-2046) No Filter on method finalize for Proxy
No Filter on method finalize for Proxy
--------------------------------------
Key: JCR-2046
URL: https://issues.apache.org/jira/browse/JCR-2046
Project: Jackrabbit Content Repository
Issue Type: Bug
Components: jackrabbit-ocm
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 });
}
...
public Object createCollectionProxy(Session session, CollectionConverter collectionConverter, Node parentNode,
CollectionDescriptor collectionDescriptor, Class collectionFieldClass) {
....
return Enhancer.create(collectionFieldClass, getInterfaces(collectionFieldClass), FINALIZE_FILTER, new Callback[] { loader });
}
...
}
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.
[jira] Updated: (JCR-2046) No Filter on method finalize for Proxy
Posted by "Sandrine Raffalli (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/JCR-2046?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sandrine Raffalli updated JCR-2046:
-----------------------------------
Description:
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"...
was:
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 });
}
...
public Object createCollectionProxy(Session session, CollectionConverter collectionConverter, Node parentNode,
CollectionDescriptor collectionDescriptor, Class collectionFieldClass) {
....
return Enhancer.create(collectionFieldClass, getInterfaces(collectionFieldClass), FINALIZE_FILTER, new Callback[] { loader });
}
...
}
Maybe you may consider other methods such as "equals", "hashCode"...
> No Filter on method finalize for Proxy
> --------------------------------------
>
> Key: JCR-2046
> URL: https://issues.apache.org/jira/browse/JCR-2046
> Project: Jackrabbit Content Repository
> Issue Type: Bug
> Components: jackrabbit-ocm
> 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.
[jira] Updated: (OCM-5) No Filter on method finalize for Proxy
Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OCM-5?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jukka Zitting updated OCM-5:
----------------------------
Description:
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 :
{code}
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});
}
...
}
{code}
Maybe you may consider other methods such as "equals", "hashCode"...
was:
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"...
> 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 :
> {code}
> 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});
> }
> ...
> }
> {code}
> 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.
[jira] Moved: (OCM-5) No Filter on method finalize for Proxy
Posted by "Jukka Zitting (JIRA)" <ji...@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.