}
}
private <T extends Service> T getService(String jndiName, Class<? extends ServiceHome> homeClass) throws Exception {
Object homeRef = remoteContext.lookup(jndiName);
ServiceHome home = (ServiceHome) PortableRemoteObject.narrow(homeRef, homeClass);
Service service = (Service) home.getClass().getMethod("create", new Class[0]).invoke(home, new Object[0]);
return (T) service;
}