Tabnine Logo
SessionsSecurityManager
Code IndexAdd Tabnine to your IDE (free)

How to use
SessionsSecurityManager
in
org.apache.shiro.mgt

Best Java code snippets using org.apache.shiro.mgt.SessionsSecurityManager (Showing top 20 results out of 315)

origin: apache/shiro

  public void destroy() {
    LifecycleUtils.destroy(getSessionManager());
    this.sessionManager = null;
    super.destroy();
  }
}
origin: apache/shiro

/**
 * Sets the underlying delegate {@link SessionManager} instance that will be used to support this implementation's
 * <tt>SessionManager</tt> method calls.
 * <p/>
 * This <tt>SecurityManager</tt> implementation does not provide logic to support the inherited
 * <tt>SessionManager</tt> interface, but instead delegates these calls to an internal
 * <tt>SessionManager</tt> instance.
 * <p/>
 * If a <tt>SessionManager</tt> instance is not set, a default one will be automatically created and
 * initialized appropriately for the the existing runtime environment.
 *
 * @param sessionManager delegate instance to use to support this manager's <tt>SessionManager</tt> method calls.
 */
public void setSessionManager(SessionManager sessionManager) {
  this.sessionManager = sessionManager;
  afterSessionManagerSet();
}
origin: apache/shiro

/**
 * Default no-arg constructor, internally creates a suitable default {@link SessionManager SessionManager} delegate
 * instance.
 */
public SessionsSecurityManager() {
  super();
  this.sessionManager = new DefaultSessionManager();
  applyCacheManagerToSessionManager();
}
origin: apache/shiro

protected void afterSessionManagerSet() {
  applyCacheManagerToSessionManager();
  applyEventBusToSessionManager();
}
origin: apache/shiro

protected SessionsSecurityManager securityManager(List<Realm> realms) {
  SessionsSecurityManager securityManager = createSecurityManager();
  securityManager.setAuthenticator(authenticator());
  securityManager.setAuthorizer(authorizer());
  securityManager.setRealms(realms);
  securityManager.setSessionManager(sessionManager());
  securityManager.setEventBus(eventBus);
  if (cacheManager != null) {
    securityManager.setCacheManager(cacheManager);
  }
  return securityManager;
}
origin: apache/shiro

/**
 * Ensures the internal delegate <code>SessionManager</code> is injected with the newly set
 * {@link #setCacheManager CacheManager} so it may use it for its internal caching needs.
 * <p/>
 * Note:  This implementation only injects the CacheManager into the SessionManager if the SessionManager
 * instance implements the {@link CacheManagerAware CacheManagerAware} interface.
 */
protected void applyCacheManagerToSessionManager() {
  if (this.sessionManager instanceof CacheManagerAware) {
    ((CacheManagerAware) this.sessionManager).setCacheManager(getCacheManager());
  }
}
origin: apache/shiro

/**
 * Sets any configured EventBus on the SessionManager if necessary.
 *
 * @since 1.3
 */
@Override
protected void afterEventBusSet() {
  super.afterEventBusSet();
  applyEventBusToSessionManager();
}
origin: apache/shiro

/**
 * Ensures the internal delegate <code>SessionManager</code> is injected with the newly set
 * {@link #setEventBus EventBus} so it may use it for its internal event needs.
 * <p/>
 * Note: This implementation only injects the EventBus into the SessionManager if the SessionManager
 * instance implements the {@link EventBusAware EventBusAware} interface.
 *
 * @since 1.3
 */
protected void applyEventBusToSessionManager() {
  EventBus eventBus = getEventBus();
  if (eventBus != null && this.sessionManager instanceof EventBusAware) {
    ((EventBusAware)this.sessionManager).setEventBus(eventBus);
  }
}
origin: org.apache.shiro/shiro-spring

