*/
package org.opendaylight.aaa.shiro.web.env;
-import org.apache.shiro.web.env.EnvironmentLoaderListener;
+import static java.util.Objects.requireNonNull;
+
+import javax.servlet.ServletContextListener;
import org.eclipse.jetty.servlets.CrossOriginFilter;
import org.opendaylight.aaa.shiro.filters.AAAShiroFilter;
import org.opendaylight.aaa.web.FilterDetails;
* @author Michael Vorburger.ch
*/
public class ShiroWebContextSecurer implements WebContextSecurer {
- private final EnvironmentLoaderListener shiroEnvironmentLoaderListener;
+ private final ServletContextListener shiroEnvironmentLoaderListener;
- public ShiroWebContextSecurer(final EnvironmentLoaderListener shiroEnvironmentLoaderListener) {
- this.shiroEnvironmentLoaderListener = shiroEnvironmentLoaderListener;
+ public ShiroWebContextSecurer(final ServletContextListener shiroEnvironmentLoaderListener) {
+ this.shiroEnvironmentLoaderListener = requireNonNull(shiroEnvironmentLoaderListener);
}
@Override
*
* @author Thomas Pantelis
*/
-public class ShiroWebEnvironmentLoaderListener extends EnvironmentLoaderListener {
+// FIXME: @WebListener and CDI (or whatever) injection?
+// FIXME: @Component with ServletContextListener
+public final class ShiroWebEnvironmentLoaderListener extends EnvironmentLoaderListener {
private static final Logger LOG = LoggerFactory.getLogger(ShiroWebEnvironmentLoaderListener.class);
private final ShiroConfiguration shiroConfiguration;
private final TokenStore tokenStore;
private final PasswordHashService passwordHashService;
+ // FIXME: @Inject for CDI, except we have ShiroConfiguration injected
+ // FIXME: @Activate for OSGi @Component, except we have ShiroConfiguration which needs to come from somewhere
public ShiroWebEnvironmentLoaderListener(final ShiroConfiguration shiroConfiguration, final DataBroker dataBroker,
final ICertificateManager certificateManager,
final AuthenticationService authenticationService,
</argument>
<argument ref="passwordService" />
</bean>
+ <service ref="shiroWebEnvLoader" interface="javax.servlet.ServletContextListener"/>
<reference id="customFilterAdapterConfig"
interface="org.opendaylight.aaa.filterchain.configuration.CustomFilterAdapterConfiguration"/>