100% found this document useful (5 votes)
32 views

Implementing SOA Using Java EE 1st Edition B.V. Kumar All Chapters Instant Download

EE

Uploaded by

dyckeyaar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (5 votes)
32 views

Implementing SOA Using Java EE 1st Edition B.V. Kumar All Chapters Instant Download

EE

Uploaded by

dyckeyaar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

Download Full ebookname - Read Now at ebookname.

com

Implementing SOA Using Java EE 1st Edition B.V.


Kumar

https://ebookname.com/product/implementing-soa-using-java-
ee-1st-edition-b-v-kumar/

OR CLICK BUTTON

DOWLOAD EBOOK

Discover More Ebook - Explore Now at ebookname.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Advanced Java Programming Uttam Kumar Roy

https://ebookname.com/product/advanced-java-programming-uttam-kumar-
roy/

ebookname.com

Beginning Java EE 6 Platform with GlassFish 3 1st Edition


Antonio Goncalves

https://ebookname.com/product/beginning-java-ee-6-platform-with-
glassfish-3-1st-edition-antonio-goncalves/

ebookname.com

Beginning EJB 3 2nd Edition Java EE 7 Edition Jonathan


Wetherbee

https://ebookname.com/product/beginning-ejb-3-2nd-edition-java-
ee-7-edition-jonathan-wetherbee/

ebookname.com

The Blackwell Encyclopedia of Management Managerial


Economics Blackwell Encyclopaedia of Management Volume 8
2nd Edition Robert E. Mcauliffe
https://ebookname.com/product/the-blackwell-encyclopedia-of-
management-managerial-economics-blackwell-encyclopaedia-of-management-
volume-8-2nd-edition-robert-e-mcauliffe/
ebookname.com
Ethics Technology and Engineering An Introduction 1st
Edition Ibo Van De Poel

https://ebookname.com/product/ethics-technology-and-engineering-an-
introduction-1st-edition-ibo-van-de-poel/

ebookname.com

The Parallax View 1st Edition Slavoj Žižek

https://ebookname.com/product/the-parallax-view-1st-edition-slavoj-
zizek/

ebookname.com

The Problem of Perception 1st Edition A. D. Smith

https://ebookname.com/product/the-problem-of-perception-1st-edition-a-
d-smith/

ebookname.com

Multilingual Currents in Literature Translation and


Culture 1st Edition Rachael Gilmour

https://ebookname.com/product/multilingual-currents-in-literature-
translation-and-culture-1st-edition-rachael-gilmour/

ebookname.com

Nonlinear Partial Differential Equations with Applications


1st Edition Tomás Roubicek

https://ebookname.com/product/nonlinear-partial-differential-
equations-with-applications-1st-edition-tomas-roubicek/

ebookname.com
In Situ Testing in Geomechanics The Main Tests 1st Edition
Fernando Schnaid (Author)

https://ebookname.com/product/in-situ-testing-in-geomechanics-the-
main-tests-1st-edition-fernando-schnaid-author/

ebookname.com
Implementing SOA
Using Java™ EE

The Java Series

Visit informit.com/thejavaseries for a complete list of available publications.

ublications in The Java ™ Series are supported, endorsed, and


P written by the creators of Java at Sun Microsystems, Inc. This series
is the official source for expert instruction in Java and provides the
complete set of tools you’ll need to build effective, robust, and portable
applications and applets. The Java ™ Series is an indispensable resource
for anyone looking for definitive information on Java technology.

Visit Sun Microsystems Press at sun.com/books to view additional titles


for developers, programmers, and system administrators working with
Java and other Sun technologies.
Implementing SOA

Using Java EE

B. V. Kumar
Prakash Narayan
Tony Ng

Upper Saddle River, NJ • Boston • Indianapolis • San Francisco


New York • Toronto • Montreal • London • Munich • Paris • Madrid
Cape Town • Sydney • Tokyo • Singapore • Mexico City
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as Editor-in-Chief
trademarks. Where those designations appear in this book, and the publisher was aware of a trademark Mark Taub
claim, the designations have been printed with initial capital letters or in all capitals. Acquisitions Editor
Sun Microsystems, Inc. has intellectual property rights relating to implementations of the technology Greg Doench
described in this publication. In particular, and without limitation, these intellectual property rights may Development Editor
include one or more U.S. patents, foreign patents, or pending applications. Songlin Qiu
Sun, Sun Microsystems, the Sun logo, J2ME, J2EE, Java Card, and all Sun and Java based trademarks Managing Editor
and logos are trademarks or registered trademarks of Sun Microsystems, Inc., in the United States and Kristy Hart
other countries. UNIX is a registered trademark in the United States and other countries, exclusively
licensed through X/Open Company, Ltd. This publication is provided “as is” without warranty of any Project Editor
kind, either express or implied, including, but not limited to, the implied warranties of merchantability, Anne Goebel
fitness for a particular purpose, or non-infringement. This publication could include technical inaccura- Copy Editor
cies or typographical errors. Changes are periodically added to the information herein; these changes Apostrophe Editing
will be incorporated in new editions of the publication. Sun Microsystems, Inc. may make improve- Services
ments and/or changes in the product(s) and/or the program(s) described in this publication at any time.
Indexer
The authors and publisher have taken care in the preparation of this book, but make no expressed or Lisa Stumpf
implied warranty of any kind and assume no responsibility for errors or omissions. No liability is
Proofreader
assumed for incidental or consequential damages in connection with or arising out of the use of the
Karen A. Gill
information or programs contained herein.
Publishing Coordinator
The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or
Michelle Housley
special sales, which may include electronic versions and/or custom covers and content particular to your
business, training goals, marketing focus, and branding interests. For more information, please contact: Cover Designer
Alan Clements
U.S. Corporate and Government Sales
(800) 382-3419 Senior Compositor
corpsales@pearsontechgroup.com Gloria Schurick
For sales outside the United States please contact:
International Sales
international@pearson.com
Visit us on the web: informit.com/aw
Library of Congress Cataloging-in-Publication Data:
Kumar, B. V. (Balepur Venkatanna ), 1959-
Implementing SOA using Java EE / B.V. Kumar, Prakash Narayan, Tony Ng.
p. cm.
ISBN 978-0-321-49215-9 (pbk. : alk. paper) 1. Service-oriented architecture (Computer science)
2. Java (Computer program language) I. Narayan, Prakash, 1960- II. Ng, Tony. III. Title.
TK5105.5828K95 2010
004.6'54--dc22
2009041877
Copyright © 2010 Sun Microsystems, Inc.
All rights reserved. Printed in the United States of America. This publication is protected
by copyright, and permission must be obtained from the publisher prior to any prohibited
reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic,
mechanical, photocopying, recording, or likewise. For information regarding permissions, write to:
Pearson Education, Inc
Rights and Contracts Department
501 Boylston Street, Suite 900
Boston, MA 02116
Fax (617) 671 3447
ISBN-13: 978-0-321-49215-9
ISBN-10: 0-321-49215-3
Text printed in the United States on recycled paper at Edwards Brothers in Ann Arbor, Michigan.
First printing December 2009
To my mother—Mrs. M. N. Lakshmidevamma
—Dr. B. V. Kumar

To my parents—Mr. K.N. Krishnamoorthy and Mrs. Sharada Krishnamoorthy


—Prakash Narayan

To Kaitlyn, Tyler, and Sophia


—Tony Ng
This page intentionally left blank
Contents

Foreword by Robert Brewin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii


Foreword by Raj Bala . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviii
Acknowledgments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
About the Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii

Part I Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1
Chapter 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Products and Services 4
Software-Driven Services 4
Web Services 6
SOA 8
Web Services and SOA Opportunities 12
Summary 13
Endnotes 13
Chapter 2 Evolution of IT Architectures . . . . . . . . . . . . . . . . . . .15
The Server-Side Architecture Progression 16
Progression of Mainframe Architecture 17
Progression of Client/Server Architecture 19
Progression of Distributed Architecture 21
Internet and World Wide Web 26

