Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright 2005 by Codemesh, Inc. All Rights Reserved 1 Welcome Jini and JavaSpaces in an SOA World by Alexander Krapf WebTech Meeting July 19 th, 2005.

Similar presentations


Presentation on theme: "Copyright 2005 by Codemesh, Inc. All Rights Reserved 1 Welcome Jini and JavaSpaces in an SOA World by Alexander Krapf WebTech Meeting July 19 th, 2005."— Presentation transcript:

1 Copyright 2005 by Codemesh, Inc. All Rights Reserved 1 Welcome Jini and JavaSpaces in an SOA World by Alexander Krapf WebTech Meeting July 19 th, 2005

2 Copyright 2005 by Codemesh, Inc. All Rights Reserved 2 Speaker  Co-founder & President of Codemesh, Inc.  mostly involved with language interoperability  “interested bystander” in Jini and distributed computing

3 Copyright 2005 by Codemesh, Inc. All Rights Reserved 3 Agenda  What is Jini?  What is JavaSpaces?  How does it compare with Web Services?  Q & A

4 Copyright 2005 by Codemesh, Inc. All Rights Reserved 4 And the question is… What is Jini?

5 Copyright 2005 by Codemesh, Inc. All Rights Reserved 5 Common Misconceptions… I dream of !Jeannie

6 Copyright 2005 by Codemesh, Inc. All Rights Reserved 6 Common Misconceptions…  Jini is designed for devices  Jini is Java-only  Jini is not ready for primetime  Jini is not supported by Sun

7 Copyright 2005 by Codemesh, Inc. All Rights Reserved 7 So what is Jini?  Jini is the original SOA  Jini is Java-centric  Jini is more than ready for primetime (just ask Orbitz)  Jini is increasingly better supported by Sun Still not part of J2SE platform, now available under Apache 2.0 license, small (yet fiercely dedicated) team, small marketing budget

8 Copyright 2005 by Codemesh, Inc. All Rights Reserved 8 If Jini is one, then what is an SOA? A system for linking resources on demand. In an SOA, resources are made available to other participants in the network as independent services that are accessed in a standardized way. This provides for more flexible loose coupling of resources than in traditional systems architectures. An application architecture in which all functions, or services, are defined using a description language and have invokable interfaces that are called to perform business processes. Each interaction is independent of each and every other interaction and the interconnect protocols of the communicating devices (i.e., the infrastructure components that determine the communication system do not affect the interfaces). Because interfaces are platform-independent, a client from any device using any operating system in any language can use the service.applicationarchitectureinterfacesprotocolsplatformclient operating system Though built on similar principles, SOA is not the same as Web services, which indicates a collection of technologies, such as SOAP and XML. SOA is more than a set of technologies and runs independent of any specific technologies.Web servicesSOAPXML Webopedia whatis.com

9 Copyright 2005 by Codemesh, Inc. All Rights Reserved 9 Common SOA characteristics… Device Independent Protocol Independent* Distributed Stateless Scalable Reliable Resilient Dynamic Secure Easy***** to use Interface-based Loosely coupled OS Independent Language Independent

10 Copyright 2005 by Codemesh, Inc. All Rights Reserved 10 …and how Jini stacks up CharacteristicJini OS Independencevia Java Language Independencevia Codemesh tools, Judy project, … Device Independencevia Java, Surrogates, Psinaptics, … Protocol IndependenceRMI is default, protocols easily pluggable Statelessnessyes, by design Distributedyes, by design Interface-basedyes, by design Scalableyes, more than anything free I’m aware of! Resilientyes, more than any other architecture I’m aware of! Reliableyes, more than any other architecture I’m aware of! Secureyes, configurable security models (SSL, Kerberos, …) Dynamicextremely, via Java, RMI, RIO project, … Easy to useat least for a distributed object technology!

11 Copyright 2005 by Codemesh, Inc. All Rights Reserved 11 So, really, what is Jini?  the embodied consequence of Jim Waldo et als “A Note on Distributed Computing”  a specification of several core Services providing discovery, transactions, and persistence  comes packaged in a starter kit, not a reference implementation!  based on the acknowledgement that failure is a normal mode of operation!

