User: jules_gosnell
  Date: 02/01/04 10:21:15

  Modified:    jetty/src/main/org/jboss/jetty/ejb
                        CoarseHttpSessionBean.java
  Log:
  first cut of distributed HttpSession stuff
  
  Revision  Changes    Path
  1.2       +92 -44    
contrib/jetty/src/main/org/jboss/jetty/ejb/CoarseHttpSessionBean.java
  
  Index: CoarseHttpSessionBean.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/contrib/jetty/src/main/org/jboss/jetty/ejb/CoarseHttpSessionBean.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CoarseHttpSessionBean.java        2002/01/03 20:51:05     1.1
  +++ CoarseHttpSessionBean.java        2002/01/04 18:21:15     1.2
  @@ -9,15 +9,16 @@
   import javax.ejb.RemoveException;
   import org.apache.log4j.Category;
   import org.jboss.jetty.interfaces.CoarseHttpSession;
  +import org.jboss.jetty.interfaces.CoarseHttpSessionData;
   
   /**
    * The Entity bean represents an HttpSession.
    *
    * @author [EMAIL PROTECTED]
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    *
    *   @ejb:bean name="jetty/CoarseHttpSession" type="CMP" 
jndi-name="ejb/jetty/CoarseHttpSession" primkey-field="id"
  - *   @ejb:pk class="java.lang.Integer"
  + *   @ejb:pk class="java.lang.String"
    *
    *   @jboss:table-name "Jetty_CoarseHttpSession"
    *   @jboss:create-table "true"
  @@ -36,22 +37,22 @@
     // Home
     //----------------------------------------
   
  -//   /**
  -//    * Transfer money
  -//    *
  -//    * @ejb:home-method
  -//    */
  -//   public void ejbHomeTransfer(HttpSession from, HttpSession to, float amount)
  -//   {
  -//     try
  -//     {
  -//       from.withdraw(amount);
  -//       to.deposit(amount);
  -//     } catch (java.rmi.RemoteException e)
  -//     {
  -//       throw new EJBException(e);
  -//     }
  -//   }
  +  //   /**
  +  //    * Transfer money
  +  //    *
  +  //    * @ejb:home-method
  +  //    */
  +  //   public void ejbHomeTransfer(HttpSession from, HttpSession to, float amount)
  +  //   {
  +  //     try
  +  //     {
  +  //       from.withdraw(amount);
  +  //       to.deposit(amount);
  +  //     } catch (java.rmi.RemoteException e)
  +  //     {
  +  //       throw new EJBException(e);
  +  //     }
  +  //   }
   
     //----------------------------------------
     // Lifecycle
  @@ -63,12 +64,13 @@
      * @ejb:create-method
      * @ejb:permission role-name="Administrator"
      */
  -  public Integer ejbCreate(Integer id)
  +  public Integer ejbCreate(CoarseHttpSessionData data)
       throws CreateException
     {
  -    _log.info("ejbCreate("+id+")");
  +    _log.info("ejbCreate("+data.getId()+")");
   
  -    setId(id);
  +    setId(data.getId());
  +    setData(data);
   
       return null;
     }
  @@ -77,10 +79,10 @@
      * Create httpSession.
      *
      */
  -  public void ejbPostCreate(Integer id)
  +  public void ejbPostCreate(CoarseHttpSessionData data)
       throws CreateException
     {
  -    _log.info("ejbPostCreate("+id+")");
  +    _log.info("ejbPostCreate("+data.getId()+")");
     }
   
     public void
  @@ -140,7 +142,7 @@
      *
      * @jboss:column-name "pk"
      */
  -  public abstract Integer getId();
  +  public abstract String getId();
   
     /**
      * @ejb:pk-field
  @@ -148,7 +150,7 @@
      *
      * @jboss:column-name "pk"
      */
  -  public abstract void setId(Integer id);
  +  public abstract void setId(String id);
   
     //----------------------------------------
     // Attributes
  @@ -219,23 +221,69 @@
       setAttributes(attrs);
     }
   
  -//   /**
  -//    * Generated bulk accessor.
  -//    *
  -//    * Not remote, but could be.
  -//    *
  -//    */
  -//   public abstract void setData(HttpSessionData data);
  -//
  -//   /**
  -//    * Generated bulk accessor.
  -//    *
  -//    * This is set as remote to allow clients to
  -//    * get all data in one call.
  -//    *
  -//    * @ejb:interface-method
  -//    * @ejb:permission role-name="Administrator"
  -//    * @ejb:transaction type="Supports"
  -//    */
  -//   public abstract HttpSessionData getData();
  +  //----------------------------------------
  +  // CreationTime
  +
  +  /**
  +   * @ejb:interface-method
  +   * @ejb:persistent-field
  +   * @ejb:transaction type="Supports"
  +   */
  +  public abstract long getCreationTime();
  +
  +  /**
  +   * @ejb:interface-method
  +   * @ejb:persistent-field
  +   * @ejb:transaction type="Supports"
  +   */
  +  public abstract void setCreationTime(long creationTime);
  +
  +  //----------------------------------------
  +  // LastAccessedTime
  +
  +  /**
  +   * @ejb:interface-method
  +   * @ejb:persistent-field
  +   * @ejb:transaction type="Supports"
  +   */
  +  public abstract long getLastAccessedTime();
  +
  +  /**
  +   * @ejb:interface-method
  +   * @ejb:persistent-field
  +   * @ejb:transaction type="Supports"
  +   */
  +  public abstract void setLastAccessedTime(long lastAccessedTime);
  +
  +  //----------------------------------------
  +  // MaxInactiveInterval
  +
  +  /**
  +   * @ejb:interface-method
  +   * @ejb:persistent-field
  +   * @ejb:transaction type="Supports"
  +   */
  +  public abstract int getMaxInactiveInterval();
  +
  +  /**
  +   * @ejb:interface-method
  +   * @ejb:persistent-field
  +   * @ejb:transaction type="Supports"
  +   */
  +  public abstract void setMaxInactiveInterval(int maxInactiveInterval);
  +
  +  //----------------------------------------
  +  // Bulk accessor
  +
  +  /**
  +   * Not remote, but could be.
  +   */
  +  public abstract void setData(CoarseHttpSessionData data);
  +
  +  /**
  +   * @ejb:interface-method
  +   * @ejb:permission role-name="Administrator"
  +   * @ejb:transaction type="Supports"
  +   */
  +  public abstract CoarseHttpSessionData getData();
   }
  
  
  

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

Reply via email to