Server-Based Java Programming

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

This book is very good if you need know how to build a simple server and what things you must know about it. The text is easy to read and very good detailed.

Author(s): Ted Neward
Publisher: Manning
Year: 2000

Language: English
Pages: 592
City: Greenwich, CT

brief contents......Page 7
contents......Page 9
foreword......Page 15
preface......Page 17
acknowledgments......Page 21
about this book......Page 23
goals of this book......Page 29
about the author......Page 31
about the cover illustration......Page 33
1.1.1 What is enterprise development?......Page 35
1.1.2 Developing the enterprise application......Page 38
1.1.3 Reinventing the wheel......Page 41
1.2 Three zeroes......Page 42
1.2.1 Zero development......Page 43
1.2.2 Zero deployment......Page 45
1.2.3 Zero administration......Page 46
1.3.2 Alternate views......Page 48
1.4 Why Java?......Page 49
1.4.1 Criticisms of Java as a server-side language......Page 51
1.5 Summary......Page 59
1.6 Additional reading......Page 60
ClassLoaders......Page 61
2.1.1 Run-time dynamic loading......Page 62
2.1.2 Reflection......Page 65
2.2.1 Java .class file format......Page 71
2.2.2 Using ClassLoader......Page 73
2.2.3 java.lang.ClassLoader......Page 75
2.2.4 Java name spaces......Page 82
2.3.2 java.net.URLClassLoader......Page 83
2.3.5 Bootstrap ClassLoader......Page 91
2.4 Summary......Page 92
2.5 Additional reading......Page 93
3.1 Extending ClassLoader......Page 95
3.1.1 FileSystemClassLoader......Page 96
3.1.2 HashtableClassLoader......Page 100
3.1.3 CompilerClassLoader......Page 101
3.1.4 StrategyClassLoader and ClassLoaderStrategy......Page 105
3.1.5 CompositeClassLoader......Page 109
3.1.6 Other ClassLoader tricks......Page 113
3.2 On-the-fly code upgrades......Page 114
3.3.1 Goals......Page 119
3.3.2 Service......Page 120
3.3.3 Server......Page 122
3.3.4 ServerManager......Page 124
3.4 Summary......Page 126
Extensions......Page 127
4.1.1 Installed extensions......Page 128
4.1.2 Building an installed extension......Page 129
4.1.3 Download extensions......Page 130
4.1.4 Building a download extension......Page 132
4.2.1 Distributed libraries through download extensions......Page 134
4.2.2 Java EXEs; relation to C++ static linking......Page 135
4.3 Packaging extensions......Page 136
4.3.1 The build-time vs. run-time dilemma......Page 137
4.4 The plug-in......Page 138
4.4.1 The plug-in concept......Page 139
4.4.2 Enter plug-ins......Page 141
4.4.3 Marking a .jar file as a plug-in......Page 144
4.4.4 PluginClassLoader......Page 145
4.4.5 Example: PluginApp......Page 152
4.4.6 Uses for plug-ins......Page 158
4.5 Summary......Page 159
Threads......Page 160
5.1.1 Concurrent processing......Page 161
5.1.2 Scalability per machine......Page 162
5.1.3 Encapsulation......Page 163
5.2 Java threads......Page 164
5.2.1 java.lang.Thread and java.lang.Runnable......Page 165
5.2.2 Starting threads......Page 171
5.2.3 Stopping threads......Page 173
5.2.4 Daemon threads......Page 176
5.2.5 Threads and ClassLoaders......Page 177
5.2.6 java.lang.ThreadGroup......Page 178
5.3 Thread implementations in Java......Page 180
5.3.3 Hybrids......Page 181
5.5 Additional reading......Page 182
Threading issues......Page 183
6.1 Synchronization......Page 184
6.1.1 Thread-local storage......Page 186
6.2 Exception-handling with multiple threads......Page 187
6.3.1 Client-Dispatcher-Server......Page 192
6.3.2 Fire-and-forget......Page 193
6.3.4 SpinLoop......Page 194
6.3.5 Polling (PeriodicThread)......Page 195
6.3.6 DelayedFire (ScheduledThread)......Page 197
6.3.7 Futures......Page 198
6.4 GJAS......Page 200
6.4.1 Adding thread support to GJAS......Page 201
6.6 Additional reading......Page 207
Control......Page 208
7.1.1 Local implementation......Page 209
7.1.2 Example: HelloService......Page 220
7.2 Testing the LocalServer implementation......Page 221
7.3 ExecService......Page 223
7.4 HelloAgainService......Page 227
7.4.1 ThreadServer......Page 230
7.4.2 Example: ConsoleControlService......Page 235
Remote control......Page 242
8.1 RMI implementation......Page 243
8.1.1 Analysis......Page 251
8.2 Other implementations......Page 252
8.3 Necessary improvements......Page 253
8.4 Additional reading......Page 258
9.1 Java models......Page 259
9.1.1 Interface: ConfigProperty and ConfigProperties......Page 260
9.1.2 Usage......Page 267
9.1.3 Configuration front ends......Page 269
9.2 Summary......Page 270
10.1 Simple socket services......Page 271
10.1.1 SocketClient......Page 272
10.1.2 EchoService......Page 277
10.1.3 TimeService......Page 279
10.1.4 Analysis......Page 280
10.2.1 SocketServer......Page 281
10.2.2 Example: Echo2Service......Page 288
10.3 Connection and ConnectionManager......Page 289
10.3.1 Example: EchoConnection......Page 296
10.3.2 Example: HTTPConnection......Page 297
10.3.3 Servlets......Page 306
10.4.1 SocketClassLoader and SocketClassService......Page 307
10.4.2 Concept: RedirectorService......Page 313
10.4.3 Concept: FilterService......Page 314
10.5 Summary......Page 315
10.6 Additional reading......Page 316
11.1 Relationship to sockets......Page 317
11.1.1 CodeServlet: A filtering servlet......Page 319
11.1.2 HeaderFooter: a redirecting servlet......Page 321
11.1.3 Server-side scripting capabilities......Page 323
11.1.4 Servlets: Not just about HTML anymore......Page 324
11.2 Servlets and the n-tier application......Page 326
11.3 Servlets as a poor man’s RMI......Page 327
11.3.1 Example: RemoteStorageServlet......Page 329
11.3.2 Concept: poor man’s RMI......Page 331
11.5 Additional reading......Page 332
Persistence......Page 334
12.1 Java Serialization......Page 335
12.1.1 Serialization to other places......Page 336
12.1.2 Security and Serialization......Page 337
12.1.3 Customized Serialization......Page 340
12.1.4 Serialization and evolution......Page 343
12.1.5 Replacement......Page 347
12.2.1 Remote storage of objects......Page 351
12.2.2 Example: RemoteStorageService and RemoteStorageClient......Page 352
12.2.3 Remote construction of objects......Page 357
12.2.4 Example: RemoteObjectFactory......Page 359
12.3 JDBC......Page 364
12.3.1 Transient data, state data, data that isn’t data......Page 366
12.3.2 Example: JDBCClassLoader......Page 368
12.4 Summary......Page 372
12.5 Additional reading......Page 373
13.1 Modeling data......Page 374
13.1.2 One-tier systems......Page 375
13.1.4 n-tier systems......Page 376
13.1.5 Benefits of an n-tier model......Page 377
13.1.7 Example: employee directory......Page 380
13.1.8 Business objects layer interface layer......Page 382
13.2.2 Example: OrgTree......Page 400
13.3 Summary......Page 404
13.4 Additional reading......Page 405
14.1 Example: HashtableModel......Page 406
14.1.1 Overview......Page 407
14.1.2 HashtablePerson, HashtableEmployee, HashtableManager......Page 408
14.1.3 HashtableModel: Creating objects......Page 409
14.1.4 HashtableModel: Finding objects......Page 412
14.1.6 Conclusion......Page 413
14.2 Example: RDBMSModel......Page 414
14.2.1 RDBMSModel: Storing Business Objects in an RDBMS......Page 415
14.2.2 Overview......Page 416
14.2.3 RDBMSPerson, RDBMSEmployee, RDBMSManager......Page 418
14.2.4 RDBMSModel: Creating objects......Page 425
14.2.5 RDBMSModel: Finding objects......Page 428
14.2.6 RDBMSModel: Removing objects......Page 429
14.2.7 Conclusion......Page 431
14.3 Summary......Page 434
14.4 Additional reading......Page 435
15.1 Why distribute?......Page 436
15.1.1 Communication......Page 437
15.1.2 Performance......Page 438
15.1.3 Economics (clustering/fault-tolerance)......Page 439
15.2.1 Stateful vs. stateless......Page 440
15.3 Technologies......Page 444
15.3.1 Raw access: Sockets......Page 445
15.3.2 Java RPC: remote method invocation......Page 446
15.3.3 Analysis......Page 451
15.3.4 RMI/JRMP......Page 453
15.3.5 Object Request Brokers: CORBA......Page 462
15.3.6 Object Request Brokers: Distributed Component Object Model......Page 466
15.3.7 Message-Oriented Middleware: JMS......Page 467
15.3.8 Objects across the wire: Mobile objects......Page 469
15.3.9 Objects across the wire: shared objects......Page 475
15.4 Employee middleware models......Page 482
15.4.1 RMI implementation......Page 485
15.4.2 JSDTModel: Shared-object implementation......Page 486
15.4.3 Analysis......Page 494
15.5 Additional reading......Page 495
Java Native Interface......Page 497
16.1 Java Native Interface......Page 498
16.1.1 Native code on the server......Page 499
16.2.1 Java calling native......Page 506
16.2.2 Native calling Java......Page 512
16.2.3 JNI invocation......Page 518
16.2.4 JNI changes in JDK 1.2......Page 526
16.3.2 CORBA......Page 528
16.4.1 Making GJAS an NT service......Page 529
16.4.2 Using NT IPC mechanisms: Named pipe......Page 530
16.5.1 Debugging support......Page 540
16.5.2 JVMDI......Page 541
16.7 Additional reading......Page 542
17.1 Importance grows......Page 544
17.1.1 Liveness......Page 545
17.1.2 Notification......Page 557
17.2 Summary......Page 567
epilogue......Page 569
Where to go from here?......Page 576
Read all about CORBA......Page 578
Summary......Page 579
C......Page 581
D......Page 582
E......Page 583
H......Page 584
J......Page 585
M......Page 586
P......Page 587
S......Page 588
Z......Page 590