20_777106 bindex.qxp11/28/0610:49PMPage715 @Transient @TransactionManagement @TransactionAtrribute @Stateless @Resource @Remote @PersistenceUnits @PersistenceUnit @PersistenceContexts @PersistenceContext @overrides @OneToMany @MappedSuperclass @Interceptors @Id @Entity @EJB @Discriminator @deprecated @Column @AttributeOverride @AroundInvoke 532 500 (HTTPresponsecode), 532 404 (HTTPresponsecode), 532 403 (HTTPresponsecode), 532 200 (HTTPresponsecode), 433 2-byte Unicodestrings, NUMERICS SYMBOLS AND noain 478 annotation, noain 490 annotation, noain 487 annotation, 479 annotation, noain 483 annotation, noain 380–381 annotation, noain 512 annotation, 497 annotation, 27 annotation, 478 annotation, noain 27 annotation, noain 481 annotation, 484 481, annotation, noain 488 annotation, noain 487 annotation, noain 487 annotation, 489 annotation, noain 490 annotation,

COPYRIGHTED 487 annotation, MATERIAL noain 487 annotation, akn,508 marking, noain 508 annotation, A adding data addFolder addActionListener Adapter pattern actionPerformed ActionListener Action accessor 585–586 access control, access 126 abstraction, Wr cinfr 413–414 XWork Actionfor, 416 web applicationvisualizationfor, 417–419 to Model2system, 412 in , 477–478 in EntityManagerAPI, 477 476, in EJBdatabase, Target 131–132 discussed, Client Adapter Adaptee 126 using, 412–415 399, of XWork, 399 in WebWork, 401 IoC and, 442–445 in JNI, 442–445 to fields, 311 to databases, Action classes. nefc n 132 interface in, 132 interface in, ehd,104 methods, nefc n 133 interface in, 133 interface in, ehd 466 method, e loseii ye,e.g.: specifictypes, See also nefc,13 0,217–218 205, 163, interface, ehd 6,25 213 205, 163, method, ehd 205 method, Index XWork

Index 20_777106 bindex.qxp 11/28/06 10:49 PM Page 716

addMouseListener method

addMouseListener method, 183 AnnotationValue method, 29, 30 addTableData method, 185 Ant (Apache) addTree method, 185 development scenarios with, 94–101 AdjustmentListener, 234 discussed, 93–94, 125 advanced programming, 455–460 Hibernate build file for, 408–409 Agent layer, 601 installing, 709–710 Aggregate, 621 in JMeter, 118 agility, 81–82 Maven 2 and, 106 AJAX (Asynchronous JavaScript and XML), 381–384 project building with, 710–713 AJAXTags library, 382–384 TestNG and, 108, 109 algorithm(s) Web ARchive use with, 709–713 in JCA, 640–641 Apache Ant. See Ant management of, 640–641 Apache Axis, 538 algorithm method, 635 Apache Derby. See Derby AlgorithmParameter object, 640 Apache TCPMon. See TCPMon AlgorithmParameterGenerator engine class, API (Application Program Interface). See also specific 627, 640, 641 types, e.g.: Java API for XML Binding AlgorithmParameterSpec interface, 640 for Hibernate, 340–341 ALL logging level, 38 in Java programming, 124 Ambler, Scott, 81 for Service Oriented Architecture, 600 AnnotatedElement interface, 31–32 applet(s) annotation(s) discussed, 691–692 @deprecated, 27 in JAR, 685 @overrides, 27 packaging, for execution, 693–694 custom, 27 security analysis for, 694 defined, 26 structure of, 692–693 discussed, 292 APPLET tags, 693 doclet API for, 28–29 appletviewer command, 693 functions of, 292–293 Application Component, 401 for Java classes, 290–292 application data in JDBC 4.0, 333–334 for configuration, 239–241 in metadata, 26–27 discussed, 237–239 in Query interface, 333 saving, 239 for resource injection in EJB, 487 application development (Model 2), 396 at runtime, 31 Application Program Interface (API). See also specific source-level, 27 types, e.g.: Java API for XML Binding usage of, 293–295 for Hibernate, 340–341 XML schema and, 301–302 in Java programming, 124 XmlAccessorType, 296–297 for Service Oriented Architecture, 600 XmlAttribute, 297 applicationScope implicit object, 366 XmlElement, 297 @AroundInvoke annotation, 481, 484 XmlElementWrapper, 297–298 array(s) XmlJavaTypeAdapter, 298–300 functions of, 437–442 XmlRootElement, 295 of generic types, 14 XmlTransient, 300–301 in JNI, 436–442 XmlType, 295–296 length property of, 18 AnnotationDesc.ElementValuePair method, 29 native code for, 438, 440 AnnotationTypeDoc method, 29 of objects, 436, 437 AnnotationTypeElementDoc method, 29

716 20_777106 bindex.qxp 11/28/06 10:49 PM Page 717

canImport method Index of primitive types, 436, 437–442 binding, 568 usage of, 436–437 body (SOAP), 570 ArrayList class, 7, 8 BorderFactory class, 186 assertions, in JMeter, 119 BorderLayout manager, 158–164 assignment conversion, 21 BorderLayoutPanel, 159–160 asterisk, 60, 61 bound type parameters, 12–13, 299 ASyncHandler, 583 boundary meta-characters, 62–63 asynchronous invocation, 581, 583–584 bounded type variables, 12–14 Asynchronous JavaScript and XML (AJAX), 381–384 bounds, 12–13 @AttributeOverride annotation, 490 boxing conversions authentication context for, 21 checks for, 668 defined, 7, 19 on client, 588–589 discussed, 19–20 codes for, 665 with generics, 21 configuration for, 670 BoxLayout manager, 164–172 credentials for, 669 browsing data defined, 666 in Hibernate, 412 execution of, 668 in Model 2 system, 416, 419–422 HTTP, 586–588, 588–589 web application visualization for, 416 in JCE, 665–673, 667–672 XWork Action for, 412–413 LoginContext for, 671–672 Buest, Cedric, 106 of messages, 665–666 buf byte array, 629 principals in, 668–669 buffers, direct byte, 456 with security checks, 668 bugs (defect), 80, 87–88 on server, 586–588 building, with design patterns, 127–131 of subject, 670 building process, 84 of user identity, 667 bundling, resource, 44 authorization business tier (J2EE), 93 defined, 666 ButtonGroup component, 161 in JCE, 672–673 buttonPanel, 226–227 autocommitting, 5 ButtonText variable, 160 Axis (Apache), 538 bytecode, 7, 8 bytes array, 641 B back-end C passing data to, 494–495 C (programming language) queries in, 505 data types, 432 bank applications Java objects in, 442–449 communication for, 520 strings in, 432 EJBs for, 520 variable arguments in, 18 Java EE for, 520 Call Level Interface, X/Open SQL (CLI), 312 Basic Profile (WS-I), 567–568 Call method, 448 batch updates callable statements (JDBC 4.0), 318, 324–326 using PreparedStatement, 327–328 CallMethod functions, 445–447 using Statement object, 326–327 CallNonVirtual functions, 447, 448 using statements, 326–328 CallNonVirtual method, 448 BatchUpdateException, 326–327 CallNonVirtualVoid function, 449 bean classes, 482 CallVoidMethod, 448, 449, 470 Beck, Kent, 91 canImport method, 221–222

717 20_777106 bindex.qxp 11/28/06 10:49 PM Page 718

Canonicalization class

Canonicalization class, 644–645 classpaths, 675–680 CardLayout manager, 202–207 clazz, 457 Cartesian join, 353 clean target, 111–112 cascade property, 350 clearFolderList method, 466 case implementation, 412–415 cleartext (plaintext), 656 CDO (Collaborative Data Objects), 460 CLI (X/Open SQL Call Level Interface), 312 CenterPanel, 138 client certificate(s) HTTP authentication on, 588–589 for digital signature verification, 632 for JMS, 613–614 in JCA, 654–656 for MBeans, 607–609 management of, 654–656 remote, 607–609 trusted, 638 for Web Services, 580–589 type parameters for, 656 writing, 580–589 certificate path, 654 client layer Certificate Revocation List (CRL), 626, 654, 656 in three-tier model, 314 CertificateFactory engine class, 627, 654–655 in two-tier model, 313 CertPathBuilder engine class, 627, 655 client programming, 524–525 CertPathValidator engine class, 627, 654, 655 client tier (J2EE), 93 CertStore engine class closing, result sets, 332 defined, 627 CloudScape, 3 discussed, 654–656 CMP (Container-Managed Persistence), 496–497 Chain of Responsibility pattern, 173–175, 177 CMT. See under Contact Management Tool ChainingInterceptor, 400 code(s) ChangeListener, 135 for authentication, 665 character classes executing, 431–432 in meta-characters, 63 Java, 428–429 in regular expressions, 63 for JNI, 428–429, 431–432 checkall function, 386, 389 code phase (Waterfall methodology), 88 checks, authentication, 668 code reuse ChildLogger, 58, 60 in JSP 2.0, 361–362 cipher, 656 with .tag files, 361–362 Cipher engine class with .tagx files, 361–362 data encryption/decryption with, 658 CodeTag annotation, 27 in JCE, 656–665 coding key wrapping/unwrapping in, 658–662 in Extreme Programming, 91 sealing objects in, 663–665 during software development, 83 CipherInputStream class, 659–662 cohesion, high, 126 CipherOutputStream class, 659–662 Collaborative Data Objects (CDO), 460 CLASS policy, 26 collection classes, 7 ClassCircularityError, 459 collection mapping, 348–350 classes CollectTask,96 defining, 407–408 color definition, 274, 300 in generics, 14 Colors enum,24 in Hibernate, 407–408 @Column annotation, 479 in Java API, 242–243 Command interface, 142–143, 162, 164, 211–213 JAXB, 280–281 Command pattern, 142–146, 190, 203 for XML Digital Signatures, 643–645 CommandManager interface, 142, 143 ClassFormatError, 459 Common Object Request Broker Architecture (CORBA) Class.forName method, 676–677 using, 553–554 classes in, 558

