September 2010
Intermediate to advanced
766 pages
18h 35m
English
Following is a full listing of all source code used in this runnable example.
package org.jboss.ejb3.examples.ch05.encryption; import java.io.UnsupportedEncodingException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.security.spec.AlgorithmParameterSpec; import java.security.spec.KeySpec; import javax.annotation.PostConstruct; import javax.annotation.Resource; import javax.crypto.Cipher; import javax.crypto.SecretKey; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.PBEKeySpec; import javax.crypto.spec.PBEParameterSpec; import javax.ejb.Local; import javax.ejb.Remote; import javax.ejb.SessionContext; import javax.ejb.Stateless; import org.apache.commons.codec.binary.Base64; import org.jboss.logging.Logger; /** * Bean implementation class of the EncryptionEJB. Shows * how lifecycle callbacks are implemented (@PostConstruct), * and two ways of obtaining externalized environment * entries. * * @author <a href="mailto:alr@jboss.org">ALR</a> */ @Stateless(name = EncryptionBean.EJB_NAME) @Local(EncryptionLocalBusiness.class) @Remote(EncryptionRemoteBusiness.class) public class EncryptionBean implements EncryptionLocalBusiness, EncryptionRemote Business { // ---------------------------------------------------------------------------|| // Class Members -------------------------------------------------------------|| // ---------------------------------------------------------------------------|| ...