1
00:00:00,000 --> 00:00:18,360
I'm Jeff McCaffer, I work for IBM Rational in Ottawa, Canada, and I'm the Equinox project

2
00:00:18,360 --> 00:00:24,920
lead and the Eclipse RCP lead as well, and I've been working on Eclipse for probably

3
00:00:24,920 --> 00:00:30,560
seven or eight years now ever since the beginning before Eclipse was Eclipse, primarily focused

4
00:00:30,560 --> 00:00:35,500
as I say on Equinox, the runtime, and specifically the client platform.

5
00:00:36,040 --> 00:00:40,980
One of the things that Eclipse historically from five, seven years ago has always been

6
00:00:40,980 --> 00:00:44,720
thought of as a tooling, you know, a tooling platform, which can do a great job with development

7
00:00:44,720 --> 00:00:48,880
tools and C development tools, that sort of thing, and sort of three or four years ago

8
00:00:48,880 --> 00:00:54,040
there was a bit of a renaissance, if you will, and people started to realize that, hey, you

9
00:00:54,040 --> 00:00:59,040
know, that modularity system, all that monetized stuff that people are using to build really

10
00:00:59,040 --> 00:01:04,380
cool tools, we could do that to build our applications, and sort of Eclipse as a rich client platform

11
00:01:04,380 --> 00:01:08,540
was born at about that time, essentially in Eclipse 3.0.

12
00:01:09,860 --> 00:01:14,700
And if you step back from that, it's been very successful, we've really had a lot of people

13
00:01:14,700 --> 00:01:18,920
adopting it and being very successful with it, but if you step back and look and say, what

14
00:01:18,920 --> 00:01:24,340
is it that is the useful part of what's giving them all that success, it really will come

15
00:01:24,340 --> 00:01:29,700
down to some great APIs and great frameworks, but underlying all of that, a really strong

16
00:01:29,700 --> 00:01:35,120
component model, and that coincided, the sort of evolution of Eclipse of the rich client

17
00:01:35,120 --> 00:01:42,600
platform coincided with our adoption of the OSGI framework specification.

18
00:01:42,920 --> 00:01:49,920
So OSGI essentially specifies a run-time, modular run-time system for Java programs.

19
00:01:49,920 --> 00:01:54,920
So the Eclipse of the rich client platform is really cool and it's a success, and now people

20
00:01:54,920 --> 00:01:59,920
are saying, well, hey, you know that component programming model, that modularity system, we can

21
00:01:59,920 --> 00:02:01,920
apply that to the server too.

22
00:02:01,920 --> 00:02:08,920
So this is really, we're seeing Eclipse evolve as a server-side story now, and I know of several

23
00:02:08,920 --> 00:02:14,920
projects and products that are coming out, various companies adopting Eclipse, IBM, sorry Eclipse

24
00:02:14,920 --> 00:02:19,920
on the server, IBM's WIP, your application server, the newest version is actually running Eclipse

25
00:02:19,920 --> 00:02:20,920
under the covers.

26
00:02:20,920 --> 00:02:24,920
So when you're running WAS, you're actually running Eclipse under the covers.

27
00:02:24,920 --> 00:02:25,920
Right.

28
00:02:25,920 --> 00:02:28,920
And that's true of some other server vendors.

29
00:02:28,920 --> 00:02:35,920
So what we're seeing now is, the real value is, you can use the same programming model across

30
00:02:35,920 --> 00:02:38,920
desktop servers and handhelds.

31
00:02:38,920 --> 00:02:43,920
Whereas, you know, in the standard travel world, we've got J2SE, J2ME, and J2EE, which

32
00:02:43,920 --> 00:02:49,920
all have sort of different programming models to varying degrees and different class structures

33
00:02:49,920 --> 00:02:50,920
that's a good thing.

34
00:02:50,920 --> 00:02:54,920
And, you know, code that runs in one doesn't always run in the other.

35
00:02:54,920 --> 00:02:59,920
And what we see now with OSGI and Eclipse and Equinox is that you can take the same bundles

36
00:02:59,920 --> 00:03:02,920
and use them in these different areas.

37
00:03:02,920 --> 00:03:03,920
Right.

38
00:03:03,920 --> 00:03:08,920
So to illustrate that, what I thought I would do is show you a little bit about how easy it

39
00:03:08,920 --> 00:03:15,920
is to use Eclipse on the server side to develop some static content and some servlet content.

40
00:03:15,920 --> 00:03:21,920
Now, I'm not a web programmer, so the web content will actually be very trivial for the world

41
00:03:21,920 --> 00:03:23,920
kind of thing.

42
00:03:23,920 --> 00:03:28,920
But the interesting part is really driving how, looking at how the systems work.

43
00:03:28,920 --> 00:03:29,920
Yeah.

44
00:03:29,920 --> 00:03:35,920
So, if you look at the screen now, so we've got an entity workspace that's not that interesting.

45
00:03:35,920 --> 00:03:42,920
But we're targeting a standard Eclipse, you know, Eclipse 3.3 SDK, just out of the box, off the

