Service implementations
@Service(implementation = RedisSessionManager.class)
interface SessionManager {
Session createSession();
}
@Service
class RedisSessionManager implements SessionManager {
@Override
public Session createSession() {
return createMySession();
}
}
void handleAuthentication(User user) {
SessionManager sessionManager = Container.get(SessionManager.class);
if (authorized)
user.setSession(sessionManager.createSession());
}Last updated