CHAPTER 8 NOTE TO READER:

Size: px
Start display at page:

Download "CHAPTER 8 NOTE TO READER:"

Transcription

1 Chap8 Page 602 Thursday, December 9, :50 PM CHAPTER 8 Servlets 604 The Enterprise JavaBeans Framework 613 Java 2 Enterprise Edition 650 Electronic Commerce Server Applications 651 Scaling Multitier Java Applications 654 NOTE TO READER: This chapter is a modified version of the chapter that appears in the book. It has been shortened for placement on the Web site. In instances where text has been removed, brackets and ellipses appear [...]. Also note that figures and page numbers may not be the same as those in the actual book chapter.

2 Chap8 Page 603 Thursday, December 9, :50 PM Server Frameworks and Architectures When Java debuted in 1995, its primary deployment platform was web browsers. Netscape s agreement to embed a Java VM in its version 2.0 browser was a public relations coup for Sun, and provided it with a means to make Java ubiquitous very quickly. A consequence, however, was a perception among programmers and the user community that Java was a client language, and that its main use was for developing user interfaces. If you are reading this book you probably know how inaccurate that picture is. One of Java s great benefits is the ability to develop platform-independent business logic and infrastructure. Yet, for the first two years of Java s existence, there was no universally accepted or robust way of deploying Java applications on servers. This was not due to a lack of support for server protocols. Sun has provided support in the standard Java packages for many Internet communication protocols from early on, and added RMI with Java 1.1. The problem was that there was no accepted standard framework for running Java applications on a server. CORBA provided such a framework, but not all organizations were willing to embrace CORBA just because they were considering Java. Further, Java CORBA implementations had many non-standard features, and suffered from a lack of compatibility. The Enterprise JavaBeans (EJB) specification finally provided the needed framework for deploying Java server applications. An application server supporting EJB can run Java application components and link them together to allow the creation of distributed server applications. Perhaps the most important result of this for Java acceptance was the fact that EJB-compliant application servers removed 603

3 Chap8 Page 604 Thursday, December 9, :50 PM 604 Advanced Java 2 Development for Enterprise Applications the issue of how to install Java on a server. Organizations no longer had to evaluate and choose a Java platform and figure out how to set it up if they wanted to build a server application. Instead, they could evaluate EJB products, which are backed by commercial support and documentation. The issue of Java on the server became moot, and selecting a Java server platform became no more controversial than selecting any other infrastructure product. When this book first appeared, it was the first book to discuss the EJB APIs. At that time, there were only a handful of fledgling products supporting EJB. Since then there has been a remarkable proliferation of Java application servers, nearly all supporting EJB. There are currently around forty such products. This range of choices has given the Java user community a rich set of options, and has greatly accelerated the adoption of Java for enterprise applications. In early 1998, Java server applications were rare, and were executed mainly by more adventurous developers. Today, Java is clearly the way to go for developing open protocol distributed applications on TCP networks. EJB is not the only deployment framework for server side Java. CORBA remains a viable Java server platform, and overlaps EJB in many areas. I will not go further into the CORBA APIs than I already have since there are many good books on that subject. The Java servlet API is another extremely important standard and is supported by many web servers, especially those which come bundled with application servers. The servlet API provides a very convenient and secure framework for creating web server extension programs which can serve dynamically generated HTML, and also can access other network servers such as databases and application servers. Servlets also provide a convenient and comparatively safe gateway for firewalls. Servlets are often used as a web-accessible front end to an EJB back end. The servlet framework includes a facility called JavaServer Pages (JSP), which allows developers to closely couple the specification of generated web content with the business rules for generating that content. This chapter explains the leading server side frameworks for Java application deployment, including servlets, JavaServer Pages, and EJB. At the end, I will try to pull all this together and discuss value-added features of current commercial frameworks and also show how these products can be used to create entire enterprise information systems. Servlets A servlet is a Java-based web server extension program. It is the Java equivalent of native web server extension technologies, such as Microsoft s ISAPI and ASP and Netscape s NSAPI. The main differences are that [...]

4 Chap8 Page 605 Thursday, December 9, :50 PM Chapter 8 Server Frameworks and Architectures 605 Security Security is no small consideration with any kind of server extension or dynamically invoked program through a web server. CGI is an enormous security hole for administrators, especially ISPs, so much so that many ISPs prohibit CGI programs. [...] Servlets as Gateways to Application Servers Servlets have become an important adjunct to application servers by providing a web-traversible gateway. Many products extend application server features including security, transaction management, and load balancing to the servlet engine, thereby allowing servlets to become the universal gateway to these services. For example, a servlet can authenticate a user and begin a transaction, and have both the user identity and transaction context propagate to the application server when remote Enterprise JavaBeans calls are made. Load balancing of EJB objects can also be provided by servlet modules used to obtain initial references to EJB objects. Load balancing of the servlets themselves can be provided using standard web load balancing techniques, including DNS-based load balancing. Later in this chapter I will discuss these integration issues more fully. For now, let s look at the servlet APIs up close. Invoking a Servlet There are three ways to invoke a servlet.[...] The Servlet Programming Interface You can either extend the abstract class HttpServlet, or implement the Servlet interface directly. You might choose to do the latter if your servlet needs to extend some other class for some reason. The Servlet interface methods are: [...] destroy() In this method you should release all servlet object resources (close database connections, etc.). This is also your last chance to write or commit persistent data, or make final log entries. Example: The Customer Manager Servlet I will demonstrate writing a servlet with a complete example, a small application which has two personalities: a servlet personality, and an RMI server personality. The servlet serves the function of letting web-based users query for information on a customer, and the RMI service allows an administrator to obtain more complete information and update the database. The administrator s user interface is shown in Figure 8-2.[...]

