Tuesday, March 4, 2014

J2EE



J2EE
 
       The Java EE project provides the core models and API for J2EE 1.2, 1.3, 1.4, Java EE 5, 6 specification levels artifacts. The core models are for creating and loading the Java EE artifacts Enterprise Applications, Application Clients, Web Applications, Web Services, Enterprise Java Bean and Connectors. All the Java EE core models exist in both org.eclipse.jst.j2ee.core org.eclipse.jst.jee plugins of the j2ee sub project. The details of each of core j2ee models usage and api are discussed in the following sections.

J2EE Programming

J2EE stands for java 2 platforms, enterprise edition. This book will describe how to build J2EE based application. The implementation is done with the help of XDoclet which simplifies the process of building an application.

What is J2EE

Short for java 2 platform enterprise edition. J2EE is a platform independent, Java- centric environment from sun for developing, building and deploying web based enterprise application online. The J2EE platform consists of a set of services, APls, and protocols that provide the functionality for developing multitired, web-based application.

At the client tier, J2EE supports pure HTML, as well as java applets or application. It relies on java servlet code to create HTML or other formatted data for the client. Enterprise JavaBeans provide another layer where the platforms logic is stored. An EJB server provides functions such as threading, concurrency, security and management. These services are transparent to the author.

Java Database connectivity, which is the java equivalent to ODBC, is the standard interface for java databases.

The java servlet APl enhances consistency for developers without requiring a graphical user interfaces.

J2EE Platforms
J2EE Java 2 Platform, Enterprise Edition is a Java designed for the scale computing typical of large. Sun Microsystems together with industry partners such as designed J2EE to simplify application development in a environment. J2EE simplifies application development and decreases the need for programming and programmer training by creating standardized, reusable modular components and by enabling the tier to handle many aspects of programming automatically.

J2EE includes many components of the Java 2 Platform, Standard Edition,
The Java Development Kit is included as the core language package.
Write Once Run Anywhere technology is included to ensure.
Support is provided for Common Object Request Broker Architecture, a predecessor of Enterprise JavaBeans, so that Java objects can communicate with CORBA objects both locally and over a network through its interface broker.
Java Database Connectivity 2.0, the Java equivalent to Open Database Connectivity, is included as the standard interface for Java databases.
A security model is included to protect data both locally and in Web-based applications.

J2EE also includes a number of components added to the J2SE model, such as the following,
Full support is included for Enterprise JavaBeans.  EJB is a server-based technology for the delivery of program components in an enterprise environment. It supports the Extensible Markup Language and has enhanced deployment and security features.
The Java API enhances consistency for developers without requiring a graphical user interface.
Java Server Pages is the Java equivalent to Microsoft’s and is used for dynamic Web-enabled data access and manipulation.

The J2EE architecture consists of four major elements,

The J2EE Application Programming Model is the standard programming model used to facilitate the development of multi-tier, thin client applications.

The J2EE Platform includes necessary policies and APIs such as the Java servlet and Java Message Service.

The J2EE Compatibility Test Suite ensures that J2EE products are compatible with the platform standards.

The J2EE Reference Implementation explains J2EE capabilities and provides its operational definition.

            J2EE is yet another acronym in the world of computing. This one stands for Java 2 Platform, Enterprise Edition. Its significance will become clear once we trace its lineage. First of all, Java is a programming language developed by Sun Microsystems, one of the giants of the industry. The Java Platform is a virtual machine, a processor look-alike that translates computerized instructions into functions.

The Java language is such that it allows cross-platform communication between multiple kinds of devices. For example, a can develop Java code on a and expect it to run on other computers, routers, and even mobile phones, as long as those devices are Java-enabled. This portability is described by the Sun acronym WORA, which stands for Write once, run anywhere. A large number of mainframes, computers, mobile phones, and other electronic devices operate using the Java Platform.

