static String getParameter(String name){
        String r = null;

        //then try jndi
        if(r==null){
            try {
                Context initCtx = new InitialContext();
                Context envCtx = (Context) initCtx.lookup("java:comp/env");
                r = (String) envCtx.lookup("s1."+name);
            } catch (Throwable e) {
            }
        }

        //then try system property
        if(r==null) {
            if (!Objects.isNullOrEmpty(System.getProperty("s1." + name)))
                r = System.getProperty("s1." + name);
        }

        //then try env property
        if(r==null){
            if(!Objects.isNullOrEmpty(System.getenv("s1." + name)))
                r = System.getenv("s1." + name);
        }

        //then try local
        if(r==null){
            try {
                Properties p = new Properties();
                p.load(Options.class.getResourceAsStream("/s1.properties"));
                r = p.getProperty(name);
            } catch (Throwable e) {
            }
        }

        if(LOG!=null && LOG.isDebugEnabled())
            LOG.debug("Read parameter "+name+": "+r);
        return r;
    }
static String getParameter ( String name ) { String r = null ; if ( r == null ) { try { Context initCtx = new InitialContext ( ) ; Context envCtx = ( Context ) initCtx . lookup ( "java:comp/env" ) ; r = ( String ) envCtx . lookup ( "s1." + name ) ; } catch ( Throwable e ) { } } if ( r == null ) { if ( ! Objects . isNullOrEmpty ( System . getProperty ( "s1." + name ) ) ) r = System . getProperty ( "s1." + name ) ; } if ( r == null ) { if ( ! Objects . isNullOrEmpty ( System . getenv ( "s1." + name ) ) ) r = System . getenv ( "s1." + name ) ; } if ( r == null ) { try { Properties p = new Properties ( ) ; p . load ( Options . class . getResourceAsStream ( "/s1.properties" ) ) ; r = p . getProperty ( name ) ; } catch ( Throwable e ) { } } if ( LOG != null && LOG . isDebugEnabled ( ) ) LOG . debug ( "Read parameter " + name + ": " + r ) ; return r ; }
@param name
@return