46
00:03:42,920 --> 00:03:43,920
download server.

47
00:03:43,920 --> 00:03:48,920
And what we can do now is go ahead and say, "Make a new plugin project."

48
00:03:48,920 --> 00:03:51,920
And we'll just call it "Hello."

49
00:03:53,920 --> 00:03:57,920
And we don't have to do anything fancy, just create that.

50
00:03:57,920 --> 00:04:02,920
And now what we want to do is we actually want to create some static content.

51
00:04:02,920 --> 00:04:07,920
We'll start out simple and just make a simple HTML page and then contribute it to a web server.

52
00:04:07,920 --> 00:04:14,920
So, you go ahead and just make a new folder, say.

53
00:04:14,920 --> 00:04:18,920
And in that folder, we'll make a new file.

54
00:04:18,920 --> 00:04:23,920
I'll say, you know, "Hello, world."

55
00:04:23,920 --> 00:04:31,920
And save it in our little guy and we'll call it "Index studies."

56
00:04:31,920 --> 00:04:32,920
All right.

57
00:04:32,920 --> 00:04:35,920
So, that's pretty straightforward.

58
00:04:35,920 --> 00:04:37,920
Now, we've got some web content.

59
00:04:37,920 --> 00:04:38,920
Okay.

60
00:04:38,920 --> 00:04:42,920
So, now we want to hook that web content into a web server.

61
00:04:42,920 --> 00:04:45,920
Now, OSGI specifies this thing called the HTTP service.

62
00:04:45,920 --> 00:04:50,920
And basically, it can serve up content, static content or serverless.

63
00:04:50,920 --> 00:04:53,920
And we've extended it to be able to do JMPs and the like.

64
00:04:53,920 --> 00:05:00,920
And what you do in our intent piece of this is you actually just go and create an extension.

65
00:05:00,920 --> 00:05:02,920
Now, Eclipse has an extension point model.

66
00:05:02,920 --> 00:05:10,920
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.

67
00:05:10,920 --> 00:05:11,920
Right, right.

68
00:05:11,920 --> 00:05:13,920
Have all the glue that connects everything together.

69
00:05:13,920 --> 00:05:14,920
Yeah, yeah.

70
00:05:14,920 --> 00:05:19,920
So, the standard Eclipse way of doing this is through the extension, extension point registry.

71
00:05:19,920 --> 00:05:23,920
And the standard OSGI way of doing it is through services.

72
00:05:23,920 --> 00:05:27,920
You know, we can get into a long discussion about what the difference is between those two.

73
00:05:27,920 --> 00:05:32,920
But for right now, for this demo, I'm going to show you how to do it declaratively with extensions.

74
00:05:32,920 --> 00:05:33,920
Okay.

75
00:05:33,920 --> 00:05:39,920
So, back here on the plugin editor page, on the overview page, and let's click on the extensions guy here.

76
00:05:39,920 --> 00:05:43,920
And I haven't created any extensions before, so I'll say yes, I want to show the extensions.

77
00:05:43,920 --> 00:05:46,920
And I'll say, well, I want to add an extension.

78
00:05:46,920 --> 00:05:52,920
And I'm going to add an -- I'm going to search for the extension point to extend.

79
00:05:52,920 --> 00:05:54,920
And I've got this resources one.

80
00:05:54,920 --> 00:06:01,920
So, I can -- I've got an extension point called resources that I can add an extension for.

81
00:06:01,920 --> 00:06:02,920
So, now here we go.

82
00:06:02,920 --> 00:06:03,920
I've got an alias.

83
00:06:03,920 --> 00:06:08,920
And an alias is sort of -- what I'm doing is I'm situating some static content in URL space.

84
00:06:08,920 --> 00:06:11,920
I'm going to contribute it to an HTTP service.

85
00:06:11,920 --> 00:06:15,920
And say, here, put this content someplace in the URL space.

86
00:06:15,920 --> 00:06:22,920
So, I'll just call it content, just for fun.

87
00:06:22,920 --> 00:06:25,920
And then we put it in web.

88
00:06:25,920 --> 00:06:26,920
Right?

89
00:06:26,920 --> 00:06:27,920
That was the directory.

90
00:06:27,920 --> 00:06:30,920
Base name is the directory of content that we have in the folder.

91
00:06:30,920 --> 00:06:31,920
Right.

92
00:06:31,920 --> 00:06:38,920
So, now we've got an extension that goes into the HTTP service and says, hey, I've got some content in the web

93
00:06:38,920 --> 00:06:40,920
directory of this bundle.

94
00:06:40,920 --> 00:06:43,920
And you should put it in URL space at slash content.

95
00:06:43,920 --> 00:06:44,920
Right.

96
00:06:44,920 --> 00:06:49,920
So, we're sort of configuring the web server, as it were, by telling it where we're putting our content.

97
00:06:49,920 --> 00:06:50,920
Yeah.

98
00:06:50,920 --> 00:06:52,920
And the neat thing is we're doing this inside of a bundle.

