List of Listings

1-1 Listing 1-1, the JBoss 3.2.x branch build process 37

2-1 The ExCCEc class used to demonstrate ClassCastException due to duplicate class loaders 52

2-2 The ExCtx, ExObj, and ExObj2 classes used by the examples 53

2-3 The ExObj and ExObj2 classes used in the examples 55

2-4 The chap2-ex0c.log debugging output for the ExObj classes seen 56

2-5 The ExIAEd class used to demonstrate IllegalAccessException due to duplicate class loaders 57

2-6 Classes demonstrating the need for loading constraints 60

2-7 A concrete example of a LinkageError 62

2-8 Obtaining debugging information for a Class 66

2-9 An example log4j.xml configuration fragment for enabling verbose class loading logging 67

2-10 An example jboss-app.xml descriptor for enabled scoped class loading at the ear level. 72

2-11 The jmx-console.war web.xml and jboss-web.xml descriptors with the security elements uncommented. 88

2-12 The RMIAdaptor interface 90

2-13 A JMX client that uses the RMIAdaptor 94

2-14 The org.jboss.system.Service interface 110

2-15 Service descriptor fragments illustrating the usage of the depends and depends-list elements. 114

2-16 An example of using the depends element to specify the complete configuration of a depended on service. 115

2-17 JNDIMapMBean interface and implementation based on the service interface method pattern 118

2-18 JNDIMap MBean interface and implementation based on the ServiceMBean interface and ServiceMBeanSupport class 120

2-19 The example 1 JNDIMap MBean service descriptor and a client usage code fragment. 122

2-20 The version 1 JNDIMap XMBean descriptor 123

2-21 The version 2 JNDIMap XMBean descriptor 129

2-22 The TestXMBeanRestart persistence test client 133

2-23 The ClientInterface view of the JNDIMap XMBean exposed via RMI/JRMP 136

2-24 The XMBean version 3 test client 136

2-25 The XMBean version 3 descriptor 137

2-26 The JMX AbstractInterceptor base class 140

2-27 The SecurityInterceptor 141

2-28 The InvokerInterceptor 142

2-29 The XMBean version 3 service deployment descriptor 145

2-30 An example ear with an MBean that depends on an EJB 147

2-31 A DynamicMBean service that uses and EJB 148

2-32 The standard MBean interface for Listing 2-31 155

2-33 The DynamicMBean jboss-service.xml descriptor 156

2-34 The org.jboss.deployment.SubDeployer interface 167

2-35 The Invoker interface 176

2-36 The Invocation class used to represent method invocations 176

2-37 The InvokerAdaptorService MBean 180

2-38 The default jmx-invoker-adaptor-server.sar jboss-service.xml deployment descriptor 184

3-1 A sample jndi.properties file 196

3-2 ENC access sample code 197

3-3 An example ejb-jar.xml env-entry fragment 204

3-4 ENC env-entry access code fragment 205

3-5 An example ejb-jar.xml ejb-ref descriptor fragment 206

3-6 ENC ejb-ref access code fragment 207

3-7 An example jboss.xml ejb-ref fragment 208

3-8 An example ejb-jar.xml ejb-local-ref descriptor fragment 209

3-9 ENC ejb-local-ref access code fragment 210

3-10 A web.xml resource-ref descriptor fragment 211

3-11 ENC resource-ref access sample code fragment 212

3-12 A sample jboss-web.xml resource-ref descriptor fragment 212

3-13 An example ejb-jar.xml resource-env-ref fragment 214

3-14 ENC resource-env-ref access code fragment 214

3-15 A sample jboss.xml resource-env-ref descriptor fragment 214

3-16 227

3-17 A JNDI client that uses HTTPS as the transport 228

3-18 An example web.xml descriptor for secured access to the JNDI servlets 231

3-19 The additional web.xml descriptor elements needed for read-only access 233

3-20 ExternalContext MBean configurations 236

5-1 The client-interceptors from the "Standard Stateless SessionBean" configuration. 252

5-2 A sample ProxyFactory proxy-factory-config 256

5-3 A sample IOFactory proxy-factory-config 257

5-4 A sample JMSContainerInvoker proxy-factory-config 258

5-5 A custom JRMPInvoker example that enables compressed sockets for session bean. 261

5-6 A sample jboss.xml descriptor for enabling RMI/HTTP for a stateless session bean. 262

5-7 A jboss.xml stateless session configuration for HA-RMI/HTTP 264

5-8 An example of a complex container-configuration element from the server/default/conf/standardjboss.xml file. 269

5-9 An example of overriding the standardjboss.xml container stateless session beans configuration to enable secured access. 271

5-10 The org.jboss.ejb.ContainerPlugin interface 281

5-11 The org.jboss.ejb.Interceptor interface 282

5-12 The org.jboss.ejb.InstancePool interface 283

5-13 The org.jboss.ejb.InstanceCache interface 284

