|
A set of additional wrapper classes is provided for Java programmers to allow the easier use of YAMI4 components as beans in the container-based environment. The Spring framework was specifically selected as a target and example variant of the calculator client-server system is provided with appropriate Spring configuration files.
There are four classes, all defined in the com.inspirel.yami.beans
package, that can help in a bean-based system:
AgentWrapper
, which allows to set up the agent object and configure it fully in terms of properties. This class includes also an additional interface for preparing a service with a single object.ObjectExporter
, which is a server-side utility class that allows to bind object implementations with the agent bean - the usage patterns for this class are similar to that of Spring exporters for RMI.ObjectProxy
, which is a client-side utility bean that encapsulates the knowledge of the local agent and remote target and that provides easier syntax for message sending operations.BeanInstantiationException
, which is an exception class used to signal initialization errors of YAMI4 beans.The Java bean wrapper and utility classes allow the communication paths to be completely configured in terms of XML files that drive the instantiation and ``wiring'' of application objects within the container.
Explaining usage patterns of the Spring framework is not the purpose of this book - the interested reader will find a simple example of complete client-server system (a variant of the calculator example) in the YAMI4 distribution package, together with appropriate XML configuration files. It is hoped that the example code and configuration are self-explanatory.