99
00:06:52,920 --> 00:06:56,920
And bundles are sort of self-contained units of function.

100
00:06:56,920 --> 00:06:58,920
So, I can -- and a versions and --

101
00:06:58,920 --> 00:06:59,920
Right.

102
00:06:59,920 --> 00:07:04,920
So, I could even specify dependencies between just static content bundles.

103
00:07:04,920 --> 00:07:05,920
Sure.

104
00:07:05,920 --> 00:07:11,920
If I have a mail system and a chat system and a group mechanism for my website, I can have

105
00:07:11,920 --> 00:07:15,920
those in different bundles and say that the mail system depends on the chat system.

106
00:07:15,920 --> 00:07:16,920
Right.

107
00:07:16,920 --> 00:07:19,920
And those calls depend together on certain sort of identity systems.

108
00:07:19,920 --> 00:07:20,920
Right, right.

109
00:07:20,920 --> 00:07:23,920
And they're all just sort of connected to each other via URL.

110
00:07:23,920 --> 00:07:28,920
And then, I mean, I'm thinking that the other exciting thing here is that you can take this

111
00:07:28,920 --> 00:07:32,920
hello bundle that we haven't deployed to any web server because everything's sort of -- to

112
00:07:32,920 --> 00:07:37,920
use an old term, they're relatively defined paths and they're not sort of tied directly

113
00:07:37,920 --> 00:07:38,920
to any particular web server.

114
00:07:38,920 --> 00:07:43,920
So, it's somewhat completely self-contained and you can deploy it anywhere that you want

115
00:07:43,920 --> 00:07:44,920
to.

116
00:07:44,920 --> 00:07:45,920
Yeah.

117
00:07:45,920 --> 00:07:50,920
In this case, you know, we're doing it into any OSGI-based, you know, HTTP service.

118
00:07:50,920 --> 00:07:51,920
Well, sure.

119
00:07:53,920 --> 00:07:54,920
Right.

120
00:07:54,920 --> 00:07:58,920
So, to run this guy, I'll open the dialogue.

121
00:07:58,920 --> 00:08:03,920
Now, I have a launch configuration I've already set up from before.

122
00:08:03,920 --> 00:08:08,920
But really, it's just a -- we've got all the plugins that are in our targets, which is

123
00:08:08,920 --> 00:08:10,920
the standard Eclipse SDK drop.

124
00:08:10,920 --> 00:08:13,920
And I've selected 11 bundles out of there.

125
00:08:13,920 --> 00:08:14,920
And you can look through the list here.

126
00:08:14,920 --> 00:08:18,920
You see there's some, you know, common blogging and some things here.

127
00:08:18,920 --> 00:08:19,920
Yeah.

128
00:08:19,920 --> 00:08:21,920
And then you get it down.

129
00:08:21,920 --> 00:08:25,920
And to the interesting ones, you've got HTTP JETI and HTTP servlets.

130
00:08:25,920 --> 00:08:30,920
So, these are the things that actually supply HTTP functionality.

131
00:08:30,920 --> 00:08:33,920
And at the very bottom, it's alphabetical.

132
00:08:33,920 --> 00:08:35,920
We've got a bundle for JETI.

133
00:08:35,920 --> 00:08:40,920
So, we've taken JETI and bundlized it by putting an OSGI manifest markup in it.

134
00:08:40,920 --> 00:08:41,920
Yeah.

135
00:08:41,920 --> 00:08:44,920
And now it's embedded inside of Equinox.

136
00:08:44,920 --> 00:08:51,920
So, what I'm about to do with this launch configuration is start up -- oh, and I've got to add our -- this

137
00:08:51,920 --> 00:08:53,920
is our bundle we just added, right?

138
00:08:53,920 --> 00:08:54,920
Mm-hmm.

139
00:08:55,920 --> 00:09:01,920
So, what I'm about to do is start up an Equinox that's got JETI embedded in it.

140
00:09:01,920 --> 00:09:08,920
JETI will start and, you know, all the various contributions that we've made to JETI, in our case, just this one,

141
00:09:08,920 --> 00:09:13,920
will get woven into the URL space that I can go to a browser and get them on.

142
00:09:13,920 --> 00:09:14,920
Right, right.

143
00:09:14,920 --> 00:09:21,920
And now, you had a kind of an interesting phrasing there that you're going to start up an Equinox.

144
00:09:21,920 --> 00:09:25,920
And so, does that mean that there's actually an Equinox server that you're starting up?

145
00:09:25,920 --> 00:09:32,920
Or, I mean, what's sort of the relationship between the container of Equinox and JETI?

146
00:09:33,920 --> 00:09:34,920
Right.

147
00:09:34,920 --> 00:09:35,920
So, let me show you that here.

148
00:09:35,920 --> 00:09:37,920
In the console, I'll make the console big.

149
00:09:37,920 --> 00:09:40,920
This is the console for what I just launched.

150
00:09:40,920 --> 00:09:41,920
Right.

