Friday, October 25, 2013

SOA - SERVICE ORIENTED ARCHITECTURE

SOA SUPPORT IN J2EE
Platform overview
J2EE or Java EE-Java 2 Platform Enterprise Edition
Java EE is the industry standard for developing portable, robust, scalable and secure server-side Java applications. (Sun Microsystems)
Types of Platform
Java 2 Platform Standard Edition (J2SE)
Java 2 Platform Micro Edition (J2ME)
Java 2 Platform Enterprise Edition (J2EE)
Relevant layers of the J2EE platform



J2EE specifications
Java 2 Platform Enterprise Edition Specification
Java API for XML-based RPC (JAX-RPC)
Web Services for J2EE
Architecture components – Used to build J2EE web application
Java Server Pages (JSPs)
Struts
Java Servlets
Enterprise JavaBeans (EJBs)
Runtime Environments
Provides additional runtime layers & API
Support two types of Component container with JAX-RPC
EJB container
Designed to host EJB components
Provides a series of enterprise-level services
Web container
   Extension to a Web server
 Used to host Java Web applications consisting of JSP or Java servlet components.
 Provide runtime services for processing of JSP requests and servlet instances.
Programming Languages
J2EE Standard Java language can be used to build Web services.
E.g.. Rational Application developer from IBM, JDeveloper from Oracle
J2EE Programming languages are
APIs
service providers
Service Requestors
Service agents
Platform extensions
APIs
Some of the relevant APIs to building SOA are
Java API for XML Processing (JAXP)
Process XML document content using a number of available parsers.
Support Document Object Model (DOM) and Simple API for XML (SAX)
transform and validate XML documents using XSLT stylesheets and XSD schemas
Packages includes
javax.xml.parsers
org.w3c.dom & org.xml.sax
javax.xml.transform


Java API for XML-based RPC (JAX-RPC)
Most popular SOAP processing API
Support both RPC-literal, document-literal request-response exchanges and one-way transmissions
Packages
javax.xml.rpc & javax.xml.rpc.server
javax.xml.rpc.handler & javax.xml.rpc.handler.soap
javax.xml.soap & javax.xml.rpc.soap

Java API for XML Registries (JAXR)
Offers a standard interface for accessing business and service registries.
 Devp for ebXML directories, Support for UDDI.
Packages
javax.xml.registry
javax.xml.registry.infomodel

Java API for XML Messaging (JAXM)
asynchronous, document-style SOAP messaging API
Used for one-way and broadcast message transmissions
SOAP with Attachments API for Java (SAAJ)
Managing SOAP messages requiring attachments
Imp. of SOAP with Attachments (SwA) 
Java Architecture for XML Binding API (JAXB)
Generating Java classes from XSD schemas and abstracting XML-level development.
Java Message Service API (JMS)
Java-centric messaging protocol 
Providing reliable delivery features not found in typical HTTP communication.

Service Providers (SP)
Typically implemented as servlets or EJB components.
JAX-RPC Service Endpoint
Imp as a servlet by Web container logic
Used within web container
EJB Service Endpoint
 Required when runtime features only available within an EJB container
 EJB component ---Stateless Session Bean.
Service Endpoint Interface (SEI)
 Follow the JAX-RPC WSDL-to-Java mapping rules

Service Implementation Bean
A class is built by a developer to house the custom business logic of a Web service. 
The Service Implementation Bean can be imp as
 EJB Endpoint (Stateless Session Bean) 
referred to as an EJB Service Implementation Bean 
resides in the EJB container
JAX-RPC Endpoint (servlet)
called as JAX-RPC Service Implementation Bean 
deployed in the Web container.


Service Requestors (SR)
Uses JAX-RPC API to create three types of client proxies
Generated stub or (Stub)
Auto-generated by JAX-RPC compiler (at design time) by consuming SP WSDL, and producing a Java-equivalent proxy component.
 Produces a static proxy  
Dynamic proxy and dynamic invocation interface 
Actual stub is not created until its methods are           invoked at runtime
Allows for fully dynamic interaction between a Java component and a WSDL definition at runtime.

Service Agents
Perform a variety of runtime filtering, processing, and routing tasks.
E.g.. Process of SOAP header processing
JAX-RPC API allows for the creation of specialized service agents called Handlers 
Handlers can process SOAP header blocks 
 messages sent by J2EE service requestors 
 messages received by EJB and JAX-RPC Service Endpoints.
Multiple handlers process different header blocks in same 
SOAP message. (called as handler chain).

Primitive SOA support
Some primitive SOA characteristics are
Service encapsulation
Loose coupling
Messaging – via JMS protocol
JMS- Java Message service

Principles of service-orientation by J2EE
Autonomy- JAX-RPC , EJB Service Endpoints 
Reusability- service can encapsulate one or more new or existing EJB components
Statelessness- does not maintain its state
Discoverability- JAXR- represent UDDI for publishing & issuing searches


Contemporary SOA support with J2EE
Based on open standards
Supports vendor diversity
Intrinsically interoperable
Promotes federation
Architecturally composable
Extensibility
Supports service-oriented business modeling
Logic-level abstraction
Organizational agility  
Enterprise-wide loose coupling



No comments:

Post a Comment