protected SessionsSecurityManager securityManager(List<Realm> realms) {
  SessionsSecurityManager securityManager = createSecurityManager();
  securityManager.setAuthenticator(authenticator());
  securityManager.setAuthorizer(authorizer());
  securityManager.setRealms(realms);
  securityManager.setSessionManager(sessionManager());
  securityManager.setEventBus(eventBus);
  if (cacheManager != null) {
    securityManager.setCacheManager(cacheManager);
  }
  return securityManager;
}
origin: org.apache.shiro/shiro-core

protected void afterSessionManagerSet() {
  applyCacheManagerToSessionManager();
  applyEventBusToSessionManager();
}
origin: org.apache.shiro/shiro-core

/**
 * Ensures the internal delegate <code>SessionManager</code> is injected with the newly set
 * {@link #setCacheManager CacheManager} so it may use it for its internal caching needs.
 * <p/>
 * Note:  This implementation only injects the CacheManager into the SessionManager if the SessionManager
 * instance implements the {@link CacheManagerAware CacheManagerAware} interface.
 */
protected void applyCacheManagerToSessionManager() {
  if (this.sessionManager instanceof CacheManagerAware) {
    ((CacheManagerAware) this.sessionManager).setCacheManager(getCacheManager());
  }
}
origin: org.apache.shiro/shiro-core

/**
 * Sets any configured EventBus on the SessionManager if necessary.
 *
 * @since 1.3
 */
@Override
protected void afterEventBusSet() {
  super.afterEventBusSet();
  applyEventBusToSessionManager();
}
origin: org.apache.shiro/shiro-core

/**
 * Ensures the internal delegate <code>SessionManager</code> is injected with the newly set
 * {@link #setEventBus EventBus} so it may use it for its internal event needs.
 * <p/>
 * Note: This implementation only injects the EventBus into the SessionManager if the SessionManager
 * instance implements the {@link EventBusAware EventBusAware} interface.
 *
 * @since 1.3
 */
protected void applyEventBusToSessionManager() {
  EventBus eventBus = getEventBus();
  if (eventBus != null && this.sessionManager instanceof EventBusAware) {
    ((EventBusAware)this.sessionManager).setEventBus(eventBus);
  }
}
origin: killbill/killbill

  private JDBCSessionDao getJDBCSessionDao(final Subject subject) {
    if (subject instanceof DelegatingSubject) {
      final DelegatingSubject delegatingSubject = (DelegatingSubject) subject;
      if (delegatingSubject.getSecurityManager() instanceof SessionsSecurityManager) {
        final SessionsSecurityManager securityManager = (SessionsSecurityManager) delegatingSubject.getSecurityManager();
        if (securityManager.getSessionManager() instanceof DefaultSessionManager) {
          final DefaultSessionManager sessionManager = (DefaultSessionManager) securityManager.getSessionManager();
          if (sessionManager.getSessionDAO() instanceof JDBCSessionDao) {
            return (JDBCSessionDao) sessionManager.getSessionDAO();
          }
        }
      }
    }

    return null;
  }
}
origin: apache/shiro

/**
 * Calls {@link org.apache.shiro.mgt.AuthorizingSecurityManager#afterCacheManagerSet() super.afterCacheManagerSet()} and then immediately calls
 * {@link #applyCacheManagerToSessionManager() applyCacheManagerToSessionManager()} to ensure the
 * <code>CacheManager</code> is applied to the SessionManager as necessary.
 */