718 20_777106 bindex.qxp 11/28/06 10:49 PM Page 719

coupling, low Index for communication, 547–563 config target, 116 COS Naming for, 550–551 configuration discussed, 547–548 application data for, 239–241 for distributed file system notifications (example), for authentication, 670 554–563 in Hibernate, 339–340, 409–410 IDL of, 548–550 of Hibernate, 409–410 Internet InterORB Protocol for, 551 internal data changes in, 266–268 in JDK, 547 in JMeter, 119 Object Request Broker in, 550 loading, 248–249 RMI compatibility with, 551 management of, 84–85 RMI-IIOP for, 551–553 in Model 2 architecture, 422–424 Common Object Service (COS) Naming, 550–551, reading, from disk, 246 559–560 saving, 248 communication verification and validation for, 258–259 during software development, 81 writing, to disk, 245–246 communication, component-to-component. See configuration object component-to-component communication deserialization of, 258 compatibility issues, of Model 2, 403–405 in Enterprise JavaBeans, 240 compile target, 112 ConfigurationType, 277, 282 complex types, 274 Connection class, 611 complexity, 396 Connection interface, 315–316 component(s) connection management, 316–318 defined, 519 ConnectionFactory class, 611 discussed, 519 ConsoleCorbaServer, 562–563 mapping, in Hibernate, 347–348 ConsoleHandler, 48–49 component class, 151 constants, in enumerations, 24 Component injecting, 401 construction phase (UP), 91 componentPanel, 226 constructors, 25 component-to-component communication contact management system, 406 for bank applications, 520 Contact Management Tool (CMT), 366–375, 370–375 CORBA for, 547–563 ContactMgmtTool, 390–391 discussed, 519, 520 ContactMgmtTool POJO, 390–391 interprocess, 521–522 ContactMgmtToolDAO JavaBean, 388, 390–391 network architecture supporting, 521–522 Container-Managed Persistence (CMP), 496–497 RPC/RMI for, 542–547 Context class, 229 scenarios for, 520–521 context-root element, 700 sockets usage for, 522–541 continuous integration, 85 for web browsing, 520 control for web portals, 521 of access to Web Services, 585–586 for Web Services, 563–596 IoC, 397–399 composite class, 152–154 control gates (Waterfall methodology), 88 Composite pattern controller (MVC), 394 component class in, 151 controller component (MVC), 140–142 composite class in, 152–154 cookie implicit object, 366 discussed, 150–151 CORBA. See Common Object Request Broker leaf class in, 151–152 Architecture concurrency, 329 COS (Common Object Service) Naming, 550–551, Concurrent Versioning System (CVS), 85 559–560 CONFIG logging level, 38 coupling, low, 126

719 20_777106 bindex.qxp 11/28/06 10:49 PM Page 720

C++ programming

C++ programming Decorator pattern, 165–166 data types, 432 decryption Java objects in, 442–449 with Cipher engine class, 658 javah for, 429–430 defined, 656 strings in, 432 DECRYPT_MODE, 657 variable arguments in, 18 defaultReadObject method, 254 crashing, in Java virtual machine, 432 DefaultWorkflowInterceptor, 401 createMenuBar method, 218–219 deleteEntry method, 639 createReference method, 646 DeleteGlobalRef function, 454 credentials, 669 DeleteLocalRef, 442, 451 Criteria interface, 340, 350–352 DeleteWeakGlobalRef function, 454 CRL (Certificate Revocation List), 626, 654, 656 deleting data. See removing data cryptographic service providers, 626 Dependency Injection (DI), 474, 487. See Inversion CustomHolder class, 11–12 of Control CVS (Concurrent Versioning System), 85 dependency mediation, 102 dependency scope, 103 deployment, of Web Services (WS), 575–580 D deployment descriptor data for Interceptors, 482 adding, 417–419 for WAR files, 696–698 browsing, 419–422 for WebWork framework, 422–423 in C/C++, 432 @deprecated annotation, 27 changing, 424–426 Derby (Apache) decryption, 658 using, 4–7 for digital signing, 632–634 benefits of, 3 encryption, 658 defined, 3 insertion of, 477–478 development of, 3 integrity of, 629 discussed, 4, 7 in JNI, 432 for Hibernate configuration files, 339 in Model 2, 417–422, 424–426 ij use in, 4–5 removing, 412 location of, 317, 341 types of, 432 in network mode, 6 verification of, 631–632, 632–634 descriptors, method, 445–446 data model, 238 deserialization DatabaseMetaData, 325 of Configuration, 258 databases defined, 241 access to, 311 discussed, 252 in Derby, 4–5 inside Swing actions, 246–247 discussed, 311–312 by value, 304 with Hibernate, 335–353 design, 126–127 ij creation of, 4 design patterns with JDBC API, 312–335 Adapter pattern, 131–134 databases, persisting applications with building with, 127–131 discussed, 311–312 Command pattern, 142–146 with Hibernate, 335–353 Composite pattern, 150–154 with JDBC API, 312–335 defined, 124 DatagramSocket class, 523 discussed, 123–124 DataSource interface, 317–318 importance of, 124–127 DBPanel constructor method, 184 for inheritance loops, 129–131 Decorator class, 170

720 20_777106 bindex.qxp 11/28/06 10:49 PM Page 721

echo server Index for interfaces, 129 @Discriminator annotation, 488 MVC pattern, 134–142 displayMessage method, 192, 193 single class design, 127 distributed file system notifications (example), Strategy pattern, 146–150 554–563 TeacherResponsibilities and, 128 distributed objects, 545–547 design phase (Waterfall methodology), 88 DLL files, 430–431 Destination class, 611 doAs method, 668 destroy method, 669, 692, 693 doclet API (Javadoc API), 28–29, 30–31 detached signature Document class, 651 defined, 643 Document Object Model (DOM), 238 discussed, 646–649 document signing. See digital signing in XML Digital Signatures, 646–649 document type definition (DTD), 338 DHPrivateKey interface, 635 doGet method, 253 DHPublicKey interface, 635 DOM (Document Object Model), 238 DI (Dependency Injection), 474, 487 domain model Dialect class, 339 for contact management system, 406 Dialog class, 215–216 defined, 336 digest method, 629 in Model 2 architecture, 405–412 DigestMethod class, 645 DOMSignContext, 647 DigestValue class, 645 doTag method, 364 digital keys dragEnter method, 168–169 creation of, 634–638 dragExit method, 168–169 JCA for, 634–640 driver(s) management of, 634–640 in JDBC 4.0, 312–313, 327 storing, 638–640 in JDBC API, 327 digital signature DriverManager, 316–317 as byte array, 632 DropMode, 221 detached, 646–649 DropTargetListener interface, 167 enveloped, 649–652 DSA (Digital Signature Algorithm), 626, 630 on JAR files, 681 DSAPrivateKey interface, 635 types of, 643 DSAPrivateKeySpec, 634 validating, 652–653 DSAPublicKey interface, 635 XML Digital Signatures, 649–653 DSAPublicKeySpec, 634 Digital Signature Algorithm (DSA), 626, 630 DSS (Digital Signature Standard), 630 Digital Signature Standard (DSS), 630 DTD (document type definition), 338 digital signing DWR (Direct Web Remoting), 384–391 data verification for, 632–634 dwReplacement method, 359–361 with detached signatures, 646–649 dwr. file, 390 of documents, 645 dynamic registration, 456–459 with enveloped signatures, 649–652 in JAR, 686–690 JCA for, 630–634, 642–654 E process for, 645–646 EAR (Enterprise ARchives). See also specific types, e.g.: validating signatures in, 652–653 Web ARchive with XML Digital Signatures, 645–646 deployment of, 700–701 direct byte buffers, 456 descriptor file for, 699–700 Direct Web Remoting (DWR), 384–391 inspecting, 699 directories, endorsed, 680–681 EAR descriptor file, 699–700 discipline, 82 eastPanel component, 161 echo server, 526–530

