Appendix B. Stateless Session EJB: Encryption Example

Description

The stateless session bean is a fantastic implementation choice for business processes which require no server-side state to be retained in between client invocations. If all information needed to process a request can be found in the request itself, the SLSB may be used as a highly efficient endpoint. In this example we build an encryption service capable of performing both one-way hashing and encryption/decryption operations.

Additionally, we show here that SLSBs may indeed have their own internal state, so long as that it’s not leaked out to the client during requests. Finally, we introduce the use of XML via environment entries to externalize configurable elements of the service.

Get Enterprise JavaBeans 3.1, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.