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

How to use
SessionFactory
in
org.apache.shiro.session.mgt

Best Java code snippets using org.apache.shiro.session.mgt.SessionFactory (Showing top 5 results out of 315)

origin: apache/shiro

protected Session newSessionInstance(SessionContext context) {
  return getSessionFactory().createSession(context);
}
origin: org.apache.shiro/shiro-core

protected Session newSessionInstance(SessionContext context) {
  return getSessionFactory().createSession(context);
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.shiro

protected Session newSessionInstance(SessionContext context) {
  return getSessionFactory().createSession(context);
}
origin: uk.q3c.krail/krail

@Override
public Session start(SessionContext context) {
  log.debug("starting VaadinSessionManager");
  // Retrieve the VaadinSession for the current user.
  VaadinSession vaadinSession = sessionProvider.get();
  // Create a new security session using the session factory.
  SimpleSession shiroSession = (SimpleSession) sessionFactory.createSession(context);
  // Assign a unique ID to the session now because this session manager
  // doesn't use a SessionDAO for persistence as it delegates to any
  // VaadinSession configured persistence.
  shiroSession.setId(UUID.randomUUID()
              .toString());
  // Put the security session in the VaadinSession. We use the session's ID as
  // part of the key just to be safe so we can double check that the security
  // session matches when it is requested in getSession.
  vaadinSession.setAttribute(SESSION_ATTRIBUTE_PREFIX + shiroSession.getId(), shiroSession);
  return shiroSession;
}
origin: KrailOrg/krail

@Override
public Session start(SessionContext context) {
  log.debug("starting VaadinSessionManager");
  // Retrieve the VaadinSession for the current user.
  VaadinSession vaadinSession = sessionProvider.get();
  // Create a new security session using the session factory.
  SimpleSession shiroSession = (SimpleSession) sessionFactory.createSession(context);
  // Assign a unique ID to the session now because this session manager
  // doesn't use a SessionDAO for persistence as it delegates to any
  // VaadinSession configured persistence.
  shiroSession.setId(UUID.randomUUID()
              .toString());
  // Put the security session in the VaadinSession. We use the session's ID as
  // part of the key just to be safe so we can double check that the security
  // session matches when it is requested in getSession.
  vaadinSession.setAttribute(SESSION_ATTRIBUTE_PREFIX + shiroSession.getId(), shiroSession);
  return shiroSession;
}
org.apache.shiro.session.mgtSessionFactory

Javadoc

A simple factory class that instantiates concrete Session instances. This is mainly a mechanism to allow instances to be created at runtime if they need to be different the defaults. It is not used by end-users of the framework, but rather those configuring Shiro to work in an application, and is typically injected into the org.apache.shiro.mgt.SecurityManager or a SessionManager.

Most used methods

  • createSession
    Creates a new Session instance based on the specified contextual initialization data.

Popular in Java

  • Updating database using SQL prepared statement
  • setContentView (Activity)
  • findViewById (Activity)
  • getSystemService (Context)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • JButton (javax.swing)
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Top plugins for Android Studio
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