01: package com.flexive.example.war;
02:
03: import com.flexive.example.shared.interfaces.EJBExample;
04: import com.flexive.shared.EJBLookup;
05: import com.flexive.shared.exceptions.FxApplicationException;
06: import com.flexive.shared.structure.FxType;
07:
08: import java.util.Map;
09:
10: /**
11: * A JSF managed bean providing cached access to an EJB method.
12: */
13: public class ManagedExampleBean {
14: private Map<FxType, Integer> instanceCounts;
15:
16: public Map<FxType, Integer> getInstanceCounts()
17: throws FxApplicationException {
18: if (instanceCounts == null) {
19: instanceCounts = EJBLookup.getEngine(EJBExample.class)
20: .getInstanceCounts();
21: }
22: return instanceCounts;
23: }
24: }
|