Package org.eclipse.persistence.sessions.server

Examples of org.eclipse.persistence.sessions.server.ServerSession


                isSessionLoadedFromSessionsXML = true;
            }
           
            // Create server session (it needs to be done before initializing ServerPlatform and logging).
            // If a sessions-xml is used this will get replaced later, but is required for logging.
            session = new ServerSession(new Project(new DatabaseLogin()));           
            // ServerSession name and ServerPlatform must be set prior to setting the loggers.
            setServerSessionName(predeployProperties);
            ClassLoader realClassLoader = persistenceUnitInfo.getClassLoader();
            updateServerPlatform(predeployProperties, realClassLoader);
            // Update loggers and settings for the singleton logger and the session logger.
View Full Code Here


        // complete.
        if (this.serverSession == null) {
          ClassLoader realLoader = setupImpl.getPersistenceUnitInfo().getClassLoader();
          // the call top setupImpl.deploy() finishes the session
          // creation
          ServerSession tempServerSession = setupImpl.deploy(realLoader, properties);
          processProperties(tempServerSession.getProperties());
          this.serverSession = tempServerSession;
        }
      }
    }
    return this.serverSession;
View Full Code Here

    return createEntityManagerImpl(properties);
  }

  protected EntityManagerImpl createEntityManagerImpl(Map properties) {
    verifyOpen();
    ServerSession session = getServerSession();
    if (!session.isLoggedIn()) {
      // PERF: Avoid synchronization.
      synchronized (session) {
        // DCL ok as isLoggedIn is volatile boolean, set after login is
        // complete.
        if (!session.isLoggedIn()) {
          session.login();
        }
      }
    }
    return new EntityManagerImpl(this, properties);
  }
View Full Code Here

  }

  public Cache getCache() {
    verifyOpen();
    if (myCache == null) {
      ServerSession session = this.getServerSession();
      myCache = new CacheImpl(this, session.getIdentityMapAccessor());
    }
    return myCache;
  }
View Full Code Here

                        throw new PersistenceException(EntityManagerSetupException.compositeIncompatibleWithSessionsXml(persistenceUnitInfo.getPersistenceUnitName()));
                    }
                    session = new SessionBroker();
                    ((SessionBroker)session).setShouldUseDescriptorAliases(true);
                } else {
                    session = new ServerSession(new Project(new DatabaseLogin()));
                }
                session.setName(this.sessionName);

                if (this.compositeEmSetupImpl == null) {
                    // session name and ServerPlatform must be set prior to setting the loggers.
View Full Code Here

    private ClassTransformer buildTransformer(PersistenceUnitInfo unitInfo, Writer logWriter, int logLevel) {
        //persistenceUnitInfo = unitInfo;
        ClassLoader privateClassLoader = unitInfo.getNewTempClassLoader();

        // create server session (it should be done before initializing ServerPlatform)
        ServerSession session = new ServerSession(new Project(new DatabaseLogin()));
        session.setLogLevel(logLevel);
        if(logWriter!=null){
            ((DefaultSessionLog)session.getSessionLog()).setWriter(logWriter);
         }
       
        session.getPlatform().setConversionManager(new JPAConversionManager());

        boolean weaveEager = false;
        String weaveEagerString = (String)unitInfo.getProperties().get(PersistenceUnitProperties.WEAVING_EAGER);
        if (weaveEagerString != null && weaveEagerString.equalsIgnoreCase("true")) {
            weaveEager = true;
View Full Code Here

                    // be either cached in the server session or ignored
                    properties = splitProperties[0];
                    Map serverSessionProperties = splitProperties[1];
                    // the call top setupImpl.deploy() finishes the session
                    // creation
                    ServerSession tempServerSession = setupImpl.deploy(realLoader, serverSessionProperties);
                    // discard all but non server session properties from server
                    // session properties.
                    Map tempProperties = EntityManagerFactoryProvider.keepSpecifiedProperties(tempServerSession.getProperties(), supportedNonServerSessionProperties);
                    // properties override server session properties
                    Map propertiesToProcess = EntityManagerFactoryProvider.mergeMaps(properties, tempProperties);
                    processProperties(propertiesToProcess);
                    this.serverSession = tempServerSession;
                }
View Full Code Here

        return createEntityManagerImpl(properties);
    }

    protected EntityManagerImpl createEntityManagerImpl(Map properties) {
        verifyOpen();
        ServerSession session = getServerSession();
        if (!session.isLoggedIn()) {
            // PERF: Avoid synchronization.
            synchronized (session) {
                // DCL ok as isLoggedIn is volatile boolean, set after login is
                // complete.
                if (!session.isLoggedIn()) {
                    session.login();
                }
            }
        }
        return new EntityManagerImpl(this, properties);
    }
View Full Code Here

                isSessionLoadedFromSessionsXML = true;
            }
           
            // Create server session (it needs to be done before initializing ServerPlatform and logging).
            // If a sessions-xml is used this will get replaced later, but is required for logging.
            session = new ServerSession(new Project(new DatabaseLogin()));           
            // ServerSession name and ServerPlatform must be set prior to setting the loggers.
            session.setName(this.sessionName);
            ClassLoader realClassLoader = persistenceUnitInfo.getClassLoader();
            updateServerPlatform(predeployProperties, realClassLoader);
            // Update loggers and settings for the singleton logger and the session logger.
View Full Code Here

                isSessionLoadedFromSessionsXML = true;
            }
           
            // Create server session (it needs to be done before initializing ServerPlatform and logging).
            // If a sessions-xml is used this will get replaced later, but is required for logging.
            session = new ServerSession(new Project(new DatabaseLogin()));           
            // ServerSession name and ServerPlatform must be set prior to setting the loggers.
            session.setName(this.sessionName);
            ClassLoader realClassLoader = persistenceUnitInfo.getClassLoader();
            updateServerPlatform(predeployProperties, realClassLoader);
            // Update loggers and settings for the singleton logger and the session logger.
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.sessions.server.ServerSession

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.