vii

From the Library of ALESSANDRO CAROLLO


viii CONTENTS

Client-Side Architecture Progression 28


Terminals as Clients 29
Thick Clients 30
Thin Clients 30
Browser Clients 31
Mobile Clients 31
Service Oriented Architecture and Web Services 32
Web Services 32
Arrival of SOAP, WSDL, and UDDI Infrastructure 34
Summary 35
Endnotes 35
Chapter 3 Evolution of Service Oriented Architecture . . . . . . . 37
Services Oriented Architecture—The Description 38
Early Architectures 38
IMS 39
CICS 40
CORBA 41
DCOM 41
Paradigm Shifts 42
Java and Java 2 Enterprise Edition 42
Extensible Markup Language 43
Web Services—XML-RPC and SOAP 44
Arrival of Web Services and SOA 44
First Generation Web Services 45
The Second Generation Web Services 45
SOA Using Web Services 46
Benefits and Challenges with SOA 47
SOA Implementation Technologies 47
Microsoft's .NET Technologies 48
Sun Microsystems’s Java Enterprise Edition Technologies 48
Summary 50
Endnotes 50
Part II Service Oriented Architecture Essentials . . . . . . . . . . . . . . 53
Chapter 4 Message Oriented Services and SOAP . . . . . . . . . . 55
SOAP Conventions 56
Message Envelope 56
Encoding Rules 56
RPC Convention 56
Binding 57
CONTENTS ix

Anatomy of SOAP 57
Basic SOAP Model 57
Detailed SOAP Model 60
SOAP Encoding Details 65
Simple Type Encoding 65
Complex Type Encoding 66
SOAP Binding to the Transport Protocol 68
Interaction Using the SOAP Protocol 68
Message Exchange Model 69
SOAP Response and the Error-Handling Mechanism 71
The SOAP <Fault> 72
The SOAP <faultcode> 72
The SOAP <faultstring> 73
The SOAP <faultactor> 73
The SOAP <detail> 73
SOAP Version Differences and Dependencies 73
SOAP Versioning 73
New SOAP Version 74
Summary 75
Endnotes 76
Chapter 5 Web Services and Web Services Description
Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77
WSDL—An XML Web Services Description Vocabulary 78
The Web Services Triangle 78
Service Invocation Fundamentals 80
Synchronous Invocation and Fundamentals of RPC Mechanism 81
Service Invocation and WSDL 85
Creation of the Service 86
Generating the Web Service Description for the Service 87
Registering the Web Service 87
Publication of the Web Service 87
Discovering the Web Service 87
Understanding the Web Services Semantics 87
Invocation of Web Service 88
Describing Web Services—The XML Way 91
WSDL Elements and Their Appearance Sequence 92
Anatomy of WSDL Document 93
WSDL Version Differences and Dependencies 100
Summary 100
Endnotes 101
x CONTENTS

Chapter 6 Registries and UDDI . . . . . . . . . . . . . . . . . . . . . . . . . 103


Defining UDDI 104
Taxonomy-Based Business Information 104
UDDI Specifications and Services 105
Public Registries Versus Private Registries 105
UDDI Nomenclature 106
Node API Sets 106
UDDI Node 106
UDDI Registries 106
Data Structure 107
Information Model 107
Core UDDI 107
The <businessEntity> Data Structure 108
The <businessService> Data Structure 109
The <bindingTemplate> Data Structure 110
The <tModel> Data Structure 111
Publication of Business Information 112
Creation and Modification of Business Information 113
Deletion of Business Information 114
Discovering Web Services 115
Information Browsing and Retrieval 116
Information Drill-Down 117
Summary 118
Chapter 7 Orchestration and Choreography . . . . . . . . . . . . . 119
Importance of Business Process and Work Flow 120
Orchestration 121
WS-Business Process Execution Language 122
Processing BPEL 124
Choreography 127
Orchestration and SOA 129
Choreography and SOA 130
Summary 130
Endnotes 131
Chapter 8 Advanced Web Services Infrastructure for
Implementing SOA . . . . . . . . . . . . . . . . . . . . . . . . . 133
Message Exchange Patterns 135
WS-*—The New Generation 136
WS-Addressing 137
WS-Atomic Transaction 137
CONTENTS xi

WS-Coordination 137
WS-Eventing 137
WS-Metadata Exchange 138
WS-Notification 138
WS-Policy Framework 138
WS-Reliability/WS-Reliable Messaging 138
WS-Security 138
WS-*—A Working Definition 139
Addressing 139
Reliability and Reliable Messaging 140
Security 142
WS-* and SOA 146
WS-Reliable Messaging and SOA 147
WS-Security and SOA 147
WS-I Basic Profile 147
Summary 148
Endnotes 148
Part III Java Platform, Enterprise Edition and ESB. . . . . . . . . . . . .149
Chapter 9 Java Platform, Enterprise Edition Overview . . . . . .151
Java EE Technology Categories 153
Web Application Technologies 153
Web Services Technologies 155
Enterprise Application Technologies 158
Common Platform Technologies 160
What's New in Java EE 5 162
Java Annotations 163
POJO Model 165
Developer Productivity 166
Java EE Component Model 167
Application Client 167
Web Components 168
EJB Components 168
Resource Adapter 168
Java EE Quality of Services 169
Distribution 169
Data Integrity 169
Security 169
Performance and Scalability 170
Availability 170
xii CONTENTS

Interoperability 171
Concurrency 171
Summary 171
Endnotes 172
Chapter 10 Web Technologies in Java EE . . . . . . . . . . . . . . . . 173
Java Servlet 174
JSP 176
JSP Standard Tag Library 177
JSF 178
MVC Paradigm in JSF 178
User Interface Component Framework 179
Navigation Model 180
Managed Beans 182
Unified Expression Language 183
Data Conversion and Validation 184
JSF Events 185
Backing Bean Approach 186
Summary 187
Endnote 187
Chapter 11 Enterprise JavaBeans and Persistence . . . . . . . . . 189
Core EJB 3.0 API 190
Dependency Injection 191
Container Services 191
Interceptors 193
New JPA 193
Entity Class 194
Relationships 195
Inheritance 196
Entity Manager 197
Entity Life-Cycle Operations 197
Java Persistence Query Language 200
Object-Relational Mapping 203
Relationship Mapping 203
Inheritance Mapping 204
Summary 205
Chapter 12 Java Web Services Overview . . . . . . . . . . . . . . . . 207
Implementing a Web Service 208
Mapping Between Java and WSDL 208
CONTENTS xiii

Web Service Annotations 210


@WebService 210
@WebMethod 211
@Oneway 211
@WebParam 211
@WebResult 211
@HandlerChain 211
@SOAPBinding 212
Accessing Web Services 212
Protocol and Transport 213
Advanced Features in JAX-WS 213
Handler Framework 213
Asynchronous Interactions 214
Messaging API 215
Java Architecture for XML Binding 217
Schema Evolution 220
Summary 222
Chapter 13 Enterprise Service Bus and Java Business
Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
The Service Bus and Enterprises 224
ESB—A Business Perspective 224
Salient Features of ESB 226
Java Business Integration—Java and ESB 227
Summary 230
Part IV Implementing SOA Using Java EE Platform . . . . . . . . . . . . 231
Chapter 14 Service Oriented Architecture and the
Web Tier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .233
Delivering Services Through the Web Tier 234
The Overall Picture 235
Web Tier Design Patterns and SOA 236
Presentation Tier Design Patterns 236
Frameworks and Service Delivery 237
Services Delivery Using JSF 238
Deciding on the Right Framework 244
Summary 245
Endnotes 246
xiv CONTENTS

Chapter 15 Service Oriented Architecture and the


