public static void register( String name1,
                                 Object obj1,
                                 String name2,
                                 Object obj2,
                                 String name3,
                                 Object obj3 ) {
        SingletonInitialContextFactory.initialize();
        try {
            javax.naming.InitialContext context = new javax.naming.InitialContext();
            if (name1 != null) context.rebind(name1, obj1);
            if (name2 != null) context.rebind(name2, obj2);
            if (name3 != null) context.rebind(name3, obj3);
        } catch (NamingException e) {
            throw new SystemFailureException("Unable to create the mock InitialContext", e);
        }
    }
public static void register ( String name1 , Object obj1 , String name2 , Object obj2 , String name3 , Object obj3 ) { SingletonInitialContextFactory . initialize ( ) ; try { javax . naming . InitialContext context = new javax . naming . InitialContext ( ) ; if ( name1 != null ) context . rebind ( name1 , obj1 ) ; if ( name2 != null ) context . rebind ( name2 , obj2 ) ; if ( name3 != null ) context . rebind ( name3 , obj3 ) ; } catch ( NamingException e ) { throw new SystemFailureException ( "Unable to create the mock InitialContext" , e ) ; } }
A convenience method that registers the supplied objects with the supplied names.

@param name1 the JNDI name for the first object
@param obj1 the first object to be registered
@param name2 the JNDI name for the second object
@param obj2 the second object to be registered
@param name3 the JNDI name for the third object
@param obj3 the third object to be registered