5-14 The org.jboss.ejb.EntityPersistenceManager interface 286

5-15 The org.jboss.ejb.EntityPersistanceStore interface 289

5-16 The org.jboss.ejb.StatefulSessionPersistenceManager interface 293

5-17 The "Standard CMP 2.x EntityBean" interceptor definition 296

5-18 The org.jboss.ejb.plugins.lock.BeanLockSupport deadlockDetection method 298

5-19 Marking an entity bean read-only using jboss.xml 301

5-20 Defining entity bean methods as read-only 301

5-21 An example of using the Instance Per Transaction policy. 302

5-22 The Instance Per Transaction configuration 303

6-1 A P2P JMS client example 308

6-2 A Pub-Sub JMS client example 311

6-3 A JMS publisher client 314

6-4 A JMS subscriber client 316

6-5 A durable topic JMS client example 319

6-6 A TextMessage processing MDB 322

6-7 The MDB ejb-jar.xml and jboss.xml descriptors 325

6-8 A JMS client that interacts with the TextMDB 326

6-9 ClientSocketFactory: The javax.net.SocketFactory implementation class name to use on the client. If not specified the default factory will be obtained from javax.net.SocketFactory.getDefault() . 341

6-10 An example UIL2 config fragment for using SSL 341

6-11 The default login-config.xml configuration for JBossMQ 345

6-12 An alternate login-config.xml configuration for JBossMQ 347

6-13 Default JDBC2 PeristenceManager SqlProperties 351

6-14 A sample JDBC2 PeristenceManager SqlProperties for Oracle 352

6-15 A JMSProviderLoader for accessing a remote JBossMQ server 359

6-16 A jboss.xml fragment for specifying the MDB JMS provider adaptor 359

6-17 A jms-ds.xml descriptor for integrating a JMS provider adaptor via JCA 360

7-1 The nontransactional file system resource adaptor deployment descriptor. 375

7-2 The notxfs-ds.xml resource adaptor MBeans service descriptor. 377

7-3 The stateless session bean echo method code which shows the access of the resource adaptor connection factory. 379

8-1 An example ejb-jar.xml and web.xml descriptor fragments which illustrate the security-role-ref element usage. 401

8-2 An example ejb-jar.xml descriptor fragment which illustrates the security-identity element usage. 402

8-3 An example ejb-jar.xml and web.xml descriptor fragments which illustrate the security-role element usage. 403

8-4 An example ejb-jar.xml descriptor fragment which illustrates the method-permission element usage. 405

8-5 A web.xml descriptor fragment which illustrates the use of the security-constraint and related elements. 408

8-6 An illustration of the steps of the authentication process from the application perspective. 412

8-7 The example 1 custom EchoSecurityProxy implementation that enforces the echo argument-based security constraint. 420

8-8 The jboss.xml descriptor which configures the EchoSecurityProxy as the custom security proxy for the EchoBean. 422

8-9 A sample login module configuration suitable for use with XMLLoginConfig 434

8-10 A JndiUserAndPass custom login module 455

8-11 The chap8-ex2 secured client access output 458

8-12 The chap8-ex2 server side behavior of the JndiUserAndPass 458

8-13 The chap8-ex2 security domain and login module configuration 459

8-14 The SRPVerifierStore interface 465

8-15 The chap8-ex3 jar contents 471

8-16 The chap8-ex3.sar jboss-service.xml descriptor for the SRP services 472

8-17 The chap8-ex3 client side and server side SRP login module configurations 472

8-18 The modifications to the Win32 run.bat start script to run JBoss with a Java 2 security manager. 475

8-19 The modifications to the UNIX/Linux run.sh start script to run JBoss with a Java 2 security manager. 475

8-20 A sample JaasSecurityDomain config for RMI/SSL 481

8-21 The jboss-service.xml and jboss.xml configurations to enable SSL with the example 4 stateless session bean. 482

9-1 A sample jboss-web.xml descriptor for mapping a war to the root context 493

9-2 Key methods of the AbstractWebContainer class. 493

9-3 A pseudo-code description of authenticating a user via the JBossSX API and the java:comp/env/security JNDI context. 500

9-4 A pseudo-code description of authorization a user via the JBossSX API and the java:comp/env/security JNDI context. 501

9-5 The JaasSecurityDoman and EmbeddedCatalinaSX MBean configurations for setting up Tomcat-4.x to use SSL as its primary connector protocol. 510

9-6 The JaasSecurityDoman and EmbeddedCatalinaSX MBean configurations for setting up Tomcat-4.x to use both non-SSL and SSL enabled HTTP connectors. 512

9-7 An EmbeddedCatalinaService41 MBean configurations for setting up Tomcat-4.1.x to use SSL enabled HTTP with the Coyote connector. 515

9-8 An example virtual host configuration. 519

9-9 An example jboss-web.xml descriptor for deploying a WAR to the www.starkinternational.com virtual host 520

