Package oracle.toplink.tools.sessionmanagement

Examples of oracle.toplink.tools.sessionmanagement.SessionManager


   */
  protected DatabaseSession loadDatabaseSession(
      String configLocation, String sessionName, ClassLoader sessionClassLoader)
      throws TopLinkException {

    SessionManager manager = getSessionManager();

    // Try to find TopLink 10.1.3 XMLSessionConfigLoader.
    Method getSessionMethod = null;
    Object loader = null;
    try {
      Class loaderClass = Class.forName("oracle.toplink.tools.sessionconfiguration.XMLSessionConfigLoader");
      getSessionMethod = SessionManager.class.getMethod("getSession",
          new Class[] {loaderClass, String.class, ClassLoader.class, boolean.class, boolean.class, boolean.class});
      if (logger.isDebugEnabled()) {
        logger.debug("Using TopLink 10.1.3 XMLSessionConfigLoader");
      }
      Constructor ctor = loaderClass.getConstructor(new Class[] {String.class});
      loader = ctor.newInstance(new Object[] {configLocation});
    }
    catch (Exception ex) {
      // TopLink 10.1.3 XMLSessionConfigLoader not found ->
      // fall back to TopLink 9.0.4 XMLLoader.
      if (logger.isDebugEnabled()) {
        logger.debug("Using TopLink 9.0.4 XMLLoader");
      }
      XMLLoader xmlLoader = new XMLLoader(configLocation);
      return (DatabaseSession) manager.getSession(xmlLoader, sessionName, sessionClassLoader, false, false);
    }

    // TopLink 10.1.3 XMLSessionConfigLoader found -> create loader instance
    // through reflection and fetch specified Session from SessionManager.
    // This invocation will check if the ClassLoader passed in is the same
View Full Code Here


   * leading to completely independent TopLink Session instances. Could be
   * overridden to return a shared or pre-configured SessionManager.
   * @return the TopLink SessionManager instance
   */
  protected SessionManager getSessionManager() {
    return new SessionManager();
  }
View Full Code Here

   */
  protected DatabaseSession loadDatabaseSession(
      String configLocation, String sessionName, ClassLoader sessionClassLoader)
      throws TopLinkException {

    SessionManager manager = getSessionManager();

    // Try to find TopLink 10.1.3 XMLSessionConfigLoader.
    Method getSessionMethod = null;
    Object loader = null;
    try {
      Class loaderClass = SessionManager.class.getClassLoader().loadClass(
          "oracle.toplink.tools.sessionconfiguration.XMLSessionConfigLoader");
      getSessionMethod = SessionManager.class.getMethod("getSession",
          new Class[] {loaderClass, String.class, ClassLoader.class, boolean.class, boolean.class, boolean.class});
      if (logger.isDebugEnabled()) {
        logger.debug("Using TopLink 10.1.3 XMLSessionConfigLoader");
      }
      Constructor ctor = loaderClass.getConstructor(new Class[] {String.class});
      loader = ctor.newInstance(new Object[] {configLocation});
    }
    catch (Exception ex) {
      // TopLink 10.1.3 XMLSessionConfigLoader not found ->
      // fall back to TopLink 9.0.4 XMLLoader.
      if (logger.isDebugEnabled()) {
        logger.debug("Using TopLink 9.0.4 XMLLoader");
      }
      XMLLoader xmlLoader = new XMLLoader(configLocation);
      return (DatabaseSession) manager.getSession(xmlLoader, sessionName, sessionClassLoader, false, false);
    }

    // TopLink 10.1.3 XMLSessionConfigLoader found -> create loader instance
    // through reflection and fetch specified Session from SessionManager.
    // This invocation will check if the ClassLoader passed in is the same
View Full Code Here

   * leading to completely independent TopLink Session instances. Could be
   * overridden to return a shared or pre-configured SessionManager.
   * @return the TopLink SessionManager instance
   */
  protected SessionManager getSessionManager() {
    return new SessionManager();
  }
View Full Code Here

   */
  protected DatabaseSession loadDatabaseSession(
      String configLocation, String sessionName, ClassLoader sessionClassLoader)
      throws TopLinkException {

    SessionManager manager = getSessionManager();

    // Try to find TopLink 10.1.3 XMLSessionConfigLoader.
    Method getSessionMethod = null;
    Object loader = null;
    try {
      Class loaderClass = SessionManager.class.getClassLoader().loadClass(
          "oracle.toplink.tools.sessionconfiguration.XMLSessionConfigLoader");
      getSessionMethod = SessionManager.class.getMethod("getSession",
          new Class[] {loaderClass, String.class, ClassLoader.class, boolean.class, boolean.class, boolean.class});
      if (logger.isDebugEnabled()) {
        logger.debug("Using TopLink 10.1.3 XMLSessionConfigLoader");
      }
      Constructor ctor = loaderClass.getConstructor(new Class[] {String.class});
      loader = ctor.newInstance(new Object[] {configLocation});
    }
    catch (Exception ex) {
      // TopLink 10.1.3 XMLSessionConfigLoader not found ->
      // fall back to TopLink 9.0.4 XMLLoader.
      if (logger.isDebugEnabled()) {
        logger.debug("Using TopLink 9.0.4 XMLLoader");
      }
      XMLLoader xmlLoader = new XMLLoader(configLocation);
      return (DatabaseSession) manager.getSession(xmlLoader, sessionName, sessionClassLoader, false, false);
    }

    // TopLink 10.1.3 XMLSessionConfigLoader found -> create loader instance
    // through reflection and fetch specified Session from SessionManager.
    // This invocation will check if the ClassLoader passed in is the same
View Full Code Here

   * leading to completely independent TopLink Session instances. Could be
   * overridden to return a shared or pre-configured SessionManager.
   * @return the TopLink SessionManager instance
   */
  protected SessionManager getSessionManager() {
    return new SessionManager();
  }
View Full Code Here

    // Get the name of the session and create it
    String sessionName = null;

    try {

      SessionManager manager = SessionManager.getManager();

      // Get the name of the session and create it
      sessionName = properties.getProperty("session.name");
      server = (Server) manager.getSession(sessionName,
          ToplinkDaoTransactionManager.class.getClassLoader());

    } catch (Exception e) {

      throw new DaoException(
View Full Code Here

TOP

Related Classes of oracle.toplink.tools.sessionmanagement.SessionManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.