Adobe Flex Getting ready for Open Source

Adobe Systems Inc. today unveiled a new version of its Flex SDK development tool set, code-named Moxie, along with plans to provide its code to the open-source community.

The next version of the standards-based language and programming model, slated to ship by the end of the year, will be available under the Mozilla Public License (MPL) now used by the Mozilla Foundation and by Sun Microsystems Inc. for its Open Solaris operating system, Adobe said.

MPL requires that changes made to the code be kept under the MPL license, and those who make the changes cannot freely distribute the altered code.

The open-source move was prompted by the increasing use of the Flex tools to build rich Internet applications — Web applications that include the rich features of desktop applications but the ease of maintenance of a Web application, said Phil Costa, director of product management for Flex.

“[Flex] has reached a critical mass of people developing on the technology and partners extending the technology that by moving it into an open-source project, we can really grow the community and get the developers more involved in extending Flex,” he said.

“[The MPL] strikes the right balance between being true to the spirit of open source … but also being friendly to the needs of commercial vendors like ourselves,” Costa said.

Adobe in June will be setting up a Web site where daily builds for the next version of Flex SDK will be posted, he added. The site will include a public bug database for users to enter bug reports or other enhancement requests.

Flex SDK and other Flex products will still be available under commercial licenses

Original Source

Computer World

Basic Servlet Archietecture

A Servlet, in its most general form, is an instance of a class which implements the javax.servlet.Servlet interface. Most Servlets, however, extend one of the standard implementations of that interface, namely javax.servlet.GenericServlet and javax.servlet.http.HttpServlet. In this tutorial we’ll be discussing only HTTP Servlets which extend the javax.servlet.http.HttpServlet class.

In order to initialize a Servlet, a server application loads the Servlet class (and probably other classes which are referenced by the Servlet) and creates an instance by calling the no-args constructor. Then it calls the Servlet’s init(ServletConfig config) method. The Servlet should performe one-time setup procedures in this method and store the ServletConfig object so that it can be retrieved later by calling the Servlet’s getServletConfig() method. This is handled by GenericServlet. Servlets which extend GenericServlet (or its subclass HttpServlet) should call super.init(config) at the beginning of the init method to make use of this feature. The ServletConfig object contains Servlet parameters and a reference to the Servlet’s ServletContext. The init method is guaranteed to be called only once during the Servlet’s lifecycle. It does not need to be thread-safe because the service method will not be called until the call to init returns.

When the Servlet is initialized, its service(ServletRequest req, ServletResponse res) method is called for every request to the Servlet. The method is called concurrently (i.e. multiple threads may call this method at the same time) so it should be implemented in a thread-safe manner.

When the Servlet needs to be unloaded (e.g. because a new version should be loaded or the server is shutting down) the destroy() method is called. There may still be threads that execute the service method when destroy is called, so destroy has to be thread-safe. All resources which were allocated in init should be released in destroy. This method is guaranteed to be called only once during the Servlet’s lifecycle.
Basic Servlet Archietecture