Business Tier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
Delivering Services Through the Business Tier 248
Business Tier Overview 248
Business Tier Design Patterns and SOA 250
Business Tier Design Patterns 251
Presentation Tier-to-Business Tier Design Patterns 251
Transfer Object Design Pattern 252
Integration Tier Design Patterns 254
The Data Access Object Pattern 255
Intrabusiness Tier Design Patterns 257
Application Service Design Pattern 258
Summary 259
Endnote 260
Chapter 16 Advanced Service Oriented Architecture . . . . . . . 261
Patterns in SOA 261
Asynchronous Messaging Patterns 263
Conversation Patterns 267
Orchestration Patterns 269
Workflow Patterns 273
Summary 279
Endnotes 280
Part V Case Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
Chapter 17 Developing Service Oriented Applications—
A Case Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
The Industry Perspective 285
Messaging Distribution in the OTA 285
The Goals of the OTA 286
The Plans and Specifications of the OTA 286
The Alliance Members 287
The Case Study 288
Challenges 289
Solution Implementation Strategies 290
Travel Reservation Service 291
The Workflow or the Process Definition 294
Solution Platform Considerations 296
Summary 298
Endnotes 299
CONTENTS xv

Chapter 18 Delivering SOA Using NetBeans SOA Pack:


Case Study—Solution . . . . . . . . . . . . . . . . . . . . . . .301
Implementation Strategy—An Overview 302
NetBeans IDE 303
Invoking NetBeans 304
Exploring the IDE 304
Project Basics 305
Project Creation 306
Summary 319
Endnotes 319
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .321
Web References 321
AJAX 321
BPEL 321
CICS 321
Design Pattern 322
ESB 322
ESB Importance 322
GDS 322
Hibernate 323
Implementing SOA with Java EE 5 323
IMS 323
IMS TM 323
J2EE Best Practices 323
J2EE Patterns 323
J2EE Versus .NET 323
Java EE 5 Developer Productivity 323
Java Specification Request 324
jRuby 325
OTA 325
Paradigm Shift 325
Paradigm Shift in IT 325
Performance Benchmark 325
Portlet 325
Ruby 325
Sabre, GDS 325
SOA 326
SOA General 326
SOAP 326
xvi CONTENTS

SOA Patterns 326


Tango 326
Web Services 327
WSDL 327
WSDL and UDDI 327
XML 327
Yahoo! 327
Books 327
Design Patterns 327
ESB 327
J2EE 328
Java 328
Java, XML 328
MDA 328
NetBeans 328
SOA 328
Software Architecture 329
Web Services 329
XML 329
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
Forewords

Robert Brewin
Recently, seasoned analysts like Anne Thomas Manes have said that SOA is
dead and that it has failed to deliver its promised benefits. There have been
opposing viewpoints to this. ZDNet blogger Joe McKendrick hosted a panel dis-
cussion on “Avoiding SOA Disillusionment,” and the panelists concluded that
any perceived disillusionment stemmed from lack of planning and measurement
on the part of the Enterprises and not from a failure of SOA. In fact, Enterprises
that have been working with SOA practices and methodologies remain bullish
on the approach and recognize that SOA continues to hold promise as a model
for integration and helping to tactically reduce costs in tough times. The promise
of SOA is that it offers an architectural approach to support the proliferation and
adoption of reusable services. This is an approach that companies should adopt
to streamline their development processes and improve the quality and maintain-
ability of their code.
At Sun, we developed the Java Platform, Enterprise Edition (Java EE) as an
industry standard, and it forms the ideal foundation upon which developers can
implement Enterprise-class SOA and next generation web applications. I am
pleased to see this book by Kumar, Narayan, and Ng, which takes a practical
approach to implementing SOA with Java EE. The focus is on real implementa-
tion techniques, leveraging the GlassFish Application Server and NetBeans IDE.
By taking this approach, the authors have demystified SOA from an alphabet
soup of Web Services standards and shown how readers can implement SOA in
their Enterprise readily and easily. In addition to explaining the concepts of SOA
and the concepts of Java EE, the authors dive deep into implementing SOA with

xvii

From the Library of ALESSANDRO CAROLLO


xviii FOREWORDS

Java EE and show how services can be delivered within different tiers of an
Enterprise architecture.
Architects, developers, managers, other IT professionals, educators, and students
will benefit from different aspects of this book from concepts to architecting to
implementation, configuration, and tuning. I trust that you will find this book
beneficial and enlightening.
Robert Brewin
Chief Technology Officer, Software
Sun Microsystems

Raj Bala
Now more than ever, concepts like availability, leveragability, scalability,
expandability, extendibility, and security permeate every discussion on technol-
ogy architecture. As companies become more aware of harvesting maximum
sustainable value from technology investments, the architecture fraternity has
always cried loud for how the fundamentals matter. Architectural integrity is
measured by all the “itys” that I mentioned in my first sentence, and it is hearten-
ing to see how the answers have been around and, in fact, getting better.
Service oriented architecture (SOA) as a fundamental fix to future problems has
evolved to newer and more advanced frontiers. Saddling on ever-perfected tech-
nologies such as Java EE, SOA is becoming more appealing and compelling
than ever before.
At Cognizant, we have been developing and delivering Enterprise solutions
using SOA. And it is my privilege to write a Foreword for a book for one of our
own—Kumar is a coauthor along with Prakash and Tony. The book carefully
unravels the vast topic of service oriented architecture through a definitive and
illustrative approach. It segments web services across First Generation Web Ser-
vices for services composition, Second Generation Web Services for wiring
these services into the process/workflow of the enterprise, and WS-* for address-
ing the nonfunctional needs of the Enterprise application. This book will also
double-up as an effective implementation guide on the advanced features of the
new Java Platform, Enterprise Edition and indicate how different APIs, such as
JAX-WS and JAXB, of the new platform help in different aspects of service ori-
entation for the Enterprise application.
This book should be extremely relevant to a variety of stake holders including
architects, senior enterprise developers, and application integrators. This book is
FOREWORDS xix

also a great reference material for students of computer science, software, and
systems architecture.
From academics to architects, practitioners to pedants, students to specialists,
coders to CXOs, this book could be a vital source of SOA inspiration—of how to
build great architecture without compromising on the “itys.”
Raj Bala
VP and Chief Technology Officer
Cognizant Technology Solutions
This page intentionally left blank
Acknowledgments

I would like to acknowledge and thank Cognizant immensely for encouraging


and supporting this collaborative work with Prakash and Tony, which was initi-
ated two years ago. Special thanks are due to Frank (CEO) and Chandra (presi-
dent and MD) for their encouragement for this collaborative work. Thanks are
due to Raj Bala (VP and CTO) and Dr. Appa Rao (VP, GTO) for their continuous
encouragement and support during the course of authoring this book. I am
highly indebted to Viswakumar (AVP, Projects) for his incessant help and sup-
port of this collaborative work.
Support from my wife Sujatha Kumar, my daughter Nayana Kumar, and my son
Govind Kashyap has been tremendous throughout the course of this book, and I
sincerely acknowledge their continued support on this project for the past two
years.
We owe our sincere appreciation to Ramesh Srinivasaraghavan and Arijit Chat-
terjee of Adobe (India) for their timely help in shaping the companion website
for this book. We also admire Sujit Reddy and Shyam Prasad of Adobe (India)
for helping us with the content and design of this site.
—Dr. B. V. Kumar

xxi

From the Library of ALESSANDRO CAROLLO


xxii ACKNOWLEDGMENTS

I would like to thank Chris Atwood and Octavian Tanase at Sun for their support
and encouragement throughout this project. Special thanks and love to my fam-
ily—Jayanthi, my wife and Akshay, Madhuri, and Rohan, my children—for
always being there for me and supporting my endeavors with vigor. I was fortu-
nate to work with a great team of coauthors: B. V. Kumar and Tony Ng. Each
brought their expert-level skills to make this a rewarding experience. Thanks to
Gopalan Suresh Raj, Binod P. G., Keith Babo, and Rick Palkovic for their semi-
nal paper, “Implementing Service-Oriented Architectures (SOA) with the Java
EE 5 SDK,” which inspired me to explore the subject further and get involved in
writing this book. This book is all about implementation. The basis for this book
is the NetBeans IDE. The team that I worked with—Todd Fast, Chris Webster,
Girish Balachandran, Nam Nguyen, Rico Cruz, Jiri Kopsa, Ajit Bhate, PCM
Reddy, and Hong Lin (among many others)—have all contributed in helping
make the NetBeans product a great success.
On the editorial and production side, thanks to Greg Doench, Michelle Housley,
Anne Goebel, and the rest of the editorial staff at Pearson for their guidance.
—Prakash Narayan

