1 /** 2 * Copyright 2014 Internet2 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 /* 17 * Created on Jun 21, 2005 18 * 19 */ 20 package edu.internet2.middleware.grouper.hibernate; 21 22 import edu.internet2.middleware.grouper.internal.dao.GrouperDAOException; 23 24 /** 25 * Implement this (usually in an anonymous inner class) to get a 26 * reference to the hibernate session object 27 * @version $Id: HibernateHandler.java,v 1.3 2009-02-06 16:33:18 mchyzer Exp $ 28 * @author mchyzer 29 */ 30 31 public interface HibernateHandler { 32 33 /** 34 * This method will be called with the hibernate session object to do 35 * what you wish. Note, HibernateException or RuntimeExceptions can be 36 * thrown by this method... others should be handled somehow.. 37 * @param hibernateHandlerBean holds the hibernate session and other things 38 * will be the same as passed in if it existed, else a new one 39 * @return the return value to be passed to return value of callback method 40 * @throws GrouperDAOException if there is a problem 41 */ 42 public Object callback(HibernateHandlerBean hibernateHandlerBean) throws GrouperDAOException; 43 }