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.ContextFilterremoves 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 returnedDetailsobjects.- Since:
- 1.0
- See Also:
- Trac ticket #8277
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classProxyCleanupFilter.Interceptorwraps a filter for each invocation
-
Field Summary
Fields Modifier and Type Field Description protected ACLVoteraclprotected CurrentDetailscurrentprotected java.util.MapunloadedObjectCache
-
Constructor Summary
Constructors Constructor Description ProxyCleanupFilter()Passesnulls 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 voiddoFilter(java.lang.String arg0, java.lang.Object arg1)java.util.Collectionfilter(java.lang.String fieldId, java.util.Collection c)java.util.Mapfilter(java.lang.String fieldId, java.util.Map m)ome.util.Filterablefilter(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()
Passesnulls 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:
filterin interfaceome.util.Filter- Overrides:
filterin classome.util.ContextFilter
-
filter
public java.util.Collection filter(java.lang.String fieldId, java.util.Collection c)- Specified by:
filterin interfaceome.util.Filter- Overrides:
filterin classome.util.ContextFilter
-
filter
public java.util.Map filter(java.lang.String fieldId, java.util.Map m)- Specified by:
filterin interfaceome.util.Filter- Overrides:
filterin classome.util.ContextFilter
-
doFilter
protected void doFilter(java.lang.String arg0, java.lang.Object arg1)- Overrides:
doFilterin classome.util.ContextFilter
-
-