0 Replies Latest reply on Sep 8, 2003 4:29 AM by luojz

    Instances of SessionBean!

    luojz Newbie

      Hi,friends,

      I want that when I deploy a SessionBean,jBoss invokes the bean's static block.For example:

      package jboss1;

      import javax.ejb.*;

      public class classpath1Bean implements SessionBean {
      static{
      System.out.println("How are you?");
      }
      SessionContext sessionContext;
      public void ejbCreate() throws CreateException {}
      public void ejbRemove() {}
      public void ejbActivate() {}
      public void ejbPassivate() {}
      public void setSessionContext(SessionContext sessionContext) {
      this.sessionContext = sessionContext;
      }
      public String test1() {
      return "Hello World!";
      }
      }

      Here,I want the static block:
      static{
      System.out.println("How are you?");
      }
      can be invoke when I deploy the bean.

      What should I do? Pls help me,Tks!!!