Package com.sun.ejb.spi.sfsb

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


    }

    public SFSBBeanState getState(Object sessionKey) {

        String fileName = sessionKey.toString();
        SFSBBeanState beanState = null;

  if(_logger.isLoggable(TRACE_LEVEL)) {
      _logger.log(TRACE_LEVEL, "[SFSBStore] Attempting to load session: "
          + sessionKey);
  }

        if (passivatedSessions.remove(fileName) == null) {
      if(_logger.isLoggable(TRACE_LEVEL)) {
    _logger.log(TRACE_LEVEL, "[SFSBStore] Could not find "
      + "state for session: " + sessionKey);
      }
            return null;
        }

        File file = new File(baseDir, fileName);
        if (file.exists()) {
            int dataSize = (int) file.length();
            byte[] data = new byte[dataSize];
            BufferedInputStream bis = null;
            FileInputStream fis = null;
            try {
                loadCount++;
                fis = new FileInputStream(file);
                bis = new BufferedInputStream(fis);
                int offset = 0;
                for (int toRead = dataSize; toRead > 0; ) {
                    int count = bis.read(data, offset, toRead);
                    offset += count;
                    toRead -= count;
               
       
                beanState = new SFSBBeanState(sessionKey, -1, false, data);
                loadSuccessCount++;
    if(_logger.isLoggable(TRACE_LEVEL)) {
        _logger.log(TRACE_LEVEL, "[SFSBStore] Successfully Loaded "
          + "session: " + sessionKey);
    }
View Full Code Here

TOP

Related Classes of com.sun.ejb.spi.sfsb.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.