1 /***
2 * Copyright 2003-2010 Terracotta, Inc.
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 package net.sf.ehcache.hibernate.management.impl;
18
19 import java.util.Properties;
20
21 import net.sf.ehcache.CacheManager;
22
23 import org.hibernate.SessionFactory;
24
25 /***
26 * Interface for helping registering mbeans for ehcache backed hibernate second-level cache
27 *
28 * <p />
29 *
30 * @author <a href="mailto:asanoujam@terracottatech.com">Abhishek Sanoujam</a>
31 *
32 */
33 public interface EhcacheHibernateMBeanRegistration {
34
35 /***
36 * Registers MBean for the input manager and session factory properties.
37 * <p />
38 * MBeans will be registered based on the input session factory name. If the input name is null or blank, the name of the cache-manager
39 * is used
40 *
41 * @param manager
42 * @param properties
43 * @throws Exception
44 */
45 public void registerMBeanForCacheManager(CacheManager manager, Properties properties) throws Exception;
46
47 /***
48 * Enable hibernate statistics in the mbean.
49 *
50 * @param sessionFactory
51 */
52 public void enableHibernateStatisticsSupport(SessionFactory sessionFactory);
53
54 }