Code example for LinkRef

0
    { 
        //TODO - check on the whole overriding/non-overriding thing 
        InitialContext ic = new InitialContext();
        Context env = (Context)ic.lookup("java:comp/env");
        __log.debug("Binding java:comp/env/"+localName+" to "+_objectNameString);
        NamingUtil.bind(env, localName, new LinkRef(_objectNameString));
    } 
     
    /** 
     * Unbind this NamingEntry from a java:comp/env 
     */ 
    public void unbindENC () 
    { 
        try 
        { 
            InitialContext ic = new InitialContext();
            Context env = (Context)ic.lookup("java:comp/env");
            __log.debug("Unbinding java:comp/env/"+getJndiName()); 
            env.unbind(getJndiName());
        } 
Connect your IDE to all the code out there  Get Codota for Java