if (EJBObject.class.isAssignableFrom(iface) || org.jboss.ejb3.JBossProxy.class.isAssignableFrom(iface)) continue;   ejbInterface= iface; break;
if (EJBObject.class.isAssignableFrom(iface)) { ejbInterface= iface; break; }
    protected void setupEJB3Support(final ServerContext ctx) {        try {            Class jbossProxyClass= Class.forName("org.jboss.ejb3.JBossProxy");            System.out.println("EASC: Enabling JBoss-EJB3 support");                        Serializer.registerMapping(jbossProxyClass, new Invokeable<String, org.jboss.ejb3.JBossProxy>() {                public String invoke(org.jboss.ejb3.JBossProxy p, Object arg) throws Exception {                    ctx.objects.put(p.hashCode(), new WeakReference(p));                    // Find out the correct interface                    Class ejbInterface= null;                    for (Class iface: p.getClass().getInterfaces()) {                        if (EJBObject.class.isAssignableFrom(iface) || org.jboss.ejb3.JBossProxy.class.isAssignableFrom(iface)) continue;                        // First interface implemented is the "real" interface                        ejbInterface= iface;                        break;                    }                    return "I:" + p.hashCode() + ":{" + Serializer.representationOf(                        ejbInterface.getName(),                        (SerializerContext)arg                    ) + "}";                }            });        } catch (ClassNotFoundException ignored) {          // No EJB3 deployment          System.out.println("EASC: No JBoss-EJB3 support enabled.");        }    }