2 * Copyright (c) 2018 Inocybe Technologies and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.aaa.shiro.web.env;
10 import org.opendaylight.aaa.api.AuthenticationService;
11 import org.opendaylight.aaa.api.TokenStore;
12 import org.opendaylight.aaa.api.password.service.PasswordHashService;
13 import org.opendaylight.aaa.tokenauthrealm.auth.TokenAuthenticators;
14 import org.opendaylight.mdsal.binding.api.DataBroker;
17 * Holds ThreadLocal variables used to indirectly inject instances into classes that are instantiated by the Shiro
18 * lib. Not ideal but a necessary evil to avoid static instances.
20 * @author Thomas Pantelis
22 public final class ThreadLocals {
23 public static final ThreadLocal<DataBroker> DATABROKER_TL = new ThreadLocal<>();
25 public static final ThreadLocal<AuthenticationService> AUTH_SETVICE_TL = new ThreadLocal<>();
27 public static final ThreadLocal<TokenStore> TOKEN_STORE_TL = new ThreadLocal<>();
29 public static final ThreadLocal<TokenAuthenticators> TOKEN_AUTHENICATORS_TL = new ThreadLocal<>();
31 public static final ThreadLocal<PasswordHashService> PASSWORD_HASH_SERVICE_TL = new ThreadLocal<>();
33 private ThreadLocals() {