Package ome.logic
Class HardWiredInterceptor
- java.lang.Object
-
- ome.logic.HardWiredInterceptor
-
- All Implemented Interfaces:
org.aopalliance.aop.Advice
,org.aopalliance.intercept.Interceptor
,org.aopalliance.intercept.MethodInterceptor
- Direct Known Subclasses:
BasicSecurityWiring
public abstract class HardWiredInterceptor extends java.lang.Object implements org.aopalliance.intercept.MethodInterceptor
Extension point for interceptors which should be compiled in from third-party code. Subclasses can be added to the build system via the omero.hard-wired.interceptors property value. All subclasses must have a no-arg constructor, but can assess various environment variables via the getters defined on this class.- Since:
- 3.0-Beta1
-
-
Constructor Summary
Constructors Constructor Description HardWiredInterceptor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
configure(java.util.List<HardWiredInterceptor> hwi, ome.system.OmeroContext ctx)
java.lang.String
getName()
Can be implemented by all subclasses, so that they can configure themselves inselfConfigure(OmeroContext)
.protected ome.system.Principal
getPrincipal(org.aopalliance.intercept.MethodInvocation mi)
protected ome.system.ServiceFactory
getServiceFactory(org.aopalliance.intercept.MethodInvocation mi)
protected boolean
hasPassword(org.aopalliance.intercept.MethodInvocation mi)
static void
initializeUserAttributes(org.aopalliance.intercept.MethodInvocation mi, ome.system.ServiceFactory sf, ome.system.Principal pr, java.util.concurrent.atomic.AtomicBoolean reusedSession)
Adds the given environment context objects to theReflectiveMethodInvocation.getUserAttributes()
Map
for lookup in subclassesstatic java.util.List<HardWiredInterceptor>
parse(java.lang.String[] classNames)
Produces aList
of instantiated interceptors from a list ofHardWiredInterceptor
subclass names.void
selfConfigure(ome.system.OmeroContext context)
CallsOmeroContext.applyBeanPropertyValues(Object, String)
to have properties injected.
-
-
-
Method Detail
-
configure
public static void configure(java.util.List<HardWiredInterceptor> hwi, ome.system.OmeroContext ctx)
-
getName
public java.lang.String getName()
Can be implemented by all subclasses, so that they can configure themselves inselfConfigure(OmeroContext)
. If the method returns null,selfConfigure(OmeroContext)
will not run.
-
selfConfigure
public void selfConfigure(ome.system.OmeroContext context)
CallsOmeroContext.applyBeanPropertyValues(Object, String)
to have properties injected.
-
parse
public static java.util.List<HardWiredInterceptor> parse(java.lang.String[] classNames)
Produces aList
of instantiated interceptors from a list ofHardWiredInterceptor
subclass names.
-
initializeUserAttributes
public static void initializeUserAttributes(org.aopalliance.intercept.MethodInvocation mi, ome.system.ServiceFactory sf, ome.system.Principal pr, java.util.concurrent.atomic.AtomicBoolean reusedSession)
Adds the given environment context objects to theReflectiveMethodInvocation.getUserAttributes()
Map
for lookup in subclasses
-
getServiceFactory
protected ome.system.ServiceFactory getServiceFactory(org.aopalliance.intercept.MethodInvocation mi)
-
getPrincipal
protected ome.system.Principal getPrincipal(org.aopalliance.intercept.MethodInvocation mi)
-
hasPassword
protected boolean hasPassword(org.aopalliance.intercept.MethodInvocation mi)
-
-