private byte [ ] createApplicationId ( String userDir , String serverName , String hostName ) { final boolean traceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "createApplicationId" , new Object [ ] { userDir , serverName , hostName } ) ; byte [ ] result ; try { // tWAS - Create a dummy IOR based on this host's IP address and server's port // tWAS - Note: the object must be remoteable, so use Current as an example. // tWAS - String s = CORBAUtils.getORB().object_to_string(CurrentImpl.instance()); // On Liberty concatenate the user directory, the server name and the host name. Then add in the time. String s = userDir + serverName + hostName + System . currentTimeMillis ( ) ; // Create a 20-byte hash value using a secure one-way hash function result = java . security . MessageDigest . getInstance ( "SHA" ) . digest ( s . getBytes ( ) ) ; } catch ( Throwable t ) { FFDCFilter . processException ( t , "com.ibm.ws.transaction.createApplicationId" , "608" , this ) ; String tempStr = "j" + ( System . currentTimeMillis ( ) % 9997 ) + ":" + userDir + hostName ; result = tempStr . getBytes ( ) ; } if ( traceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "createApplicationId" , Util . toHexString ( result ) ) ; return result ; }
Returns an application identifier key which can be used as a unique component within the global identifier and branch qualifier of an XID . This method is derived from tWAS