@Component(value="cuba_AnonymousSessionHolder") public class AnonymousSessionHolder extends java.lang.Object implements AppContext.Listener, org.springframework.core.Ordered
Modifier and Type | Field and Description |
---|---|
protected AuthenticationManager |
authenticationManager |
protected java.util.concurrent.locks.ReentrantReadWriteLock |
lock |
protected SecurityScopes |
securityScopes |
protected java.util.Map<java.lang.String,UserSession> |
sessions |
HIGHEST_PLATFORM_PRECEDENCE, LOWEST_PLATFORM_PRECEDENCE
Constructor and Description |
---|
AnonymousSessionHolder() |
Modifier and Type | Method and Description |
---|---|
void |
applicationStarted()
Called by
AppContext after successful application startup and initialization. |
void |
applicationStopped()
Called by
AppContext before application shutdown. |
UserSession |
getAnonymousSession()
Method returns a UserSession saved for the default scope
|
UserSession |
getAnonymousSession(java.lang.String securityScope)
Method returns a UserSession saved for the given scope
|
int |
getOrder() |
void |
init() |
void |
initializeAnonymousSessions() |
protected UserSession |
loginAnonymous(java.lang.String securityScope) |
protected volatile java.util.Map<java.lang.String,UserSession> sessions
@Inject protected AuthenticationManager authenticationManager
@Inject protected SecurityScopes securityScopes
protected java.util.concurrent.locks.ReentrantReadWriteLock lock
public void applicationStarted()
AppContext.Listener
AppContext
after successful application startup and initialization.applicationStarted
in interface AppContext.Listener
public void applicationStopped()
AppContext.Listener
AppContext
before application shutdown.applicationStopped
in interface AppContext.Listener
public int getOrder()
getOrder
in interface org.springframework.core.Ordered
public UserSession getAnonymousSession()
public UserSession getAnonymousSession(java.lang.String securityScope)
securityScope
- security scope namepublic void initializeAnonymousSessions()
protected UserSession loginAnonymous(java.lang.String securityScope) throws LoginException
LoginException
@PostConstruct public void init()