Dynamic Adaptability of Services in Enterprise JavaBeans Architecture



Similar documents
Software Engineering. Software Engineering. Component-Based. Based on Software Engineering, 7 th Edition by Ian Sommerville

Component Middleware. Sophie Chabridon. INT - INF Department - Distributed Systems team 2006

Service Oriented Architecture

A Framework for Automatic Performance Monitoring, Analysis and Optimisation of Component Based Software Systems

Service-Oriented Architectures

The Service Revolution software engineering without programming languages

A Flexible Security Architecture for the EJB Framework

The EMSX Platform. A Modular, Scalable, Efficient, Adaptable Platform to Manage Multi-technology Networks. A White Paper.

Chapter 4. Architecture. Table of Contents. J2EE Technology Application Servers. Application Models

A Scalability Model for Managing Distributed-organized Internet Services

Distributed Objects and Components

zen Platform technical white paper

Core J2EE Patterns, Frameworks and Micro Architectures

Software Development Kit

Transparent Resource Management and Self-Adaptability Using Multitasking Virtual Machine RM API

What Is the Java TM 2 Platform, Enterprise Edition?

A standards-based approach to application integration

Methods and tools for data and software integration Enterprise Service Bus

Managing Variability in Software Architectures 1 Felix Bachmann*

Java Technology in the Design and Implementation of Web Applications

Java EE 7: Back-End Server Application Development

ObjectWeb. An Introduction

Stock Trader System. Architecture Description

SERVICE ORIENTED ARCHITECTURE

Structuring Product-lines: A Layered Architectural Style

Challenges and Opportunities for formal specifications in Service Oriented Architectures

25 May Code 3C3 Peeling the Layers of the 'Performance Onion John Murphy, Andrew Lee and Liam Murphy

New Methods for Performance Monitoring of J2EE Application Servers

Service-Oriented Computing: Service Foundations

Integrated Development of Distributed Real-Time Applications with Asynchronous Communication

Explicit Connectors in Component Based Software Engineering for Distributed Embedded Systems. Dietmar Schreiner and Karl M.

Case Studies of Running the Platform. NetBeans UML Servlet JSP GlassFish EJB

Contents. Client-server and multi-tier architectures. The Java 2 Enterprise Edition (J2EE) platform

Introduction to Web Services

Business-Driven Software Engineering Lecture 3 Foundations of Processes

Oracle Application Development Framework Overview

What is Middleware? Software that functions as a conversion or translation layer. It is also a consolidator and integrator.

Introduction to Service Oriented Architectures (SOA)

Motivation Definitions EAI Architectures Elements Integration Technologies. Part I. EAI: Foundations, Concepts, and Architectures

Web Application Architectures

Applying 4+1 View Architecture with UML 2. White Paper

Web Service Authorization Framework

Real Time Programming: Concepts

Chapter 6. CORBA-based Architecture. 6.1 Introduction to CORBA 6.2 CORBA-IDL 6.3 Designing CORBA Systems 6.4 Implementing CORBA Applications

Outline SOA. Properties of SOA. Service 2/19/2016. Definitions. Comparison of component technologies. Definitions Component technologies

CHAPTER THREE, Network Services Management Framework

Service-Oriented Architecture: Performance Issues and Approaches

2 (18) - SOFTWARE ARCHITECTURE Service Oriented Architecture - Sven Arne Andreasson - Computer Science and Engineering.

Service Oriented Architectures

Java 2 Platform, Enterprise Edition (J2EE) Bruno Souza Java Technologist, Sun Microsystems, Inc.

What is ODBC? Database Connectivity ODBC, JDBC and SQLJ. ODBC Architecture. More on ODBC. JDBC vs ODBC. What is JDBC?

Enterprise Service Bus

Lesson 18 Web Services and. Service Oriented Architectures

Increasing IT flexibility with IBM WebSphere ESB software.

1 What Are Web Services?

Excerpts from Chapter 4, Architectural Modeling -- UML for Mere Mortals by Eric J. Naiburg and Robert A. Maksimchuk

EJB & J2EE. Component Technology with thanks to Jim Dowling. Components. Problems with Previous Paradigms. What EJB Accomplishes

Efficient Monitoring of OSGi Applications

