src/main/java/org/jboss/util/naming/NonSerializableFactory.java
/** A convenience method that simplifies the process of rebinding a
     non-serializable object into a JNDI context.

    @param ctx the JNDI context to rebind to.
    @param key the key to use in both the NonSerializableFactory map and JNDI. It
        must be a valid name for use in ctx.bind().
    @param target the non-Serializable object to bind.
    @throws NamingException thrown on failure to rebind key into ctx.
    */
A convenience method that simplifies the process of rebinding a
non-serializable object into a JNDI context.
A convenience method that simplifies the process of rebinding a non - serializable object into a JNDI context .
public static synchronized void rebind(Context ctx, String key, Object target) throws NamingException
    {
        NonSerializableFactory.rebind(key, target);
        String className = target.getClass().getName();
        String factory = NonSerializableFactory.class.getName();
        StringRefAddr addr = new StringRefAddr("nns", key);
        Reference memoryRef = new Reference(className, addr, factory, null);
        ctx.rebind(key, memoryRef);
    }
public static synchronized void rebind ( Context ctx , String key , Object target ) throws NamingException { NonSerializableFactory . rebind ( key , target ) ; String className = target . getClass ( ) . getName ( ) ; String factory = NonSerializableFactory . class . getName ( ) ; StringRefAddr addr = new StringRefAddr ( "nns" , key ) ; Reference memoryRef = new Reference ( className , addr , factory , null ) ; ctx . rebind ( key , memoryRef ) ; }
A convenience method that simplifies the process of rebinding a
non-serializable object into a JNDI context.
A convenience method that simplifies the process of rebinding a non - serializable object into a JNDI context .
// Bind a reference to target using NonSerializableFactory as the ObjectFactory