Shahzad Bhatti

February 7, 2005

JINI

Filed under: Computing — admin @ 8:13 pm

JINI

 Mobile computing > continually changing topology
 Edge networking > no administrator access
 Utility computing > dynamic system re/provisioning
 Dynamic clustering > changing cluster configuration
 Large-scale distribution > constant partial failure
 Dynamic integration > unpredictable service availability
 Ad-hoc networking > spontaneous assembly
 Workflow/Msg switching > loose, asynchronous coupling
 Compute Grid > dynamic scalability
 
 RPC Systems require :
 > The client to know who it is calling
 > The client to know where the server is
 > The client and server to be active at the same time
 > The client and server to agree in detail on what form the
 call will take
 > The client and server to agree in detail on how the call
 will be made
 
 
 Where to Use Spaces
 Flow of objects
 > Workflow
 > Dataflow
 Coordinating loosely coupled collections of
 processes
 > Allows components to come and go
 > Allows components to change
 Don't use where you need
 > A file system
 > A database (object or relational)
 
 Security Valuation: Spaces Style
 Valuate set of fixed income securities
 > Break work into small chunks
 > Write an entry for each chunk into the space
 > Wait for results to come back
 Server process loops
 > Taking valuation requests
 > Executing each request, writing back results
 
 
 public class Task implements Entry
 public String clientID;
 public Task() {}
   public Entry execute() {
     throw new UnsupportedOperationException();
   }
   public long resultLeaseTime() {...}
   }
 public class ValuationTask extends Task {
   // public String clientID;
   public InitialConditions data;
   public ValuationTask() {}
   public Entry execute() {
     ValuationResult result = new ValuationResult();
     result.clientID = clientID;
     result.value = data.valuate();
     return result;
   }
   public long resultLeaseTime() {...}
   }
 
 Server
 ValuationTask tmpl = new ValuationTask();
 while (true) {
   ValuationTask task = (ValuationTask) space.take(tmpl, null, Long.MAX_VALUE);
   Entry result = task.execute();
   if (result != null) space.write(result, null, task.resultLeaseTime());
   //if (result != null) space.write(result, null, task.leaseTime());
 }
 
 Client
 int count = 0;
 while (i.hasNext()) {
 ValuationTask task = new ValuationTask();
 task.clientID = "jmcclain";
 task.data = (InitialConditions)i.next();
 Lease l = space.write(task, null, 3600000)
 lrm.renewFor(l, Lease.FOREVER, null);
 count++;
 }
 ValuationResult tmpl = new ValuationResult();
 tmpl.clientID = "jmcclain";
 for (int i=0; i Authentication
 > Integrity
 > Confidentiality
 > Quality of service
 Use constraints (with Java policy) to specify
 > What a Subject can do
 > What a Subject can't do
 > What a Subject must do
 
 
 The Secure Remote Call Model
 Obtain a proxy from somewhere
 Perform 'proxy preparation'
 > Verify that the proxy can be trusted
 > Attach constraints to the proxy
 > Grant necessary permissions to the proxy
 Make remote calls through the proxy
 
 
 Jini Extensible Remote Invocation
 > RMI/JRMP ('1.0')
 > RMI/IIOP ('1.0B')
 > Jini ERI ('2.0')
 > Kerberos (Java GSS)
 > JXTA (jini.org project)
 > UDP (experimental)
 
 public interface JavaSpace {
 Lease write(Entry entry, Transaction txn, long lease)
 throws TransactionException, RemoteException;
 Entry read(Entry tmpl, Transaction txn, long timeout)
 throws UnusableEntryException, TransactionException,
 InterruptedException, RemoteException;
 Entry take(Entry tmpl, Transaction txn, long timeout)
 throws UnusableEntryException, TransactionException,
 InterruptedException, RemoteException;
 EventRegistration
 notify(Entry tmpl, Transaction txn,
 RemoteEventListener listener, long lease,
 MarshalledObject handback)
 throws TransactionException, RemoteException;
 Entry readIfExists(Entry tmpl, Transaction txn,
 long timeout)
 throws UnusableEntryException, TransactionException,
 InterruptedException, RemoteException;
 Entry takeIfExists(Entry tmpl, Transaction txn,
 long timeout)
 throws UnusableEntryException, TransactionException,
 InterruptedException, RemoteException;
 long NO_WAIT = 0;
 Entry snapshot(Entry e) throws RemoteException
 }
 
 
 
 Exporter Configuration
 example.sunw.service {
 ..............
 private endpt = SSlServerEndpoint.getInstance(0);
 private constraints = new BasicMethodConstraints
 (new InvocationConstraints
 (new InvocationConstraint[]{Integrity.YES},
 null) );
 private ilFactory = new ProxyTrustILFactory
 (constraints,
 ServicePermission.class);
 serverExporter = new BasicJeriExporter
 (endpt, ilFactory);
 ..............
 }//end example.sunw.service
 
 Proxy Preparer Configuration
 example.sunw.client {
 ..............
 private verifyTrust = true;
 private constraints
 = new BasicMethodConstraints(...);
 private dynamicPermissions
 = new Permission[] {...};
 servicePreparer
 = new BasicProxyPreparer(verifyTrust,
 constraints,
 dynamicPermissions);
 ..............
 }//end example.sunw.client
 
 
 
 Refinements
 Wrap operations in transactions
 Priorities
 Create a FIFO
 > Push data structure logic into the space also
 Audit trails
 Status
 Dependent tasks
 Fixed function server nodes
 
 
 
 Future
 Community currently working on extension to
 spaces
 > Batch write and take
 > Exhaustive read
 > Also fills roll of batch read
 > New event
 > New queries support multiple templates
 Should make space better at multicasting
 Batch/multi-template take should help various
 compute server scenarios
 
 
 GigaSpaces http://www.gigaspaces.com
 IntaMission http://www.intamission.com
 Blitz - http://www.dancres.org/blitz
 
 

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URL

Sorry, the comment form is closed at this time.

Powered by WordPress