The 2 in the acronym J2EE stands for Version 2. As with many software applications, J2EE is Java Platform Version 2. Actually, the number 2 is often dropped nowadays, so J2EE becomes Java EE. Traditionally, though, it's still J2EE.

Now, on to the EE. It stands for Enterprise Edition, which is a powerful form of the Java Platform. Sun has created three editions so far. The most precise is the Micro Edition, which is used for mobile phones and PDAs. Following form, this can be abbreviated as Java ME.


           J2EE is actually a collection of technologies and APIs for the Java platform designed to support "Enterprise" Applications which can generally be classed as large-scale, distributed, transactional and highly-available applications designed to support mission-critical business requirements. 

          In terms of what an employee is looking for in specific techs, it is quite hard to say, because the playing field has kept changing over he last 5 years. It really is about the class of problems that are being solved more than anything else. Transactions and distribution are key.

There are 2 version of the Java Environments, J2EE and Se. SE is the standard edition, which includes all the basic classes that you would need to write single user applications. While the Enterprise Edition is set up for multi-tiered enterprise applications, or possible distributed applications. If you'd be using app servers, like tomcat or websphere, you'd want to use the J2EE, with the extra classes for n-tier support.

J2EE, strictly speaking, is a set of APIs as the current top answer has it which enable a programmer to build distributed, transactional systems. The idea was to abstract away the complicated distributed, transactional bits which would be implemented by a Container such as WebSphere or Web Logic, leaving the programmer to develop business logic free from worries about storage mechanisms and synchronization.

In reality, it was a cobbled-together, design-by-committee mish-mash, which was pushed pretty much for the benefit of vendors like IBM, Oracle and BEA so they could sell ridicously over-complicated, over-engineered, over-useless products. Which didn’t have the most basic feature.

J2EE traditionally referred to products and standards released by Sun. For example if you were developing a standard J2EE web application, you would be using EJBs, Java Server Faces, and running in an application server that supports the J2EE standard. However since there is such a huge open source plethora of libraries and products that do the same jobs as well as and many will argue better then these Sun offerings, the day to day meaning of J2EE has migrated into referring to these as well For instance a Spring Tomcat Hibernate solution in many minds.




Getting started with J2EE

         To explore how the J2EE is used in the enterprise, here are some additional resources,
SearchSOA.com columnist William Brogden discusses SOAP toolkits and the role SOAP attachments can play in the Java programming universe.
               The Java EE 5 platform has no shortage of critics who see it as too complex and difficult for developers working on Web services and SOA projects, but the platform also has its evangelists, one of whom is Kevin Schmidt, director of SOA at Sun Microsystems Inc. In a two-part Q&A, Schmidt talks first about the capabilities he sees Java EE 5 bringing to SOA. In the second part, he answers some of the criticisms leveled at the platform.

Definition

J2EE Java 2 Platform, Enterprise Edition is a development platform for creating distributed enterprise applications. J2EE is comprised of reusable modular components. 

Java 2 Platform, Enterprise Edition is the former name for Java EE, Java’s platform for servers. While the Java EE nomenclature, introduced in 2006, simply means Java Platform Enterprise Edition. The enterprise edition of Java is used for creating Web and enterprise applications.

Java 2 Platform Enterprise Edition Java-based software infrastructure. A standardized set of infrastructure software components written in the 'run-anywhere' Java programming language. 

Although owned by Sun, J2EE has been defined in collaboration with other leading vendors including IBM, Oracle and BEA. Today, it forms the basis of many of the leading web systems software platforms, including IBM WebSphere, BEA Web Logic, Sun ONE and the open-source JBoss. J2EE version 1.4, in beta until late summer 2003, incorporates full support for web services standards and introduces a J2EE version of the Java Connector Architecture, which simplifies connections and messaging from external resources.

The former name of Java EE Java Platform, Enterprise Edition. Originally the Java Professional Edition, the "J2" prefix was added for Version 1.2 in 1999 and dropped for Version 5 in 2006. 