OUR COURSES 19 November All prices are per person in Swedish Krona. Solid Beans AB Kungsgatan Göteborg Sweden

CHAPTER 2 MODELLING FOR DISTRIBUTED NETWORK SYSTEMS: THE CLIENT- SERVER MODEL

How To Guarantee A Service In A Distributed Real Time System

CONDIS. IT Service Management and CMDB

Design Patterns. Design patterns are known solutions for common problems. Design patterns give us a system of names and ideas for common problems.

Japan Communication India Skill Development Center

A Pluggable Security Framework for Message Oriented Middleware

Event-based middleware services

Integration of Application Business Logic and Business Rules with DSL and AOP

Service Governance and Virtualization For SOA

Service Oriented Architecture (SOA) Architecture, Governance, Standards and Technologies

Systems Integration: Co C mp m onent- t bas a e s d s o s ftw ft a w r a e r e ngin i eeri r n i g

Service-Oriented Architecture and Software Engineering

COMP5426 Parallel and Distributed Computing. Distributed Systems: Client/Server and Clusters

1 What Are Web Services?

Pattern-based J2EE Application Deployment with Cost Analysis

Service Oriented Architecture

Generating Aspect Code from UML Models

GenericServ, a Generic Server for Web Application Development

ARCHITECTURAL DESIGN OF MODERN WEB APPLICATIONS

Implementing Java Distributed Objects with JDBC

Deploying QoS sensitive services in OSGi enabled home networks based on UPnP

How To Create A C++ Web Service

How To Protect Your Computer From Being Hacked On A J2Ee Application (J2Ee) On A Pc Or Macbook Or Macintosh (Jvee) On An Ipo (J 2Ee) (Jpe) On Pc Or

CACHÉ: FLEXIBLE, HIGH-PERFORMANCE PERSISTENCE FOR JAVA APPLICATIONS

An introduction to creating JSF applications in Rational Application Developer Version 8.0

Overview of CORBA 11.1 I NTRODUCTION TO CORBA Object services 11.5 New features in CORBA Summary

A Unified Messaging-Based Architectural Pattern for Building Scalable Enterprise Service Bus

Service Design Essentials

Middleware support for the Internet of Things

On-Demand Business Process Integration Based on Intelligent Web Services

Globule: a Platform for Self-Replicating Web Documents

Service Oriented Architecture 1 COMPILED BY BJ

Di 6.1a. Warum naive SOA scheitert Ein Erfahrungsbericht. Adam Bien. January 26-30, 2009, Munich, Germany ICM - International Congress Centre Munich

emontage: An Architecture for Rapid Integration of Situational Awareness Data at the Edge

A Thread Monitoring System for Multithreaded Java Programs

Software Service Engineering Architect s Dream or Developer s Nightmare?

Architectural Decisions as Service Realization Methodology in Model-Driven SOA Construction

Service Computing: Basics Monica Scannapieco

JSLEE and SIP-Servlets Interoperability with Mobicents Communication Platform

A Software Architecture to Facilitate the creation of DRM Systems

The Java Series. Java Essentials I What is Java? Basic Language Constructs. Java Essentials I. What is Java?. Basic Language Constructs Slide 1

Transcription:

