29
Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Embed Size (px)

Citation preview

Page 1: Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Science and TechnologyNorwegian University ofNTNU

Rolv Bræk, January 2008 1

ActorFrame

an introduction

Rolv Bræk

NTNU

Department of Telematics

Page 2: Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Science and TechnologyNorwegian University ofNTNU

Rolv Bræk, January 2008 2

The challenge

Access and transport network

Service Enablers

Tools Service Creation Environments

Methods

Terminals

Appliances

Parlay, OSA, JAIN, ...

Application Servers (Service Execution Environments)

Services

Access and transport network

Service Enablers

Tools Service Creation Environments

Methods

Terminals

Appliances

soap http RMI, …

Parlay, OSA, JAIN, ...

Application Servers (Service Execution Environments)

Users and user communities

Services

Service engineering

Service deployment and execution

Service platforms

How to supportRapid,

Compositional,and

Correct developmentwith

Dynamic deploymentof

Innovative Convergent Services?

Page 3: Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Science and TechnologyNorwegian University ofNTNU

Rolv Bræk, January 2008 3

First principle: Serve the Application domain

UserClient

User

Appliance

ServiceProviders

Community

ServiceEnablers

participant

provider

interactspresent at

interacts

interacts

interacts

subscriber

provider

EndUsers

Clients Application/Business logic Resources

UserTerminal

User

Appliance

ServiceProviders

Community

ServiceEnablers

participant

provider

interactspresent at

interacts

interacts

interacts

subscriber

provider

EndUsers

Clients Application/Business logic Resources

Page 4: Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Science and TechnologyNorwegian University ofNTNU

Rolv Bræk, January 2008 4

Second principle:mirror the environment!

SCS

UserAgent

UserTerminal

ServiceFrame

TerminalAgent

AppliancesServiceEnabler

AgentASUSAppliance

Agent

ApplicationActor

CommunityAgent

ServiceFrame: Agents serving the environment

Page 5: Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Science and TechnologyNorwegian University ofNTNU

Rolv Bræk, January 2008 5

Third principle:enable the right class of service

• Client-server (traditional O-O and IS)• One-way initiatives • A service as an interface• Synchronous communication • Restricted structure

• Peer-to-peer (telecom and real-time)• Multi-way initiatives• A service as a collaboration• Asynchronous communication• General structure

... now meeting each other

We focus on P2P and consider CS a special case

Page 6: Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Science and TechnologyNorwegian University ofNTNU

Rolv Bræk, January 2008 6

Fourth principle:support the cross-cutting nature of services• a service is a collaboration between roles performed by

agents• a role is the part an agent (or actor) plays in a service• agents may be involved in several services• horizontal and vertical role composition

Service 1

Agent 1Agent 2

Agent 3Agent 4

Agent 5

Service 3

Service 2

Vertical composition (within an agent)

Horizontal composition(within a service)

Page 7: Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Science and TechnologyNorwegian University ofNTNU

Rolv Bræk, January 2008 7

Fifth principle:component based framework with loose coupling- Actors and Agents

<<stereotype>>actor

actor : ActorAddress

<<metaclass>>Class

<<stereotype>>ActorAddress

actorId : StringactorType : String

<<profile>> ActorFrame

<<stereotype>>actorMsg

sender : ActorAdddressReceiver : ActorAddress

<<metaclass>>Signal

<<stereotype>>actor

actor : ActorAddress

<<stereotype>>actor

actor : ActorAddress

<<metaclass>>Class

<<metaclass>>Class

<<stereotype>>ActorAddress

actorId : StringactorType : String

<<stereotype>>ActorAddress

actorId : StringactorType : String

<<profile>> ActorFrame

<<stereotype>>actorMsg

sender : ActorAdddressReceiver : ActorAddress

<<stereotype>>actorMsg

sender : ActorAdddressReceiver : ActorAddress

<<metaclass>>Signal

