| SOA 22 December 2015 | [Link] PM |
PROXY AND SKELTON
PROXY
Reference to the remote object (server object)
Visible only to client side
Send the client request to server
Looks like a class file but contains no application code
It runs only on client machine
It forward a client remote calling to skeletons, which forward them on to the suitable server
objects
SKELETON
Skeletons return the results of server method invocation to client via stubs
Responsible for sending the server response to client
Visible only to server side
PROXY TYPES
1. Stub Proxy (Client Proxy)
2. Skeleton Proxy (Server Proxy)
1. Stub Proxy
It is a client side proxy
The purpose of the stub is to convert the java code into network oriented stream (Marshaling)
2. Skeleton Proxy
It is a server side proxy
1
| SOA 22 December 2015 | [Link] PM |
Purpose:
Converting the network oriented stream into java program (Demarshaling)
STUB vs SKELETON IN DISTRIBUTE APPLICATIONS
Client Execute Server
Call
Method
Method
Client Server
Application Application
Stub Proxy Skeleton Proxy
Network
Create, Locate, Delete, Invoke
2
| SOA 22 December 2015 | [Link] PM |
GENERATING PROXIES AND STUBS FROM SERVICE CONTRACTS
Advantages of Service Contracts
Service contract is a tool that is used to generate service proxies and service skeletons
based on the WSDL
Service proxies are programming language used to define the new services
Service skeletons are programming language classes that give the framework for
implementing new services
GENERATING JAVA CLASSES FROM SERVICE CONTRACTS
1. Java Service Proxy Class
([Link])
interface calc extends [Link]
{
int add(int x, int y);
int mul(int a, int b);
}
The code [Link] is a java service proxy class that models the CalcService and gives
methods that model the operations of the CalcService
2. Java Service Skeleton Class
([Link])
public class calcImp
{
public int add(int x, int y)
{
return(x+y);
3
| SOA 22 December 2015 | [Link] PM |
}
public int mul(int x, int y)
{
return(x*y);
}
}
[Link]
It gives the framework for implementing the CalcService