1. Introduction Dynamic Adaptability of Services in Enterprise JavaBeans Architecture Zahi Jarir *, Pierre-Charles David **, Thomas Ledoux ** zahijarir@ucam.ac.ma, {pcdavid, ledoux}@emn.fr (*) Faculté des Sciences Semlalia, Département Informatique, BP 2390, Marrakech, Morocco (**) École des Mines de Nantes, 4, rue Alfred Kastler, BP 20722 44307 Nantes Cedex 3-France Abstract To be in harmony with continuous variations of the execution environment such as fluctuating network bandwidth, decreasing battery power, and so on, new approaches are required for component-based middleware to make them adaptable with regard to these changes. The aim of the work presented in this paper is to enhance the EJB architecture by allowing applications to be aware of, and adapt to, variations in the execution context. We propose to dynamically adapt the association between EJB components and middleware services when necessary. Thus, EJB applications have the advantage to be dynamically adaptive according to changes related to their execution context. Keywords : Adaptable Middleware, EJB architecture, Dynamic Adaptability of Services, Dynamic Reconfiguration. One of the major challenges faced by component-based middleware is the ability to dynamically adapt to many execution environment evolutions, from the change of execution platform (PDA, portable computer, etc.) to the run-time variations of availability of certain resources such as CPU, memory, communication capacities, etc. Using a separation of concerns approach to component-based middleware development allows to distinguish functional code from non-functional code, representing middleware services. Then, it should possible to reconfigure the associations between these two kinds of code: that is which piece of functional code is affected (and how it is affected) by nonfunctional services. When these reconfigurations are guided by the evolutions of the execution environment, the resulting system can be said to be dynamically adaptive. In the case of EJB environment, configuration between components and middleware services is only supported at deployment-time using a declarative deployment descriptor [1]. In this paper, we present an experiment which shows how the EJB architecture can be extended to allow reconfigurations to be performed at run-time. To introduce run-time adaptability in an EJB environment, we have reused an infrastructure for adaptable middleware developed in a previous work [2], and which relied originally on a MetaObject Protocol instead of a component model like the EJB model. The rest of this paper is organized as follow. In Section 2, we give an overview of the existing infrastructure for adaptable middleware. In Section 3, we propose an adaptable EJB server by incorporating the main features of this infrastructure in the JOnAS EJB implementation. Finally, we conclude the paper in Section 4. This research is supported by the RNTL project ARCAD (http://arcad.essi.fr) 1

2. An Infrastructure for Adaptable Middleware To ensure an advanced adaptability of component-based applications regarding changes of the environment, we have chosen to focus on the middleware layer. Because applications built on top of the middleware rely on it for all their interactions with the environment, adapting the middleware allows us to indirectly adapt applications. To do this, we developed an infrastructure for adaptable middleware [2] (cf. Figure 1). This infrastructure considers that the application (the right side of the figure) is split in two parts: functional components (i.e. business objects) and non-functional services (corresponding to the middleware layer). The possible reconfigurations of the application consist in modifying the associations between these two parts with a very fine granularity (each component can be adapted independently). These reconfigurations are performed by a generic adaptation engine, which is configured for each application by adaptation policies described below. Finally, the modifications are initiated by the engine when significant evolutions of the environment are detected by a simple monitoring framework, consisting of a collection of probes (CPU usage, battery life, bandwidth measure ). Adaptation policies themselves are split in two parts: - System policies, consisting in sets of rules of the form condition action, where the condition is relative to the execution environment (as reified by the monitoring framework), and the action is either the attachment or detachment of a specific services, possibly with configuration parameters. These policies are relatively independent of a given application, and could be written by system administrators for example. - Application policies, which defines groups of functional components according to their runtime properties (class of an object, value of a field ), and binds existing system policies to these groups. These policies must be written with a good knowledge of the semantics of the application (for example by the application programmer himself). Adaptation Policies Non-functional Services Adaptation Engine Functional Components Probes Physical Resources Figure 1 An Infrastructure for middleware adaptation. Figure 2 shows a simple example of each kind of policies, which are interpreted at run-time by the adaptation engine. 2

<system-policy name="tracer"> System.xml <rule> <when> <less-than> <property-value name="/system/network.bandwidth"/> <number value="40000"/> </less-than> </when> <ensure> <attached service="logservice" role="main"/> </ensure> </rule> </system-policy> <application-policy> Application.xml <group name="logged-components"> <select from="all"> <or> <equals> <property-value name="classname"/> <string value="account"/> </equals> <equals> <property-value name="classname"/> <string value="accountwithinterests"/> </equals> </or> </select> <bind policy="tracer"/> </group> </application-policy> Figure 2 Examples of a system and application policies code. The file System.xml provides a system policy called tracer which consists of one rule that ensures to attach a service named logservice - to a specific group described in an application policy - if and only if the network bandwidth is less than 40000 bps. This policy can be reused in different applications. The application policy (cf. the file Application.xml), defines one group named "logged-components" that contains all objects of both Account and AccountWithInterests classes and binds to this group the system policy tracer. All these objects will be adapted in the same way. The original implementation of this infrastructure used the reflective features of a MetaObject Protocol named RAM (Reflection for Adaptable Mobility) [3], identifying base-level objects with functional components and meta-level objects with non-functional services. However, most of our infrastructure (the left side of Figure 1) is completely independent of these implementation decisions, and relies only on very generic notions of components and services which makes it reusable in other context, an EJB server for example. Thus, thanks to the loose coupling between the different entities of our infrastructure and the particular role played by an EJB container between middleware services and EJB components (see below), we decided to replace the RAM Meta-Objects by the EJB container and reuse the monitoring framework and the decision module based on adaptation policies in order to provide dynamic adaptability of services in an EJB architecture. 3. Towards an Adaptable EJB Server The focus of this section is on the setting up of the adaptable EJB server using the infrastructure presented in section 2. To implement this adaptable EJB server, we have used the Evidian implementation of EJB specifications named JOnAS (Java Open Application Server) [4] which is part of the ObjectWeb Open Source initiative [5]. In order to validate this adaptable EJB server, we used home-made services (for example, trace or asynchronous communication with transparent futures) rather than JOnAS predefined services, which were 3

not implemented in a modular enough way to make them reusable for our purpose. The following subsections illustrate this implementation. 3.1. Our Approach The EJB container is the runtime environment in which enterprise bean instances can live and execute. The enterprise bean typically contain the business logic ( functional code ) for an EJB application. The associated EJB container is responsible to inject transparently services defined by the enterprise bean s deployment descriptors such as declarative transaction management, security, persistence, concurrency, and state management. Client access is mediated by the EJB container in which the enterprise bean is deployed. This layer of indirection manifests itself as an interposition object called the EJB Object. Because the EJB container is an intermediary between EJB components and the outside world [1], we have decided to delegate the task of dynamic composition of services at this level. However, containers are generated statically using the information provided by the beans deployment descriptors, which mean that we can not modify associations between beans and services at run-time without modifying these containers. Thanks to GenIC (Generate Interposition Classes) tool offered in open source by JOnAS and allowing to generate container code, the setting up of this implementation is proved possible. 3.2. Extending the EJB Container for Adaptation In order to respect EJB container specification, we have introduced an indirection from EJB Object towards another object, called DynamicComposite. DynamicComposite object will be responsible for playing the role of dynamic composer of EJB services. In the standard process to develop an application for the JOnAS EJB platform, the application developer, once his beans are written, creates two XML deployment descriptors: the standard ejb-jar.xml common to every EJB implementation, and a JOnAS-specific jonas-ejbjar.xml. These files are then read by the GenIC tool to generate the corresponding container code. Because the indirection we want to introduce is not required for every bean and because of the negative impact it can have on performance, we wanted the developer to identify explicitly which of his beans would be dynamically adaptable. To this end, we introduced a new XML tag in the jonas-ejb-jar.xml file with the following syntax: <DynamicComposite>true or false</dynamiccomposite>. When this tag is present and set to true, it means that the corresponding bean will benefit from our dynamic adaptation service. To take this new tag into account, we had to modify the GenIC tool to generate the correct indirection on every business method call on the adaptable beans. Normally, when a EJB container intercepts a business method call it forwards the message to its managed bean (in addition to the execution of the statically required services). With our modification, the message is sent instead to a DynamicComposite object associated to the container. As its name implies, this object is able to compose dynamically attached or detached home-made services before or after finally sending the message to the bean. The following example shows a (simplified) fragment of code from an EJB container (the class JonasOpRemote representing the EJB Object in JonAS) with dynamic adaptation enabled. The commented line shows the code that would have been generated if it had been disabled, or by the non-modified GenIC tool. public synchronized void buy(int p1) throws RemoteException { sb.opbean eb = (sb.opbean) ctx.getinstance(); // eb.buy(p1); // Original code Object[] args = new Object[]{ new Integer(p1) }; Class[] types = new Class[]{ Integer.TYPE } Method meth = eb.getclass().getmethod("buy", types); dynamiccomposite.execute(eb, meth, args); } 4

3.3. Setting up a Dynamic Adaptation Service within the JOnAS Server Now that we have introduced an indirection into the EJB containers, this subsection describes how we connected the DynamicComposite object to our existing adaptation infrastructure presented before. Fortunately, JOnAS is written in a relatively modular way and makes it possible to add new services in addition to those defined in the EJB specification. Thus, we created a new JOnAS service, called DynamicAdaptation, which plays the role of a meta-service and which encapsulates our existing infrastructure (the adaptation engine and monitoring framework, see Fig. 1) as shown in Figure 3. On startup, the JOnAS server initializes all the services it is aware of, including the DynamicAdaptation one. It is during this initialization that the adaptation policies are loaded and the adaptation engine started up. A final step is then required to close the loop by making the adaptation engine aware of the beans and their DynamicComposite object. First, a simple Adapter design pattern [6] has been developed to allow the adaptation engine to deal with DynamicComposite and the services it composes. Then, GenIC was again used to modify the constructors of EJB containers so that they instanciate a DynamicComposite and register it into the adaptation engine, through the DynamicAdaptation service: public JOnASOpRemote(JSessionHome home) throws RemoteException { super(home, true); dynamiccomposite = new DynamicComposite( sb.opbean ); ServiceManager sm = ServiceManager.getInstance(); dynadapt = (DynamicAdaptation) sm.getservice("dynamicadaptation"); dynadapt.registerdynamiccomposite( sb.opbean, dynamiccomposite); } EJB Server DynamicComposite Home Object EJB Object EJB Container Enterprise Java Bean System.xml Application.xml Dynamic Adaptation Home Service 1 Home Service 2 Transaction Database Services 3.4. Usage Physical Resources Figure 3 An adaptable EJB architecture. From the application developer s point of view, the resulting systems is used in much the same way as the original JOnAS. After having developed the beans normally and written the standard deployment descriptors, the programmer must decide which beans will require dynamic adaptation, and for those (and only those), add a DynamicComposite tag (with a true value to the jonas-ejb-jar.xml file), and then normally run the GenIC tool to generate the container classes. At this point, and even without any adaptation policy defined, 5

the application is ready to run in the exact same way as in the original JOnAS setup (except for the slowdown due to the unused indirection). To use the full power of our infrastructure, the programmer must write (or reuse) system and application adaptation policies that will be loaded by the DynamicAdaptation service who knows where to find them. When the adaptation engine is started during the server initialization, it loads the provided policies, and sets up the monitoring framework to listen to the environmental conditions specified in system policies. Once this is done, the engine enters in a passive state, where it waits to be notified of environment changes by the monitoring framework (which runs asynchronously). 4. Conclusion and Perspectives In response to the changes of the execution environment, component-based applications have to be dynamically adaptive. To attain this objective in the context of EJB environment, this paper presents an implementation of an adaptable EJB architecture based on JOnAS by integrating the main features of an existing infrastructure for adaptable middleware. This adaptable EJB architecture consists in modifying at run-time and with a fine granularity the association between EJB and middleware services. Therefore EJB applications will have the advantage to be adaptive towards any significant evolutions of the environment changes. As mentioned previously, this architecture have been validated using home-made services. The next logical step would be to replace these home-made services by the standard EJB services. However, this is probably not possible without breaking the EJB model. First, the use of JOnAS predefined services will confront us to the complex nature of their composition. Then, the different kinds of beans provided by the EJB specification (entity, session) correspond to predefined configurations of non-functional services, which must be defined at deployment time and can not be modified. If the EJB model does not evolve towards more dynamicity, the only run-time adaptations it allow would concern services outside its scope. 5. References [1] Linda G. DeMichiel, L. Ümit Yalçinalp Sanjeev Krishnan, Enterprise JavaBeans Specification, Version 2.0, Final Release, Sun Microsystems, August 2001. [2] Pierre-Charles David and Thomas Ledoux An Infrastructure for Adaptable Middleware, submitted paper to the Third International Workshop on Software Engineering and Middleware (SEM 2002), ICSE 2002 Co-Located Events. [3] N. M. N Bouraqadi-Saâdani, T. Ledoux and M. Südholt A Reflective Infrastructure for Coarse-Grained Strong Mobility and its Tool-Based Implementation, Invited presentation at the International Workshop on ``Experiences with Reflective Systems'' (held in conjunction with Reflection 2001). [4] JOnAS, http://www.evidian.com/jonas. [5] ObjectWeb consortium, http://www.objectweb.org. [6] E. Gamma, R. Helm, R. Johnson, J. Vlissides Design Patterns, Addison-Wesley Reading, Massachusetts, 1995. 6