idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
164,300
public synchronized void putString ( String item ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "putString" , item ) ; checkValid ( ) ; if ( item == null ) { WsByteBuffer currentBuffer = getCurrentByteBuffer ( 3 ) ; currentBuffer . putShort ( ( short ) 1 ) ; currentBuffer . put ( new byte [ ] { ( byte ) 0 } ) ; } else { try { byte [ ] stringAsBytes = item . getBytes ( stringEncoding ) ; WsByteBuffer currentBuffer = getCurrentByteBuffer ( 2 + stringAsBytes . length ) ; currentBuffer . putShort ( ( short ) stringAsBytes . length ) ; currentBuffer . put ( stringAsBytes ) ; } catch ( UnsupportedEncodingException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".putString" , CommsConstants . COMMSBYTEBUFFER_PUTSTRING_01 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Unable to encode String: " , e ) ; SibTr . error ( tc , "UNSUPPORTED_STRING_ENCODING_SICO8005" , new Object [ ] { stringEncoding , e } ) ; throw new SIErrorException ( TraceNLS . getFormattedMessage ( CommsConstants . MSG_BUNDLE , "UNSUPPORTED_STRING_ENCODING_SICO8005" , new Object [ ] { stringEncoding , e } , null ) ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "putString" ) ; }
Puts a String into the byte buffer encoded in UTF8 .
164,301
public synchronized void putSIDestinationAddress ( SIDestinationAddress destAddr , short fapLevel ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "putSIDestinationAddress" , new Object [ ] { destAddr , Short . valueOf ( fapLevel ) } ) ; checkValid ( ) ; String destName = null ; String busName = null ; byte [ ] uuid = new byte [ 0 ] ; boolean localOnly = false ; if ( destAddr != null ) { destName = destAddr . getDestinationName ( ) ; busName = destAddr . getBusName ( ) ; if ( destAddr instanceof JsDestinationAddress ) { JsDestinationAddress jsDestAddr = ( JsDestinationAddress ) destAddr ; { if ( jsDestAddr . getME ( ) != null ) uuid = jsDestAddr . getME ( ) . toByteArray ( ) ; localOnly = jsDestAddr . isLocalOnly ( ) ; } } } putShort ( ( short ) uuid . length ) ; if ( uuid . length != 0 ) put ( uuid ) ; putString ( destName ) ; putString ( busName ) ; if ( fapLevel >= JFapChannelConstants . FAP_VERSION_9 ) { put ( localOnly ? CommsConstants . TRUE_BYTE : CommsConstants . FALSE_BYTE ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "putSIDestinationAddress" ) ; }
Puts an SIDestinationAddress into the byte buffer .
164,302
public synchronized void putSelectionCriteria ( SelectionCriteria criteria ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "putSelectionCriteria" , criteria ) ; checkValid ( ) ; String discriminator = null ; String selector = null ; short selectorDomain = ( short ) SelectorDomain . SIMESSAGE . toInt ( ) ; if ( criteria != null ) { discriminator = criteria . getDiscriminator ( ) ; selector = criteria . getSelectorString ( ) ; SelectorDomain selDomain = criteria . getSelectorDomain ( ) ; if ( selDomain != null ) { selectorDomain = ( short ) selDomain . toInt ( ) ; } } putShort ( selectorDomain ) ; putString ( discriminator ) ; putString ( selector ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "putSelectionCriteria" ) ; }
Puts a SelectionCriteria object into the byte buffer .
164,303
public synchronized void putXid ( Xid xid ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "putXid" , xid ) ; putInt ( xid . getFormatId ( ) ) ; putInt ( xid . getGlobalTransactionId ( ) . length ) ; put ( xid . getGlobalTransactionId ( ) ) ; putInt ( xid . getBranchQualifier ( ) . length ) ; put ( xid . getBranchQualifier ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "putXid" ) ; }
Puts an Xid into the Byte Buffer .
164,304
public synchronized void putSITransaction ( SITransaction transaction ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "putSITransaction" , transaction ) ; Transaction commsTx = ( Transaction ) transaction ; int flags = - 1 ; if ( transaction == null ) { putInt ( 0x00000000 ) ; } else { OptimizedTransaction optTx = null ; if ( transaction instanceof SuspendableXAResource ) { SIXAResource suspendableXARes = ( ( SuspendableXAResource ) transaction ) . getCurrentXAResource ( ) ; if ( suspendableXARes instanceof OptimizedTransaction ) { optTx = ( OptimizedTransaction ) suspendableXARes ; } } else if ( transaction instanceof OptimizedTransaction ) { optTx = ( OptimizedTransaction ) transaction ; } if ( optTx != null ) { flags = CommsConstants . OPTIMIZED_TX_FLAGS_TRANSACTED_BIT ; boolean local = optTx instanceof SIUncoordinatedTransaction ; boolean addXid = false ; boolean endPreviousUow = false ; if ( local ) { flags |= CommsConstants . OPTIMIZED_TX_FLAGS_LOCAL_BIT ; } if ( ! optTx . isServerTransactionCreated ( ) ) { flags |= CommsConstants . OPTIMIZED_TX_FLAGS_CREATE_BIT ; if ( local && optTx . areSubordinatesAllowed ( ) ) flags |= CommsConstants . OPTIMIZED_TX_FLAGS_SUBORDINATES_ALLOWED ; optTx . setServerTransactionCreated ( ) ; addXid = ! local ; } if ( addXid && ( optTx . isEndRequired ( ) ) ) { flags |= CommsConstants . OPTIMIZED_TX_END_PREVIOUS_BIT ; endPreviousUow = true ; } putInt ( flags ) ; putInt ( optTx . getCreatingConversationId ( ) ) ; putInt ( commsTx . getTransactionId ( ) ) ; if ( addXid ) { if ( endPreviousUow ) { putInt ( optTx . getEndFlags ( ) ) ; optTx . setEndNotRequired ( ) ; } putXid ( new XidProxy ( optTx . getXidForCurrentUow ( ) ) ) ; } } else { putInt ( commsTx . getTransactionId ( ) ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) ) { int commsId = - 1 ; if ( commsTx != null ) commsId = commsTx . getTransactionId ( ) ; CommsLightTrace . traceTransaction ( tc , "PutTxnTrace" , commsTx , commsId , flags ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "putSITransaction" ) ; }
Puts an SITransaction into the buffer
164,305
public int putMessgeWithoutEncode ( List < DataSlice > messageParts ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "putMessgeWithoutEncode" , messageParts ) ; int messageLength = 0 ; for ( int x = 0 ; x < messageParts . size ( ) ; x ++ ) { messageLength += messageParts . get ( x ) . getLength ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Message is " + messageLength + "byte(s) in length" ) ; putLong ( messageLength ) ; for ( int x = 0 ; x < messageParts . size ( ) ; x ++ ) { DataSlice messPart = messageParts . get ( x ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "DataSlice[" + x + "]: " + "Array: " + Arrays . toString ( messPart . getBytes ( ) ) + ", " + "Offset: " + messPart . getOffset ( ) + ", " + "Length: " + messPart . getLength ( ) ) ; wrap ( messPart . getBytes ( ) , messPart . getOffset ( ) , messPart . getLength ( ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "putMessgeWithoutEncode" , messageLength ) ; return messageLength ; }
This method is used to put a message into the buffer but assumes that the encode has already been completed . This may be in the case where we would like to send the message in chunks but we decide that the message would be better sent as an entire message .
164,306
public synchronized void putDataSlice ( DataSlice slice ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "putDataSlice" , slice ) ; putInt ( slice . getLength ( ) ) ; wrap ( slice . getBytes ( ) , slice . getOffset ( ) , slice . getLength ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "putDataSlice" ) ; }
This method is used to put a data slice into the buffer . A data slice is usually given to us by MFP as part of a message and this method can be used to add a single slice into the buffer so that the message can be sent in multiple transmissions . This is preferable to sending the message in one job lot because we can allocate the memory required in smaller chunks making life easier on the Java memory manager .
164,307
public synchronized void putSIMessageHandles ( SIMessageHandle [ ] siMsgHandles ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "putSIMessageHandles" , siMsgHandles ) ; putInt ( siMsgHandles . length ) ; for ( int handleIndex = 0 ; handleIndex < siMsgHandles . length ; ++ handleIndex ) { JsMessageHandle jsHandle = ( JsMessageHandle ) siMsgHandles [ handleIndex ] ; putLong ( jsHandle . getSystemMessageValue ( ) ) ; put ( jsHandle . getSystemMessageSourceUuid ( ) . toByteArray ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "message handle: " + siMsgHandles [ handleIndex ] ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "putSIMessageHandles" ) ; }
Puts the array of message handles into the buffer .
164,308
public synchronized void putException ( Throwable throwable , String probeId , Conversation conversation ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "putException" , new Object [ ] { throwable , probeId , conversation } ) ; Throwable currentException = throwable ; short numberOfExceptions = 0 ; while ( currentException != null ) { currentException = currentException . getCause ( ) ; numberOfExceptions ++ ; } currentException = throwable ; putShort ( numberOfExceptions ) ; while ( currentException != null ) { short exceptionId = getExceptionId ( currentException ) ; addException ( currentException , exceptionId , probeId ) ; currentException = currentException . getCause ( ) ; probeId = null ; } final HandshakeProperties handshakeProperties = conversation . getHandshakeProperties ( ) ; if ( ( handshakeProperties != null ) && ( ( CATHandshakeProperties ) handshakeProperties ) . isFapLevelKnown ( ) ) { final int fapLevel = ( ( CATHandshakeProperties ) handshakeProperties ) . getFapLevel ( ) ; if ( fapLevel >= JFapChannelConstants . FAP_VERSION_9 ) { int reason = Reasonable . DEFAULT_REASON ; String inserts [ ] = Reasonable . DEFAULT_INSERTS ; if ( throwable instanceof Reasonable ) { reason = ( ( Reasonable ) throwable ) . getExceptionReason ( ) ; inserts = ( ( Reasonable ) throwable ) . getExceptionInserts ( ) ; } else if ( throwable instanceof SIException ) { reason = ( ( SIException ) throwable ) . getExceptionReason ( ) ; inserts = ( ( SIException ) throwable ) . getExceptionInserts ( ) ; } else if ( throwable instanceof SIErrorException ) { reason = ( ( SIErrorException ) throwable ) . getExceptionReason ( ) ; inserts = ( ( SIErrorException ) throwable ) . getExceptionInserts ( ) ; } putInt ( reason ) ; putShort ( inserts . length ) ; for ( int i = 0 ; i < inserts . length ; ++ i ) { putString ( inserts [ i ] ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "putException" ) ; }
This method will fill a buffer list with WsByteBuffer s that when put together form a packet describing an exception and it s linked exceptions . It will traverse down the cause exceptions until one of them is null .
164,309
public synchronized String getString ( ) { checkReleased ( ) ; String returningString = null ; short stringLength = receivedBuffer . getShort ( ) ; byte [ ] stringBytes = new byte [ stringLength ] ; receivedBuffer . get ( stringBytes ) ; if ( stringLength == 1 && stringBytes [ 0 ] == 0 ) { } else { try { returningString = new String ( stringBytes , stringEncoding ) ; } catch ( UnsupportedEncodingException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".getString" , CommsConstants . COMMSBYTEBUFFER_GETSTRING_01 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , "Unable to encode String: " , e ) ; SibTr . exception ( tc , e ) ; } SibTr . error ( tc , "UNSUPPORTED_STRING_ENCODING_SICO8005" , new Object [ ] { stringEncoding , e } ) ; throw new SIErrorException ( TraceNLS . getFormattedMessage ( CommsConstants . MSG_BUNDLE , "UNSUPPORTED_STRING_ENCODING_SICO8005" , new Object [ ] { stringEncoding , e } , null ) ) ; } } return returningString ; }
Reads a String from the current position in the byte buffer .
164,310
public synchronized SIDestinationAddress getSIDestinationAddress ( short fapLevel ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getSIDestinationAddress" , Short . valueOf ( fapLevel ) ) ; checkReleased ( ) ; boolean isFromMediation = false ; short uuidLength = getShort ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Uuid length:" , "" + uuidLength ) ; SIBUuid8 uuid = null ; if ( uuidLength != 0 ) { if ( uuidLength == 1 ) { byte addressFlags = get ( ) ; if ( addressFlags == CommsConstants . DESTADDR_ISFROMMEDIATION ) { isFromMediation = true ; } } else { byte [ ] uuidBytes = get ( uuidLength ) ; uuid = new SIBUuid8 ( uuidBytes ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Uuid:" , uuid ) ; } } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Uuid was null" ) ; } String destinationName = getString ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Destination name:" , destinationName ) ; String busName = getString ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Bus name:" , busName ) ; boolean localOnly = false ; if ( fapLevel >= JFapChannelConstants . FAP_VERSION_9 ) { final byte localOnlyByte = get ( ) ; localOnly = ( localOnlyByte == CommsConstants . TRUE_BYTE ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "localOnly: " , localOnly ) ; JsDestinationAddress destAddress = null ; if ( uuid == null && destinationName == null && busName == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Both UUID, destination name and bus name were null" ) ; } else { { destAddress = ( ( JsDestinationAddressFactory ) JsDestinationAddressFactory . getInstance ( ) ) . createJsDestinationAddress ( destinationName , localOnly , uuid , busName ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getSIDestinationAddress" , destAddress ) ; return destAddress ; }
Reads an SIDestinationAddress from the current position in the byte buffer .
164,311
public synchronized SelectionCriteria getSelectionCriteria ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getSelectionCriteria" ) ; checkReleased ( ) ; SelectorDomain selectorDomain = SelectorDomain . getSelectorDomain ( getShort ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Selector domain" , selectorDomain ) ; String discriminator = getString ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Discriminator:" , discriminator ) ; String selector = getString ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Selector:" , selector ) ; SelectionCriteria selectionCriteria = CommsClientServiceFacade . getSelectionCriteriaFactory ( ) . createSelectionCriteria ( discriminator , selector , selectorDomain ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getSelectionCriteria" ) ; return selectionCriteria ; }
Reads a SelectionCriteria from the current position in the byte buffer .
164,312
public synchronized Xid getXid ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getXid" ) ; checkReleased ( ) ; int formatId = getInt ( ) ; int glidLength = getInt ( ) ; byte [ ] globalTransactionId = get ( glidLength ) ; int blqfLength = getInt ( ) ; byte [ ] branchQualifier = get ( blqfLength ) ; XidProxy xidProxy = new XidProxy ( formatId , globalTransactionId , branchQualifier ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getXid" , xidProxy ) ; return xidProxy ; }
Reads an Xid from the current position in the buffer .
164,313
public synchronized SIBusMessage getMessage ( CommsConnection commsConnection ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getMessage" ) ; checkReleased ( ) ; SIBusMessage mess = null ; int messageLen = ( int ) getLong ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Message length" , messageLen ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Remaining in buffer" , receivedBuffer . remaining ( ) ) ; if ( messageLen > - 1 ) { try { if ( receivedBuffer . hasArray ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Received buffer has a backing array" ) ; mess = JsMessageFactory . getInstance ( ) . createInboundJsMessage ( receivedBuffer . array ( ) , receivedBuffer . position ( ) + receivedBuffer . arrayOffset ( ) , messageLen , commsConnection ) ; receivedBuffer . position ( receivedBuffer . position ( ) + messageLen ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Received buffer does NOT have a backing array" ) ; byte [ ] messageArray = get ( messageLen ) ; mess = JsMessageFactory . getInstance ( ) . createInboundJsMessage ( messageArray , 0 , messageLen , commsConnection ) ; } } catch ( Exception e ) { FFDCFilter . processException ( e , CLASS_NAME + ".getMessage" , CommsConstants . COMMSBYTEBUFFER_GETMESSAGE_01 , this , new Object [ ] { "messageLen=" + messageLen + ", position=" + receivedBuffer . position ( ) + ", limit=" + receivedBuffer . limit ( ) + " " + ( receivedBuffer . hasArray ( ) ? "arrayOffset=" + receivedBuffer . arrayOffset ( ) + " array.length=" + receivedBuffer . array ( ) . length : "no backing array" ) } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( this , tc , "Unable to create message" , e ) ; dump ( this , tc , 100 ) ; } throw new SIResourceException ( e ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getMessage" , mess ) ; return mess ; }
Reads an SIBusMessage from the current position in the buffer .
164,314
public synchronized SIMessageHandle [ ] getSIMessageHandles ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getSIMessageHandles" ) ; int arrayCount = getInt ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "arrayCount" , arrayCount ) ; SIMessageHandle [ ] msgHandles = new SIMessageHandle [ arrayCount ] ; JsMessageHandleFactory jsMsgHandleFactory = JsMessageHandleFactory . getInstance ( ) ; for ( int msgHandleIndex = 0 ; msgHandleIndex < msgHandles . length ; ++ msgHandleIndex ) { long msgHandleValue = getLong ( ) ; byte [ ] msgHandleUuid = get ( 8 ) ; msgHandles [ msgHandleIndex ] = jsMsgHandleFactory . createJsMessageHandle ( new SIBUuid8 ( msgHandleUuid ) , msgHandleValue ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getSIMessageHandles" , msgHandles ) ; return msgHandles ; }
Reads some message handles from the buffer .
164,315
public synchronized int peekInt ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "peekInt" ) ; checkReleased ( ) ; int result = 0 ; if ( receivedBuffer != null ) { int currentPosition = receivedBuffer . position ( ) ; result = receivedBuffer . getInt ( ) ; receivedBuffer . position ( currentPosition ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "peekInt" , result ) ; return result ; }
This method will peek at the next 4 bytes in the buffer and return the result as an int . The buffer position will be unchanged by calling this method .
164,316
public synchronized long peekLong ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "peekLong" ) ; checkReleased ( ) ; long result = 0 ; if ( receivedBuffer != null ) { int currentPosition = receivedBuffer . position ( ) ; result = receivedBuffer . getLong ( ) ; receivedBuffer . position ( currentPosition ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "peekLong" , result ) ; return result ; }
This method will peek at the next 8 bytes in the buffer and return the result as a long . The buffer position will be unchanged by calling this method .
164,317
public synchronized void skip ( int lengthToSkip ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "skip" , lengthToSkip ) ; checkReleased ( ) ; if ( receivedBuffer != null ) { receivedBuffer . position ( receivedBuffer . position ( ) + lengthToSkip ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "skip" ) ; }
Skips over the specified number of bytes in the received byte buffer .
164,318
public synchronized void rewind ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "rewind" ) ; checkReleased ( ) ; if ( receivedBuffer != null ) { receivedBuffer . rewind ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "rewind" ) ; }
Rewinds the buffer to the beginning of the received data so that the data can be re - read .
164,319
public List < DataSlice > encodeFast ( AbstractMessage message , CommsConnection commsConnection , Conversation conversation ) throws MessageEncodeFailedException , SIConnectionDroppedException , IncorrectMessageTypeException , UnsupportedEncodingException , MessageCopyFailedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "encodeFast" , new Object [ ] { CommsLightTrace . msgToString ( message ) , commsConnection , CommsLightTrace . minimalToString ( conversation ) } ) ; if ( ! message . isControlMessage ( ) ) { short clientCapabilities = ( ( CATHandshakeProperties ) conversation . getHandshakeProperties ( ) ) . getCapabilites ( ) ; boolean requiresJMF = ( clientCapabilities & CommsConstants . CAPABILITIY_REQUIRES_JMF_ENCODING ) != 0 ; boolean requiresJMS = ( clientCapabilities & CommsConstants . CAPABILITIY_REQUIRES_JMS_MESSAGES ) != 0 ; if ( requiresJMF || requiresJMS ) { message = ( ( JsMessage ) message ) . makeInboundJmsMessage ( ) ; } if ( requiresJMF ) { message = ( ( JsMessage ) message ) . transcribeToJmf ( ) ; } } List < DataSlice > messageParts = null ; try { messageParts = message . encodeFast ( commsConnection ) ; } catch ( MessageEncodeFailedException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Caught a MessageEncodeFailedException from MFP:" , e ) ; if ( e . getCause ( ) != null ) { if ( e . getCause ( ) instanceof SIConnectionDroppedException ) { throw new SIConnectionDroppedException ( TraceNLS . getFormattedMessage ( CommsConstants . MSG_BUNDLE , "CONVERSATION_CLOSED_SICO0065" , null , null ) ) ; } else if ( e . getCause ( ) instanceof IllegalStateException ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "The linked exception IS an IllegalStateException" ) ; if ( conversation . isClosed ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "The conversation was closed - rethrowing as SIConnectionDroppedException" ) ; throw new SIConnectionDroppedException ( TraceNLS . getFormattedMessage ( CommsConstants . MSG_BUNDLE , "CONVERSATION_CLOSED_SICO0065" , null , null ) ) ; } } } throw e ; } if ( TraceComponent . isAnyTracingEnabled ( ) ) CommsLightTrace . traceMessageId ( tc , "EncodeMsgTrace" , message ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "encodeFast" , messageParts ) ; return messageParts ; }
This method actually does the fast encode on a JsMessage message .
164,320
public static int calculateEncodedStringLength ( String s ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "calculateEncodedStringLength" , s ) ; final int length ; if ( s == null ) { length = 3 ; } else { try { final byte [ ] stringAsBytes = s . getBytes ( stringEncoding ) ; length = stringAsBytes . length + 2 ; } catch ( UnsupportedEncodingException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".calculateEncodedStringLength" , CommsConstants . COMMSBYTEBUFFER_CALC_ENC_STRLEN_01 ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Unable to encode String: " , e ) ; SibTr . error ( tc , "UNSUPPORTED_STRING_ENCODING_SICO8023" , new Object [ ] { stringEncoding , e } ) ; throw new SIErrorException ( TraceNLS . getFormattedMessage ( CommsConstants . MSG_BUNDLE , "UNSUPPORTED_STRING_ENCODING_SICO8023" , new Object [ ] { stringEncoding , e } , null ) ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "calculateEncodedStringLength" , Integer . valueOf ( length ) ) ; return length ; }
Calculates the length in bytes of a String when it is placed inside a CommsByteBuffer via the putString method . A null String can be passed into this method .
164,321
public synchronized boolean getBoolean ( ) { final byte value = get ( ) ; if ( value == CommsConstants . TRUE_BYTE ) return true ; else if ( value == CommsConstants . FALSE_BYTE ) return false ; else throw new IllegalStateException ( "Unexpected byte: " + value ) ; }
Returns the next value in the buffer interpreted as a boolean . Should only be called when the next byte in the buffer was written by a call to putBoolean .
164,322
protected File assertDirectory ( String dirName , String locName ) { File d = new File ( dirName ) ; if ( d . isFile ( ) ) throw new LocationException ( "Path must reference a directory" , MessageFormat . format ( BootstrapConstants . messages . getString ( "error.specifiedLocation" ) , locName , d . getAbsolutePath ( ) ) ) ; return d ; }
Ensure that the given directory either does not yet exists or exists as a directory .
164,323
protected void substituteSymbols ( Map < String , String > initProps ) { for ( Entry < String , String > entry : initProps . entrySet ( ) ) { Object value = entry . getValue ( ) ; if ( value instanceof String ) { String strValue = ( String ) value ; Matcher m = SYMBOL_DEF . matcher ( strValue ) ; int i = 0 ; while ( m . find ( ) && i ++ < 4 ) { String symbol = m . group ( 1 ) ; Object expansion = initProps . get ( symbol ) ; if ( expansion != null && expansion instanceof String ) { strValue = strValue . replace ( m . group ( 0 ) , ( String ) expansion ) ; entry . setValue ( strValue ) ; } } } } }
Perform substitution of symbols used in config
164,324
public boolean checkCleanStart ( ) { String fwClean = get ( BootstrapConstants . INITPROP_OSGI_CLEAN ) ; if ( fwClean != null && fwClean . equals ( BootstrapConstants . OSGI_CLEAN_VALUE ) ) { return true ; } String osgiClean = get ( BootstrapConstants . OSGI_CLEAN ) ; return Boolean . valueOf ( osgiClean ) ; }
Check osgi clean start properties ensure set correctly for clean start
164,325
protected ReturnCode generateServerEnv ( boolean generatePassword ) { double jvmLevel ; String s = null ; try { s = AccessController . doPrivileged ( new java . security . PrivilegedExceptionAction < String > ( ) { public String run ( ) throws Exception { String javaSpecVersion = System . getProperty ( "java.specification.version" ) ; return javaSpecVersion ; } } ) ; jvmLevel = Double . parseDouble ( s ) ; } catch ( Exception ex ) { throw new LaunchException ( "Invalid java.specification.version, " + s , MessageFormat . format ( BootstrapConstants . messages . getString ( "error.create.unknownJavaLevel" ) , s ) , ex , ReturnCode . ERROR_BAD_JAVA_VERSION ) ; } BufferedWriter bw = null ; File serverEnv = getConfigFile ( "server.env" ) ; try { char [ ] keystorePass = PasswordGenerator . generateRandom ( ) ; String serverEnvContents = FileUtils . readFile ( serverEnv ) ; String toWrite = "" ; if ( generatePassword && ( serverEnvContents == null || ! serverEnvContents . contains ( "keystore_password=" ) ) ) { if ( serverEnvContents != null ) toWrite += System . getProperty ( "line.separator" ) ; toWrite += "keystore_password=" + new String ( keystorePass ) ; } if ( jvmLevel >= 1.8 && ( serverEnvContents == null || ! serverEnvContents . contains ( "WLP_SKIP_MAXPERMSIZE=" ) ) ) { if ( serverEnvContents != null || ! toWrite . isEmpty ( ) ) toWrite += System . getProperty ( "line.separator" ) ; toWrite += "WLP_SKIP_MAXPERMSIZE=true" ; } if ( serverEnvContents == null ) FileUtils . createFile ( serverEnv , new ByteArrayInputStream ( toWrite . getBytes ( "UTF-8" ) ) ) ; else FileUtils . appendFile ( serverEnv , new ByteArrayInputStream ( toWrite . getBytes ( "UTF-8" ) ) ) ; } catch ( IOException ex ) { throw new LaunchException ( "Failed to create/update the server.env file for this server" , MessageFormat . format ( BootstrapConstants . messages . getString ( "error.create.java8serverenv" ) , serverEnv . getAbsolutePath ( ) ) , ex , ReturnCode . LAUNCH_EXCEPTION ) ; } finally { if ( bw != null ) { try { bw . close ( ) ; } catch ( IOException ex ) { } } } return ReturnCode . OK ; }
For Java 8 and newer JVMs the PermGen command line parameter is no longer supported . This method checks the Java level and if it is less than Java 8 it simply returns OK . If it is Java 8 or higher this method will attempt to create a server . env file with
164,326
protected void setProbeListeners ( ProbeImpl probe , Collection < ProbeListener > listeners ) { Set < ProbeListener > enabled = enabledProbes . get ( probe ) ; if ( enabled == null ) { enabled = new HashSet < ProbeListener > ( ) ; enabledProbes . put ( probe , enabled ) ; } enabled . addAll ( listeners ) ; }
Associate a collection of listeners with the specified probe .
164,327
protected Set < ProbeListener > getProbeListeners ( ProbeImpl probe ) { Set < ProbeListener > listeners = enabledProbes . get ( probe ) ; if ( listeners == null ) { listeners = Collections . emptySet ( ) ; } return listeners ; }
Get the set of probe listeners that have been associated with the specified probe by this adapter .
164,328
protected void unbox ( final Type type ) { switch ( type . getSort ( ) ) { case Type . BOOLEAN : visitTypeInsn ( CHECKCAST , "java/lang/Boolean" ) ; visitMethodInsn ( INVOKEVIRTUAL , "java/lang/Boolean" , "booleanValue" , "()Z" , false ) ; break ; case Type . BYTE : visitTypeInsn ( CHECKCAST , "java/lang/Byte" ) ; visitMethodInsn ( INVOKEVIRTUAL , "java/lang/Byte" , "byteValue" , "()B" , false ) ; break ; case Type . CHAR : visitTypeInsn ( CHECKCAST , "java/lang/Character" ) ; visitMethodInsn ( INVOKEVIRTUAL , "java/lang/Character" , "charValue" , "()C" , false ) ; break ; case Type . DOUBLE : visitTypeInsn ( CHECKCAST , "java/lang/Double" ) ; visitMethodInsn ( INVOKEVIRTUAL , "java/lang/Double" , "doubleValue" , "()D" , false ) ; break ; case Type . FLOAT : visitTypeInsn ( CHECKCAST , "java/lang/Float" ) ; visitMethodInsn ( INVOKEVIRTUAL , "java/lang/Float" , "floatValue" , "()F" , false ) ; break ; case Type . INT : visitTypeInsn ( CHECKCAST , "java/lang/Integer" ) ; visitMethodInsn ( INVOKEVIRTUAL , "java/lang/Integer" , "intValue" , "()I" , false ) ; break ; case Type . LONG : visitTypeInsn ( CHECKCAST , "java/lang/Long" ) ; visitMethodInsn ( INVOKEVIRTUAL , "java/lang/Long" , "longValue" , "()J" , false ) ; break ; case Type . SHORT : visitTypeInsn ( CHECKCAST , "java/lang/Short" ) ; visitMethodInsn ( INVOKEVIRTUAL , "java/lang/Short" , "shortValue" , "()S" , false ) ; break ; case Type . ARRAY : case Type . OBJECT : visitTypeInsn ( CHECKCAST , type . getInternalName ( ) ) ; break ; default : break ; } }
Generate the instruction sequence needed to unbox the boxed data at the top of stack .
164,329
void replaceArgsWithArray ( String desc ) { Type [ ] methodArgs = Type . getArgumentTypes ( desc ) ; createObjectArray ( methodArgs . length ) ; for ( int i = methodArgs . length - 1 ; i >= 0 ; i -- ) { if ( methodArgs [ i ] . getSize ( ) == 2 ) { visitInsn ( DUP_X2 ) ; visitLdcInsn ( Integer . valueOf ( i ) ) ; visitInsn ( DUP2_X2 ) ; visitInsn ( POP2 ) ; } else { visitInsn ( DUP_X1 ) ; visitInsn ( SWAP ) ; visitLdcInsn ( Integer . valueOf ( i ) ) ; visitInsn ( SWAP ) ; } box ( methodArgs [ i ] ) ; visitInsn ( AASTORE ) ; } }
Create an object array and store the target method arguments in it .
164,330
void restoreArgsFromArray ( String desc ) { Type [ ] methodArgs = Type . getArgumentTypes ( desc ) ; for ( int i = 0 ; i < methodArgs . length ; i ++ ) { visitInsn ( DUP ) ; visitLdcInsn ( Integer . valueOf ( i ) ) ; visitInsn ( AALOAD ) ; unbox ( methodArgs [ i ] ) ; if ( methodArgs [ i ] . getSize ( ) == 2 ) { visitInsn ( DUP2_X1 ) ; visitInsn ( POP2 ) ; } else { visitInsn ( SWAP ) ; } } visitInsn ( POP ) ; }
Recreate the parameter list for the target method from an Object array containing the data .
164,331
protected void setProbeInProgress ( boolean inProgress ) { if ( inProgress && ! this . probeInProgress ) { this . probeInProgress = true ; if ( this . probeMethodAdapter != null ) { this . mv = this . visitor ; } } else if ( ! inProgress && this . probeInProgress ) { this . probeInProgress = false ; this . mv = probeMethodAdapter != null ? probeMethodAdapter : this . visitor ; } }
Called by the project injection adapter to indicate that the probe instruction stream is being injected . This is used to change the target of the chain to skip other probe related adapters .
164,332
public void setTargetSignificance ( String targetSignificance ) { if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( this , TRACE , "setTargetSignificance" , targetSignificance ) ; } _targetSignificance = targetSignificance ; }
Set the target significance property .
164,333
public void setTargetTransportChain ( String targetTransportChain ) { if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( this , TRACE , "setTargetTransportChain" , targetTransportChain ) ; } _targetTransportChain = targetTransportChain ; }
Set the target transport chain property .
164,334
public void setUseServerSubject ( Boolean useServerSubject ) { if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( this , TRACE , "setUseServerSubject" , useServerSubject ) ; } _useServerSubject = useServerSubject ; }
Set the useServerSubject property .
164,335
public void setRetryInterval ( String retryInterval ) { _retryInterval = ( retryInterval == null ? null : Integer . valueOf ( retryInterval ) ) ; }
Sets the retry interval
164,336
static PortComponent getPortComponentByEJBLink ( String ejbLink , Adaptable containerToAdapt ) throws UnableToAdaptException { return getHighLevelElementByServiceImplBean ( ejbLink , containerToAdapt , PortComponent . class , LinkType . EJB ) ; }
Get the PortComponent by ejb - link .
164,337
static PortComponent getPortComponentByServletLink ( String servletLink , Adaptable containerToAdapt ) throws UnableToAdaptException { return getHighLevelElementByServiceImplBean ( servletLink , containerToAdapt , PortComponent . class , LinkType . SERVLET ) ; }
Get the PortComponent by servlet - link .
164,338
static WebserviceDescription getWebserviceDescriptionByEJBLink ( String ejbLink , Adaptable containerToAdapt ) throws UnableToAdaptException { return getHighLevelElementByServiceImplBean ( ejbLink , containerToAdapt , WebserviceDescription . class , LinkType . EJB ) ; }
Get the WebserviceDescription by ejb - link .
164,339
static WebserviceDescription getWebserviceDescriptionByServletLink ( String servletLink , Adaptable containerToAdapt ) throws UnableToAdaptException { return getHighLevelElementByServiceImplBean ( servletLink , containerToAdapt , WebserviceDescription . class , LinkType . SERVLET ) ; }
Get the WebserviceDescription by servlet - link .
164,340
@ SuppressWarnings ( "unchecked" ) private static < T > T getHighLevelElementByServiceImplBean ( String portLink , Adaptable containerToAdapt , Class < T > clazz , LinkType linkType ) throws UnableToAdaptException { if ( null == portLink ) { return null ; } if ( PortComponent . class . isAssignableFrom ( clazz ) || WebserviceDescription . class . isAssignableFrom ( clazz ) ) { Webservices wsXml = containerToAdapt . adapt ( Webservices . class ) ; if ( null == wsXml ) { return null ; } for ( WebserviceDescription wsDes : wsXml . getWebServiceDescriptions ( ) ) { if ( wsDes . getPortComponents ( ) . size ( ) == 0 ) { continue ; } for ( PortComponent portCmpt : wsDes . getPortComponents ( ) ) { ServiceImplBean servImplBean = portCmpt . getServiceImplBean ( ) ; String serviceLink = LinkType . SERVLET == linkType ? servImplBean . getServletLink ( ) : servImplBean . getEJBLink ( ) ; if ( serviceLink == null ) { continue ; } else if ( serviceLink . equals ( portLink ) ) { if ( PortComponent . class . isAssignableFrom ( clazz ) ) { return ( T ) portCmpt ; } else { return ( T ) wsDes ; } } } } return null ; } return null ; }
For internal usage . Can only process the PortComponent . class and WebserviceDescription . class .
164,341
public long getCompletionTime ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getCompletionTime" ) ; long completionTime = - 1 ; long timeOut = getTimeout ( ) ; if ( timeOut != SIMPConstants . INFINITE_TIMEOUT ) { completionTime = getIssueTime ( ) + timeOut ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getCompletionTime" , new Long ( completionTime ) ) ; return completionTime ; }
Return the completion time for this request . - 1 means infinite
164,342
protected synchronized void deactivate ( ComponentContext context ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Unregistering JNDIEntry " + serviceRegistration ) ; } if ( this . serviceRegistration != null ) { this . serviceRegistration . unregister ( ) ; } }
Unregisters a service if one was registered
164,343
public static UserProfile getUserProfile ( ) { UserProfile userProfile = null ; Subject subject = getSubject ( ) ; Iterator < UserProfile > userProfilesIterator = subject . getPrivateCredentials ( UserProfile . class ) . iterator ( ) ; if ( userProfilesIterator . hasNext ( ) ) { userProfile = userProfilesIterator . next ( ) ; } return userProfile ; }
Get UserProfile for the subject on the thread .
164,344
public void dispatchAsynchException ( ProxyQueue proxyQueue , Exception exception ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "dispatchAsynchException" , new Object [ ] { proxyQueue , exception } ) ; AsynchExceptionThread thread = new AsynchExceptionThread ( proxyQueue , exception ) ; dispatchThread ( thread ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "dispatchAsynchException" ) ; }
Dispatches the exception to the relevant proxy queue .
164,345
public void dispatchAsynchEvent ( short eventId , Conversation conversation ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "dispatchAsynchEvent" , new Object [ ] { "" + eventId , conversation } ) ; AsynchEventThread thread = new AsynchEventThread ( eventId , conversation ) ; dispatchThread ( thread ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "dispatchAsynchEvent" ) ; }
Dispatches the data to be sent to the connection event listeners on a thread .
164,346
public void dispatchCommsException ( SICoreConnection conn , ProxyQueueConversationGroup proxyQueueConversationGroup , SIConnectionLostException exception ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "dispatchCommsException" ) ; CommsExceptionThread thread = new CommsExceptionThread ( conn , proxyQueueConversationGroup , exception ) ; dispatchThread ( thread ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "dispatchCommsException" ) ; }
Dispatches the exception to be sent to the connection event listeners on a thread .
164,347
public void dispatchDestinationListenerEvent ( SICoreConnection conn , SIDestinationAddress destinationAddress , DestinationAvailability destinationAvailability , DestinationListener destinationListener ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "dispatchDestinationListenerEvent" , new Object [ ] { conn , destinationAddress , destinationAvailability , destinationListener } ) ; final DestinationListenerThread thread = new DestinationListenerThread ( conn , destinationAddress , destinationAvailability , destinationListener ) ; dispatchThread ( thread ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "dispatchDestinationListenerEvent" ) ; }
Dispatches a thread which will call the destinationAvailable method on the destinationListener passing in the supplied parameters .
164,348
public void dispatchConsumerSetChangeCallbackEvent ( ConsumerSetChangeCallback consumerSetChangeCallback , boolean isEmpty ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "dispatchConsumerSetChangeCallbackEvent" , new Object [ ] { consumerSetChangeCallback , isEmpty } ) ; final ConsumerSetChangeCallbackThread thread = new ConsumerSetChangeCallbackThread ( consumerSetChangeCallback , isEmpty ) ; dispatchThread ( thread ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "dispatchConsumerSetChangeCallbackEvent" ) ; }
Dispatches a thread which will call the consumerSetChange method on the ConsumerSetChangeCallback passing in the supplied parameters .
164,349
public void dispatchStoppableConsumerSessionStopped ( ConsumerSessionProxy consumerSessionProxy ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "dispatchStoppableConsumerSessionStopped" , consumerSessionProxy ) ; final StoppableAsynchConsumerCallbackThread thread = new StoppableAsynchConsumerCallbackThread ( consumerSessionProxy ) ; dispatchThread ( thread ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "dispatchStoppableConsumerSessionStopped" ) ; }
Dispatches a thread which will call the stoppableConsumerSessionStopped method on consumerSessionProxy .
164,350
private void dispatchThread ( Runnable runnable ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "dispatchThread" ) ; try { threadPool . execute ( runnable ) ; } catch ( InterruptedException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Thread was interrupted" , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "dispatchThread" ) ; }
Actually dispatches the thread .
164,351
private static void invokeCallback ( SICoreConnection conn , ConsumerSession session , Exception exception , int eventId ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "invokeCallback" , new Object [ ] { conn , session , exception , eventId } ) ; if ( conn != null ) { try { final AsyncCallbackSynchronizer asyncCallbackSynchronizer = ( ( ConnectionProxy ) conn ) . getAsyncCallbackSynchronizer ( ) ; SICoreConnectionListener [ ] myListeners = conn . getConnectionListeners ( ) ; for ( int x = 0 ; x < myListeners . length ; x ++ ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Invoking callback on: " + myListeners [ x ] ) ; asyncCallbackSynchronizer . enterAsyncExceptionCallback ( ) ; try { switch ( eventId ) { case ( 0x0000 ) : myListeners [ x ] . commsFailure ( conn , ( SIConnectionLostException ) exception ) ; break ; case ( CommsConstants . EVENTID_ME_QUIESCING ) : myListeners [ x ] . meQuiescing ( conn ) ; break ; case ( CommsConstants . EVENTID_ME_TERMINATED ) : myListeners [ x ] . meTerminated ( conn ) ; break ; case ( CommsConstants . EVENTID_ASYNC_EXCEPTION ) : myListeners [ x ] . asynchronousException ( session , exception ) ; break ; default : if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Invalid event ID: " + eventId ) ; break ; } } catch ( Exception e ) { FFDCFilter . processException ( e , CLASS_NAME + ".invokeCallback" , CommsConstants . CLIENTASYNCHEVENTTHREADPOOL_INVOKE_01 , new Object [ ] { myListeners [ x ] , conn , session , exception , "" + eventId } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Caught an exception from the callback" , e ) ; } finally { asyncCallbackSynchronizer . exitAsyncExceptionCallback ( ) ; } } } catch ( SIException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Unable to get connection listeners" , e ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "invokeCallback" ) ; }
This method will send a message to the connection listeners associated with this connection .
164,352
public static String getHeader ( HttpServletRequest req , String key ) { HttpServletRequest sr = getWrappedServletRequestObject ( req ) ; return sr . getHeader ( key ) ; }
Obtain the value of the specified header .
164,353
public void destroy ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "destroy" ) ; if ( _resourceCallback != null ) _resourceCallback . destroy ( ) ; _wrappers . remove ( _transaction . getGlobalId ( ) ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "destroy" ) ; }
as another server tried to rollback the transaction .
164,354
protected void close ( ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "close" ) ; if ( flushHelper != null ) flushHelper . shutdown ( ) ; if ( notifyHelper != null ) notifyHelper . shutdown ( ) ; logFile = null ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "close" ) ; }
Prohibits further operations on the LogFile .
164,355
private void setFileSpaceLeft ( ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "setFileSpaceLeft" , new Object [ ] { new Long ( fileLogHeader . fileSize ) , new Long ( fileLogHeader . startByteAddress ) , new Long ( filePosition ) } ) ; long newFileSpaceLeft = fileLogHeader . startByteAddress - filePosition ; if ( newFileSpaceLeft <= 0 ) newFileSpaceLeft = newFileSpaceLeft + fileLogHeader . fileSize - FileLogHeader . headerLength * 2 ; fileSpaceLeft = newFileSpaceLeft ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "setFileSpaceLeft" , new Object [ ] { new Long ( fileSpaceLeft ) } ) ; }
Sets the amount of space still left in the log file .
164,356
final void flush ( ) throws ObjectManagerException { final String methodName = "flush" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName ) ; int startPage = 0 ; LogBuffer flushLogBuffer = null ; synchronized ( logBufferLock ) { startPage = lastPageFilling ; flushLogBuffer = logBuffer ; flushLogBuffer . pageWaiterExists [ startPage ] = true ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isDebugEnabled ( ) ) trace . debug ( this , cclass , methodName , new Object [ ] { "logBuffer_flushing" , new Integer ( startPage ) , new Integer ( firstPageFilling ) , new Integer ( lastPageFilling ) , new Integer ( flushLogBuffer . pageWritersActive . get ( startPage ) ) } ) ; } flushLogBuffer . waitForFlush ( startPage ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName ) ; }
Writes buffered output to hardened storage . By the time this method returns all of the data in the logBuffer must have been written to the disk . We mark the last page as having a thread waiting . If there are no threads currently writing to any page we wake the flushHelper otherwise we let the writers wake the flushHelper if it is stalled . Blocks until the write to disk has completed .
164,357
protected void reserve ( long reservedDelta ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "reserve" , new Object [ ] { new Long ( reservedDelta ) } ) ; long unavailable = reserveLogFileSpace ( reservedDelta ) ; if ( unavailable != 0 ) { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "reserve" , new Object [ ] { "via LogFileFullException" , new Long ( unavailable ) , new Long ( reservedDelta ) } ) ; throw new LogFileFullException ( this , reservedDelta , reservedDelta , reservedDelta - unavailable ) ; } if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "reserve" ) ; }
Reserve space in the log file . We don t have to account for sector bytes because those were reserved at startup .
164,358
private long reserveLogFileSpace ( long reservedDelta ) { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "reserveLogFileSpace" , new Object [ ] { new Long ( reservedDelta ) } ) ; long stillToReserve = reservedDelta ; int index = new java . util . Random ( Thread . currentThread ( ) . hashCode ( ) ) . nextInt ( fileSpaceAvailable . length ) ; int startIndex = index ; while ( stillToReserve != 0 ) { synchronized ( fileSpaceAvailableLock [ index ] ) { if ( stillToReserve <= fileSpaceAvailable [ index ] ) { fileSpaceAvailable [ index ] = fileSpaceAvailable [ index ] - stillToReserve ; stillToReserve = 0 ; } else { stillToReserve = stillToReserve - fileSpaceAvailable [ index ] ; fileSpaceAvailable [ index ] = 0 ; index ++ ; if ( index == fileSpaceAvailable . length ) index = 0 ; if ( index == startIndex ) break ; } } } if ( stillToReserve != 0 ) { long giveBack = reservedDelta - stillToReserve ; for ( int i = 0 ; i < fileSpaceAvailable . length ; i ++ ) { synchronized ( fileSpaceAvailableLock [ i ] ) { fileSpaceAvailable [ i ] = fileSpaceAvailable [ i ] + giveBack / fileSpaceAvailable . length ; if ( i == startIndex ) fileSpaceAvailable [ i ] = fileSpaceAvailable [ i ] + giveBack % fileSpaceAvailable . length ; } } } if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "reserveLogFileSpace" , new Object [ ] { new Long ( stillToReserve ) , new Integer ( startIndex ) } ) ; return stillToReserve ; }
Reserve space in the log file . If the required space is not available then no space is acllocated in the log file . The space of freed when the log file is truncated .
164,359
private long paddingReserveLogSpace ( long spaceToReserve ) throws ObjectManagerException { if ( trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "paddingReserveLogSpace" , new Object [ ] { new Long ( spaceToReserve ) } ) ; synchronized ( paddingSpaceLock ) { paddingSpaceAvailable -= spaceToReserve ; if ( spaceToReserve > 0 ) { if ( paddingSpaceAvailable < 0 ) { NegativePaddingSpaceException exception = new NegativePaddingSpaceException ( this , paddingSpaceAvailable ) ; ObjectManager . ffdc . processException ( this , cclass , "paddingReserveLogSpace" , exception , "1:1088:1.52" ) ; spaceToReserve = - paddingSpaceAvailable ; paddingSpaceAvailable = 0 ; } else { spaceToReserve = 0 ; } } else { if ( paddingSpaceAvailable > PADDING_SPACE_TARGET ) { spaceToReserve = PADDING_SPACE_TARGET - paddingSpaceAvailable ; paddingSpaceAvailable = PADDING_SPACE_TARGET ; } else { spaceToReserve = 0 ; } } } if ( spaceToReserve != 0 ) { reserve ( spaceToReserve ) ; } if ( trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "paddingReserveLogSpace" , new Object [ ] { new Long ( spaceToReserve ) } ) ; return spaceToReserve ; }
Reserve or unreserve log space but keep back an amount used for padding . This method is used to ensure there is always enough padding space by keeping back space returned by add delete and replace operations committing or backing out which was reserved up front . This never fails . It gives space even if not available .
164,360
protected final long writeNext ( LogRecord logRecord , long reservedDelta , boolean checkSpace , boolean flush ) throws ObjectManagerException { long logSequenceNumber = addLogRecord ( logRecord , reservedDelta , false , checkSpace , flush ) ; return logSequenceNumber ; }
Copy a LogRecord into the LogBuffer ready to write to end of the LogFile .
164,361
protected final long markAndWriteNext ( LogRecord logRecord , long reservedDelta , boolean checkSpace , boolean flush ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "markAndWriteNext" , new Object [ ] { logRecord , new Long ( reservedDelta ) , new Boolean ( checkSpace ) , new Boolean ( flush ) } ) ; long logSequenceNumber ; synchronized ( fileMarkLock ) { logSequenceNumber = addLogRecord ( logRecord , reservedDelta , true , checkSpace , flush ) ; } if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "markAndWriteNext" , new Object [ ] { new Long ( logSequenceNumber ) , new Long ( fileMark ) } ) ; return logSequenceNumber ; }
Includes a LogRecord in a FlushSet for writing to end of the LogFile as with writeNext but also sets the truncation mark to immediately befrore the written logRecord .
164,362
private int addPart ( LogRecord logRecord , byte [ ] fillingBuffer , boolean completed , int offset , int partLength ) throws ObjectManagerException { final String methodName = "addPart" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName , new Object [ ] { logRecord , fillingBuffer , new Boolean ( completed ) , new Integer ( offset ) , new Integer ( partLength ) } ) ; byte [ ] partHeader = new byte [ partHeaderLength ] ; if ( completed ) partHeader [ 0 ] = PART_Last ; else if ( logRecord . atStart ( ) ) partHeader [ 0 ] = PART_First ; else partHeader [ 0 ] = PART_Middle ; partHeader [ 1 ] = logRecord . multiPartID ; partHeader [ 2 ] = ( byte ) ( partLength >>> 8 ) ; partHeader [ 3 ] = ( byte ) ( partLength >>> 0 ) ; int remainder = pageSize - offset % pageSize ; int length = Math . min ( remainder , partHeaderLength ) ; System . arraycopy ( partHeader , 0 , fillingBuffer , offset , length ) ; offset = offset + length ; if ( remainder <= partHeaderLength ) offset ++ ; if ( offset >= fillingBuffer . length ) { fillingBuffer = logBuffer . buffer ; offset = 1 ; } if ( length < partHeaderLength ) { System . arraycopy ( partHeader , length , fillingBuffer , offset , partHeaderLength - length ) ; offset = offset + partHeaderLength - length ; } int bytesToAdd = Math . min ( pageSize - ( offset % pageSize ) , partLength ) ; for ( ; ; ) { if ( offset >= fillingBuffer . length ) { fillingBuffer = logBuffer . buffer ; offset = 1 ; } offset = logRecord . fillBuffer ( fillingBuffer , offset , bytesToAdd ) ; partLength = partLength - bytesToAdd ; if ( partLength == 0 ) break ; bytesToAdd = Math . min ( pageSize - 1 , partLength ) ; offset ++ ; } if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName , new Object [ ] { new Integer ( offset ) } ) ; return offset ; }
Add the partHeader before the logRecord and then the part of the logRecord . If necessary wrap round the end of the log buffer back to the start .
164,363
public void cancel ( ) { synchronized ( ivCancelLock ) { ivIsCanceled = true ; if ( ivScheduledFuture != null ) ivScheduledFuture . cancel ( false ) ; ivCache = null ; ivElements = null ; } }
Cancel the Scheduled Future object
164,364
protected void renderTextAreaValue ( FacesContext facesContext , UIComponent uiComponent ) throws IOException { ResponseWriter writer = facesContext . getResponseWriter ( ) ; Object addNewLineAtStart = uiComponent . getAttributes ( ) . get ( ADD_NEW_LINE_AT_START_ATTR ) ; if ( addNewLineAtStart != null ) { boolean addNewLineAtStartBoolean = false ; if ( addNewLineAtStart instanceof String ) { addNewLineAtStartBoolean = Boolean . valueOf ( ( String ) addNewLineAtStart ) ; } else if ( addNewLineAtStart instanceof Boolean ) { addNewLineAtStartBoolean = ( Boolean ) addNewLineAtStart ; } if ( addNewLineAtStartBoolean ) { writer . writeText ( "\n" , null ) ; } } String strValue = org . apache . myfaces . shared . renderkit . RendererUtils . getStringValue ( facesContext , uiComponent ) ; if ( strValue != null ) { writer . writeText ( strValue , org . apache . myfaces . shared . renderkit . JSFAttr . VALUE_ATTR ) ; } }
Subclasses can override the writing of the text value of the textarea
164,365
public final void put ( long priority , Object value ) { PriorityQueueNode node = new PriorityQueueNode ( priority , value ) ; if ( size == elements . length ) { PriorityQueueNode [ ] tmp = new PriorityQueueNode [ 2 * size ] ; System . arraycopy ( elements , 0 , tmp , 0 , size ) ; elements = tmp ; } int pos = size ++ ; setElement ( node , pos ) ; moveUp ( pos ) ; }
Insert data with the given priority into the heap and heapify .
164,366
protected void moveUp ( int pos ) { PriorityQueueNode node = elements [ pos ] ; long priority = node . priority ; while ( ( pos > 0 ) && ( elements [ parent ( pos ) ] . priority > priority ) ) { setElement ( elements [ parent ( pos ) ] , pos ) ; pos = parent ( pos ) ; } setElement ( node , pos ) ; }
Advance a node in the queue based on its priority .
164,367
public final Object getMin ( ) throws NoSuchElementException { PriorityQueueNode max = null ; if ( size == 0 ) throw new NoSuchElementException ( ) ; max = elements [ 0 ] ; setElement ( elements [ -- size ] , 0 ) ; heapify ( 0 ) ; return max . value ; }
Dequeue the highest priority element from the queue .
164,368
protected final void setElement ( PriorityQueueNode node , int pos ) { elements [ pos ] = node ; node . pos = pos ; }
Set an element in the queue .
164,369
protected void heapify ( int position ) { int i = - 1 ; int l ; int r ; int smallest = position ; while ( smallest != i ) { i = smallest ; l = left ( i ) ; r = right ( i ) ; if ( ( l < size ) && ( elements [ l ] . priority < elements [ i ] . priority ) ) smallest = l ; else smallest = i ; if ( ( r < size ) && ( elements [ r ] . priority < elements [ smallest ] . priority ) ) smallest = r ; if ( smallest != i ) { PriorityQueueNode tmp = elements [ smallest ] ; setElement ( elements [ i ] , smallest ) ; setElement ( tmp , i ) ; } } }
Reheap the queue .
164,370
public static void setJPAComponent ( JPAComponent instance ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "setJPAComponent" , instance ) ; jpaComponent = instance ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "setJPAComponent" ) ; }
Return the default JPAComponent object in the application server .
164,371
public Tag decorate ( Tag tag ) { Tag t = null ; for ( int i = 0 ; i < this . decorators . length ; i ++ ) { t = this . decorators [ i ] . decorate ( tag ) ; if ( t != null ) { return t ; } } return tag ; }
Uses the chain of responsibility pattern to stop processing if any of the TagDecorators return a value other than null .
164,372
protected PriorityConverterMap getConverters ( ) { PriorityConverterMap allConverters = new PriorityConverterMap ( ) ; if ( addDefaultConvertersFlag ( ) ) { allConverters . addAll ( getDefaultConverters ( ) ) ; } if ( addDiscoveredConvertersFlag ( ) ) { allConverters . addAll ( DefaultConverters . getDiscoveredConverters ( getClassLoader ( ) ) ) ; } allConverters . addAll ( userConverters ) ; allConverters . setUnmodifiable ( ) ; return allConverters ; }
Get the converters default discovered and user registered converters are included as appropriate .
164,373
JsMessagingEngine [ ] getMEsToCheck ( ) { final String methodName = "getMEsToCheck" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName ) ; } JsMessagingEngine [ ] retVal = SibRaEngineComponent . getMessagingEngines ( _endpointConfiguration . getBusName ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName , retVal ) ; } return retVal ; }
All Messaging engines including those that are not running should be considered part of the list that the MDB should look at before trying a remote connection .
164,374
JsMessagingEngine [ ] removeStoppedMEs ( JsMessagingEngine [ ] MEList ) { final String methodName = "removeStoppedMEs" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName , MEList ) ; } JsMessagingEngine [ ] startedMEs = SibRaEngineComponent . getActiveMessagingEngines ( _endpointConfiguration . getBusName ( ) ) ; List < JsMessagingEngine > runningMEs = Arrays . asList ( startedMEs ) ; List < JsMessagingEngine > newList = new ArrayList < JsMessagingEngine > ( ) ; for ( int i = 0 ; i < MEList . length ; i ++ ) { JsMessagingEngine nextME = MEList [ i ] ; if ( runningMEs . contains ( nextME ) ) { newList . add ( nextME ) ; } } JsMessagingEngine [ ] retVal = new JsMessagingEngine [ newList . size ( ) ] ; retVal = newList . toArray ( retVal ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName , retVal ) ; } return retVal ; }
This method will remove non running MEs from the supplied array of MEs
164,375
public void messagingEngineDestroyed ( JsMessagingEngine messagingEngine ) { final String methodName = "messagingEngineDestroyed" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName , messagingEngine ) ; } final JsMessagingEngine [ ] localMessagingEngines = SibRaEngineComponent . getMessagingEngines ( _endpointConfiguration . getBusName ( ) ) ; if ( 0 == localMessagingEngines . length ) { SibTr . info ( TRACE , "ME_DESTROYED_CWSIV0779" , new Object [ ] { messagingEngine . getName ( ) , _endpointConfiguration . getBusName ( ) } ) ; try { clearTimer ( ) ; timerLoop ( ) ; } catch ( final ResourceException exception ) { FFDCFilter . processException ( exception , CLASS_NAME + "." + methodName , FFDC_PROBE_1 , this ) ; SibTr . error ( TRACE , "MESSAGING_ENGINE_STOPPING_CWSIV0765" , new Object [ ] { exception , messagingEngine . getName ( ) , messagingEngine . getBusName ( ) } ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName ) ; } }
If a messaging engine is destroyed and there are now no local messaging engines on the server then kick off a check to see if we can connect to one .
164,376
public RemoteListCache getCache ( ) { RemoteRepositoryCache logCache = getLogResult ( ) == null ? null : getLogResult ( ) . getCache ( ) ; RemoteRepositoryCache traceCache = getTraceResult ( ) == null ? null : getTraceResult ( ) . getCache ( ) ; return switched ? new RemoteListCacheImpl ( traceCache , logCache ) : new RemoteListCacheImpl ( logCache , traceCache ) ; }
returns this result cache usable for remote transport
164,377
public void setCache ( RemoteListCache cache ) { if ( cache instanceof RemoteListCacheImpl ) { RemoteListCacheImpl cacheImpl = ( RemoteListCacheImpl ) cache ; if ( getLogResult ( ) != null ) { RemoteRepositoryCache logCache = switched ? cacheImpl . getTraceCache ( ) : cacheImpl . getLogCache ( ) ; if ( logCache != null ) { getLogResult ( ) . setCache ( logCache ) ; } } if ( getTraceResult ( ) != null ) { RemoteRepositoryCache traceCache = switched ? cacheImpl . getLogCache ( ) : cacheImpl . getTraceCache ( ) ; if ( traceCache != null ) { getTraceResult ( ) . setCache ( traceCache ) ; } } } else { throw new IllegalArgumentException ( "Unknown implementation of the RemoteListCache instance" ) ; } }
sets cache for this result based on the provided one
164,378
protected Iterator < RepositoryLogRecord > getNewIterator ( int offset , int length ) { OnePidRecordListImpl logResult = getLogResult ( ) ; OnePidRecordListImpl traceResult = getTraceResult ( ) ; if ( logResult == null && traceResult == null ) { return EMPTY_ITERATOR ; } else if ( traceResult == null ) { return logResult . getNewIterator ( offset , length ) ; } else if ( logResult == null ) { return traceResult . getNewIterator ( offset , length ) ; } else { MergedServerInstanceLogRecordIterator result = new MergedServerInstanceLogRecordIterator ( logResult , traceResult ) ; result . setRange ( offset , length ) ; return result ; } }
Creates new OnePidRecordIterator returning records in the range .
164,379
public void processXML ( ) throws InjectionException { @ SuppressWarnings ( "unchecked" ) List < ServiceRef > serviceRefs = ( List < ServiceRef > ) ivNameSpaceConfig . getWebServiceRefs ( ) ; if ( serviceRefs == null || serviceRefs . isEmpty ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "No service-refs in XML for module: " + ivNameSpaceConfig . getModuleName ( ) ) ; } return ; } ClassLoader moduleClassLoader = ivNameSpaceConfig . getClassLoader ( ) ; if ( moduleClassLoader == null ) { throw new InjectionException ( "Internal Error: The classloader of module " + ivNameSpaceConfig . getModuleName ( ) + " is null." ) ; } List < ServiceRef > jaxwsServiceRefs = InjectionHelper . normalizeJaxWsServiceRefs ( serviceRefs , moduleClassLoader ) ; if ( jaxwsServiceRefs . isEmpty ( ) ) { return ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Found JAX-WS service refs in XML for module: " + ivNameSpaceConfig . getModuleName ( ) ) ; } List < InjectionBinding < WebServiceRef > > bindingList = WebServiceRefBindingBuilder . buildJaxWsWebServiceRefBindings ( jaxwsServiceRefs , ivNameSpaceConfig ) ; if ( bindingList != null && ! bindingList . isEmpty ( ) ) { for ( InjectionBinding < WebServiceRef > binding : bindingList ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Adding binding for JAX-WS service-ref: " + binding . getJndiName ( ) ) ; } addInjectionBinding ( binding ) ; } } }
This method will process any service - ref elements in the client s deployment descriptor .
164,380
public void resolve ( InjectionBinding < WebServiceRef > binding ) throws InjectionException { WebServiceRefInfo wsrInfo = ( ( WebServiceRefBinding ) binding ) . getWebServiceRefInfo ( ) ; Reference ref = null ; if ( wsrInfo . getLookupName ( ) != null && ! wsrInfo . getLookupName ( ) . isEmpty ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Build IndirectJndiLookup(" + wsrInfo . getLookupName ( ) + ") for service-ref '" + wsrInfo . getJndiName ( ) ) ; } IndirectJndiLookupReferenceFactory factory = ivNameSpaceConfig . getIndirectJndiLookupReferenceFactory ( ) ; ref = factory . createIndirectJndiLookup ( binding . getJndiName ( ) , wsrInfo . getLookupName ( ) , Object . class . getName ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Obtained Reference from IndirectJndiLookup object: " + ref . toString ( ) ) ; } } else { ref = new Reference ( WebServiceRefProcessor . class . getName ( ) , ServiceRefObjectFactory . class . getName ( ) , null ) ; WebServiceRefInfoRefAddr wsrInfoRefAddr = new WebServiceRefInfoRefAddr ( wsrInfo ) ; ref . add ( wsrInfoRefAddr ) ; J2EEName j2eeName = ivNameSpaceConfig . getJ2EEName ( ) ; String componenetName = ( null != j2eeName ) ? j2eeName . getComponent ( ) : null ; wsrInfo . setComponenetName ( componenetName ) ; } WebServiceRefInfoBuilder . configureWebServiceRefPartialInfo ( wsrInfo , ivNameSpaceConfig . getClassLoader ( ) ) ; binding . setObjects ( null , ref ) ; }
This method will resolve the InjectionBinding it is given . This involves storing the correct information within the binding instance so that later on the injection can occur . It also enables JNDI lookups to occur on the resource that is indicated in the binding .
164,381
private static void checkResponseCode ( URLConnection uc ) throws IOException { if ( uc instanceof HttpURLConnection ) { HttpURLConnection httpConnection = ( HttpURLConnection ) uc ; int rc = httpConnection . getResponseCode ( ) ; if ( rc != HttpURLConnection . HTTP_OK && rc != HttpURLConnection . HTTP_MOVED_TEMP ) { throw new IOException ( ) ; } } }
If URLConnection is an HTTP connection check that the response code is HTTP_OK
164,382
private String getCommonRootDir ( String filePath , HashMap validFilePaths ) { for ( Iterator it = validFilePaths . entrySet ( ) . iterator ( ) ; it . hasNext ( ) ; ) { Map . Entry entry = ( Map . Entry ) it . next ( ) ; String path = ( String ) ( ( entry ) . getKey ( ) ) ; if ( filePath . startsWith ( path ) ) return ( String ) entry . getValue ( ) ; } return null ; }
Retrieves the directory in common between the specified path and the archive root directory . If the file path cannot be found among the valid paths then null is returned .
164,383
private ArrayList < String > getExtensionInstallDirs ( ) throws IOException { String extensiondir = root + "etc/extensions/" ; ArrayList < String > extensionDirs = new ArrayList < String > ( ) ; for ( Entry entry : container ) { if ( entry . getName ( ) . startsWith ( extensiondir ) && entry . getName ( ) . endsWith ( ".properties" ) ) { Properties prop = new Properties ( ) ; prop . load ( entry . getInputStream ( ) ) ; String installDir = ( prop . getProperty ( "com.ibm.websphere.productInstall" ) ) ; if ( null != installDir && ! installDir . equals ( "" ) ) { extensionDirs . add ( installDir ) ; } } } return extensionDirs ; }
Retrieves all the extension products install directories as indicated their properties file .
164,384
public static void printNeededIFixes ( File outputDir , List extractedFiles ) { try { Runtime runtime = Runtime . getRuntime ( ) ; final String productInfo = new File ( outputDir , isWindows ? "bin/productInfo.bat" : "bin/productInfo" ) . getAbsolutePath ( ) ; final String [ ] runtimeCmd = { productInfo , "validate" } ; Process process = runtime . exec ( runtimeCmd , null , new File ( outputDir , "bin" ) ) ; Thread stderrCopier = new Thread ( new OutputStreamCopier ( process . getErrorStream ( ) , System . err ) ) ; stderrCopier . start ( ) ; new OutputStreamCopier ( process . getInputStream ( ) , System . out ) . run ( ) ; try { stderrCopier . join ( ) ; process . waitFor ( ) ; } catch ( InterruptedException e ) { } } catch ( IOException ioe ) { System . out . println ( ioe . getMessage ( ) ) ; } }
If necessary this will print a message saying that the installed files mean that an iFix needs to be re - installed .
164,385
protected Set listMissingCoreFeatures ( File outputDir ) throws SelfExtractorFileException { Set missingFeatures = new HashSet ( ) ; if ( requiredFeatures != null && ! "" . equals ( requiredFeatures ) ) { StringTokenizer tokenizer = new StringTokenizer ( requiredFeatures , "," ) ; while ( tokenizer . hasMoreElements ( ) ) { String nextFeature = tokenizer . nextToken ( ) ; if ( nextFeature . indexOf ( ";" ) >= 0 ) nextFeature = nextFeature . substring ( 0 , nextFeature . indexOf ( ";" ) ) ; missingFeatures . add ( nextFeature . trim ( ) ) ; } FilenameFilter manifestFilter = createManifestFilter ( ) ; File featuresDir = new File ( outputDir + "/lib/features" ) ; File [ ] manifestFiles = featuresDir . listFiles ( manifestFilter ) ; if ( manifestFiles != null ) { for ( int i = 0 ; i < manifestFiles . length && ! missingFeatures . isEmpty ( ) ; i ++ ) { FileInputStream fis = null ; File currentManifestFile = null ; try { currentManifestFile = manifestFiles [ i ] ; fis = new FileInputStream ( currentManifestFile ) ; Manifest currentManifest = new Manifest ( fis ) ; Attributes attrs = currentManifest . getMainAttributes ( ) ; String manifestSymbolicName = attrs . getValue ( "Subsystem-SymbolicName" ) ; if ( manifestSymbolicName . indexOf ( ";" ) >= 0 ) manifestSymbolicName = manifestSymbolicName . substring ( 0 , manifestSymbolicName . indexOf ( ";" ) ) ; missingFeatures . remove ( manifestSymbolicName . trim ( ) ) ; } catch ( FileNotFoundException fnfe ) { throw new SelfExtractorFileException ( currentManifestFile . getAbsolutePath ( ) , fnfe ) ; } catch ( IOException ioe ) { throw new SelfExtractorFileException ( currentManifestFile . getAbsolutePath ( ) , ioe ) ; } finally { SelfExtractUtils . tryToClose ( fis ) ; } } } } return missingFeatures ; }
This method checks that all the core features defined in the the manifest header exist in the server runtime we re extracting into and returns any features that don t . If the coreFeatures header is blank it means we re not an extended jar .
164,386
protected static boolean argIsOption ( String arg , String option ) { return arg . equalsIgnoreCase ( option ) || arg . equalsIgnoreCase ( '-' + option ) ; }
Test if the argument is an option . Allow single or double leading - be case insensitive .
164,387
protected static void displayCommandLineHelp ( SelfExtractor extractor ) { String jarName = System . getProperty ( "sun.java.command" , "wlp-liberty-developers-core.jar" ) ; String [ ] s = jarName . split ( " " ) ; jarName = s [ 0 ] ; System . out . println ( "\n" + SelfExtract . format ( "usage" ) ) ; System . out . println ( "\njava -jar " + jarName + " [" + SelfExtract . format ( "options" ) + "] [" + SelfExtract . format ( "installLocation" ) + "]\n" ) ; System . out . println ( SelfExtract . format ( "options" ) ) ; System . out . println ( " --acceptLicense" ) ; System . out . println ( " " + SelfExtract . format ( "helpAcceptLicense" ) ) ; System . out . println ( " --verbose" ) ; System . out . println ( " " + SelfExtract . format ( "helpVerbose" ) ) ; System . out . println ( " --viewLicenseAgreement" ) ; System . out . println ( " " + SelfExtract . format ( "helpAgreement" ) ) ; System . out . println ( " --viewLicenseInfo" ) ; System . out . println ( " " + SelfExtract . format ( "helpInformation" ) ) ; if ( extractor . isUserSample ( ) ) { System . out . println ( " --downloadDependencies" ) ; System . out . println ( " " + SelfExtract . format ( "helpDownloadDependencies" ) ) ; } }
Display command line usage .
164,388
public void handleLicenseAcceptance ( LicenseProvider licenseProvider , boolean acceptLicense ) { SelfExtract . wordWrappedOut ( SelfExtract . format ( "licenseStatement" , new Object [ ] { licenseProvider . getProgramName ( ) , licenseProvider . getLicenseName ( ) } ) ) ; System . out . println ( ) ; if ( acceptLicense ) { SelfExtract . wordWrappedOut ( SelfExtract . format ( "licenseAccepted" , "--acceptLicense" ) ) ; System . out . println ( ) ; } else { if ( ! obtainLicenseAgreement ( licenseProvider ) ) { System . exit ( 0 ) ; } } }
This method will print out information about the license and if necessary prompt the user to accept it .
164,389
private static boolean obtainLicenseAgreement ( LicenseProvider licenseProvider ) { boolean view ; SelfExtract . wordWrappedOut ( SelfExtract . format ( "showAgreement" , "--viewLicenseAgreement" ) ) ; view = SelfExtract . getResponse ( SelfExtract . format ( "promptAgreement" ) , "" , "xX" ) ; if ( view ) { SelfExtract . showLicenseFile ( licenseProvider . getLicenseAgreement ( ) ) ; System . out . println ( ) ; } SelfExtract . wordWrappedOut ( SelfExtract . format ( "showInformation" , "--viewLicenseInfo" ) ) ; view = SelfExtract . getResponse ( SelfExtract . format ( "promptInfo" ) , "" , "xX" ) ; if ( view ) { SelfExtract . showLicenseFile ( licenseProvider . getLicenseInformation ( ) ) ; System . out . println ( ) ; } System . out . println ( ) ; SelfExtract . wordWrappedOut ( SelfExtract . format ( "licenseOptionDescription" ) ) ; System . out . println ( ) ; boolean accept = SelfExtract . getResponse ( SelfExtract . format ( "licensePrompt" , new Object [ ] { "[1]" , "[2]" } ) , "1" , "2" ) ; System . out . println ( ) ; return accept ; }
Display and obtain agreement for the license terms
164,390
public String close ( ) { if ( instance == null ) { return null ; } try { container . close ( ) ; instance = null ; } catch ( IOException e ) { return e . getMessage ( ) ; } return null ; }
Release the jar file and null instance so that it can be deleted
164,391
public void clear ( ) { this . parentMap = null ; if ( null != this . values ) { for ( int i = 0 ; i < this . values . length ; i ++ ) { this . values [ i ] = null ; } this . values = null ; } }
Clear all content from this map . This will disconnect from any parent map as well .
164,392
public V get ( String name ) { V rc = null ; K key = getKey ( name ) ; if ( null != key ) { rc = get ( key ) ; } return rc ; }
Query the possible value associated with a named EventLocal . A null is returned if the name does not match any stored value or if that stored value is explicitly null .
164,393
private K getKey ( String name ) { if ( null != this . keys ) { final K [ ] temp = this . keys ; K key ; for ( int i = 0 ; i < temp . length ; i ++ ) { key = temp [ i ] ; if ( null != key && name . equals ( key . toString ( ) ) ) { return key ; } } } if ( null != this . parentMap ) { return this . parentMap . getKey ( name ) ; } return null ; }
Look for the key with the provided name . This returns null if no match is found .
164,394
public V get ( K key ) { return get ( key . hashCode ( ) / SIZE_ROW , key . hashCode ( ) % SIZE_ROW ) ; }
Query the value for the provided key .
164,395
public void put ( K key , V value ) { final int hash = key . hashCode ( ) ; final int row = hash / SIZE_ROW ; final int column = hash & ( SIZE_ROW - 1 ) ; validateKey ( hash ) ; validateTable ( row ) ; this . values [ row ] [ column ] = value ; this . keys [ hash ] = key ; }
Put a key and value pair into the storage map .
164,396
public V remove ( K key ) { final int hash = key . hashCode ( ) ; final int row = hash / SIZE_ROW ; final int column = hash & ( SIZE_ROW - 1 ) ; final V rc = get ( row , column ) ; validateKey ( hash ) ; validateTable ( row ) ; this . values [ row ] [ column ] = null ; this . keys [ hash ] = null ; return rc ; }
Remove a key from the storage .
164,397
@ SuppressWarnings ( "unchecked" ) private void validateKey ( int index ) { final int size = ( index + 1 ) ; if ( null == this . keys ) { this . keys = ( K [ ] ) new Object [ size ] ; } else if ( index >= this . keys . length ) { Object [ ] newKeys = new Object [ size ] ; System . arraycopy ( this . keys , 0 , newKeys , 0 , this . keys . length ) ; this . keys = ( K [ ] ) newKeys ; } }
Ensure that we have space in the local key array for the target index .
164,398
@ SuppressWarnings ( "unchecked" ) private void validateTable ( int targetRow ) { if ( null == this . values ) { int size = ( targetRow + 1 ) ; if ( SIZE_TABLE > size ) { size = SIZE_TABLE ; } this . values = ( V [ ] [ ] ) new Object [ size ] [ ] ; } else if ( targetRow >= this . values . length ) { final int size = ( targetRow + 1 ) ; Object [ ] [ ] newTable = new Object [ size ] [ ] ; System . arraycopy ( this . values , 0 , newTable , 0 , this . values . length ) ; this . values = ( V [ ] [ ] ) newTable ; } else if ( null != this . values [ targetRow ] ) { return ; } this . values [ targetRow ] = ( V [ ] ) new Object [ SIZE_ROW ] ; for ( int i = 0 ; i < SIZE_ROW ; i ++ ) { this . values [ targetRow ] [ i ] = ( V ) NO_VALUE ; } }
Validate that the storage table contains the provided row . This will allocate new space if that is required .
164,399
public String getRemoteEngineUuid ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getRemoteEngineUuid" ) ; String engineUUID = _anycastInputHandler . getLocalisationUuid ( ) . toString ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getRemoteEngineUuid" , engineUUID ) ; return engineUUID ; }
Return the remote engine uuid