User: peter   
  Date: 00/12/20 20:42:42

  Modified:    src/main/org/jboss/test/cts/ejb StatefulSessionBean.java
  Log:
  Added more tests to stateful session bean.
  
  Revision  Changes    Path
  1.3       +123 -21   
jbosstest/src/main/org/jboss/test/cts/ejb/StatefulSessionBean.java
  
  Index: StatefulSessionBean.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jbosstest/src/main/org/jboss/test/cts/ejb/StatefulSessionBean.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- StatefulSessionBean.java  2000/08/10 04:09:22     1.2
  +++ StatefulSessionBean.java  2000/12/21 04:42:41     1.3
  @@ -1,35 +1,137 @@
  -/*
  - * Copyright 1999 by dreamBean Software,
  - * All rights reserved.
  - */
   package org.jboss.test.cts.ejb;
   
  +
  +
  +import org.jboss.test.util.ejb.*;
  +import java.security.Principal;
   import java.io.*;
   import java.util.*;
   import javax.ejb.*;
  -
   import org.jboss.test.util.ejb.SessionSupport;
   
  +
   /**
  - *      
  + *
    *   @see <related>
    *   @author $Author: peter $
  - *   @version $Revision: 1.2 $
  + *   @version $Revision: 1.3 $
    */
  +
   public class StatefulSessionBean
      extends SessionSupport
   {
  -   // Constants -----------------------------------------------------
  -    
  -   // Attributes ----------------------------------------------------
  -   
  -   // Static --------------------------------------------------------
  -
  -   // Constructors --------------------------------------------------
  -   
  -   // Public --------------------------------------------------------
  -     public String method1(String msg)
  -     {
  -             return msg;
  -     }
  +   private int counter;
  +
  +   /**
  +    * Method ejbCreate
  +    *
  +    *
  +    * @throws CreateException
  +    *
  +    */
  +
  +   public void ejbCreate ()
  +      throws CreateException
  +   {
  +   }
  +
  +   /**
  +    * Method method1
  +    *
  +    *
  +    * @param msg
  +    *
  +    * @return
  +    *
  +    */
  +
  +   public String method1 (String msg)
  +   {
  +      return msg;
  +   }
  +
  +   /**
  +    * Method incCounter
  +    *
  +    *
  +    */
  +
  +   public void incCounter ()
  +   {
  +      counter++;
  +   }
  +
  +   /**
  +    * Method decCounter
  +    *
  +    *
  +    */
  +
  +   public void decCounter ()
  +   {
  +      counter--;
  +   }
  +
  +   /**
  +    * Method getCounter
  +    *
  +    *
  +    * @return
  +    *
  +    */
  +
  +   public int getCounter ()
  +   {
  +      return counter;
  +   }
  +
  +   /**
  +    * Method setCounter
  +    *
  +    *
  +    * @param value
  +    *
  +    */
  +
  +   public void setCounter (int value)
  +   {
  +      counter = value;
  +   }
  +
  +   /**
  +    * Method getBeanContextInfo
  +    *
  +    *
  +    * @return
  +    *
  +    */
  +
  +   public BeanContextInfo getBeanContextInfo ()
  +   {
  +      BeanContextInfo ctx = new BeanContextInfo();
  +
  +      System.out.println("Getting EJBObject..");
  +
  +      Class remoteInterface = sessionCtx.getEJBObject().getClass();
  +
  +      ctx.remoteInterface = remoteInterface.getName();
  +
  +      System.out.println("Getting EJBHome...");
  +
  +      Class homeInterface = sessionCtx.getEJBHome().getClass();
  +
  +      ctx.homeInterface = homeInterface.getName();
  +
  +      System.out.println("Getting CallerPrincipal...");
  +
  +      Principal principal = sessionCtx.getCallerPrincipal();
  +
  +      ctx.principleName = principal.getName();
  +
  +      //ctx.isCallerInRole = sessionCtx.isCallerInRole();
  +      return ctx;
  +   }
   }
  +
  +
  +/*------ Formatted by Jindent 3.23 Basic 1.0 --- http://www.jindent.de ------*/
  
  
  

Reply via email to