721 20_777106 bindex.qxp 11/28/06 10:49 PM Page 722

education, for software development

education, for software development, 84 for many-to-many relationships, 506–517 EIS (Enterprise Information System), 93 Object-Relational Mapping vs., 473 EJB. See Enterprise JavaBeans for one-to-many relationships, 496–506 EJB 3 (Enterprise JavaBeans 3), 474 packaging, 698–699 @EJB annotation, 490 persistence capabilities of, 485–496 EJBContext interface, 487 problems with, 473, 480 ejb-jar.xml file, 699 serialization, 262–263 EL. See Expression Language session beans and, 480–481 elaboration phase (UP), 91 usage of, 240 elements XMLEncoder/Decoder API for, 262–263 initial setting for, 437 Enterprise JavaBeans 3 (EJB 3), 474 in native arrays, 439 entities ElementType,26 in EJBs, 475, 478 Ellipse2D class, 180 in JPA, 475 ellipses, in variable arguments, 18, 19 of Plain Old Java Object, 475 email client @Entity annotation, 487 development of, 460–471 entity beans, 480 JNI for, 460–471 EntityManager API system design for, 460–461 acquisition of, 476 user interface of, 461–471 adding data in, 477–478 EncodedKeySpec, 634 defined, 475 encryption discussed, 476–480 with Cipher engine class, 658 persistence in, 476 defined, 656 Query method for, 478 ENCRYPT_MODE, 657 enumerations ENCTYPE FORM attribute, 379–380 constants in, 24 enctype tag, 379–380 defined, 24 endorsed directories, 680–681 discussed, 24–26 Endorsed Standard Override Mechanism, 680 with fields and methods, 25–26 endpoints, 579 in JDK 5, 24 engine classes, 626–628 with methods, 25–26 engine.js script, 385 EnumMap,25 enhanced for loop. See for loop enums,25 EnsureLocalCapacity function, 453 EnumSet,25 Enterprise ARchives (EAR). See also specific types, e.g.: envelope (SOAP), 570 Web ARchive enveloped signature deployment of, 700–701 defined, 643 descriptor file for, 699–700 discussed, 649–652 inspecting, 699 in XML Digital Signatures, 649–652 Enterprise Information System (EIS), 93 equals method, 668 Enterprise JavaBeans (EJBs) eraseItems method, 390 for bank applications, 520 ErrorManager,56 configuration object in, 240 EventPanel method, 196–197 discussed, 473–474 exception(s), 15–16 EL features in, 359 exception handling, 449–451 entities in, 475 ExceptionCheck function, 449 features of, 474 ExceptionClear function, 450 inspecting, 699 ExceptionDescribed function, 450 interceptor classes in, 481–485 ExceptionOncurred function, 449 JPA of. See Java Persistence API

722 20_777106 bindex.qxp 11/28/06 10:49 PM Page 723

getConnection method Index execMethods, 448 flexibility, 395, 426 executable JAR, 691 FlowLayout manager, 173–177, 226–227 execute method, 200, 205, 211–213, 227–228 folders, storing and retrieving, 464–465 Executer interface, 15–16 for loop, enhanced executeTests method, 34 defined, 7 execution (code) improvements on, over JDK5, 17–18 of authentication, 668 syntax for, 16–17 using JNI, 431–432, 445–449 foreach,16 of JSP page, 376 formal type parameters, 8, 9 of methods, 445–449 Formatter class, 52–55 existing protocols, 541 formPanel method, 197–198, 200 ExitAction, 140–141 FROM clause, 475 Expression Language (EL) FromReflectedMethod function, 459–460 in JSP 2.0, 359–361, 365–366 front-end in JSTL 1.1, 374–375 with AJAX, 382 in Model 1 Architecture, 357 DWR library for, 391 eXtensible Markup Language. See under XML Java EE for, 520 Externalizable classes, 243 function signatures (prototypes), 430 Externalizable interface, 243, 259–260 Function Tag Library, 366–368 Extreme Programming (XP), 87, 91–92 G F Gang of Four (GoF) design patterns, 158 FatalError function, 450, 452 generatePanel method, 233 field(s) generateParameters, 640 access to, 442 generatePrivate method, 636 enumerations with, 25–26 generatePublic method, 636 field access, 442–445 generate-web target, 112 field descriptors, 446 generation (sequence) pattern, 49 file manipulation (JAR), 681–684 generics (parameterized types) file naming, 50 using, 14 file system arrays of, 14 for Maven 2, 102 bounded type variables, 12–14 notification events, 554, 556, 558–561 boxing with, 21 POM files on, 102 class instances in, 14 FileHandler, 49–50 defined, 7 FileItem class, 379–380 discussed, 7–8 FileManager bean, 378, 380–381 exceptions and, 15–16 fill method, 181 in JDK 5, 7 fillTable function, 386–387 methods for, 15 Filter interface, 55–56 type erasure, 8–11 findClass method, 678–679 wildcards, 11–12 findHelper method, 677–678 Getahead, 384 finding data (EJB), 476 GetArrayElements, 438 FINE logging level, 38 GetArrayLength, 437, 442 FINER logging level, 38 GetArrayRegion, 439 FINEST logging level, 38 getCertificateAlias method, 639 FinishButton class, 228 getCertificateChain method, 639 fireTableDataChanged method, 187 getColor method, 226–227, 229 FLAG, 670 getConnection method, 388

723 20_777106 bindex.qxp 11/28/06 10:49 PM Page 724

getContactData method

getContactData method, 388–389 GridLayout manager, 169–171, 177–189 getContactMgmtTool method, 389 GROUP clause, 475 getDate method, 201–202 GroupLayout manager, 207–214 getDeclaredAnnotations,32 getElementById method, 389 getEncoded method, 635 H GetFieldID, 443–444, 446 handleNext method, 230–233 getFolderList function, 467 handlePrevious method, 230–233 getFormat method, 635 Handler class getInstance method methods for, 46–48 for Cipher objects, 657 stock handlers for, 48–51 for engine classes, 627, 628 use of, 46 for KeyFactory, 635 hashCode method, 9, 669 getKeySpec method, 636, 639 hashtableQuestions collection class, 162 getLocalAddr method, 358 HAVING clause, 475 getLocalName method, 358 header files, javah for, 429–430 getLocalPort method, 358 header implicit object, 366 getMarker method, 706 headers (SOAP), 570 GetMethodID, 446 headerValues implicit object, 366 getName method, 669 Hibernate GetObjectArrayElement, 437, 442 API, 340–341 GetObjectClass function, 447, 459 components of, 336–337 getPanel method, 229 configuration of, 409–410 getParameter method, 694 Criteria interface in, 350–352 getProcedures method, 326 discussed, 335–336 getRandomNumbers, 105 many-to-one relationship in, 345–346 getRecentFiles, 267 mapping files in, 338–339, 347–350, 424 getRemotePort method, 358 Model 2 architecture support for, 402–403 getSplashScreen method, 216–217 persistent objects in, 337–338, 342–344, 407 GetStaticField, 444 persisting applications with, 335–353 GetStaticMethodID function, 447 Plain Old Java Object vs., 337 GetStringChars, 434, 436 Query interface in, 352–353 GetStringLength, 434 setup for, 341, 409–410 GetSuperClass, 459 usage example for, 341–353 getValues method, 231–232 utility classes in, 341–342 getWinner method, 707–708 WebWork support for, 402–403 getXturn method, 708 in XDoclet, 113, 115–116, 115–117 global references Hibernate API using, 453 many-to-many relationships in, 345–346 creating and destroying, 454 role of, 337 defined, 451 Hibernate configuration file local references with, 455 discussed, 339–340 weak, 453 role of, 337 GoF (Gang of Four) design patterns, 158 Hibernate mapping file Graphics2d method, 180 defined, 338 greedy operators, 64–65 discussed, 338–339 GridBagConstraints class, 189, 192–193 role of, 337 GridBagLayout manager, 189–194 Hibernate Query Language (HQL), 340, 352–353 GridLayout class, 161 HibernateAction class, 404–405 HibernateFactory object, 402

724 20_777106 bindex.qxp 11/28/06 10:49 PM Page 725

