Usage examples for non-deprecated APIs?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Usage examples for non-deprecated APIs?

io7m
Hello.

Are there any usage examples out there for using the newer non-deprecated APIs such as Environment?

If you follow the documentation on the Shiro site, for example, you're told to use the IniSecurityManagerFactory class. This is deprecated and the deprecation notice points you at the Environment interface. There's no documentation on this that I can see, but with a bit of exploration in the IDE, I came up with this:

https://raw.githubusercontent.com/io7m/shiro-example/master/src/main/java/com/io7m/shiro/examples/Example0.java

(https://github.com/io7m/shiro-example)

Unfortunately, with a bare-bones config.ini, the program says:

Exception in thread "main" java.lang.IllegalStateException: No SecurityManager found in Environment.  This is an invalid environment state.
        at org.apache.shiro.env.DefaultEnvironment.getSecurityManager(DefaultEnvironment.java:81)
        at com.io7m.shiro.examples.Example0.main(Example0.java:34)

I've tried searching on GitHub for code that uses these interfaces, and the Shiro codebase for examples, but there just doesn't seem to be anything. What am I missing?
Loading...