151
00:09:41,920 --> 00:09:44,920
Here in the corner, it's an OSGI framework that I launched.

152
00:09:44,920 --> 00:09:46,920
It happens to be called JETI and Equinox.

153
00:09:46,920 --> 00:09:51,920
And this is the standard OSGI console that we get.

154
00:09:51,920 --> 00:09:53,920
And you can see in here the list of bundles.

155
00:09:53,920 --> 00:09:55,920
I've got 11 bundles running.

156
00:09:55,920 --> 00:09:57,920
And there's Mort A, JETI there.

157
00:09:57,920 --> 00:09:58,920
So, there's Mort A, JETI.

158
00:09:58,920 --> 00:09:59,920
Right.

159
00:09:59,920 --> 00:10:02,920
And various other bundles which are active.

160
00:10:02,920 --> 00:10:04,920
And so, it's just up and running.

161
00:10:04,920 --> 00:10:06,920
And I can see here that JETI has started up.

162
00:10:06,920 --> 00:10:08,920
It's listening on port 80.

163
00:10:08,920 --> 00:10:11,920
And various things are sort of going on.

164
00:10:11,920 --> 00:10:18,920
And now, if I find my browser, go over here and go localhost.

165
00:10:18,920 --> 00:10:20,920
I've done this before.

166
00:10:20,920 --> 00:10:21,920
So, it's over there.

167
00:10:21,920 --> 00:10:22,920
Oh, darn.

168
00:10:22,920 --> 00:10:23,920
Oh, yes.

169
00:10:23,920 --> 00:10:24,920
Because I didn't put index.

170
00:10:24,920 --> 00:10:26,920
It's actually the wrong URL.

171
00:10:26,920 --> 00:10:27,920
Sorry.

172
00:10:27,920 --> 00:10:33,920
So, I can just go here and get content slash index dot HTML.

173
00:10:33,920 --> 00:10:35,920
I forgot which one I was doing.

174
00:10:35,920 --> 00:10:38,920
And there's our static content flow world.

175
00:10:38,920 --> 00:10:39,920
Right.

176
00:10:39,920 --> 00:10:41,920
And that was actually pretty quick to just get up and running with things.

177
00:10:41,920 --> 00:10:42,920
Especially since that.

178
00:10:42,920 --> 00:10:43,920
Well, yeah.

179
00:10:43,920 --> 00:10:44,920
That's the thing.

180
00:10:44,920 --> 00:10:46,920
There was nothing, you know, no configuring comcat.

181
00:10:46,920 --> 00:10:47,920
Right.

182
00:10:47,920 --> 00:10:51,920
And long sequence and making a war and all that sort of stuff.

183
00:10:51,920 --> 00:10:53,920
It's basically just, you know, let it go.

184
00:10:53,920 --> 00:10:54,920
Right.

185
00:10:54,920 --> 00:11:04,920
But what's kind of even cooler is that content is literally being served up dynamically right now.

186
00:11:04,920 --> 00:11:05,920
Right.

187
00:11:05,920 --> 00:11:09,920
So, I can change this to a hollow world, I don't know, whatever.

188
00:11:09,920 --> 00:11:10,920
It's nice.

189
00:11:11,920 --> 00:11:12,920
Right.

190
00:11:12,920 --> 00:11:17,920
And then I go back to our web browser and refresh and it's there.

191
00:11:17,920 --> 00:11:18,920
Right.

192
00:11:18,920 --> 00:11:19,920
So, this is something really magic.

193
00:11:19,920 --> 00:11:20,920
Oh, wow.

194
00:11:21,920 --> 00:11:24,920
So, what's going on in the back?

195
00:11:24,920 --> 00:11:28,920
Is it just like you said, it's reading directly from the file system, right?

196
00:11:28,920 --> 00:11:29,920
Right.

197
00:11:29,920 --> 00:11:30,920
That's pretty exciting.

198
00:11:30,920 --> 00:11:31,920
Yeah.

199
00:11:31,920 --> 00:11:32,920
So, what it is is I launched Equinox.

200
00:11:33,920 --> 00:11:34,920
Yeah.

201
00:11:34,920 --> 00:11:37,920
The bundles are coming, some of them out of my workspace and some of them out of what we

202
00:11:37,920 --> 00:11:38,920
call our target box ones.

203
00:11:38,920 --> 00:11:39,920
Right.

204
00:11:39,920 --> 00:11:42,920
And so, the ones that are coming out of my workspace, they're literally just very interested.

205
00:11:42,920 --> 00:11:43,920
Right, right.

206
00:11:43,920 --> 00:11:47,920
So, when I go and I edit them, the content is immediately reflected in whatever…

207
00:11:48,920 --> 00:11:49,920
Right.

208
00:11:49,920 --> 00:11:55,920
And what that shows you is that a bundle can be, you know, a zip file as it were or some

209
00:11:55,920 --> 00:12:00,920
other blob of information or it could just be an expanded out file system based sort

210
00:12:00,920 --> 00:12:01,920
of bundle as it were.

