Package org.apache.shiro.env

Examples of org.apache.shiro.env.Environment


            @Override
            protected void bindWebEnvironment(AnnotatedBindingBuilder<? super WebEnvironment> bind) {
                bind.to(MyWebEnvironment.class);
            }
        });
        Environment environment = injector.getInstance(Environment.class);
        assertNotNull(environment);
        assertTrue(environment instanceof MyWebEnvironment);
        WebEnvironment webEnvironment = injector.getInstance(WebEnvironment.class);
        assertNotNull(webEnvironment);
        assertTrue(webEnvironment instanceof MyWebEnvironment);
View Full Code Here


            @Override
            protected void bindEnvironment(AnnotatedBindingBuilder<Environment> bind) {
                bind.to(MyEnvironment.class);
            }
        });
        Environment environment = injector.getInstance(Environment.class);
        assertNotNull(environment);
        assertTrue(environment instanceof MyEnvironment);
    }
View Full Code Here

        return brokerService;
    }

    protected ShiroPlugin createPlugin(String iniPath) {
        Ini ini = Ini.fromResourcePath(iniPath);
        Environment env = new IniEnvironment(ini);
        ShiroPlugin plugin = new ShiroPlugin();
        plugin.setEnvironment(env);
        return plugin;
    }
View Full Code Here

        assertSame(plugin.getAuthenticationFilter().getNext(), filter);
    }

    public void testSetEnvironment() {
        ShiroPlugin plugin = new ShiroPlugin();
        Environment env = new DefaultEnvironment();
        plugin.setEnvironment(env);
        assertSame(env, plugin.getEnvironment());
    }
View Full Code Here

    }

    private ConnectionContext createContext(Subject subject) {
        ConnectionContext ctx = new ConnectionContext();
        ConnectionInfo info = new ConnectionInfo();
        Environment environment = new Environment() {
            @Override
            public org.apache.shiro.mgt.SecurityManager getSecurityManager() {
                return null; //not needed in this test.
            }
        };
View Full Code Here

            return this.environment;
        }

        //this.environment is null - set it:
        if (this.securityManager != null) {
            this.environment = new Environment() {
                @Override
                public SecurityManager getSecurityManager() {
                    return ShiroPlugin.this.securityManager;
                }
            };
View Full Code Here

    }

    @Override
    public Broker installPlugin(Broker broker) throws Exception {

        Environment environment = ensureEnvironment();

        this.authorizationFilter.setEnvironment(environment);
        this.authenticationFilter.setEnvironment(environment);
        this.subjectFilter.setEnvironment(environment);
View Full Code Here

TOP

Related Classes of org.apache.shiro.env.Environment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.