private Serializable deserializeToRealObject ( ) throws IOException , ClassNotFoundException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "deserializeToRealObject" ) ; Serializable obj = null ; ObjectInputStream ois = null ; byte [ ] bytes = getDataFromPayload ( ) ; if ( bytes != null ) { try { ByteArrayInputStream bais = new ByteArrayInputStream ( bytes ) ; // Get the classloader, which may be the standard classloader or may be an application // classloader provided by WebSphere ClassLoader cl = AccessController . doPrivileged ( new PrivilegedAction < ClassLoader > ( ) { @ Override public ClassLoader run ( ) { return Thread . currentThread ( ) . getContextClassLoader ( ) ; } } ) ; ois = new DeserializationObjectInputStream ( bais , cl ) ; // Deserialize the object and set the local variables appropriately obj = ( Serializable ) ois . readObject ( ) ; hasRealObject = true ; hasSerializedRealObject = true ; softRefToRealObject = new SoftReference < Serializable > ( obj ) ; } catch ( IOException ioe ) { FFDCFilter . processException ( ioe , "com.ibm.ws.sib.mfp.impl.JsJmsObjectMessageImpl.deserializeToRealObject" , "340" ) ; throw ioe ; } catch ( ClassNotFoundException cnfe ) { FFDCFilter . processException ( cnfe , "com.ibm.ws.sib.mfp.impl.JsJmsObjectMessageImpl.deserializeToRealObject" , "345" ) ; throw cnfe ; } finally { try { if ( ois != null ) { ois . close ( ) ; } } catch ( IOException ex ) { // No FFDC code needed if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Exception closing the ObjectInputStream" , ex ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "deserializeToRealObject" , ( obj == null ? "null" : obj . getClass ( ) ) ) ; return obj ; }
Private method to deserialize the real object from the payload .