KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > za > org > coefficient > modules > mailforum > CoefficientClassExpert


1 package za.org.coefficient.modules.mailforum;
2
3 import net.sf.hibernate.HibernateException;
4
5 import org.dithaka.metadata.ClassExpert;
6
7 import za.org.coefficient.util.common.InvokerFactory;
8
9 public abstract class CoefficientClassExpert extends ClassExpert
10 {
11     protected abstract String JavaDoc getClassName();
12     protected abstract String JavaDoc getMethodName();
13
14     public Object JavaDoc getObject(Long JavaDoc id) throws HibernateException {
15         try {
16             Object JavaDoc object = InvokerFactory.getRemoteInvoker()
17                     .invokeMethodOnModule(getClassName(), getMethodName(),
18                     new Object JavaDoc[] {id});
19             return object;
20         }
21         catch (Exception JavaDoc ex) {
22             throw new HibernateException(ex);
23         }
24     }
25
26 }
27
Popular Tags