ome.logic
Class HardWiredInterceptor

java.lang.Object
  extended by ome.logic.HardWiredInterceptor
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor
Direct Known Subclasses:
AopContextInitializer, BasicSecurityWiring

public abstract class HardWiredInterceptor
extends Object
implements 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
Author:
Josh Moore, josh.moore at gmx.de

Constructor Summary
HardWiredInterceptor()
           
 
Method Summary
static void configure(List<HardWiredInterceptor> hwi, OmeroContext ctx)
           
 String getName()
          Can be implemented by all subclasses, so that they can configure themselves in selfConfigure(OmeroContext).
protected  Principal getPrincipal(MethodInvocation mi)
           
protected  ServiceFactory getServiceFactory(MethodInvocation mi)
           
protected  boolean hasPassword(MethodInvocation mi)
           
static void initializeUserAttributes(MethodInvocation mi, ServiceFactory sf, Principal pr, boolean hasPassword)
          Adds the given environment context objects to the ReflectiveMethodInvocation.getUserAttributes() Map for lookup in subclasses
static List<HardWiredInterceptor> parse(String[] classNames)
          Produces a List of instantiated interceptors from a list of HardWiredInterceptor subclass names.
 void selfConfigure(OmeroContext context)
          Calls OmeroContext.applyBeanPropertyValues(Object, String) to have properties injected.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.aopalliance.intercept.MethodInterceptor
invoke
 

Constructor Detail

HardWiredInterceptor

public HardWiredInterceptor()
Method Detail

configure

public static void configure(List<HardWiredInterceptor> hwi,
                             OmeroContext ctx)

getName

public String getName()
Can be implemented by all subclasses, so that they can configure themselves in selfConfigure(OmeroContext). If the method returns null, selfConfigure(OmeroContext) will not run.


selfConfigure

public void selfConfigure(OmeroContext context)
Calls OmeroContext.applyBeanPropertyValues(Object, String) to have properties injected.


parse

public static List<HardWiredInterceptor> parse(String[] classNames)
Produces a List of instantiated interceptors from a list of HardWiredInterceptor subclass names.


initializeUserAttributes

public static void initializeUserAttributes(MethodInvocation mi,
                                            ServiceFactory sf,
                                            Principal pr,
                                            boolean hasPassword)
Adds the given environment context objects to the ReflectiveMethodInvocation.getUserAttributes() Map for lookup in subclasses


getServiceFactory

protected ServiceFactory getServiceFactory(MethodInvocation mi)

getPrincipal

protected Principal getPrincipal(MethodInvocation mi)

hasPassword

protected boolean hasPassword(MethodInvocation mi)


OmeroJava Api

Version: Beta4.2.1-r8614-Beta4.2-b41

Copyright © 2009 The University of Dundee. All Rights Reserved.