I would like to thank Jeet Kaul and Tom Kincaid for their encouragement and
support, Bill Shannon and Eduardo Pelegri-Llopart for their guidance, and the
entire GlassFish team who worked on the Java EE platform and SDK.
—Tony Ng
About the Authors

Dr. B. V. Kumar, currently the director and chief architect at Cognizant Tech-
nology Solutions, has an M Tech from IIT Kanpur and a Ph.D. from IIT Kharag-
pur. He has more than 19 years of experience in the field of information
technology at various levels and in organizations such as ComputerVision Cor-
poration (Singapore), Parametric Technologies (Seoul, S. Korea), and Sun
Microsystems (India). Prior to joining Cognizant, Dr. Kumar was the principal
researcher and technologist at Infosys Technologies and was responsible for the
research and development activities and new initiatives at the SETLabs. Dr.
Kumar has been working on the Enterprise technologies for more than 7 years,
focusing on J2EE and web services technologies. As a chief architect and direc-
tor at the Global Technology Office of Cognizant (India), Dr. Kumar is manag-
ing IP and asset creation, technology evangelization, and community
development and project support. Dr. Kumar has filed for two patents in the IP
space and published many technological papers in international journals and
conferences. He has coauthored Web Services—An Introduction and J2EE Archi-
tecture.
Prakash Narayan is the CTO and cofounder of Micello, Inc. Micello is an
early-stage startup in Silicon Valley focusing on delivering high-value data to
users at the point of consumption by providing the information within a map of
the indoor location. Prior to founding Micello, Prakash was at Sun Microsys-
tems, where he was one of the founders of Zembly—a social network for devel-
opers to build services, widgets, and social applications. Immediately before
Zembly, Prakash had responsibility for Java EE and SOA tooling in NetBeans.

xxiii

From the Library of ALESSANDRO CAROLLO


xxiv ABOUT THE AUTHORS

Prakash holds an MS degree in computer science from Indian Institute of Tech-


nology, Delhi, and a BS degree in electronics engineering from Birla Institute of
Technology and Science, Pilani, India.
Tony Ng is the senior director of engineering at Yahoo!, where he is responsible
for Yahoo! developer platforms and technologies including Yahoo! Application
platform (YAP), Yahoo! Query Language (YQL), and Yahoo! Developer Net-
work (YDN). Before joining Yahoo!, Tony was the director of engineering at
Sun Microsystems, where he managed development of the Java EE platform and
GlassFish application server. Tony is a coauthor of J2EE Connector Architecture
and Enterprise Application Integration. He holds an MS degree in computer sci-
ence from Massachusetts Institute of Technology and an MBA degree from the
University of California, Berkeley.
Part I
Overview

• Chapter 1 Introduction
• Chapter 2 Evolution of IT Architectures
• Chapter 3 Evolution of Service Oriented Architecture

1
Random documents with unrelated
content Scribd suggests to you:
wheels on the quiet road decided me. I did not wish that any one should see
my cousin crying there by the wayside.

"Very well," I said; "I promise on condition that you stop crying at once, and
walk on like a reasonable being."

Agneta's face brightened instantly. She rose, and, slipping her hand within my
arm, as though she felt the need of support, began to walk at a pace which
soon brought us within the gate of "Gay Bowers."

CHAPTER XVI
MISJUDGED

WE gained the house without encountering anybody. Agneta went upstairs at


once, while I hastened to get her a cup of tea. Entering the dining-room, I
found Alan Faulkner seated there taking tea in solitude. I started at seeing
him, and a hot tide of colour rose in my face. I would have given anything not
to have blushed at that moment. The belief that my access of colour would be
interpreted as a symptom of inward shame heightened my confusion till I felt
that I was crimson to the roots of my hair.

"Oh," I said stupidly, "are you having tea alone?"

"Yes," he said. "Jenny insisted on bringing me some. She said all the others
were out."

"I hope she made it properly," I said.

"It is very nice," he replied. "Let me give you some?"

"No, thank you, I will not have any just now," I responded awkwardly; "but I will
take a cup for Agneta. She has a headache."
I began to prepare a little tray to carry upstairs, and he helped me deftly. It had
been a surprise to me to discover that such a learned man could be so handy
and practical in everyday matters.

I went upstairs and remained with Agneta until she had taken her tea. I
expected that Mr. Faulkner would have quitted the dining-room ere my return,
but when I came back with the tray, he was still there, doing nothing more
profitable than playing with Sweep.

"I poured out a cup for you, Miss Nan," he said as I entered. "I know you do
not like strong tea, but now I am afraid you will find it cold. Let me ring for
some fresh tea?"

"This will do nicely, thank you," I said constrainedly as I seated myself at the
table.

He had moved to the window, and sat there in such a position that I only
caught a side view of him. Sweep's forepaws were on his knee, and he was
stroking the dog's ears with a regular, even movement, which appeared to be
equally agreeable to them both.

"Why could he not go away and leave me to take my tea in peace?" I thought,
as I waited nervously for him to speak. I tried hard to appear at my ease as I
sipped my tea, but I was far from being so. I longed to break into careless talk,
but somehow I could think of nothing to say.

Gradually I became aware that he was scarcely less embarrassed than I was.
Once or twice, he shot a grave, inquiring glance at me, and seemed about to
speak, but nothing came of it. When at last he spoke, his words gave me a
shock.

"That was Mr. Ralph Marshman whom I saw with you in the wood, Miss Nan."

"It was," was all I could say, while, to my vexation, I felt myself flushing again.

"He was at Cambridge with me," he said.

"You know him then?" was my reply.

"My acquaintance with him was of the slightest description," he replied


emphatically. "He was in his first year, and I had finished my college course."

I was silent, for I felt myself in a dilemma. For Agneta's sake I should have
liked to question him concerning Mr. Ralph Marshman; but if I did so he would
imagine that I took a personal interest in the young man. Indeed, I much
feared that already that idea had possession of his mind. I longed to explain
the true state of affairs, but I could not betray Agneta's secret. I was bound to
keep silence, but I realised with a sinking heart that my promise was likely to
cost me dear.

An awkward silence had lasted for some minutes, when Alan Faulkner said in
a low, deep voice, that seemed to vibrate with some subtle emotion:

"I wonder, Miss Nan, if I dare take the privilege of a friend, and venture to give
you a warning."

"Of course, I shall be happy for you to speak to me as a friend," I said, as he


waited for me to reply; "but you are mistaken in supposing that I need a
warning."

"Ah, you do not know," he said quickly; "you are young, Miss Nan, and may be
easily deceived by a specious manner and good appearance. I hate to speak
against people. It seems mean to rake up the errors of a man's past. If I
thought he had reformed, I would not say a word; but as it is, I think you ought
to know that while I was at the University Ralph Marshman made himself
notorious by a course of conduct which resulted in his being sent down. I—I
hardly know how to tell you, but it was something more than a mad escapade,
the outcome of youthful riot; he acted in a way that showed him to be utterly
unprincipled and dishonourable to a degree. Forgive me if I give you pain."

Of course, he said it with the kindest intention; but his thus taking it for granted
that I was so deeply interested in Ralph Marshman made me unreasonably
angry. His words certainly caused my heart to quiver with pain; but in a way
that he could not understand. At the same time they kindled within me such a
fire of passionate indignation as led me to exclaim, in a voice unlike my own:
"Pain! How can you give me pain, Mr. Faulkner? I can assure you that is
beyond your power; but it amazes me that you should thus misjudge another."

