daemons.add(createServiceDaemon(connectionPoolSize, ejbServer, red));
daemons.add(createServiceDaemon(connectionPoolSize, ejbServer, blue));
ConfigurationFactory config = new ConfigurationFactory();
Assembler assembler = SystemInstance.get().getComponent(Assembler.class);
// containers
StatelessSessionContainerInfo statelessContainerInfo = config.configureService(StatelessSessionContainerInfo.class);
statelessContainerInfo.properties.setProperty("TimeOut", "100");
statelessContainerInfo.properties.setProperty("PoolSize", "" + statelessPoolSize);
statelessContainerInfo.properties.setProperty("MinSize", "2");
statelessContainerInfo.properties.setProperty("StrictPooling", "true");
assembler.createContainer(statelessContainerInfo);
// Setup the descriptor information
StatelessBean bean = new StatelessBean(CounterBean.class);
bean.addBusinessLocal(Counter.class.getName());
bean.addBusinessRemote(RemoteCounter.class.getName());
bean.addPostConstruct("init");
bean.addPreDestroy("destroy");
EjbJar ejbJar = new EjbJar();
ejbJar.addEnterpriseBean(bean);
CounterBean.instances.set(0);
assembler.createApplication(config.configureApplication(ejbJar));
String failoverURI = "failover:sticky:";
failoverURI += "ejbd://127.0.0.1:" + daemons.get(0).getPort() + "?red,";
failoverURI += "ejbd://127.0.0.1:" + daemons.get(1).getPort() + "?blue";