FileDocCategorySizeDatePackage
LoggingBefore.javaAPI DocExample877Mon Apr 25 07:02:56 BST 2005com.springbook.interceptors

LoggingBefore

public class LoggingBefore extends Object implements org.springframework.aop.MethodBeforeAdvice

Fields Summary
private net.sf.hibernate.SessionFactory
factory
Constructors Summary
Methods Summary
public voidbefore(java.lang.reflect.Method method, java.lang.Object[] objects, java.lang.Object o)

      Session s = null;
      LogEvent le = new LogEvent(method.getName(), new Date());
      try {
         s = factory.openSession();
         s.save(le);
      } catch (Exception ex) {
         // log the exception
      } finally {
         s.close();
      }
   
public net.sf.hibernate.SessionFactorygetSessionFactory()

      return this.factory;
   
public voidsetSessionFactory(net.sf.hibernate.SessionFactory factory)

      this.factory = factory;