for (final BeanContext deployment : beans) {
if (deployment.isLocalbean() && !deployment.isDynamicallyImplemented()) { // init proxy eagerly otherwise deserialization of serialized object can't work
final List<Class> interfaces = new ArrayList<Class>(2);
interfaces.add(Serializable.class);
interfaces.add(IntraVmProxy.class);
final BeanType type = deployment.getComponentType();
if (BeanType.STATEFUL.equals(type) || BeanType.MANAGED.equals(type)) {
interfaces.add(BeanContext.Removable.class);
}
try {
LocalBeanProxyFactory.createProxy(deployment.getBeanClass(), classLoader, interfaces.toArray(new Class<?>[interfaces.size()]));