Title: mChaRM: a Reflective Middleware for CommunicationBased Reflection
1mChaRM a Reflective Middleware for
Communication-Based Reflection
2Overview
- Problem Analysis
- Traditional Reflective Approaches on Distributed
Systems - Multi-Channel Reification
- Related Works and Application
- Open Discussions
3Problem Analysis
Naming and Routing Security authentication Communi
cation Reliability Multi-communiations QoS
Requirments
4Out of Control-CORBA
5Hard Wired TAO
6Reflective Computation
- Reflection a computational process of reasoning
about and acting upon the system itself.
How to do?
What to do?
Computational Part
Reflective Part
7Meta-Object Protocol (CLOS MOP)
(defclass position)() (x y))
(defclass person)() (name age address))
8Meta-Object Protocol (CLOS MOP)
Base Object
(defclass person)() (name age address)
(metaclass hash-table-class))
9OpenJava
Base-Level Program
.java
Meta-level Program
10(No Transcript)
11CodAA reflective middleware for distributed
programming
Lookup
Execution
Scheduling
State access
Buffering
sending
Receiving
Base Level Application Object
12CodAA reflective middleware for distributed
programming
13Problems for Traditional Reflective Approaches
Receiving Decrypt
Sending Encrypt
Object 1
Object 2
14Problems for Traditional Reflective Approaches
15Problems for Traditional Reflective Approaches
Object B
Object A
Trapped
Trapped
Meta A
Meta B Authentication
16Multi-Channel Reification --Model
Target locus
Abstract Locus
Target locus
Source locus
Target locus
(1) the sender and the beginning of the
communication, termed source locus, (2) the
dispatching and the delivering of the message to
the designed receivers, termed abstract locus,
and (3)the receivers and the carrying the
computation really out, termed target loci.
17Multi-Channel Reification --Model
Non-functional Code CoreMetaBehavior()
Abstract Locus
Target locus
Source locus
Functional Code Invoke() ReceiverStubMetaBeha
vior() return tInvoke()
Functional Code SenderStubMetaBehavior()
18Java RMI (Remote Method Invocation)
Remote Interface
Client
Server (Remote Object)
Registration Server
19Java RMI (Remote Method Invocation)
Client Program
public static void main (String argv)
try HelloInterface hello
(HelloInterface) Naming.lookup ("//ortles.ccs.neu.
edu/Hello") System.out.println
(hello.say()) catch (Exception e)
System.out.println ("HelloClient exception "
e)
20Java RMI (Remote Method Invocation)
Server Object
import java.rmi. import java.rmi.server.
public class Hello extends UnicastRemoteObject
implements HelloInterface private String
message public Hello (String msg) throws
RemoteException message msg public
String say() throws RemoteException return
message
21Java RMI (Remote Method Invocation)
Server Program
public static void main (String argv)
try Naming.rebind ("Hello", new Hello
("Hello, world!")) System.out.println ("Hello
Server is ready.") catch (Exception
e) System.out.println ("Hello Server failed
" e)
22Multi-Channel Reification
Sender
Receiver
Define Kinds Invoke MultiRMI
mChaRM Preprocessor
Services
23Multi-Channel Reification Kind
public class sender instantiates
mChaRM_MOP kinds kind verbose with A, B, Z to
dummy1 kind normal with A, B, Z to dummy2,
dummy3 //usual class description
Methods
Kind Name
Receivers
24Multi-Channel Reification Sender
Sender Program
public class customer instantiates
mChaRM_MOP Kinds Kind validation with ATM1 to
withdraw public static void main( String
args) customer c new
client(Walter) c.multiRMI(deposit,
new String ATM1 new Object walter,
c.multiRMI(withdraw, new String
ATM1 new Object walter,
25Multi-Channel Reification Receiver
Receiver Program
public class ATM instantiates mChaRM MOP public
void deposit(String id, String accNum, int sum)
// code for depositing the ltsumgt on the ltidgts
account. public void withdraw(String id,
String accNum, int sum) // code for withdrawing
the ltsumgt from the ltidgts account.
26Multi-Channel Reification Channel Core
Channel Core Program
class validationChannelCore extends
channelCore private Hashtable right
public validationChannelCore(String RsName,
String permissionFileName) //
initialize the right table . . .
super(Validation, RsName, senderStub,
receiverStub) public Object
coreMetaBehavior(mChaRMMethodCall msg)
bool permission right.get(key(client,
receiversName, methodName)) if
(!permission) thrown IllegallRequestForAService
return super.coreMetaBehavior(msg)
27Related WorkQuO
28Related WorkQuO
We asked How to keep consistency among contracts?
29Related WorkQuO
- Client Delegate
- ---Source Locus
- Object Delegate
- ---Target Locus
- Contract
- ---Abstract Locus
30Related Work -TAO
- Can we use Multi-Channel to realize end-to-end
real time TAO? - Add on-line configuration feature to TAO.
-
31Related Work -AspectJ
Object
Object
Object
.exe
32Related Work -AspectJ
- Join Point
- Pointcuts
- Advices
- Aspects
AspectJ
Advice
advice body
pointcut
join point
Java Program
33Related Work -AspectJ
Pointcut
34Related Work -AspectJ
- Features
- Can be used on legacy codes
- Can work on multiple objects (Can MOP do this)
- One step reflection
- How would AspectJ do this?
35Another ApproacheOpenCORBA
ORB Wrapper
ORB Wrapper
ORB
ORB
- Doesnt need new language
- High Cost
36Reflective Application Spring Kernel
- A Reflective Architecture for Real-time OS
- Specification of Reflective Information
- Spring-C
- System Description Language(SDL)
- Fault Tolerant Entities for Real-Time (FERT)
- Real-Time Scheduling
- Fault Tolerance
- Integrating Scheduling and Fault Tolerance
37Reflective ApplicationSpring Kernel
- Features
- Addresses time constraints at all levels of the
system so that more accurate timing analysis can
be done even early in the design - Facilitates the use of scheduling algorithms that
are robust even under violations in the initial
assumptions - Supports planning-based scheduling that allows
detection of timing errors early and application
of state- and time-dependent recovery strategies - Supports adaptive fault tolerance so that there
is flexible management of redundancy subject to
time constrains.
38Discussions
- Can senders use multiple channels of the same
kind at the same time? - Where are the registration servers? Are they in
different machines and we have to have them
running all the time? - Tradeoffs for Reflective Computing
- Security
- Performance
- Others