Package org.eclipse.persistence.sessions.server

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


            synchronized (this) {
                // DCL ok as isLoggedIn is volatile boolean, set after login is 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 CacheImpl getCache(){
        verifyOpen();
        if (myCache == null){
            ServerSession session=this.getServerSession();
            myCache = new CacheImpl(this,session.getIdentityMapAccessor());
            }
            return myCache;
    }
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.
            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

    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

     * We preserve state from each processor run by holding static references
     * to projects.
     */
    public MetadataProject getMetadataProject(SEPersistenceUnitInfo puInfo) {
        if (! metadataProjects.containsKey(puInfo.getPersistenceUnitName())) {
            MetadataProject project = new MetadataProject(puInfo, new ServerSession(new Project(new DatabaseLogin())), false, false, false, false);
            metadataProjects.put(puInfo.getPersistenceUnitName(), project);
            return project;
        } else {
            return metadataProjects.get(puInfo.getPersistenceUnitName());
        }
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.
            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

            synchronized (this) {
                // DCL ok as isLoggedIn is volatile boolean, set after login is 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 CacheImpl getCache(){
        verifyOpen();
        if (myCache == null){
            ServerSession session=this.getServerSession();
            myCache = new CacheImpl(this,session.getIdentityMapAccessor());
            }
            return myCache;
    }
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.