<<metaclass>>Signal

<<actor>>

Actor

innerActor:Actor[*]

in

out

out

in

<<actor>>

Actor

innerActor:Actor[*]innerActor:Actor[*]

in

out

out

in

Agent

identity:credentials:profile:

Page 8: Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Science and TechnologyNorwegian University ofNTNU

Rolv Bræk, January 2008 8

Sixth principle:services as collaborations

with: • goal expressions for liveness• behaviour specified using MSC and state machines• features represented by collaboration uses• role behaviour designed as actor state machines

a:Caller b:Callee

invite:RoleRequest

c:Calling

b:Busy

u:Unavailable

b:CalledAgent

requester

requested

invokeda bbb

aa

UserCall

{goal: VoiceCnt(a,b) = a.VoiceCntTo(b) AND b.VoiceCntTo(a)}

Page 9: Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Science and TechnologyNorwegian University ofNTNU

Rolv Bræk, January 2008 9

FullCall

at:TermCallee

bt:TermCaller

au:UserCaller

bu:UserCallee

uc:UserCallo:TermCall t:TermCall

bt:TermCallee

at:TermCaller

au:UserCaller

bu:UserCallee

uc:UserCallo:TermCall t:TermCall

fcx:FullCall

at:TermAgent

au:UserAgent

bu:UserAgent

bt:TermAgent

collaborations

agents

... and roles/actors bound to agents

• Actors as service components (provide roles)• Actors for separate services and sessions

Page 10: Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Science and TechnologyNorwegian University ofNTNU

Rolv Bræk, January 2008 10

Agent structure example: reflecting the domain and the environment

AmigosApplication

Kari:UserAgent

Ola:UserAgent

Mp1:MeetingPlacet1:

TermAgent

t2:TermAgent

Mp2:MeetingPlace

Plattformindenpendent

Page 11: Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Science and TechnologyNorwegian University ofNTNU

Rolv Bræk, January 2008 11

Services as collaborations with roles

tchat uchat mpchatterminal

terminal tchat uchat mpchat

Chat interaction

designed as Actors with (Role) state machines

Chat service

Chat interactionref

Page 12: Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Science and TechnologyNorwegian University ofNTNU

Rolv Bræk, January 2008 12

... bound to Agents

AmigosApplication

Kari:UserAgent

Ola:UserAgent

Mp1:MeetingPlace

t1:TermAgent

t2:TermAgent

Mp2:MeetingPlace

tlogon ulogon

tchat uchat

mpchat

mpcall

tcall ucall

Platformindenpendent

Page 13: Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Science and TechnologyNorwegian University ofNTNU

Rolv Bræk, January 2008 13

... with platform adaptors and edges

AmigosFramework

Kari:UserAgent

Ola:UserAgent

Mp1:MeetingPlace

t1:TermAgent

t2:TermAgent

Mp2:MeetingPlace

tlogon ulogon

tchat mpcalluchat

mpchat

tcall ucall

OSA FW OSA CallC

call

Service Platform SpecificComputing

Platform Specific

PlatformindenpendentEdge

Edge

Page 14: Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Science and TechnologyNorwegian University ofNTNU

Rolv Bræk, January 2008 14

Dynamic structure composition - ”horizontal”

• Dynamic links imply that roles are dynamically assigned to actors.• This requires dynamic role management mechanisms for discovery, selection, adaptation

and invocation.• A large class of services are triggered in response to dynamic link requests (at least

communication control services).• There may be constraints on what actors are allowed to play given roles, e.g. B must be

the individual identified by the called party identifier, B must have a given responsibility, B may be any object that can play the role.

• The state of an actor may determine what roles the actor is able to play at any given time, e.g. busy, free.

• Compatibility rules must be applied on dynamic liks to ensure goal and progress

UserAgent

Caller

CallB A

Call BAa

b

Terminal UTTerminalAgent

POT 1

