session 7: jms, jca, jsf dr. nipat jongsawat. หัวข้อนำเสนอ jms: java message...

24
Session 7: JMS, JCA, JSF Dr. Nipat Jongsawat

Upload: margery-watson

Post on 18-Jan-2016

227 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Session 7: JMS, JCA, JSF Dr. Nipat Jongsawat. หัวข้อนำเสนอ JMS: Java Message Service JCA: Java Connector Architecture JSF : JavaServer Face Dr. Nipat

Session 7: JMS, JCA, JSF

Dr. Nipat Jongsawat

Page 2: Session 7: JMS, JCA, JSF Dr. Nipat Jongsawat. หัวข้อนำเสนอ JMS: Java Message Service JCA: Java Connector Architecture JSF : JavaServer Face Dr. Nipat

หั�วข้�อนำ�เสนำอ• JMS : Java Message Service• JCA : Java Connector Architecture• JSF : JavaServer Face

Dr. Nipat Jongsawat

Page 3: Session 7: JMS, JCA, JSF Dr. Nipat Jongsawat. หัวข้อนำเสนอ JMS: Java Message Service JCA: Java Connector Architecture JSF : JavaServer Face Dr. Nipat

http://ibm.com/redbooks Patterns: Implementing Self-

Service in an SOA environment

Dr. Nipat Jongsawat

Page 4: Session 7: JMS, JCA, JSF Dr. Nipat Jongsawat. หัวข้อนำเสนอ JMS: Java Message Service JCA: Java Connector Architecture JSF : JavaServer Face Dr. Nipat

Messaging

• เป็ นำว�ธี�กรส��อสรระหัว�ง applications หัร�อ software components.

• ส�งเสร�ม loosely coupled

Message-Oriented

Middleware

Application A

Messaging API

Messaging Clients

Application B

Messaging API

Messaging Clients

“MOM”

“e-mail for applications”

Dr. Nipat Jongsawat

Page 5: Session 7: JMS, JCA, JSF Dr. Nipat Jongsawat. หัวข้อนำเสนอ JMS: Java Message Service JCA: Java Connector Architecture JSF : JavaServer Face Dr. Nipat

Java Message Service (JMS)

• เป็ นำ Java API เพื่��อสร�ง ส�ง ร�บ และอ�นำ messages

• Messages – Asynchronous: a client does not have to

request them in order to receive them.– Reliable: ensure message is delivered

safely once and only once.

Dr. Nipat Jongsawat

Page 6: Session 7: JMS, JCA, JSF Dr. Nipat Jongsawat. หัวข้อนำเสนอ JMS: Java Message Service JCA: Java Connector Architecture JSF : JavaServer Face Dr. Nipat

JMS Architecture

• JMS provider– a messaging system that implements JMS interfaces and

provides administrative and control features.

• JMS clients– programs or components written in Java that produce or

consume messages.

• Messages– objects that communicate information between the JMS

clients.

JMS

Provider

JMS

ProviderJMS clientJMS client

JMS clientIBM MQSeries, Tibco, SpiritSoft, Fiorano, Softwired

Dr. Nipat Jongsawat

Page 7: Session 7: JMS, JCA, JSF Dr. Nipat Jongsawat. หัวข้อนำเสนอ JMS: Java Message Service JCA: Java Connector Architecture JSF : JavaServer Face Dr. Nipat

Using JMS API

• A provider wants the components not to depend on other components’ interfaces, so that components can be easily replaced.

• The provider wants the application to run whether or not all components are up and running simultaneously.

• The application business model allows a component to send information to another and to continue to operate without receiving immediate response.

Dr. Nipat Jongsawat

Page 8: Session 7: JMS, JCA, JSF Dr. Nipat Jongsawat. หัวข้อนำเสนอ JMS: Java Message Service JCA: Java Connector Architecture JSF : JavaServer Face Dr. Nipat

Messaging Domain• Point-to-Point (One consumer per message)