I paused, for my voice had grown husky. I found myself on the point of
bursting into tears. Alan Faulkner had turned on the window seat, and was
looking at me with eyes full of pain, and with something of reproach in them
too, it seemed to me. The next moment there was the sound of wheels on the
gravel outside, and the wagonette drove up to the door containing Aunt Patty,
Mr. Dicks, and innumerable parcels.

Instantly I sprang up, welcoming the diversion. Choking down my emotion, I


ran out. As I busied myself in helping aunt out and collecting the parcels, I
assumed an animation at which I secretly marvelled. Was I too becoming an
adept at dissimulation? As I chattered away to Mr. Dicks, or questioned aunt
as to what she had done, my heart was like lead, yet it seemed to me that I
played my part well. I did not deceive Aunt Patty, however. She looked at me
more than once with an intentness that made me uncomfortable, and at last
she said:

"What is the matter with you, Nan? You don't seem yourself somehow. Have
you been ministering to Agneta, till you have got a headache from force of
sympathy?"

"Not exactly," I replied, thankful that Mr. Faulkner had taken himself off ere
aunt made this remark: "but the weather is trying, don't you think? It seems so
hot and oppressive this afternoon."

"I have not found it so," said Aunt Patty; "there was a nice breeze driving."

"If you'd lived in New York, Miss Nan, I guess you wouldn't call this a hot day,"
said Josiah Dicks; "I wonder what Pollie would say to it. Do you know that she
is sitting up to-day? I saw her, bless her heart! And she waved her hand to her
old dad from the window."

"Yes, I know. Auntie told me. I am so glad," I said, trying hard to seem glad,
while I secretly felt as if gladness and I had parted company for ever. Then I
went away. My bedroom, unfortunately, was no longer a place of refuge for
me, so I turned into Paulina's deserted room, which had been thoroughly
disinfected after she quitted it. I sat down, and tried to review the situation
calmly; but my thoughts were like goads, and soon drove me to pacing the
floor in a restless anguish which sought relief in movement. I was angry with
Alan Faulkner and angry with myself. What right had he to leap to the
conclusion that I was attracted by Ralph Marshman? It was intolerable that he
should imagine him to be my lover. My face burned with shame as I thought of
it, and I reproached myself bitterly for the ill-considered action which had
placed me in such a false position. That he should think it necessary to warn
me that the man was unworthy!

My mind found no relief as I recalled all that had passed between us. I had
said not a word that could remove the impression which he had received. Now
that it was too late, I thought of many a neatly-turned, significant phrase which
might have convinced him of his mistake without revealing my cousin's folly.
Why had I dumbly submitted to the imputation? Why had the few words I had
uttered been so passionately incoherent? Ah! I knew but too well how it was.
The discovery that he had so misunderstood me dealt me a blow which
deprived me of the power to defend myself. No one's good opinion would I
less willingly lose than that of Alan Faulkner. And I had lost it—lost it, as I
feared, for ever, through my own blind folly!

The sound of the dressing-bell roused me from my bitter musings. Wearily,


heavily I went to prepare for dinner. It is no exaggeration to say that I felt at
that hour as if I could never know happiness, or even comfort, again.

Agneta was already dressed when I entered our room. Her face was flushed.
She looked pretty and excited. Her mood too had changed. She persisted in
discussing all kinds of trifles with me as I made my toilette, till in my irritation I
could hardly refrain from bidding her hold her tongue. And this was the girl
who had seemed broken-hearted a little while before! I reflected that she
could have no depth of character. Her tears had arisen from mere surface
emotion. She could not really care greatly for Ralph Marshman. And it was for
the sake of such a one that I was stung with sharpest self-reproach and
suffered such a cruel sense of loss. I was far from loving my cousin as I
followed her downstairs that evening.

My head ached, and I had little appetite as I seated myself at the table. I saw
aunt glance at me and then at Agneta, who had quite regained her spirits, and
was chatting with Colonel Hyde. When I ventured to turn my eyes on Alan
Faulkner it struck me that he looked grave and stern. Beyond making a few
remarks to Aunt Patty in a subdued tone, he contributed little to the
conversation. Once I caught a searching glance from him, beneath which my
eyes sank involuntarily.

The next moment an indignant sense of the injustice of his judgment rallied
my spirit. Why should I be ashamed, when I had no true cause for shame? If I
had acted unwisely in meeting Ralph Marshman in the wood, my intention had
been good. I had done nothing that I should fear to confess to mother. Oh,
how I longed for the time when I could tell her all about it!

With that I lifted my head, and, making a desperate effort to appear


lighthearted, I began to talk with Mr. Dicks. A strange mood took possession of
me, and I laughed and talked with a flippancy of which I was afterwards
heartily ashamed. My liveliness outran Agneta's. I said such foolish things that
aunt looked at me in astonishment. I believe she thought I had caught
Paulina's fever. I could not have acted more foolishly. I was taking the best
means of confirming the ill opinion of me I believed Alan Faulkner had formed.
The cloud on his brow darkened. He appeared to pay little heed to what was
passing about him, yet instinct told me that he heard every word I uttered.
When dessert was placed on the table, he asked Aunt Patty to excuse him, as
he had some work he wanted to finish. He went away, and the burden of
despondency settled again upon my spirit, more intense than before.

I had never been so wretched as I was that night. I was entangled in a mesh
of adverse circumstances from which I was powerless to extricate myself. I lay
down feeling sure that there could be little sleep for me. Throughout the hours
of the night the same poignant thoughts tortured me. Yet I was not without
hope. Surely the morrow must bring relief. I determined to make an effort to
right myself in Alan Faulkner's estimation. He had, I knew, accepted Mrs.
Canfield's invitation to her garden party. During the hours we should spend in
those beautiful grounds, I could hope to find an opportunity of saying a few
quiet words to Alan Faulkner, which, without compromising Agneta would
convince him that Ralph Marshman was no friend of mine.

Round this idea my thoughts finally gathered as the weary night passed away.
Agneta's restless movements made me doubt if she were sleeping much more
than I, but I never addressed a word to her. I found it hard to forgive her for
the mischief she had wrought.

Day was dawning ere the first gleam of true comfort visited my soul. It came
with a memory of Holy Writ. "If our heart condemn us, God is greater than our
heart, and knoweth all things." My heart did condemn me for folly and mistake,
but not for the moral ugliness and dissimulation which I believed were imputed
to me. And God knew all things! However others might misjudge me, there
was perfect comprehension, perfect justice for me with Him. Why had I not
carried my sense of wrong to Him, instead of resenting my injury with
weapons of pride and indignation which had only recoiled against myself? I
had longed for the comfort of mother's sympathy, and all the while there was a
stronger, mightier Love, a Love which knew those hidden recesses of my
heart that I could hardly have laid bare even to her, and the arms of that love
were outstretched to draw me near! Weak, helpless, crying like a child, I crept
into the embrace of that love, and found rest. As the birds began to chirp
beneath the eaves I fell asleep.

When I came into the breakfast-room the next morning, rather later than
usual, Mr. Dicks cheerily congratulated me on its being such a fine day for the
garden party.

"It is just the kind of weather you young ladies like," he said; "fine and warm
enough for you to wear your muslins and laces without a fear. How my Pollie
would have enjoyed it! However, she will enjoy going to the seaside before
long, if all goes well. The doctor says he will soon give us permission to shift
our quarters."
I hardly know how I replied to him, for at the same moment there fell on my
ears the voice of Alan Faulkner saying to Aunt Patty in clear, incisive tones:

"I must write a note to Mrs. Canfield, and beg her to excuse me this afternoon.
I am obliged to go to town to-day on important business."

"Oh, what a pity!" Aunt Patty exclaimed, with genuine regret in her tones.
"Mrs. Canfield will be so disappointed."

"I think not," he said with a shake of the head. "Out of a hundred guests she
can surely spare one."

"That may be, but not such a one," was aunt's reply. "I know that both she and
the Squire were looking forward to seeing you."

Alan Faulkner smiled incredulously. For a learned professor, he was


wonderfully deficient in a sense of his own importance.

"Is there no help for it?" aunt asked.

"None," he replied. "I must go, and by the first train, too."

