O'Reilly logo

JBoss AS 7 Configuration, Deployment, and Administration by Francesco Marchioni

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Clustering session beans

In Chapter 3, Configuring Enterprise Services, we recapped the difference between Stateless Session Beans (SLSB) and Stateful Session Beans (SFSB).

SLSB are not able to retain state between invocations, so the main benefit of clustering an SLSB is to balance the load between an array of servers. Consequently, the clustering policies are pretty simple and requires at most adding a @ org.jboss.ejb3.annotation.Clustered annotation.

@Stateless
@Clustered
public class ClusteredBean {
public void doSomething() {
// Do something
}
}

If you want to further specialize your SLSB, then you can choose the load-balancing algorithm used to distribute the load between your EJBs. These are the available load-balancing policies for your ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required