5 Chap8 Page 606 Thursday, December 9, :50 PM 606 Advanced Java 2 Development for Enterprise Applications Testing and Deployment [...] Retrieving GET and POST Data It is a little bit unfortunate but not unbearably inconvenient that the API you use to retrieve query parameters supplied with a GET request is different from the API you use to retrieve POST form parameters. Therefore, an HttpServlet must first determine if the data originates from a GET query or a POST. You can determine this using the HttpServletRequest.getMethod() call, which returns a string indicating the HTTP request method (i.e., GET or POST ). Once you know this, you can call the getquerystring() method for a GET request or the getinput- Stream() method for a POST request, and then call an appropriate parsing method which is again specific to the request method. For example, this code snippet produces a hashtable containing the request data: public void service(httpservletrequest req, HttpServletResponse res) throws ServletException, IOException { // Get the input data int len = req.getcontentlength(); ServletInputStream sis = null; Hashtable data = null; String method = req.getmethod(); if (method.equals("get")) { String q = req.getquerystring(); data = HttpUtils.parseQueryString(q); } else if (method.equals("post")) { sis = req.getinputstream(); data = HttpUtils.parsePostData(len, sis); } if (data == null) System.out.println("data is null"); Multipart POST Content. It is very unfortunate that at the present time, multipart content is not directly supported by the servlet API. If your application needs to supply multipart content to the servlet, you cannot use the parsepostdata() method and you must implement your own routines for parsing the raw posted multipart stream. Multipart content is quite common in many applications. For example, when an HTML form contains an input tag with type="file", the form tag usually specifies enctype="multipart/form-data" causing the form data and the

6 Chap8 Page 607 Thursday, December 9, :50 PM Chapter 8 Server Frameworks and Architectures 607 attached file to be sent as a multipart stream. This feature permits the use of web pages which allow the user to select a file for upload. The uploaded file is posted as one part of the multipart stream, and the form data itself is posted as the first part. Writing the code to handle multipart content is not hard, but it would be nice if the standard API handled it. Redirection. A servlet can respond to a web client with a location reply, which will cause a browser to redirect itself to the specified location. This is accomplished with the HttpServletResponse.sendRedirect(String url) method. The argument to this method must be an absolute URL. Class Loader Issues Like any Java component environment, a servlet server should generally separate one servlet from another by running it with its own class loader. However, the specification does not require it and many servers (including the Java Web Server 2.0) do not. Therefore it is a good idea not to set properties or use non-final static objects or data in a servlet. The Servlet 2.2 specification, which is still in draft form at this writing, states that servlets should be well-behaved with regard to separation from other servlets, although it does not address class loaders specifically and leaves the implementation up to the server provider. Apparently some server vendors felt that defining the behavior in terms of class loaders was too implementation specific, since some vendors may cache classes across VMs and use other means of keeping session data separate. The exact semantics of session separation is therefore a little bit unclear at this time, but it is likely that servers compliant with Servlet 2.2 will provide the separation between servlets that is needed. State Management HTTP is a stateless protocol, but defines a mechanism called cookies for maintaining state on a client in a way which can be retrieved by a server. There are other techniques which are commonly used, including encoding session state as query parameters in relocation URLs and in URLs that are embedded in content sent back to the client. The HttpSession type is an abstraction of client session persistence. HttpSession abstracts client state so that the servlet does not have to worry which client session persistence technique is used. A cookie is just a set of data, defined by a server, which is stored in the user s browser (if the user so permits). Any data can be stored in a cookie, but usually it is minimal and compact, and only enough to correlate the user with previous transactions the user has performed, and possibly containing user preferences as well. For example, a server might store in your browser a cookie containing a

7 Chap8 Page 608 Thursday, December 9, :50 PM 608 Advanced Java 2 Development for Enterprise Applications unique session ID (which the server creates for you), so that it can keep track of what requests you perform over time. Cookies usually expire, so this state does not persist forever. A cookie may also be set to terminate when the user exists the browser. The user can set whether they want any server to read a cookie, or only the server that set it otherwise, any web site could examine your cookies to tell what other web sites you had visited recently. Cookies do not impact the HTML content or URLs sent back to the browser, and therefore are preferred for maintaining client state. To get the current session, use the Servlet getsession(boolean create) method with an argument of true. This will create a session between your servlet and the user s browser, if one does not already exist, and return the new or preexisting session to you. Most implementations will attempt to use cookies for maintaining session state, and if that fails, use URL encoding. Some servers allow you to specify which technique to use by setting a property or other means. You can associate data with a session by using the HttpServletRequest.getSession(true) to get the session, and then HttpSession.putValue(String name, Object value) to set a value and the HttpSession.getValue(String name) method to retrieve a session value. Also, to ensure that session state is maintained regardless of the session mechanism used, you should call the getsession() method each time the servlet is invoked; otherwise, session state may be lost if URL encoding is being used. The actual session data that the session management system stores in a cookie or encodes in URLs is small, and is typically a session ID of some kind. In general, your servlet should be written to assume that URL encoding is the mechanism used for maintaining session state. In fact, when a browser first invokes a servlet, URL encoding may be used to get the session going and then switch to using cookies. To allow URL encoding to work, you should never manually write URL strings to the output stream for receipt by the browser or for embedding in a web page. Instead, you should pass all written URLs through the encodeurl(string) method to allow the session management system to add any state information it needs. When performing redirects, you should also pass a redirect URL through the encoderedirecturl(string) method. Session objects are stored on the server. Therefore, the session state may be local to the VM maintaining the session. If clustering is provided by the web server, the server must either guarantee that a client session will remain with a particular server during the session s lifetime, or the session object must be made available to the other servers in the cluster. Clustering is usually supported by some kind of

8 Chap8 Page 609 Thursday, December 9, :50 PM Chapter 8 Server Frameworks and Architectures 609 Note The encodeurl(string) and encoderedirecturl(string) methods replace the similarly named methods encodeurl(string) and encoderedirecturl(string) from earlier releases of the Servlet API. distributed session state management facility, which may even be persistent, allowing for long-term sessions. In designing an application s session state, you need to decide if that information needs to be persistent and durable across system restarts, and if it needs to be transactional. It is a good idea to distinguish clearly between session data and persistent application data, since the latter represents true business data and usually needs to be transactional and durable. Any data which needs to be reliably available across server restarts should probably be incorporated into the application data model explicitly rather than treated as session data. Session data is inherently transient. In fact, a session can go away unpredictably simply by a cookie expiring. Servlet session objects will be reclaimed when the session expires. When Session State Is Large [...] User-Specific Profiles and Authentication If you want to provide user-specific profiles for your application, then you need to have users first log in, and then associate their session with their login profile. To do this, you should first check if the user s session is new, and if it is, redirect them to a login page where they log in, and then store in a database an association between their login ID and their current session. For example, this code checks if the session is new, and if so redirects them to a login page: HttpSession session = request.getsession(true); if (session.isnew()) { response.sendredirect( } else { // Session is preexisting; get its ID and apply profile // based on that. }

9 Chap8 Page 610 Thursday, December 9, :50 PM 610 Advanced Java 2 Development for Enterprise Applications At the login URL, make them provide a user ID and password in a form, which you can retrieve with the parsepostdata() method discussed above. Then call getid() on the session, and store the session ID for later use, and redirect the user back to where they just came from. Note that if your application requires that users log in again after a period of inactivity, you will have to include this in your logic, since isnew() will only return true if there is no session state; if session state is retrieved via a cookie, it will return false. The isnew() method also continues to return false if a session cannot be established for any reason. Alternatively, you can make use of standard HTTP authentication provided by the web server. If the user is authenticated, you can obtain the user ID by calling HttpServletRequest.getRemoteUser(). You should make the call at the entry point to the web site. If you need to make it at more than one point, you can still use the isnew() method to determine if the user has just connected and therefore if you should obtain the user ID. Here is an example of using web authentication to obtain the user ID: HttpSession session = request.getsession(true); if (session.isnew()) { String user = request.getremoteuser(); if (user == null) throw new Exception( Should not happen ); // Set session state to include the user.... } The Servlet 2.2 specification (available as a pre-release draft only at this writing, and so this is subject to change) adds the methods getremoteuserprincipal() and isremoteuserinrole(), analogous to methods of the same name defined in the EJB 1.1 specification. While the getremoteuser() method returns the user ID provided by the user, the getremoteuserprincipal() returns the authenticated Principal which the server identified to correspond to the remote user. Servlet 2.2 compliant servlet engines should unify authentication mechanisms and the getremoteuserprincipal() should always return the user authenticated identity (principal) regardless of how the user is authenticated to the servlet server. For example, if basic authentication (password provided to the browser) is used, the getremoteuserprincipal() method should return the user s Principal, and if certificate-based authentication is used via a user certificate and private key, the getremoteuser() method should also return the user s Principal. Pre-2.2 servers may not be able to return the user ID if certificate-based authentication is

10 Chap8 Page 611 Thursday, December 9, :50 PM Chapter 8 Server Frameworks and Architectures 611 used; instead a different method must be used to obtain the user identity, as shown below. You should give some thought to how secure you want the session to be. For example, instead of using a password, you could install the servlet on a secure web server and use SSL, and require users to install a personal digital certificate in their browser. In pre-servlet 2.2 (and pre-java 2) servers, a technique supported by some servers for obtaining the user s SSL identity was by getting the attribute javax.net.ssl.peer_certificates with the ServletRequest getattribute() method, which would return an array of javax.security.cert.x509certificate (with the user s certificate first), and could then get the distinguished name of the certificate owner by calling getsubjectdn(). Here is an example: [...] Basic web authentication works by having the web client (browser) send an authorization header to the server. If an authorization header is required but was not sent, the server returns an authorization error, and the browser then sends the header (this is called lazy authentication). Before doing so, the browser may display a dialog box for the user to enter a user ID and password. The web server is not involved in the creation of this dialog box. The Servlet 2.2 specification defines a method of authentication called formbased authentication which uses an HTML form instead of relying on the authentication dialog and protocol built-in to the web client or on the authentication header. Instead, it uses the HTTP POST method and a special server-based program (servlet) for obtaining the posted authentication parameters and submitting them to the web server s authentication service. An HTML form of the following basic kind must be used to utilize this technique. The form can be customized to depict a look and feel appropriate for the application, but its input parameter names and the action field cannot be changed. <form method="post" action="j_security_check"> <input type="text" name="j_username"> <input type="password" name="j_password"> </form> Note that the POST action target is the special j_security_check servlet program. This program is required to be provided by all servlet engines and it provides the form-based authentication service. Reentrancy It is generally a good idea to avoid using multithreading in server business applications, and allow the middleware to manage threading and concurrency. While some middleware component systems such as EJB (discussed later in this chapter)

11 Chap8 Page 612 Thursday, December 9, :50 PM 612 Advanced Java 2 Development for Enterprise Applications disallow multithreading in server applications, some do not, and it is then necessary for the developer to anticipate the effects of concurrent invocations on objects and code. Multiple web clients are allowed to access a servlet object concurrently unless the servlet class implements the SingleThreadModel interface. In that case, the servlet is assumed to not be reentrant and the servlet can be assured that accesses to it will be serialized (guarded) by the server. To prevent other clients that are trying to access the servlet from blocking, it is then necessary for the server to spawn multiple instances of the servlet, possibly maintaining them in a pool. In any system which maintains a resource pool, the system must have a policy for determining to what extent the pooled resources are interchangeable. In the case of a servlet pool, the servlet specification requires that servlets be interchangeable. Therefore, you should not leave client-specific state in a servlet object in any way other than via the HttpSession mechanism. Otherwise, instances of the same servlet will not be interchangeable. Multiple UI Frames and Concurrency It is common for a servlet to be accessed from a multiframe thin-client page, just as it is common for a heavy-client application to have multiple panels or windows. If each page corresponds to a servlet URL, the servlets will be invoked simultaneously when the UI page is shown. Servlet Design One of the most challenging aspects of servlets is deciding how to coordinate the functions of obtaining information and presenting it. Servlets operate in a request/response model, and the state which they can maintain between invocations is limited. Therefore it is best to view each invocation as a separate transaction, which is mostly if not completely self-contained, and which is fully responsible for obtaining and displaying its own data. The application therefore cannot be designed to first build a user interface, and then process user interactions with that user interface: the user interface must be rebuilt each time. This makes it difficult to maintain user interface context, such as the current selected item on a screen, and so on. [...] Mixing and Matching Servlet Servers and EJB Servers Most web application servers come bundled with a web server, which includes a servlet engine. Nevertheless it is often possible to mix and match web server, servlet engine, and EJB server from different sources. For example, you should be able to deploy servlets in a Netscape web server which access Enterprise Java- Beans in a WebLogic EJB server. To go a step further, there are many third-party servlet engines for the Netscape web servers. A popular one is JRunner. Thus, it is

12 Chap8 Page 613 Thursday, December 9, :50 PM Chapter 8 Server Frameworks and Architectures 613 possible to deploy servlets in a Netscape web server, using a third-party servlet engine, accessing an EJB server of a different brand.[...] Deploying Servlets Prior to Servlet 2.2 there was no standard way to deploy servlets. There was no specification of what could reside in a servlet JAR file, or even if servlets could be deployed as JAR files. There was also no specification stating how servlet codebases were defined, as already mentioned. Nevertheless there have been some de facto standards for deployment and these other aspects of behavior.[...] XML-based Deployment. Sun is making an effort to better define and standardize the way in which Java applications of all kinds are deployed. The Servlet 2.2 draft specification includes an XML definition of a servlet deployment descriptor. The deployment descriptor will be packaged inside of a servlet deployment file, which will be a JAR file, possibly with a.web or.war (WebARchive) extension. [...] Where to Run a Servlet Server An issue that often comes up in application architecture design is where to deploy servlets. In particular, should they be inside the firewall or outside the firewall, and should they be colocated with the application server? [...] JavaServer Pages JavaServer Pages (JSP) is an HTML/Java hybrid language for embedding program commands in a web page. These commands are interpreted by the web server prior to returning content to the client. JSP is the modern Java incarnation of what historically were known as server side includes, which did much the same thing in a more primitive way. While JSP operation can be understood to be interpreted, most implementations will in fact compile portions of a JSP page into one or more runtime objects which can be cached for efficiency. [...] Serving XML. An extremely important aspect of JSP is that it is defined as an XML application. Thus a JSP page can be viewed as an XML document with embedded Java code snippets (escaped using XML syntax) which are evaluated at runtime. JSP can therefore be used to create dynamic templates for generating XML messages.[...] The Enterprise JavaBeans Framework In the previous chapters we saw some of the tremendous practical difficulties in designing and implementing correct multiuser multitier applications. Intuitively, you should feel that these difficulties should not be necessary; somehow, the tools are not right, or are too complicated. After all, all you want to do in most cases is

13 Chap8 Page 614 Thursday, December 9, :50 PM 614 Advanced Java 2 Development for Enterprise Applications get data in and out, in such a way that you don t conflict with what someone else is doing. It should be very simple. Enterprise JavaBeans (EJB) attempts to address these problems by defining a standard architecture for creating multiuser applications based on a three-tier approach. The architecture drastically simplifies the choices the application programmer needs to make, and delegates most of those concerns to an infrastructure layer that is the responsibility of the middleware vendor. The market for middleware is now in a tremendous growth phase, and having a standard architecture that requires interoperability, as the Enterprise JavaBeans framework does, will greatly enhance the value of these products. Client, Server, and Data Resource The EJB model is a three-tier model based on remote method invocation on server objects using RMI. EJB defines an object framework for a set of server object roles and implementations. The model is symmetric, however, in that server objects invoke each other in the same way clients invoke them (i.e., there is no distinction between a local and a remote client). This provides a high degree of object relocatability. (Of course, under the covers, an implementation is free to implement local calls differently, as long as this is transparent to the application.) Client sessions with server objects are either stateless or stateful. A stateful object retains value between transactions (but not necessarily between client connections). If a connection is stateful, the server object can be either persistent (retains value between client connections) or not persistent. A nonpersistent server object is called a session object, and a persistent server object is called an entity object. Entity objects are available to all clients, and a server which provides entity objects in effect provides an object database. Session objects, however, are available only to the client for which they were created, and they do not persist after the client connection is terminated. Even though EJB connections are based on RMI, EJB servers are free to use either RMI s native stream protocol (JRMP), IIOP, or any protocol that can bridge to either of these. This means that EJB objects can interoperate with non-java clients. Many vendors have also developed EJB-based gateways to their server products, including many mainframe-based applications. Transaction Management Transaction management is a central feature of EJB servers, and all EJB servers either provide transaction management or allow the integrated use of an external transaction manager. From an API point of view, transactions are manifested as remote calls. You can either take charge of transaction management in your client or server beans, or

14 Chap8 Page 615 Thursday, December 9, :50 PM Chapter 8 Server Frameworks and Architectures 615 leave it up to the middleware. The latter is recommended, since that is one of its main advantages. I will assume that unless otherwise specified. [...] Propagation of Transaction Context. An interesting situation arises if an organization has more than one application server, and a bean in one application server needs to access a bean in another application server. If the first bean executes in a transaction context, its call to the second bean in the other server needs to execute in the same context. Therefore, the two servers need to be linked, and the first server must be able to transfer the transaction context to the second server. The ability to transfer or import transaction context is an important feature as an application grows and starts to be used by other departments, and integrated into the infrastructure. Most EJB servers provide this capability, but in different degrees and in different ways. The EJB specification does not require that an EJB server be able to share transaction context with other servers, although it is clear that is a desired and intended feature. The wonderful thing is that if your application does not need transaction context propagation today, you can always change servers later if you do need it without affecting your application design. At most, you may need to import a different RMI package and change some JNDI properties, but the overall application should not need to change. Taking this a step further, you can design applications without worrying about where components are deployed, because the components can operate within the same transaction even if they are redeployed on different servers. Application components are therefore portable, even if they are transactional. This is depicted in Figure 8-1. EJB Server A EJB Server A EJB Server B DB1 DB2 DB1 DB2 Figure 8-1 Applications need not change if components are redeployed for improved efficiency.

15 Chap8 Page 616 Thursday, December 9, :50 PM 616 Advanced Java 2 Development for Enterprise Applications How It Works Let s look at the sequence of events that normally occurs, as depicted in Figure 8-5. When a client wants to use a server service, it first establishes a connection by looking up the container object in some directory service via a JNDI interface, and performing a create(). This creates (or allocates from a pool, if the object is stateless) an instance of the requested enterprise bean. It does not return a reference to this object, however: it creates a server-side proxy, called an EJB Object (an unfortunate name, since everything is an object), and returns a reference to that. The proxy object fields calls from the client, and in turn makes identical calls to the Enterprise JavaBean, which in turn makes identical calls to the actual user-written class that implements the business logic. In addition, the proxy object acts as a checkpoint, and performs checks with the container environment regarding security policies. As you can see, it is the EJB container which actually invokes the Enterprise Java- Beans that you write. The container therefore has the opportunity to perform various actions before it actually makes this invocation, such as identifying your user Principal, what roles your Principal belongs to, and what transaction your call may already be associated with. The container has the job of allocating a thread for the purpose of servicing your request, and then turning the request over to that thread. From that point on, it keeps track of which transaction that thread belongs to. The container also may provide load management services and may provide persistent data resource connection pools. In short, the container provides a protected and managed environment for EJB invocations and performs many of the infrastructure-related housekeeping tasks that you would have to otherwise build into a distributed application.

16 Chap8 Page 617 Thursday, December 9, :50 PM Chapter 8 Server Frameworks and Architectures 617 RMI/JRMP JNDI provider RMI/IJRMP Stub: EJBHome RMI/JRMP Stub: EJBObject Client* RMI Registry JRMP JRMP JRMP EJB Server Container Create implementation for EJBObject Implementation for EJBHome the container s exposed interface Java EJB Business Object *May be another enterprise bean XAResource TM Figure 8-2 Client and EJB interaction. Data sources JDBC2 or other JTA- Compatible Connection (i.e., exposes an XAResource interface) Session Bean vs. Entity Bean EJB defines two primary kinds of enterprise beans: session beans and entity beans (see Figure 8-2). The difference between a session bean and an entity bean is that an entity bean represents a persistent data item, such as a record in a database. An entity bean instance therefore does not represent a class of items, but represents a particular instance, just as a record is an instance of a row in a relational table. An entity bean instance also has a unique identity, and can be obtained by looking it up using one of its finder methods, just as an indexed row in a relational table can be obtained by performing a query on the value of the index. The lifetime of an entity bean instance is also permanent, and it exists until it is explicitly removed, just as a table row exists until it is deleted. Entity beans provide an object-oriented view of arbitrary data resources, which may be non-object-oriented in actuality. For example, an entity bean facade may be created to represent a relational data resource so that the application can be coded as if the data resource were object oriented. The EJB server may even provide a tool to generate the entity bean layer for relational or other kinds of data resources that it directly supports.

17 Chap8 Page 618 Thursday, December 9, :50 PM 618 Advanced Java 2 Development for Enterprise Applications Exists until Access by multiple clients Obtained by Can be passivated when in a transaction Session Bean Server crashes, container is destroyed, or session is terminated No Creating No Entity Bean Explicitly removed Yes Creating, using Handle, or finding Yes Figure 8-3 Comparison of session and entity JavaBeans. Both kinds of beans can be provided to client applications from instance pools in an EJB server. However, the use of instance pooling is a performance feature, and it is largely transparent to clients. In addition, a session bean can be declared to be stateless, allowing the server greater freedom to reuse the bean instance, but whether the server actually makes use of this freedom depends on the server and is transparent to the application. Beans Are Components Entity beans may be small-grain representations of actual persistent data items. Still, an entity bean is a component not a data item. An entity bean instance represents a runtime proxy for an actual data item, typically a complex data item. If your database table has a million rows in it, there are not a million entity beans there is one entity bean instance for each instance you look up via a findxxx() method, or obtain a reference to by any means. These instances may be reclaimed at any time to conserve resources, which may cause your application to block briefly the next time it tries to access the instance. The conceptual difference between components and persistent data objects is an important one. Data objects represent the actual data, and components provide reusable and portable methods of getting to those objects in convenient ways, as well as operations to perform on them. Even if your database is an object database and the objects themselves provide methods, database objects are not inherently portable and self-contained. It is analogous to the difference between a non-enterprise JavaBean and a simple Java program object. An ordinary JavaBean has additional requirements to allow it to be reusable and redeployable, and its getter and setter methods provide a gateway to any real or virtual attributes managed by the bean. Similarly, Enterprise JavaBeans are reusable and redeployable components for accessing data. Runtime Synchronization An extremely important aspect of Enterprise JavaBeans is that runtime access to methods is automatically synchronized by the EJB container so that a program-

18 Chap8 Page 619 Thursday, December 9, :50 PM Chapter 8 Server Frameworks and Architectures 619 mer does not have to deal with reentrancy issues. This is a departure from the CORBA models which provide shared object access, but require you to write reentrant code and manually keep track of client-specific state. Bean access synchronization is accomplished without limiting scalability by defining models which support either unshared session-specific state, or shared state which is transactionally managed. These are the session bean and entity bean models respectively. In addition, to support the use of pre-initialized object pools, the model explicitly provides for a special kind of session bean which is declared to not retain state between invocations, thereby allowing it to be pooled after every method call. These bean models will be discussed in greater detail later in this chapter. Deployment EJB 1.0 defined a set of six provider and user roles for enterprise beans. However, the 1.0 specification did not make use of many of these roles, particularly those related to deployment and assembly. The six roles are: 1. Server provider Integrates and provides the core EJB services required by an EJB container. There is no standard interface between an EJB server and an EJB container (the two are effectively synonymous in current products), and so the server provider is currently the same as the container provider. In the future, there may exist a standard interface between an EJB server and an EJB container, making it possible to obtain containers from third parties (e.g., containers which provide entity bean access to specialized data resources); then the server provider and container provider may no longer necessarily be the same party. 2. Container provider Provides an EJB container, which is able to deploy and run enterprise beans with the facilities and APIs required by the EJB specification. The EJB container implements the API seen by an enterprise bean. 3. Bean provider (module developer) Develops an enterprise bean, in accordance with the EJB specification. The bean is packaged in an EJB JAR file, typically with a tool provided by the EJB server provider. The bean provider specifies deployment information in the EJB deployment descriptor, which is also included in the JAR file. EJB 1.0 used a serialized Java object as a deployment descriptor; EJB 1.1 replaces that with an XML format. The Java 2 Enterprise Edition specification refers to this role with the more generic terms module developer and component developer. 4. Application assembler Selects a set of enterprise beans to compose a larger application.

19 Chap8 Page 620 Thursday, December 9, :50 PM 620 Advanced Java 2 Development for Enterprise Applications 5. Application deployer Installs enterprise beans and enterprise beans applications in an EJB server. 6. System administrator Configures the runtime resources and security settings needed by the EJB server to support the EJB services, data resources, and containers. These roles are summarized in Figure 8-4. The EJB 1.0 specification does not define precise boundaries between roles 1 and 2, or between roles 4, 5, and 6. The 1.1 specification clarifies the roles somewhat and addresses some important issues important to server and container builders. An enterprise bean is packaged in a JAR file with a deployment descriptor. An EJB 1.0 deployment descriptor is itself a serialized bean, which is an instance of javax.ejb.deployment.deploymentdescriptor. EJB 1.0 beans had to have a manifest listing each bean s deployment descriptor s serialized file along with the special attribute Enterprise-Bean: True. For example, this manifest section lists the bean MyBean : Name: mypackage/mybeandeploymentdescriptor.ser Enterprise-Bean: True

20 Chap8 Page 621 Thursday, December 9, :50 PM Chapter 8 Server Frameworks and Architectures 621 Server Provider Builds the application server Container Provider Builds the container which runs in the application server and exposes EJB services and APIs to the application components Component Developer May assemble components into an application as well The result is a highly reusable component, set of components, or applications Application Assembler Selects and configures components to create an end-use application The result is an application unit suitable for deployment in a specific kind of environment or a specific environment Application Deployer Selects and configures applications and components to deploy ( stand up ) an end-use application The result is a fully deployed application users can use Figure 8-4 EJB application lifecycle roles. Application Administrator Monitors and administers the application Makes configuration changes as necessary over time The EJB 1.0 deployment descriptor serialized object contains the deployment attributes, which may apply to the entire enterprise bean, or be specific to particular remote methods. The deployment descriptor contains a security descriptor, method descriptors, a transaction attribute, and an object JNDI name. The security descriptor specifies access rights on a per-user basis. The deployment descriptor may have a set of method descriptors, which specify a security descriptor and transaction attribute on a method-specific basis. EJB 1.1 deprecates this representation and replaces it with an XML representation, which is discussed below. In addition, EJB 1.1 no longer uses the manifest to identify beans, but instead identifies them from the XML deployment descriptor syntax, which must be stored in the META-INF directory in the JAR file and have the name ejb-jar.xml.

21 Chap8 Page 622 Thursday, December 9, :50 PM 622 Advanced Java 2 Development for Enterprise Applications An EJB server registers an enterprise bean via JNDI, using the object name obtained from the deployment descriptor. This provides object location independence, because other beans can find the object simply by using the JNDI API. EJB 1.0 Deployment Descriptors. EJB 1.0 defines these attributes for bean deployment descriptors: Name beanhomename The JNDI Name to use for this bean. (The environment may prefix the name with other path information.) String enterprisebeanclassname The full name of the enterprise bean class i.e., the business class. String homeinterfaceclassname The full name of the bean s Home interface. String remoteinterfaceclassname The full name of the bean s remote interface. boolean reentrant If true, multiple concurrent calls to the same bean instance are permitted. This is necessary for beans that require recursion or which are called back by the beans they call. Use with care, because this capability disables many safeguards, particularly the container s concurrency control mechanisms. This can be set to true only for entity beans. Properties environmentproperties The customizable properties, with default values, that the administrator may set when the bean is deployed. AccessControlEntry[] Method method The bean method this access control entry applies to, or null if it applies to the entire bean. Identity[] allowedidentities The identities that are permitted to invoke the method (or the bean if method is null). ControlDescriptor[] Each enterprise bean method may have a control descriptor. It includes the following: Method method The method the descriptor applies to, or null if the descriptor applies to the entire bean. int runasmode One of: CLIENT_IDENTITY Use the identity of the client invoking the method. SYSTEM_IDENTITY Use a privileged account. The actual account used is determined in a product-specific way. SPECIFIED_IDENTITY Use the identity specified in the runasidentity property (see below). Identity runasidentity Use this identity, if the runasmode is set to SPECIFIED_IDENTITY.

22 Chap8 Page 623 Thursday, December 9, :50 PM Chapter 8 Server Frameworks and Architectures 623 int transactionattribute One of: TX_BEAN_MANAGED The bean uses JTA to manage transactions itself. It can obtain the current JTA transaction by using EJB- Context.getCurrentTransaction(). TX_MANDATORY If the client is not in a transaction when the bean is called, an exception will be thrown. TX_NOT_SUPPORTED The bean must not be invoked within a transaction. TX_REQUIRED The EJB server starts a transaction for each method invocation (and commits on return), unless one is already in progress for that client. TX_REQUIRES_NEW The EJB server always creates a new transaction for the call. If the client was already in a transaction, that transaction is temporarily disassociated from the caller s thread until the new call (and new transaction) completes. TX_SUPPORTS The call executes in the context of the client's transaction, if there is one; otherwise it executes without a transaction. int isolationlevel One of the following. These have the meanings defined in JDBC. TRANSACTION_READ_COMMITTED TRANSACTION_READ_UNCOMMITTED TRANSACTION_REPEATABLE_READ TRANSACTION_SERIALIZABLE Session bean descriptors have these additional attributes: int sessiontimeout A container may destroy a session bean after an inactive period set by this timeout (value is in seconds). A value of zero means a default value should be used. int statemanagementtype One of: STATEFUL_SESSION The bean is assumed to retain a modified state after an invocation returns, preventing the bean from being shared with other clients that request a bean of the same kind. STATELESS_SESSION The container can assume that the bean does not retain state across invocations, and that the bean may therefore be pooled. It also assumes the bean as a zero-argument create() method.

23 Chap8 Page 624 Thursday, December 9, :50 PM 624 Advanced Java 2 Development for Enterprise Applications Entity bean descriptors have these additional attributes: String primarykeyclassname The full name of the class that is used to represent the entity bean s primary key value. Field[] containermanagedfields The specified fields are to be made persistent by the container. The bean makes sure to set the values of these fields during bean initialization, in its ejbcreate() method. It should be noted that when referring to a session bean deployed as STATEFUL_SESSION, the term stateless refers more to the bean s reusability than to whether or not it actually contains state. Session beans are identified as stateless only so that the server can economize on its creation of new session bean instances. If a bean can be returned to a pool of session bean instances, and used for calls by additional clients without those clients being able to detect that the bean has already been used, then the bean is considered to be stateless, even if the bean maintains a resource connection. EJB 1.1 Deployment Descriptors. The EJB 1.1 deployment descriptor uses XML syntax, and its overall structure is shown Figure 8-5. It has three main parts: a header consisting of descriptive information, an enterprise-beans section which lists bean definitions, and an assembly-descriptor section which adds information related to access control and transaction control. <ejb-jar> <description>...text...</description> optional <display-name> name to be displayed by tools... </display-name> <small-icon> relative pathname of a 16x16.jpg or.gif... </small-icon> <large-icon> relative pathname of a 32X32.jpg or.gif... </large-icon> <enterprise-beans> <session> one or more <session> and/or <entity> definitions see below... </session> optional optional optional <entity> </entity> </enterprise-beans> <assembly-descriptor> see below... </assembly-descriptor> </ejb-jar> see below... optional Figure 8-5 EJB 1.1 deployment descriptor structure.

Chapter 10 Web-based Information Systems

Chapter 10 Web-based Information Systems Prof. Dr.-Ing. Stefan Deßloch AG Heterogene Informationssysteme Geb. 36, Raum 329 Tel. 0631/205 3275 dessloch@informatik.uni-kl.de Chapter 10 Web-based Information Systems Role of the WWW for IS Initial

More information

Enterprise Java and Rational Rose - Part II

Enterprise Java and Rational Rose - Part II Enterprise Java and Rational Rose - Part II by Khawar Ahmed Technical Marketing Engineer Rational Software Loïc Julien Software Engineer Rational Software This is the second installment of a twopart series

More information

Application Servers in E-Commerce Applications

Application Servers in E-Commerce Applications Application Servers in E-Commerce Applications Péter Mileff 1, Károly Nehéz 2 1 PhD student, 2 PhD, Department of Information Engineering, University of Miskolc Abstract Nowadays there is a growing demand

More information

PSD1B Advance Java Programming Unit : I-V. PSD1B- Advance Java Programming

PSD1B Advance Java Programming Unit : I-V. PSD1B- Advance Java Programming PSD1B Advance Java Programming Unit : I-V PSD1B- Advance Java Programming 1 UNIT I - SYLLABUS Servlets Client Vs Server Types of Servlets Life Cycle of Servlets Architecture Session Tracking Cookies JDBC

More information

Vision of J2EE. Why J2EE? Need for. J2EE Suite. J2EE Based Distributed Application Architecture Overview. Umair Javed 1

Vision of J2EE. Why J2EE? Need for. J2EE Suite. J2EE Based Distributed Application Architecture Overview. Umair Javed 1 Umair Javed 2004 J2EE Based Distributed Application Architecture Overview Lecture - 2 Distributed Software Systems Development Why J2EE? Vision of J2EE An open standard Umbrella for anything Java-related

More information

Appendix A - Glossary(of OO software term s)

Appendix A - Glossary(of OO software term s) Appendix A - Glossary(of OO software term s) Abstract Class A class that does not supply an implementation for its entire interface, and so consequently, cannot be instantiated. ActiveX Microsoft s component

More information

On Performance of Enterprise JavaBeans

On Performance of Enterprise JavaBeans On Performance of Enterprise JavaBeans Radek Pospíšil, Marek Procházka, Vladimír Mencl 1 Abstract Enterprise JavaBeans (EJB) is a new-sprung technology for Java-based distributed software components. During

More information

Java Enterprise Edition

Java Enterprise Edition Java Enterprise Edition The Big Problem Enterprise Architecture: Critical, large-scale systems Performance Millions of requests per day Concurrency Thousands of users Transactions Large amounts of data

More information

Enterprise JavaBeans (I) K.P. Chow University of Hong Kong

Enterprise JavaBeans (I) K.P. Chow University of Hong Kong Enterprise JavaBeans (I) K.P. Chow University of Hong Kong JavaBeans Components are self contained, reusable software units that can be visually composed into composite components using visual builder

More information

Introduction. Enterprise Java Instructor: Please introduce yourself Name Experience in Java Enterprise Edition Goals you hope to achieve

Introduction. Enterprise Java Instructor: Please introduce yourself Name Experience in Java Enterprise Edition Goals you hope to achieve Enterprise Java Introduction Enterprise Java Instructor: Please introduce yourself Name Experience in Java Enterprise Edition Goals you hope to achieve Course Description This course focuses on developing

More information

Distributed Multitiered Application

Distributed Multitiered Application Distributed Multitiered Application Java EE platform uses a distributed multitiered application model for enterprise applications. Logic is divided into components https://docs.oracle.com/javaee/7/tutorial/overview004.htm

More information

Borland Application Server Certification. Study Guide. Version 1.0 Copyright 2001 Borland Software Corporation. All Rights Reserved.

Borland Application Server Certification. Study Guide. Version 1.0 Copyright 2001 Borland Software Corporation. All Rights Reserved. Borland Application Server Certification Study Guide Version 1.0 Copyright 2001 Borland Software Corporation. All Rights Reserved. Introduction This study guide is designed to walk you through requisite

More information

J2EE Development. Course Detail: Audience. Duration. Course Abstract. Course Objectives. Course Topics. Class Format.

J2EE Development. Course Detail: Audience. Duration. Course Abstract. Course Objectives. Course Topics. Class Format. J2EE Development Detail: Audience www.peaksolutions.com/ittraining Java developers, web page designers and other professionals that will be designing, developing and implementing web applications using

More information

(9A05803) WEB SERVICES (ELECTIVE - III)

(9A05803) WEB SERVICES (ELECTIVE - III) 1 UNIT III (9A05803) WEB SERVICES (ELECTIVE - III) Web services Architecture: web services architecture and its characteristics, core building blocks of web services, standards and technologies available

More information

Overview p. 1 Server-side Component Architectures p. 3 The Need for a Server-Side Component Architecture p. 4 Server-Side Component Architecture

Overview p. 1 Server-side Component Architectures p. 3 The Need for a Server-Side Component Architecture p. 4 Server-Side Component Architecture Preface p. xix About the Author p. xxii Introduction p. xxiii Overview p. 1 Server-side Component Architectures p. 3 The Need for a Server-Side Component Architecture p. 4 Server-Side Component Architecture

More information

In the most general sense, a server is a program that provides information

In the most general sense, a server is a program that provides information d524720 Ch01.qxd 5/20/03 8:37 AM Page 9 Chapter 1 Introducing Application Servers In This Chapter Understanding the role of application servers Meeting the J2EE family of technologies Outlining the major

More information

Enterprise Java Security Fundamentals

Enterprise Java Security Fundamentals Pistoia_ch03.fm Page 55 Tuesday, January 6, 2004 1:56 PM CHAPTER3 Enterprise Java Security Fundamentals THE J2EE platform has achieved remarkable success in meeting enterprise needs, resulting in its widespread

More information

NetBeans IDE Field Guide

NetBeans IDE Field Guide NetBeans IDE Field Guide Copyright 2005 Sun Microsystems, Inc. All rights reserved. Table of Contents Extending Web Applications with Business Logic: Introducing EJB Components...1 EJB Project type Wizards...2

More information

Advanced Java Programming

Advanced Java Programming Advanced Java Programming Length: 4 days Description: This course presents several advanced topics of the Java programming language, including Servlets, Object Serialization and Enterprise JavaBeans. In

More information

COURSE 9 DESIGN PATTERNS

COURSE 9 DESIGN PATTERNS COURSE 9 DESIGN PATTERNS CONTENT Applications split on levels J2EE Design Patterns APPLICATION SERVERS In the 90 s, systems should be client-server Today, enterprise applications use the multi-tier model

More information

Java- EE Web Application Development with Enterprise JavaBeans and Web Services

Java- EE Web Application Development with Enterprise JavaBeans and Web Services Java- EE Web Application Development with Enterprise JavaBeans and Web Services Duration:60 HOURS Price: INR 8000 SAVE NOW! INR 7000 until December 1, 2011 Students Will Learn How to write Session, Message-Driven

More information

TOPLink for WebLogic. Whitepaper. The Challenge: The Solution:

TOPLink for WebLogic. Whitepaper. The Challenge: The Solution: Whitepaper The Challenge: Enterprise JavaBeans (EJB) represents a new standard in enterprise computing: a component-based architecture for developing and deploying distributed object-oriented applications

More information

Exam Actual. Higher Quality. Better Service! QUESTION & ANSWER

Exam Actual. Higher Quality. Better Service! QUESTION & ANSWER Higher Quality Better Service! Exam Actual QUESTION & ANSWER Accurate study guides, High passing rate! Exam Actual provides update free of charge in one year! http://www.examactual.com Exam : 310-090 Title

More information

This course is intended for Java programmers who wish to write programs using many of the advanced Java features.

This course is intended for Java programmers who wish to write programs using many of the advanced Java features. COURSE DESCRIPTION: Advanced Java is a comprehensive study of many advanced Java topics. These include assertions, collection classes, searching and sorting, regular expressions, logging, bit manipulation,

More information

13. Databases on the Web

13. Databases on the Web 13. Databases on the Web Requirements for Web-DBMS Integration The ability to access valuable corporate data in a secure manner Support for session and application-based authentication The ability to interface

More information

ITdumpsFree. Get free valid exam dumps and pass your exam test with confidence

ITdumpsFree.  Get free valid exam dumps and pass your exam test with confidence ITdumpsFree http://www.itdumpsfree.com Get free valid exam dumps and pass your exam test with confidence Exam : 310-090 Title : Sun Certified Business Component Developer for J2EE 1.3 Vendors : SUN Version

More information

A General ecommerce Platform with Strong International and Local Aspects

A General ecommerce Platform with Strong International and Local Aspects A General ecommerce Platform with Strong International and Local Aspects By Martin Ramsin A Master s Thesis August 2000 Examiner: Professor Seif Haridi Supervisors:Andy Neil and Mark Bünger, Icon MediaLab

More information

Enterprise Java Unit 1- Chapter 3 Prof. Sujata Rizal Introduction to Servlets

Enterprise Java Unit 1- Chapter 3 Prof. Sujata Rizal Introduction to Servlets 1. Introduction How do the pages you're reading in your favorite Web browser show up there? When you log into your favorite Web site, how does the Web site know that you're you? And how do Web retailers

More information

Enterprise Java Unit 1-Chapter 2 Prof. Sujata Rizal Java EE 6 Architecture, Server and Containers

Enterprise Java Unit 1-Chapter 2 Prof. Sujata Rizal Java EE 6 Architecture, Server and Containers 1. Introduction Applications are developed to support their business operations. They take data as input; process the data based on business rules and provides data or information as output. Based on this,

More information

Using JNDI from J2EE components

Using JNDI from J2EE components Using JNDI from J2EE components Stand-alone Java program have to specify the location of the naming server when using JNDI private static InitialContext createinitialcontext() throws NamingException {

More information

EJB ENTERPRISE JAVA BEANS INTRODUCTION TO ENTERPRISE JAVA BEANS, JAVA'S SERVER SIDE COMPONENT TECHNOLOGY. EJB Enterprise Java

EJB ENTERPRISE JAVA BEANS INTRODUCTION TO ENTERPRISE JAVA BEANS, JAVA'S SERVER SIDE COMPONENT TECHNOLOGY. EJB Enterprise Java EJB Enterprise Java EJB Beans ENTERPRISE JAVA BEANS INTRODUCTION TO ENTERPRISE JAVA BEANS, JAVA'S SERVER SIDE COMPONENT TECHNOLOGY Peter R. Egli 1/23 Contents 1. What is a bean? 2. Why EJB? 3. Evolution

More information

Chapter 6 Enterprise Java Beans

Chapter 6 Enterprise Java Beans Chapter 6 Enterprise Java Beans Overview of the EJB Architecture and J2EE platform The new specification of Java EJB 2.1 was released by Sun Microsystems Inc. in 2002. The EJB technology is widely used

More information

Advanced Topics in Operating Systems

Advanced Topics in Operating Systems Advanced Topics in Operating Systems MSc in Computer Science UNYT-UoG Dr. Marenglen Biba 8-9-10 January 2010 Lesson 10 01: Introduction 02: Architectures 03: Processes 04: Communication 05: Naming 06:

More information

Chapter 1: Distributed Information Systems

Chapter 1: Distributed Information Systems Chapter 1: Distributed Information Systems Contents - Chapter 1 Design of an information system Layers and tiers Bottom up design Top down design Architecture of an information system One tier Two tier

More information

presentation DAD Distributed Applications Development Cristian Toma

presentation DAD Distributed Applications Development Cristian Toma Lecture 12 S4 - Core Distributed Middleware Programming in JEE Distributed Development of Business Logic Layer presentation DAD Distributed Applications Development Cristian Toma D.I.C.E/D.E.I.C Department

More information

X100 ARCHITECTURE REFERENCES:

X100 ARCHITECTURE REFERENCES: UNION SYSTEMS GLOBAL This guide is designed to provide you with an highlevel overview of some of the key points of the Oracle Fusion Middleware Forms Services architecture, a component of the Oracle Fusion

More information

Enterprise Java and Rational Rose -- Part I

Enterprise Java and Rational Rose -- Part I Enterprise Java and Rational Rose -- Part I by Khawar Ahmed Technical Marketing Engineer Rational Software Loïc Julien Software Engineer Rational Software "We believe that the Enterprise JavaBeans component

More information

Problems in Scaling an Application Client

Problems in Scaling an Application Client J2EE What now? At this point, you understand how to design servers and how to design clients Where do you draw the line? What are issues in complex enterprise platform? How many servers? How many forms

More information

Implementing a Web Service p. 110 Implementing a Web Service Client p. 114 Summary p. 117 Introduction to Entity Beans p. 119 Persistence Concepts p.

Implementing a Web Service p. 110 Implementing a Web Service Client p. 114 Summary p. 117 Introduction to Entity Beans p. 119 Persistence Concepts p. Acknowledgments p. xvi Introduction p. xvii Overview p. 1 Overview p. 3 The Motivation for Enterprise JavaBeans p. 4 Component Architectures p. 7 Divide and Conquer to the Extreme with Reusable Services

More information

J2EE Interview Questions

J2EE Interview Questions 1) What is J2EE? J2EE Interview Questions J2EE is an environment for developing and deploying enterprise applications. The J2EE platform consists of a set of services, application programming interfaces

More information

Ch04 JavaServer Pages (JSP)

Ch04 JavaServer Pages (JSP) Ch04 JavaServer Pages (JSP) Introduce concepts of JSP Web components Compare JSP with Servlets Discuss JSP syntax, EL (expression language) Discuss the integrations with JSP Discuss the Standard Tag Library,

More information

Chapter 10 Web-based Information Systems

Chapter 10 Web-based Information Systems Prof. Dr.-Ing. Stefan Deßloch AG Heterogene Informationssysteme Geb. 36, Raum 329 Tel. 0631/205 3275 dessloch@informatik.uni-kl.de Chapter 10 Web-based Information Systems Role of the WWW for IS Initial

More information

Fast Track to Java EE

Fast Track to Java EE Java Enterprise Edition is a powerful platform for building web applications. This platform offers all the advantages of developing in Java plus a comprehensive suite of server-side technologies. This

More information

Introduction to JSP and Servlets Training 5-days

Introduction to JSP and Servlets Training 5-days QWERTYUIOP{ Introduction to JSP and Servlets Training 5-days Introduction to JSP and Servlets training course develops skills in JavaServer Pages, or JSP, which is the standard means of authoring dynamic

More information

Oracle EXAM - 1Z Java EE 6 Enterprise JavaBeans Developer Certified Expert Exam. Buy Full Product.

Oracle EXAM - 1Z Java EE 6 Enterprise JavaBeans Developer Certified Expert Exam. Buy Full Product. Oracle EXAM - 1Z0-895 Java EE 6 Enterprise JavaBeans Developer Certified Expert Exam Buy Full Product http://www.examskey.com/1z0-895.html Examskey Oracle 1Z0-895 exam demo product is here for you to test

More information

Software Paradigms (Lesson 10) Selected Topics in Software Architecture

Software Paradigms (Lesson 10) Selected Topics in Software Architecture Software Paradigms (Lesson 10) Selected Topics in Software Architecture Table of Contents 1 World-Wide-Web... 2 1.1 Basic Architectural Solution... 2 1.2 Designing WWW Applications... 7 2 CORBA... 11 2.1

More information

Module 3 Web Component

Module 3 Web Component Module 3 Component Model Objectives Describe the role of web components in a Java EE application Define the HTTP request-response model Compare Java servlets and JSP components Describe the basic session

More information

Chapter 8 Web-based Information Systems

Chapter 8 Web-based Information Systems Prof. Dr.-Ing. Stefan Deßloch AG Heterogene Informationssysteme Geb. 36, Raum 329 Tel. 0631/205 3275 dessloch@informatik.uni-kl.de Chapter 8 Web-based Information Systems Role of the WWW for IS Initial

More information

HttpServlet ( Class ) -- we will extend this class to handle GET / PUT HTTP requests

HttpServlet ( Class ) -- we will extend this class to handle GET / PUT HTTP requests What is the servlet? Servlet is a script, which resides and executes on server side, to create dynamic HTML. In servlet programming we will use java language. A servlet can handle multiple requests concurrently.

More information

Java 2 Platform, Enterprise Edition: Platform and Component Specifications

Java 2 Platform, Enterprise Edition: Platform and Component Specifications Table of Contents Java 2 Platform, Enterprise Edition: Platform and Component Specifications By Bill Shannon, Mark Hapner, Vlada Matena, James Davidson, Eduardo Pelegri-Llopart, Larry Cable, Enterprise

More information

Session 8. Reading and Reference. en.wikipedia.org/wiki/list_of_http_headers. en.wikipedia.org/wiki/http_status_codes

Session 8. Reading and Reference. en.wikipedia.org/wiki/list_of_http_headers. en.wikipedia.org/wiki/http_status_codes Session 8 Deployment Descriptor 1 Reading Reading and Reference en.wikipedia.org/wiki/http Reference http headers en.wikipedia.org/wiki/list_of_http_headers http status codes en.wikipedia.org/wiki/_status_codes

More information

Oracle 10g: Build J2EE Applications

Oracle 10g: Build J2EE Applications Oracle University Contact Us: (09) 5494 1551 Oracle 10g: Build J2EE Applications Duration: 5 Days What you will learn Leading companies are tackling the complexity of their application and IT environments

More information

The Developer s Guide to Understanding Enterprise JavaBeans. Nova Laboratories

The Developer s Guide to Understanding Enterprise JavaBeans. Nova Laboratories The Developer s Guide to Understanding Enterprise JavaBeans Nova Laboratories www.nova-labs.com For more information about Nova Laboratories or the Developer Kitchen Series, or to add your name to our

More information

Component-Based Platform for a Virtual University Information System

Component-Based Platform for a Virtual University Information System Component-Based Platform for a Virtual University Information System Dr. IVAN GANCHEV, Dr. MAIRTIN O DROMA, FERGAL McDONNELL Department of Electronics and Computer Engineering University of Limerick National

More information

J2EE: Best Practices for Application Development and Achieving High-Volume Throughput. Michael S Pallos, MBA Session: 3567, 4:30 pm August 11, 2003

J2EE: Best Practices for Application Development and Achieving High-Volume Throughput. Michael S Pallos, MBA Session: 3567, 4:30 pm August 11, 2003 J2EE: Best Practices for Application Development and Achieving High-Volume Throughput Michael S Pallos, MBA Session: 3567, 4:30 pm August 11, 2003 Agenda Architecture Overview WebSphere Application Server

More information

Deccansoft Software Services. J2EE Syllabus

Deccansoft Software Services. J2EE Syllabus Overview: Java is a language and J2EE is a platform which implements java language. J2EE standard for Java 2 Enterprise Edition. Core Java and advanced java are the standard editions of java whereas J2EE

More information

Data Management in Application Servers. Dean Jacobs BEA Systems

Data Management in Application Servers. Dean Jacobs BEA Systems Data Management in Application Servers Dean Jacobs BEA Systems Outline Clustered Application Servers Adding Web Services Java 2 Enterprise Edition (J2EE) The Application Server platform for Java Java Servlets

More information

BEA WebLogic Server. and BEA WebLogic Express. Introduction to BEA WebLogic Server 6.1

BEA WebLogic Server. and BEA WebLogic Express. Introduction to BEA WebLogic Server 6.1 BEA WebLogic Server and BEA WebLogic Express Introduction to BEA WebLogic Server 6.1 BEA WebLogic Server Version 6.1 Document Date: June 24, 2002 Copyright Copyright 2002 BEA Systems, Inc. All Rights Reserved.

More information

Teamcenter Global Services Customization Guide. Publication Number PLM00091 J

Teamcenter Global Services Customization Guide. Publication Number PLM00091 J Teamcenter 10.1 Global Services Customization Guide Publication Number PLM00091 J Proprietary and restricted rights notice This software and related documentation are proprietary to Siemens Product Lifecycle

More information

Active Server Pages Architecture

Active Server Pages Architecture Active Server Pages Architecture Li Yi South Bank University Contents 1. Introduction... 2 1.1 Host-based databases... 2 1.2 Client/server databases... 2 1.3 Web databases... 3 2. Active Server Pages...

More information

Session 20 Data Sharing Session 20 Data Sharing & Cookies

Session 20 Data Sharing Session 20 Data Sharing & Cookies Session 20 Data Sharing & Cookies 1 Reading Shared scopes Java EE 7 Tutorial Section 17.3 Reference http state management www.ietf.org/rfc/rfc2965.txt Cookies Reading & Reference en.wikipedia.org/wiki/http_cookie

More information

Chapter 2 FEATURES AND FACILITIES. SYS-ED/ Computer Education Techniques, Inc.

Chapter 2 FEATURES AND FACILITIES. SYS-ED/ Computer Education Techniques, Inc. Chapter 2 FEATURES AND FACILITIES SYS-ED/ Computer Education Techniques, Inc. Objectives You will learn: JDeveloper features. Java in the database. Simplified database access. IDE: Integrated Development

More information

Java SE7 Fundamentals

Java SE7 Fundamentals Java SE7 Fundamentals Introducing the Java Technology Relating Java with other languages Showing how to download, install, and configure the Java environment on a Windows system. Describing the various

More information

Table of Contents. Introduction... xxi

Table of Contents. Introduction... xxi Introduction... xxi Chapter 1: Getting Started with Web Applications in Java... 1 Introduction to Web Applications... 2 Benefits of Web Applications... 5 Technologies used in Web Applications... 5 Describing

More information

BEAWebLogic Server. Introduction to BEA WebLogic Server and BEA WebLogic Express

BEAWebLogic Server. Introduction to BEA WebLogic Server and BEA WebLogic Express BEAWebLogic Server Introduction to BEA WebLogic Server and BEA WebLogic Express Version 10.0 Revised: March, 2007 Contents 1. Introduction to BEA WebLogic Server and BEA WebLogic Express The WebLogic

More information

UNIT-III EJB APPLICATIONS

UNIT-III EJB APPLICATIONS UNIT-III EJB APPLICATIONS CONTENTS EJB Session Beans EJB entity beans EJB clients EJB Deployment Building an application with EJB. EJB Types Types of Enterprise Beans Session beans: Also called business

More information

Agent-Enabling Transformation of E-Commerce Portals with Web Services

Agent-Enabling Transformation of E-Commerce Portals with Web Services Agent-Enabling Transformation of E-Commerce Portals with Web Services Dr. David B. Ulmer CTO Sotheby s New York, NY 10021, USA Dr. Lixin Tao Professor Pace University Pleasantville, NY 10570, USA Abstract:

More information

Exam Questions 1Z0-895

Exam Questions 1Z0-895 Exam Questions 1Z0-895 Java Platform, Enterprise Edition 6 Enterprise JavaBeans Developer Certified Expert Exam https://www.2passeasy.com/dumps/1z0-895/ QUESTION NO: 1 A developer needs to deliver a large-scale

More information

PLATFORM TECHNOLOGY UNIT-5

PLATFORM TECHNOLOGY UNIT-5 1. Write in brief about the J2EE enterprise edition? Java is one of the most commonly used and mature programming languages for building enterprise applications. Java development has evolved from small

More information

1Z Java EE 6 Web Component Developer Certified Expert Exam Summary Syllabus Questions

1Z Java EE 6 Web Component Developer Certified Expert Exam Summary Syllabus Questions 1Z0-899 Java EE 6 Web Component Developer Certified Expert Exam Summary Syllabus Questions Table of Contents Introduction to 1Z0-899 Exam on Java EE 6 Web Component Developer Certified Expert... 2 Oracle

More information

BEAAquaLogic. Service Bus. Interoperability With EJB Transport

BEAAquaLogic. Service Bus. Interoperability With EJB Transport BEAAquaLogic Service Bus Interoperability With EJB Transport Version 3.0 Revised: February 2008 Contents EJB Transport Introduction...........................................................1-1 Invoking

More information

Designing a Distributed System

Designing a Distributed System Introduction Building distributed IT applications involves assembling distributed components and coordinating their behavior to achieve the desired functionality. Specifying, designing, building, and deploying

More information

S1 Informatic Engineering

S1 Informatic Engineering S1 Informatic Engineering Advanced Software Engineering Web App. Process and Architecture By: Egia Rosi Subhiyakto, M.Kom, M.CS Informatic Engineering Department egia@dsn.dinus.ac.id +6285640392988 SYLLABUS

More information

Session 9. Deployment Descriptor Http. Reading and Reference. en.wikipedia.org/wiki/http. en.wikipedia.org/wiki/list_of_http_headers

Session 9. Deployment Descriptor Http. Reading and Reference. en.wikipedia.org/wiki/http. en.wikipedia.org/wiki/list_of_http_headers Session 9 Deployment Descriptor Http 1 Reading Reading and Reference en.wikipedia.org/wiki/http Reference http headers en.wikipedia.org/wiki/list_of_http_headers http status codes en.wikipedia.org/wiki/http_status_codes

More information

web.xml Deployment Descriptor Elements

web.xml Deployment Descriptor Elements APPENDIX A web.xml Deployment Descriptor s The following sections describe the deployment descriptor elements defined in the web.xml schema under the root element . With Java EE annotations, the

More information

JAVA COURSES. Empowering Innovation. DN InfoTech Pvt. Ltd. H-151, Sector 63, Noida, UP

JAVA COURSES. Empowering Innovation. DN InfoTech Pvt. Ltd. H-151, Sector 63, Noida, UP 2013 Empowering Innovation DN InfoTech Pvt. Ltd. H-151, Sector 63, Noida, UP contact@dninfotech.com www.dninfotech.com 1 JAVA 500: Core JAVA Java Programming Overview Applications Compiler Class Libraries

More information

~ Ian Hunneybell: CBSD Revision Notes (07/06/2006) ~

~ Ian Hunneybell: CBSD Revision Notes (07/06/2006) ~ 1 Component: Szyperski s definition of a component: A software component is a unit of composition with contractually specified interfaces and explicit context dependencies only. A software component can

More information

Introduction To Web Architecture

Introduction To Web Architecture Introduction To Web Architecture 1 Session Plan Topic Estimated Duration Distributed computing 20 min Overview of Sun Microsoft Architecture 15 min Overview of Microsoft Architecture 15 min Summary 15

More information

Application Servers G Session 11 - Sub-Topic 2 Using Enterprise JavaBeans. Dr. Jean-Claude Franchitti

Application Servers G Session 11 - Sub-Topic 2 Using Enterprise JavaBeans. Dr. Jean-Claude Franchitti Application Servers G22.3033-011 Session 11 - Sub-Topic 2 Using Enterprise JavaBeans Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical Sciences

More information

BEAWebLogic Server and WebLogic Express. Programming WebLogic JNDI

BEAWebLogic Server and WebLogic Express. Programming WebLogic JNDI BEAWebLogic Server and WebLogic Express Programming WebLogic JNDI Version 10.0 Document Revised: March 30, 2007 Contents 1. Introduction and Roadmap Document Scope and Audience.............................................

More information

Development of E-Institute Management System Based on Integrated SSH Framework

Development of E-Institute Management System Based on Integrated SSH Framework Development of E-Institute Management System Based on Integrated SSH Framework ABSTRACT The J2EE platform is a multi-tiered framework that provides system level services to facilitate application development.

More information

Servlet Fudamentals. Celsina Bignoli

Servlet Fudamentals. Celsina Bignoli Servlet Fudamentals Celsina Bignoli bignolic@smccd.net What can you build with Servlets? Search Engines E-Commerce Applications Shopping Carts Product Catalogs Intranet Applications Groupware Applications:

More information

About 1. Chapter 1: Getting started with odata 2. Remarks 2. Examples 2. Installation or Setup 2. Odata- The Best way to Rest 2

About 1. Chapter 1: Getting started with odata 2. Remarks 2. Examples 2. Installation or Setup 2. Odata- The Best way to Rest 2 odata #odata Table of Contents About 1 Chapter 1: Getting started with odata 2 Remarks 2 Examples 2 Installation or Setup 2 Odata- The Best way to Rest 2 Chapter 2: Azure AD authentication for Node.js

More information

Middleware. Adapted from Alonso, Casati, Kuno, Machiraju Web Services Springer 2004

Middleware. Adapted from Alonso, Casati, Kuno, Machiraju Web Services Springer 2004 Middleware Adapted from Alonso, Casati, Kuno, Machiraju Web Services Springer 2004 Outline Web Services Goals Where do they come from? Understanding middleware Middleware as infrastructure Communication

More information

Verteilte Systeme (Distributed Systems)

Verteilte Systeme (Distributed Systems) Verteilte Systeme (Distributed Systems) Karl M. Göschka Karl.Goeschka@tuwien.ac.at http://www.infosys.tuwien.ac.at/teaching/courses/ VerteilteSysteme/ Lecture 4: Operating System Support Processes and

More information

Outline. Project Goal. Overview of J2EE. J2EE Architecture. J2EE Container. San H. Aung 26 September, 2003

Outline. Project Goal. Overview of J2EE. J2EE Architecture. J2EE Container. San H. Aung 26 September, 2003 Outline Web-based Distributed EJB BugsTracker www.cs.rit.edu/~sha5239/msproject San H. Aung 26 September, 2003 Project Goal Overview of J2EE Overview of EJBs and its construct Overview of Struts Framework

More information

Selecting Enterprise JavaBeans Technology

Selecting Enterprise JavaBeans Technology Patricia Seybold Group Strategic Technologies, Best Practices, Business Solutions Selecting Enterprise JavaBeans Technology By Anne Thomas July 1998 Prepared for WebLogic, Inc. 85 Devonshire Street, 5

More information

Enterprise JavaBeans Benchmarking 1

Enterprise JavaBeans Benchmarking 1 Enterprise JavaBeans Benchmarking 1 Marek Procházka, Petr T ma, Radek Pospíšil Charles University Faculty of Mathematics and Physics Department of Software Engineering Czech Republic {prochazka, tuma,

More information

DESIGN PATTERN - INTERVIEW QUESTIONS

DESIGN PATTERN - INTERVIEW QUESTIONS DESIGN PATTERN - INTERVIEW QUESTIONS http://www.tutorialspoint.com/design_pattern/design_pattern_interview_questions.htm Copyright tutorialspoint.com Dear readers, these Design Pattern Interview Questions

More information

J2EE Web Development 13/1/ Application Servers. Application Servers. Agenda. In the beginning, there was darkness and cold.

J2EE Web Development 13/1/ Application Servers. Application Servers. Agenda. In the beginning, there was darkness and cold. 1. Application Servers J2EE Web Development In the beginning, there was darkness and cold. Then, mainframe terminals terminals Centralized, non-distributed Agenda Application servers What is J2EE? Main

More information

Websphere Server 8.5 Best Practices Oracle FLEXCUBE Universal Banking Release [December] [2016]

Websphere Server 8.5 Best Practices Oracle FLEXCUBE Universal Banking Release [December] [2016] Websphere Server 8.5 Best Practices Oracle FLEXCUBE Universal Banking Release 12.3.0.0.0 [December] [2016] Table of Contents 1. INTRODUCTION... 1-1 1.1 BACKGROUND... 1-1 1.2 BASICS OF WEBSPHERE... 1-1

More information

The team that wrote this redbook

The team that wrote this redbook Preface p. xix The team that wrote this redbook p. xix Comments welcome p. xxiii Overview of WebSphere Application Server V3.5 p. 1 What is WebSphere Application Server? p. 1 WebSphere Application Server

More information

OBJECTIVES. After completing Concepts, you will be able to:

OBJECTIVES. After completing Concepts, you will be able to: CHAPTER 2 CONCEPTS OBJECTIVES After completing Concepts, you will be able to: Describe the importance of intermediate bytecode to the portability of Java software. Describe the Java EE architecture of

More information

Virtual Credit Card Processing System

Virtual Credit Card Processing System The ITB Journal Volume 3 Issue 2 Article 2 2002 Virtual Credit Card Processing System Geraldine Gray Karen Church Tony Ayres Follow this and additional works at: http://arrow.dit.ie/itbj Part of the E-Commerce

More information

BEAWebLogic. Server. Introduction to WebLogic Server and WebLogic Express. Version 8.1 Revised: June 28, 2006 Part Number:

BEAWebLogic. Server. Introduction to WebLogic Server and WebLogic Express. Version 8.1 Revised: June 28, 2006 Part Number: BEAWebLogic Server Introduction to WebLogic Server and WebLogic Express Version 8.1 Revised: June 28, 2006 Part Number: 860-001002-012 Copyright Copyright 2003 BEA Systems, Inc. All Rights Reserved. Restricted

More information

JDBC Today C HAPTER 1 INTRODUCTION

JDBC Today C HAPTER 1 INTRODUCTION C HAPTER 1 JDBC Today INTRODUCTION Since its inception in 1995 the Java language has continued to grow in popularity. Originally intended as a language for embedded systems, the Java language has moved

More information

Vendor: SUN. Exam Code: Exam Name: SUN Certified ENITRPRISE ARCHITECT FOR J2EE(tm)TECHNOLOGY. Version: Demo

Vendor: SUN. Exam Code: Exam Name: SUN Certified ENITRPRISE ARCHITECT FOR J2EE(tm)TECHNOLOGY. Version: Demo Vendor: SUN Exam Code: 310-051 Exam Name: SUN Certified ENITRPRISE ARCHITECT FOR J2EE(tm)TECHNOLOGY Version: Demo QUESTION NO: 1 Which acts as a proxy to an EJB? A. home instance B. remote instance C.

More information

SCBCD EXAM STUDY KIT. Paul Sanghera CX JAVA BUSINESS COMPONENT DEVELOPER CERTIFICATION FOR EJB MANNING. Covers all you need to pass

SCBCD EXAM STUDY KIT. Paul Sanghera CX JAVA BUSINESS COMPONENT DEVELOPER CERTIFICATION FOR EJB MANNING. Covers all you need to pass CX-310-090 SCBCD EXAM STUDY KIT JAVA BUSINESS COMPONENT DEVELOPER CERTIFICATION FOR EJB Covers all you need to pass Includes free download of a simulated exam You will use it even after passing the exam

More information

Oracle Fusion Middleware 11g: Build Applications with ADF I

Oracle Fusion Middleware 11g: Build Applications with ADF I Oracle University Contact Us: +966 1 1 2739 894 Oracle Fusion Middleware 11g: Build Applications with ADF I Duration: 5 Days What you will learn This course is aimed at developers who want to build Java

More information

index_ qxd 7/18/02 11:48 AM Page 259 Index

index_ qxd 7/18/02 11:48 AM Page 259 Index index_259-265.qxd 7/18/02 11:48 AM Page 259 Index acceptance testing, 222 activity definition, 249 key concept in RUP, 40 Actor artifact analysis and iterative development, 98 described, 97 136 in the

More information