Package com.sun.ejb.spi.sfsb.store

Examples of com.sun.ejb.spi.sfsb.store.SFSBBeanState


  }
    }

    SFSBBeanState getSFSBBeanState(SessionContextImpl sc) {
  //No need to synchronize
  SFSBBeanState sfsbBeanState = null;
  try {
           
            if ((containerState != CONTAINER_STARTED) && (containerState != CONTAINER_STOPPED)) {
    _logger.log(Level.FINE, "getSFSBBeanState() returning because "
      + "containerState: " + containerState);
                return null;
            }

            if (sc.getState() == DESTROYED) {
                return null;
      }
           
            Object ejb = sc.getEJB();
           
            ComponentInvocation ci = new ComponentInvocation(ejb, this, sc);
            invocationManager.preInvoke(ci);

            synchronized (sc) {
                try {
                    interceptorManager.intercept(
                            CallbackType.PRE_PASSIVATE, sc);
        sc.setLastPersistedAt(System.currentTimeMillis());
                    long newCtxVersion = sc.incrementAndGetVersion();
        byte[] serializedState = IOUtils.serializeObject(sc, true);
        sfsbBeanState = sfsbStoreManager.createSFSBBeanState(
      sc.getInstanceKey(), System.currentTimeMillis(),
      !sc.existsInStore(), serializedState);
        sfsbBeanState.setVersion(newCtxVersion);
                    interceptorManager.intercept(
                            CallbackType.POST_ACTIVATE, sc);
        //Do not set sc.setExistsInStore() here
                } catch (java.io.NotSerializableException serEx) {
                    _logger.log(Level.WARNING, "Error  during checkpoint ("
View Full Code Here


        sc.setLastPersistedAt(System.currentTimeMillis());
        byte[] serializedState = null;
        try {
                        long newCtxVersion = sc.incrementAndGetVersion();
            serializedState = IOUtils.serializeObject(sc, true);
            SFSBBeanState beanState =
      sfsbStoreManager.createSFSBBeanState(
        sc.getInstanceKey(), sc.getLastAccessTime(),
        !sc.existsInStore(), serializedState);
                        beanState.setVersion(newCtxVersion);
      sfsbStoreManager.checkpointSave(beanState);

      //Now that we have successfully stored.....
           
      sc.setLastPersistedAt(System.currentTimeMillis());
View Full Code Here

  for (int i=0; i<size; i++) {
      SessionContextImpl ctx = contexts[i];
      StatefulSessionContainer container =
    (StatefulSessionContainer) ctx.getContainer();
      SFSBBeanState beanState = container.getSFSBBeanState(ctx);
      if (beanState != null) {
    states.add(beanState);
      }
  }
View Full Code Here

    /** A Factory method to create a SFSBBeanState. The StoreManager
     *   is responsible for filling the SFSBBeanState with the
     *   correct ClusterId, containerId and SFSBStoreManager
     */
    public SFSBBeanState createSFSBBeanState(Object sessionId, long lastAccess, boolean isNew, byte[] state) {
        return new SFSBBeanState(
            this.getClusterID(),
            containerID,  //long
            sessionId,
            lastAccess,
            isNew,
View Full Code Here

            _logger.entering("ReplicatedSFSBStoreManager", "getState", id);
        }
        if(id == null) {
            return null;
        }
        SFSBBeanState sfsbState = null;
        //try first in locally passivated cache before going to backup
        sfsbState= this.getFromLocallyPassivatedCache(id.toString());
        if(sfsbState != null) {
            return sfsbState;
        }
View Full Code Here

            store = getStore();           
            ( (ReplicatedEjbStore) store).save(beanStates, startTime);
            //added for monitoring
            if(this.isMonitoringEnabled()) {
                for(int i=0; i<beanStates.length; i++) {
                    SFSBBeanState nextBeanState = beanStates[i];
                    stats.processBeanSize(this.getBeanSize(nextBeanState));
                }
            }
            //end added for monitoring          
        }
View Full Code Here

   
    private Long[] storeOriginalTxCheckpointDurations(SFSBBeanState[] beanStates) {   
        //return temporarily stored original txCheckpointDurations
        Long[] originalTxCheckpointDurations = new Long[beanStates.length];
        for(int i=0; i<beanStates.length; i++) {
            SFSBBeanState nextBeanState = beanStates[i];
            originalTxCheckpointDurations[i] =
                new Long(nextBeanState.getTxCheckpointDuration());
        }
        return originalTxCheckpointDurations;
    }
View Full Code Here

   
    private void restoreOriginalTxCheckpointDurations(SFSBBeanState[] beanStates, Long[] originalTxCheckpointDurations) {   
        //restore temporarily stored original txCheckpointDurations
        //to beanStates from originalTxCheckpointDurations
        for(int i=0; i<beanStates.length; i++) {
            SFSBBeanState nextBeanState = beanStates[i];
            long originalDuration = originalTxCheckpointDurations[i].longValue();
            nextBeanState.setTxCheckpointDuration(originalDuration);
        }
        return;
    }
View Full Code Here

    private void printTxCheckpointDurations(SFSBBeanState[] beanStates) {   
        //used for testing
        if (_logger.isLoggable(Level.FINE)) {
            _logger.fine("Printing Checkpoint Durations");
            for(int i=0; i<beanStates.length; i++) {
                SFSBBeanState nextBeanState = beanStates[i];
                _logger.fine("printTxCheckpointDurations for beanState[" + i + "]: "
                             + nextBeanState.getTxCheckpointDuration());
            }
        }
        return;
    }
View Full Code Here

         */
        if(ReplicationHealthChecker.isStopping()) {
            return;
        }       

        SFSBBeanState beanStates[] = getLocallyPassivatedBeanStatesArray();
        for (int i = 0; i < beanStates.length; i++) {
            SFSBBeanState beanState = (SFSBBeanState) beanStates[i];
            if(beanState.getLastAccess() <= repairStartTime) {
                try {
                    checkpointSave(beanState);
                } catch(SFSBStoreManagerException ex) {
                     // FIXME evaluate log level
                    if (_logger.isLoggable(Level.FINE)) {
View Full Code Here

TOP

Related Classes of com.sun.ejb.spi.sfsb.store.SFSBBeanState

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.