protected static byte [ ] getJ2EENameBytes ( byte [ ] bytes ) throws CSIException { // ****Important Note******: Much of this code was copied to com.ibm.ejs.oa.EJBOAKeyImpl.java // in ecutils and modified slightly. Changes to this code may also // require corresponding changes to that code. // boolean isHome = false ; byte [ ] j2eeNameBytes = null ; // Match up the header with the new format. If it does not match // then we have an incoming type 1 BeanId. for ( int i = 0 ; i < HEADER_LEN ; i ++ ) { if ( bytes [ i ] != header [ i ] ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Header mismatch, attempting to deserialize BeanId" ) ; // Should be rare that we get an old beanid throw new CSIException ( "Parser Error: header mismatch" ) ; } } // Make sure this is a valid bean type, and if so, then read the // Java EE Name bytes from the key bytes. switch ( bytes [ HEADER_LEN ] ) { case HOME_BEAN : isHome = true ; // LI2281-3 case STATEFUL_BEAN : case STATEFUL_BEAN + USES_BEAN_MANAGED_TX : case ENTITY_BEAN : case SINGLETON_BEAN : case SINGLETON_BEAN + USES_BEAN_MANAGED_TX : case STATELESS_BEAN : case STATELESS_BEAN + USES_BEAN_MANAGED_TX : case MESSAGEDRIVEN_BEAN : // d176974 case MESSAGEDRIVEN_BEAN + USES_BEAN_MANAGED_TX : // d176974 j2eeNameBytes = readJ2EENameBytes ( bytes ) ; break ; default : if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "Unable to parse bean id: unsupported EJB type: " + bytes [ HEADER_LEN ] ) ; throw new CSIException ( "Unsupported EJB Type: " + bytes [ HEADER_LEN ] ) ; } // For Home beans, the 'J2EEName' is for HomeOfHomes, and the // primary key is the real J2EEName... LI2281-3 if ( isHome ) { try { int pkeyIndex = HEADER_LEN + BEAN_TYPE_LEN + J2EE_NAME_LEN + j2eeNameBytes . length ; j2eeNameBytes = ( byte [ ] ) readPKey ( bytes , pkeyIndex , null ) ; } catch ( Throwable th ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "Unable to parse bean id: home j2eeName: " + th ) ; throw new CSIException ( "Unable to read j2eeName bytes" , th ) ; } } return j2eeNameBytes ; }
d145400 . 1