211
00:12:01,920 --> 00:12:02,920
Exactly.

212
00:12:02,920 --> 00:12:04,920
You don't have to worry about packaging things up.

213
00:12:05,920 --> 00:12:06,920
Yeah.

214
00:12:06,920 --> 00:12:11,920
You could take this bundle and export it as a jar and then it would be a bundled jar

215
00:12:11,920 --> 00:12:12,920
and it would work.

216
00:12:12,920 --> 00:12:13,920
It's just exactly the same.

217
00:12:13,920 --> 00:12:14,920
Right.

218
00:12:14,920 --> 00:12:15,920
Right.

219
00:12:15,920 --> 00:12:16,920
So, now we've done some static content.

220
00:12:16,920 --> 00:12:19,920
You know, that was fun but it's not that exciting.

221
00:12:19,920 --> 00:12:21,920
So, let's do some serverlets.

222
00:12:21,920 --> 00:12:28,920
So, you remember we added an extension to the, excuse me, to the resources extension point.

223
00:12:28,920 --> 00:12:38,920
So, let's add another extension, check this guy, to the serverlets extension point.

224
00:12:40,920 --> 00:12:44,920
So, here we've got, it's asking for details for the extension.

225
00:12:44,920 --> 00:12:46,920
Again, we have to give it an alias.

226
00:12:46,920 --> 00:12:48,920
Let's put this one simply at hello.

227
00:12:48,920 --> 00:12:49,920
Mm-hmm.

228
00:12:49,920 --> 00:12:53,920
And we have to define it, you know, serverlets are defined by Java classes.

229
00:12:53,920 --> 00:12:55,920
So, we have to define a class.

230
00:12:55,920 --> 00:12:59,920
But now, there's some interesting things that are going to happen here.

231
00:12:59,920 --> 00:13:03,920
And before we go and do that, we want to look at the dependencies.

232
00:13:03,920 --> 00:13:10,920
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.

233
00:13:10,920 --> 00:13:11,920
Absolutely.

234
00:13:11,920 --> 00:13:16,920
So, right here, I'm looking into the dependencies page of the bundle, the hello bundle.

235
00:13:16,920 --> 00:13:21,920
And we can see the list of required plugins and the list of imported packets.

236
00:13:21,920 --> 00:13:25,920
These are all the things that I could, the bundle I possibly get from the outside world.

237
00:13:25,920 --> 00:13:27,920
As you can see, they're both empty.

238
00:13:27,920 --> 00:13:28,920
Right.

239
00:13:28,920 --> 00:13:30,920
Right now, we're not thinking we need anything from the outside world.

240
00:13:30,920 --> 00:13:36,920
But we're about to implement a servlet which needs to extend HTTP servlet to class.

241
00:13:36,920 --> 00:13:37,920
Right.

242
00:13:37,920 --> 00:13:40,920
We have to see if we're going to get that from one place.

243
00:13:40,920 --> 00:13:45,920
So, what we can do here is then to go and add import package and do HTTP.

244
00:13:45,920 --> 00:13:50,920
Oh, hang on.

245
00:13:50,920 --> 00:13:52,920
I don't want a servlet.

246
00:13:52,920 --> 00:13:54,920
We need these two packages.

247
00:13:54,920 --> 00:13:55,920
Okay.

248
00:13:55,920 --> 00:13:57,920
So, I'm going to add those.

249
00:13:57,920 --> 00:13:58,920
Save.

250
00:13:58,920 --> 00:14:00,920
And go back to my extension tab here.

251
00:14:00,920 --> 00:14:03,920
And now I'm going to go and define the servlet class.

252
00:14:03,920 --> 00:14:05,920
When I do that, it comes in partially filled out.

253
00:14:05,920 --> 00:14:06,920
Right.

254
00:14:06,920 --> 00:14:13,920
But I'm actually going to make it extend HTTP servlet there.

255
00:14:13,920 --> 00:14:14,920
Okay.

256
00:14:14,920 --> 00:14:16,920
And I'll just click finish.

257
00:14:16,920 --> 00:14:19,920
And now I've got a servlet class, but it's got no body.

258
00:14:19,920 --> 00:14:21,920
So, I'll do get.

259
00:14:21,920 --> 00:14:23,920
And I'll make a quick body here.

260
00:14:23,920 --> 00:14:25,920
What should we do?

261
00:14:25,920 --> 00:14:26,920
We'll just do something like that.

262
00:14:26,920 --> 00:14:26,920
We'll do that.

263
00:14:26,920 --> 00:14:27,920
We'll do that.

264
00:14:27,920 --> 00:14:28,920
Not yet.

265
00:14:28,920 --> 00:14:29,920
Later.

266
00:14:29,920 --> 00:14:30,920
Make that even feel cool.

267
00:14:30,920 --> 00:14:31,920
And do that.

268
00:14:31,920 --> 00:14:32,920
Yeah.

269
00:14:32,920 --> 00:14:33,920
We'll just do a preview.

