User: user57  
  Date: 02/02/16 00:52:51

  Modified:    src/main/org/jboss/ejb/plugins
                        StatefulSessionFilePersistenceManager.java
  Log:
   o add debugging before activation && passivation
   o Usinf Buffered{Input|Output}Streams
  
  Revision  Changes    Path
  1.32      +26 -9     
jboss/src/main/org/jboss/ejb/plugins/StatefulSessionFilePersistenceManager.java
  
  Index: StatefulSessionFilePersistenceManager.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/StatefulSessionFilePersistenceManager.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- StatefulSessionFilePersistenceManager.java        15 Feb 2002 06:18:31 -0000     
 1.31
  +++ StatefulSessionFilePersistenceManager.java        16 Feb 2002 08:52:51 -0000     
 1.32
  @@ -13,6 +13,8 @@
   import java.io.ObjectInputStream;
   import java.io.ObjectOutputStream;
   import java.io.FileOutputStream;
  +import java.io.BufferedInputStream;
  +import java.io.BufferedOutputStream;
   import java.io.FileInputStream;
   import java.io.IOException;
   import java.lang.reflect.Method;
  @@ -38,13 +40,14 @@
   import org.jboss.util.jmx.MBeanServerLocator;
   
   /**
  - *  This class is one of the passivating plugins for JBoss.
  - *  It is fairly simple and can work from the file system from wich JBoss is 
operating
  + * This class is one of the passivating plugins for JBoss.
  + * It is fairly simple and can work from the file system from wich JBoss is 
operating.
  + * Passivates beans into the system data directory under the 'sessions' 
sub-directory.
    *
  - *  @author <a href="mailto:[EMAIL PROTECTED]";>Rickard �berg</a>
  - *  @author <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
  - *  @author <a href="mailto:[EMAIL PROTECTED]";>Sebastien Alborini</a>
  - *  @version $Revision: 1.31 $
  + * @author <a href="mailto:[EMAIL PROTECTED]";>Rickard �berg</a>
  + * @author <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
  + * @author <a href="mailto:[EMAIL PROTECTED]";>Sebastien Alborini</a>
  + * @version $Revision: 1.32 $
    */
   public class StatefulSessionFilePersistenceManager
      implements StatefulSessionPersistenceManager
  @@ -73,6 +76,8 @@
      {
         boolean debug = log.isDebugEnabled();
   
  +      // FIXME: these never change, make them static and loaded on class init
  +
         // Find methods
         ejbActivate = SessionBean.class.getMethod("ejbActivate", new Class[0]);
   
  @@ -205,11 +210,16 @@
      {
         try
         {
  +         if (log.isDebugEnabled()) {
  +            log.debug("Attempting to activate; ctx=" + ctx);
  +         }
  +         
            ObjectInputStream in;
               
  -            
            // Load state
  -         in = new SessionObjectInputStream(ctx, new 
FileInputStream(getFile(ctx.getId())));
  +         in = new SessionObjectInputStream
  +            (ctx, new BufferedInputStream
  +             (new FileInputStream(getFile(ctx.getId()))));
               
            ctx.setInstance(in.readObject());
               
  @@ -260,11 +270,18 @@
      {
         try
         {
  +         if (log.isDebugEnabled()) {
  +            log.debug("Attempting to passivate; ctx=" + ctx);
  +         }
  +         
            // Call bean
            ejbPassivate.invoke(ctx.getInstance(), new Object[0]);
               
            // Store state
  -         ObjectOutputStream out = new SessionObjectOutputStream(new 
FileOutputStream(getFile(ctx.getId())));
  +         ObjectOutputStream out =
  +            new SessionObjectOutputStream
  +            (new BufferedOutputStream
  +             (new FileOutputStream(getFile(ctx.getId()))));
               
            out.writeObject(ctx.getInstance());
               
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to