My heart sank within me as I realised that the hope to which I had clung
during the wakeful hours of the night was doomed to disappointment. Not yet
was I to be reinstated in the estimation of my friend. Unconsciously I had
cherished many pleasurable anticipations of the day's festivity. Now I shrank
from the thought of it, but I little foresaw how different from my preconceptions
everything would be.

CHAPTER XVII
A GALA DAY AT GREENTREE

GREENTREE HALL, the residence of Squire Canfield, as the countryfolk


called him, was situated not more than a quarter of a mile from "Gay Bowers,"
measuring the distance as the crow flies. The entrance gates and pretty
thatched lodge stood midway between the Vicarage and the village green. A
fine avenue of elms led up to the Hall, which had been the home of Canfields
for many generations. The present owner of the property, a man verging on
old age, was a worthy descendant of the good old family.

John Canfield was justly proud of his venerable house and beautiful grounds.
He employed several gardeners, and could boast the best-kept gardens in the
neighbourhood. His head gardener was wont to win the chief prizes at most of
the local flower shows. The extensive conservatories belonging to Greentree
Hall were well worth seeing, and when they were in the perfection of their
beauty the Squire would invite all his friends and acquaintances for many
miles round to come and see them. The garden party, for which Mrs. Canfield
issued invitations every June, was a festivity much appreciated in the locality,
and by no means despised by town folk, for a good many visitors came from
London by the mid-day express to assist at it. Mrs. Canfield was generally
fortunate in having good weather for her entertainment. Never could she have
had a more brilliant day than this promised to be.

Aunt Patty needed my help in various ways that morning, and I was glad to be
well occupied. I saw hardly anything of Agneta before luncheon. She kept
upstairs, and I fancied she was engaged in arranging some details of her
dress for the afternoon. Mrs. Canfield, with whom Aunt Patty was on the most
neighbourly terms, had begged her to bring her young people early, as she
wanted our assistance in starting the games.

Her own daughters were both married; one, the wife of an Essex M.P., was
coming from town with her husband for the day. Aunt Patty had promised that
we would be there by three o'clock, for which hour the guests were invited.

My toilette was quickly made—a short, light skirt and a pretty blouse, specially
designed by Olive for the occasion, gave me an agreeable sense of being
suitably attired.

"You look as nice as possible, Nan," Agneta said, casting a careless glance at
me as she fastened her shoe-string. "One cannot be very smart when one is
expected to play tennis."

"Nevertheless you seem to have achieved it," I said as I looked at her. She
was dressed as I had not seen her before—in a short skirt and smart little coat
of white serge, with gold buttons and gold braiding on collar and cuffs. Her
vest was of pale blue silk, daintily finished with lace, and her simple white hat
completed a costume which was in remarkably good taste for my cousin. "I
never saw you more becomingly dressed."

She laughed, and her face flushed with pleasure. "Thank you," she said. "I am
glad you approve; it is something to win a compliment from you."

Her trouble of yesterday seemed entirely to have vanished, unless her


excessive nervousness were a trace of it. It must be weakness that made her
lips twitch so strangely as she talked, and the fingers with which she was tying
her shoe strings tremble so much that she was very slow in securing them.

As I observed her I heard Aunt Patty's voice from below, crying:

"Come, girls, are you ready? It is time we went."

"You are ready, are you not, Agneta?" I said.

"Oh, yes—only—I must find another handkerchief," she replied. "Don't wait for
me, Nan—I'll overtake you. I know the way through the fields."

I ran downstairs, and told Aunt Patty that Agneta would be there in a minute.
Apparently the handkerchief was hard to find, for though we waited several
minutes she did not come. At last we passed into the garden. We had no
intention of walking by the road. We had only to go through the orchard and
across two fields beyond, and we were in Greentree Park. So aunt and I
strolled slowly on. Colonel Hyde and Mr. Dicks would follow later, but we knew
that Mrs. Canfield would like us to be there when her guests began to arrive.

"What can be keeping Agneta?" I said when we reached the end of the first
field. We waited, looking impatiently towards "Gay Bowers," but she did not
appear. "I must run back and hurry her," I said at last. "She has not been to
the Hall before, so I cannot leave her to follow alone. Don't wait for us, auntie."

"I suppose you had better go back," said aunt reluctantly, "but don't make
yourself hot by running. I will walk on slowly."

In spite of aunt's warning, I retraced my steps pretty quickly. Nothing was to


be seen of Agneta. I called to her as I entered the house, but received no
reply. I hurried upstairs to our room; it was unoccupied. Hastening downstairs
again, I encountered Jenny, our housemaid.

"Miss Redmayne has gone, miss," she said. "I saw her go out of the gate a
few minutes ago."
"Out of the gate," I repeated. "Do you mean that she went by the road?
Whatever made her do that? It is much farther."

"So I thought, miss," replied Jenny. "I wondered she should take that way, with
all the dust there'll be from the vehicles coming along presently. She had her
dust-cloak on her arm, though."

"Her dust-cloak!" I exclaimed. "You must be mistaken, Jenny. My cousin would


not be likely to carry a dust-cloak to the Hall."

"I was surprised myself, miss, to see Miss Redmayne with it, but she certainly
did take it," Jenny persisted.

"How very strange!" I said, amazed that Agneta should exhibit such unusual
and, to my mind, absurd carefulness on this occasion. "Well, it is no good my
following her along the road. If I go across the fields I shall be there almost as
soon as she is."

As I spoke a carriage full of ladies drove past our gate, and I could hear
another vehicle following it. People were coming early, determined to have a
long and pleasant afternoon. I turned back, feeling annoyed with my cousin,
and was by no means cool when I reached the Park. I saw Aunt Patty in the
midst of a group on the lawn, but Agneta was not with her. Before I could look
about for my cousin, Mrs. Canfield met me, greeted me kindly, and asked me
to go and see if the croquet hoops were properly set. They were not quite at
the right distances, and I was hurriedly altering them when a strong hand took
the last one from my grasp, and fixed it for me. With pleasure I perceived that
Jack Upsher had come to my assistance.

"You here, Jack!" I exclaimed. "Then the exam is over?"

"Rather!" he said. "But I could not get away till twelve o'clock to-day. I have
hardly been home half-an-hour, but I was not going to miss this social function
if I could help it."

"Really," I said, "You astonish me! This is something new. It seems only the
other day that you were saying how stupid you found this festivity last year."

"And so I did," he coolly replied. "You were not here last year, Nan. That fact
makes all the difference."

"Oh, I dare say!" I responded with a laugh. "You don't think my vanity is equal
to swallowing that? By the by, did you see anything of Agneta as you came
through the grounds?"

"No," he said. "Why? Have you lost your cousin?"

"Hardly that," I said with a smile; "but I have missed her somehow, and I am
afraid she may be feeling lonely as she knows hardly any one here. We will go
and look for her. But now tell me how you got on in your exam."

"Oh, don't ask me, Nan!" he groaned. "You may expect to hear that I am
ploughed again."

"Nonsense I shall expect nothing of the kind," was my reply. "You might tell me
how you think you have done."

"Oh, badly," he said, "though I am not without a faint hope that I may squeeze
through. I sincerely hope it may be so, for the governor's sake. I say, where's
that crank of a professor?"

As he spoke we had come round to the front of the Hall, and saw before us a
party on the lawn. The number of the guests had increased considerably, but I
looked in vain for Agneta.

"I don't know what you mean," I said stiffly. Then I saw Aunt Patty coming
towards me with the evident intention of addressing me.

"Nan," she said as she came up, "what about Agneta?"

"What about her?" I repeated stupidly, as I glanced around. "She is not here?"

"Of course not," said Aunt Patty quickly, "but you saw her—how is she?"

"I did not see her," was my reply; "Jenny said she had started."

"Then what is the meaning of this, which a servant has just brought me?" aunt
asked, holding out an envelope as she spoke. Within, hastily pencilled on a
slip of paper, were the words:

"Dear Mrs. Lucas,—I am sorry to say that I cannot come. My