270
00:14:33,920 --> 00:14:34,920
Um.

271
00:14:34,920 --> 00:14:35,920
Hello from the servlet.

272
00:14:35,920 --> 00:14:36,920
Perfect.

273
00:14:36,920 --> 00:14:37,920
And do that.

274
00:14:37,920 --> 00:14:38,920
We'll just, uh, do a preview.

275
00:14:38,920 --> 00:14:39,920
Um.

276
00:14:39,920 --> 00:14:40,920
Hello from the servlet.

277
00:14:40,920 --> 00:14:41,920
Perfect.

278
00:14:41,920 --> 00:14:42,920
And do that.

279
00:14:42,920 --> 00:14:43,920
Yeah.

280
00:14:43,920 --> 00:14:44,920
We'll just, uh, do a preview.

281
00:14:44,920 --> 00:14:45,920
Um.

282
00:14:45,920 --> 00:14:46,920
Hello from the servlet.

283
00:14:46,920 --> 00:14:47,920
Um.

284
00:14:47,920 --> 00:14:49,920
Hello from the servlet.

285
00:14:49,920 --> 00:14:50,920
Perfect.

286
00:14:50,920 --> 00:14:51,920
And close.

287
00:14:51,920 --> 00:14:52,920
Close that.

288
00:14:52,920 --> 00:15:00,920
So, we register that, you know, you can obviously put any arbitrary content here in your service

289
00:15:00,920 --> 00:15:01,920
if you want.

290
00:15:01,920 --> 00:15:02,920
Right, right.

291
00:15:02,920 --> 00:15:06,920
And I'll obviously link it to web application frameworks and things like that.

292
00:15:06,920 --> 00:15:07,920
Oh, sure.

293
00:15:07,920 --> 00:15:08,920
I mean, you do, Rhett.

294
00:15:08,920 --> 00:15:10,920
You can have a jack on front.

295
00:15:10,920 --> 00:15:11,920
Right, right, right.

296
00:15:11,920 --> 00:15:12,920
Temples for all of those.

297
00:15:12,920 --> 00:15:15,920
But I'm trying to show just the sort of the basics here.

298
00:15:15,920 --> 00:15:16,920
Absolutely.

299
00:15:16,920 --> 00:15:23,920
So, we'll save our, uh, saved everything.

300
00:15:23,920 --> 00:15:27,920
Now, just to step back for a second and make sure that I've done everything I need to

301
00:15:27,920 --> 00:15:28,920
do.

302
00:15:28,920 --> 00:15:29,920
Um.

303
00:15:29,920 --> 00:15:30,920
I believe so.

304
00:15:30,920 --> 00:15:31,920
So, we'll go back.

305
00:15:31,920 --> 00:15:34,920
And now, there's something interesting I'll show you.

306
00:15:34,920 --> 00:15:37,920
Uh, we should still assign the console.

307
00:15:37,920 --> 00:15:39,920
We're still running our server.

308
00:15:39,920 --> 00:15:40,920
Uh-huh.

309
00:15:40,920 --> 00:15:41,920
Right.

310
00:15:41,920 --> 00:15:43,920
And what we did is we went into our bundle.

311
00:15:43,920 --> 00:15:44,920
Right.

312
00:15:44,920 --> 00:15:47,920
And we, we used to have static, just static content in there.

313
00:15:47,920 --> 00:15:48,920
And it's still here in the index.html.

314
00:15:48,920 --> 00:15:50,920
And what we just did is we added a servlet.

315
00:15:50,920 --> 00:15:51,920
Right.

316
00:15:51,920 --> 00:15:54,920
We added that servlet up the, uh, hello URL.

317
00:15:54,920 --> 00:15:58,920
So, if we went to localhost/hello, let's go do that right now.

318
00:15:58,920 --> 00:15:59,920
Ah, yes.

319
00:15:59,920 --> 00:16:01,920
We will see it dynamically deployed, huh?

320
00:16:01,920 --> 00:16:04,920
Well, yes and no.

321
00:16:04,920 --> 00:16:06,920
The localhost flow, I don't see it.

322
00:16:06,920 --> 00:16:07,920
Right?

323
00:16:07,920 --> 00:16:08,920
Right.

324
00:16:08,920 --> 00:16:21,920
But if I go back to our console, here, and find the, our hello bundle is number two.

325
00:16:21,920 --> 00:16:22,920
Right.

326
00:16:22,920 --> 00:16:31,920
So, if I go and I say, update two, and then go back to my lib browser.

327
00:16:31,920 --> 00:16:32,920
Oh, yeah.

328
00:16:32,920 --> 00:16:33,920
That's exciting.

329
00:16:33,920 --> 00:16:34,920
That's exciting.

330
00:16:34,920 --> 00:16:35,920
So, what happens when you update a bundle?

331
00:16:35,920 --> 00:16:38,920
See, what I did is I really just changed the content of the bundle.

332
00:16:38,920 --> 00:16:39,920
Right.

333
00:16:39,920 --> 00:16:40,920
That content got installed previously.