9-10 An example configuration for including external static content 521

9-11 An example EmbeddedTomcatService MBean configuration that supports integration with Apache using the Ajpv13 protocol connector. 523

10-1 An example SystemPropertiesService jboss-service descriptor 528

10-2 An example Scheduler jboss-service descriptor 539

10-3 The Listing 10-2 ExSchedulable class code 540

11-1 The EJB 2.0 DOCTYPE Declaration 546

11-2 Entity Local Home Interface 557

11-3 Entity Local Interface 557

11-4 Entity Implementation Class 557

11-5 The ejb-jar.xml Entity Declaration 559

11-6 A sample jbosscmp-jdbc.xml Entity Mapping 560

11-7 Sample cmp-field abstract accessor declaration 564

11-8 The ejb-jar.xml cmp-field Declaration 564

11-9 The jbosscmp-jdbc.xml cmp-field Mapping 566

11-10 A sample jbosscmp-jdbc.xml cmp-field read-only declaration 568

11-11 A sample audit element declaration 569

11-12 The jbosscmp-jdbc.xml Dependent Value Class Declaration 571

11-13 Generated Column Names for ContactInfo Dependent Value Class 573

11-14 The jbosscmp-jdbc.xml cmp-field Dependent Value Class Property Override 574

11-15 Collection Valued cmr-field Abstract Accessor Declaration 576

11-16 Single Valued cmr-field Abstract Accessor Declaration 576

11-17 The ejb-jar.xml Relationship Declaration 576

11-18 The jbosscmp-jdbc.xml Relationship Mapping Template 579

11-19 Sample jboss.xml fragment illustrating insert-after-ejb-post-create 582

11-20 The jbosscmp-jdbc.xml Foreign Key Mapping 584

11-21 The jbosscmp-jdbc.xml Relation-table Mapping 585

11-22 Finder Declaration 588

11-23 ejbSelect Declaration 588

11-24 A sample ejb-jar.xml Query Declaration 588

11-25 The jbosscmp-jdbc.xml JBossQL Override 591

11-26 JBossQL SQL Mapping 592

11-27 A sample jboss-ql finder using LIMIT and OFFSET 592

11-28 DynamicQL Example Code 593

11-29 A sample jbosscmp-jdbc.xml DynamicQL Override 594

11-30 The jbosscmp-jdbc.xml DeclaredSQL Override 595

11-31 DeclaredSQL SQL Mapping 596

11-32 The jbosscmp-jdbc.xml DeclaredSQL Override With From Clause 596

11-33 The jbosscmp-jdbc.xml DeclaredSQL With From Clause SQL Mapping 597

11-34 The jbosscmp-jdbc.xml DeclaredSQL ejbSelect Override 597

11-35 The jbosscmp-jdbc.xml DeclaredSQL ejbSelect SQL Mapping 598

11-36 Custom Finder Example Code 599

11-37 Loading Scenario Example Code 600

11-38 Unoptimized findAll Query 601

11-39 Unoptimized Load Queries 601

11-40 The jbosscmp-jdbc.xml Load Group Declaration 602

11-41 on-find Optimized findAll Query 604

11-42 The jbosscmp-jdbc.xml on-find Declaration 605

11-43 on-load (Unoptimized) findAll Query 606

11-44 on-load Optimized Load Queries 606

11-45 The jbosscmp-jdbc.xml on-load Declaration 607

11-46 The jbosscmp-jdbc.xml none Declaration 608

11-47 The jboss.xml Commit Option Declaration 609

11-48 The jbosscmp-jdbc.xml Eager Load Declaration 610

11-49 The jbosscmp-jdbc.xml Lazy Load Group Declaration 611

11-50 Relationship Lazy Loading Example Code 612

11-51 The jbosscmp-jdbc.xml Relationship Lazy Loading Configuration 613

11-52 on-find Optimized findAll Query 614

11-53 on-find Optimized Relationship Load Queries 615

11-54 No Transaction Loading Example Code 616

11-55 No Transaction on-find Optimized findAll Query 616

11-56 No Transaction on-load Optimized Load Queries 617

11-57 User Transaction Example Code 618

11-58 The prototype optimistic locking entity container configuration 619

11-59 A sample jbosscmp-jdbc.xml descriptor illustrating the optimistic locking strategies 622

11-60 A sample autogenerated key config for a known pk cmp-field 629

11-61 A sample autogenerated key config for an uknown-pk 629

11-62 A sample jbosscmp-jdbc.xml defaults declaration 632

11-63 A sample short mapping for Oracle9i 638

11-64 The org.jboss.ejb.plugins.cmp.jdbc.Mapper interface 638

12-1 A HelloWorld EJB with XDoclet markup 642

12-2 The non-simple types used by the complexHello method 645

12-3 The xdoclet target definition 646

12-4 An Axis Client for the Hello EJB/Web Service 653

13-1 The GNU lesser general public license text 656