idx
int64
0
165k
question
stringlengths
73
4.15k
target
stringlengths
5
918
len_question
int64
21
890
len_target
int64
3
255
160,700
public boolean removeEntry ( Object dependency , Object entry ) { //SKS-O boolean found = false ; ValueSet valueSet = ( ValueSet ) dependencyToEntryTable . get ( dependency ) ; if ( valueSet == null ) { return found ; } found = valueSet . remove ( entry ) ; if ( valueSet . size ( ) == 0 ) removeDependency ( dependency ) ; return found ; }
SKS - O
86
4
160,701
protected void modified ( String id , Map < String , Object > properties ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( this , tc , "modified " + id , properties ) ; } config = properties ; myProps = null ; }
DS method to modify this component .
67
7
160,702
protected ReadableLogRecord getReadableLogRecord ( long expectedSequenceNumber ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getReadableLogRecord" , new java . lang . Object [ ] { this , new Long ( expectedSequenceNumber ) } ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Creating readable log record to read from file " + _fileName ) ; final ReadableLogRecord readableLogRecord = ReadableLogRecord . read ( _fileBuffer , expectedSequenceNumber , ! _logFileHeader . wasShutdownClean ( ) ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getReadableLogRecord" , readableLogRecord ) ; return readableLogRecord ; }
Read a composite record from the disk . The caller supplies the expected sequence number of the record and this method confirms that this matches the next record recovered .
170
30
160,703
void fileClose ( ) throws InternalLogException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "fileClose" , this ) ; if ( _fileChannel != null ) { try { // Don't close channel as it will free a lock - wait until file close if ( _outstandingWritableLogRecords . get ( ) == 0 && ! _exceptionInForce ) { force ( ) ; // make sure all records really are on disk // Now we know that there are no gaps in the records and none have failed // to be written, byte by byte scanning at the next start can be avoided. _logFileHeader . setCleanShutdown ( ) ; // set the fact that shutdown was clean writeFileHeader ( false ) ; // write clean shutdown into header force ( ) ; } _file . close ( ) ; } catch ( Throwable e ) { FFDCFilter . processException ( e , "com.ibm.ws.recoverylog.spi.LogFileHandle.fileClose" , "541" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "fileClose" , "InternalLogException" ) ; throw new InternalLogException ( e ) ; } _fileBuffer = null ; _file = null ; _fileChannel = null ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "fileClose" ) ; }
Close the file managed by this LogFileHandle instance .
305
11
160,704
public WriteableLogRecord getWriteableLogRecord ( int recordLength , long sequenceNumber ) throws InternalLogException { if ( ! _headerFlushedFollowingRestart ) { // ensure header is updated now we start to write records for the first time // synchronization is assured through locks in LogHandle.getWriteableLogRecord writeFileHeader ( true ) ; _headerFlushedFollowingRestart = true ; } if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getWriteableLogRecord" , new Object [ ] { new Integer ( recordLength ) , new Long ( sequenceNumber ) , this } ) ; // Create a slice of the file buffer and reset its limit to the size of the WriteableLogRecord. // The view buffer's content is a shared subsequence of the file buffer. // No other log records have access to this log record's view buffer. ByteBuffer viewBuffer = ( ByteBuffer ) _fileBuffer . slice ( ) . limit ( recordLength + WriteableLogRecord . HEADER_SIZE ) ; WriteableLogRecord writeableLogRecord = new WriteableLogRecord ( viewBuffer , sequenceNumber , recordLength , _fileBuffer . position ( ) ) ; // Advance the file buffer's position to the end of the newly created WriteableLogRecord _fileBuffer . position ( _fileBuffer . position ( ) + recordLength + WriteableLogRecord . HEADER_SIZE ) ; _outstandingWritableLogRecords . incrementAndGet ( ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getWriteableLogRecord" , writeableLogRecord ) ; return writeableLogRecord ; }
Get a new WritableLogRecord for the log file managed by this LogFileHandleInstance . The size of the record must be specified along with the record s sequence number . It is the caller s responsbility to ensure that both the sequence number is correct and that the record written using the returned WritableLogRecord is of the given length .
348
70
160,705
private void writeFileHeader ( boolean maintainPosition ) throws InternalLogException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "writeFileHeader" , new java . lang . Object [ ] { this , new Boolean ( maintainPosition ) } ) ; // Build the buffer that forms the major part of the file header and // then convert this into a byte array. try { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Writing header for log file " + _fileName ) ; _logFileHeader . write ( _fileBuffer , maintainPosition ) ; force ( ) ; } catch ( InternalLogException exc ) { FFDCFilter . processException ( exc , "com.ibm.ws.recoverylog.spi.LogFileHandle.writeFileHeader" , "706" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "writeFileHeader" , exc ) ; throw exc ; } catch ( Throwable exc ) { FFDCFilter . processException ( exc , "com.ibm.ws.recoverylog.spi.LogFileHandle.writeFileHeader" , "712" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "writeFileHeader" , "InternalLogException" ) ; throw new InternalLogException ( exc ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "writeFileHeader" ) ; }
Writes the file header stored in _logFileHeader to the file managed by this LogFileHandle instance .
320
22
160,706
private void writeFileStatus ( boolean maintainPosition ) throws InternalLogException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "writeFileStatus" , new java . lang . Object [ ] { this , new Boolean ( maintainPosition ) } ) ; if ( _logFileHeader . status ( ) == LogFileHeader . STATUS_INVALID ) { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "writeFileStatus" , "InternalLogException" ) ; throw new InternalLogException ( null ) ; } try { int currentFilePointer = 0 ; if ( maintainPosition ) { // If the caller wishes the file pointer's current // position to be maintained cache it's position // here so that it can be reset once the header // has been written. currentFilePointer = _fileBuffer . position ( ) ; } // Move the buffer's pointer to the header status // field and perform a forced write of the new status _fileBuffer . position ( STATUS_FIELD_FILE_OFFSET ) ; _fileBuffer . putInt ( _logFileHeader . status ( ) ) ; force ( ) ; if ( maintainPosition ) { // Reinstate the fileBuffer's pointer to its original position. _fileBuffer . position ( currentFilePointer ) ; } } catch ( Throwable exc ) { FFDCFilter . processException ( exc , "com.ibm.ws.recoverylog.spi.LogFileHandle.writeFileStatus" , "797" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "writeFileStatus" , "WriteOperationFailedException" ) ; throw new WriteOperationFailedException ( exc ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "writeFileStatus" ) ; }
Updates the status field of the file managed by this LogFileHandle instance . The status field is stored in _logFileHeader .
391
27
160,707
protected LogFileHeader logFileHeader ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "logFileHeader" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "logFileHeader" , _logFileHeader ) ; return _logFileHeader ; }
Accessor for the log file header object assoicated with this LogFileHandle instance .
70
18
160,708
public byte [ ] getServiceData ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getServiceData" , this ) ; byte [ ] serviceData = null ; if ( _logFileHeader != null ) { serviceData = _logFileHeader . getServiceData ( ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getServiceData" , RLSUtils . toHexString ( serviceData , RLSUtils . MAX_DISPLAY_BYTES ) ) ; return serviceData ; }
Accessor for the service data assoicated with this LogFileHandle instance .
124
16
160,709
public int freeBytes ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "freeBytes" , this ) ; int freeBytes = 0 ; try { int currentCursorPosition = _fileBuffer . position ( ) ; int fileLength = _fileBuffer . capacity ( ) ; freeBytes = fileLength - currentCursorPosition ; if ( freeBytes < 0 ) { freeBytes = 0 ; } } catch ( Throwable exc ) { FFDCFilter . processException ( exc , "com.ibm.ws.recoverylog.spi.LogFileHandle.freeBytes" , "956" , this ) ; freeBytes = 0 ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "freeBytes" , new Integer ( freeBytes ) ) ; return freeBytes ; }
Returns the number of free bytes remaining in the file associated with this LogFileHandle instance .
178
18
160,710
public String fileName ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "fileName" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "fileName" , _fileName ) ; return _fileName ; }
Returns the name of the file associated with this LogFileHandle instance
63
13
160,711
void keypointStarting ( long nextRecordSequenceNumber ) throws InternalLogException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "keypointStarting" , new Object [ ] { new Long ( nextRecordSequenceNumber ) , this } ) ; // Set the header to indicate a keypoint operation. This also marks the header // as valid. _logFileHeader . keypointStarting ( nextRecordSequenceNumber ) ; try { writeFileHeader ( false ) ; } catch ( InternalLogException exc ) { FFDCFilter . processException ( exc , "com.ibm.ws.recoverylog.spi.LogFileHandle.keypointStarting" , "1073" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "keypointStarting" , exc ) ; throw exc ; } catch ( Throwable exc ) { FFDCFilter . processException ( exc , "com.ibm.ws.recoverylog.spi.LogFileHandle.keypointStarting" , "1079" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "keypointStarting" , "InternalLogException" ) ; throw new InternalLogException ( exc ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "keypointStarting" ) ; }
Informs the LogFileHandle instance that a keypoint operation is about begin into the file associated with this LogFileHandle instance . The status of the log file is updated to KEYPOINTING and written to disk .
295
44
160,712
void keypointComplete ( ) throws InternalLogException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "keypointComplete" , this ) ; _logFileHeader . keypointComplete ( ) ; try { writeFileStatus ( true ) ; } catch ( InternalLogException exc ) { FFDCFilter . processException ( exc , "com.ibm.ws.recoverylog.spi.LogFileHandle.keypointComplete" , "1117" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "keypointComplete" , exc ) ; throw exc ; } catch ( Throwable exc ) { FFDCFilter . processException ( exc , "com.ibm.ws.recoverylog.spi.LogFileHandle.keypointComplete" , "1123" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "keypointComplete" , "InternalLogException" ) ; throw new InternalLogException ( exc ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "keypointComplete" ) ; }
Informs the LogFileHandle instance that a keypoint operation into the file has completed . The status of the log file is updated to ACTIVE and written to disk .
248
34
160,713
void becomeInactive ( ) throws InternalLogException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "becomeInactive" , this ) ; _logFileHeader . changeStatus ( LogFileHeader . STATUS_INACTIVE ) ; try { writeFileStatus ( false ) ; } catch ( InternalLogException exc ) { FFDCFilter . processException ( exc , "com.ibm.ws.recoverylog.spi.LogFileHandle.becomeInactive" , "1161" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "becomeInactive" , exc ) ; throw exc ; } catch ( Throwable exc ) { FFDCFilter . processException ( exc , "com.ibm.ws.recoverylog.spi.LogFileHandle.becomeInactive" , "1167" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "becomeInactive" , "InternalLogException" ) ; throw new InternalLogException ( exc ) ; } if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "becomeInactive" , this ) ; }
This method is invoked to inform the LogFileHandle instance that the file it manages is no longer required by the recovery log serivce . The status field stored in the header is updated to INACTIVE .
265
42
160,714
public void fileExtend ( int newFileSize ) throws LogAllocationException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "fileExtend" , new Object [ ] { new Integer ( newFileSize ) , this } ) ; final int fileLength = _fileBuffer . capacity ( ) ; if ( fileLength < newFileSize ) { try { // Expand the file to the new size ensuring that its pointer // remains in its current position. int originalPosition = _fileBuffer . position ( ) ; // TODO // Tr.uncondEvent(tc, "Expanding log file to size of " + newFileSize + " bytes."); Tr . event ( tc , "Expanding log file to size of " + newFileSize + " bytes." ) ; if ( _isMapped ) { _fileBuffer = _fileChannel . map ( FileChannel . MapMode . READ_WRITE , 0 , newFileSize ) ; } else { // The file is not mapped. // Allocate a new DirectByteBuffer, copy the old ByteBuffer into the new one, // then write the new ByteBuffer to the FileChannel (automatically expanding it). if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "File is NOT mapped. Allocating new DirectByteBuffer" ) ; _fileBuffer . position ( 0 ) ; final ByteBuffer newByteBuffer = ByteBuffer . allocateDirect ( newFileSize ) ; newByteBuffer . put ( _fileBuffer ) ; newByteBuffer . position ( 0 ) ; _fileChannel . write ( newByteBuffer , 0 ) ; _fileBuffer = newByteBuffer ; } _fileBuffer . position ( originalPosition ) ; _fileSize = newFileSize ; } catch ( Exception exc ) { FFDCFilter . processException ( exc , "com.ibm.ws.recoverylog.spi.LogFileHandle.fileExtend" , "1266" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . event ( tc , "Unable to extend file " + _fileName + " to " + newFileSize + " bytes" ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "fileExtend" , "LogAllocationException" ) ; throw new LogAllocationException ( exc ) ; } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "fileExtend" ) ; }
Extend the physical log file . If newFileSize is larger than the current file size the log file will extended so that it is newFileSize kilobytes long . If newFileSize is equal to or less than the current file size the current log file will be unchanged .
524
57
160,715
protected void force ( ) throws InternalLogException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "force" , this ) ; try { if ( _isMapped ) { // Note: on Win2K we can get an IOException from this even though it is not declared ( ( MappedByteBuffer ) _fileBuffer ) . force ( ) ; } else { // Write the "pending" WritableLogRecords. writePendingToFile ( ) ; _fileChannel . force ( false ) ; } } catch ( java . io . IOException ioe ) { FFDCFilter . processException ( ioe , "com.ibm.ws.recoverylog.spi.LogFileHandle.force" , "1049" , this ) ; _exceptionInForce = true ; if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "Unable to force file " + _fileName ) ; // d453958: moved terminateserver code to MultiScopeRecoveryLog.markFailed method. if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "force" , "InternalLogException" ) ; throw new InternalLogException ( ioe ) ; } catch ( InternalLogException exc ) { FFDCFilter . processException ( exc , "com.ibm.ws.recoverylog.spi.LogFileHandle.force" , "1056" , this ) ; _exceptionInForce = true ; if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "Unable to force file " + _fileName ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "force" , "InternalLogException" ) ; throw exc ; } catch ( LogIncompatibleException exc ) { FFDCFilter . processException ( exc , "com.ibm.ws.recoverylog.spi.LogFileHandle.force" , "1096" , this ) ; _exceptionInForce = true ; if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "Unable to force file " + _fileName ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "force" , "InternalLogException" ) ; throw new InternalLogException ( exc ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "force" ) ; }
Forces the contents of the memory - mapped view of the log file to disk . Having invoked this method the caller can be certain that any data added to the log as part of a prior log write is now stored persistently on disk .
527
48
160,716
private String normalize ( String alias ) { // replace all the '.'s to '\.'s String regExp = alias . replaceAll ( "[\\.]" , "\\\\\\." ) ; // replace all the '*'s to '.*'s regExp = regExp . replaceAll ( "[*]" , "\\.\\*" ) ; // System.out.println("Normalized "+alias+" to "+regExp); return regExp ; }
This method normalizes the alias into a valid regular expression
98
11
160,717
public Iterator targetMappings ( ) { // System.out.println("TargetMappings called"); // return vHostTable.values().iterator(); 316624 Collection vHosts = vHostTable . values ( ) ; // 316624 List l = new ArrayList ( ) ; // 316624 l . addAll ( vHosts ) ; // 316624 return l . listIterator ( ) ; // 316624 }
Returns an enumeration of all the target mappings added to this mapper
91
15
160,718
public final BehindRef insert ( final AbstractItemLink insertAil ) { final long insertPosition = insertAil . getPosition ( ) ; boolean inserted = false ; BehindRef addref = null ; // Loop backwards through the list in order of decreasing sequence number // (addition usually near the end) until we have inserted the entry BehindRef lookat = _lastLinkBehind ; while ( ! inserted && ( lookat != null ) ) { AbstractItemLink lookatAil = lookat . getAIL ( ) ; if ( lookatAil != null ) { long lookatPosition = lookatAil . getPosition ( ) ; if ( insertPosition > lookatPosition ) { // This is where it goes then addref = new BehindRef ( insertAil ) ; if ( lookat . _next == null ) { // It's now the last one in the list _lastLinkBehind = addref ; } else { // It's going in the middle of the list addref . _next = lookat . _next ; lookat . _next . _prev = addref ; } addref . _prev = lookat ; lookat . _next = addref ; inserted = true ; } else if ( insertPosition == lookatPosition ) { // A duplicate. OK, it's been made reavailable more than once addref = lookat ; inserted = true ; } else { // Need to move backwards lookat = lookat . _prev ; } } else { BehindRef newlookat = lookat . _prev ; _remove ( lookat ) ; lookat = newlookat ; } } // If we have not inserted it yet, it's going to be the first in the list if ( ! inserted ) { addref = new BehindRef ( insertAil ) ; if ( _firstLinkBehind != null ) { addref . _next = _firstLinkBehind ; _firstLinkBehind . _prev = addref ; _firstLinkBehind = addref ; } else { _firstLinkBehind = addref ; _lastLinkBehind = addref ; } } return addref ; }
Inserts a reference to an AIL in the list of AILs behind the curent position of the cursor . The insertion is performed in position order . The list is composed of weak references and any which are discovered to refer to objects no longer on the heap are removed as we go .
440
59
160,719
private final void _remove ( final BehindRef removeref ) { if ( _firstLinkBehind != null ) { if ( removeref == _firstLinkBehind ) { // It's the first in the list ... if ( removeref == _lastLinkBehind ) { // ... and the only entry, the list is now empty _firstLinkBehind = null ; _lastLinkBehind = null ; } else { // ... and there are more entries, the first will change BehindRef nextref = removeref . _next ; removeref . _next = null ; nextref . _prev = null ; _firstLinkBehind = nextref ; } } else if ( removeref == _lastLinkBehind ) { // It's the list in the list and not the first also, the last will change BehindRef prevref = removeref . _prev ; removeref . _prev = null ; prevref . _next = null ; _lastLinkBehind = prevref ; } else { // It's in the middle of the list BehindRef prevref = removeref . _prev ; BehindRef nextref = removeref . _next ; removeref . _next = null ; removeref . _prev = null ; prevref . _next = nextref ; nextref . _prev = prevref ; } } }
Removes the first AIL in the list of AILs behind the current position of the cursor . The list may empty completely as a result .
268
30
160,720
protected boolean invokeTraceRouters ( RoutedMessage routedTrace ) { boolean retMe = true ; LogRecord logRecord = routedTrace . getLogRecord ( ) ; /* * Avoid any feedback traces that are emitted after this point. * The first time the counter increments is the first pass-through. * The second time the counter increments is the second pass-through due * to trace emitted. We do not want any more pass-throughs. */ try { if ( ! ( counterForTraceRouter . incrementCount ( ) > 2 ) ) { if ( logRecord != null ) { Level level = logRecord . getLevel ( ) ; int levelValue = level . intValue ( ) ; if ( levelValue < Level . INFO . intValue ( ) ) { String levelName = level . getName ( ) ; if ( ! ( levelName . equals ( "SystemOut" ) || levelName . equals ( "SystemErr" ) ) ) { //SystemOut/Err=700 WsTraceRouter internalTrRouter = internalTraceRouter . get ( ) ; if ( internalTrRouter != null ) { retMe &= internalTrRouter . route ( routedTrace ) ; } else if ( earlierTraces != null ) { synchronized ( this ) { if ( earlierTraces != null ) { earlierTraces . add ( routedTrace ) ; } } } } } } } } finally { counterForTraceRouter . decrementCount ( ) ; } return retMe ; }
Route only trace log records . Messages including Systemout err will not be routed to trace source to avoid duplicate entries
323
22
160,721
protected void publishTraceLogRecord ( TraceWriter detailLog , LogRecord logRecord , Object id , String formattedMsg , String formattedVerboseMsg ) { //check if tracefilename is stdout if ( formattedVerboseMsg == null ) { formattedVerboseMsg = formatter . formatVerboseMessage ( logRecord , formattedMsg , false ) ; } RoutedMessage routedTrace = new RoutedMessageImpl ( formattedMsg , formattedVerboseMsg , null , logRecord ) ; invokeTraceRouters ( routedTrace ) ; /* * Avoid any feedback traces that are emitted after this point. * The first time the counter increments is the first pass-through. * The second time the counter increments is the second pass-through due * to trace emitted. We do not want any more pass-throughs. */ try { if ( ! ( counterForTraceSource . incrementCount ( ) > 2 ) ) { if ( logRecord != null ) { Level level = logRecord . getLevel ( ) ; int levelValue = level . intValue ( ) ; if ( levelValue < Level . INFO . intValue ( ) ) { String levelName = level . getName ( ) ; if ( ! ( levelName . equals ( "SystemOut" ) || levelName . equals ( "SystemErr" ) ) ) { //SystemOut/Err=700 if ( traceSource != null ) { traceSource . publish ( routedTrace , id ) ; } } } } } } finally { counterForTraceSource . decrementCount ( ) ; } try { if ( ! ( counterForTraceWriter . incrementCount ( ) > 1 ) ) { // write to trace.log if ( detailLog != systemOut ) { String traceDetail = formatter . traceLogFormat ( logRecord , id , formattedMsg , formattedVerboseMsg ) ; detailLog . writeRecord ( traceDetail ) ; } } } finally { counterForTraceWriter . decrementCount ( ) ; } }
Publish a trace log record .
423
7
160,722
@ Override public void setMessageRouter ( MessageRouter msgRouter ) { externalMessageRouter . set ( msgRouter ) ; if ( msgRouter instanceof WsMessageRouter ) { setWsMessageRouter ( ( WsMessageRouter ) msgRouter ) ; } }
Inject the SPI MessageRouter .
64
8
160,723
@ Override public void unsetMessageRouter ( MessageRouter msgRouter ) { externalMessageRouter . compareAndSet ( msgRouter , null ) ; if ( msgRouter instanceof WsMessageRouter ) { unsetWsMessageRouter ( ( WsMessageRouter ) msgRouter ) ; } }
Un - inject .
70
4
160,724
protected void initializeWriters ( LogProviderConfigImpl config ) { // createFileLog may or may not return the original log holder.. messagesLog = FileLogHolder . createFileLogHolder ( messagesLog , newFileLogHeader ( false , config ) , config . getLogDirectory ( ) , config . getMessageFileName ( ) , config . getMaxFiles ( ) , config . getMaxFileBytes ( ) , config . getNewLogsOnStart ( ) ) ; // Always create a traceLog when using Tr -- this file won't actually be // created until something is logged to it... TraceWriter oldWriter = traceLog ; String fileName = config . getTraceFileName ( ) ; if ( fileName . equals ( "stdout" ) ) { traceLog = systemOut ; LoggingFileUtils . tryToClose ( oldWriter ) ; } else { traceLog = FileLogHolder . createFileLogHolder ( oldWriter == systemOut ? null : oldWriter , newFileLogHeader ( true , config ) , config . getLogDirectory ( ) , config . getTraceFileName ( ) , config . getMaxFiles ( ) , config . getMaxFileBytes ( ) , config . getNewLogsOnStart ( ) ) ; if ( ! TraceComponent . isAnyTracingEnabled ( ) ) { ( ( FileLogHolder ) traceLog ) . releaseFile ( ) ; } } }
Initialize the log holders for messages and trace . If the TrService is configured at bootstrap time to use JSR - 47 logging the traceLog will not be created here as the LogRecord should be routed to logger rather than being formatted for the trace file .
300
53
160,725
@ Override public Object load ( String batchId ) { Object loadedArtifact ; loadedArtifact = getArtifactById ( batchId ) ; if ( loadedArtifact != null ) { if ( logger . isLoggable ( Level . FINEST ) ) { logger . finest ( "load: batchId: " + batchId + ", artifact: " + loadedArtifact + ", artifact class: " + loadedArtifact . getClass ( ) . getCanonicalName ( ) ) ; } } return loadedArtifact ; }
Use CDI to load the artifact with the given ID .
111
12
160,726
protected Bean < ? > getUniqueBeanByBeanName ( BeanManager bm , String batchId ) { Bean < ? > match = null ; // Get all beans with the given EL name (id). EL names are applied via @Named. // If the bean is not annotated with @Named, then it does not have an EL name // and therefore can't be looked up that way. Set < Bean < ? > > beans = bm . getBeans ( batchId ) ; try { match = bm . resolve ( beans ) ; } catch ( AmbiguousResolutionException e ) { return null ; } return match ; }
Use the given BeanManager to lookup a unique CDI - registered bean with bean name equal to batchId using EL matching rules .
136
26
160,727
@ FFDCIgnore ( BatchCDIAmbiguousResolutionCheckedException . class ) protected Bean < ? > getUniqueBeanForBatchXMLEntry ( BeanManager bm , String batchId ) { ClassLoader loader = getContextClassLoader ( ) ; BatchXMLMapper batchXMLMapper = new BatchXMLMapper ( loader ) ; Class < ? > clazz = batchXMLMapper . getArtifactById ( batchId ) ; if ( clazz != null ) { try { return findUniqueBeanForClass ( bm , clazz ) ; } catch ( BatchCDIAmbiguousResolutionCheckedException e ) { if ( logger . isLoggable ( Level . FINER ) ) { logger . finer ( "getBeanForBatchXML: BatchCDIAmbiguousResolutionCheckedException: " + e . getMessage ( ) ) ; } return null ; } } else { return null ; } }
Use the given BeanManager to lookup a unique CDI - registered bean with bean class equal to the batch . xml entry mapped to be the batchId parameter
210
31
160,728
@ FFDCIgnore ( { ClassNotFoundException . class , BatchCDIAmbiguousResolutionCheckedException . class } ) protected Bean < ? > getUniqueBeanForClassName ( BeanManager bm , String className ) { // Ignore exceptions since will just failover to another loading mechanism try { Class < ? > clazz = getContextClassLoader ( ) . loadClass ( className ) ; return findUniqueBeanForClass ( bm , clazz ) ; } catch ( BatchCDIAmbiguousResolutionCheckedException e ) { if ( logger . isLoggable ( Level . FINER ) ) { logger . finer ( "getBeanForClassName: BatchCDIAmbiguousResolutionCheckedException: " + e . getMessage ( ) ) ; } return null ; } catch ( ClassNotFoundException cnfe ) { if ( logger . isLoggable ( Level . FINER ) ) { logger . finer ( "getBeanForClassName: ClassNotFoundException for " + className + ": " + cnfe ) ; } return null ; } }
Use the given BeanManager to lookup the set of CDI - registered beans with the given class name .
238
21
160,729
private synchronized void createExecutor ( ) { if ( componentConfig == null ) { // this is a completely normal occurrence and can happen if a ThreadFactory is bound prior to // component activation... the proper thing to do is to do nothing and wait for activation return ; } if ( threadPoolController != null ) threadPoolController . deactivate ( ) ; ThreadPoolExecutor oldPool = threadPool ; poolName = ( String ) componentConfig . get ( "name" ) ; String threadGroupName = poolName + " Thread Group" ; int coreThreads = Integer . parseInt ( String . valueOf ( componentConfig . get ( "coreThreads" ) ) ) ; int maxThreads = Integer . parseInt ( String . valueOf ( componentConfig . get ( "maxThreads" ) ) ) ; if ( maxThreads <= 0 ) { maxThreads = Integer . MAX_VALUE ; } if ( coreThreads < 0 ) { coreThreads = 2 * CpuInfo . getAvailableProcessors ( ) ; } // Make sure coreThreads is not bigger than maxThreads, subject to MINIMUM_POOL_SIZE limit coreThreads = Math . max ( MINIMUM_POOL_SIZE , Math . min ( coreThreads , maxThreads ) ) ; // ... and then make sure maxThreads is not smaller than coreThreads ... maxThreads = Math . max ( coreThreads , maxThreads ) ; BlockingQueue < Runnable > workQueue = new BoundedBuffer < Runnable > ( java . lang . Runnable . class , 1000 , 1000 ) ; RejectedExecutionHandler rejectedExecutionHandler = new ExpandPolicy ( workQueue , this ) ; threadPool = new ThreadPoolExecutor ( coreThreads , maxThreads , 0 , TimeUnit . MILLISECONDS , workQueue , threadFactory != null ? threadFactory : new ThreadFactoryImpl ( poolName , threadGroupName ) , rejectedExecutionHandler ) ; threadPoolController = new ThreadPoolController ( this , threadPool ) ; if ( oldPool != null ) { softShutdown ( oldPool ) ; } }
Create a thread pool executor with the configured attributes from this component config .
453
15
160,730
private < T > Collection < ? extends Callable < T > > wrap ( Collection < ? extends Callable < T > > tasks ) { List < Callable < T >> wrappedTasks = new ArrayList < Callable < T > > ( ) ; Iterator < ? extends Callable < T > > i = tasks . iterator ( ) ; while ( i . hasNext ( ) ) { Callable < T > c = wrap ( i . next ( ) ) ; if ( serverStopping ) wrappedTasks . add ( c ) ; else wrappedTasks . add ( new CallableWrapper < T > ( c ) ) ; } return wrappedTasks ; }
This is private so handling both interceptors and wrapping in this method for simplicity
140
15
160,731
public JsMessage next ( ) throws MessageDecodeFailedException , SISessionUnavailableException , SISessionDroppedException , SIConnectionUnavailableException , SIConnectionDroppedException , SIResourceException , SIConnectionLostException , SIErrorException , SINotAuthorizedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "next" ) ; JsMessage retMsg = null ; // begin D249096 retMsg = queue . get ( proxyQueueId ) ; if ( retMsg == null ) { convHelper . flushConsumer ( ) ; retMsg = queue . get ( proxyQueueId ) ; } // end D249096 if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "next" , retMsg ) ; return retMsg ; }
Returns the next message for a browse .
209
8
160,732
public void close ( ) throws SIResourceException , SIConnectionLostException , SIErrorException , SIConnectionDroppedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "close" ) ; if ( ! closed ) { // begin D249096 convHelper . closeSession ( ) ; queue . purge ( proxyQueueId ) ; owningGroup . notifyClose ( this ) ; closed = true ; // end D249096 } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "close" ) ; }
Closes the proxy queue .
151
6
160,733
public void put ( CommsByteBuffer msgBuffer , short msgBatch , boolean lastInBatch , boolean chunk ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "put" , new Object [ ] { msgBuffer , msgBatch , lastInBatch , chunk } ) ; QueueData queueData = null ; // If this data represents a chunk we need to read the flags from the buffer. This // will indicate to us whether we need to create some new queue data to stash on the // queue or if ( chunk ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Dealing with a chunked message" ) ; // Get the flags from the buffer byte flags = msgBuffer . get ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Flags:" , "" + flags ) ; // Is this the first chunk? if ( ( flags & CommsConstants . CHUNKED_MESSAGE_FIRST ) == CommsConstants . CHUNKED_MESSAGE_FIRST ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "First chunk received" ) ; // If it is, create some new queue data to place on the queue with the initial // chunk queueData = new QueueData ( this , lastInBatch , chunk , msgBuffer ) ; // Put the data to the queue queue . put ( queueData , msgBatch ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Middle / Last chunk received" ) ; // Otherwise, we need to append to the chunks already collected. We do this by // finding the chunk to append to. This will be the last message on the queue // (i.e. at the back). This works for all cases as an async consumer cannot be // driven concurrently (so the last incomplete message on the queue will be the // one we want). boolean lastChunk = ( ( flags & CommsConstants . CHUNKED_MESSAGE_LAST ) == CommsConstants . CHUNKED_MESSAGE_LAST ) ; queue . appendToLastMessage ( msgBuffer , lastChunk ) ; } } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Dealing with the entire message" ) ; queueData = new QueueData ( this , lastInBatch , chunk , msgBuffer ) ; // Put the data to the queue queue . put ( queueData , msgBatch ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "put" ) ; }
Places a browse message on the queue .
682
9
160,734
public void setBrowserSession ( BrowserSessionProxy browserSession ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setBrowserSession" , browserSession ) ; if ( this . browserSession != null ) { // We are flagging this here as we should never call setBrowserSession() twice. // A proxy queue is associated with a session for the lifetime of the session and calling // it twice is badness. SIErrorException e = new SIErrorException ( nls . getFormattedMessage ( "RESET_OF_BROWSER_SESSION_SICO1035" , null , null ) ) ; FFDCFilter . processException ( e , CLASS_NAME + ".setBrowserSession" , CommsConstants . BROWSERPQ_SETBROWSERSESS_01 , this ) ; throw e ; } if ( browserSession == null ) { // You can't pass in a null you complete badger SIErrorException e = new SIErrorException ( nls . getFormattedMessage ( "NULL_BROWSER_SESSION_SICO1036" , null , null ) ) ; FFDCFilter . processException ( e , CLASS_NAME + ".setBrowserSession" , CommsConstants . BROWSERPQ_SETBROWSERSESS_02 , this ) ; throw e ; } this . browserSession = browserSession ; convHelper . setSessionId ( browserSession . getProxyID ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setBrowserSession" ) ; }
Sets the browser session this proxy queue is being used in conjunction with .
359
15
160,735
private void readObject ( ObjectInputStream in ) throws IOException , ClassNotFoundException { GetField fields = in . readFields ( ) ; principal = ( String ) fields . get ( PRINCIPAL , null ) ; jwt = ( String ) fields . get ( JWT , null ) ; type = ( String ) fields . get ( TYPE , null ) ; handleClaims ( jwt ) ; }
Deserialize json web token .
87
7
160,736
private void writeObject ( ObjectOutputStream out ) throws IOException { PutField fields = out . putFields ( ) ; fields . put ( PRINCIPAL , principal ) ; fields . put ( JWT , jwt ) ; fields . put ( TYPE , type ) ; out . writeFields ( ) ; }
Serialize json web token .
67
6
160,737
private static JarFile _getAlternativeJarFile ( URL url ) throws IOException { String urlFile = url . getFile ( ) ; // Trim off any suffix - which is prefixed by "!/" on Weblogic int separatorIndex = urlFile . indexOf ( "!/" ) ; // OK, didn't find that. Try the less safe "!", used on OC4J if ( separatorIndex == - 1 ) { separatorIndex = urlFile . indexOf ( ' ' ) ; } if ( separatorIndex != - 1 ) { String jarFileUrl = urlFile . substring ( 0 , separatorIndex ) ; // And trim off any "file:" prefix. if ( jarFileUrl . startsWith ( "file:" ) ) { jarFileUrl = jarFileUrl . substring ( "file:" . length ( ) ) ; } return new JarFile ( jarFileUrl ) ; } return null ; }
taken from org . apache . myfaces . view . facelets . util . Classpath
196
20
160,738
private void requestProcessed ( FacesContext facesContext ) { if ( ! _firstRequestProcessed ) { // The order here is important. First it is necessary to put // the value on application map before change the value here. // If multiple threads reach this point concurrently, the // variable will be written on the application map at the same // time but always with the same value. facesContext . getExternalContext ( ) . getApplicationMap ( ) . put ( FIRST_REQUEST_PROCESSED_PARAM , Boolean . TRUE ) ; _firstRequestProcessed = true ; } }
This method places an attribute on the application map to indicate that the first request has been processed . This attribute is used by several methods in ApplicationImpl to determine whether or not to throw an IllegalStateException
123
40
160,739
@ Generated ( value = "com.ibm.jtc.jax.tools.xjc.Driver" , date = "2014-06-11T05:49:00-04:00" , comments = "JAXB RI v2.2.3-11/28/2011 06:21 AM(foreman)-" ) public List < Property > getPropertyList ( ) { if ( propertyList == null ) { propertyList = new ArrayList < Property > ( ) ; } return this . propertyList ; }
Gets the value of the propertyList property .
114
10
160,740
protected Token current ( ) { final String methodName = "current" ; Token currentToken ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName + toString ( ) ) ; currentToken = objectStore . like ( this ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName , new Object [ ] { currentToken , Integer . toHexString ( currentToken . hashCode ( ) ) } ) ; return currentToken ; }
Give back the current token if there is already one known to the Object Store for the same ManagedObject .
133
22
160,741
public final ManagedObject getManagedObject ( ) throws ObjectManagerException { // final String methodName = "getManagedObject"; // if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) // trace.entry(this, // cclass, // methodName); // Get the object if is already in memory. ManagedObject managedObject = null ; if ( managedObjectReference != null ) managedObject = ( ManagedObject ) managedObjectReference . get ( ) ; if ( managedObject == null ) { // See if we can avoid synchronizing. synchronized ( this ) { if ( managedObjectReference != null ) managedObject = ( ManagedObject ) managedObjectReference . get ( ) ; if ( managedObject == null ) { managedObject = objectStore . get ( this ) ; if ( managedObject != null ) { managedObject . owningToken = this ; // PM22584 Set the owning token first managedObjectReference = new java . lang . ref . WeakReference ( managedObject ) ; } // if (managedObject != null). } // if (managedObject == null). } // synchronize (this). } // if (managedObject == null). // if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) // trace.exit(this, // cclass, // methodName, // new Object[] {managedObject}); return managedObject ; }
Find the ManagedObject handled by this token .
293
10
160,742
protected synchronized ManagedObject setManagedObject ( ManagedObject managedObject ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "setManagedObject" + "managedObject=" + managedObject + "(ManagedObject)" + toString ( ) ) ; ManagedObject managedObjectSet ; // For return. // Has any ManagedObject ever been associated with tis Token? if ( managedObjectReference == null ) { // Nothing currently known so use the version given. managedObject . owningToken = this ; // PM22584 Set the owning token first managedObjectReference = new java . lang . ref . WeakReference ( managedObject ) ; managedObjectSet = managedObject ; } else { ManagedObject existingManagedObject = ( ManagedObject ) managedObjectReference . get ( ) ; if ( existingManagedObject == null ) { // Is it still accessible? managedObject . owningToken = this ; // PM22584 Set the owning token first managedObjectReference = new java . lang . ref . WeakReference ( managedObject ) ; managedObjectSet = managedObject ; } else { // In memory and accessible. // During recovery another object already recovered may have refered // to this one causing it to already be resident in memory. // Replace what we already have with this version. existingManagedObject . becomeCloneOf ( managedObject ) ; managedObjectSet = existingManagedObject ; } // if (existingManagedObject == null). } // if(managedObjectReference == null). if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "setManagedObject" , new Object [ ] { managedObjectSet } ) ; return managedObjectSet ; }
Associate a new ManagedObject with this token . If there is already a managedObject associated with the Token it is replaced by making it a clone of the new ManagedObject so that existing references to the old ManagedObject becone refrences to the new one .
387
55
160,743
void invalidate ( ) { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "invalidate" ) ; // Prevent any attempt to load the object. objectStore = null ; // If the ManagedObject is already in memory access it, otherwise there is nothing // we need to do to it. if ( managedObjectReference != null ) { ManagedObject managedObject = ( ManagedObject ) managedObjectReference . get ( ) ; if ( managedObject != null ) managedObject . state = ManagedObject . stateError ; } // if (managedObjectReference != null). if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "invalidate" ) ; }
Make the token and any ManagedObject it refers to invalid . Used at shutdown to prevent accidental use of a ManagedObject in the ObjectManager that instantiated it or any other Object Manager .
177
39
160,744
public static final Token restore ( java . io . DataInputStream dataInputStream , ObjectManagerState objectManagerState ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( cclass , "restore" , new Object [ ] { dataInputStream , objectManagerState } ) ; int objectStoreIdentifier ; long storedObjectIdentifier ; try { byte version = dataInputStream . readByte ( ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isDebugEnabled ( ) ) trace . debug ( cclass , "restore" , new Object [ ] { new Byte ( version ) } ) ; objectStoreIdentifier = dataInputStream . readInt ( ) ; storedObjectIdentifier = dataInputStream . readLong ( ) ; } catch ( java . io . IOException exception ) { // No FFDC Code Needed. ObjectManager . ffdc . processException ( cclass , "restore" , exception , "1:400:1.14" ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( cclass , "restore" , "via PermanentIOException" ) ; throw new PermanentIOException ( cclass , exception ) ; } // catch (java.io.IOException exception). Token tokenToReturn = new Token ( objectManagerState . getObjectStore ( objectStoreIdentifier ) , storedObjectIdentifier ) ; // Swap for the definitive Token. // TODO should have a smarter version of like() which takes a storedObjectIdentifier, // instead of requiring a new Token(). tokenToReturn = tokenToReturn . current ( ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( cclass , "restore" , "returns token=" + tokenToReturn + "(Token)" ) ; return tokenToReturn ; }
Recover the token described by a dataInputStream and resolve it ot the definitive token .
421
18
160,745
public static HttpEndpointImpl findEndpoint ( String endpointId ) { for ( HttpEndpointImpl i : instance . get ( ) ) { if ( i . getName ( ) . equals ( endpointId ) ) return i ; } return null ; }
Return the endpoint for the given id .
55
8
160,746
public synchronized List < Long > getTicksOnStream ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getTicksOnStream" ) ; List < Long > msgs = new ArrayList < Long > ( ) ; StateStream stateStream = getStateStream ( ) ; // Initial range in stream is always completed Range stateStream . setCursor ( 0 ) ; // skip this and move to next range stateStream . getNext ( ) ; // Get the first TickRange after completed range and move cursor to the next one TickRange tr = stateStream . getNext ( ) ; // Iterate until we reach final Unknown range while ( tr . endstamp < RangeList . INFINITY ) { if ( ! ( tr . type == TickRange . Completed ) ) { msgs . add ( new Long ( tr . startstamp ) ) ; } tr = stateStream . getNext ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getTicksOnStream" , msgs ) ; return msgs ; }
Gets a list of all tick values on the state stream
256
12
160,747
public void quit ( ) { try { this . keepOn = false ; if ( this . serverSocket != null && ! this . serverSocket . isClosed ( ) ) { this . serverSocket . close ( ) ; this . serverSocket = null ; } } catch ( final IOException e ) { throw new RuntimeException ( e ) ; } }
Exit POP3 server .
73
5
160,748
boolean contains ( String normalizedPath ) { if ( normalizedPath == null ) return false ; if ( normalizedPath . length ( ) < normalizedRoot . length ( ) ) return false ; return normalizedPath . regionMatches ( 0 , normalizedRoot , 0 , normalizedRoot . length ( ) ) ; }
Check if the provided path is contained within this root s hierarchy .
62
13
160,749
private static String getIPAddress ( ) { String rc ; try { rc = InetAddress . getLocalHost ( ) . getHostAddress ( ) ; } catch ( Exception e ) { // No FFDC code needed rc = Long . valueOf ( new Random ( ) . nextLong ( ) ) . toString ( ) ; } return rc ; }
InetAddress is compatible with both IPv4 & IPv6
73
12
160,750
private SecurityMetadata getSecurityMetadata ( WebAppConfig webAppConfig ) { WebModuleMetaData wmmd = ( ( WebAppConfigExtended ) webAppConfig ) . getMetaData ( ) ; return ( SecurityMetadata ) wmmd . getSecurityMetaData ( ) ; }
Gets the security metadata from the web app config
62
10
160,751
private boolean isDenyUncoveredHttpMethods ( List < SecurityConstraint > scList ) { for ( SecurityConstraint sc : scList ) { List < WebResourceCollection > wrcList = sc . getWebResourceCollections ( ) ; for ( WebResourceCollection wrc : wrcList ) { if ( wrc . getDenyUncoveredHttpMethods ( ) ) { return true ; } } } return false ; }
Returns whether deny - uncovered - http - methods attribute is set . In order to check this value entire WebResourceCollection objects need to be examined since it only set properly when web . xml is processed .
92
40
160,752
@ Override public final DataSource createConnectionFactory ( ConnectionManager connMgr ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "createConnectionFactory" , connMgr ) ; DataSource connFactory = jdbcRuntime . newDataSource ( this , connMgr ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "createConnectionFactory" , connFactory ) ; return connFactory ; }
Creates a javax . sql . DataSource that uses the application server provided connection manager to manage its connections .
129
24
160,753
private Connection getConnection ( PooledConnection pconn , WSConnectionRequestInfoImpl cri , String userName ) throws ResourceException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "getConnection" , AdapterUtil . toString ( pconn ) ) ; Connection conn = null ; boolean isConnectionSetupComplete = false ; try { conn = pconn . getConnection ( ) ; postGetConnectionHandling ( conn ) ; isConnectionSetupComplete = true ; } catch ( SQLException se ) { FFDCFilter . processException ( se , getClass ( ) . getName ( ) , "260" , this ) ; ResourceException x = AdapterUtil . translateSQLException ( se , this , false , getClass ( ) ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "getConnection" , se ) ; throw x ; } finally { // Destroy the connection if we weren't able to successfully complete the setup. if ( ! isConnectionSetupComplete ) { if ( conn != null ) try { conn . close ( ) ; } catch ( Throwable x ) { } if ( pconn != null ) try { pconn . close ( ) ; } catch ( Throwable x ) { } } } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "getConnection" , AdapterUtil . toString ( conn ) ) ; return conn ; }
Gets a java . sql . Connection from a PooledConnection use the cri to extract certain information if needed if trused context is supported ...
343
30
160,754
@ Override public Set < ManagedConnection > getInvalidConnections ( @ SuppressWarnings ( "rawtypes" ) Set connectionSet ) throws ResourceException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "getInvalidConnections" , connectionSet ) ; Set < ManagedConnection > badSet = new HashSet < ManagedConnection > ( ) ; WSRdbManagedConnectionImpl mc = null ; // Loop through each ManagedConnection in the list, using each connection's // preTestSQLString to check validity. Different connections can // have different preTestSQLStrings if they were created by different // ManagedConnectionFactories. for ( Iterator < ? > it = connectionSet . iterator ( ) ; it . hasNext ( ) ; ) { mc = ( WSRdbManagedConnectionImpl ) it . next ( ) ; if ( ! mc . validate ( ) ) badSet . add ( mc ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "getInvalidConnections" , badSet ) ; return badSet ; }
The spec interface is defined with raw types so we have no choice but to declare it that way too
265
20
160,755
private Object getTraceable ( Object d ) throws ResourceException { WSJdbcTracer tracer = new WSJdbcTracer ( helper . getTracer ( ) , helper . getPrintWriter ( ) , d , type , null , true ) ; Set < Class < ? > > classes = new HashSet < Class < ? > > ( ) ; for ( Class < ? > cl = d . getClass ( ) ; cl != null ; cl = cl . getSuperclass ( ) ) classes . addAll ( Arrays . asList ( cl . getInterfaces ( ) ) ) ; return Proxy . newProxyInstance ( jdbcDriverLoader , classes . toArray ( new Class [ classes . size ( ) ] ) , tracer ) ; }
Enable supplemental tracing for the underlying data source or java . sql . Driver .
161
15
160,756
private void onConnect ( Connection con , String [ ] sqlCommands ) throws SQLException { final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; TransactionManager tm = connectorSvc . getTransactionManager ( ) ; Transaction suspendedTx = null ; String currentSQL = null ; Throwable failure = null ; try { UOWCoordinator coord = tm == null ? null : ( ( UOWCurrent ) tm ) . getUOWCoord ( ) ; if ( coord != null && coord . isGlobal ( ) ) suspendedTx = tm . suspend ( ) ; Statement stmt = con . createStatement ( ) ; for ( String sql : sqlCommands ) { currentSQL = sql ; if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "execute onConnect SQL" , sql ) ; stmt . execute ( sql ) ; } stmt . close ( ) ; } catch ( Throwable x ) { failure = x ; } if ( suspendedTx != null ) { try { tm . resume ( suspendedTx ) ; } catch ( Throwable x ) { failure = x ; } } if ( failure != null ) { if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "failed" , AdapterUtil . stackTraceToString ( failure ) ) ; throw new SQLNonTransientConnectionException ( AdapterUtil . getNLSMessage ( "DSRA4004.onconnect.sql" , currentSQL , dsConfig . get ( ) . id ) , "08000" , 0 , failure ) ; } }
Execute the onConnect SQL commands . The connection won t be enlisted in a WAS transaction yet but it s necessary to suspend and WAS global transaction in order to avoid confusing the DB2 type 2 JDBC driver .
345
43
160,757
private void postGetConnectionHandling ( Connection conn ) throws SQLException { helper . doConnectionSetup ( conn ) ; String [ ] sqlCommands = dsConfig . get ( ) . onConnect ; if ( sqlCommands != null && sqlCommands . length > 0 ) onConnect ( conn , sqlCommands ) ; // Log the database and driver versions on first getConnection. if ( ! wasUsedToGetAConnection ) { // Wait until after the connection succeeds to set the indicator. // This accounts for the scenario where the first connection attempt is bad. // The information needs to be read again on the second attempt. helper . gatherAndDisplayMetaDataInfo ( conn , this ) ; wasUsedToGetAConnection = true ; } }
utility used to gather metadata info and issue doConnectionSetup .
161
13
160,758
final void reallySetLogWriter ( final PrintWriter out ) throws ResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "setting the logWriter to:" , out ) ; if ( dataSourceOrDriver != null ) { try { AccessController . doPrivileged ( new PrivilegedExceptionAction < Void > ( ) { public Void run ( ) throws SQLException { if ( ! Driver . class . equals ( type ) ) { ( ( CommonDataSource ) dataSourceOrDriver ) . setLogWriter ( out ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Unable to set logwriter on Driver type" ) ; } return null ; } } ) ; } catch ( PrivilegedActionException pae ) { SQLException se = ( SQLException ) pae . getCause ( ) ; FFDCFilter . processException ( se , getClass ( ) . getName ( ) , "593" , this ) ; throw AdapterUtil . translateSQLException ( se , this , false , getClass ( ) ) ; } } logWriter = out ; // Keep the value only if successful on the DataSource. }
This method is to be used by RRA code to set logwriter when needed
283
16
160,759
public final int getLoginTimeout ( ) throws SQLException { try { if ( ! Driver . class . equals ( type ) ) { return ( ( CommonDataSource ) dataSourceOrDriver ) . getLoginTimeout ( ) ; } //Return that the default value is being used when using the Driver type return 0 ; } catch ( SQLException sqlX ) { FFDCFilter . processException ( sqlX , getClass ( ) . getName ( ) , "1670" , this ) ; throw AdapterUtil . mapSQLException ( sqlX , this ) ; } }
Retrieves the login timeout for the DataSource .
125
11
160,760
@ Override public String formatRecord ( RepositoryLogRecord record , Locale locale ) { if ( null == record ) { throw new IllegalArgumentException ( "Record cannot be null" ) ; } StringBuilder sb = new StringBuilder ( 300 ) ; String lineSeparatorPlusPadding = "" ; // Use basic format createEventHeader ( record , sb ) ; lineSeparatorPlusPadding = svLineSeparatorPlusBasicPadding ; // add the localizedMsg sb . append ( formatMessage ( record , locale ) ) ; // if we have a stack trace, append that to the formatted output. if ( record . getStackTrace ( ) != null ) { sb . append ( lineSeparatorPlusPadding ) ; sb . append ( record . getStackTrace ( ) ) ; } return sb . toString ( ) ; }
Formats a RepositoryLogRecord into a localized basic format output String .
185
15
160,761
public void addGlobalTagLibConfig ( GlobalTagLibConfig globalTagLibConfig ) { try { TldParser tldParser = new TldParser ( this , configManager , false , globalTagLibConfig . getClassloader ( ) ) ; if ( globalTagLibConfig . getClassloader ( ) == null ) loadTldFromJarInputStream ( globalTagLibConfig , tldParser ) ; else loadTldFromClassloader ( globalTagLibConfig , tldParser ) ; globalTagLibConfigList . add ( globalTagLibConfig ) ; } catch ( JspCoreException e ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . SEVERE ) ) { logger . logp ( Level . SEVERE , CLASS_NAME , "addGlobalTagLibConfig" , "failed to create TldParser " , e ) ; } } }
add some GlobalTabLibConfig to the global tag libs we know about . If the provided config provides a classloader we will load the TLDs via that class loaders otherwise the JAR URL will be used to find the TLDs .
203
51
160,762
public static synchronized ClientConnectionManager getRef ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getRef" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getRef" , instance ) ; return instance ; }
Returns a reference to the single instance of this class in existence . The class must have been previously initilised by a call to the initialise method - otherwise invoking this method will generate a runtime exception . This class implements the singleton design pattern .
87
50
160,763
@ Override public WSStatistic getStatistic ( int dataId ) { ArrayList members = copyStatistics ( ) ; if ( members == null || members . size ( ) <= 0 ) return null ; int sz = members . size ( ) ; for ( int i = 0 ; i < sz ; i ++ ) { StatisticImpl data = ( StatisticImpl ) members . get ( i ) ; if ( data != null && data . getId ( ) == dataId ) { return data ; } } return null ; }
get Statistic by data id
111
6
160,764
private synchronized void myupdate ( WSStats newStats , boolean keepOld , boolean recursiveUpdate ) { if ( newStats == null ) return ; StatsImpl newStats1 = ( StatsImpl ) newStats ; // update the level and description of this collection this . instrumentationLevel = newStats1 . getLevel ( ) ; // update data updateMembers ( newStats , keepOld ) ; // update subcollections if ( recursiveUpdate ) updateSubcollection ( newStats , keepOld , recursiveUpdate ) ; }
Assume we have verified newStats is the same PMI module as this Stats
104
16
160,765
public void insert ( SimpleTest test , Object target ) { if ( size == ranges . length ) { RangeEntry [ ] tmp = new RangeEntry [ 2 * size ] ; System . arraycopy ( ranges , 0 , tmp , 0 , size ) ; ranges = tmp ; } ranges [ size ] = new RangeEntry ( test , target ) ; size ++ ; }
Insert a range and an associated target into the table .
75
11
160,766
public Object getExact ( SimpleTest test ) { for ( int i = 0 ; i < size ; i ++ ) { if ( ranges [ i ] . correspondsTo ( test ) ) return ranges [ i ] . target ; } return null ; }
Retrieve the Object associated with an exactly defined range
52
10
160,767
public void replace ( SimpleTest test , Object target ) { for ( int i = 0 ; i < size ; i ++ ) if ( ranges [ i ] . correspondsTo ( test ) ) { ranges [ i ] . target = target ; return ; } throw new IllegalStateException ( ) ; }
Replace the Object in a range that is known to exist
61
12
160,768
public List find ( Number value ) { // was NumericValue List targets = new ArrayList ( 1 ) ; for ( int i = 0 ; i < size ; i ++ ) { if ( ranges [ i ] . contains ( value ) ) targets . add ( ranges [ i ] . target ) ; } return targets ; }
Find targets associated with all ranges including this value .
67
10
160,769
@ FFDCIgnore ( XMLStreamException . class ) public boolean parseServerConfiguration ( InputStream in , String docLocation , BaseConfiguration config , MergeBehavior mergeBehavior ) throws ConfigParserException , ConfigValidationException { XMLStreamReader parser = null ; try { parser = getXMLInputFactory ( ) . createXMLStreamReader ( docLocation , in ) ; return parseServerConfiguration ( new DepthAwareXMLStreamReader ( parser ) , docLocation , config , mergeBehavior ) ; } catch ( XMLStreamException e ) { throw new ConfigParserException ( e ) ; } finally { if ( parser != null ) { try { parser . close ( ) ; } catch ( XMLStreamException e ) { throw new ConfigParserException ( e ) ; } } } }
private if not for tests
163
5
160,770
public void start ( QueuedFuture < ? > queuedFuture ) { Runnable timeoutTask = ( ) -> { queuedFuture . abort ( new TimeoutException ( ) ) ; } ; start ( timeoutTask ) ; }
start timer and cancel given future
48
6
160,771
private void timeout ( ) { lock . writeLock ( ) . lock ( ) ; try { //if already stopped, do nothing, otherwise check times and run the timeout task if ( ! this . stopped ) { long now = System . nanoTime ( ) ; long remaining = this . targetEnd - now ; this . timedout = remaining <= FTConstants . MIN_TIMEOUT_NANO ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { debugTime ( "!Start {0}" , this . start ) ; debugTime ( "!Target {0}" , this . targetEnd ) ; debugTime ( "!Now {0}" , now ) ; debugTime ( "!Remain {0}" , remaining ) ; } //if we really have timedout then run the timeout task if ( this . timedout ) { debugRelativeTime ( "Timeout!" ) ; this . timeoutTask . run ( ) ; } else { //this shouldn't be possible but if the timer popped too early, restart it debugTime ( "Premature Timeout!" , remaining ) ; start ( this . timeoutTask , remaining ) ; } } } finally { lock . writeLock ( ) . unlock ( ) ; } }
This method is run when the timer pops
263
8
160,772
private void start ( Runnable timeoutTask ) { long timeout = timeoutPolicy . getTimeout ( ) . toNanos ( ) ; start ( timeoutTask , timeout ) ; }
Get the timeout from the policy and start the timer
37
10
160,773
private void start ( Runnable timeoutTask , long remainingNanos ) { lock . writeLock ( ) . lock ( ) ; try { this . timeoutTask = timeoutTask ; this . start = System . nanoTime ( ) ; this . targetEnd = start + remainingNanos ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { debugTime ( ">Start {0}" , this . start ) ; debugTime ( ">Target {0}" , this . targetEnd ) ; debugTime ( ">Now {0}" , this . start ) ; debugTime ( ">Remain {0}" , remainingNanos ) ; } Runnable task = ( ) -> { timeout ( ) ; } ; if ( remainingNanos > FTConstants . MIN_TIMEOUT_NANO ) { this . future = scheduledExecutorService . schedule ( task , remainingNanos , TimeUnit . NANOSECONDS ) ; } else { task . run ( ) ; } } finally { lock . writeLock ( ) . unlock ( ) ; } }
This is the method which actually starts the timer
233
9
160,774
public void stop ( ) { lock . writeLock ( ) . lock ( ) ; try { debugRelativeTime ( "Stop!" ) ; this . stopped = true ; if ( this . future != null && ! this . future . isDone ( ) ) { debugRelativeTime ( "Cancelling" ) ; this . future . cancel ( true ) ; } this . future = null ; } finally { lock . writeLock ( ) . unlock ( ) ; } }
Stop the timeout ... mark it as stopped and cancel the scheduled future task if required
98
16
160,775
public void restart ( ) { lock . writeLock ( ) . lock ( ) ; try { if ( this . timeoutTask == null ) { throw new IllegalStateException ( Tr . formatMessage ( tc , "internal.error.CWMFT4999E" ) ) ; } stop ( ) ; this . stopped = false ; start ( this . timeoutTask ) ; } finally { lock . writeLock ( ) . unlock ( ) ; } }
Restart the timer ... stop the timer reset the stopped flag and then start again with the same timeout policy
92
21
160,776
public long check ( ) { long remaining = 0 ; lock . readLock ( ) . lock ( ) ; try { if ( this . timedout ) { // Note: this clears the interrupted flag if it was set // Assumption is that the interruption was caused by the Timeout boolean wasInterrupted = Thread . interrupted ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { if ( wasInterrupted ) { Tr . debug ( tc , "{0}: Throwing timeout exception and clearing interrupted flag" , getDescriptor ( ) ) ; } else { Tr . debug ( tc , "{0}: Throwing timeout exception" , getDescriptor ( ) ) ; } } throw new TimeoutException ( Tr . formatMessage ( tc , "timeout.occurred.CWMFT0000E" ) ) ; } long now = System . nanoTime ( ) ; remaining = this . targetEnd - now ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { debugTime ( "?Start " , this . start ) ; debugTime ( "?Target" , this . targetEnd ) ; debugTime ( "?Now " , now ) ; debugTime ( "?Remain" , remaining ) ; } } finally { lock . readLock ( ) . unlock ( ) ; } return remaining ; }
Check if the timedout flag was previously set and throw an exception if it was . Otherwise return the remaining timeout time in nanoseconds .
292
29
160,777
@ Trivial private void debugTime ( String message , long nanos ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { FTDebug . debugTime ( tc , getDescriptor ( ) , message , nanos ) ; } }
Output a debug message showing a given relative time converted from nanos to seconds
62
15
160,778
public static String createPropertyFilter ( String name , String value ) { assert name . matches ( "[^=><~()]+" ) ; StringBuilder builder = new StringBuilder ( name . length ( ) + 3 + ( value == null ? 0 : value . length ( ) * 2 ) ) ; builder . append ( ' ' ) . append ( name ) . append ( ' ' ) ; int begin = 0 ; if ( value != null ) { for ( int i = 0 ; i < value . length ( ) ; i ++ ) { if ( "\\*()" . indexOf ( value . charAt ( i ) ) != - 1 ) { builder . append ( value , begin , i ) . append ( ' ' ) ; begin = i ; } } return builder . append ( value , begin , value . length ( ) ) . append ( ' ' ) . toString ( ) ; } else { return builder . append ( ' ' ) . toString ( ) ; } }
Creates a filter string that matches an attribute value exactly . Characters in the value with special meaning will be escaped .
205
23
160,779
public static void delete ( final File f ) { if ( f != null && f . exists ( ) ) { // Why do we have to specify a return type for the run method and paramatize // PrivilegedExceptionAction to it, this method should have a void return type ideally. AccessController . doPrivileged ( new PrivilegedAction < Object > ( ) { @ Override public Object run ( ) { if ( ! f . delete ( ) ) { logger . log ( Level . INFO , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "LOG_CANNOT_DELETE_FILE" , f . getAbsolutePath ( ) ) ) ; f . deleteOnExit ( ) ; } return null ; } } ) ; } }
Java 2 security APIs for deleteOnExit
163
8
160,780
public static FileInputStream getFileIputStream ( final File file ) throws FileNotFoundException { try { return AccessController . doPrivileged ( new PrivilegedExceptionAction < FileInputStream > ( ) { @ Override public FileInputStream run ( ) throws FileNotFoundException { return new FileInputStream ( file ) ; } } ) ; } catch ( PrivilegedActionException e ) { // Creating a FileOutputStream can only return a FileNotFoundException throw ( FileNotFoundException ) e . getCause ( ) ; } }
Java 2 security APIs for FileInputStream
113
8
160,781
public static long getFileLength ( final File file ) throws FileNotFoundException { try { return AccessController . doPrivileged ( new PrivilegedExceptionAction < Long > ( ) { @ Override public Long run ( ) throws FileNotFoundException { return file . length ( ) ; } } ) ; } catch ( PrivilegedActionException e ) { // Creating a FileOutputStream can only return a FileNotFoundException throw ( FileNotFoundException ) e . getCause ( ) ; } }
Java 2 security APIs for file length
103
7
160,782
JavaURLContext createJavaURLContext ( Hashtable < ? , ? > envmt , Name name ) { return new JavaURLContext ( envmt , helperServices , name ) ; }
This method should only be called by the JavaURLContextReplacer class for de - serializing an instance of JavaURLContext . The name parameter can be null .
40
33
160,783
public String encodeURL ( HttpSession session , String url ) { return encodeURL ( session , null , url , null ) ; }
called from ConvergedHttpSession . encodeURL path
28
10
160,784
public void complete ( VirtualConnection vc , TCPReadRequestContext rsc ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "complete() called: vc=" + vc ) ; } HttpOutboundServiceContextImpl mySC = ( HttpOutboundServiceContextImpl ) vc . getStateMap ( ) . get ( CallbackIDs . CALLBACK_HTTPOSC ) ; mySC . continueRead ( ) ; }
Called by the channel below us when a read has finished .
111
13
160,785
public void error ( VirtualConnection vc , TCPReadRequestContext rsc , IOException ioe ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "error() called: vc=" + vc + " ioe=" + ioe ) ; } HttpOutboundServiceContextImpl mySC = ( HttpOutboundServiceContextImpl ) vc . getStateMap ( ) . get ( CallbackIDs . CALLBACK_HTTPOSC ) ; // Reading a body from an HTTP/1.0 server that closes the connection // after completely sending the body will trigger an IOException here. if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Socket closure, signaling close." ) ; } // only valid if this response is a non-length delimited body // otherwise pass the exception up to the application channel // PK18799 - check the stored SC values instead of msg as Proxy may // change it on the fly if ( ! mySC . isChunkedEncoding ( ) && ! mySC . isContentLength ( ) ) { mySC . prepareClosure ( ) ; mySC . getAppReadCallback ( ) . complete ( vc ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "IOException during body read" ) ; } mySC . setPersistent ( false ) ; mySC . getAppReadCallback ( ) . error ( vc , ioe ) ; } }
Called by the channel below us when an error occurs during a read .
350
15
160,786
public static void logLoudAndClear ( String textToLog , String callingClass , String callingMethod ) { final String methodName = "logLoudAndClear" ; final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; final String cClass = ( callingClass != null && ! callingClass . isEmpty ( ) ) ? callingClass : "callingClass" ; final String cMethod = ( callingMethod != null && ! callingMethod . isEmpty ( ) ) ? callingMethod : "callingMethod" ; if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "#################################################################################################" + "\n #################################################################################################" + "#################################################################################################" + "\n #################################################################################################" + "#################################################################################################" + "\n #################################################################################################" + "#################################################################################################" + "\n #################################################################################################" + "#################################################################################################" + "\n #################################################################################################" + "#################################################################################################" + "\n #################################################################################################" + "#################################################################################################" + "\n #################################################################################################" + "#################################################################################################" + "\n #################################################################################################" + "#################################################################################################" + "\n " + "\n " + cClass + ": " + cMethod + " is using " + className + ": " + methodName + " \n " + textToLog + "\n " + "\n " + "#################################################################################################" + "\n #################################################################################################" + "#################################################################################################" + "\n #################################################################################################" + "#################################################################################################" + "\n #################################################################################################" + "#################################################################################################" + "\n #################################################################################################" + "#################################################################################################" + "\n #################################################################################################" + "#################################################################################################" + "\n #################################################################################################" + "#################################################################################################" + "\n #################################################################################################" + "#################################################################################################" + "\n #################################################################################################" + "#################################################################################################" ) ; }
logLoudAndClear Log the provided text in a very distinct way making it easy to find it in the trace . log This method should be used for testing and debugging proposes only . This method should not be used in shipped code .
433
47
160,787
private MessagingEngine createMessageEngine ( JsMEConfig me ) throws Exception { String thisMethodName = CLASS_NAME + ".createMessageEngine(JsMEConfig)" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , thisMethodName , "replace ME name here" ) ; } JsMessagingEngine engineImpl = null ; bus = new JsBusImpl ( me , this , ( me . getSIBus ( ) . getName ( ) ) ) ; // getBusProxy(me); engineImpl = new JsMessagingEngineImpl ( this , bus , me ) ; MessagingEngine engine = new MessagingEngine ( me , engineImpl ) ; _messagingEngines . put ( defaultMEUUID , engine ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , thisMethodName , engine . toString ( ) ) ; } return engine ; }
Create a single Message Engine admin object using suppled config object .
226
13
160,788
private JsBusImpl getBusProxy ( JsMEConfig me ) { String thisMethodName = CLASS_NAME + ".getBusProxy(ConfigObject)" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , thisMethodName , "ME Name" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , thisMethodName ) ; } return this . bus ; }
Returns the runtime configuration of the bus to which the supplied messaging engine belongs . If the bus runtime configuration does not yet exist it is created . In liberty this is default bus configuration
119
35
160,789
private JsBusImpl getBusProxy ( String name ) throws SIBExceptionBusNotFound { String thisMethodName = CLASS_NAME + ".getBusProxy(String)" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , thisMethodName , name ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , thisMethodName ) ; } return this . bus ; }
Returns the runtime configuration of the bus to which the named messaging engine belongs . If the bus runtime configuration does not yet exist it is created .
117
28
160,790
public JsBus getBus ( String busName ) throws SIBExceptionBusNotFound { String thisMethodName = CLASS_NAME + ".getBus(String)" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , thisMethodName , busName ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , thisMethodName ) ; } return this . bus ; }
Returns the runtime configuration of the named bus . For liberty is always default bus
116
15
160,791
public Set getMessagingEngineSet ( String busName ) { String thisMethodName = CLASS_NAME + ".getMessagingEngineSet(String)" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , thisMethodName , busName ) ; } Set retSet = new HashSet ( ) ; if ( meConfig != null ) { String meName = meConfig . getMessagingEngine ( ) . getName ( ) ; BaseMessagingEngineImpl engineImpl = getMessagingEngine ( meName ) ; retSet . add ( engineImpl . getUuid ( ) . toString ( ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Integer i = new Integer ( retSet . size ( ) ) ; SibTr . exit ( tc , thisMethodName , i . toString ( ) ) ; } return retSet ; }
Returns the set of messaging engines on the named bus .
208
11
160,792
public String [ ] showMessagingEngines ( ) { String thisMethodName = CLASS_NAME + ".showMessagingEngines()" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , thisMethodName , this ) ; } final String [ ] list = new String [ _messagingEngines . size ( ) ] ; Enumeration e = listMessagingEngines ( ) ; int i = 0 ; while ( e . hasMoreElements ( ) ) { Object c = e . nextElement ( ) ; list [ i ++ ] = ( ( BaseMessagingEngineImpl ) c ) . getBusName ( ) + ":" + ( ( BaseMessagingEngineImpl ) c ) . getName ( ) + ":" + ( ( BaseMessagingEngineImpl ) c ) . getState ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , thisMethodName ) ; } return list ; }
Return a readable string of messaging engines in the process
230
10
160,793
public void startMessagingEngine ( String busName , String name ) throws Exception { String thisMethodName = CLASS_NAME + ".startMessagingEngine(String, String)" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , thisMethodName , new Object [ ] { busName , name } ) ; } BaseMessagingEngineImpl me = ( BaseMessagingEngineImpl ) getMessagingEngine ( busName , name ) ; if ( me != null ) { me . startConditional ( ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Unable to locate engine <bus=" + busName + " name=" + name + ">" ) ; throw new Exception ( "The messaging engine <bus=" + busName + " name=" + name + "> does not exist" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , thisMethodName ) ; } }
Start a messaging engine
246
4
160,794
public boolean isServerStarted ( ) { String thisMethodName = CLASS_NAME + ".isServerStarted()" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , thisMethodName , this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , thisMethodName , new Boolean ( _serverStarted ) ) ; } return _serverStarted ; }
Has the WAS server in which we are contained now started?
116
12
160,795
public boolean isServerStopping ( ) { String thisMethodName = CLASS_NAME + ".isServerStopping()" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , thisMethodName , this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , thisMethodName , new Boolean ( _serverStopping ) ) ; } return _serverStopping ; }
Is the WAS server in which we are contained stopping?
116
11
160,796
public boolean isServerInRecoveryMode ( ) { String thisMethodName = CLASS_NAME + ".isServerInRecoveryMode()" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , thisMethodName , this ) ; } boolean ret = false ; // (_serverMode == Server.RECOVERY_MODE); TBD if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , thisMethodName , new Boolean ( ret ) ) ; } return ret ; }
250606 . 3 recovery mode support
134
7
160,797
public List < String > listDefinedBuses ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "listDefinedBuses" , this ) ; } List buses = null ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , "listDefinedBuses" , buses ) ; } return buses ; }
Returns a list of configured buses in this cell . For liberty this method will return the null value because no directory structure is maintained in liberty for a bus .
106
31
160,798
public static final String base64Decode ( String str , String enc ) throws UnsupportedEncodingException { if ( str == null ) { return null ; } else { byte data [ ] = getBytes ( str ) ; return base64Decode ( new String ( data , enc ) ) ; } }
Converts a String with the given encoding to a base64 encoded String .
63
15
160,799
public static final String base64Decode ( String str ) { if ( str == null ) { return null ; } else { byte data [ ] = getBytes ( str ) ; return toString ( base64Decode ( data ) ) ; } }
Converts a base64 encoded String to a decoded String .
52
13