Terminal UT

Ta: TerminalAgent

Tb: TerminalAgent

ua:UserAgent ub:UserAgent

3

21

1 1 2

3

2

31 1POT Caller callee POT

Callee

Page 15: Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Science and TechnologyNorwegian University ofNTNU

Rolv Bræk, January 2008 15

Seventh principle:Support dynamic role binding

Dynamic role binding is central to many services, it entails: 1. Agent identification, which aims at identifying an agent by

consulting a name-server or performing a service discovery. (Note that some service features are related to the agent identification, e.g. aliasing, business domain restrictions or originating and terminating screening features in telephony.)

2. Role request, which aims at creating a dynamic link with a coordinated feature set. This means to request the identified agent (from phase 1) to play a role with a certain feature set. If the agent is able to play the requested role/features, it invokes it and a link is dynamically established between the requesting and the requested roles, so that they can collaborate. If not a substitute role may be negotiated, or the request may be queued.

3. Role release, which signals that a role is finished and has released whatever resources it had occupied.

Page 16: Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Science and TechnologyNorwegian University ofNTNU

Rolv Bræk, January 2008 16

requester:Actor

invoked:Actor

requested:Agent

RoleRequest

sd RoleRequest

requestor requested

RoleReq

RoleDeniedalt

fail

RoleConfirm

s_goal:playing

invoked

RolePlay

<<create>>

ref Role Request

Role request pattern

• All actors inherits this behaviour (from <<Actor>>)• The invoked role depends on the actor descriptor (content constraints) state

and policy of the requested actor• Role negotiation may take place, by extending the standard pattern

Page 17: Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Science and TechnologyNorwegian University ofNTNU

Rolv Bræk, January 2008 17

RoleBaseIdle

RoleConfirm / addAssoc,treatRoleConfirm

AssociationError / removeAssoc,treatAssociationError

RoleRequest

[notAllowedToConnect] / SendRoleDenied

[allowedToConnect] / Create/RetrieveRole,SendRolePlayRolePlay

[cardinality violated] / SendRoleDenied,treatRolePlay

[cardinality not violated] / SendRoleConfirm,treatRolePlay

RoleRelease / removeAssoc,treatRoleRelease

[not empty context]

[empty context]

1

Idle

Pending

Playing

[active = false]

RolePlay // ReleaseAllAssociations

RolePendingRoleResume

H*

1

[active = true]

Actor Default Behavior (enhanced composite diagram)

Page 18: Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Science and TechnologyNorwegian University ofNTNU

Rolv Bræk, January 2008 18

The invoked role behaviour proceeds until:

• It needs to bring a new role into the collaboration (i.e. create another dynamic role biding).• In this case it first needs to identify the agent and then

initiate a role request to this agent as explained.• It needs to check what feature or feature set to select at a

certain point if this depend on agent policy (e.g. if mid-call telephony services are allowed);

• It needs to signal to its own agent that it is available for additional linking, in response to an incoming role request (e.g. to perform a call waiting feature); or

• It is finished and performs role release.

Page 19: Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Science and TechnologyNorwegian University ofNTNU

Rolv Bræk, January 2008 19

Eigth principle:Implementation layering

Application: MyUserAgent, MyTerminalAgent,

MyCommunityAgent,…. My Roles

ServiceFrame: UserAgents, TerminalAgents, CommunityAgents, ApplicationActors, ….

ActorFrame: Actors, Roles, Plays, Patterns, ….

JavaFrame: CompositeObjects, StateMachines, Mediators, CompositeStates, Asynchronous communication,

Java VM

Provides Application domain concepts

Provides Role modelling concepts

Provides UML2.0 concepts

E.g AMIGOS

Page 20: Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Science and TechnologyNorwegian University ofNTNU

Rolv Bræk, January 2008 20

... with platform portabilityM

od

elin

g

PSM

Imp

lem

enta

tion

PlM’