334
00:16:40,920 --> 00:16:41,920
Now, I've changed the content.

335
00:16:41,920 --> 00:16:46,920
And now, I tell, I simply tell the OSGI system, hey, update the content of that.

336
00:16:46,920 --> 00:16:49,920
Because there's new, like update your, your view of, of that bundle.

337
00:16:49,920 --> 00:16:50,920
Because there's new content in it.

338
00:16:50,920 --> 00:16:51,920
Right.

339
00:16:51,920 --> 00:16:52,920
Right.

340
00:16:52,920 --> 00:16:55,920
And so, it dynamically went, found those classes, found those new extensions,

341
00:16:55,920 --> 00:17:01,920
wove them into the system, and made that URL available, um, to, you know, to the browsers.

342
00:17:01,920 --> 00:17:06,920
And, and does, does it, does it reload the entire bundle, or is it more selective in how

343
00:17:06,920 --> 00:17:09,920
it reloads things, or dynamically loads things up?

344
00:17:09,920 --> 00:17:14,920
No, it reloads the bundle, because you could have arbitrary classes already loaded.

345
00:17:14,920 --> 00:17:15,920
Sure.

346
00:17:15,920 --> 00:17:18,920
Like, in this case, we went to static content with no classes into something with classes.

347
00:17:18,920 --> 00:17:22,920
But, if I already had something with classes in it, um, that, you could get quite sticky

348
00:17:22,920 --> 00:17:24,920
into having old versions of classes.

349
00:17:24,920 --> 00:17:25,920
Oh, yeah.

350
00:17:25,920 --> 00:17:26,920
Absolutely.

351
00:17:26,920 --> 00:17:29,920
So, you have to essentially throw away the old class loader.

352
00:17:29,920 --> 00:17:30,920
Right.

353
00:17:30,920 --> 00:17:32,920
And get a new class loader based on the new content.

354
00:17:32,920 --> 00:17:33,920
That makes sense.

355
00:17:33,920 --> 00:17:34,920
But, yeah.

356
00:17:34,920 --> 00:17:39,920
I mean, because I'm running, you know, in a, um, you know, a modern job or VM, we've got

357
00:17:39,920 --> 00:17:40,920
hot code replaced.

358
00:17:40,920 --> 00:17:44,920
We can also do things like, um, I'll add some more text here.

359
00:17:44,920 --> 00:17:45,920
Let's see.

360
00:17:45,920 --> 00:17:46,920
Let's see.

361
00:17:46,920 --> 00:17:47,920
Let's see.

362
00:17:47,920 --> 00:17:48,920
Second version.

363
00:17:48,920 --> 00:17:49,920
We'll change that.

364
00:17:49,920 --> 00:17:50,920
Right.

365
00:17:50,920 --> 00:17:58,920
And because we're running in situ, right, right out of the project, so just to illustrate that,

366
00:17:58,920 --> 00:18:02,920
right, I added the text here, and, and what I'm going to do is I'll go and I'll update

367
00:18:02,920 --> 00:18:03,920
bundle again.

368
00:18:03,920 --> 00:18:04,920
Okay.

369
00:18:04,920 --> 00:18:12,920
So I can just do update two, and then go back to our browser, and refresh, and then we've got

370
00:18:12,920 --> 00:18:13,920
a lot of those users.

371
00:18:13,920 --> 00:18:14,920
Great.

372
00:18:14,920 --> 00:18:15,920
Yeah, that's, that's pretty nice.

373
00:18:15,920 --> 00:18:19,920
That's, I mean, that's always one of the, uh, uh, if you don't have something helping

374
00:18:19,920 --> 00:18:24,920
you out along these lines, one of the, the, uh, annoyances of doing any sort of Java enterprise

375
00:18:24,920 --> 00:18:28,920
or whatever you want to call it development is having to redeploy things and wait.

376
00:18:28,920 --> 00:18:29,920
It's a, it's a big time suck.

377
00:18:29,920 --> 00:18:30,920
It's a big time suck.

378
00:18:30,920 --> 00:18:34,920
So it's always nice to have a system, like runtime systems that are very responsive to

379
00:18:34,920 --> 00:18:36,920
getting new changes in there for the development cycle.

380
00:18:36,920 --> 00:18:37,920
Right.

381
00:18:37,920 --> 00:18:38,920
Right.

382
00:18:38,920 --> 00:18:41,920
And so actually one of your questions on something that's very important.

383
00:18:41,920 --> 00:18:45,920
I mean, this, what we've been running is, is Jetty embedded inside of Econoc.

384
00:18:45,920 --> 00:18:46,920
Right.

385
00:18:46,920 --> 00:18:50,920
And in a classic sort of IT shop, uh, you know, if you went to your IT, you know, your

386
00:18:50,920 --> 00:18:54,920
security guys and said, and said, hey, I want to run this Econoc thing on our production

387
00:18:54,920 --> 00:18:55,920
service.

388
00:18:55,920 --> 00:18:56,920
Right.

