280 likes | 299 Views
This progress report discusses the implementation of the Replication Framework, including EJB and Web-service implementations, transaction interception, deployment support, and open issues.
E N D
Replication Framework:Progress Report Vance Maverick University of Bologna Dec. 11, 2003
Outline • Framework recap • EJB implementation • Web-service implementation • Transaction interception • Deployment support • Some open issues • Summary ADAPT Bologna meeting, Dec. 2003
Framework recap • Generic API for interface between standard J2EE server and replication algorithm • Allow different replication algorithms to be plugged in • Protect replication development from upgrades in the server • Circulated paper designs from May onwards • Presented at Brussels meeting ADAPT Bologna meeting, Dec. 2003
ComponentMonitor API • Approach: module barriers between J2EE container and replication algorithm • Replication code implements interface ComponentMonitor • Container provides services to replication code through interfaces • ContainerSupport provides top-level container services • ComponentHandle stands for component ADAPT Bologna meeting, Dec. 2003
Intercepting invocations ComponentMonitor call() ? call() Handle Normal Intercepted • Container diverts invocation to ComponentMonitor • Response call(ComponentHandle, Request) • CM may perform arbitrary computation + communication • To continue execution, it forwards call to ComponentHandle ADAPT Bologna meeting, Dec. 2003
Communicating component state ComponentMonitor ComponentMonitor Handle State Handle Handle State State • ComponentMonitor does not reference component directly • Instead, uses serializable ComponentHandle • Gets and sets state as opaque serializable “blob” (bytes) ADAPT Bologna meeting, Dec. 2003
EJB implementation of API • Types of EJBs • Entity bean • Stateless session bean • Stateful session bean • ComponentHandle contains • JNDI name of bean • Session ID (for SFSB) • Primary key object (for entity bean) • Intercept persistence methods for entity bean ADAPT Bologna meeting, Dec. 2003
EJB EJB EJB PersistenceManager EJB Invocation Interception EJB Container Interceptors ADAPT Bologna meeting, Dec. 2003
EJB EJB EJB PersistenceManager EJB Invocation Interception EJB Container ComponentMonitor Interceptors Call Management Persistence Management ADAPT Bologna meeting, Dec. 2003
EJB EJB EJB PersistenceManager EJB Persistence Invocation Interception EJB Container Interceptors ADAPT Bologna meeting, Dec. 2003
EJB EJB EJB PersistenceManager EJB Persistence Invocation Interception EJB Container Component Monitor Interceptors Call Management Wrapper Persistence Management ADAPT Bologna meeting, Dec. 2003
Axis web service objects • Implement a web service (port type) • WSDL2Java tool • Generates Java interface from WSDL definition • Developer creates object as implementation of interface • Deployed in Axis configuration file • “Scope”: instance per request, per client session, or per server • Request scope is stateless, others stateful ADAPT Bologna meeting, Dec. 2003
Web service implementation of API • ComponentHandle • Service name • Session ID (when session scope) • We generate this • State transmission • Serialized form of web service object • Automatic translation of EJB references • When deserialized, new object replaces old ADAPT Bologna meeting, Dec. 2003
Handlers in Axis Service Object handleRequest() handleRequest() HTTP handleResponse() handleResponse() • Handler model defined by Sun (JAX-RPC) ADAPT Bologna meeting, Dec. 2003
Component Interception ComponentMonitor ComponentHandle call() call() Proxy “Normal” Axis chain Handlers disabled static call() TxHandler WSMon Handler Service Object handleRequest() handleRequest() handleResponse() handleResponse() AXIS ADAPT Bologna meeting, Dec. 2003
Transactions Container EJB Persistence Manager begin, commit Read, Write prepare, commit, rollback DataSource (XAResource) Transaction Manager ADAPT Bologna meeting, Dec. 2003
Transactions Container EJB Persistence Manager begin, commit Read, Write Transaction Interceptor prepare, commit, rollback begin, commit DataSource (XAResource) Transaction Manager ADAPT Bologna meeting, Dec. 2003
Transactions Container EJB Persistence Manager begin, commit Read, Write prepare, commit, rollback Transaction Interceptor DataSource (XAResource) ADAPT Bologna meeting, Dec. 2003
Component Monitor Component Monitor ContainerSupport Container Support Remote Deployment (Farming) ADAPT Bologna meeting, Dec. 2003
Component Monitor Component Monitor Container Support Container Support Remote Deployment (Farming) Notification ADAPT Bologna meeting, Dec. 2003
Component Monitor Component Monitor Container Support Container Support Remote Deployment (Farming) Transmission ADAPT Bologna meeting, Dec. 2003
Component Monitor Component Monitor Container Support Container Support Remote Deployment (Farming) Deployment ADAPT Bologna meeting, Dec. 2003
Open issues I: Persistence • Persistent creation vs. instantiation of existing object • Requires clarification in API • So far, test applications based on entity beans, CMP • BMP should be equivalent • ejbStore() and ejbLoad() have same timing, semantics • In practice, developers don’t rely entirely on entity beans • Considered inefficient ADAPT Bologna meeting, Dec. 2003
Persistence through SFSBs • Consider stateful session bean that accesses DB • Each method invocation may read and modify DB as well as bean state • Replication algorithm should wait till commit before synchronizing state on other replicas • Bean should not access other state outside beans, DB • Standard development guideline • With these cautions, we believe mechanism is adequate ADAPT Bologna meeting, Dec. 2003
ComponentMonitor Stub Open issues II: Client-side invocation Cluster 1 ComponentMonitor Stub ComponentMonitor ComponentMonitor Cluster 2 ADAPT Bologna meeting, Dec. 2003
What stub could do • Select target host for invocation • Select means of communication • Group communication instead of RMI • Add information to request and response • Session ID • List of alternate hosts • Applies to J2EE invocation more than web services • Stub code is downloaded from server ADAPT Bologna meeting, Dec. 2003
Open Issues III: Message-Driven Beans • Natural base for asynchronous service implementation • Stateless component with one method • void onMessage(javax.jms.Message) • Variant of existing invocation model • Response is posted to a JMS Session (not return value from invocation) ADAPT Bologna meeting, Dec. 2003
Summary • API has stabilized • Some loose ends to be tied up • Core methods work correctly • Demonstrated in “toy” replication algorithms • Replication algorithm development can begin ADAPT Bologna meeting, Dec. 2003