Examples of PersistenceSession


Examples of org.apache.isis.core.runtime.system.persistence.PersistenceSession

        return persistedObjects;
    }

    @Override
    public PersistenceSession createPersistenceSession() {
        final PersistenceSession persistenceSession = super.createPersistenceSession();
        if (persistedObjects != null) {
            final OidGenerator oidGenerator = persistenceSession.getOidGenerator();
            final IdentifierGenerator identifierGenerator = oidGenerator.getIdentifierGenerator();
            if (identifierGenerator instanceof IdentifierGeneratorDefault) {
                final IdentifierGeneratorDefault identifierGeneratorDefault = (IdentifierGeneratorDefault) identifierGenerator;
                identifierGeneratorDefault.resetTo(persistedObjects.getOidGeneratorMemento());
            }
View Full Code Here

Examples of org.apache.isis.core.runtime.system.persistence.PersistenceSession

    public void execute(final AuthenticationSession authSession, final Object context) {
//        if(!enabled) return;
//        enabled = false;
        try {
            IsisContext.openSession(authSession);
            PersistenceSession persistenceSession = getPersistenceSession();
            persistenceSession.getServicesInjector().injectServicesInto(this);
            doExecute(context);
        } finally {
            IsisContext.closeSession();
        }
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.system.persistence.PersistenceSession

        return adapter;
    }

    @SuppressWarnings("unchecked")
    public <T extends ObjectStoreSpi> T getObjectStore(Class<T> cls) {
        final PersistenceSession persistenceSession = getPersistenceSession();
        return (T) persistenceSession.getObjectStore();
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.system.persistence.PersistenceSession

    }


    @Override
    public IsisSession openSession(final AuthenticationSession authenticationSession) {
        final PersistenceSession persistenceSession = persistenceSessionFactory.createPersistenceSession();
        ensureThatArg(persistenceSession, is(not(nullValue())));

        final UserProfile userProfile = userProfileLoader.getProfile(authenticationSession);
        ensureThatArg(userProfile, is(not(nullValue())));
View Full Code Here

Examples of org.apache.isis.core.runtime.system.persistence.PersistenceSession

    // //////////////////////////////////////

   
    protected void doExecute(Object context) {

        final PersistenceSession persistenceSession = getPersistenceSession();
        final IsisTransactionManager transactionManager = getTransactionManager(persistenceSession);
        final List<Command> commands = Lists.newArrayList();
        transactionManager.executeWithinTransaction(new TransactionalClosureAbstract() {
            @Override
            public void execute() {
View Full Code Here

Examples of org.apache.isis.core.runtime.system.persistence.PersistenceSession

        servicesInjector = new ServicesInjectorDefault();
        servicesInjector.setContainer(container);

        adapterManager = new AdapterManagerDefault(new PojoRecreatorDefault());
        adapterFactory = new PojoAdapterFactory();
        persistenceSession = new PersistenceSession(mockPersistenceSessionFactory, adapterFactory, objectFactory, servicesInjector, new OidGenerator(new IdentifierGeneratorDefault()), adapterManager, mockPersistAlgorithm, mockObjectStore) {
            @Override
            protected SpecificationLoaderSpi getSpecificationLoader() {
                return isisMetaModel.getSpecificationLoader();
            }
           
View Full Code Here

Examples of org.apache.isis.core.runtime.system.persistence.PersistenceSession

   
    protected ObjectAdapter epv2Adapter;
    protected ObjectSpecification epvSpecification;

    protected ObjectStoreSpi getStore() {
        PersistenceSession psos = IsisContext.getPersistenceSession();
        return (ObjectStoreSpi) psos.getObjectStore();
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.system.persistence.PersistenceSession

        if (getConfiguration().getBoolean(LOGGING_PROPERTY, false)) {
            final String level = getConfiguration().getString(LOGGING_PROPERTY + ".level", "debug");
            objectStore = new IsisObjectStoreLogger(objectStore, level);
        }
       
        final PersistenceSession persistenceSession =
                new PersistenceSession(persistenceSessionFactory, adapterFactory, objectFactory, servicesInjector, identifierGenerator, adapterManager, persistAlgorithm, objectStore);
       
        final IsisTransactionManager transactionManager = createTransactionManager(persistenceSession, objectStore, servicesInjector);
       
        ensureThatArg(persistenceSession, is(not(nullValue())));
        ensureThatArg(transactionManager, is(not(nullValue())));
       
        persistenceSession.setDirtiableSupport(true);
        persistenceSession.setTransactionManager(transactionManager);
       
        return persistenceSession;
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.system.persistence.PersistenceSession

        return adapter;
    }

    @SuppressWarnings("unchecked")
    public <T extends ObjectStoreSpi> T getObjectStore(Class<T> cls) {
        final PersistenceSession persistenceSession = getPersistenceSession();
        return (T) persistenceSession.getObjectStore();
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.system.persistence.PersistenceSession

    // //////////////////////////////////////

   
    protected void doExecute(Object context) {

        final PersistenceSession persistenceSession = getPersistenceSession();
        final IsisTransactionManager transactionManager = getTransactionManager(persistenceSession);
        final List<Command> commands = Lists.newArrayList();
        transactionManager.executeWithinTransaction(new TransactionalClosureAbstract() {
            @Override
            public void execute() {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.