Information Technology Reference
In-Depth Information
F
IG
.9.
EJBSync
: method replay infrastructure.
class that implements
EJBObject
) delegates a client invocation to the bean imple-
mentation (i.e., the class that implements
SessionBean
or
EntityBean
), a
top-level
method invocation is logged by creating a LogRecord EJB. For example, if an ap-
plication invokes the SSB
newOrder
method, and that method, in turn, invokes the
OrderHome.createOrder
and a series of
Order.addLineItem
methods,
only
newOrder
(and its arguments) are logged.
EJBSync
is responsible for tracking
the dynamic method depth at which a given method executes. Note that only remote-
able EJBs support method logging using the
EJBSync
middleware. Local-only EJBs
do not have Handles that allow references to them to be saved persistently, and their
parameters are not restricted to serializable datatypes.
Sample 14
shows the signature of the
newOrder
method as specified in the
Man-
ageOrder
SSB. The bean developer implements this method to validate the input
parameters, and iterate over the set of line items in the order so as to interact with the
OrderHome
,
OrderLineHome
,
StockHome
, and
CustomerHome
and place
the order.
ManageOrder
and its implementation are specified independently of any
container implementation or environment, and can be deployed to any EJB container.