Usage

J2EE services are conducted in the tier between the enterprise and the user's machine.

Explains J2EE

J2EE came into existence sometime in 1999 as one of the specialized platforms under Java 2. Other included platforms were J2ME for mobile devices and J2SE for regular applications. 

Developing a Java EE application requires the Java EE Software Development Kit. The SDK contains all the tools needed for building, testing and deploying a software application. For faster development, graphical Integrated Development Environments like NetBeans, JBuilder, and Eclipse can be used. Crucial parts of the Java EE SDK come from the combined efforts of Sun Engineers and the open source community known as Glassfish.

J2EE was designed to allow software to run on any hardware. In the old days, people had to write to the specific CPU chip and operating system and then the program was not portable across different types of equipment. Now, with Java running on so many platforms, the same code can be used. Write once, run everywhere

J2EE Project

The project vision is to extend eclipse platform with support for building multi-tier J2EE applications. The project will grow the community of eclipse users, and grow the community of developers that create Web applications based on the J2EE platform. In this way, we will help make eclipse the industry standard tool integration platform for development based on Open Standards and Technologies. The project must preserve the eclipse value proposition by providing integration, ease-of-use, function, and "coolness". Web artifacts must be first class citizens with respect to the capabilities that eclipse users expect. Servers must be first class execution environments, including both open and Commercial implementations, therefore encourage support of eclipse by server vendors.

J2EE Project Model

The J2EE Project model extends Web Project Model to support the development of J2EE applications in a variety of ways, projects divided across multiple related projects, or modules factored into one project that can host multiple artifacts. This includes support for,

J2EE Editor Model

The Editor Model will offer developers a set of APIs to access J2EE models, participate in build and refactoring activities, and allow them to easily create various text, and graphical editors for J2EE. 

J2EE Server Models

J2EE Application Servers are multi-tier distributed component-based products, typically implemented in Java, that reside in the middle-tier of a server centric architecture. They provide middleware services for security and state maintenance, along with data access and persistence. This model generally includes a Client Tier, a Middle Tier, and an EIS Tier. The Client Tier can be one or more applications or browsers. The J2EE Platform is in the Middle Tier and consists of a Web Server and an EJB Server these servers are also called containers. There can be additional sub-tiers in the Middle Tier. The Enterprise Information System tier includes the existing applications, files, and databases.

     Although based on the same standard, there are significant variations on how available servers support J2EE components, the way they are administered, started, stopped and how J2EE modules are managed, and how they support development time activities such as debugging and hot deployment and automatic refreshes.

J2EE Standard Tools

J2EE Standard Tools will provide extensible plug-ins for the development of J2EE Applications and support development, testing and debugging with a wide range of J2EE servers. Exemplar tools will support the development of Web Applications, Enterprise JavaBeans, Java Web Services, and support development, testing and debugging with standard compliant J2EE application servers specific additional extensions may be required. 

The interaction of JCM and the exemplar tools based on JCM will provide a healthy environment where requirements and APIs are based on actual needs. Tools will verify the APIs. This is a critical feature of the project in that JCM without tools, or tools without JCM, will not achieve our goal to provide a platform for high quality web development based on J2EE. 

J2EE Components

These models will represent J2EE standard modules, files, deployment descriptors and various other artifacts, associated natures, builders, validators and EMF models. They will at minimum include models for,

J2EE Model

This is a set of frameworks, and models, which provide the necessary abstractions and APIs to work and develop with J2EE Tools, and to build IDEs and tools to support these activities. JCM is not just an adaptation of the J2EE specifications, but it will focus on the additional requirements of developers and tool builders. JCM is naturally related to the models and tools defined in, and will address at a minimum the following areas


Goals for the J2EE Model and Tools

Divide and Conquer: Lots of components, so divide the work using the classical principle of hierarchy 

Layer Build Dependencies: J2EE Standards builds on the Web Standards, the J2EE Extensions build on the J2EE 

