final HessianRegistry registry = service.getRegistry();
final String appName = findAppName();
for (final Deployment deployment : toDeploy) {
final Hessian hessian = deployment.itf.getAnnotation(Hessian.class);
final HessianServer server;
try {
server = new HessianServer(deployment.bean.getBeanClass().getClassLoader());
} catch (final HessianServer.HessianIsMissingException e) {
LOGGER.info("Hessian is not available so openejb-hessian will not deploy any service");
break;
}
try {
if (hessian != null && hessian.serializerFactory() != Object.class && !hessian.serializerFactory().isInstance(server.getSerializerFactory())) {
server.serializerFactory(hessian.serializerFactory().newInstance());
}
} catch (final Exception e) {
throw new OpenEJBRuntimeException(e);
}
if (hessian != null) {
server.sendCollectionType(hessian.sendCollectionType());
}
if (Dependent.class.equals(deployment.bean.getScope())) {
LOGGER.warning("@Dependent can lead to memory leaks ATM");
}
server.createSkeleton(bm.getReference(deployment.bean, deployment.itf, null), deployment.itf);