head
is bad. Please express my regret to Mrs. Canfield."

"AGNETA."
I was amazed. Agneta had made no complaint of headache to me, nor had
she seemed to be suffering in any way. One wild conjecture after another
presented itself to my mind with lightning speed, and I suppose my expression
betrayed something of what was passing within, for Aunt Patty exclaimed
hastily:

"What is it, Nan? Of what are you thinking? Why do you look like that?"

"Oh, nothing," I replied hurriedly, "but I must go; I must find out what is wrong
with Agneta."

"Yes, do," said my aunt; "walking in the sun may have upset her and obliged
her to turn back. Go quickly, dear, and, if she should seem really ill, be sure to
send word to me."

"I will come with you," said Jack.

"You will do nothing of the kind," I replied. "You will stay and start some games
of tennis and croquet, and help Mrs. Canfield, as I promised to do, until I come
back."

"Oh, I say—" he began; but I waved him away, and was off for the nearest exit
from the Park. I needed no urging to haste. Once within the fields, I ran at my
utmost speed, for a painful suspicion had taken possession of my mind. Had I
fallen into a snare when I agreed to say nothing to Aunt Patty about Ralph
Marshman till this day was over?

I reached the house and tore upstairs to our bedroom. Agneta was not there.
Everything belonging to her was left in perfect order. A hasty glance round
convinced me that she had been gathering her things together and arranging
them with a certain method and purpose.

I had now no fear that my cousin was ill. A very different explanation forced
itself upon my mind. So strong was this conviction that I did not wait to search
the house. After one futile call, unheard even by the servants, who had
betaken themselves to the garden, and were watching from behind the trees
the unusual traffic along the quiet country road, I got out my bicycle, mounted
it, and rode at full speed for Chelmsford.

I felt desperate as I sped along the road. For the first time in my career as a
cyclist I was guilty of "scorching." Agneta must have had fully half-an-hour's
start of me. How she had gone I could not tell; probably she had availed
herself of one of the conveyances returning from Greentree Hall. I knew that a
train left Chelmsford for London some time between three and four o'clock,
and by this I imagined that she would travel, for I had made up my mind that
she was bent on elopement. If only I could get to the station before that train
started! It hardly seemed possible that I could be in time.

I had never ridden so hard before, and I certainly never felt so ashamed of
myself. I kept meeting carriages carrying guests to the garden party. With
many of the people I was doubtless acquainted, but I looked neither to the
right nor left as I rode on, mechanically steering my way as directly as
possible. How thankful I was that my machine was such a splendid runner! I
got over the ground at a record pace. I dimly wondered, as I passed each
conveyance, whether the people it carried would think me mad, or imagine
that sudden illness or accident was the cause of my thus rushing into town.
Those who recognised me would assuredly think it very strange that I should
be going from Greentree in such haste on that afternoon.

But now I was coming into the town, and it behoved me to ride more
circumspectly, if I would not get into trouble. I heard a church clock strike the
half-hour, and felt sure that I should miss the train unless it were behind time,
which might possibly happen, as it came up from Ipswich, and I believed it
was market day there. The way to the station seemed to have mysteriously
lengthened out; but I turned the corner at last, and saw the booking-office
before me.

The train was just coming in as I sprang from my bicycle and gave it into the
care of a porter. I got my ticket and rushed on to the platform. My eyes fell on
Agneta, wrapped in her long grey dust-cloak, just as she was stepping into a
carriage. A porter was closing the door. By an imperious sign, I bade him hold
it open, and, running up, sprang breathless into the compartment just as the
train began to move. As I sank panting on to a seat opposite to my cousin, she
uttered a cry of surprise and dismay.

CHAPTER XVIII
AN ELOPEMENT
THERE were several other persons in the carriage with Agneta, and they
observed me curiously as I slowly recovered from the effects of the rush I had
made.

"Nan," said Agneta, leaning forward and speaking in an angry whisper, "what
is the meaning of this? Why are you here?"

"It is I who should put such questions," was my reply. "Why are you, Agneta,
running away thus? How could you dare to send such a false excuse to Aunt
Patty?"

"It is true enough!" she said defiantly. "My head does ache; and I could not go
to the Hall because I had promised to go to London."

"To meet Ralph Marshman, I suppose?" I said, carefully subduing my voice.

She nodded.

"Of course; but it is all right, Nan. He has procured a special licence, and we
shall be married almost as soon as I reach London."

"Oh, will you?" I said to myself. "Not if I can prevent it!"

"It is perfectly mad of you to come away thus," she went on, "and you will do
no good. How could you be so foolish as to leave the garden party? What will
Mrs. Canfield say?"

"I do not care," I said doggedly; but it was hardly true. I did care. The thought
of Aunt Patty's anxiety and Mrs. Canfield's astonishment made me uneasy. It
was not pleasant to think of the remarks people were probably making about
me at that moment; but I believed I was doing right. Better that I should be
misunderstood and misjudged than that Agneta, on the threshold of
womanhood, should bring upon herself a lifelong misery. I might not succeed
in thwarting her purpose; but it should not be my fault if she threw herself
away upon a bad man.

"How you managed to get here so quickly I cannot think," Agneta continued.
"You could not have done it if the train had not been late, I know, for I made a
calculation. To think it should be late to-day of all days! Not that it will make
any difference. You need not think that you are going to stop me! My mind is
quite made up! I mean to marry him!"
"You shall not marry him in this wrong and secret manner if I can help it!" was
my reply. "I tell you that frankly!"

Then aware that our fellow travellers were watching us, and doubtless
wondering what caused the altercation we were carrying on in undertones, I
became silent, and Agneta, after a few indignant and cutting comments on my
behaviour, to which I made no reply, also ceased to speak.

I felt far from comfortable as the train bore us rapidly towards London. I
dreaded the thought of another encounter with Ralph Marshman. I had but the
vaguest ideas of what action I ought to take in the strange situation into which
I was thus thrust. I could only resolve that I would not quit my cousin. I would
witness her marriage if I could not hinder it; but I believed that no clergyman
would perform the ceremony if I told him that Agneta was under age, and
about to marry in defiance of her parents' will.

At the last station before we reached Liverpool Street most of the people in
our compartment got out. Agneta seized the opportunity to make another
attempt to shake my resolution.

"It is of no use, Nan," she said. "You had better take the next train back to
Chelmsford. You will only make yourself ridiculous. You cannot prevent us
from doing as we please."

"I am not so sure of that," I said. "Anyhow, I mean to try."

"I never knew such folly!" she said so passionately that I felt sure she was not
so confident of carrying out her plans as she wished to appear.

"The folly is yours, Agneta!" I replied. "You are worse than foolish! You are a
wicked, ungrateful girl, and if you get your own way in this you will be a
miserable woman!"

That she responded with angry and offensive words was no sign that she did
not feel my words to be true. Her face grew very white as the train began to
slow into the terminus. I expect I was pale too. I know I felt faint, and trembled
all over as I rose and grasped Agneta's arm, determined that she should not
slip away. As we glided past an array of porters, I caught sight of Ralph
Marshman peering eagerly into each compartment. The next moment he saw
Agneta, and, darting forward, opened the door and helped her out almost
before the train stopped. He looked amazed as I sprang after her and clung to
her side.
"You here!" he faltered, and his brow grew dark. "What is the meaning of
this?"

"It means that I have come to look after my cousin!" I said boldly.

"It is very kind of you," he said sarcastically; "but she needs your care no
longer. I will take care of her now."

"Where she goes I go too," was all I said as I tightened my grasp of her arm,
in spite of her efforts to shake me off.

"But this is absurd!" he said, and went on to make angry and rude remarks,
which had no more effect on me than if I had been deaf, so firmly strong was
my resolve. He even laid his hand on my arm and tried by force to separate
me from my cousin, but I was able to resist the attempt, and he could not do
more without making a scene amid the crowd of passengers now upon the
platform.

We moved toward the exit, I clinging to Agneta's left arm, and Marshman
walking on the other side of her. Suddenly she uttered a low cry of dismay and
drew away from him.