EJB simulator

ActorFrame

Implementation using Actor classes

EJB

EJB ActorFrame

Implementation using Actor classes

Functionality using Actor model

JVM

Midlet ActorFrame

Implementation using Actor classes

Terminals, appliances Application servers

Page 21: Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Science and TechnologyNorwegian University ofNTNU

Rolv Bræk, January 2008 21

... and distribution transparency

• Freedom to deploy actors on small devices and servers• Global address space and transparent messaging• Simple configuration, but not yet self-configuring

Application Server

edge

edgeTerminal/appliance

edge

Application Server

edge

edge

Terminal/appliance

edge

Page 22: Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Science and TechnologyNorwegian University ofNTNU

Rolv Bræk, January 2008 22

Application - PIM’

Adaptation - PIM’

<<Actor>><<Actor>>

<<Actor>>

<<Agent>><<Agent>>

<<Agent>>

ApplicationSystem

compose

compose

compose

Application Implementation

edge

edge Java XMLJava XMLJava XMLJava XMLJava XMLJava XML

dynamicallydeploy

translate translateModels

Java Frameworks

Ninth principle: dynamic system - open structure with object and type dynamics

Actor descriptor:content and

context

State machines:SM and CS

Page 23: Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Science and TechnologyNorwegian University ofNTNU

Rolv Bræk, January 2008 23

Actor (Deployment) Descriptor

Page 24: Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Science and TechnologyNorwegian University ofNTNU

Rolv Bræk, January 2008 24

OSGi Container

Bundles

OSGi

Acto

rRo

uter

Actors

Forward table

Actors

ActorsTCP

Sessionosgi

Bluetooth Session

Page 25: Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Science and TechnologyNorwegian University ofNTNU

Rolv Bræk, January 2008 25

Creating an OSGi Bundle

Osiris Profile Extension

UDP

TCP

SOAP

NM NMRo

ute

r /SRService

Registery

bundle

AM

actor actor

SE

1. Deploy the Router2. Registrate the router in

Service Registery3. Deploy the bundle4. Bundle finds the Router

in the Service Registery5. The bundle connects

itself to the Router via a Connector

6. Messages to other bundles is send via the Router

Page 26: Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Science and TechnologyNorwegian University ofNTNU

Rolv Bræk, January 2008 26

OSGI containerOSGi

OSGI containerOSGi

Communication

Acto

rRo

uter

OSGiJ2SE

Actors

TCPSession

UDP

Bluetooth

Acto

rRo

uter

J2SEOSGI

Actors

TCPSession

UDP

SOAP

Acto

rRo

uter

CLDCJ2ME

Actors

Bluetooth

Service

Page 27: Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Science and TechnologyNorwegian University ofNTNU

Rolv Bræk, January 2008 27

Application models -PIM

Agents Actors System

Service models r2

r3

r1

Collaborations with behaviour Role behaviours

design synthesis Role1SM Role2SM

<<Actor>><<Actor>>

<<Actor>>

<<Agent>><<Agent>>

<<Agent>>

ApplicationSystem

Role1SM Role2SM

composition

composition

composition

composition

Tenth principle: model driven service engineering

Page 28: Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Science and TechnologyNorwegian University ofNTNU

Rolv Bræk, January 2008 28

Towards Service Oriented Development

This is our research focus. You may participate!

Page 29: Science and Technology Norwegian University of NTNU Rolv Bræk, January 2008 1 ActorFrame an introduction Rolv Bræk NTNU Department of Telematics

Science and TechnologyNorwegian University ofNTNU

Rolv Bræk, January 2008 29

RAMSES

Actors

Modelingusing UML2.0

Implementingusing Javaframmeworks

Agents

Actors Agents

Service models Roles

... using the RAMSES tool set

Deployment

Simulation

TranslatorValidation

Editor

Systems

Systems

ActorFrame

PIM, PIM’

PM+

PIM