12 Copyright 2005 by Codemesh, Inc. All Rights Reserved 12 Jini key concepts  Discovery/Join protocol for bootstrapping  the Service as a discoverable entity  the LookupService as the gateway to every other Service  the Lease as a mechanism for resilient Service life-cycle management

13 Copyright 2005 by Codemesh, Inc. All Rights Reserved 13 A Typical Jini Example public interface Hello { public String sayHello() throws RemoteException; } The Hello Service There is no Service interface that needs to be extended!

14 Copyright 2005 by Codemesh, Inc. All Rights Reserved 14 A Service Implementation public class HelloImpl implements Hello { public String sayHello() throws RemoteException { return “Hello!”; } } The Hello Service Implementation

15 Copyright 2005 by Codemesh, Inc. All Rights Reserved 15 A Server Implementation public class HelloServer extends HelloImpl, ServerProxyTrust, ProxyAccessor { public static void main( String[] args ) { Configuration config = ConfigurationProvider.getInstance( args ); Hello serverProxy = (Hello) getExporter( config ).export(this); Proxy smartProxy = Proxy.create(serverProxy); DiscoveryManagement discovery = new LookupDiscovery( null, config ); JoinManager join = new JoinManager( smartProxy, null, getServiceID(), discovery, null, config ); }... } The Hello Server Implementation

16 Copyright 2005 by Codemesh, Inc. All Rights Reserved 16 A Client Implementation public class HelloClient { public static void main( String[] args ) { Hello server = (Hello)lookup( Hello.class, 10 ); System.out.println( "Server says: " + server.sayHello() ); System.exit( 0 ); }... } The Hello Client Implementation lookup() is ten line boilerplate code!

17 Copyright 2005 by Codemesh, Inc. All Rights Reserved 17 Important omitted Details…  The Hello client only leased the service  The lease interval defines the application’s reactivity to network failure  Lookup can be by type and attribute  What code needs to be deployed on client?

18 Copyright 2005 by Codemesh, Inc. All Rights Reserved 18 A Typical Jini Example Client Lookup Service Looking for a Hello service “Server” HelloImpl Join HelloImpl Proxy Download Proxy to Impl protocol could be anything or even nothing! Proxy could just be a dynamically loaded interface implementation!

19 Copyright 2005 by Codemesh, Inc. All Rights Reserved 19 Jini Example Key Features  Scalability via multiple Service instances  Resilience via multiple Service instances and Lease mechanism  Client only requires service interface, everything else is downloaded dynamically  there can but does not have to be a channel between the client and the service  any code downloads or communications can be protected by standard security

20 Copyright 2005 by Codemesh, Inc. All Rights Reserved 20 What’s missing?  higher-level features related to dynamic deployment, QoS/SLA of Services (RIO project, ServiceContainer project, IncaX, Valaran Inc., etc.)  Inter-Service communications  Distributed data persistence  Workflow/scheduling  JavaSpaces

21 Copyright 2005 by Codemesh, Inc. All Rights Reserved 21 And the question is… What is JavaSpaces?

22 Copyright 2005 by Codemesh, Inc. All Rights Reserved 22 Common Misconceptions… What do we have on the screen there lieutenant? It must be a JSpace, captain! j

23 Copyright 2005 by Codemesh, Inc. All Rights Reserved 23 Common Misconceptions…  JavaSpaces is a database  JavaSpaces is slow  JavaSpaces is a research project

24 Copyright 2005 by Codemesh, Inc. All Rights Reserved 24 So what is JavaSpaces?  JavaSpaces is not a database but it may optionally use one  JavaSpaces is a Jini Service thereby inheriting all Jini advantages  JavaSpaces is … JavaSpaces  a distributed object store/cache  a work orchestration/distribution mechanism  best defined through its use

25 Copyright 2005 by Codemesh, Inc. All Rights Reserved 25 The usual illustration… there can be multiple space instances read, write, take are the most common operations no modification of entries in space (take out – modify - put back)