InterruptedExeption Index HibernateInterceptor, 403–404 INFO logging level, 38 holdability, of result sets, 329–330 ignoreflag attribute, 385–386 Holtz, Lou, 82 inheritance, 126 horizontal components, 397 inheritance loops, 129–131 HQL (Hibernate Query Language), 340, 352–353 init method, 692, 693 HTML files, 530 initComponents () method, 160 HTMLTableFormatter,58 initialElement, 437 HTTP 1.0, 533 initialize, 636 HTTP authentication initParam implicit object, 366 on client, 588–589 Injector interface, 398 on server, 586–588 INOUT parameter, 324 HTTP GET InputScreen, 249 background on, 532–533 insensitive result sets, 329 implementation with, 533–538 insideCircle method, 182 for protocols, 532–538 inspecting HTTP Input tag, 379–380 Enterprise ARchives, 699 HTTP protocol Enterprise JavaBeans, 699 elements of, 531–532 WAR files, 699 in JDK, 541, 588 installation wizards (Swing), 225–234 response codes in, 532 installing in web applications, 521, 522 Ant (Apache), 709–710 for Web Services, 571 JDBC API, 313 Instrumentation layer, 601 integrated development environment (IDE), 84 I integration IBM, 3 service-oriented, 599 @Id annotation, 478 during software development, 85 id property systems, 599 in Hibernate database, 339, 407 interactive JDBC scripting tool (ij), 4–5 for mapping, 339 interceptor classes IDE (integrated development environment), 84 deployment descriptor for, 482 identification, user, 667 in EJBs, 481–485 IDL (Interface Definition Language), 548–550 InvocationContext for, 481–482, 484–485 ignoreflag, 387–388 life cycle of, 485 IIOB. See Internet InterORB Protocol StatelessSession interface for, 482–484 ij (interactive JDBC scripting tool), 4–5 styles of, 482 impl package classes, 277 in WebWork, 400–401 implementation @Interceptors annotation, 481 with HTTP GET, 533–538 Interface Definition Language (IDL), 548–550 in Web Services, 579 interface design, 129 implicit objects, 366 International Organization for Standards (ISO), 312 importData method, 221–222 internationalization, of strings, 433 IN parameters Internet InterORB Protocol (IIOB) pitfalls of, 322–323 for CORBA, 547 in prepared statements, 320–323 discussed, 551 setting, 320–322 for objects passed by value, 551 inception phase (UP), 91 for RMI, 545 index option (JAR), 690–691 interprocess communication, 521–522 indirect measurement, 87 InterruptedExeption, 588 InetSocketAddress class, 523, 524

725 20_777106 bindex.qxp 11/28/06 10:49 PM Page 726

InvalidJarIndexException

InvalidJarIndexException, 690 in JDK, 308 inverse attribute, 350 object graphs, 277–280, 283 Inversion of Control (IoC, dependency injection) pitfalls of, 302–307 defined, 396 runtime compatibility for, 277 discussed, 146 serialization in, 290 in Model 2 architecture, 397–399, 426 usage of, 307–308 Plain Old Java Object for, 398 value serialization in, 302–305 invocation protocol version compatibility for, 277 asynchronous, 581, 583–584 WSDL for, 308 in JSP 2.0, 363–365 XML Schema Definition in, 271 method, 21 Java API for XML Binding classes, 280–281 synchronous, 582–583 annotations, 292–301 of Web Services, 581–584 usage of, 283–290 InvocationContext, 481–482, 484–485 from XML schema, 276–277 InvocationContext reference, 481, 484 Java ARchive (JAR) Invoker interface, 142, 144–145 applets in, 685 IoC. See Inversion of Control creation of executable JAR, 691 IOException, 15–16 discussed, 681 IsAssignableFrom function, 459 and endorsed directories, 680–681 isCertificateEntry method, 639 exploring, 681 isCurrent method, 669 file manipulation in, 681–684 isDesktopSupported method, 222–223 index option for, 690–691 isDestroyed method, 669 and Java classpaths, 675–680 isKeyEntry method, 639 for license files, 253, 254 ISO (International Organization for Standards), 312 manifest files for, 684–685 IsSameObject function, 455 signing, 686–690 Iterable interface, 17 Java Authentication and Authorization Service (JAAS), iterator(s), 16 625, 666 iterator tags, 421 Java class annotations, 290–292 Java code discussed, 428–429 J native methods for, 427 J2EE web application strings in, 432 architecture of, 93 variable arguments in, 18 defined, 125 Java Cryptography Architecture (JCA) design patterns in, 125 algorithms in, 640–641 WebWork as, 422 architecture of, 626 JAAS (Java Authentication and Authorization Service), certificate management in, 654–656 625, 666 design of, 626 JAddEventButton class, 200 for digital keys, 634–640 Jakarta Commons Net Package, 541 for digital signing, 630–634, 642–654 Jakarta Commons Upload, 378 discussed, 625 JAR. See JAVA ARchive; Java ARchive engine classes for, 626–628 jar tool, 681–684 MessageDigest class in, 628–630 jarsigner, 686 RNG in, 641–642 Java 5 Tiger release, 106 security and, 625–626 Java API for XML Binding (JAXB) XML Digital Signatures in, 642–654 advantages to using, 307 Java Cryptography Extension (JCE) disadvantages to using, 307 authentication in, 665–673, 667–672 discussed, 270–271 authorization in, 672–673

726 20_777106 bindex.qxp 11/28/06 10:49 PM Page 727

Java Serialization API Index Cipher class in, 656–657, 656–665 sending messages with, 611–612 discussed, 625 server configuration for, 612–613 KeyGenerator engine class in, 662 for SOA, 610–618 for license files, 254 topics in, 611 message authentication code in, 665–666 Java meta-characters, 63, 64 sealing objects with, 663–665 Java Naming and Directory Interface (JNDI), 317–318, SecretKeyFactory in, 662–663 380, 474 security and, 625, 656 Java Native Interface (JNI) services of, 656 using, 428 Java DataBase Connectivity. See under JDBC advanced programming with, 455–460 Java Development Kit. See under JDK arrays in, 436–442 Java drivers, 312 code for, 428–429 Java EE. See Java Enterprise Edition creating, 429–431 Java Enterprise Edition (Java EE) data types in, 432 for bank applications, 520 discussed, 427, 432 discussed, 519 dynamic registration with, 456–459 for RMI, 547 for email client development, 460–471 Java Foundation Classes (JFC) exception handling using, 449–451 discussed, 157–158 executing code using, 431–432 layout managers, 158–214 field access using, 442–445 Mustang release, 214–225 local reference in, 452 Java logging method execution using, 445–449 defined, 34 NIO support in, 456 discussed, 35–36 object references in, 451–455 ErrorManager,56 program writing with, 427 examples of, 56–60 reflection functions in, 459–460 Filter interface, 55–56 strings in, 432–436 Formatter class, 52–55 threading using, 455–456 Handler class, 46–51 Java Network Launch Protocol (JNLP), 702–704 Level class, 45–46 Java objects. See object(s) Logger class, 38–42 Java Persistence API (JPA) LogManager class, 36–42 discussed, 474–475 LogRecord class, 42–45 entities in, 475 Java Management Extensions (JMX) entity manager of, 476–480 architecture for, 601 features of, 474, 475 discussed, 600 for Plain Old Java Object, 474 importance of, 601 query language of, 475–476 MBeans in, 602–610 select statements in, 475–476 relevance of, 600 Java persistence query language, 475–476 for SOA, 600–610 Java preferences. See Preferences class Java Messaging Service (JMS) Java Remote Method Protocol (JRMP), 545 client for, 613–614 Java Runtime Environment, 680 discussed, 610 Java SDK, 626–627 importance of, 610 Java Serialization API JMSAgent in, 617–618 classes in, 242–243 JMSWorker MBean in, 614–616 discussed, 241–242 message functions in, 611–612 extending and customizing, 257–261 queues in, 610–611 format customization, 258–260 receiving messages with, 611–612 implementation, into applications, 253–257 relevance of, 600 steps for, 243

727 20_777106 bindex.qxp 11/28/06 10:49 PM Page 728

Java Serialization API (continued)

Java Serialization API (continued) JDBC 3.0, 335 strengths and weaknesses in, 261 JDBC 4.0 time-based licensing using, 249–253 using, 315–316 transient keyword for, 257 annotations in, 333–334 usage of, 261–262 connection management in, 316–318 versioning in, 260–261 DataSource interface in, 317–318 XMLEncoder/Decoder API vs., 269 discussed, 311 Java Server Page (JSP) DriverManager in, 316–317 for EJB 3 components, 513 drivers in, 312–313, 327 EL features in, 359 result sets in, 328–333 Java Socket API, 523 statements in, 318–328 Java Standard Template Library. See JSTL 1.1 transaction management in, 334–335 Java strings, UTF-8 format for, 433 JDBC API (Java DataBase Connectivity API) Java virtual machine classes in, 243 crashing, 432 in Derby, 5–6 string usage in, 432 discussed, 312–313 Java Web Start applications drivers in, 327 discussed, 702, 709 establishing data source for Contact Management TicTacToe example for, 702–709 Tool, 373 Java2DPanel class, 179–180, 182–183 installing, 313 Java2DPanelMouseclickPrint class, 188–189 parameters in, 353 JavaBeans (Enterprise). See Enterprise JavaBeans persisting applications with, 312–335 Javadoc API (doclet API), 28–29, 30–31 setObject method for, 323–324 javah, 429–430 three-tier model of, 314–315 javap utility, 446 two-tier model of, 313–314 JavaScript JDBC-net pure Java driver, 312 AJAXTags libraries as alternative to, 382 JDBC-ODBC bridge driver, 312 and DWR, 384 JDK (Java Development Kit) function, 385 CORBA support in, 547 JAXB. See Java API for XML Binding dependencies in, 103 JAXB 1.0, 271, 277 HTTP support in, 541, 588 JAXB 2.0, 271, 277, 280 JAXB in, 308 JAXB classes (JDK 6), 276 manipulating JAR files, 681–682 JAXBContext, 281 versioning in, 260 JAXBElement, 280–281 XMLEncoder/Decoder API in, 269 JAXBException, 287, 289 JDK 5 JAX-WS, 575–577, 579 enumerations in, 24 JBoss, 612–613 features of, 3 JButton component, 160, 174, 205 for loop enhanced from, 17–18 JButton setText() method, 162 generics in, 7 JButtonCoins method, 176 JDK 6 JButtonSave component, 200–201 changes in, 3 JButtonStrategy1 class, 203–204, 205–206 Derby in, 3 JButtonStrategy2 button, 204 JAXB classes in, 276 JButtonStrategy2 class, 206 WS deployment with, 577–578 jbyte, 434 JFC (Java Foundation Classes) JCA. See Java Cryptography Architecture discussed, 157–158 JCE. See Java Cryptography Extension layout managers, 158–214 jchar, 432, 434 Mustang release, 214–225 JConsole, 604–605