"What is the matter?" he asked.

Why I looked towards him I do not know, but as I did so I saw that Alan
Faulkner stood just behind him, and was gazing at me with astonished eyes. It
was only for a moment that I saw him. A mist passed before my eyes and my
head grew dizzy. When I looked again he had vanished in the crowd, and so
had Ralph Marshman.

But it was not the sight of Alan Faulkner that had startled Agneta. Some one
else was claiming her attention. An elderly gentleman, spare and trim in
appearance and of dignified demeanour, had laid his hand on her shoulder
and was gazing at her with wrath and indignation in his eyes.

"Agneta, what are you doing here? Was it you that rascal came to meet?"

Agneta was dumbfounded. When she tried to speak utterance failed her. Her
lips quivered helplessly and she burst into tears. The speaker looked at her
with more exasperation than compassion in his glance. His eyes fell on me,
and he said with an air of extreme irritation:
"Perhaps you will kindly explain what brings my daughter to town at this hour.
You seem to be her companion."

I had not seen my uncle since I was a child, and till he spoke thus I failed to
recognise him. He was the last person I expected to meet just then.
Deliverance had come from the most unexpected quarter; but thankful I was
that it had come.

"I am her cousin, Annie Darracott," I said simply.

"Oh, really! And you think it right to assist her to meet that scoundrel," he said
huskily. "So this is how Mrs. Lucas discharges her responsibility! I see I made
a mistake in committing my daughter to her care."

"You make a very great mistake now," I replied; "my aunt knows nothing of our
being here."

"The more shame to you," he responded severely; "but now, please take my
daughter into the waiting-room while I look after that scoundrel."

I was only too glad to obey, for Agneta had lost all control of herself and was
sobbing hysterically, and I felt like crying myself, though I was determined I
would not give way.

Ralph Marshman had not waited to be interviewed by an indignant parent. Mr.


Redmayne came back after a futile search for him. By that time I had procured
a glass of water for Agneta and she was a little calmer.

"I shall take charge of you now," he said grimly; "you will both come with me to
my hotel."

A moment's reflection convinced me that nothing would be gained by my


taking the next train for Chelmsford. The garden party would be over before I
could get to Greentree.

"I must send a telegram at once to Aunt Patty," I said. "She does not know
what has become of us and will be very uneasy."

"Oh, I am glad you have some consideration for her," he said bitterly. "Really
the lawlessness of young people nowadays is appalling! Running off by
yourselves to London in this way! I never heard of such disgraceful conduct
on the part of well-brought-up girls."
"You should not speak so to Nan, father," Agneta said. "It is not her fault that
we are here. She only came because I did."

"I beg her pardon if I am unjust," he said, "but the whole affair is
incomprehensible to me. I will go and telegraph to Mrs. Lucas, and then I will
take you away."

"Oh, if only you would take me home to mother!" I said involuntarily.

"What! To Clapham? You would like to go there?"

"Why, of course!" I said almost impatiently.

He looked at me in some surprise.

"I could take you, certainly," he said. "Perhaps—I wonder if—However, we can
talk of that presently." And he went off to despatch the telegram.

"Oh, Nan, don't leave me!" Agneta said when he had gone. "Father is awful
when he is angry! He won't be quite so bad if you are with me."

"And yet you were ready to dare his utmost anger," I said.

"Oh, I should not have minded so much if Ralph were with me!" she said. "And
he always said that father would be sure to forgive us when he found it
impossible to part us, but I was afraid."

"It seems that Mr. Marshman is afraid too, now," I could not help saying. "At
any rate, he has found it convenient to slip away and leave you to bear the
brunt of your father's displeasure."

When Uncle Redmayne came back to us, his bearing was somewhat less
severe. He said he had been thinking things over, and had come to the
conclusion that it would be well to take me home at once and explain to my
parents what had happened. Perhaps my mother would be willing to take
Agneta in for the night. He had business that would occupy him for some
hours on the following day, but he could take her back to Manchester with him
in the evening. He would write and explain to Mrs. Lucas his reasons for not
allowing her to return.

Agneta looked miserable enough when she heard this, but she said not a
word. Her father's manner towards her had lost none of its harshness. I could
not but feel sorry for her as I heard the cutting words he addressed to her
every now and then.
Before we started for Clapham, he took us to the refreshment room to have
some tea. He pressed me to try various sweet cakes, but neither I nor Agneta
could eat anything. The tea refreshed us, however, and still more sustaining to
me was the thought that I was going home. I had no fear of meeting my
parents. I knew that they would not condemn me unheard.

It hardly seemed real to me when presently I found myself driving in a cab


along the side of Clapham Common. How little I had thought when I rose that
morning that the evening would find me here!

Mother's astonishment when she saw us drive up to the door was beyond
words to express. She looked absolutely frightened, till I assured her that we
were both well, and that no fresh outbreak of illness had occurred. She told
me afterwards that I could have no idea how we had alarmed her, for both
Agneta and I looked as if something terrible had happened.

By this time, indeed, my cousin's strength was about gone, while her
headache had become almost unbearable. When we went upstairs she broke
down utterly, and, feeling sure that she could endure nothing more in the way
of rebuke or reproach, I persuaded her to go to bed.

Olive and Peggy bustled about and rearranged the rooms, aching with
curiosity to know what was the meaning of our sudden, unexpected arrival. I,
too, was longing to tell them, but nothing could be said till poor Agneta's
aching head lay on a cool pillow, and we could leave her to the quiet she so
sorely craved, though inward tranquillity it was beyond our power to give her.

A little later I was telling Mr. Redmayne in the presence of my father and
mother what I knew of Ralph Marshman's meetings with Agneta, and all that
had happened that day. When I had done, he expressed his regret that he had
blamed me ere he knew the truth of the matter.

"I see now that you were my headstrong girl's true friend," he said. "You tried
to save her from herself." Then, turning to father and mother, he added, "You
are more fortunate in your children than I am. I don't know how it is. I have
done everything for my children that I could do. They have had every
advantage, and all kinds of indulgences, yet when I look for a little comfort
from them, they reward me by the basest ingratitude."

There was a moment's silence, and then mother said gently:

"Agneta will surely be wiser after this. She has learned a lesson, I trust."
"If she has not, I will see that she does," he replied angrily. "She will find that I
will stand no more nonsense of this kind. That man thought that, if he
succeeded in marrying her, I should be fool enough to forgive her, and let her
have the portion I can give to my daughters, or, at any rate, leave it to her
when I die. I should have done nothing of the kind. If Agneta had married in
defiance of my wishes I would never have forgiven her. She might have
starved before I would have given her a shilling!"

"Oh, don't say that!" mother cried with a shiver, but there was no relenting in
his countenance. He looked quite capable of so acting at that moment, and I
am sure that he meant what he said.

Then he went on to explain how he had learned that Marshman had been
dismissed from his post in the bank at Newcastle, certain doubtful practices of
his having come to the knowledge of the firm. Thinking it probable that the
young man had gone to London and might make an attempt to see Agneta,
Mr. Redmayne decided to take an early opportunity of going to town himself.
While there, he would go down to "Gay Bowers," see Agneta, and put Aunt
Patty on her guard in case the detrimental should present himself.

He had not long arrived in town, and was on his way to Liverpool Street with
the idea of going down that very evening to Chelmsford, if there was a train
that would serve his purpose, when he perceived Ralph Marshman entering
the station in advance of him. Instantly, he resolved to watch the young man's
proceedings. He followed him to the platform where the train from Chelmsford
would come in, and, carefully avoiding his observation, waited a wearisome
time till at last the overdue train arrived. The result that rewarded his pains I
have already narrated. I was interested in hearing uncle's description of what
had occurred, till suddenly mother's eyes fell on me, and she exclaimed:

"Nan, you look worn-out. Go to bed at once."

And to bed I thankfully went, but did not sleep till I had told Olive the whole
story, and a good deal more.

CHAPTER XIX
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookname.com

You might also like