Package ome.tools.hibernate
Class ProxyCleanupFilter
- java.lang.Object
-
- ome.util.ContextFilter
-
- ome.tools.hibernate.ProxyCleanupFilter
-
- All Implemented Interfaces:
ome.util.Filter
public class ProxyCleanupFilter extends ome.util.ContextFilter
removes all proxies from a return graph to prevent ClassCastExceptions and Session Closed exceptions. You need to be careful with printing. Calling toString() on an unitialized object will break before filtering is complete. Note: we aren't setting the filtered collections here because it's "either null/unloaded or filtered". We will definitiely filter here, so it would just increase bandwidth. As of 4.4.0, this class is also responsible for various security-based modifications to returnedDetails
objects.- Since:
- 1.0
- See Also:
- Trac ticket #8277
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ProxyCleanupFilter.Interceptor
wraps a filter for each invocation
-
Field Summary
Fields Modifier and Type Field Description protected ACLVoter
acl
protected CurrentDetails
current
protected java.util.Map
unloadedObjectCache
-
Constructor Summary
Constructors Constructor Description ProxyCleanupFilter()
Passesnull
s toProxyCleanupFilter(ACLVoter, CurrentDetails)
such that all restricted objects will be unloaded.ProxyCleanupFilter(ACLVoter acl, CurrentDetails current)
Construct a proxy cleanup filter that checks the security restrictions on certain objects.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doFilter(java.lang.String arg0, java.lang.Object arg1)
java.util.Collection
filter(java.lang.String fieldId, java.util.Collection c)
java.util.Map
filter(java.lang.String fieldId, java.util.Map m)
ome.util.Filterable
filter(java.lang.String fieldId, ome.util.Filterable f)
-
-
-
Field Detail
-
unloadedObjectCache
protected java.util.Map unloadedObjectCache
-
acl
protected final ACLVoter acl
-
current
protected final CurrentDetails current
-
-
Constructor Detail
-
ProxyCleanupFilter
public ProxyCleanupFilter()
Passesnull
s toProxyCleanupFilter(ACLVoter, CurrentDetails)
such that all restricted objects will be unloaded.
-
ProxyCleanupFilter
public ProxyCleanupFilter(ACLVoter acl, CurrentDetails current)
Construct a proxy cleanup filter that checks the security restrictions on certain objects.- Parameters:
acl
- the ACL votercurrent
- the current thread's security context
-
-
Method Detail
-
filter
public ome.util.Filterable filter(java.lang.String fieldId, ome.util.Filterable f)
- Specified by:
filter
in interfaceome.util.Filter
- Overrides:
filter
in classome.util.ContextFilter
-
filter
public java.util.Collection filter(java.lang.String fieldId, java.util.Collection c)
- Specified by:
filter
in interfaceome.util.Filter
- Overrides:
filter
in classome.util.ContextFilter
-
filter
public java.util.Map filter(java.lang.String fieldId, java.util.Map m)
- Specified by:
filter
in interfaceome.util.Filter
- Overrides:
filter
in classome.util.ContextFilter
-
doFilter
protected void doFilter(java.lang.String arg0, java.lang.Object arg1)
- Overrides:
doFilter
in classome.util.ContextFilter
-
-