728 20_777106 bindex.qxp 11/28/06 10:49 PM Page 729

lazy (reluctant) operators Index JFormattedTextField class, 174 JFrame (BorderLayout) container, 158 K key agreement, 656 JKS, 638 key entry, 638 JMeter, 117–120 key interface, 634–635 JMeter 2.1, 119 key unwrapping, 658–662 JMS. See Java Messaging Service key wrapping, 658–662 JMSAgent component, 611, 617–618 KeyFactory engine class JMSWoker component, 611, 614–616 defined, 627 JMX. See Java Management Extensions for representation conversion, 635 JNDI (Java Naming and Directory Interface), 317–318, KeyGenerator engine class, 662 380, 474 KeyInfo class, 645 JNextButton component, 228 KeyPair class, 636 JNI. See Java Native Interface KeyPairGenerator engine class JNIMailBridge, 460, 465 defined, 627 JNINativeMethod structure, 457, 459 for key management, 636 JNLP (Java Network Launch Protocol), 702–704 KeySelectorResult interface, 653 JPA. See Java Persistence API keysize parameter, 636 JPanel, 138 KeySpec interface, 634 JPanel (FlowLayout) container, 158 keystore, 638–639 JPreviousButton component, 227–228 KeyStore engine class JQuestionButton, 162 defined, 627 JRadioButtonAnswer class, 162 discussed, 638 JResetButton button, 164 for key management, 636 JRMP (Java Remote Method Protocol), 545 King, Gavin, 402 JSP (Java Server Page) for EJB 3 components, 513 EL features in, 359 L JSP 2.0 language features code reuse in, 361–362 boxing conversions, 19–21 discussed, 357–358 discussed, 7 Expression Language in, 359–361, 365–366 enumerations, 24–26 invocation protocol in, 363–365 for loop, enhanced, 16–18 .jspx page extensions in, 362–363 generics, 7–16 for Model 1 architecture, 357–365, 376–380 metadata, 26–34 Servlet 2.4 support in, 358 static data importing, 21–23 web application visualization with, 376–380 unboxing conversions, 20–21 JSP custom tags (WebWork), 417 variable arguments, 18–19 .jspx page extensions, 362–363 Larman, Craig, 90 JSR 105, 642 layout managers JSTL 1.1 BorderLayout manager, 158–164 discussed, 366 BoxLayout manager, 164–172 Function Tag Library in, 366–368 CardLayout manager, 202–207 for Model 1 architecture, 366–375 discussed, 158 SQL transactions in, 368–370 FlowLayout manager, 173–177 web application visualization with, 370–375 GridBagLayout manager, 189–194 jstring data type (C/C++), 432, 433 GridLayout manager, 177–189 JTextArea component, 233 GroupLayout manager, 207–214 JTextField, 221, 231–232 SpringLayout manager, 194–202 JTree object, 208 lazy attribute, 350 JUnit, 85 lazy (reluctant) operators, 65

729 20_777106 bindex.qxp 11/28/06 10:49 PM Page 730

leaf class

leaf class, 151–152 learning curve (Model 2), 395 M MAC (message authentication code) len parameter, 628, 629 defined, 656 Level class, 45–46 in JCE, 665–666 license files mail messages, 464–466 JAR for, 253, 254 MailClient, 460 JCE for, 254 MailFolder class, 463 life cycle MailMessage class, 463 of interceptor classes, 485 main method, 679 of JMSWorker, 614 manifest files (JAR), 681, 684–685 with Maven, 101, 106 manipulating result sets, 331–332 listeners, in JMeter, 119 many-to-many relationships listkey, 419 EJBs for, 506–517 listvalue, 419 in Hibernate API, 345–346 load method, 638 one-to-many relationships vs., 507 loading, 248–249, 287–290 web components for, 506–517 load-on-startup attribute, 697 many-to-one relationship, 345–346 local references MAPI routines, 465–466 creating and deleting, 451 @MappedSuperclass annotation, 489 defined, 451 mapping global references with, 455 of collections, 348–350 management of, 452–453 components of, 347–348 memory issues of, 452 files for, 424 localized strings, 433 in Hibernate, 338–340, 347–350 Logger class properties for, 350 levels of, 38 property-to-column, 339 methods for, 38–42 XDoclet for, 110–111 usage of, 38 marshaller Logger objects, 34–35, 39–42 in RMI, 544 logging. See Java logging XML, 281–282 LoggingInterceptor, 400 Maven 1, 101 logic controllers, in JMeter, 119 Maven 2 login method, 223 Ant and, 106 LoginAction, 140 archetypes in, 102 LoginContext, 670, 671–672 discussed, 101–102 LogManager class transitive dependencies in, 102–106 configuration of, 37 MBeans control methods in, 37–38 creation of, 602–606 properties of, 36 in JConsole, 605 logout parameter, 671 JMSWorker, 614–616 LogRecord class, 42–45 in JMX, 602–610 defined, 42 in JMX architecture, 601 methods for, 43 management of, 602–606, 606 for origination, 43–44 remote client for, 607–609 for resource bundling, 44 RemoteAgent for, 606–607 for setting information, 44–45 WorkMonitor for, 609–610 loops MBeanServer, 603, 607 for checking, 506 MD4 algorithm, 628 inheritance, 129–131 MD5 algorithm, 628 loose-coupling, 128, 619

730 20_777106 bindex.qxp 11/28/06 10:49 PM Page 731

Model-View-Controller (MVC) pattern Index MD5 algorithms, 626 methods parameter, 457 MDI (multiple document interface), 239 mgrBody object, 386–387 member variables, 442 Microsoft .NET framework, 554, 596 memory, 452 middle layer, in three-tier model, 314 MemoryHandler, 50–51 middleware message authentication code (MAC) message-oriented, 600, 610, 618 defined, 656 for RMI, 546 in JCE, 665–666 mime-mapping element, 698 Message class, 611 Mine, Philip, 269 MessageClient component, 611 model(s), 406 MessageConsumer class, 611 model (MVC), 394 MessageDigest engine class model component (MVC), 136–137 calculating, 628–629 Model 1 architecture defined, 627 discussed, 355–357 in JCA, 628–630 EL for, 359–361, 365–366 verifying, 629–630 JSP 2.0 specification for, 357–365, 376–380 Message-Oriented Middleware (MOM), 600, 610, 618 JSTL 1.1 for, 366–375 MessageProducer class, 611 Model 2 architecture vs., 396 messages Model 2 architecture in JMS, 611–612 adding data to, 417–419 receiving, 611–612 advantages of, 395 sending, 611–612 application development with, 396 meta-characters browsing data in, 419–422 boundary, 62–63 case implementation in, with actions, 412–415 character classes in, 63 changing data in, 424–426 discussed, 60 compatibility issues of, 403–405 Java, 63, 64 configuring, 422–424 POSIX, 63–64 disadvantages of, 395–396 predefined types, 61–63 discussed, 393–395, 426 in regular expressions, 61–63 domain model definition in, 405–412 types of, 60 Hibernate support in, 402–403 metadata Inversion of Control in, 397–399 AnnotationDesc,29 Model 1 architecture vs., 396 AnnotationDesc.ElementValuePair,29 MVC in, 393–394 annotations in, 26–27 need for, 393 AnnotationTypeDoc,29 Plain Old Java Object in, 426 AnnotationValue,30 problems with, 403–405 AnnotionTypeElementDoc, 29–30 process of, 394–395 defined, 7 scope in, 395 META-INF directory, 681, 683–684, 686, 689, 690 security in, 395 method descriptors, 445–446 use of, 395–396 method execution, 445–449 web application visualization in, 415–422 method invocations, 21 with WebWork, 396, 399–402 methodology ModelDrivenInterceptor, 400 discussed, 88 mode-less, 215 Extreme Programming, 91–92 modeling, 81 observations on, 92–93 Model-View-Controller (MVC) pattern Unified Process, 90–91 application initialization with, 136 Waterfall methodology, 88–89 changes to, 135 methods, 25–26 components of, 394

