package org.jboss.test.hibernate.ejb.interfaces;
public class AggregateProfileServiceUtil
{
private static Object lookupHome(java.util.Hashtable environment, String jndiName, Class narrowTo) throws javax.naming.NamingException {
javax.naming.InitialContext initialContext = new javax.naming.InitialContext(environment);
try {
Object objRef = initialContext.lookup(jndiName);
if (narrowTo.isInstance(java.rmi.Remote.class))
return javax.rmi.PortableRemoteObject.narrow(objRef, narrowTo);
else
return objRef;
} finally {
initialContext.close();
}
}
public static AggregateProfileServiceHome getHome() throws javax.naming.NamingException
{
return (AggregateProfileServiceHome) lookupHome(null, AggregateProfileServiceHome.JNDI_NAME, AggregateProfileServiceHome.class);
}
public static AggregateProfileServiceHome getHome( java.util.Hashtable environment ) throws javax.naming.NamingException
{
return (AggregateProfileServiceHome) lookupHome(environment, AggregateProfileServiceHome.JNDI_NAME, AggregateProfileServiceHome.class);
}
}