Package ome.security.basic
Class EventHandler
- java.lang.Object
-
- ome.security.basic.EventHandler
-
- All Implemented Interfaces:
java.util.EventListener,org.aopalliance.aop.Advice,org.aopalliance.intercept.Interceptor,org.aopalliance.intercept.MethodInterceptor,org.springframework.context.ApplicationListener<ContextMessage>
public class EventHandler extends java.lang.Object implements org.aopalliance.intercept.MethodInterceptor, org.springframework.context.ApplicationListener<ContextMessage>
method interceptor responsible for login and creation of Events. Calls are made to theBasicSecuritySystemprovided in theconstructor. After the method isinvokedvarious cleanup actions are performed and finally all credentials allclearedfrom theThread.- Since:
- 3.0
-
-
Field Summary
Fields Modifier and Type Field Description protected SessionFactoryfactoryprotected booleanreadOnlyprotected BasicSecuritySystemsecSysprotected ome.util.SqlActionsqlprotected org.springframework.transaction.interceptor.TransactionAttributeSourcetxSource
-
Constructor Summary
Constructors Constructor Description EventHandler(ome.util.SqlAction sql, BasicSecuritySystem securitySystem, SessionFactory factory, org.springframework.transaction.interceptor.TransactionAttributeSource txSource)Deprecated.EventHandler(ome.util.SqlAction sql, BasicSecuritySystem securitySystem, SessionFactory factory, org.springframework.transaction.interceptor.TransactionAttributeSource txSource, ReadOnlyStatus readOnly)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandoLogin(boolean readOnly, boolean isClose)java.lang.Objectinvoke(org.aopalliance.intercept.MethodInvocation arg0)Invocation interceptor for preparing thisThreadfor execution and subsequently resetting it.voidonApplicationEvent(ContextMessage msg)If aContextMessageis received then we need to either add aContextMessage.Pushlogin to the stack orContextMessage.Popremove one.
-
-
-
Field Detail
-
txSource
protected final org.springframework.transaction.interceptor.TransactionAttributeSource txSource
-
secSys
protected final BasicSecuritySystem secSys
-
factory
protected final SessionFactory factory
-
sql
protected final ome.util.SqlAction sql
-
readOnly
protected final boolean readOnly
-
-
Constructor Detail
-
EventHandler
@Deprecated public EventHandler(ome.util.SqlAction sql, BasicSecuritySystem securitySystem, SessionFactory factory, org.springframework.transaction.interceptor.TransactionAttributeSource txSource)Deprecated.only public constructor, used for dependency injection. Requires an activeHibernateTemplateandBasicSecuritySystem.- Parameters:
sql- the SQL actionsecuritySystem- the security systemfactory- the Hibernate session factorytxSource- the Spring transaction attribute source
-
EventHandler
public EventHandler(ome.util.SqlAction sql, BasicSecuritySystem securitySystem, SessionFactory factory, org.springframework.transaction.interceptor.TransactionAttributeSource txSource, ReadOnlyStatus readOnly)
-
-
Method Detail
-
onApplicationEvent
public void onApplicationEvent(ContextMessage msg)
If aContextMessageis received then we need to either add aContextMessage.Pushlogin to the stack orContextMessage.Popremove one.- Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<ContextMessage>
-
invoke
public java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation arg0) throws java.lang.ThrowableInvocation interceptor for preparing thisThreadfor execution and subsequently resetting it.- Specified by:
invokein interfaceorg.aopalliance.intercept.MethodInterceptor- Throws:
java.lang.Throwable- See Also:
MethodInterceptor.invoke(org.aopalliance.intercept.MethodInvocation)
-
doLogin
public boolean doLogin(boolean readOnly, boolean isClose)
-
-