440 likes | 590 Views
Presentation to LaSalle University’s CIS 679: Middleware Architecture Class Java’s Role in Enterprise Middleware Gene Wenning gwenning@liveprecision.com March 20, 2006. Outline. Introduction to Java What is Java? How is a Java Program Developed? Java is a Platform
E N D
Presentation to LaSalle University’s CIS 679: Middleware Architecture Class Java’s Role in Enterprise Middleware Gene Wenning gwenning@liveprecision.com March 20, 2006
Outline • Introduction to Java • What is Java? • How is a Java Program Developed? • Java is a Platform • J2EE: Java’s Role In Enterprise Middleware • Logical Application Tiers • Logical Architecture • Container Frameworks • Other Relevant Frameworks • Communication Mechanisms • Support for XML • Support for Security
Outline • Java’s Next Big Thing in Middleware: Java Business Integration (JBI) API • Closing Thoughts on Java • Preparation for future demonstration (4/24/2006) of a Custom Developed, Java Message Broker by reviewing • Driving Requirements for the Message Broker • Review the Use Cases that will be demonstrated
What is Java? • Java is a high level programming language that: • is object oriented • supports concurrent programming via threading • can be executed on many machines and vendor operating systems • can be “written once” and “executed anywhere” • is free subject to the acceptance of a reasonable licensing agreement with Sun Microsystems As adapted from Sun’s Java Tutorial http://java.sun.com
How is a Java Program Developed? • A Java software developer kit (JDK) is obtained from either Sun Microsystems or your hardware vendor of choice • You install the JDK • You set up Java’s environment variables • JAVA_HOME: specifies where Java’s SDK resides in your file system • PATH: edit this to include Java’s “bin” directory within your computer’s execution path (i.e. a list of places where it should look to find programs to run) • You can write Java program’s in a simple text editor • Only rule… all programs must end in .java in order for the compiler to recognize them • You compile your Java to progam to byte code • You execute your byte code within a Virtual Machine • The virtual machine interprets the byte code and interacts with the native operating system to accomplish your program’s tasks
How is a Java Program Developed? Runs in the Java Virtual Machine Runs in the Java Virtual Machine Picture taken from Sun’s Java Tutorial
Java is a Platform • A platform is the hardware or software environment in which a program runs • Typically described as a combination of the operating system and underlying hardware • The Java Platform is a software-only platform that runs on top of other platforms (e.g. Microsoft Windows, Mac O/S, Sun Solaris, etc.) • Consists of two components: • Virtual Machine (JVM) • Application Programming Interface (API)
The Java Platform • JVM interprets compiled Java byte code into machine dependent instructions • JVM actually resides in a package called the Java Runtime Edition (JRE). • Bundled within the JDK • Enables execution of Java programs without the bloat of the JDK
The Java Platform (continued) • An API is a set of routines provided in libraries that extends a language's basic functionality • Java calls libraries “packages”. • Packages typically are compressed in a form similar to a ZIP file called Java Archive files (i.e. jars). • Java programs are always defined as “Classes” because Java is object oriented • Classes are sometimes referred to as “Beans”. • Drives the saying “Beans are in the Jar” • Two types of API’s exist in Java • Interface Specifications: Non-Functional Libraries • Implementations: Functional Libraries
The Java Platform (continued) • Use of an Interface Specification API library always requires the use of an implementation library • Typically used when implementation is vendor dependent and is not a native resident of the hardware platform on which Java is executing • Java’s Database Connectivity (JDBC) API is an example of an interface API (i.e. jdbc.jar) • Oracle’s JDBC implementation for Java version 1.4 or later is required to use the JDBC API to interact with Oracle (i.e. ojdbc14.jar) • Both “jars” (i.e. interface and implementation) must be within the program’s executable path to function correctly.
The Java Platform (continued) • Examples of native implementation libraries resident within Java platform • Input / Output • Math • Native Interface (JNI) • JNI enables applications written in C/C++ to interoperate with Java applications on the same machine • C/C++ can initiate a JVM within its thread of execution, start a Java application, and receive a result • Java application can call C/C++ application and receive a result • JNI is significant because it enables legacy C/C++ applications to benefit from Java’s vast libraries / frameworks (e.g. web enablement of legacy applications)
Figure 1-5 Java EE Server and Containers The Java Platform (continued) JNI in Action Memory Monitor consists of spawned concurrent thread always running withinWeb Container Any Legacy Supported Server Legacy Adapter Service “C” IMAN Main “C” ITK Main Start-up Thread of Execution (always running) Java Native Interface Java Virtual Machine Apache Tomcat Web Application Memory Monitor Service Call Thread of Execution spawned by Tomcat Web Container(lives only for the duration of the call) Apache Tomcat Only “hand coded” portions of framework Java Native Interface “C” PDM API “C” Vendor API Logical IP
The Java Platform (continued) • Java groups their API libraries into three categories • J2SE: Standard Edition • J2EE: Enterprise Edition (http://java.sun.com/j2ee/1.4/docs/api/index.html) • J2ME: Micro Edition (http://java.sun.com/j2se/1.5.0/docs/api/index.html) • Not going to cover this… this is really a platform in itself for programming on devices (e.g. cell phones) that have small memory footprints • J2SE • All of its API’s can run within the J2SE JVM • J2EE • Most of J2EE’s API’s can run within the JVM shipped with J2SE • For example, Java’s Messaging Service (JMS) • Those that cannot run in the JVM require the implementation of a J2EE Container to execute • Note that these “containers” run within the JVM shipped with the J2SE. Said another way… J2EE does not ship a different JVM.
The Java Platform (continued) • One big weakness in the Java Platform • You should not use Java for real-time programming (i.e. when the time between programmatic operations is required to occur at predictable times) • Due to JVM’s memory manager running concurrently at unpredictable times • To address this limitation, in January 2006 the JCP released a reference implementation and interface specification called the Real-time Specification for Java
Figure 1-5 Java EE Server and Containers J2EE’s Logical Application Tiers Typical to find web and business tiers consolidated with standard beans in lieu of EJBs ApplicationClient Browser Client Tier JSP Servlet Web Tier JCA EJB JCA EJB Business Logic Tier Legacy Application Legacy Application EIS Tier Database Database Database / Legacy Tier
Figure 1-5 Java EE Server and Containers J2EE Logical Architecture Client Machine Server Machine Browser Web Container HTTP JSP Servlet Server Machine ApplicationClientContainer HTTP ApplicationClient RMI / Direct Database JDBC EJB Container RMI / JMS / JCA EJB EJB Legacy Application JCA / JMS Client application containers are typically based on J2SE
J2EE Containers • Two types: • Web Container: Manages the execution of Java Server Pages (JSP) and servlet components • An example implementation is the Apache Software Foundation’s (ASF) Tomcat server. • Enterprise Java Bean Container: Manages the execution of Enterprise Java Beans (EJBs) • Example implementations include: Sun’s J2EE Application Server, JBoss, Oracle Application Server, IBM’s WebSphere Application Server, BEA WebLogic • Both container types can be supported by a single J2EE Server • In examples above, only Tomcat is a pure web container
J2EE Containers (continued) • Containersare nothing more than J2SEapplications running within a JVM • EJB Containers are useful because they handle transaction and state management, multithreading, resource lookup and pooling, and other complex low-level details • EJB Containers can generate the software necessary to persist / store an EJBs state within a database • Known as Container Managed Persistence (CMP) • EJBs can also manage their own persistence • Known as Bean Managed Persistance (BMP)
J2EE Containers (continued) • Think of J2EE Containers as frameworks to aid the application development and support processes • EBJ Container Pros and Cons • Pros • Better software reuse • Ability to isolate business logic and allow that logic to be reused from many different application client types (i.e. thin, rich) • Cons • Programmers must follow the container’s rules • No management of EJB / servlet lifecycle • No management of resource pooling • No creation of threads • Performance complaints when using CMP • Complex to: install, configure, support
J2EE Containers (continued) • A single container can support multiple J2EE applications concurrently • Process of loading an application into a container is known as deployment • Containers support the following actions on an application • Start • Stop • Deploy • Undeploy
J2EE Containers (continued) • Three types of EJBs • Session Beans • Associated with one EJB Client. • Created and destroyed by the particular EJB Client that is using it. • Can be stateful or stateless • Do not survive a system shutdown / restart cycle • Entity Beans • Always stateful • Bean may be shared by multiple EJB Clients. • States can be persisted across multiple invocations. • Survive a system shutdown / restart cycle • Message Driven Beans • Activated by the arrival of a message on a JMS queue
J2EE Containers (continued) • EJB Containers also support ResourceAdapters that comply with Java’s Connector Architecture (JCA) • Support access to legacy enterprise information systems (EIS) (e.g. SAP) • A resource adapter is a software component that allows a J2EE application to access and interact with the underlying resource manager of the EIS using socket level programming • Think of JCA as a “thick” adapter
J2EE Containers (continued) • Complexity of EJB containers has limited their widespread adoption • Takes careful planning and thought to leverage their services • JCA is still in its infancy… some major application vendors (e.g. SAP) have provided implementations but the current thrust is toward SOA concepts using web services in lieu of “thick” adapters • JCA’s technical architecture is more mature to web services from a quality point of view but market forces are dominating
Other Relevant Java Frameworks • Java’s API for Web Services (JAX-WS) • Enables Java applications to be “web service” enabled • Auto-generates: • Client bindings for Java to call another web service from a consumed Web Service Description Language (WSDL) document • Generates the WSDL document and associated request/response servlets from a Java API interface • Artifacts are deployed in the web container • Could also be used as a J2EE communication mechanism • Eliminates need for previous frameworks such as Apache’s AXIS and JCA
Other Relevant Java Frameworks • Java Web Start • Provides a platform-independent, secure, and robust deployment technology via the web. • Full featured Java applications are launched on the client machine from a click in the browser • Unlike applets, downloaded application runs independently of the browser – expect to see a more rich clients • Apache’s Struts • Model, View, Controller (MVC) framework for the web tier • Apache’s Another Neat Tool (ANT) • Platform independent build environment similar to C’s “make” • Much larger than “make”, can also work with C/C++ and .Net
Java’s Communication Mechanisms True Communication Protocols • HTTP / HTTPS / FTP/ REXEC / SMTP • Java’s Remote Method of Invocation (RMI) • Enables Java applications / objects running within either a J2SE JVM or J2EE container to intercommunicate with another Java application / object in another J2SE JVM or J2EE container • Common Object Request Broker Architecture (CORBA) • Enables Java applications / objects running within either a J2SE JVM or J2EE container to intercommunicate with remote C/C++ applications • Java’s Native Interface (JNI)
Java’s Communication Mechanisms (continued) API’s to vendor specific implementations (continued) • Java’s Database Connectivity (JDBC) • Enables Java applications to communicate with databases (e.g. Oracle, SQLServer, DB2, Teradata, etc.) in a uniform way • Java’s Messaging Service (JMS) • Enables Java applications to communicate with message oriented middleware providers (e.g. IBM’s MQSeries, Oracle’s AQ, Tibco Rendezvous, Sonic Software, etc.) in a uniform way • Java Mail • Enables Java applications to communicate with mail servers using industry standards protocols like: POP3, SMTP, and IMAP in a uniform way
Java’s Communication Mechanisms (continued) API’s to vendor specific implementations (continued) • Java’s Naming and Directory Interface (JNDI) • Performs standard directory operations, such as associating attributes with objects and searching for objects using their attributes. Using JNDI, a Java application can store and retrieve any type of named Java object. • Independent of any specific implementation, Java applications can use JNDI to access multiple naming and directory services, including existing naming and directory services such as LDAP, NDS, DNS, and NIS. This allows Java applications to coexist with legacy applications and systems.
Java’s Support for XML • Java API for XML Processing (JAXP) • Defines API’s for parsing and transformation of XML independent of implementation • Parsing concepts supported include: • Converting XML document to a loosely defined Java object called the Document Object Model (DOM) • Simple API for XML Parsing (SAX) provides an event driven, “push” API to the programmer as XML entities are discovered • Streaming API for XML (StAX), provides an event-driven, “pull” API for reading and writing XML documents. • Apache’s Xerces implementation supports parsing XML documents as either a DOM or via SAX • Enhancements in work to support StAX • Oracle and BEA have StAX parser implementations available • Transformation API called TRaX • Supports XML style sheet transformation language (XSLT) • Apache’s Xalan project provides TRaX compliant XSLT implementation and also allows its XSLT to be “extended” via Java
Java’s Support for XML (continued) • Java API for XML Binding (JAXB) • Binding is defined as the process of extracting XML content and instantiating a stronglytyped Java object representation so that the XML can be programmatically manipulated • Supports two-way conversion • Given an XML document, creates Java object representation • Given a Java object representation, can produce an XML document • Requires an XML Schema to exist or be created • Custom mappings between XML entity names and Java class attributes are possible through Java’s support for annotations
Java’s Support for XML (continued) • Java API for XML Registries (JAXR) – very similar to JNDI • Provides a uniform and standard Java API for accessing different kinds of XML Registries. • An XML registry is an enabling infrastructure for discovering Web services. Specifications include: • OASIS’ ebXML Registry and Repository standard • UDDI, which is being developed by a vendor consortium (defacto standard) • Apache’s Scout project provides an implementation and supports both ebXML and UDDI • Concept of service discovery is still in its infancy
Java’s Support for XML (continued) • Apache has a unique project called XML Graphics • Supports the W3C’s XSL-FO language which describes how documents should be printed • Project ships an implementation that takes as input an XML document compliant with the XSL-FO language, passes it through an interpreter, and creates one of the following: PDF, PCL, PS, SVG, Print, AWT, MIF and TXT • This is a powerful language for document creation from XML via the Java platform
Java’s Support for XML (continued) • Cannot understate the importance of XML and Java’s support for it… • Enables creation of new fourth generation programming languages (4GLs) whose underlying engine is based on Java • Personally co-developed a language called XSQL (XML based Structured Query Language)
Java’s Support for XML (continued) Case Study: Creation of XSQL 4GL • Enables the dynamic manipulation of Relational Database Management Systems (RDBMS) compliant with Java’s Database Connectivity (JDBC) via feature rich, interpretative programming environment • Executes: select, insert, update, and delete statements and stored procedures • Evaluates expressions: addition, subtraction, multiplication, division, concatenation, etc. • Supports: looping, variable declaration, etc. • Allows output of these statement calls to be used as inputs to subsequent calls • Outputs an XML document that represents the results of these statement executions
Java’s Support for XML (continued) Case Study: Creation of XSQL 4GL JDBC Compliant RDBMS JDBCAPI External System XSLTInterpreter XSQLInterpreter RDBMS XML XML XSQLSpec ResultofInteraction XSLT Spec XMLDoc Can be deployed into an Integration Broker
Java’s Support for XML (continued) Case Study: Creation of XSQL 4GL • What an XSQL document looks like <xsql> <select name="partExistance"> <sql>select count(*) as count from WDS61.IM_TABLE where PART = ‘MTOCP1’ </sql> </select> <if condition="partExistance.COUNT==0"> <then> <call procedure-name="EXEC_ALL" package-name="ENGINEERING_ADDPART" schema-name="WDS61"> <arg name="PART" value=“MTOCP1"> <value>Test MES-MTO BOM Interface</value> </arg> <arg name=“UM" value=“EA"/> <arg name="PUR_MFG" value="M"/> <arg value="L" name="PART_TYPE"/> <arg name="DFLT_STKRM" value="54"/> </call> </then> </if></xsql> Determining if Part Exists in application database If Part does NOT exist, then add part to application database using provided API Hundreds of lines of Java code executed within a typical statement hidden from XSQL developer and systematically controlled in one place
Java’s Support for XML (continued) Case Study: Creation of XSQL 4GL • What an XSQL output document looks like • Ouput document can then be sent back to the Integration Broker as a published message from the application <root> <partExistance> <count>0</count> </partExistance> <ENGINEERING_ADDPART> <returnValue>0</returnValue> <PART>MTOCP1</PART> <UM>EA</UM> <PUR_MFG>M</PUR_MFG> <PART_TYPE>L</PART_TYPE> <DFLT_STKRM>54</DFLT_STKRM> </ENGINEERING_ADDPART></root>
Java’s Support for Security • Java’s provides robust security support but it is highly fragmented, redundant, and very complex to put into practice • Java’s support for security is broken down into five areas: • Platform Security: represents the security features that are built into the language and are enforced by the Java compiler and virtual machine • Strong data typing • Automatic memory management • Byte code verification • Secure class loading
Java’s Support for Security (continued) • Java’s support for security is broken down into five areas: • Authentication and Access Control via the following APIs • Java’s Authentication and Authorization Service (JAAS) API • Java’s Simple Authentication and Security Layer (SASL) API • Supports a secure, challenge / response protocol over the network • Policy and Permissions API • Enables the developer to create and administer applications requiring fine-grained user access to security-sensitive resources • Typically file based on permissions that “sit” within a hierarchical tree
Java’s Support for Security (continued) • Java’s support for security is broken down into five areas: • Secure Communications • Java GSS-API: Used for securely exchanging messages between communicating applications. Based on W3C RFC Generic Security Services Application Program Interface (GSS-API) • Java Secure Socket Extension (JSSE) API: Enables secure Internet communications. It provides a framework and an implementation for a Java version of the SSL and TLS protocols and includes functionality for data encryption, server authentication, message integrity, and optional client authentication
Java’s Support for Security (continued) • Java’s support for security is broken down into five areas: • Cryptography • Java Cryptography Architecture: is a a framework for accessing and developing cryptographic functionality for the Java platform • Public Key Infrastructure Support • Java Certification Path API: consists of classes and interfaces for handling certification paths • Java Certificate API: provides classes and interfaces for parsing and managing certificates, certificate revocation lists (CRLs), and certification paths. It contains support for X.509 v3 certificates and X.509 v2 CRLs
Java Business Integration • Represents the future of Java in Enterprise Middleware • JBI is a framework for implementing an enterprise service bus to facilitate the collaboration between services and messages in a consistent manner • A Java Community Project called “Open-ESB” has been established to provide a reference implementation
Closing Thoughts on Java • Very robust platform … can use the software platform to satisfy almost every conceivable middleware need • If a need is not delivered by Sun, the open source community (e.g. Apache Software Foundation) or Java Community Process satisfies the shortfall • Difficult technology to get your arms around as a developer compared to Microsoft • Many options exist to solve your need • Always evolving • Fragmented message and documentation • Best representative of the “Open Source” revolution