if (Serializer.hasMapping(EJBObject.class)) {   return; }
    public void setup(final ServerContext ctx) {        Serializer.registerExceptionName(javax.naming.NameNotFoundException.class, "naming/NameNotFound");        Serializer.registerExceptionName(java.lang.reflect.InvocationTargetException.class, "invoke/Exception");        Serializer.registerMapping(EJBHome.class, new Invokeable<String, EJBHome>() {            public String invoke(EJBHome 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 (EJBHome.class.isAssignableFrom(iface)) {                        ejbInterface= iface;                        break;                    }                }                return "I:" + p.hashCode() + ":{" + Serializer.representationOf(                    ejbInterface.getName(),                    (SerializerContext)arg                ) + "}";            }        });        Serializer.registerMapping(EJBObject.class, new Invokeable<String, EJBObject>() {            public String invoke(EJBObject 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)) {                        ejbInterface= iface;                        break;                    }                }                return "I:" + p.hashCode() + ":{" + Serializer.representationOf(                    ejbInterface.getName(),                    (SerializerContext)arg                ) + "}";            }        });    }