I'm Jeff McCaffer, I work for IBM Rational in Ottawa, Canada, and I'm the Equinox project lead and the Eclipse RCP lead as well, and I've been working on Eclipse for probably seven or eight years now ever since the beginning before Eclipse was Eclipse, primarily focused as I say on Equinox, the runtime, and specifically the client platform. One of the things that Eclipse historically from five, seven years ago has always been thought of as a tooling, you know, a tooling platform, which can do a great job with development tools and C development tools, that sort of thing, and sort of three or four years ago there was a bit of a renaissance, if you will, and people started to realize that, hey, you know, that modularity system, all that monetized stuff that people are using to build really cool tools, we could do that to build our applications, and sort of Eclipse as a rich client platform was born at about that time, essentially in Eclipse 3.0. And if you step back from that, it's been very successful, we've really had a lot of people adopting it and being very successful with it, but if you step back and look and say, what is it that is the useful part of what's giving them all that success, it really will come down to some great APIs and great frameworks, but underlying all of that, a really strong component model, and that coincided, the sort of evolution of Eclipse of the rich client platform coincided with our adoption of the OSGI framework specification. So OSGI essentially specifies a run-time, modular run-time system for Java programs. So the Eclipse of the rich client platform is really cool and it's a success, and now people are saying, well, hey, you know that component programming model, that modularity system, we can apply that to the server too.
2:01So this is really, we're seeing Eclipse evolve as a server-side story now, and I know of several projects and products that are coming out, various companies adopting Eclipse, IBM, sorry Eclipse on the server, IBM's WIP, your application server, the newest version is actually running Eclipse under the covers. So when you're running WAS, you're actually running Eclipse under the covers. Right. And that's true of some other server vendors. So what we're seeing now is, the real value is, you can use the same programming model across desktop servers and handhelds. Whereas, you know, in the standard travel world, we've got J2SE, J2ME, and J2EE, which all have sort of different programming models to varying degrees and different class structures that's a good thing. And, you know, code that runs in one doesn't always run in the other. And what we see now with OSGI and Eclipse and Equinox is that you can take the same bundles and use them in these different areas. Right. So to illustrate that, what I thought I would do is show you a little bit about how easy it is to use Eclipse on the server side to develop some static content and some servlet content. Now, I'm not a web programmer, so the web content will actually be very trivial for the world kind of thing. But the interesting part is really driving how, looking at how the systems work. Yeah. So, if you look at the screen now, so we've got an entity workspace that's not that interesting. But we're targeting a standard Eclipse, you know, Eclipse 3.3 SDK, just out of the box, off the download server. And what we can do now is go ahead and say, "Make a new plugin project." And we'll just call it "Hello." And we don't have to do anything fancy, just create that. And now what we want to do is we actually want to create some static content.
4:02We'll start out simple and just make a simple HTML page and then contribute it to a web server. So, you go ahead and just make a new folder, say. And in that folder, we'll make a new file. I'll say, you know, "Hello, world." And save it in our little guy and we'll call it "Index studies." All right. So, that's pretty straightforward. Now, we've got some web content. Okay. So, now we want to hook that web content into a web server. Now, OSGI specifies this thing called the HTTP service. And basically, it can serve up content, static content or serverless. And we've extended it to be able to do JMPs and the like. And what you do in our intent piece of this is you actually just go and create an extension. Now, Eclipse has an extension point model. Once you've decomposed the system into a bunch of pieces, you then need a mechanism to weave it all back together to sort of form a solution to your application. Right, right. Have all the glue that connects everything together. Yeah, yeah. So, the standard Eclipse way of doing this is through the extension, extension point registry. And the standard OSGI way of doing it is through services. You know, we can get into a long discussion about what the difference is between those two. But for right now, for this demo, I'm going to show you how to do it declaratively with extensions. Okay. So, back here on the plugin editor page, on the overview page, and let's click on the extensions guy here. And I haven't created any extensions before, so I'll say yes, I want to show the extensions. And I'll say, well, I want to add an extension. And I'm going to add an -- I'm going to search for the extension point to extend. And I've got this resources one. So, I can -- I've got an extension point called resources that I can add an extension for. So, now here we go.
6:02I've got an alias. And an alias is sort of -- what I'm doing is I'm situating some static content in URL space. I'm going to contribute it to an HTTP service. And say, here, put this content someplace in the URL space. So, I'll just call it content, just for fun. And then we put it in web. Right? That was the directory. Base name is the directory of content that we have in the folder. Right. So, now we've got an extension that goes into the HTTP service and says, hey, I've got some content in the web directory of this bundle. And you should put it in URL space at slash content. Right. So, we're sort of configuring the web server, as it were, by telling it where we're putting our content. Yeah. And the neat thing is we're doing this inside of a bundle. And bundles are sort of self-contained units of function. So, I can -- and a versions and -- Right. So, I could even specify dependencies between just static content bundles. Sure. If I have a mail system and a chat system and a group mechanism for my website, I can have those in different bundles and say that the mail system depends on the chat system. Right. And those calls depend together on certain sort of identity systems. Right, right. And they're all just sort of connected to each other via URL. And then, I mean, I'm thinking that the other exciting thing here is that you can take this hello bundle that we haven't deployed to any web server because everything's sort of -- to use an old term, they're relatively defined paths and they're not sort of tied directly to any particular web server. So, it's somewhat completely self-contained and you can deploy it anywhere that you want to. Yeah. In this case, you know, we're doing it into any OSGI-based, you know, HTTP service. Well, sure. Right. So, to run this guy, I'll open the dialogue. Now, I have a launch configuration I've already set up from before.
8:03But really, it's just a -- we've got all the plugins that are in our targets, which is the standard Eclipse SDK drop. And I've selected 11 bundles out of there. And you can look through the list here. You see there's some, you know, common blogging and some things here. Yeah. And then you get it down. And to the interesting ones, you've got HTTP JETI and HTTP servlets. So, these are the things that actually supply HTTP functionality. And at the very bottom, it's alphabetical. We've got a bundle for JETI. So, we've taken JETI and bundlized it by putting an OSGI manifest markup in it. Yeah. And now it's embedded inside of Equinox. So, what I'm about to do with this launch configuration is start up -- oh, and I've got to add our -- this is our bundle we just added, right? Mm-hmm. So, what I'm about to do is start up an Equinox that's got JETI embedded in it. JETI will start and, you know, all the various contributions that we've made to JETI, in our case, just this one, will get woven into the URL space that I can go to a browser and get them on. Right, right. And now, you had a kind of an interesting phrasing there that you're going to start up an Equinox. And so, does that mean that there's actually an Equinox server that you're starting up? Or, I mean, what's sort of the relationship between the container of Equinox and JETI? Right. So, let me show you that here. In the console, I'll make the console big. This is the console for what I just launched. Right. Here in the corner, it's an OSGI framework that I launched. It happens to be called JETI and Equinox. And this is the standard OSGI console that we get. And you can see in here the list of bundles. I've got 11 bundles running. And there's Mort A, JETI there. So, there's Mort A, JETI. Right. And various other bundles which are active. And so, it's just up and running.
10:04And I can see here that JETI has started up. It's listening on port 80. And various things are sort of going on. And now, if I find my browser, go over here and go localhost. I've done this before. So, it's over there. Oh, darn. Oh, yes. Because I didn't put index. It's actually the wrong URL. Sorry. So, I can just go here and get content slash index dot HTML. I forgot which one I was doing. And there's our static content flow world. Right. And that was actually pretty quick to just get up and running with things. Especially since that. Well, yeah. That's the thing. There was nothing, you know, no configuring comcat. Right. And long sequence and making a war and all that sort of stuff. It's basically just, you know, let it go. Right. But what's kind of even cooler is that content is literally being served up dynamically right now. Right. So, I can change this to a hollow world, I don't know, whatever. It's nice. Right. And then I go back to our web browser and refresh and it's there. Right. So, this is something really magic. Oh, wow. So, what's going on in the back? Is it just like you said, it's reading directly from the file system, right? Right. That's pretty exciting. Yeah. So, what it is is I launched Equinox. Yeah. The bundles are coming, some of them out of my workspace and some of them out of what we call our target box ones. Right. And so, the ones that are coming out of my workspace, they're literally just very interested. Right, right. So, when I go and I edit them, the content is immediately reflected in whatever… Right. And what that shows you is that a bundle can be, you know, a zip file as it were or some other blob of information or it could just be an expanded out file system based sort of bundle as it were. Exactly. You don't have to worry about packaging things up.
12:05Yeah. You could take this bundle and export it as a jar and then it would be a bundled jar and it would work. It's just exactly the same. Right. Right. So, now we've done some static content. You know, that was fun but it's not that exciting. So, let's do some serverlets. So, you remember we added an extension to the, excuse me, to the resources extension point. So, let's add another extension, check this guy, to the serverlets extension point. So, here we've got, it's asking for details for the extension. Again, we have to give it an alias. Let's put this one simply at hello. Mm-hmm. And we have to define it, you know, serverlets are defined by Java classes. So, we have to define a class. But now, there's some interesting things that are going to happen here. And before we go and do that, we want to look at the dependencies. So, remember I talked to you before about how bundles are standalone and they describe what they need for the rest of the world and what they give for the rest of the world. Absolutely. So, right here, I'm looking into the dependencies page of the bundle, the hello bundle. And we can see the list of required plugins and the list of imported packets. These are all the things that I could, the bundle I possibly get from the outside world. As you can see, they're both empty. Right. Right now, we're not thinking we need anything from the outside world. But we're about to implement a servlet which needs to extend HTTP servlet to class. Right. We have to see if we're going to get that from one place. So, what we can do here is then to go and add import package and do HTTP. Oh, hang on. I don't want a servlet. We need these two packages. Okay. So, I'm going to add those. Save. And go back to my extension tab here. And now I'm going to go and define the servlet class. When I do that, it comes in partially filled out.
14:05Right. But I'm actually going to make it extend HTTP servlet there. Okay. And I'll just click finish. And now I've got a servlet class, but it's got no body. So, I'll do get. And I'll make a quick body here. What should we do? We'll just do something like that. We'll do that. We'll do that. Not yet. Later. Make that even feel cool. And do that. Yeah. We'll just do a preview. Um. Hello from the servlet. Perfect. And do that. We'll just, uh, do a preview. Um. Hello from the servlet. Perfect. And do that. Yeah. We'll just, uh, do a preview. Um. Hello from the servlet. Um. Hello from the servlet. Perfect. And close. Close that. So, we register that, you know, you can obviously put any arbitrary content here in your service if you want. Right, right. And I'll obviously link it to web application frameworks and things like that. Oh, sure. I mean, you do, Rhett. You can have a jack on front. Right, right, right. Temples for all of those. But I'm trying to show just the sort of the basics here. Absolutely. So, we'll save our, uh, saved everything. Now, just to step back for a second and make sure that I've done everything I need to do. Um. I believe so. So, we'll go back. And now, there's something interesting I'll show you. Uh, we should still assign the console. We're still running our server. Uh-huh. Right. And what we did is we went into our bundle. Right. And we, we used to have static, just static content in there. And it's still here in the index.html. And what we just did is we added a servlet. Right. We added that servlet up the, uh, hello URL. So, if we went to localhost/hello, let's go do that right now. Ah, yes. We will see it dynamically deployed, huh? Well, yes and no. The localhost flow, I don't see it.
16:06Right? Right. But if I go back to our console, here, and find the, our hello bundle is number two. Right. So, if I go and I say, update two, and then go back to my lib browser. Oh, yeah. That's exciting. That's exciting. So, what happens when you update a bundle? See, what I did is I really just changed the content of the bundle. Right. That content got installed previously. Now, I've changed the content. And now, I tell, I simply tell the OSGI system, hey, update the content of that. Because there's new, like update your, your view of, of that bundle. Because there's new content in it. Right. Right. And so, it dynamically went, found those classes, found those new extensions, wove them into the system, and made that URL available, um, to, you know, to the browsers. And, and does, does it, does it reload the entire bundle, or is it more selective in how it reloads things, or dynamically loads things up? No, it reloads the bundle, because you could have arbitrary classes already loaded. Sure. Like, in this case, we went to static content with no classes into something with classes. But, if I already had something with classes in it, um, that, you could get quite sticky into having old versions of classes. Oh, yeah. Absolutely. So, you have to essentially throw away the old class loader. Right. And get a new class loader based on the new content. That makes sense. But, yeah. I mean, because I'm running, you know, in a, um, you know, a modern job or VM, we've got hot code replaced. We can also do things like, um, I'll add some more text here. Let's see. Let's see. Let's see. Second version. We'll change that. Right. And because we're running in situ, right, right out of the project, so just to illustrate that, right, I added the text here, and, and what I'm going to do is I'll go and I'll update bundle again. Okay. So I can just do update two, and then go back to our browser, and refresh, and then we've got
18:12a lot of those users. Great. Yeah, that's, that's pretty nice. That's, I mean, that's always one of the, uh, uh, if you don't have something helping you out along these lines, one of the, the, uh, annoyances of doing any sort of Java enterprise or whatever you want to call it development is having to redeploy things and wait. It's a, it's a big time suck. It's a big time suck. So it's always nice to have a system, like runtime systems that are very responsive to getting new changes in there for the development cycle. Right. Right. And so actually one of your questions on something that's very important. I mean, this, what we've been running is, is Jetty embedded inside of Econoc. Right. And in a classic sort of IT shop, uh, you know, if you went to your IT, you know, your security guys and said, and said, hey, I want to run this Econoc thing on our production service. Right. They would, they would probably, you know, look at you strangely and, and, you know, quietly shuffle you out the door. Right. Um, but if you went to them and said, hey, I have this web app that I want to run on our, you know, on our production, uh, or whatever your website would be. Right. They would say, you know, they'd ask a few questions, but they'd call, you know, in the end it would, it would, it would work out well. Right. And so what we have is to take exactly these same bundles and run them embedded inside of another web app. It's a thing we call the serverlet bridge. And essentially what happens is you, you have this, this tiny war, uh, that we create and it's, it's just got OSGI and a little launcher stuff in it. And you, you would deploy that war using standard, you know, J2E tools and all that sort of stuff. You put it in as a regular web app. And what it does when it starts up, it registers the serverlet with the, in the web app. And when somebody hits that serverlet, essentially it goes and it will start an Equinox framework inside of the web app. Right. And once Equinox is running, you can add bundles to it and do all that sort of stuff. Right. It's, it's, it's, it's, it's, it's, it's, it's, it's, it's, it's a little tiny HTTP server server, server, uh, service story in there that forwards the request that came into the web app and forwards them and on to the bundles that are registered.
20:13So I can take exactly this bundle, the hello bundle and package it up, either put it in the war or leave it outside the war and have the war discover it. Um, and, and, and deploy into Tomcat or WAZ or, or, or in fact, Yeti running as a standalone, you know, for them. Right. Right. Or BA servers. And again, going back to the discussion about programming models, it gives you that notion that you can run the same content on all, like I could run this on a cell phone. Right. So that their next version of, uh, cell phones are going to be OSGI enabled. Right. So you can run this bundle on your cell phone, run it on your desktop, run it on your server, you know, all sorts of different things are now possible. So that, that's, that's really kind of the, the overview of, of, of, you know, flip to the server as an example of really the modularity story that's emerging around OSGI and, and Quinox, um, and Java indeed, um, as the underlying technology. Yeah, that, that looks nice. It's very powerful. Well, that's fantastic. Yeah. Well, thanks for, uh, showing us all those features. That was, uh, that was quite helpful. That'll be fun. I enjoy it. There's, uh, there's, there's, there's many more. I've just sort of scratched the surface of, uh, Equinox as a, as a, as a solid, you know, runtime base for lots of different kinds of applications, whether they're web-based or embedded or desktop or tools. Right. There's a lot more under there, but, uh, you know, we have to look at that. That's right. And it seems like with Europa that, uh, there'll be much, uh, there'll be a lot more depth on the server side of using OSGI or, or, you know, Equinox using the OSGI model of development instead of just, uh, doing it on the desktop as it were. So that'll be fun. Yeah. I've seen a lot more. Yeah. That'll be fun to see pan out. Hmm. All right. Well, uh, thanks. Thank you. Thank you.