The structure of software reflects the structure of the organization that built it: We are building a platform and need to validate our API. 

Java 2 Platform, Enterprise Edition J2EE specification

This topic describes the Java 2 Platform, Enterprise Edition J2EE specification that is the foundation of the application programming model for WebSphere® Application Server. WebSphere programming model extensions add value by extending the J2EE programming model. Read this topic for a brief overview of key J2EE concepts, including the parts of the J2EE runtime environment and J2EE application packaging and deployment.

            The Java 2 Platform, Enterprise Edition J2EE specification is the standard for developing, deploying, and running enterprise applications. The ultimate source of information is the specification, which is available on the Sun Microsystems, at The WebSphere Application Server documentation provides links and J2EE descriptions for convenience only. 

For the specifications supported by this product version, which include the J2EE 1.4 specifications and continued support for some earlier specification levels,
For information about specification levels that are deprecated in this version,

Java 2 Platform, Enterprise Edition defines a standard that applies to all aspects of designing, developing, and deploying multi-tier, server-based applications. The standard architecture that is defined by the J2EE specification is composed of the following elements,

Standard application model for developing multi-tier applications.

Standard platform for hosting applications.

Compatibility test suite for verifying that J2EE platform products comply with the J2EE platform standard.

Reference implementation providing an operational definition of the J2EE platform.
The J2EE platform specification describes the run-time environment for a J2EE application. 

This environment includes application components, containers, and resource manager drivers. The elements of this environment communicate with a specified set of standard services.

J2EE Benefits

The J2EE specification provides customers a standard which can be used to ensure investment protection when purchasing or developing applications. Comprehensive, independent Compatibility Test Suites ensure vendor compliance with J2EE standards.

Some benefits of deploying to a J2EE-compliant architecture include,
A simplified architecture that is based on standard components, services, and clients. The architecture maximizes the write-once, run-anywhere Java technology.

Services providing integration with existing systems, including Java Databases Connectivity, Java Message Service, Java Connector Architecture Java Interface Definition Language the JavaMail API, and Java Transaction API for reliable business transactions.

Scalability to meet demand, by distributing containers across multiple systems and using database connection pooling, for example.

A better choice of application development tools and components from vendors providing standard solutions.

A flexible security model that provides single sign-on support, integration with legacy security schemes, and a unified approach to securing application components.

The J2EE specifications are the result of an industry-wide effort that involves a large number of contributors. IBM has contributed in defining more than 80 percent of the J2EE APIs.

Application components and their containers

The J2EE programming model has four types of application components, which reside in these types of containers in the Application Server
Enterprise beans - Run by the Enterprise JavaBeans container
Servlets and Java Server Pages files - Run by the Web container
Application clients - Run by the application client container
J2EE containers provide runtime support for application components. There must be one container for each application component type in a J2EE application. By having a container between the application components and the set of services, the J2EE specification can provide a federated view of the APIs for the application components.

A container provides the APIs to the application components that are used for accessing the services. The container can also handle security, resource pooling, state management as well as naming and transaction issues.

Standard services

The J2EE platform provides components with a set of standard services that they can use to interact with each other. See the for descriptions of each standard service.

J2EE packaging

During a process called assembly, J2EE components are packaged into modules. Modules are then packaged into applications. Applications can be deployed on the application server. Each module and application contains a J2EE deployment descriptor. The deployment descriptor is an XML file that provides instructions for deploying the application. For product-specific details,

J2EE platform roles

The J2EE platform also defines a number of distinct roles that are performed during the application development and deployment life cycle,

The product provider designs and offers the J2EE platform, APIs, and other features that are defined in the J2EE specification for purchase.

The tool provider offers tools that are used for the development and packaging of application components as part of the J2EE specifications.

The application component provider creates Web components, enterprise beans, applets, or application clients to use in J2EE applications.

The application assembler takes a set of components that are developed by component providers and assembles them in the form of an enterprise archive file.

