ome.tools.hibernate
Class SessionFactory

java.lang.Object
  extended by ome.tools.hibernate.SessionFactory
All Implemented Interfaces:
Advice, Interceptor, MethodInterceptor

public class SessionFactory
extends Object
implements MethodInterceptor

Simple source of Thread-aware Session instances. Wraps a call to SessionFactoryUtils. Should be safe to call from within any service implementation call or inside of Executor.execute.

Since:
4.0
Author:
Josh Moore, josh at glencoesoftware.com

Constructor Summary
SessionFactory(org.hibernate.SessionFactory factory, ome.util.SqlAction isolatedSqlAction)
           
 
Method Summary
 org.hibernate.Session getSession()
          Returns a session active for the current thread.
 Object invoke(MethodInvocation mi)
          Wraps all invocations to Session to prevent certain usages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionFactory

public SessionFactory(org.hibernate.SessionFactory factory,
                      ome.util.SqlAction isolatedSqlAction)
Method Detail

getSession

public org.hibernate.Session getSession()
Returns a session active for the current thread. The returned instance will be wrapped with AOP to prevent certain usage.

See Also:
ticket:73

invoke

public Object invoke(MethodInvocation mi)
              throws Throwable
Wraps all invocations to Session to prevent certain usages.

Specified by:
invoke in interface MethodInterceptor
Throws:
Throwable


OmeroJava Api

Version: 4.3.3-00d1137e-b2894

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