389
00:18:56,920 --> 00:18:59,920
They would, they would probably, you know, look at you strangely and, and, you know, quietly

390
00:18:59,920 --> 00:19:00,920
shuffle you out the door.

391
00:19:00,920 --> 00:19:01,920
Right.

392
00:19:01,920 --> 00:19:04,920
Um, but if you went to them and said, hey, I have this web app that I want to run on

393
00:19:04,920 --> 00:19:09,920
our, you know, on our production, uh, or whatever your website would be.

394
00:19:09,920 --> 00:19:10,920
Right.

395
00:19:10,920 --> 00:19:13,920
They would say, you know, they'd ask a few questions, but they'd call, you know, in the

396
00:19:13,920 --> 00:19:15,920
end it would, it would, it would work out well.

397
00:19:15,920 --> 00:19:16,920
Right.

398
00:19:16,920 --> 00:19:22,920
And so what we have is to take exactly these same bundles and run them embedded inside

399
00:19:22,920 --> 00:19:24,920
of another web app.

400
00:19:24,920 --> 00:19:26,920
It's a thing we call the serverlet bridge.

401
00:19:26,920 --> 00:19:31,920
And essentially what happens is you, you have this, this tiny war, uh, that we create

402
00:19:31,920 --> 00:19:35,920
and it's, it's just got OSGI and a little launcher stuff in it.

403
00:19:35,920 --> 00:19:40,920
And you, you would deploy that war using standard, you know, J2E tools and all that sort of stuff.

404
00:19:40,920 --> 00:19:42,920
You put it in as a regular web app.

405
00:19:42,920 --> 00:19:47,920
And what it does when it starts up, it registers the serverlet with the, in the web app.

406
00:19:47,920 --> 00:19:52,920
And when somebody hits that serverlet, essentially it goes and it will start an Equinox framework

407
00:19:52,920 --> 00:19:54,920
inside of the web app.

408
00:19:54,920 --> 00:19:55,920
Right.

409
00:19:55,920 --> 00:20:01,920
And once Equinox is running, you can add bundles to it and do all that sort of stuff.

410
00:20:01,920 --> 00:20:02,920
Right.

411
00:20:02,920 --> 00:20:13,920
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.

412
00:20:13,920 --> 00:20:21,920
So 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.

413
00:20:21,920 --> 00:20:27,920
Um, and, and, and deploy into Tomcat or WAZ or, or, or in fact, Yeti running as a standalone, you know, for them.

414
00:20:27,920 --> 00:20:28,920
Right.

415
00:20:28,920 --> 00:20:29,920
Right.

416
00:20:29,920 --> 00:20:30,920
Or BA servers.

417
00:20:30,920 --> 00:20:39,920
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.

418
00:20:39,920 --> 00:20:40,920
Right.

419
00:20:40,920 --> 00:20:45,920
So that their next version of, uh, cell phones are going to be OSGI enabled.

420
00:20:45,920 --> 00:20:46,920
Right.

421
00:20:46,920 --> 00:20:54,920
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.

422
00:20:54,920 --> 00:21:12,920
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.

423
00:21:12,920 --> 00:21:13,920
Yeah, that, that looks nice.

424
00:21:13,920 --> 00:21:14,920
It's very powerful.

425
00:21:15,920 --> 00:21:17,920
Well, that's fantastic.

426
00:21:17,920 --> 00:21:18,920
Yeah.

427
00:21:18,920 --> 00:21:20,920
Well, thanks for, uh, showing us all those features.

428
00:21:20,920 --> 00:21:22,920
That was, uh, that was quite helpful.

429
00:21:22,920 --> 00:21:23,920
That'll be fun.

430
00:21:23,920 --> 00:21:24,920
I enjoy it.

431
00:21:24,920 --> 00:21:26,920
There's, uh, there's, there's, there's many more.

432
00:21:26,920 --> 00:21:37,920
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.

433
00:21:37,920 --> 00:21:38,920
Right.

434
00:21:38,920 --> 00:21:41,920
There's a lot more under there, but, uh, you know, we have to look at that.

435
00:21:41,920 --> 00:21:42,920
That's right.

436
00:21:42,920 --> 00:21:52,920
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

437
00:21:52,920 --> 00:21:55,920
instead of just, uh, doing it on the desktop as it were.

438
00:21:55,920 --> 00:21:56,920
So that'll be fun.

439
00:21:56,920 --> 00:21:57,920
Yeah.

440
00:21:57,920 --> 00:21:58,920
I've seen a lot more.

441
00:21:58,920 --> 00:21:59,920
Yeah.

442
00:21:59,920 --> 00:22:00,920
That'll be fun to see pan out.

443
00:22:00,920 --> 00:22:01,920
Hmm.

444
00:22:01,920 --> 00:22:02,920
All right.

445
00:22:02,920 --> 00:22:03,920
Well, uh, thanks.

446
00:22:03,920 --> 00:22:04,920
Thank you.

447
00:22:04,920 --> 00:22:05,920
Thank you.