26 Copyright 2005 by Codemesh, Inc. All Rights Reserved 26 JavaSpaces key concepts  Space contains implementations of Entry  Entries are mobile Java objects, not just data!  Entries are leased from the space  Entry operations can be transacted  Entries are queried by example

27 Copyright 2005 by Codemesh, Inc. All Rights Reserved 27 A Computation Server Example public class Task implements Entry { public String priority = null; public String jobid = null; public String owner = null; public Boolean done = null; public void execute() {}; } public class ModelingTask extends Task { public int[] inputs = null; public int[] outputs = null; public void execute() { … } } The interface for all computations A concrete tasks

28 Copyright 2005 by Codemesh, Inc. All Rights Reserved 28 A Computation Server Example JavaSpace space = getSpace(); ModelingTask mt1 = new ModelingTask( “NORMAL”, “job1”, “alex” ); mt1.inputs = new int[] { 10, 20, 30 }; ModelingTask mt2 = new ModelingTask( “NORMAL”, “job1”, “alex” ); mt2.inputs = new int[] { 20, 40, 60, 80 }; space.write( mt1, null, Lease.FOREVER ); space.write( mt2, null, Lease.FOREVER ); Client-side: Posting the problem

29 Copyright 2005 by Codemesh, Inc. All Rights Reserved 29 A Computation Server Example JavaSpace space = getSpace(); ModelingTask template = new ModelingTask( null, “job1”, null ); template.done = Boolean.TRUE; ArrayList results = new ArrayList(); long waitUntil = System.currentTimeMillis() + 60 * 1000; while ( true ) { long maxWait = waitUntil – System.currentTimeMillis(); if( maxWait < 0 ) break; Entry e = space.take( template, null, maxWait ); results.add( e ); } Client-side: Retrieving the solution

30 Copyright 2005 by Codemesh, Inc. All Rights Reserved 30 A Computation Server Example JavaSpace space = getSpace(); Task template = new Task( null, null, null ); template.done = Boolean.FALSE; while ( true ) { Transaction txn = createTransaction( 10 * 60 * 1000 ); try { Task t = null; t = (Task)space.take( template, txn, Long.MAX_VALUE ); if( t != null ) { t.execute(); space.write( t, txn, Lease.FOREVER ); txn.commit(); } } catch( Exception e ) { txn.abort(); } } Server-side: Processing the problem

31 Copyright 2005 by Codemesh, Inc. All Rights Reserved 31 And Web Services?  Are not nearly as dynamic  Have the “industry standard” advantage  Are becoming less transparent/easy as they get closer to being an SOA  Have one big advantage: language independence! (as long as a full protocol stack is available)  Codemesh JunC++ion and JuggerNET

32 Copyright 2005 by Codemesh, Inc. All Rights Reserved 32 Proxy-Based Solution What does this look like at runtime? Java Server Service.NET Client Proxy’ Runtime Library Service JVM Proxy Proxy’ Client ProcessServer Process

33 Copyright 2005 by Codemesh, Inc. All Rights Reserved 33 Proxy-Based Solution JVM C JNI DLL Generated Proxy Classes (C#) C# PInvoke assembly API.NET User Architectural Diagram

34 Copyright 2005 by Codemesh, Inc. All Rights Reserved 34 Key Differentiators  Jini provides mobile code capabilities  In Jini, you can choose where the service is run (client or server)  Smart clients are trivially easy to develop and deploy with Jini  Security available without extensions, third-party products

35 Copyright 2005 by Codemesh, Inc. All Rights Reserved 35 Thank you! Codemesh, Inc. P.O.Box 620 Carlisle, MA 01741 http://www.codemesh.com info@codemesh.com Let’s chat and have some drinks!


Download ppt "Copyright 2005 by Codemesh, Inc. All Rights Reserved 1 Welcome Jini and JavaSpaces in an SOA World by Alexander Krapf WebTech Meeting July 19 th, 2005."

Similar presentations


Ads by Google