• Publish/Subscribe (Many consumers per msg.)

Dr. Nipat Jongsawat

Page 9: Session 7: JMS, JCA, JSF Dr. Nipat Jongsawat. หัวข้อนำเสนอ JMS: Java Message Service JCA: Java Connector Architecture JSF : JavaServer Face Dr. Nipat

Point-to-Point

• Built around the concept of message queues, sender and receivers.

• Each message has only one consumer.• A sender and a receiver of a message

have no timing dependencies. The receiver can fetch the message whether or not it was running when the client sent the message.

• The receiver acknowledges the successful processing of a message.

Dr. Nipat Jongsawat

Page 10: Session 7: JMS, JCA, JSF Dr. Nipat Jongsawat. หัวข้อนำเสนอ JMS: Java Message Service JCA: Java Connector Architecture JSF : JavaServer Face Dr. Nipat

Publish/Subscribe domain

• Each message can have multiple consumers.

• Publishers and subscribers have a timing dependency. A client that subscribes to a topic can consume only messages published after the client has created a subscription, and the subscriber must continue to be active in order for it to consume messages.

Dr. Nipat Jongsawat

Page 11: Session 7: JMS, JCA, JSF Dr. Nipat Jongsawat. หัวข้อนำเสนอ JMS: Java Message Service JCA: Java Connector Architecture JSF : JavaServer Face Dr. Nipat

Message Consumption

• Synchronously: A subscriber or receiver explicitly fetches the message from the destination by calling the receive method.

• Asynchronous: A client can register a message listener with a consumer. A message listener is similar to an event listener. Whenever a message arrives at the destination, the JMS provider delivers the message by calling the listener’s onMessage method, which acts on the content.

Dr. Nipat Jongsawat

Page 12: Session 7: JMS, JCA, JSF Dr. Nipat Jongsawat. หัวข้อนำเสนอ JMS: Java Message Service JCA: Java Connector Architecture JSF : JavaServer Face Dr. Nipat

SubscriberXML

Publisher

XML

Async Messaging (Publisher-Subscriber)

Dr. Nipat Jongsawat

Page 13: Session 7: JMS, JCA, JSF Dr. Nipat Jongsawat. หัวข้อนำเสนอ JMS: Java Message Service JCA: Java Connector Architecture JSF : JavaServer Face Dr. Nipat

http://ibm.com/redbooks Patterns: Implementing Self-

Service in an SOA environment

Dr. Nipat Jongsawat

Page 14: Session 7: JMS, JCA, JSF Dr. Nipat Jongsawat. หัวข้อนำเสนอ JMS: Java Message Service JCA: Java Connector Architecture JSF : JavaServer Face Dr. Nipat

Integration Complexity

m*n

AppServer

m+n

EIS

JCA

EISAppServer

Using JCA to access an EIS is akin to

using JDBC to access a database.

Dr. Nipat Jongsawat

Page 15: Session 7: JMS, JCA, JSF Dr. Nipat Jongsawat. หัวข้อนำเสนอ JMS: Java Message Service JCA: Java Connector Architecture JSF : JavaServer Face Dr. Nipat

JCA : Java Connector Architecture

• like a bridge, it attaches two ends together, JavaEE and EIS

• simplifies the integration of diverseEISs

• each EIS requires only one implementation of CA SAP

CICS...

AppServerResourceAdapter

Connector

EIS

Dr. Nipat Jongsawat

Page 16: Session 7: JMS, JCA, JSF Dr. Nipat Jongsawat. หัวข้อนำเสนอ JMS: Java Message Service JCA: Java Connector Architecture JSF : JavaServer Face Dr. Nipat

JCA : Key Components

• Resource Adapter– Connects EIS resource to the

JCA infrastructure

• System Contract– Connection & transaction

management and security

• Common Client Interface– Provides a common

programming interface model for interacting with EIS via resource adapters

Dr. Nipat Jongsawat

Page 17: Session 7: JMS, JCA, JSF Dr. Nipat Jongsawat. หัวข้อนำเสนอ JMS: Java Message Service JCA: Java Connector Architecture JSF : JavaServer Face Dr. Nipat

  Web services JMS JCA

Interface coupling (abstract service

definition)

YES Dynamic interface

discovery and request

construction ispossible

NO Payload agnostic

YES

Technical coupling (protocol stack)

NO With WSIF, client is

not bound to a client library for a

particular protocolimplementation

YES YES

Portability YES-Multi language

NO Java technology

only

NO Java technology

only

Reliability - HTTP R binding forSOAP

YES Specific

www.ibm.com/developerworks/webservices/library/ws-jcajms.htmlDr. Nipat Jongsawat

Page 18: Session 7: JMS, JCA, JSF Dr. Nipat Jongsawat. หัวข้อนำเสนอ JMS: Java Message Service JCA: Java Connector Architecture JSF : JavaServer Face Dr. Nipat

  Web services JMS JCA

Transactional Support Future- WS Coordination &- WS Transaction

Compensation and XAmodels

Limited in scope Only to the queue entry point

YES XA model

Security -WS Security Not part of the standard, hence

-vendor specific

Integration between EIS and J2EE

Synchronous mode YES Major use

Do it yourself YES

Asynchronous mode YES Document oriented

interface

YES Future

- Event driven, pushmode

YES Document oriented

interface or flow support (BPEL4WS)

YES Future

Dr. Nipat Jongsawat

Page 19: Session 7: JMS, JCA, JSF Dr. Nipat Jongsawat. หัวข้อนำเสนอ JMS: Java Message Service JCA: Java Connector Architecture JSF : JavaServer Face Dr. Nipat

JSF : JavaServer Face

• Server-side user interface component framework for Java technology-based web applications.

• JSP components– Set of APIs for representing UI components and managing their

state, handling events and input validation, defining page navigation, and supporting internationalization and accessibility

– A JavaServer Pages (JSP) custom tag library for expressing a JSF interface within a JSP page

Dr. Nipat Jongsawat

Page 20: Session 7: JMS, JCA, JSF Dr. Nipat Jongsawat. หัวข้อนำเสนอ JMS: Java Message Service JCA: Java Connector Architecture JSF : JavaServer Face Dr. Nipat

JSF : UI Components

Dr. Nipat Jongsawat

Page 21: Session 7: JMS, JCA, JSF Dr. Nipat Jongsawat. หัวข้อนำเสนอ JMS: Java Message Service JCA: Java Connector Architecture JSF : JavaServer Face Dr. Nipat

Input Validation<h:inputText id="string" required="true" value="#{data.string}" size="20"> <f:validateLength minimum="3" maximum="12"/></h:inputText><h:message for="string" style="color: red;"/>

Dr. Nipat Jongsawat

Page 22: Session 7: JMS, JCA, JSF Dr. Nipat Jongsawat. หัวข้อนำเสนอ JMS: Java Message Service JCA: Java Connector Architecture JSF : JavaServer Face Dr. Nipat

JSF & MVC

Dr. Nipat Jongsawat

Page 23: Session 7: JMS, JCA, JSF Dr. Nipat Jongsawat. หัวข้อนำเสนอ JMS: Java Message Service JCA: Java Connector Architecture JSF : JavaServer Face Dr. Nipat

Dr. Nipat Jongsawat

Page 24: Session 7: JMS, JCA, JSF Dr. Nipat Jongsawat. หัวข้อนำเสนอ JMS: Java Message Service JCA: Java Connector Architecture JSF : JavaServer Face Dr. Nipat

More Information

• The J2EE™ 5 Tutorial• JMS

– http://java.sun.com/products/jms • JCA

– http://java.sun.com/j2ee/connector • JSF

– http://java.sun.com/javaee/ javaserverfaces

Dr. Nipat Jongsawat