Package com.ericsson.ssa.sip.persistence

Examples of com.ericsson.ssa.sip.persistence.ReplicationUnitOfWork


   
    /**
    * checks/adds this entity to unitOfWork
    */
    protected void addToUnitOfWork() {
        ReplicationUnitOfWork uow =
            ReplicationUnitOfWork.getThreadLocalUnitOfWork();
        if(uow != null) {
            uow.add(this);
        } else {
            throw new IllegalStateException("HAServletTimer>>addToUnitOfWork: unit of work missing");
        }
    }
View Full Code Here


    @Override
    public void cancel(boolean mayInterruptIfRunning) {
        super.cancel(mayInterruptIfRunning);
        // remove from unit-of-work due its already gone from SessionManager
        ReplicationUnitOfWork uow =
            ReplicationUnitOfWork.getThreadLocalUnitOfWork();
        if (uow != null) {
            uow.remove(this);
        }
    }
View Full Code Here

     * is about to be passivated.
     */
    void notifyWillPassivate() {
        // assumption is that this is never called with an active UOW
        // assert(ReplicationUnitOfWork.getThreadLocalUnitOfWork() == null);
        ReplicationUnitOfWork unitOfWork = new ReplicationUnitOfWork();
        unitOfWork.lockApplicationSession(this);
        try {
            notifySessionWillPassivate();           
        } finally {
            // Unlock UOW, but don't save it (see IT 1114). If any changes
            // were made to the SAS, they will be included in the serialized
            // representation of the SAS that is going to be migrated
            unitOfWork.unlock();
        }
    }
View Full Code Here

                        ">>passivate: " + this);
        }
       
        // assumption is that this is never called with an active UOW
        // assert(ReplicationUnitOfWork.getThreadLocalUnitOfWork() == null);
        ReplicationUnitOfWork unitOfWork = new ReplicationUnitOfWork();
        unitOfWork.lockApplicationSession(this);
        try {
            cancelNonPersistentTimers();

            // Remove from active cache
            PersistentSipSessionManagerBase mgr = (PersistentSipSessionManagerBase)
            getSipSessionManager();
            if (mgr != null) {
                mgr.removeSipApplicationSessionFromCache(this);
            }

            if (sasTimer != null) {
                sasTimer.cancel();
            }
           
        } finally {
            // Unlock UOW, but don't save it (see IT 1114)
            unitOfWork.unlock();
        }
    }
View Full Code Here

                        ">>activate: " + this);
        }
        if (ReplicationUnitOfWork.getThreadLocalUnitOfWork() == null) {
            // if not invoked in the context where there is a UOW we create
            // a new one (e.g., when called after a loadAdvisory).
            ReplicationUnitOfWork unitOfWork = new ReplicationUnitOfWork();
            unitOfWork.lockApplicationSession(this);
            try {
                return super.activate();
            } finally {
                // Save modified entities (if any), and unlock the dialog
                unitOfWork.saveAndUnlock();
            }
        } else {
            // reuse the current UOW
            return super.activate();           
        }
View Full Code Here

    public void touchAndSave() {
        if (logger.isLoggable(Level.FINE)) {
            logger.fine("IN " + this.getClass().getName() +
                        ">>touchAndSave: " + this);
        }
        ReplicationUnitOfWork unitOfWork
            = ReplicationUnitOfWork.getThreadLocalUnitOfWork();
        if(unitOfWork == null) {
            unitOfWork = new ReplicationUnitOfWork();
        }
       
        unitOfWork.lockApplicationSession(this);
        try {
            this.setPFieldExpirationTime(this.getPFieldExpirationTime());
        } finally {
            // Save modified entities, and unlock the dialog
            unitOfWork.saveAndUnlock();
        }
    }   
View Full Code Here

    /**
    * checks/adds this entity to unitOfWork
    */
    protected void addToUnitOfWork() {
        if (shouldBePersisted()) {
            ReplicationUnitOfWork uow =
                ReplicationUnitOfWork.getThreadLocalUnitOfWork();
            if(uow != null) {
                uow.add(this);
            } else {
                throw new IllegalStateException("HASipApplicationSession>>addToUnitOfWork: unit of work missing");
            }
        }
    }
View Full Code Here

    protected void invalidate(boolean hasTimedOut) {
        super.invalidate(hasTimedOut);

        // remove from unit-of-work due its already gone from SessionManager
        if (shouldBePersisted()) {
            ReplicationUnitOfWork uow =
                ReplicationUnitOfWork.getThreadLocalUnitOfWork();
            if (uow != null) {
                uow.remove(this);
            }
        }       
    }
View Full Code Here

            // Instantiate a unit-of-work to collect any modified
            // entities/artifacts during timer invocation.
            // If a unit-of-work already exists, leverage it instead of
            // creating a new one.
            if (ReplicationUnitOfWork.getThreadLocalUnitOfWork() == null) {
                ReplicationUnitOfWork unitOfWork = new ReplicationUnitOfWork();
                unitOfWork.lockApplicationSession(this);
                try {
                    // fire timer
                    super.timeout(timer);
                } finally {
                    // Save modified entities (if any), and unlock the dialog
                    unitOfWork.saveAndUnlock();
                }
            } else {
                // reuse the current uow
                super.timeout(timer);
            }
View Full Code Here

            } else {
                sipAppSession = sipSessionManager.createSipApplicationSession(
                    convergedCtxt.getSipApplicationListeners());
            }

            ReplicationUnitOfWork uow =
                ReplicationUnitOfWork.getThreadLocalUnitOfWork();
            if (uow != null) {
                uow.lockApplicationSession(sipAppSession);
            }
        }

        if ((sipAppSession != null) &&
                (httpSession.getSipApplicationSessionId() == null)) {
View Full Code Here

TOP

Related Classes of com.ericsson.ssa.sip.persistence.ReplicationUnitOfWork

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.