@Override
protected void afterCacheManagerSet() {
  super.afterCacheManagerSet();
  applyCacheManagerToSessionManager();
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.shiro

/**
 * Ensures the internal delegate <code>SessionManager</code> is injected with the newly set
 * {@link #setCacheManager CacheManager} so it may use it for its internal caching needs.
 * <p/>
 * Note:  This implementation only injects the CacheManager into the SessionManager if the SessionManager
 * instance implements the {@link CacheManagerAware CacheManagerAware} interface.
 */
protected void applyCacheManagerToSessionManager() {
  if (this.sessionManager instanceof CacheManagerAware) {
    ((CacheManagerAware) this.sessionManager).setCacheManager(getCacheManager());
  }
}
origin: org.apache.shiro/shiro-core

/**
 * Sets the underlying delegate {@link SessionManager} instance that will be used to support this implementation's
 * <tt>SessionManager</tt> method calls.
 * <p/>
 * This <tt>SecurityManager</tt> implementation does not provide logic to support the inherited
 * <tt>SessionManager</tt> interface, but instead delegates these calls to an internal
 * <tt>SessionManager</tt> instance.
 * <p/>
 * If a <tt>SessionManager</tt> instance is not set, a default one will be automatically created and
 * initialized appropriately for the the existing runtime environment.
 *
 * @param sessionManager delegate instance to use to support this manager's <tt>SessionManager</tt> method calls.
 */
public void setSessionManager(SessionManager sessionManager) {
  this.sessionManager = sessionManager;
  afterSessionManagerSet();
}
origin: org.apache.shiro/shiro-core

  public void destroy() {
    LifecycleUtils.destroy(getSessionManager());
    this.sessionManager = null;
    super.destroy();
  }
}
origin: org.apache.shiro/shiro-core

/**
 * Calls {@link org.apache.shiro.mgt.AuthorizingSecurityManager#afterCacheManagerSet() super.afterCacheManagerSet()} and then immediately calls
 * {@link #applyCacheManagerToSessionManager() applyCacheManagerToSessionManager()} to ensure the
 * <code>CacheManager</code> is applied to the SessionManager as necessary.
 */
@Override
protected void afterCacheManagerSet() {
  super.afterCacheManagerSet();
  applyCacheManagerToSessionManager();
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.shiro

/**
 * Sets the underlying delegate {@link SessionManager} instance that will be used to support this implementation's
 * <tt>SessionManager</tt> method calls.
 * <p/>
 * This <tt>SecurityManager</tt> implementation does not provide logic to support the inherited
 * <tt>SessionManager</tt> interface, but instead delegates these calls to an internal
 * <tt>SessionManager</tt> instance.
 * <p/>
 * If a <tt>SessionManager</tt> instance is not set, a default one will be automatically created and
 * initialized appropriately for the the existing runtime environment.
 *
 * @param sessionManager delegate instance to use to support this manager's <tt>SessionManager</tt> method calls.
 */
public void setSessionManager(SessionManager sessionManager) {
  this.sessionManager = sessionManager;
  afterSessionManagerSet();
}
org.apache.shiro.mgtSessionsSecurityManager

Javadoc

Shiro support of a SecurityManager class hierarchy that delegates all org.apache.shiro.session.Session operations to a wrapped org.apache.shiro.session.mgt.SessionManager instance. That is, this class implements the methods in the SessionManager interface, but in reality, those methods are merely passthrough calls to the underlying 'real' SessionManager instance.

The remaining SecurityManager methods not implemented by this class or its parents are left to be implemented by subclasses.

In keeping with the other classes in this hierarchy and Shiro's desire to minimize configuration whenever possible, suitable default instances for all dependencies will be created upon instantiation.

Most used methods

  • getSessionManager
    Returns this security manager's internal delegate SessionManager.
  • afterSessionManagerSet
  • applyCacheManagerToSessionManager
    Ensures the internal delegate SessionManager is injected with the newly set #setCacheManager so it m
  • getCacheManager
  • applyEventBusToSessionManager
    Ensures the internal delegate SessionManager is injected with the newly set #setEventBus so it may u
  • getEventBus
  • setAuthenticator
  • setAuthorizer
  • setCacheManager
  • setEventBus
  • setRealms
  • setSessionManager
    Sets the underlying delegate SessionManager instance that will be used to support this implementatio
  • setRealms,
  • setSessionManager

Popular in Java

  • Finding current android device location
  • getApplicationContext (Context)
  • scheduleAtFixedRate (Timer)
  • compareTo (BigDecimal)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now