[
https://issues.apache.org/jira/browse/JEXL-292?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16825997#comment-16825997
]
Dmitri Blinov commented on JEXL-292:
------------------------------------
Now that a subclass of {{Permissions}} class can be defined, we need a way to
provide the defined subclass to the {{Uberspect}} implementation. The idea is
to have an additional member and a parameter in constructor:
{code:java}
public Uberspect(Log runtimeLogger, JexlUberspect.ResolverStrategy sty,
Permissions perms) {
...
this.permissions = perms;
}
{code}
So that {{Uberspect.base()}} can pass it to the {{Introspector}} constructor
{code}
protected final Introspector base() {
Introspector intro = ref.get();
if (intro == null) {
// double checked locking is ok (fixed by Java 5 memory model).
synchronized (this) {
intro = ref.get();
if (intro == null) {
intro = new Introspector(rlog, loader.get(), permissions);
ref = new SoftReference<Introspector>(intro);
loader = new SoftReference<ClassLoader>(intro.getLoader());
version.incrementAndGet();
}
}
}
return intro;
}
{code}
> Allow to specify custom Permissions class for Uberspect to be used later by
> Introspector
> ----------------------------------------------------------------------------------------
>
> Key: JEXL-292
> URL: https://issues.apache.org/jira/browse/JEXL-292
> Project: Commons JEXL
> Issue Type: New Feature
> Affects Versions: 3.1
> Reporter: Dmitri Blinov
> Assignee: Henri Biestro
> Priority: Minor
>
> As of now the default implementation of {{internal.introspection.Uberspect}}
> class does not allow the usage of anything other than default instance of
> {{internal.introspection.Permissions}} class, although internally the
> {{internal.introspection.Introspector}} has a constructor that accesspts the
> {{Permissions}} object. Subclassing of {{Uberspect}} does not help here since
> {{Uberspect.base()}} method is decalred {{final}}. We need some way to pass
> customized {{Permissions}} class to default {{Uberspect}} implementation
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)