The deplorer is responsible for deploying an enterprise application into a specific operational environment that corresponds to a J2EE platform product.

The system administrator is responsible for the operational environment in which the application runs.

Product providers and tool providers have a product focus. Application component providers and application assemblers focus on the application. Deplores and system administrators focus on providing the J2EE application with platform-specific artifacts, and on the platform run time.
These roles help identify the tasks and people involved. Understanding this separation of roles is important because it helps to determine the approach when developing and deploying J2EE applications.

Application Model
 
      The org.eclipse.jst.j2ee.application package contains all the api for creating an Application module and the nested modules Application Client, Web, EJB and Connector in the Application.
 
The snippet of code below shows how to create an Application,
 ApplicationFactory.eINSTANCE.createApplication();

The ApplicationFactory interface has addtional api to create j2ee modules as listed below
                               WebModule createWebModule();
                               JavaClientModule createJavaClientModule();
                               EjbModule createEjbModule();
                               ConnectorModule createConnectorModule();
                               ApplicationPackage getApplicationPackage();
                                             

             The Application needs to have a minimum of one module as per J2EE specification. The modules can be created as standalone modules or along with an EAR with the module added to the EAR. The standalone module creation api are mentioned in the corresponding module sections below. The following diagram depicts all the elements in the Application that constitutes the Enterprise Application resource. The Application needs to have a minimum of one module as per J2EE specification. The modules can created as part of EAR creation or individually as standalone modules. The UML model below depicts the elements of an Application and that constitute the application.xml file.


Web Application Model

The web application java package contains all the model api for creating and accessing the elements context-param, servlet, servlet-mapping, session-config, mime-mapping, welcome-file-list, error-page, taglib, resource-ref, security-constraint, login-config, security-role, env-entry of a Web App. The Web App and Web Resource Collection are the interfaces through which all the elements of Web Application module can be accessed. The web application package contains the concrete implementation of the interface provided in the org.eclipse.jst.j2ee.web application package. The following diagram depicts all the elements of a Web Module deployment descriptor that constitutes the Web Archive 

The snippet of code below shows how a WebArtifactEdit is accessed from a Web component to get the list of all the servlet in the web module.

                                                             public List getServlets(IVirtualComponent webComponent) { 
                                                             WebArtifactEdit webArtifactEdit = null; 
                                                             try { 
                                                                            webArtifactEdit = WebArtifactEdit.getWebArtifactEditForRead(webComponent); 
                                                                            return webArtifactEdit.getWebApp().getServlets(); 
                                                             } 
                                                             finally { 
                                                                            if(webArtifactEdit!= null) 
                                                                                            webArtifactEdit.dispose(); 
                                                                                            } 
                                                             }
                                              
Connector Model
 
      
 The org.eclipse.jst.j2ee.jca java package contains all the interfaces and api for creating and accessing the elements vendor-name, spec-version, eis-type, version, license, resource adapter, activation-spec of an Connector module. The Connector interface contains the entire api for accessing the elements of an Connector module. The Resource Adapter interface provides the entire api for accessing the elements of the internals of an Connector modules. The following diagram depicts all the elements of a Connector resource that constitutes Resource Archive. 

Web Service Model

The org.eclipse.jst.j2ee.webservice.wsclient java package contains all the interfaces and api for creating and accessing the elements ports, handlers, service Refs, components Scoped Refs etc, of a Web Services Client resource. The Web service client Factory interface contains all the api for creating the elements of a Web Service Client. The Component Scoped Refs, Handler, Port Component Ref, Service Ref interfaces contain the api for accessing the internal elements of a Web Services client resource. The org.eclipse.jst.j2ee.webservice.wsdd package contains the api to access the elements of Web Services Deployment Descriptor. The WsddFactory interface contains the api for creating the elements of a WSDD resource. The following diagram depicts all the elements of a WSDD and the Web Services Client resource.


No comments:

Post a Comment