731 20_777106 bindex.qxp 11/28/06 10:49 PM Page 732

Model-View-Controller (MVC) pattern (continued)

Model-View-Controller (MVC) pattern (continued) NIO support, 456 controller component of, 140–142 NoClassDefFoundError exception, 450 discussed, 134–142, 393 nodes, in Preferences class, 70, 72, 73 in Model 2 architecture, 393–394 nonscrollable result sets, 329 model component of, 136–137 non-static fields, 442 purpose of, 134 non-static methods, 445 view component of, 137–139 NULL character, 433 modularity NumberFormat class, 174 in Model 2 architecture, 426 numBytes array, 641 of WebWork, 426 module element, 699–700 MOM (Message-Oriented Middleware), 600, 610, 618 O MonitorEnter function, 456 OASIS, 596 mousePressed method, 181 object(s) MS Outlook, 460 in ArrayList,7 multiple document interface (MDI), 239 arrays of, 436, 437 Mustang release, 214–225 in C/C++, 442–449 MVC pattern. See Model-View-Controller pattern distributed, 545–547 MyAdjustmentListener method, 234 point, 275 MyTableModel class, 186–187 in RMI, 545–547 sealing, 663–665 object graph, 239 N Object Graph Navigation Language (OGNL), 401 name parameter, 579, 671 object graphs (JAXB), 277–280 named queries, 475 object graphs serialization, 290 NamedQuery annotation, 506 Object Management Group (OMG), 547 naming (COS), 550–551, 559–560 Object method, 30 naming files, 50 object references native API/part Java driver, 312 comparing, 455 native arrays, 439 global, 453–455 native code global references, 453–455 for arrays, 438, 440 in JNI, 451–455 Java objects in, 437 local, 451–453 sort routine in, 4389 local references, 451–453 native keyword, 428 Object Request Broker (ORB), 550 native libraries, 431 ObjectFactory class, 280 native methods ObjectInputStream, 249, 265 using, 428–429 object-oriented (OO) design, 126, 127, 234, 311 for Java code, 427 ObjectOutputStream, 249, 265 registering, 456–459 Object-Relational Mapping (O/RM) unregistering, 457 in @Column annotation, 479 native-protocol pure Java driver, 312 compatibility issues of, 403 navigating result sets, 330–331 EJBs vs., 473 .NET framework (Microsoft), 554, 596 solutions of, 344 NetBeans, 207 tools for, 403 network architecture, 521–522 object-to-object communication, 548 NewArray, 438 OFF logging level, 38 NewGlobalRef function, 453, 454 OFX (Open Financial Exchange), 271 NewLocalRef function, 451 OGNL (Object Graph Navigation Language), 401 NIO direct buffers, 456 OMG (Object Management Group), 547

732 20_777106 bindex.qxp 11/28/06 10:49 PM Page 733

Preferences class Index omitCheckedItems function, 385–386 PBE (password-based encryption), 656 @OneToMany annotation, 478 PBEKey interface, 635 one-to-many relationships persistence query language, 475–476 EJBs for, 478–479, 496–506 @PersistenceContext annotation, 487 many-to-many relationships vs., 507 @PersistenceContexts annotation, 487 web components for, 496–506 PersistenceDelegates, 269 OO design. See object-oriented design @PersistenceUnit annotation, 487 opaque representations, 634, 635 @PersistenceUnits annotation, 487 Open Financial Exchange (OFX), 271 persistent objects Open Systems Interconnection (OSI), 521 in Hibernate, 337–338, 342–344, 407 OperatingSystems enum,24 libraries for, 497 operations, in Preferences class, 70–71, 74 properties of, 496 opMode parameter, 657 role of, 337 Optional FLAG, 670 pigLatin method, 359–361 O/R mappings, standardized, 475 PKCS (Public Key Cryptography Standard), 638 ORB (Object Request Broker), 550 Plain Old Java Object (POJO) ORDER BY clause, 475 ContactMgmtTool, 390–391 O/RM. See Object-Relational Mapping entities of, 475 OSCAR, 540 Hibernate vs., 337 OSI (Open Systems Interconnection), 521 for IoC, 398 OutOfMemoryError, 459 JPA for, 474 @overrides annotation, 27 in Model 2 architecture, 426 OwnerSession interface, 507–508 session beans as, 474 plaintext (cleartext), 656 platform-independent RPCs, 566–567 P POA (Portable Object Adapter), 559 package target, 112 point objects, 275 packaging POJO. See Plain Old Java Object for applet execution, 693–694 polymorphism, 126, 130, 149 of EJBs, 698–699 POM (project object model), 103, 106 pageContext implicit object, 366 Popescu, Alexandru, 106 pageScope implicit object, 366 PopLocalFrame function, 452, 453 paint method, 692, 693 populateTable method, 184, 185, 187 paintComponent(Graphics g) method, PopupMenu class, 217–218 166, 180, 183 port types, 568 panelTable method, 185, 197 Portable Object Adapter (POA), 559 param implicit object, 366 portlet, 361–362 PARAM tag, 694 POSIX meta-characters, 63–64 parameterized types, 8. See also generics PostPersist, 501 params parameter, 657 post-processor tests, in JMeter, 119 paramSpec object, 640 PostRemove, 501 paramValues implicit object, 366 Preferences class parentheses, inside regular expressions, 65 using, 75–77 ParentLogger,58 discussed, 70 parse method, 649 events in, 73 parsing, file formats, 530 exporting, to XML, 74 Password-Based Encryption (PBE), 656 nodes in, 70, 72, 73 password-based encryption (PBEKey), 635 operations in, 70–71, 74 Pattern-Matcher model, 61, 68 retrieving values for, 72–73 patterns. See design patterns setting values for, 73

733 20_777106 bindex.qxp 11/28/06 10:49 PM Page 734

prepared statements (JDBC 4.0)

prepared statements (JDBC 4.0) Public Key Cryptography Standard (PKCS), 638 batch updates using, 327–328 public key object, 632 discussed, 318 PublicKey interface, 635 IN parameters in, 320–323 PushLocalFrame, 453 setObject method for, 323–324 PreparedStatement, 327–328 pre-processor tests, in JMeter, 119 Q primary key, 500, 511 quality measures, 80 primitive types Query interface array type counterpart for, 436 annotations in, 333 arrays of, 436, 437–442 for EntityManager API, 478 conversion of, to reference type, 19 in Hibernate, 352–353 references to, 20–21 in Hibernate API, 340 types of, 438 of JPA, 475–476 principals, in authentication, 668–669 queues (JMS), 610–611 printf (), 432 PrintWriter class, 524 R private key, 632 random number generation, 641–642 PrivateKey interface, 635 random number generator (RNG), 641 processing chain pattern, 619 RDBMS (Remote Database Management System), 324 programming readObject method, 254 client, 524–525 read-only result sets, 329 scripting vs., 396 refactoring, 83 sockets for, 524–525, 525–526 reference, 543 project building, with Apache Ant, 710–713 reference(s) project object model (POM), 103, 106 conversion of, from primitive types, 19 PropertyChangeListener interface, 139, 174–175 object. See object references property-to-column mapping, 339 to primitive types, 20–21 propOrder value, 295–296 Reference class, 643 proprietary protocols, 540–541 reflection API, 32–33 protocol(s) reflection functions, 459–460 defined, 521 refresh method, 669 discussed, 530 RegisterNatives function, 457, 459 existing, 541 registerOutParameter, 324 HTTP GET for, 532–538 registration HTTP specification for, 531–532 dynamic, 456–459 implementation with, 530–541 with JNI, 456–459 proprietary, 540–541 for native methods, 456–459 reverse engineering with, 540–541 registry (RMI), 545 for RPCs, 544–545 regular expressions with sockets, 530–541 character classes in, 63 sockets and, 530–541 defined, 34, 60 specification for, 531–540 Matcher class, 66–68 TCPMon testing for, 538–540 MatchResult interface, 68 utilizing, 541 meta-characters in, 61–63 prototypes (function signatures), 430 parentheses inside, 65 provided scope, 103 Pattern class, 65–66 providers (cryptographic service providers), 626 repetition operators in, 64 pseudo-random random number, 640 usage examples for, 68–70

734 20_777106 bindex.qxp 11/28/06 10:49 PM Page 735

