How can one have non-client specific state in stateless session beans?

sachin mahishi

You can use the Environment to get a pointer to a somewhat global state, that's shared among all EJBs:

public class test implements SessionBean
{
 private transient SessionContext ctx;
 static final float PIE=3.14 ;
 private transient Properties    myprops;    

 //all the SessionBean  methods 
 public void setSessionContext(SessionContext ctx) {
    this.ctx = ctx;
    myprops    = ctx.getEnvironment();
  }


}
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact