Service Component Architecture Overview

decorumgroveInternet και Εφαρμογές Web

7 Αυγ 2012 (πριν από 5 χρόνια και 13 μέρες)

365 εμφανίσεις

®


IBM Software Group

© 2005 IBM Corporation

Updated
March 15, 2013

WebSphere Process Server v6.0

WebSphere Integration Developer v6.0

Service Component Architecture Overview

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

2

Goals


Introduce Service Component Architecture (SCA)


Introduce tools support for assembling SCA
modules


Provide a simple example of an SCA
-
based
application

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

3

Agenda


Overview


Architecture


Tools Support


Example


Summary and References

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

4

Service Oriented Architecture

Service Component
Architecture (SCA)
Business Objects
(SDO
-
based technology)

BPEL + Extensions

SCA
Service Component
Architecture (SCA)
Business Objects
(SDO
-
based technology)

BPEL + Extensions

SCA
Service Component
Architecture
Business
Objects
Common Event
Infrastructure
Human
Tasks
Human
Tasks
Business
State
Machines
Business
State
Machines
Business
Rules
Business
Rules
Business
Processes
Business
Processes
WebSphere Application Server (J2EE Runtime)
Interface
Maps
Business
Object Maps
Relationships
Selectors
Service Component
Architecture
Business
Objects
Common Event
Infrastructure
Human
Tasks
Human
Tasks
Business
State
Machines
Business
State
Machines
Business
Rules
Business
Rules
Business
Processes
Business
Processes
WebSphere Application Server (J2EE Runtime)
Interface
Maps
Business
Object Maps
Relationships
Selectors
IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

5

Service Component Architecture: Description


SCA is a service oriented component model for business
services that publish or operate on business data


SCA provides a single abstraction for service types that
may already be expressed as


Session beans


Web Services


Java class


BPEL


etc…


Separates “business logic” from “infrastructure logic”

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

6

Agenda


Overview


Architecture


Tools Support


Example


Summary and References

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

7

Service Component Architecture: Features


Provides the Service Component Definition
Language (SCDL) for defining service components


Provides the ability to:


Define service components


Make services available to clients outside current module


Import and reference external services in current module


Compose services into larger application components


Provides a client programming model allowing
client access to service components

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

8

Service Component: Overview

Java

BPEL

Business

Rules

Selector

Human

Task

State

Machine

Implementation Types

Java

WSDL

Port Type

Interface

Reference

Java

WSDL

Port Type

Interface
Maps

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

9

Service Module: Overview

Import

Export

Standalone

Reference

Service

Component

Service

Component

Service Module

Wire

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

10

Service Module: Artifacts

Artifact

Comments

Module Definition


Contained in the
sca.module

file at the root SCA project JAR

Service
Components


A module can contain 0..n service definitions


Each component definition is contained in a
<SERVICE_NAME>.component

file

Imports


A module can contain 0..n import definitions


Each import definition is contained in a
<IMPORT_NAME>.import

file

Exports


A module can contain 0..n export definitions


Each export definition is contained in a
<EXPORT_NAME>.export

file

References


Two types of References


In
-
line (contained within a service component definition)


Stand
-
alone


Stand
-
alone references are defined in the
sca.references

file

Other Artifacts


Other artifacts include: Java Classes, WSDL files, XSD files, BPEL, etc.

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

11

Service Component Definition

Component definitions include:


name


0..N interfaces


0..N references


implementation



There are two supported types: Java
or WSDL Port type


Support for synchronous and
asynchronous interaction styles

Interfaces



Used to specify other service
components called by this component

References



A service component can be implemented
using any of implementation types
supported by WID.

Implementation



Unique
within SCA module


Must match component file path
relative to module root

Component Name

Name = MyService

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

12

References and Wires


Used by a non
-
SCA component or
another component within the module

Stand
-
alone Reference


Used only by the component in which
the reference is defined

In
-
line Reference


Identifies the target service component
or import for the reference definition

Wire

Reference definitions include:


name


multiplicity


interface


wire

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

13

Imports

Import definitions include:


name


1..N interfaces


esbBinding

An import is a valid target for a wire

An import allows access to services
outside the current SCA module


Describes how the external service is
bound to the current module

esbBinding

Web

Service

Service

Component

JMS

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

14

Exports

Export definitions include:


name


target


1..N interfaces


esbBinding

An export allows access to services for
use outside the current SCA module


Describes how the service is
bound externally

esbBinding


Identifies the component to be exported

Target

Web

Service

Service

Component

JMS

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

15

Client Programming Model


Client programming model allows clients to


Locate services


Invoke methods on services


Clients locate services with the ServiceManager


Key class is


com.ibm.websphere.sca.ServiceManager


Two ways to instantiate a ServiceManager depending on
desired lookup scope for service


Use the following method to locate a service


com.ibm.websphere.sca.Service locateService(String);

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

16

Client Programming Model (Continued)


Two service invocation models


Dynamic





Type safe

Service myService =


(Service) serviceManager.locateService(“myService");

DataObject input = ...

myService.invoke(“someOperation”, input);

MyServiceImpl myService =


(MyServiceImpl) serviceManager.locateService(“myService");

myService.someMethod(“input”);

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

17

Asynchronous Model


SCA provides the ability for services to be called
synchronously or asynchronously


There 3 types of asynchronous invocation models

invokeAsync()

Client

Service

further

processing

One Way

invokeAsync()

Client

Service

invokeResponse()

further

processing

Deferred Response

invokeAsync()

Client

Service

onInvokeResponse()

Request with Callback

further

processing

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

18

SCA Interactions

Interface

Invocation Model

Invocation
Methods

Synchronous


Internal External

One Way

Deferred

Response

Request

with

Callback

Dynamic

Type
Safe

WSDL


YES

NO

Java


YES

YES

Data passed by reference in the same SCA Module

Data passed by value

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

19

SCA Quality of Service


Qualifiers provide the ability to specify quality of
service requirements from the SCA runtime


Qualifiers fall into one of the following categories


Transaction


Activity Session


Security


Asynchronous Reliability


Qualifier can be specified on service component
references, interfaces, and implementations

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

20

Example

Section

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

21

Example: HelloWorld

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

22

Example: HelloWorld Assembly Definitions

<scdl:component displayName="HelloWorld" name=“HelloWorld" ...>


<interfaces>


<interface xsi:type="wsdl:WSDLPortType”




portType="ns1:HelloWorldInterface">


<method name="sendMessage"/>


</interface>


</interfaces>


<implementation xsi:type="java:JavaImplementation”




class = “sample.HelloWorldImpl”/>

</scdl:component>

<scdl:references ... >


<reference name="HelloWorldInterfacePartner">


<interface xsi:type="wsdl:WSDLPortType"


portType="ns1:HelloWorldInterface"/>


<wire target=“HelloWorld”/>


</reference>

</scdl:references>

HelloWorld.component

sca.references

Standalone

Reference

HelloWorld

Component

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

23

Example: HelloWorld Implementation Details

HelloWorldImpl.java

public class HelloWorldImpl {


public String sendMessage(String message) {


return "The following message was submitted: " + message;


}

}


HelloWorldInterface.wsdl

Implementation

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

24

Example: HelloWorld Client Implementation

index.jsp (Client Programming Model)

try {


ServiceManager serviceManager = new ServiceManager();


Service service = (Service)


serviceManager.locateService("HelloWorldInterfacePartner");







String theMessage = request.getParameter("message");


DataObject resp = (DataObject) service.invoke("sendMessage", theMessage);


if (resp != null) {


out.println("<p>" + resp.getString("status") + "</p>");


}

} catch (Exception e) {


System.out.println(e);

}


Reference
Name

Invoke the
“sendMessage”
service

Get status String from
returned DataObject

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

25

Example: HelloWorld Artifacts

Implementation of
HelloWorldInterface

Definition of HelloWorld
service component

Standalone
reference

definition

HelloWorld
module definition

HelloWorldInterface
WSDL definition

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

26

Example: Using Imports and Exports


IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

27

Summary and Reference

Section

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

28

Summary


SCA is the fundamental component model for
WebSphere Process Server v6


Programming model the Service Oriented Architecture
solution


SCA helps separate business logic from
implementation


Focus is on assembling solutions rather than
implementation details


Mitigates need for integration developers to have deep
knowledge of Java or J2EE


Aimed at helping J2EE developers become more
productive

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

29

References


Service Data Objects (SDO)


http://www
-
128.ibm.com/developerworks/library/j
-
commonj
-
sdowmt/


http://www
-
106.ibm.com/developerworks/java/library/j
-
sdo/


http://download.eclipse.org/tools/emf/sdo/javadoc/commonj/sdo/package
-
summary.html

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

30

Type Safe Client Invocation

Interface

Methods

Description

HelloWorld

String sendMessage(String)

Used to invoke synchronous
service requests to sendMessage

HelloWorldAsync

Ticket sendMessageAsync(String)

Used to invoke
deferred
response

asynchronous service
requests

Ticket sendMessageAsync(String, Callback)

Used to invoke
request with
callback

asynchronous service
requests

String sendMessageResponse(Ticket, long)

Used to get response in the case
of
deferred response

invocation

HelloWorldCallback

void onSendMessageResponse(Ticket,

Exception)

Callback interface must be
implemented by the client using a
request with callback

asynchronous service invocation

HelloWorldImplAsync

void sendMessageAsync(String, Callback,
Ticket)

Asynchronous HelloWorld
implementations must implement
this interface

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

31

Dynamic Client Invocation

Interface

Methods

Description

Service

Object invoke(String, Object)

Used to invoke synchronous
service requests

Ticket invokeAsync(String, Object)

Used to invoke
one
-
way

or
deferred response

asynchronous
service requests

Ticket invokeAsync(String, Object, Callback)

Used to invoke
request with
callback

asynchronous service
requests. Can be used with
one
-
way

invocation, but the callback is
ignored

Object invokeResponse(Ticket, long)

Used to get response in the case of
deferred response

invocation

Callback

void onInvokeResponse(Ticket, Object, Exception)

Callback interface must be
implemented by the client using a
request with callback

asynchronous service invocation

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

32

Qualifiers

Type

Qualifier

Scope

Description

transaction

Implementation

global



A global transaction must be present to run
the component

local



A global transaction must not exist to run the
component

any



Component is unaffected by transactional state

joinTransaction

Interface

true



Hosting container joins client transaction

false



Hosting container will not join client
transaction


suspendTransaction

Reference

true



Synchronous invocations of target component
do not run within client global transaction.

false



Synchronous invocations of target component
run within client global transaction

deliverAsyncAt

Reference

call



Asynchronous invocations of a target service
occur immediately

commit



Asynchronous invocations of a target
service occur as part of a global transaction

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

33

Qualifiers (Continued)

Type

Qualifier

Scope

Description

reliability

Reference

Specifies the quality of service level for asynchronous
message delivery. Reliability can be one of the
following values:
bestEffort

or
assured

requestExpiration

Reference

Specifies the length of time (milliseconds) after which
an asynchronous request is to be discarded if not
delivered

responseExpiration

Reference

Specifies the length of time (milliseconds) that the
runtime must retain an asynchronous response or
must provide a callback

securityIdentity

Implementation

The
permission

specifies a logical name for the
identity under which the implementation executes at
runtime.

securityPermission

Interfaces,
Interface,
Method

The caller identity must have the
role

specified from
this qualifier in order to have permission to execute
the interface or method

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

34

Qualifiers (Continued)

Type

Qualifier

Scope

Description

activitySession

Implementation

true



There must be an ActivitySession
established in order to run this component

false



The component runs under no Activity
Session

any



The component is agnostic to the presence
or absence of an ActivitySession

joinActivitySession

Interface

true



Hosting container joins client
ActivitySession

false



Hosting container will not join client
ActivitySession

suspendActivitySession

Reference

true



Methods on target component will NOT
run as part of any client ActivitySession

false


Methods on target component will run as
part of any client ActivitySession

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

35

Foils Moved to WID Presentation

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

36

Tools Support

Section

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

37

Module Assembly in Integration Developer V6


Assembly Editor


Primary tool for composing SCA
-
based applications


Visual tool for specifying


Service components


Interfaces, implementation type, and references


Stand
-
alone references


Exports


Imports


Wires connecting component references with the appropriate target service



Two development approaches are supported


Top down


Bottom up

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

38

Assembly Editor: Getting Started

Canvas

Palette

The Assembly Diagram is found

under Module Assembly

Components

Import, Export, Stand
-
alone Reference

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

39

Palette: Reference

Java Component

Generic Component

Business Process

Component

State Machine

Component

Human Task

Component

Business Rule

Component

Components

Selector

Interface Mapping

Special Components

Supported implementation types

NOTE:



The generic component is used to
model components whose
implementation type is not known


Only the Java component supports
Java type interfaces

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

40

Palette: Reference (Continued)

Wiring Tool

Wiring

Import Component

Export Component

Standalone Reference

Import, Export, References


Click on the wiring tool


Click on the reference of the first
component


Click the interface of the target
component


IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

41

Assembly Diagram: Components

Reference (with multiplicity)

Shows
implementation type

Add Reference

Add Interface

Context menu

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

42

Assembly Diagram: Components (Continued)

IBM Software Group

*IBM Confidential* Service Component Architecture Overview

© 2005 IBM Corporation

43

Assembly Diagram: Wires


Components can be wired together by the


Wiring tool from palette


Wiring handle


Context menu option


The properties view can display important
information about a wire



Click on the wire

and go to the

Properties view