scrollable result sets Index relational database, 315–316 result sets ReleaseStringChars, 434, 436 using, 330 reluctant (lazy) operators, 65 closing, 332 @Remote annotation, 483 concurrency of, 329 remote client (MBeans), 607–609 discussed, 328 Remote Database Management System (RDBMS), 324 holdability of, 329–330 Remote Management layer, 601 in JDBC 4.0, 328–333 Remote Method Invocation (RMI) manipulating, 331–332 CORBA compatibility with, 551 navigating, 330–331 defined, 542 row insertion/deletion in, 332 defining, 543 types of, 329 distributed objects in, 545–547 ResultSet interface, 315–316 IIOB for, 545 retention, 26, 27 in Java EE, 547 RetentionPolicy enumeration, 26 marshalling/unmarshalling in, 544 reuse middleware for, 546 code, 361–362 objects in, 544 at code-level, 124 principles of, 542–543 at design-level, 124 registry for, 545 in Model 2 architecture, 395 RMI-IIOP objects from, 551–553 reverse containment, 130 serialization in, 249 reverse engineering, 540–541 remote procedure calls (RPC) RMI. See Remote Method Invocation defined, 542 RMI-IIOP, 551–553 platform-independent, 566–567 RNG (random number generator), 641 principles of, 542–543 rootElement object, 280 protocols for, 544–545 RPC. See remote procedure calls in Web Services, 566–567 RSAMultiPrimePrivateCrtKey interface, 634, 635 remote reference, 542 RSAPrivateCRTKey interface, 634, 635 RemoteAgent (MBeans), 606–607 RSAPrivateKey interface, 634, 635 removeAll method, 200, 227–228 RSAPublicKey interface, 634, 635 removing data RulesButton class, 164 in EJB database, 476 runtime in Hibernate, 412 annotations at, 31 renewItems method, 390 JAXB version compatibility for, 277 renewResults function, 385–388 RUNTIME policy, 26 repetition operators, 64 replaceString, 435–436 Request Component, 401 S request-reply pattern sampler plans, in JMeter, 119 discussed, 619–621 savepoint, 335 for SOA, 619–621 saving request-response flow, 399–400 action implementation for, 284–287 requestScope implicit object, 366 of application data, 239 Required FLAG, 670 configuration, 248 Requisite FLAG, 670 scalability, 395 @Resource annotation, 380–381 SchemaExport (Hibernate), 408, 409, 425 resource bundling, 44 scope, 395 Resource Injection, 486 scripting, programming vs., 396 restoreLogPanel method, 201–202 scrollable result sets, 329, 330

735 20_777106 bindex.qxp 11/28/06 10:49 PM Page 736

sealing objects

sealing objects, 663–665 Service Oriented Architecture (SOA) searchClassPath method, 678 APIs for, 600 searchJarFile method, 677 discussed, 599–600 SecretKey interface, 635 for JMS, 610–618 SecretKeyFactory, 662–663 JMX for, 600–610 Secure Hash Algorithm (SHA-1), 626, 628, 630 processing chain pattern for, 619 SecureRandom engine class request-reply pattern for, 619–621 defined, 627 Split-Aggregate pattern for, 621–623 use of, 642 system integration patterns for, 619–623 security for Web Services, 563 of Applets, 694 Service Provider Interface (SPI), 626, 627 discussed, 625 service-oriented integration, 599 using JAAS, 666 servlet, for timeserver, 252 with JCA, 625–626 Servlet 2.4 support, in JSP 2.0, 358 with JCE, 625, 656 servlet element, 697 in Model 2 architecture, 395 session bean, 474, 480–481 user identification and, 667 Session class, 611 security checks, 668 Session Component, 401 security-constraint element, 698 Session object security-role element, 698 in Hibernate API, 340, 402, 403 Select statements, 475 transaction support in, 611 select tag (WebWork), 419 SessionFactory, 340–342 sendMail method, 464 sessionScope implicit object, 366 sensitive result sets, 329 sessionStatelessLocal, 494–495 sequence (generation) pattern, 49 SetArrayRegion, 439 Serializable interface, 243, 249 setBackground method, 226–227 serialization. See also Java Serialization API setCertificateEntry, 639 classes for, 243 setEnabled method, 226–227 defined, 241 SetField, 443–444 inside Swing actions, 246–247 setKeyEntry method, 639 in Java API, for XML Binding, 302–305 SetLayout() method, 158 JAXB, 290 setListData method, 222 for object graphs, 290 setMarker method, 706, 708 in RMI, 249 setMinimumFractionDigits method, 174 strengths of, 261 setObject method as temporary solution, 262 for JDBC API, 323–324 by value, 302–305 for prepared statements, 323–324 weaknesses of, 261 setPreferredSize method, 179–180 XmlJavaTypeAdapter as root of, 306 setRecentFiles, 267 serialVersionUID, 260 setSuccessor method, 175–176 server setTabComponent method, 220–221 HTTP authentication on, 586–588 setText method, 231–232 JMS configuration of, 612–613 setValueAt method, 186–187 programming, 525–526 setValues method, 230–232 sockets for programming of, 525–526 setVerticalGroup method, 211 server layer SEVERE logging level, 38 in three-tier model, 314 SHA-1 (Secure Hash Algorithm), 626, 628, 630 in two-tier model, 313 short iterations, 86 ServerSocket class, 523 Show Tables command, 412

736 20_777106 bindex.qxp 11/28/06 10:49 PM Page 737

string(s) Index SIGN signature state, 630 standardized O/R mappings, 475 Signature engine class start method, 692, 693 defined, 627, 643 State class, 225, 229–234 states of, 630 State pattern, 203, 225 for verification of data, 631–632 stateful session bean, 480 signatures. See digital signature state-full filter, 622 SignedInfo class, 643 @Stateless annotation, 497 signing. See digital signing stateless session bean, 480 Simple Object Access Protocol (SOAP) StatelessSession interface, 482–484 and WAR files, 695 statement(s) (JDBC 4.0) in WS, 567, 570–571, 642 batch updates using, 326–328 in WSDL, 567–568 callable, 324–326 SimpleFormatter, 52, 58 interface for, 318–319 SimpleKeySelectorResult, 653 prepared, 320–324 SimpleTagSupport class, 364 Statement interface, 315–316 single class design, 127 Statement object SOA. See Service Oriented Architecture batch updates using, 326–327 SOAP. See Simple Object Access Protocol execution methods for, 319 socket(s) static data importing, 21–23 classes of, 523 static fields, 442 for client programming, 524–525 static importing for communication, 522–541 defined, 7 communication with, 522–541 discussed, 21–23 defined, 521, 522 syntax for, 22 in echo server, 526–530 static methods, 445 Java Socket API, 523 StaticParametersInterceptor, 400 protocol implementation with, 530–541 stock formatters protocols and, 530–541 creating, 54–55 for server programming, 525–526 discussed, 52 types of, 523 SimpleFormatter,52 Socket class, 523, 524 XMLFormatter, 52–54 SocketEcho class, 526–529 stock handlers SocketHandler,49 ConsoleHandler, 48–49 software development principles, 80–88 FileHandler, 49–50 software estimation, 87 for Handler class, 48–51 source code, 83 MemoryHandler, 50–51 source control, 85 SocketHandler,49 SOURCE policy, 26, 27 StreamHandler,48 source-level annotations, 27 stop method, 692, 693 specification, for protocols, 531–540 storage, of digital keys, 638–640 SPI (Service Provider Interface), 626, 627 store method, 638 spiral methodology, 89 Strategy pattern, 126, 146–150, 203–204 SplashScreen class, 216–217 StreamHandler,48 Split, 621 string(s) Split-Aggregate pattern, 621–623 in C/C++, 432 SpringLayout manager, 194–202 functions of, 433–434 SQL transactions, in JSTL 1.1, 368–370 internationalization of, 433 stack trace, 450 in Java code, 432 standard transactions, 335 in Java virtual machine, 432 in JNI, 432–436

737 20_777106 bindex.qxp 11/28/06 10:49 PM Page 738

string(s) (continued)

string(s) (continued) TCPMon (Apache) localized, 433 using, 539–540 in native code, 435 acquiring, 539 replacing, 435 discussed, 538–539 storage of, 432 protocol testing with, 538–540 types of, 432 TeacherResponsibilities, 128 String method, 30 teamwork, 84 Struts, 396 testing methods, 32–33, 85 stubs TestNG, 85, 106–110, 125 defined, 543 TestParameters annotation, 34 for Web Services, 581 TestStrategy interface, 207 sub-elements testStrategy method, 205 in JAXB, 277 THEAD tag, 386–387 in WAR file attributes, 696 thread synchronization, 455 subject authentication, 670 ThreadGroups, 117, 119 Subject class, 667, 668 threading, using JNI, 455–456 subtyping, 147 three-tier model, 314–315 Sufficient FLAG, 670 Throw function, 450 SUN package, 626, 628, 630, 638 ThrowNew function, 450 sun-jaxws.xml, in Tomcat, 579–580 throws,15 superclass constructors, 25, 459 TicTacToe Java Web Start application example, supportsStoredProcedures, 326 702–709 Swing API, 262 time-based licensing Swing applications discussed, 249–250 in GroupLayout manager, 208–210 implementing, 250–252 layout managers in, 158, 190, 191 using Java Serialization API, 249–253 and Mustang release, 223 timeserver in, 252–253 navigation flows in, 225–234 TimerInterceptor, 400 in SpringLayout manager, 196–197, 199 timers, in JMeter, 119 switch statements, 24–25 timeservers, 252–253 synchronizing objects, 455 Tomcat synchronous invocation, 582–583 sun-jaxws.xml in, 579–580 system design, 460–461 Web service deployment on, 578 system integration patterns web.xml configuration in, 579 processing chain pattern, 619 WS deployment using, 578–580 request-reply pattern, 619–621 ToReflectedField function, 460 for SOA, 619–623 ToReflectedMethod function, 460 Split-Aggregate pattern, 621–623 toString method, 669 System.load, 455 traceability, 82–83 systems integration, 599 tracking bugs, 87–88 transaction(s) in Hibernate API, 340 T in JDBC 4.0, 334–335 tabTest, 219–220 management of, 334–335 .tag files SQL, in JSTL 1.1, 368–370 code reuse with, 361–362 standard, 335 conversion into Java code, 364 @TransactionAtrribute marking, 508 tag library (WebWork), 401, 417 @TransactionManagement annotation, 508 .tagx files, code reuse with, 361–362 TransferHandler class, 221–222 target, 26 Transform class, 644 TCP ( Transmission Control Protocol), 523 @Transient annotation, 512

