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 theBasicSecuritySystem
provided in theconstructor
. After the method isinvoked
various cleanup actions are performed and finally all credentials allcleared
from theThread
.- Since:
- 3.0
-
-
Field Summary
Fields Modifier and Type Field Description protected SessionFactory
factory
protected boolean
readOnly
protected BasicSecuritySystem
secSys
protected ome.util.SqlAction
sql
protected org.springframework.transaction.interceptor.TransactionAttributeSource
txSource
-
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 boolean
doLogin(boolean readOnly, boolean isClose)
java.lang.Object
invoke(org.aopalliance.intercept.MethodInvocation arg0)
Invocation interceptor for preparing thisThread
for execution and subsequently resetting it.void
onApplicationEvent(ContextMessage msg)
If aContextMessage
is received then we need to either add aContextMessage.Push
login to the stack orContextMessage.Pop
remove 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 activeHibernateTemplate
andBasicSecuritySystem
.- 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 aContextMessage
is received then we need to either add aContextMessage.Push
login to the stack orContextMessage.Pop
remove one.- Specified by:
onApplicationEvent
in interfaceorg.springframework.context.ApplicationListener<ContextMessage>
-
invoke
public java.lang.Object invoke(org.aopalliance.intercept.MethodInvocation arg0) throws java.lang.Throwable
Invocation interceptor for preparing thisThread
for execution and subsequently resetting it.- Specified by:
invoke
in interfaceorg.aopalliance.intercept.MethodInterceptor
- Throws:
java.lang.Throwable
- See Also:
MethodInterceptor.invoke(org.aopalliance.intercept.MethodInvocation)
-
doLogin
public boolean doLogin(boolean readOnly, boolean isClose)
-
-