The most obvious step for improving the availability of applications running high-traffic Websites is to host them in environments designed for high availability. Availability in the infrastructure is typically achieved by building redundancies at all levels. But to fully leverage the availability built in an environment, application designers must design their applications with high availability in mind. It is important to be conscious of the fact that certain application design choices that would work well in a simple environment may not be as effective in a highly available environment. For applications that do not have the luxury of being deployed in a highly available environment, some design considerations can improve their availability.
Plenty of Web applications rely on JavaScript or some other client-side scripting, yet most developers only measure server-side execution time. Client-side execution time is just as important. In fact, if you're measuring from the end-user perspective, you should also be looking at network time. In this article Srijeeb Roy introduces a lightweight approach to capturing the end user's experience of application response time. He also shows you how to send and log client-side response times on a server for future analysis. Level: Intermediate
The transport-level server load balancing architectures described in the first half of this article are more than adequate for many Web sites, but more complex and dynamic sites can't depend on them. Applications that rely on cache or session data must be able to handle a sequence of requests from the same client accurately and efficiently, without failing. In this follow up to his introduction to server load balancing, Gregor Roth discusses various application-level load balancing architectures, helping you decide which one will best meet the business requirements of your Web site.
Fortunately, Java Native Interface gives us the flexibility that we require. JNI was developed as a way for Java applications to take advantage of platform-native resources; it allows the JVM to interoperate with applications and libraries written in C, C++, assembly, and several other languages. With JNI, not only can Java call native code but the native code can also create and manipulate Java objects. The result is that JNI allows full language interoperability, making it an ideal candidate for legacy application integration.
In the subsequent sections, I analyze some causes of memory leaks in enterprise Java applications using a sample application and a memory profiling tool. I also suggest strategies for detecting and plugging such leaks in your own projects.
This article presents a framework that can be used to develop search features modeled on Web searches. The framework simplifies the client code and is easily extensible in that implementations can extend the framework to provide various application-specific search features. A single application can contain several different implementations of this framework, each corresponding to a search by different business objects.
Many Web applications, especially those deployed for e-commerce, necessitate the transmission of sensitive data between the Web server and the client browser. This data could include passwords, credit card numbers, or bank account numbers -- any information users would not want divulged to the general public. To protect sensitive data during transmission, developers at Netscape Communications created Secure Sockets Layer (SSL) and its companion protocol, HTTP over Secure Sockets Layer (HTTPS). HTTPS employs SSL to protect data by encrypting it at the source, be it the server or the client, and decrypting it at the destination, thus preventing anyone monitoring Internet data transmissions from easily capturing this data. The client and server exchange public keys to enable encryption and decryption.
The solution, of course, is to use Java Native Interface (JNI) extensions. But what will this mean for Java's cross-platform capabilities? If your application is only 60% Pure Java, it won't run on other platforms -- so why use Java at all? Admittedly, Java has other benefits: the language is easy to learn and use, the code is simple to maintain and debug, and by using it you leave open the possibility of migrating to other platforms in the future -- if you design your application with such migration in mind.
To make the distinction clear, I'll call programs written as described at the beginning of the article as "not dynamically extensible." Now, I don't want you to think that not being dynamically extensible is some sort of a flaw. That is not necessarily so. Some programs shouldn't be dynamically extensible. However, many programs, including most shrink-wrapped applications, would benefit users greatly if they were.
JavaServer Pages (JSP) is a more flexible technology than servlets because it can respond to dynamic changes at runtime. Can you imagine a common Java class that has this dynamic capability too? It would be interesting if you could modify the implementation of a service without redeploying it and update your application on the fly.
As creator and director of the No Fluff Just Stuff Software Symposium Series, Jay Zimmerman is uniquely positioned to stay ahead of the curve in Java application development. In this year-end discussion with Andrew Glover, Jay addressed a wide range of questions about what Java developers were doing to manage software complexity in 2007, and which languages, frameworks, tools, and techniques could help you make Java application development fun again in 2008.
This article discusses possible migration strategies for moving applications written using EJB 2.1 or an earlier specification to an EJB 3.0-based architecture. The possible migration paths are evaluated from both the perspectives of design and implementation. This article does not intend to be exhaustive in illustrating the migration options. After reading this article, you should be able to choose the best option, within your own specific context, for migrating the legacy EJB code to the new specification.
There are a couple of disadvantages to the static class solution, however, and they aren't so obvious at first glance. When a value changes, you have to recompile the class -- a tad inconvenient, but not too much of a hassle. But what if this class is used to configure a cluster of applications on different machines? You have to distribute the newly recompiled class to all the hosts and make sure they're all in sync. And, you have to restart the applications in order for the changes to take effect.
Why JDBC? JDBC is Java's database API that adapts arbitrary SQL databases to Java and provides a common interface for using them. JDBC works by providing three Java interfaces -- Connection, Statement, and ResultSet -- which are implemented by vendor-specific drivers. The programmer just plugs in the correct driver and sends the correct SQL to access the database of his/her choice -- the rest of JDBC usage is essentially uniform.
In the past, you might have used log files to figure your application's runtime behavior. Or you might have written custom management interfaces to get runtime information, perform runtime administrative operations, or for sending alerts when something goes wrong. JMX makes it easy to instrument applications using MBeans, Java objects that represent manageable resources. With MBeans, JMX-enabled applications can be managed and monitored using JMX clients.
The Proxy pattern is an important and widely used design pattern in object-oriented programming. Do you ever use Proxy in Java since its introduction in JDK 1.3? A dynamic proxy class is a class that implements a list of interfaces specified at runtime. An implementation for the proxy's behavior can be provided at runtime through an InvocationHandler. So Proxy is an important class in Java's reflection package, and is widely used in many Java applications.
Despite the limitations of temporary destinations, there are definite advantages to their use in real-time applications. In this section, we will examine a representative messaging application using JMS.
This article is the first in a series of articles on Apache's Jakarta-Tomcat server. The Tomcat server is a Java-based Web Application container that was created to run Servlet and JavaServer Page web applications. It has become the reference implementation for both the Servlet and JSP specifications. The purpose of this first article is to give you a basic understanding of web applications. Once we have this basic understanding, we will be able to move on to discussions of Tomcat. This article assumes that you have a basic understanding of Servlets and JSPs.
How do you respond when a web application is running a little slow? If you are like me, you try to help it along by clicking on another link, refreshing the page, using the Back button, or otherwise sending more requests to the server. Although this may seem like an innocent way to get the site "unstuck," it really just makes the situation worse by increasing the load.
Structure of a Palm Application, Part 3 In this third excerpt from "Palm OS Programming, 2nd Edition," Neil Rhodes and Julie McKeehan discuss how the operating system communicates with an application when it's not running. This is the third in a series of three excerpts designed to familiarize developers with the structure of Palm apps.
What we need now is a tool that blends separately developed components into a well-crafted finished product; a tool that protects major subsystems of the architecture from each other. It should be easy to understand because of what it encourages: rapid development against a very modular environment. It should let you assemble applications from existing components, putting in as little glue as possible. And it should endeavor to simplify the need for highly customizable applications to have tailor-made functionality.
Imagine a Java Web application server that runs on Unix, delivers incredible performance, is really easy to set up, and inexpensive to boot. Even crazier, imagine that this little app server offers all of the features you expect from a modern Java server, including JSP/servlets, XML/XSL, and EJB/CMP.
Structure of a Palm Application, Part 2 In this second excerpt from "Palm OS Programming, 2nd Edition," Neil Rhodes and Julie McKeehan build on the terminology and conventions they introduced in the first excerpt and walk us through a sample application. This is the second in a series of three excerpts designed to familiarize developers with the structure of Palm apps.
Inexpensive and easy to set up. The system administrator only needs to make a few changes in the DNS server to support round robin, and many of the newer DNS servers already include support. It doesn't require any code change to the Web application; in fact, Web applications aren't aware of the load-balancing scheme in front of it.
The SMTPAppender makes it easy to broadcast application errors to your entire support team. Figure 2 shows an example email message from the SMTPAppender class.
All the work you have done on the application--identifying the modules and decoupling them with mediators--will now pay off. Since you had designed the WebMonitor to be scalable from the ground up, it is now easy to put the engine on a separate machine and even create several engines that can divide the load among them. Because the modules are decoupled by mediators, you do not need to rewrite the code inside of the modules but instead, simply use different mediators. This way, you can seamlessly scale up your distributed application to be used over many computers and easily handle heavy loads.
We start with a discussion of how an application is structured to run on the Palm OS. You will learn that a Palm application is an event-driven system and that its routines are structured to handle various types of events. We will describe an application's life cycle--its starting, running, and closing. To help solidify your understanding of these points, we provide a simple application, OReilly Starter, which is a prototypical Palm application. We walk you through its organization (for example, its source files, utility files, and so on) and then show you the source code in its routines. While the application doesn't do much, it contains all of the standard routines and has the correct structure for any Palm application. You can use it as the starting point for your own work.
Despite some of my prior comments, I do believe that there is a universal understanding of quality. People want to use applications that do things right and don't break. The problems arise when we continue to build applications with increasing levels of complexity and we don't effectively plan to manage that complexity. End users equate simple usage and minimal failures with quality. Each of the quality-related goals I noted earlier can be addressed with a variety of implementation approaches, but there will always be a need for a battery of testing to validate the results.
Learn about what I call "Web 2.01," a fusion of "Web 2.0" style application content with a "Rich Internet Application" client, which is not subject to many of the limitations of a web browser.
I even held a seminar, where we talked about RiA, Rich Internet Applications (http://jroller.com/page/jcarreira/20040403 ) I also spent time writing Flex (by Neville), such as:
At the end of September 2002, TheServerSide ported its codebase to be clusterable around BEA WebLogic 7, and Oracle 9iAS - the ultimate display of J2EE portability in action. We then wrote an article which discussed the task. Since that time, we have focused on adding features to TheServerSide, to expand the usefullness of the site to our users. Recently we worked with Sun and added Sun ONE Application Server to the cluster. The latest vendor to join in the fun is Novell. This article discusses the port of TheServerSide to Novell's exteNd Application Server.
Understanding the class loading architectures of major application server vendors helps J2EE developers design application packaging structures that are both portable and efficient. After a brief primer on the basics of class loading, the class loading hierarchies of three major application servers (BEA WebLogic 6.1 SP2, IBM WebSphere 4.0, and HP-AS 8 Maintenance Pack 3) are presented. The discussion is limited to J2EE application modules (.ear), EJB modules (.jar) and web application modules (.war). A familiarity with J2EE packaging mechanisms (.ear, .war, and .jar) is assumed; please see the References section for introductory material.
If you're not using 9i, then you could try a product called Times Ten. This is an in-memory database that is very, very fast and can act as a queryable cache for a back end database. If you are thinking of relying on some memory caching scheme to satisfy your queries then make sure that the cache can survive a database failure. Make sure the connection pool can remove 'stale' database connections to the fail database and will sensibly handle the situation where a connection is needed but the database is down. I mean, of course, that the application is notified that a connection is unavailable after a timeout. The pool should also handle the situation when the database comes back up and start returning connections again. How-ever, I'll cover this type of approach more in the third iteration section.
If an application is useful, then the network of users will grow crazily fast at some point. As more and more mission-critical applications are now running on Java EE, many Java developers are caring about scalability issues. However, most of popular Web 2.0 sites are built with script languages, and there are a lot of voices to doubt the scalability of Java Applications. In this article, Wang Yu takes real world cases as examples to explain ways on how to scale Java applications based on his experiences on the laboratory projects, and at the same time, bring together practice, science, algorithms, frameworks, and experience on failed projects, to help readers on building high scalable Java applications.
Allen Stoker is currently a Technologist with Liberty Mutual Insurance in Indianapolis and oversees the architecture of several applications in both the J2EE and Mainframe environments.
[1] A RESTful Core for Web-like Application Flexibility - Part 1 [2] A RESTful Core for Web-like Application Flexibility - Part 2 [3] A RESTful Core for Web-like Application Flexibility - Part 3 [4] A module's identifier should be globally unique; we recommend using a URN based on a reverse DNS name (such as urn:com:mycom:project1:workbench). [5] The resource representation for this remote address might also be found in the local cache; as long as it is still valid, as specified by its HTTP headers. [6] This trace of the request is through a prototypical forum application. The full details of the actual forum application are described in the 1060 Forum Guide, which includes details specific to NetKernel 3.3. [7] To be accurate, the syntax of the active: URI scheme requires that its arguments are also URI schemes, so the database request would be written more like this: active:sqlQuery+operand@resource:/topic-query+topic@data:text/plain,374+entry@data:text/plain,1 [8] See the Wikipedia entry for design patterns, which originated from the concept of architectural patterns.
This being TheServerSide.com, using the name of ?the other development platform? is probably about as welcome as using the name of ?the Scottish play? in a theatre! No, this isn?t a sell-out. Naked Objects is a Java framework, written by Java enthusiasts, and intended for use by Java developers. But we?ve discovered that Naked Objects will allow you to write a business application in Java and then deploy it, without modification, on either the Java or the .Net platforms. This ought to be seen as very good news for the Java community - it potentially positions Java as the de facto standard for specifying business functionality.
The first part of the headline to this article ('Fat is the new thin') is tongue-in-cheek: we copied it from a recent headline in the fashion world.. But we do claim that by using Naked Objects it is possible to gain all of the advantages of a rich-client interface, without sacrificing the advantages of the thin-client approach - and with other architectural advantages to boot.
This article is a synopsis of the topics covered in the book, "Developing Applications with Java and UML" published by Addison-Wesley (Nov 2001) by Paul R. Reed, Jr. Paul is president of Jackson-Reed, Inc. (www.jacksonreed.com), a training and consulting firm that focuses on the implementation of Object-Oriented and Distributed systems for clients in the United States, Europe, Asia, and the Middle East. Reach Paul at [email protected].
With full decoupling of clients and endpoints, the microkernel is able to schedule work across CPU cores analogous to the way a load balancer distributes work across servers in a large web site's server farm. Just as a browser has no clue whether a web site has a single server or ten thousand servers, client code in our architecture is unaware of whether the machine executing its request has only a single core or sixty-four cores. And that means that application software can scale up with the addition of CPU cores without the software developer writing any thread aware code. This is a very significant result because, as many know by now, writing code to perform well on multiple CPU cores is a challenging task.
[1] A RESTful Core for Web-like Application Flexibility - Part 1 [2] A RESTful Core for Web-like Application Flexibility - Part 2 [3] RFC 2396: Uniform Resource Identifiers (URI): Generic Syntax [4] The "active" URI scheme [5] In this example, a subsequent mapping of active:sqlQuery to a physical endpoint would be used to establish the connection to a database, execute the query, and return a result representation. Such a mapping need not be defined in each application module but could be imported from a commonly available relational database query module. [6] Since modules export only logical addresses, the coupling between modules is at a logical level. Modules are free to change the internal implementation of the services provided at the exported logical addresses. [7] Wikipedia entry for memoization
This is all fine until one starts to consider issues of system malleability. One way to think about this code is from the perspective of a client and a service. The program being written assumes the role of the client and the instance of the Date class is the service. This may not seem like a problem until you ask a question such as "How do I replace the Date service with an updated implementation while the system is running?". If you need to do this extrinsically (for example, you are managing a system and you need to replace a portion of the system with updated code) you have a problem. With a traditional Java application this is difficult since, as in our example above, the class has been loaded into memory and all symbolic references have been replaced with direct references. Adding this flexibility is possible, but comes at the cost of adding complexity (such as class-loading and management code) to the program.
Scheduling tasks in J2EE applications is a common need. There is more to job scheduling than running backups at 3 o'clock in the morning. Customer relationship management (CRM) applications, for example, need to contact customers periodically during the sales cycle. File transfer applications need to transmit and receives files on a regular basis, except on holidays. Administrative applications need to send reminder emails to notify employees and customers about important events. All these enterprise applications can benefit from job scheduling.
Without the right tools and techniques, tuning for performance can be unbearably difficult, yet you can't afford to turn your back on the process. It's absolutely critical. With the size and complexity of most Java applications, it's getting much more important to get an early handle on performance. Gartner estimates that only 14% of applications meet "all measured and tested response time estimates."
The year 2000 has seen Java 2, Enterprise Edition (J2EE) compliancy move out of the realm of marketing and into nine shipping products. J2EE vendor strategic positioning has continually changed, from focusing on core products, to an integrated range of J2EE services, to J2EE compliancy and finally to avoiding commoditization by leveraging J2EE servers as platforms for WebServices, Wireless and EAI development. The dominant players in the game have surfaced, but a variety of strategic takeovers may reshape J2EE app. server market share for 2001. In short, the server side java industry has gone through a whirl wind of change, this article will walk you through the years events and explain the trends and the players that will change the server side java landscape in 2001.
This article describes how to achieve a high level of performance in a J2EE application, independent of which Application Server you use. A structured approach to improving performance will be described that ranges from broad strokes (monitoring J2EE Application Server resource usage) to fine strokes (finding bottlenecks in the application). After reading this article you will find that performance isn't just an occasional activity--- performance is a state of mind.
The eMotherEarth application is featured in Art of Java Web Development. It is a modular Model 2 web application, making it is easy to change to use the Flyweight design pattern. The only code shown here revolves around changing boundary and controllers classes to implement caching. To download the entire application, you can go to www.nealford.com/art.htm to access the book's source code archive. The first step is to build the canonical list of products and place it in a globally accessible place. The obvious choice is the application context. Therefore, the Welcome controller in eMotherEarth has changed to build the list of products and place them in the application context. The revised init() and new buildFlyweightReferences() methods of the Welcome controller appears in listing 1.
At the end of September 2002, TheServerSide ported its codebase to be clusterable around BEA WebLogic 7, and Oracle 9iAS - the ultimate display of J2EE portability in action. We then wrote an article which discussed the task. Since that time, we have focused on adding features to TheServerSide, to expand the usefullness of the site to our users. Recently we worked with Sun and have added the newly re-written Sun ONE Application Server 7 to the cluster. This article discusses the work that was done making TheServerSide.com J2EE application run on the J2EE 1.3 certified Sun ONE Application Server 7.
As I mentioned earlier, a single thread of tasks will be the scalability bottleneck of the system. However, some single-thread jobs, such as processing or generating huge data sets, not only need to be paralleled to multithreaded or multiprocessed, but also have the requirement of scaling to multiple server nodes. For example, a Java EE project tested in our laboratory has a scenario to analyze the URL access patterns in their website from the logging files. The logging files would be accumulated more than 120 GB every week. Analyzing these logging files required four hours when using a single thread of Java application. This customer resolved this problem by using Hadoop Map-Reduce to scale it horizontally. Now, this URL access patterns analyzing program can not only be run in a multiprocessed mode, but also parallelized to more than 10 nodes, and it only spends 7 minutes to finish all the work.
In this article, I intend to create my own simple Hibernate-powered application that will be able to "understand" CMT. As mentioned above, I failed on my first attempt, but the second came together easily. I hope that the stages described in this article will help to those who are stuck on this problem.
In this article, we will take a look at using Maven 2 to help build a simple web application (a bit of business logic in a JAR and a JSP-based web application). By the end of this article, you should feel comfortable working with Maven 2, and ready to start using it as a much more satisfactory tool than Ant (or even your IDE).
Mark Jacobstein, EVP Corporate Development and Marketing, describes Loopt social networking application for mobile devices and the development issues of permissions, safety, and working with operators and other third party developers. He also discusses the various changes in social behavior that software like this are likely to bring.
In this article, we have shown a powerful technique that allows the developer to interact dynamically with any Java web application. The technique is based on the idea of sending scripts from the client side to run on the server side. The implementation we presented uses JavaScript to interpret the server-side scripts, although with a little effort it could be easily adapted to use a different scripting language for Java.
Rather than have developers repetitiously writing the common functionality found in nearly all Java-based web applications, Sun released the JSP Standard Tag Library (JSTL). Encouraging developers to move away from the Model 1 style of development with scriptlets, JSTL provides a standard implementation and usage syntax of this common functionality in the form of JSP tag libraries. JSTL has been widely adopted throughout the industry and other model-view-controller (MVC) frameworks, such as Spring Web MVC; Struts 1 and 2, have similar libraries.
Isn't Java Web Start (JWS) supposed to allow web-based distribution of applications? So why would one want to distribute a Java Web Start (JWS) application via CD-ROM? Well, for a number of reasons. For larger applications, a complete installation can still be a major download even with high-speed broadband. Secondly, not all desktops are online, and not all can access the internet (for corporate security reasons, for example). And, lastly, some people just like CDs.
Handling Java Web Application Input, Part 2 Cross-site scripting describes a variety of attacks against web applications, tricking them into executing code that compromises security. In this article, Stephen Enright shows how a combination of filtering and proper encoding can prevent such attacks.
Our key objective in this article is to get notified of application errors via the Yahoo Messenger API. What this means is that we need to get a Yahoo instant message (Yahoo IM) when there is an application error. Since we are dealing with log4j and Java, we need a Java API that allows us to invoke the functionality of Yahoo Messenger. There are quite a few Java APIs out there in the open source world that allow us to do exactly this. In this article, we will be looking at jYSMG, a Yahoo Messenger Java API.
Java Native Interface (JNI) is a mechanism that can be used to establish communication between native language programs and the Java virtual machine. The documentation for JNI and the technical literature on JNI deal extensively with interactions between the JVM and C/C++ code. The Java SDK even provides a utility to generate a header file to facilitate calling C/C++ programs from Java code. However, there is hardly any mention of Java and assembly language code working together. In an earlier article I showed how assembly language programs can be called from Java applications. Here I deal with the technique for invoking Java programs from an ASM process through a demo application that calls a Java method from assembly language code. The Java method brings up a Swing JDialog to show that it has, indeed, been launched.
Open ESB opens a new world of opportunities for enterprises to address business process management challenges. This session will provide a overview of how Java EE skills can be easily extended to solve some of the complex integration and business process management problems. It will also provide an overview of Open ESB, WS-BPEL 2.0 Implementation and the array of options to connect to enterprise services.
In this talk you will learn how to build a composite application using Open ESB. You will understand how to leverage existing enterprise applications by building a new class of applications called Composite applications.
This is the second article in a series on handling Java web application input. In part one, I talked about validation best practices and SQL injection attacks. In this article, I will continue the theme, and in particular will talk about the threat of cross-site scripting, as well as looking at correctly handling exceptions in J2EE web applications.
The NetBeans platform provides a complete application framework for creating modular, extensible applications. Modules for user interface, printing, intermodule communication, and many other services already exist in the platform. Using these existing, well-tested APIs can save you time developing a larger application.
As a result of the DST change, applications using time or time zone functionality in an older Java Runtime Environment (JRE) may report incorrect time between March 26 and April 2 2006. The time zone data in those environments contains outdated DST information for Australia.
Television viewers with Java-enabled digital television receivers will be able to receive and interact with Java TV applications while watching network programming. The tool for interacting with Java TV applications is the viewer's television remote.
The Java 2 Platform, Standard Edition (J2SE) 5.0 release provides comprehensive monitoring and management support. It not only defines the management interfaces for the Java virtual machine, but also provides out-of-the-box remote monitoring and management on the Java platform and of applications that run on it. In addition, JDK 5.0 includes the Java Monitoring and Management Console (JConsole) tool. It uses the extensive instrumentation of the Java virtual machine to provide information on performance and resource consumption of applications running on the Java platform using Java Management Extension (JMX) technology.
Sun Microsystems released the Java Application Platform SDK to streamline enterprise application development and improve developer productivity. The SDK also supports the newly released Java Platform, Standard Edition 6 and the latest technologies of the Java Platform, Enterprise Edition 5 (Java EE 5) Specification. It includes updated versions of Sun GlassFish Enterprise Server and Portlet Container. This free release is based on the source code developed by Sun engineers and the open-source community.
Creating a Web 2.0 web application with Ajax, a technology that includes but is not limited to Asynchronous JavaScript and XML, for seamless data interaction is a complex undertaking. To help you understand exactly what Web 2.0 is and how Ajax works to improve the user experience, the Java BluePrints program team developed the Java Pet Store 2.0 reference application. By exploring the use cases, design, and implementation of the Pet Store 2.0 application, you can learn more about building an application with similar functionality.
You can find web applications everywhere on the Internet. Many of these web applications are used to process online forms, tally voting polls, take orders within online stores, allow users to book a flight for their next business trip, or simply to display the user's login name. Which Java technologies do you need to create a web application and which packages do you need to import? The answer depends on what kind of application you're building and what it does.
With the growing need for information security in today's digital systems, SSL has become the universally accepted method for setting up authenticated and encrypted communication between clients and servers. This article will discuss how to use the Sun Java System Application Server 8.1 software (hereafter referred to as Application Server) to build SSL-enabled web applications and how to implement SSL client authentication in the Java 2 Platform, Enterprise Edition (J2EE) 1.4 security realm.
Have you heard of Java Blue Prints program? Java Petstore and Java Smart Ticket fall under this category. If you haven't heard of Adventure Builder the latest addition to the Java blue prints then you are not alone. However, if you have not heard of Java Petstore then probably you are not in the J2EE community for too long. Petstore reached its height of popularity during penultimate phase of the .COM boom era. You would find Petstore everywhere prominently from each booth of JavaOne to home pages of J2EE tools and application server vendors with their published and unpublished modifications. Even the guys in the .Net camps loved this application and not too long ago they created the fiasco with their Petstore vs. Petshop benchmark.
HTTP's statelessness, however, has proven a challenge in the context of Web-based applications that mimic traditional client-server designs. Traditional client-server applications typically maintain some connection state on both the client and the server, creating what appears to be a "persistent" connection between the two. The illusion of a persistent connection makes it easier to follow an event-driven programming paradigm, since the context for events passed between client and server is provided by the connection itself. Some event-driven client-server applications also allow the server to send messages to the client.
There are, really, two distinct notions of state: There is the explicit state that a developer might access through a distributed cache. But there is also the implicit state that is really a byproduct of the way the application is structured. It's that implicit state that the [enterprise] fabric uses to provide software-based fault-tolerance. Because that state information is propagated out to multiple machines in the fabric, the fabric will continue the work someplace else [in case of node failure].
Instead of developers having to worry about making their clustered POJOs implement Serializable, heap sharing and thread coordination across JVMs is "plugged into" the Java memory model: The Terracotta server knows what data changed in the application, and replicates only the object fields that have changed, and only to the nodes that need it, when those nodes need it. As a result, Terracotta eases application clustering burden, and allows enterprise applications to scale horizontally to a large number of nodes.
Building on examples or some reference code is a frequent developer practice. However, few IDEs curently support such a working style. In this JavaOne 2008 interview with Artima, CodeGear marketing director Jeff Anders explains Application Factories, a novel approach implemented in JBuilder 2008 that makes it easy to build an application by modifying a common reference code base:
Developers not directly involved in legacy migration projects may care little about how the applications they work on today will adapt to new environments and future technologies. Yet, application longevity—the ability for an application to keep pace with successive waves of new technologies, languages, and platforms—is a big concern for enterprises that foot the bill for today's development projects. Developing applications with longevity in mind can add value to a developer's work.
Find Your Application's Balance Java's power is its platform independence, but it comes at a cost—the specific features of each platform. The best approach is to build platform-independent applications that preserve the platform-specific features of their target environments. I hope this article helps you to find that golden balance.
This article presents an easy way to relieve Java developers from worrying about what to do with exceptions that don't relate directly to their applications, allowing them to concentrate on handling only the exceptions that affect the flow of their applications.
Clearly, the FMA and the Jiro technology implementation cannot be completely covered in the space of one article. Instead, I've concentrated on providing an overview of the architecture and getting you started with the Jiro technology. All examples used in the article were overly simplified, because management application programming is an inherently complex space.
My intent for including this information in my book was not to split hairs or try to complicate the issue, but to alert programmers to the danger of assuming pass-by-reference semantics in Java applications. If you assume pass-by-reference semantics in a Java application, you might write a swap method like the one above, then wonder why it doesn't work.
The Java platform's lightweight component class has many applications in customizing your help system. For example, you've already seen how to use the lightweight component class JHSecondaryViewer and the
You may have already acquired OmniFind and discovered how quick and easy it is to set up an index and start searching. You may have also discovered that the client search applications provided by OmniFind are J2EE based, intended to be run within a J2EE application server environment such as IBM's WebSphere®. This may be suitable for your client base if access is via a Web browser, but perhaps your end users rely exclusively on the Notes Client to access Domino. In that case, read on to find out how to add search functionality to your conventional Lotus Notes applications.
In this article, I begin to put that tinkering-and-learning clause to the test with an in-depth look at the anatomy of a Shale application. I start out by revisiting Shale's so-called starter application (which you'll quickly learn is more of a template) so that you can see exactly what it brings to Web application development. You use the starter application to build your own sample application, which you then use to explore the many files and directories that make up even the most basic Shale application. Along the way, I show you where your JSPs and Java? classes go and explain how Shale simplifies the process of building highly functional and customized Web applications.
Multithreaded applications often make use of the producer-consumer programming scenario, wherein repetitive jobs are created by a producer thread, passed to a job queue, and processed by a consumer thread. While this programming method is very useful, it often results in duplicate code, which can be a real problem to debug and maintain.
The java.util.Timer and java.util.TimerTask classes, which I'll refer to collectively as the Java timer framework, make it easy for programmers to schedule simple tasks. (Note that these classes are also available in J2ME.) Before this framework was introduced in the Java 2 SDK, Standard Edition, Version 1.3, developers had to write their own scheduler, which involved grappling with threads and the intricacies of the Object.wait() method. However, the Java timer framework is not rich enough to meet the scheduling requirements of many applications. Even a task that needs repeating every day at the same time cannot be directly scheduled using Timer, due to the time jumps that occur as daylight saving time comes and goes.
This article describes and compares various options for integrating mainframe applications with new applications--primarily Java? and J2EE applications--including both point-to-point and Enterprise Service Bus (ESB) based integration options.
Alex Roetter has several years of experience writing multithreaded applications in Java and other languages. He holds a B.S. in Computer Science from Stanford University. You can contact Alex at [email protected].
In this article, I'll introduce a continuations-based alternative that can simplify the development of complex Web applications. I'll start with an introduction to continuations, including an argument for how the continuations-based approach can be a shot in the arm for the traditional MVC style of programming. Then I'll move on to a simple example: an enterprise application that demonstrates the advantages of using continuations in terms of ease of development and understanding of the application code. Because one of the chief disadvantages of using continuations is their lack of support on the Java platform, I'll use the Apache Cocoon framework to demonstrate a JavaScript implementation of the example program and a pure Java language one. I'll conclude with an overview of the pros and cons of using continuations.
While there are many Web frameworks in the Java? ecosystem, they all are based, directly or indirectly, on the Servlets infrastructure. The Servlets API provides a host of useful features, including state management through the HttpSession and ServletContext mechanisms, which allows the application to maintain state that persists across multiple user requests. However, some subtle (and largely unwritten) rules govern the use of shared state in Web applications, of which many applications unknowingly fall afoul. The result is that many stateful Web applications have subtle and serious flaws.
To simplify the autonomic enablement of legacy applications, I have created a set of abstract Aspects and utility classes that can be extended to handle most possible event generation situations. (See Resources below for the download link.) Use this abstract Aspect layout to minimize what you have to define when you're ready to include this in your application. Your Aspect would at most contain two pointcut definitions (which simply define the package or call structure the Aspect is applied against) and a method that returns a string representation of the application name.
The features of different Web browsers, such as language settings and JavaScript support, can cause Web applications to work differently from one browser to another. This lack of continuity among browsers not only causes an application to look bad, but it often causes it to break. This article presents a number of tips you can follow to solve some of these problems.
The javax.tools package, added to Java SE 6 as a standard API for compiling Java source, lets you add dynamic capabilities to extend static applications. This article provides an overview of the major classes in the package and demonstrates how to use them to create a façade for compiling Java source from Java Strings, StringBuffers, or other CharSequences, instead of files. It then uses this façade to build an interactive plotting application that lets the user express a numeric function y = f(x) using any valid numeric Java expression. Finally, it discusses the possible security risks associated with dynamic source compilation and ways to deal with those risks.
What is the JCA application development process? How does EAB fit into it? Although there are no absolute rules for developing a JCA-based application, Figure 2 below shows a process that many developers using EAB have found effective when creating an application. It begins by developing the application in VisualAge for Java. By developing, we mean using the EAB tools to generate code that can access an EIS through the JCA connector and be called by your application. Once the code is generated, another tool in VisualAge for Java is used to test it. The WebSphere® Test Environment emulates the server, in this case, the WebSphere Application Server.
Multicast-based device discovery technology is the most frequently used device discovery technology in a private peer-to-peer network. In a wireless environment, where you can't apply multicast technology, you can use CISC to enhance a P2P application's performance. When designing, developing, and deploying device discovery technologies with critical requirements, you can learn useful methods from UPnP design and implementation.
It's no coincidence that I've written the requirements in three statements. Each maps directly onto a set of actions taken under specific conditions. Each condition should be recognized by a matcher. (For more on matchers and mailets, see the first part of this series.) For example, an e-mail sent to a specific address can be matched with the built-in RecipientIs matcher. Unfortunately, when I studied the source code for RecipientIs, I noticed that any number of recipients could be used and that any match was deemed appropriate. This is probably fine in most cases, but our application needs to make sure one and only one specified recipient is involved, so we'll develop a simple matcher that does this. The MatchSingleRecipient class we'll develop will also serve as a good introduction showing how you can put the Matcher API to work.
This article has described how easy it is to create a basic telecommunications application using SIP servlets. The use of open standards such as SIP, together with Java programming, has radically simplified the task of creating complex applications. Although not necessarily feature-rich, the contact center application has shown how a wide variety of hardware and software components based upon open standards can combine to produce an effective solution. Furthermore, the speed with which such solutions can be developed is an order of magnitude greater than ever before. Indeed, this solution took less than one month to complete, and a sizeable percentage of that effort was expended on the user interface! I encourage you to experiment with the SIP Servlet API and see for yourself just how quickly you use use it to help with your own problems.
For applications where data flow can be controlled, a central point for access decisions can make manageability easier. This model is useful for controlling access from external systems, users, and applications, as well as internally within the application.
If many users can request an identical search query (and the result is not in the millions of rows or changes very often), it makes sense to select the whole result set from the database and pre-cache it in the application server's memory. Subsequent queries would not result in expansive database hits, and will be served very quickly from the application server's memory.
In the meantime, feel free to reuse the Focus and Flow classes and let me know what interesting flows and their context you arrive at. I have not seen too many references to the issue of flow representation within an application except the fact that applications do have flows. One recent article points to the benefit of treating the flows as representable entities[1].
The digital certificates bind a particular public key with a particular person. They are issued by special kind of authorities (certification authorities) in strict security precautions, which guarantee their authenticity. We can think of the digital certificates as electronic documents, certifying that a given public key is property of a given person. In practice for the purposes of the digital signature, the most widely used are X.509 certificates.
As part of building this rudimentary user interface for the unit testing framework, I made some minor improvements to the core BBTest code. I also learned that you do not want to code a catch block to trap Throwable instances; otherwise, the BlackBerry generates some odd exceptions. I changed the BBTest code to catch RuntimeException instead. The RIM (Research In Motion, the company that makes the BlackBerry) Javadoc for Throwable discusses the details of this special implementation.
One of the best features of the Plone Content Management System (CMS) is the fact that you can define content types easily by using the Archetypes schema language. With Archetypes, you list the attributes of a content type and it takes care of all the details of persisting objects to Plone's object database, displaying objects in a web page, and providing edit forms and validation for users to create and update objects. When such objects reflect the entities of a business process, you create a new web application using only the schema language. For more information on working with the Plone Content Management System see the first article in this series The Plone Content Management System
What can I tell you about the attributes of the perfect application for a Grid environment? Or, should you be asking about the perfect Grid environment for your application? As much as you would like these two questions to lead you to the same answer, they rarely, if ever, do. In this article, I will discuss what I like to call the Application Grid—the perfect Grid setup for your application. I am staying away from the term "virtualization" because it is too abstract, and means different things to different people.
As more and more people use Web-based applications, the need for greater usability becomes obvious, particularly when you consider this in the context of the earlier example, and how much money would be lost in productivity each year just by having all Web users delete a single e-mail with current Web applications. Graduated Usability's effect doesn't need to be as extreme to have an impact on a business. What if a call center could save 5 to10 seconds per call just by using an RIA solution, or an online stock trade order could be executed a few seconds faster? The ability of RIAs to provide "cool" or "pretty" user interfaces made them a fad, but their ability to significantly increase an employee's productivity by allowing developers and designers to build applications that are more usable makes them a perfect platform to build your next Web application.
The NakovDocumentSigner framework is a working example that illustrates one particular approach for using digital signatures by Java-based Web applications. It deals with the problems that arises in signing documents on the client machine and verifying them on the server. It demonstrates how the standard functionality available in the Java platform can be exploited to sign files in Web, verify digital signatures, certificates, and certification chains. The framework is freeware and can be used in its original or modified form for any purposes, including as a part of commercial products.
Now that the overview of various authentication methods has been outlined, you can take a look at its use in the applications. The following application-specific areas will be covered:
In addition to the Logger class, there are a few other features that are interesting. One is the Handler. It takes the logs from Logger and further processes them. A handler has an instance of Formatter associated with it. For example, the XMLFormatter class formats the logs into XML, which is particularly useful for additional processing or sending the log record via SOAP to a central data collection facility.
Because most developers are firm believers in Murphy's law, it behooves you to examine ways of making applications as "failure-proof" as possible. This leads to better "availability," in market-speak—in other words, it means an application that is up and operational as much of the time as is possible.