738 20_777106 bindex.qxp 11/28/06 10:49 PM Page 739

web application deployment descriptor (web.xml) Index transient keyword, 257 UTF-8 format, for Java strings, 433 transition phase (UP), 91 utility classes (Hibernate), 341–342 translation, of JSP page, 376 utility libraries Transmission Control Protocol (TCP), 523 discussed, 34–35 transparent representations, 634, 635 Java logging, 35–60 transport protocols, 571 Preferences class, 70–77 TrayDemo constructor, 216–217, 221 regular expressions, 60–70 trayIcon object, 217–218 util.js script, 385 treePanel method, 186 trusted certificate entry, 638 Twain, Mark, 87 V two-tier model, 313–314 validate method, 201–202 type erasure, 8–11 validation type parameters. See also generics of configuration, 258–259 bound, 12–13, 299 of signatures, 652–653 for certificates, 656 of XWork, 415 formal, 8, 9 value deserialization, 304 types section, 570 value serialization, 302–305 type-safe, 7, 8, 24 ValueStack, 401 variable arguments in C/C++, 18 U defined, 7 UDP (User Datagram Protocol), 523 ellipses in, 18, 19 UDT (User Defined Types), 323 in Java code, 18 UML (Unified Modeling Language) training, 81 velocity, 87 unboxing conversions verification context for, 21 of configuration, 258–259 defined, 7 of data, 632–634 discussed, 20–21 for digital signing, 632–634 uncheckall function, 386, 389 of MessageDigest, 629–630 Unicode strings, 2-byte, 433 VERIFY signature state, 630, 632 Unified Modeling Language (UML) training, 81 versioning, 260–261 Unified Process (UP), 90–92 vertical components, 397 UNINITIALIZED signature state, 630 view (MVC), 394 unmarshaller view component (MVC), 137–139 creation of, 281–282 Visitor pattern, 190, 193–194 in RMI, 544 Visual Studio 2005, 430 XML, 281–282 volatility, in application, 126 unregistering native methods, 457 UnregisterNatives function, 457 UNWRAP_MODE, 657 W unwrapped keys, 658–662 WAR files. See Web ARchive UP (Unified Process), 90–92 WARNING logging level, 38 updatable result sets, 329, 331 Waterfall methodology, 88–89, 92–93 update clause, 16 weak global references, 451, 453, 454 URL class, 533, 534, 579 weather application example (WS), 564–566, 572–575, User Datagram Protocol (UDP), 523 589–596 User Defined Types (UDT), 323 Web application(s), 694–695 user identity authentication, 667 web application deployment descriptor (web.xml), user interface, of email client, 461–471 422–423

739 20_777106 bindex.qxp 11/28/06 10:49 PM Page 740

web application visualization

web application visualization for JAXB, 308 for adding data, 416 location of, 585 for browsing data, 416 SOAP in, 567–568 with JSP 2.0, 376–380 Web Services Interoperability Organization (WS-I) with JSTL 1.1, 370–375 Basic Profile of, 567–568 in Model 2 architecture, 415–422 defined, 564 Web ARchive (WAR files) Web Services Interoperability Technologies Project with Ant (Apache), 709–713 (WSIT), 596 deployment descriptor for, 696–698 web sites directory structure, 695 automated browsing on, 520 discussed, 694–695 server-side applications for, 525 inspecting, 699 Web Services on, 563 package target in, 112 Web tier (J2EE), 93 SOAP and, 695 WebMethod annotation, 575 structure of, 695 WebParam annotation, 575 web browsers, 238 WebResult annotation, 575 web browsing, 520 WebService annotation, 575 web component (EJB 3) WebServiceContext, 587 construction of, with tables, 496–506 WebWork deployment of, 506–517 Actions in, 399 for form usage, 485–496 architecture of, 399–400 for many-to-many relationships, 506–517 components in, 401 for one-to-many relationships, 496–506 defined, 396 web portals, 521 deployment descriptor for, 422–423 Web Services (WS) Hibernate support by, 402–403 access control in, 585–586 interceptors in, 400–401 asynchronous invocation of, 581, 583–584 as J2EE web application, 422 calling, 581–582 Model 2 architecture with, 396, 399–402 communication for, 563–596 modularity of, 426 deployment of, 575–580 OGNL in, 401 discussed, 563–564 request-response flow in, 399–400 enabling example for, 564–566, 572–575, 589–596 tag library, 401, 417 endpoints attributes for, 579 ValueStack in, 401 invocation of, 581–584 XWork as component in, 399 of JAX-WS, 575–577, 579 XWork in, 144 JDK 6 for deployment of, 577–578 XWork wrapped to, 423 platform-independent RPCs in, 566–567 WebWork JSP custom tags, 417 relevance of, 600 WebWork2, 396 SOAP in, 570–571 web.xml, 422–423, 579 stubs for, 581 welcome-file-list element, 698 synchronous invocation of, 582–583 WHERE clause, 475 Tomcat for deployment of, 578–580 wildcards, 11–12 transport protocols for, 571 WorkMonitor, 609–610 weather application example for, 564–566, 572–575, WorkPanel, 138, 139 589–596 World Wide Web Consortium, 270 writing client for, 580–589 WRAP_MODE, 657 wsgen and, 577 wrapped keys, 658–662 wsimport tool for, 580–581 wrapper, 423 Web Services Description Language (WSDL) writeObject method, 254 discussed, 568–570 writing, configuration, 245–246

740 20_777106 bindex.qxp 11/28/06 10:49 PM Page 741

XWork Action Index WS. See Web Services XML document WSDL. See Web Services Description Language for configuration objects, 271–272 wsgen, 577 in JSP.20-compliant web containers, 362–363 WS-I (Web Services Interoperability Organization) XML schema Basic Profile of, 567–568 annotations generating, 301–302 defined, 564 JAXB classes from, 276–277 wsimport tool, 580–581, 585, 596 XML Schema Definition (XSD) WSIT (Web Services Interoperability Technologies for configuration data model, 275–276 Project), 596 development of, 270 in JAXB, 271 for XML format definitions, 273–280 X XmlAccessorType, 296–297 XDoclet, 110–117 XmlAttribute, 292, 297 clean target in, 111–112 XmlElement, 292, 297 as code generation engine, 113–114 XmlElementWrapper, 292, 297–298 compile target in, 112 XMLEncoder/Decoder API config target in, 116 classes in, 265 discussed, 125 customization of, 268–269 generate-web target in, 112 discussed, 262 Hibernate in, 113, 115–117 EJB serialization using, 262–263, 265–269, 265–270 for mapping, 110–111 file format of, 264 package target in, 112 Java Serialization API vs., 262–263, 269 usage of, 110 in JDK, 269 xjc command, 276–277 usage of, 269–270 XML XML serialization format in, 263–264 annotations generating, 301–302 XMLFormatter, 52–54, 58 content creation, 283 XmlID, 292, 305 for content creation, 283 XmlIDREF, 292, 305 data types in, 568 XmlJavaTypeAdapter, 293, 298–300 format for, 273–280 XmlRootElement, 280–281, 291, 293, 295 format of, 273–280 XmlTransient, 293, 300–301 JAXB classes from, 276–277 XmlType, 295–296, 293296 marshaller, 281–282 XmlValue, 293 marshalling/unmarshalling, 281–282 X/Open SQL Call Level Interface (CLI), 312 relevance of, 600 XP (Extreme Programming), 87, 91–92 unmarshaller, 281–282 XSD. See XML Schema Definition XML Digital Signature API Specification XWork classes for, 643–645 validating, 415 detached signatures in, 646–649 as WebWork component, 144, 399 discussed, 642–643 WebWork wrapped to, 423 document signing with, 645 XWork Action enveloped signatures in, 649–652 for adding data, 413–414 in JCA, 642–654 for browsing data, 412–413 signing process in, 645–646 discussed, 399, 412–415 validating signatures in, 652–653

741 20_777106 bindex.qxp 11/28/06 10:49 PM Page 742