idx
int64
0
41.2k
question
stringlengths
83
4.15k
target
stringlengths
5
715
37,600
private void readLastScanFile ( ) { final String methodName = "readLastScanFile()" ; final File f = new File ( lastScanFileName ) ; traceDebug ( methodName , "cacheName=" + this . cacheName ) ; if ( f . exists ( ) ) { final CacheOnDisk cod = this ; AccessController . doPrivileged ( new PrivilegedAction ( ) { public Object run ( ) { FileInputStream fis = null ; ObjectInputStream ois = null ; try { fis = new FileInputStream ( f ) ; ois = new ObjectInputStream ( fis ) ; cod . lastScanTime = ois . readLong ( ) ; } catch ( Throwable t ) { com . ibm . ws . ffdc . FFDCFilter . processException ( t , "com.ibm.ws.cache.CacheOnDisk.readLastScanFile" , "611" , cod ) ; traceDebug ( methodName , "cacheName=" + cod . cacheName + "\nException: " + ExceptionUtility . getStackTrace ( t ) ) ; } finally { try { if ( ois != null ) { ois . close ( ) ; } if ( fis != null ) { fis . close ( ) ; } } catch ( Throwable t ) { com . ibm . ws . ffdc . FFDCFilter . processException ( t , "com.ibm.ws.cache.CacheOnDisk.readLastScanFile" , "622" , cod ) ; traceDebug ( methodName , "cacheName=" + cod . cacheName + "\nException: " + ExceptionUtility . getStackTrace ( t ) ) ; } } return null ; } } ) ; } }
Call this method to read the timestamp of the last scan in Last Scan file .
37,601
protected void updateLastScanFile ( ) { final String methodName = "updateLastScanFile()" ; final File f = new File ( lastScanFileName ) ; final CacheOnDisk cod = this ; traceDebug ( methodName , "cacheName=" + this . cacheName ) ; AccessController . doPrivileged ( new PrivilegedAction ( ) { public Object run ( ) { FileOutputStream fos = null ; ObjectOutputStream oos = null ; try { fos = new FileOutputStream ( f ) ; oos = new ObjectOutputStream ( fos ) ; oos . writeLong ( System . currentTimeMillis ( ) ) ; } catch ( Throwable t ) { com . ibm . ws . ffdc . FFDCFilter . processException ( t , "com.ibm.ws.cache.CacheOnDisk.updateLastScanFile" , "650" , cod ) ; traceDebug ( methodName , "cacheName=" + cod . cacheName + "\nException: " + ExceptionUtility . getStackTrace ( t ) ) ; } finally { try { if ( oos != null ) { oos . close ( ) ; } if ( fos != null ) { fos . close ( ) ; } } catch ( Throwable t ) { com . ibm . ws . ffdc . FFDCFilter . processException ( t , "com.ibm.ws.cache.CacheOnDisk.updateLastScanFile" , "661" , cod ) ; traceDebug ( methodName , "cacheName=" + cod . cacheName + "\nException: " + ExceptionUtility . getStackTrace ( t ) ) ; } } return null ; } } ) ; }
Call this method to update the timestamp of the last scan in Last Scan file .
37,602
private void deletePropertyFile ( ) { final String methodName = "deletePropertyFile()" ; final File f = new File ( htodPropertyFileName ) ; final CacheOnDisk cod = this ; traceDebug ( methodName , "cacheName=" + this . cacheName ) ; AccessController . doPrivileged ( new PrivilegedAction ( ) { public Object run ( ) { try { f . delete ( ) ; } catch ( Throwable t ) { com . ibm . ws . ffdc . FFDCFilter . processException ( t , "com.ibm.ws.cache.CacheOnDisk.deletePropertyFile" , "883" , cod ) ; traceDebug ( methodName , "cacheName=" + cod . cacheName + "\nException: " + ExceptionUtility . getStackTrace ( t ) ) ; } return null ; } } ) ; }
Call this method to delete the HTOD property file .
37,603
public void deleteDiskCacheFiles ( ) { final String methodName = "deleteDiskCacheFiles()" ; final File f = new File ( swapDirPath ) ; final CacheOnDisk cod = this ; traceDebug ( methodName , "cacheName=" + this . cacheName ) ; AccessController . doPrivileged ( new PrivilegedAction ( ) { public Object run ( ) { File fl [ ] = f . listFiles ( ) ; for ( int i = 0 ; i < fl . length ; i ++ ) { try { fl [ i ] . delete ( ) ; } catch ( Throwable t ) { com . ibm . ws . ffdc . FFDCFilter . processException ( t , "com.ibm.ws.cache.CacheOnDisk.deleteDiskCacheFiles" , "908" , cod ) ; traceDebug ( methodName , "cacheName=" + cod . cacheName + "\nException: " + ExceptionUtility . getStackTrace ( t ) ) ; } } return null ; } } ) ; }
Call this method to delete all disk cache files per cache instance .
37,604
protected ValueSet readAndDeleteInvalidationFile ( ) { final String methodName = "readAndDeleteInvalidationFile()" ; final File f = new File ( invalidationFileName ) ; final CacheOnDisk cod = this ; this . valueSet = new ValueSet ( 1 ) ; if ( f . exists ( ) ) { AccessController . doPrivileged ( new PrivilegedAction ( ) { public Object run ( ) { FileInputStream fis = null ; ObjectInputStream ois = null ; try { fis = new FileInputStream ( f ) ; ois = new ObjectInputStream ( fis ) ; int size = ois . readInt ( ) ; cod . valueSet = new ValueSet ( size ) ; for ( int i = 0 ; i < size ; i ++ ) { cod . valueSet . add ( ois . readObject ( ) ) ; } } catch ( Throwable t1 ) { com . ibm . ws . ffdc . FFDCFilter . processException ( t1 , "com.ibm.ws.cache.CacheOnDisk.readAndDeleteInvalidationFile" , "1056" , cod ) ; traceDebug ( methodName , "cacheName=" + cod . cacheName + "\nException: " + ExceptionUtility . getStackTrace ( t1 ) ) ; } finally { try { if ( ois != null ) { ois . close ( ) ; } if ( fis != null ) { fis . close ( ) ; } f . delete ( ) ; } catch ( Throwable t2 ) { com . ibm . ws . ffdc . FFDCFilter . processException ( t2 , "com.ibm.ws.cache.CacheOnDisk.readAndDeleteInvalidationFile" , "1068" , cod ) ; traceDebug ( methodName , "cacheName=" + cod . cacheName + "\nException: " + ExceptionUtility . getStackTrace ( t2 ) ) ; } } return null ; } } ) ; } traceDebug ( methodName , "cacheName=" + this . cacheName + " " + invalidationFileName + " valueSet=" + valueSet . size ( ) ) ; return this . valueSet ; }
Call this method to read in all invalidation cache ids if the invalidation file exists . and then delete the invalidation file .
37,605
protected void createInvalidationFile ( ) { final String methodName = "createInvalidationFile()" ; final File f = new File ( invalidationFileName ) ; final CacheOnDisk cod = this ; traceDebug ( methodName , "cacheName=" + this . cacheName + " valueSet=" + cod . valueSet . size ( ) ) ; AccessController . doPrivileged ( new PrivilegedAction ( ) { public Object run ( ) { FileOutputStream fos = null ; ObjectOutputStream oos = null ; try { fos = new FileOutputStream ( f ) ; oos = new ObjectOutputStream ( fos ) ; oos . writeInt ( cod . valueSet . size ( ) ) ; Iterator it = valueSet . iterator ( ) ; while ( it . hasNext ( ) ) { Object entryId = it . next ( ) ; oos . writeObject ( entryId ) ; } } catch ( Throwable t1 ) { com . ibm . ws . ffdc . FFDCFilter . processException ( t1 , "com.ibm.ws.cache.CacheOnDisk.createInvalidationFile" , "1106" , cod ) ; traceDebug ( methodName , "cacheName=" + cod . cacheName + "\nException: " + ExceptionUtility . getStackTrace ( t1 ) ) ; } finally { try { oos . close ( ) ; fos . close ( ) ; } catch ( Throwable t2 ) { com . ibm . ws . ffdc . FFDCFilter . processException ( t2 , "com.ibm.ws.cache.CacheOnDisk.createInvalidationFile" , "1113" , cod ) ; traceDebug ( methodName , "cacheName=" + cod . cacheName + "\nException: " + ExceptionUtility . getStackTrace ( t2 ) ) ; } } return null ; } } ) ; }
Call this method to create invalidation file to offload the invalidation cache ids . When the server is restarted the invalidation cache ids are read back . The LPBT will be called to remove these cache ids from the disk .
37,606
public void alarm ( final Object alarmContext ) { final String methodName = "alarm()" ; synchronized ( this ) { if ( ! stopping && ! this . htod . invalidationBuffer . isDiskClearInProgress ( ) ) { this . htod . invalidationBuffer . invokeBackgroundInvalidation ( HTODInvalidationBuffer . SCAN ) ; } else if ( stopping ) { traceDebug ( methodName , "cacheName=" + this . cacheName + " abort disk cleanup because of server is stopping." ) ; } else { if ( cleanupFrequency == 0 ) { sleepTime = calculateSleepTime ( ) ; } traceDebug ( methodName , "cacheName=" + this . cacheName + " disk clear is in progress - skip disk scan and set alarm sleepTime=" + sleepTime ) ; Scheduler . createNonDeferrable ( sleepTime , alarmContext , new Runnable ( ) { public void run ( ) { alarm ( alarmContext ) ; } } ) ; } } }
Call this method when the alarm is triggered . It is being checked to see whether a disk cleanup is scheduled to run .
37,607
public void clearDiskCache ( ) { if ( htod . clearDiskCache ( ) == HTODDynacache . DISK_EXCEPTION ) { stopOnError ( this . htod . diskCacheException ) ; } else { updateLastScanFile ( ) ; updatePropertyFile ( ) ; createInProgressFile ( ) ; } }
Call this method to clear the disk cache per cache instance .
37,608
public int writeCacheEntry ( CacheEntry ce ) { int returnCode = htod . writeCacheEntry ( ce ) ; if ( returnCode == HTODDynacache . DISK_EXCEPTION ) { stopOnError ( this . htod . diskCacheException ) ; } return returnCode ; }
Call this method to write a cache entry to the disk .
37,609
public CacheEntry readCacheEntry ( Object id ) { Result result = htod . readCacheEntry ( id ) ; if ( result . returnCode == HTODDynacache . DISK_EXCEPTION ) { stopOnError ( result . diskException ) ; this . htod . returnToResultPool ( result ) ; return null ; } CacheEntry cacheEntry = ( CacheEntry ) result . data ; this . htod . returnToResultPool ( result ) ; return cacheEntry ; }
Call this method to read a cache entry from the disk .
37,610
public void delCacheEntry ( CacheEntry ce , int cause , int source , boolean fromDepIdTemplateInvalidation ) { htod . delCacheEntry ( ce , cause , source , fromDepIdTemplateInvalidation ) ; }
Call this method to a cache entry from the disk .
37,611
public void delCacheEntry ( ValueSet removeList , int cause , int source , boolean fromDepIdTemplateInvalidation , boolean fireEvent ) { htod . delCacheEntry ( removeList , cause , source , fromDepIdTemplateInvalidation , fireEvent ) ; }
Call this method to remove multiple of cache ids from the disk .
37,612
public ValueSet readDependency ( Object id , boolean delete ) { Result result = htod . readDependency ( id , delete ) ; if ( result . returnCode == HTODDynacache . DISK_EXCEPTION ) { stopOnError ( result . diskException ) ; this . htod . returnToResultPool ( result ) ; return HTODDynacache . EMPTY_VS ; } ValueSet valueSet = ( ValueSet ) result . data ; if ( valueSet == null ) { valueSet = HTODDynacache . EMPTY_VS ; } this . htod . returnToResultPool ( result ) ; return valueSet ; }
Call this method to read a specified dependency id which contains the cache ids from the disk .
37,613
public ValueSet readTemplate ( String template , boolean delete ) { Result result = htod . readTemplate ( template , delete ) ; if ( result . returnCode == HTODDynacache . DISK_EXCEPTION ) { stopOnError ( result . diskException ) ; this . htod . returnToResultPool ( result ) ; return HTODDynacache . EMPTY_VS ; } ValueSet valueSet = ( ValueSet ) result . data ; if ( valueSet == null ) { valueSet = HTODDynacache . EMPTY_VS ; } this . htod . returnToResultPool ( result ) ; return valueSet ; }
Call this method to read a specified template which contains the cache ids from the disk .
37,614
public ValueSet readTemplatesByRange ( int index , int length ) { Result result = htod . readTemplatesByRange ( index , length ) ; if ( result . returnCode == HTODDynacache . DISK_EXCEPTION ) { stopOnError ( result . diskException ) ; this . htod . returnToResultPool ( result ) ; return HTODDynacache . EMPTY_VS ; } ValueSet valueSet = ( ValueSet ) result . data ; if ( valueSet == null ) { valueSet = HTODDynacache . EMPTY_VS ; } this . htod . returnToResultPool ( result ) ; return valueSet ; }
Call this method to get the template ids based on the index and the length from the disk .
37,615
public int getCacheIdsSize ( boolean filter ) { if ( filter == CacheOnDisk . FILTER ) { return htod . getCacheIdsSize ( filter ) - htod . invalidationBuffer . size ( ) ; } else { return htod . getCacheIdsSize ( filter ) ; } }
Call this method to get the number of the cache ids in the disk .
37,616
public void delDependencyEntry ( Object id , Object entry ) { if ( htod . delDependencyEntry ( id , entry ) == HTODDynacache . DISK_EXCEPTION ) { stopOnError ( this . htod . diskCacheException ) ; } }
Call this method to delete a cache id from a specified dependency in the disk .
37,617
public void delTemplateEntry ( String template , Object entry ) { if ( htod . delTemplateEntry ( template , entry ) == HTODDynacache . DISK_EXCEPTION ) { stopOnError ( this . htod . diskCacheException ) ; } }
Call this method to delete a cache id from a specified template in the disk .
37,618
public void delDependency ( Object id ) { if ( htod . delDependency ( id ) == HTODDynacache . DISK_EXCEPTION ) { stopOnError ( this . htod . diskCacheException ) ; } }
Call this method to delete speciifed dependency id from the disk .
37,619
public void delTemplate ( String template ) { if ( htod . delTemplate ( template ) == HTODDynacache . DISK_EXCEPTION ) { stopOnError ( this . htod . diskCacheException ) ; } }
Call this method to delete speciifed template from the disk .
37,620
public int writeDependency ( Object id , ValueSet vs ) { int returnCode = htod . writeDependency ( id , vs ) ; if ( returnCode == HTODDynacache . DISK_EXCEPTION ) { stopOnError ( this . htod . diskCacheException ) ; } return returnCode ; }
Call this method to write a dependency id with a collection of cache ids to the disk .
37,621
public int writeTemplate ( String template , ValueSet vs ) { int returnCode = htod . writeTemplate ( template , vs ) ; if ( returnCode == HTODDynacache . DISK_EXCEPTION ) { stopOnError ( this . htod . diskCacheException ) ; } return returnCode ; }
Call this method to write a template with a collection of cache ids to the disk .
37,622
public int writeDependencyEntry ( Object id , Object entry ) { int returnCode = htod . writeDependencyEntry ( id , entry ) ; if ( returnCode == HTODDynacache . DISK_EXCEPTION ) { stopOnError ( this . htod . diskCacheException ) ; } return returnCode ; }
Call this method to add a cache id for a specified dependency id to the disk .
37,623
public int writeTemplateEntry ( String template , Object entry ) { int returnCode = htod . writeTemplateEntry ( template , entry ) ; if ( returnCode == HTODDynacache . DISK_EXCEPTION ) { stopOnError ( this . htod . diskCacheException ) ; } return returnCode ; }
Call this method to add a cache id for a specified template to the disk .
37,624
protected long calculateSleepTime ( ) { Calendar c = new GregorianCalendar ( ) ; int currentHour = c . get ( Calendar . HOUR_OF_DAY ) ; int currentMin = c . get ( Calendar . MINUTE ) ; int currentSec = c . get ( Calendar . SECOND ) ; long stime = SECONDS_FOR_24_HOURS - ( ( currentHour * 60 + currentMin ) * 60 + currentSec ) + cleanupHour * 60 * 60 ; if ( stime > SECONDS_FOR_24_HOURS ) { stime = stime - SECONDS_FOR_24_HOURS ; } if ( stime < 10 ) { stime = 10 ; } stime = stime * 1000 ; return stime ; }
return the sleep time in msec
37,625
public void clearInvalidationBuffers ( ) { this . htod . invalidationBuffer . clear ( HTODInvalidationBuffer . EXPLICIT_BUFFER ) ; this . htod . invalidationBuffer . clear ( HTODInvalidationBuffer . SCAN_BUFFER ) ; if ( this . evictionPolicy != CacheConfig . EVICTION_NONE ) { this . htod . invalidationBuffer . clear ( HTODInvalidationBuffer . GC_BUFFER ) ; } }
This method clears invalidaiton buffers in HTODDynacache
37,626
public Result readHashcodeByRange ( int index , int length , boolean debug , boolean useValue ) { Result result = this . htod . readHashcodeByRange ( index , length , debug , useValue ) ; if ( result . returnCode == HTODDynacache . DISK_EXCEPTION ) { stopOnError ( result . diskException ) ; } return result ; }
This method find the hashcode based on index and length .
37,627
public int updateExpirationTime ( Object id , long oldExpirationTime , int size , long newExpirationTime , long newValidatorExpirationTime ) { int returnCode = this . htod . updateExpirationTime ( id , oldExpirationTime , size , newExpirationTime , newValidatorExpirationTime ) ; if ( returnCode == HTODDynacache . DISK_EXCEPTION ) { stopOnError ( this . htod . diskCacheException ) ; } return returnCode ; }
This method is used to update expiration times in GC and disk emtry header
37,628
protected int checkDirectoryWriteable ( String location ) { final String methodName = "checkDirectoryWriteable()" ; int rc = CacheOnDisk . LOCATION_OK ; if ( location . equals ( "" ) ) { rc = CacheOnDisk . LOCATION_NOT_DEFINED ; } else if ( location . startsWith ( "${" ) && location . indexOf ( "}" ) > 0 ) { rc = CacheOnDisk . LOCATION_NOT_VALID ; } else { try { File f = new File ( location ) ; if ( ! f . exists ( ) ) { if ( ! f . mkdirs ( ) ) { rc = CacheOnDisk . LOCATION_CANNOT_MAKE_DIR ; } } else if ( ! f . isDirectory ( ) ) { rc = CacheOnDisk . LOCATION_NOT_DIRECTORY ; } else if ( ! f . canWrite ( ) ) { rc = CacheOnDisk . LOCATION_NOT_WRITABLE ; } } catch ( Throwable t ) { rc = CacheOnDisk . LOCATION_NOT_WRITABLE ; com . ibm . ws . ffdc . FFDCFilter . processException ( t , "com.ibm.ws.cache.CacheOnDisk.checkDirectoryWriteable" , "1779" , this ) ; traceDebug ( methodName , "cacheName=" + this . cacheName + " location=" + location + "\nException: " + ExceptionUtility . getStackTrace ( t ) ) ; } } traceDebug ( methodName , "cacheName=" + this . cacheName + " location=" + location + " rc=" + rc ) ; return rc ; }
Check the location whether it is writable or not
37,629
public static String getRepositorySubpath ( MavenCoordinates artifact ) { StringBuffer buf = new StringBuffer ( ) ; String [ ] groupDirs = artifact . getGroupId ( ) . split ( "\\." ) ; for ( String dir : groupDirs ) { buf . append ( dir ) . append ( "/" ) ; } buf . append ( artifact . getArtifactId ( ) ) . append ( "/" ) . append ( artifact . getVersion ( ) ) ; return buf . toString ( ) ; }
Gets the expected path within a Maven repository for the given Maven artifact based on its Maven coordinates .
37,630
public static String getFileName ( MavenCoordinates artifact , Constants . ArtifactType type ) { return artifact . getArtifactId ( ) + "-" + artifact . getVersion ( ) + type . getMavenFileExtension ( ) ; }
Gets the expected file name for a Maven artifact based on its Maven coordinates .
37,631
public void clearBody ( ) throws javax . jms . JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "clearBody" ) ; super . clearBody ( ) ; dataBuffer = null ; dataStart = 0 ; readStream = null ; if ( jsBytesMsg != null ) { jsBytesMsg . setBytes ( null ) ; jsBytesMsg . setObjectProperty ( ApiJmsConstants . ENCODING_PROPERTY , null ) ; jsBytesMsg . setObjectProperty ( ApiJmsConstants . CHARSET_PROPERTY , null ) ; } integerEncoding = ApiJmsConstants . ENC_INTEGER_NORMAL ; floatEncoding = ApiJmsConstants . ENC_FLOAT_IEEE_NORMAL ; cachedBytesToString = null ; if ( ! producerWontModifyPayloadAfterSet ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Producer might modify the payload after set - encoding is required, so reinitialise encoding relating variables" ) ; _writeBytes = new ByteArrayOutputStream ( ) ; writeStream = new DataOutputStream ( _writeBytes ) ; integer_count = 0 ; integer_offsets = new int [ ARRAY_SIZE ] ; integer_sizes = new int [ ARRAY_SIZE ] ; if ( integers != null ) integers . removeAllElements ( ) ; if ( float_offsets != null ) float_offsets . removeAllElements ( ) ; if ( float_values != null ) float_values . removeAllElements ( ) ; bodySetInJsMsg = false ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Producer has promised not to modify payload - ensure write streams used for encoding are null" ) ; _writeBytes = null ; writeStream = null ; writeByteArrayCalled = false ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "clearBody" ) ; }
Clear out the message body . All other parts of the message are left untouched .
37,632
public byte readByte ( ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "readByte" ) ; try { checkBodyReadable ( "readByte" ) ; if ( requiresInit ) lazyInitForReading ( ) ; byte byteRead = readStream . readByte ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "readByte" , byteRead ) ; return byteRead ; } catch ( IOException e ) { JMSException jmse = ( JMSException ) JmsErrorUtils . newThrowable ( MessageEOFException . class , "END_BYTESMESSAGE_CWSIA0183" , null , tc ) ; jmse . initCause ( e ) ; throw jmse ; } }
Read a signed 8 - bit value from the stream message .
37,633
public int readBytes ( byte [ ] value , int length ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "readBytes" , new Object [ ] { value , length } ) ; try { checkBodyReadable ( "readBytes" ) ; if ( requiresInit ) lazyInitForReading ( ) ; if ( value . length < length || length < 0 ) throw new IndexOutOfBoundsException ( ) ; int result = readStream . read ( value , 0 , length ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "readBytes" , result ) ; return result ; } catch ( IOException e ) { JMSException jmse = ( JMSException ) JmsErrorUtils . newThrowable ( MessageEOFException . class , "END_BYTESMESSAGE_CWSIA0183" , null , tc ) ; jmse . initCause ( e ) ; throw jmse ; } }
Read a portion of the bytes message stream .
37,634
public char readChar ( ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "readChar" ) ; try { checkBodyReadable ( "readChar" ) ; if ( requiresInit ) lazyInitForReading ( ) ; readStream . mark ( 2 ) ; char result = readStream . readChar ( ) ; if ( integerEncoding == ApiJmsConstants . ENC_INTEGER_REVERSED ) { result = Character . reverseBytes ( result ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "readChar" , result ) ; return result ; } catch ( IOException e ) { try { readStream . reset ( ) ; } catch ( IOException e2 ) { } JMSException jmse = ( JMSException ) JmsErrorUtils . newThrowable ( MessageEOFException . class , "END_BYTESMESSAGE_CWSIA0183" , null , tc ) ; jmse . initCause ( e ) ; throw jmse ; } }
Read a Unicode character value from the stream message .
37,635
public long readLong ( ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "readLong" ) ; try { checkBodyReadable ( "readLong" ) ; if ( requiresInit ) lazyInitForReading ( ) ; readStream . mark ( 8 ) ; long result = readStream . readLong ( ) ; if ( integerEncoding == ApiJmsConstants . ENC_INTEGER_REVERSED ) { result = Long . reverseBytes ( result ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "readLong" , result ) ; return result ; } catch ( IOException e ) { try { readStream . reset ( ) ; } catch ( IOException e2 ) { } throw ( JMSException ) JmsErrorUtils . newThrowable ( JMSException . class , "EXCEPTION_RECEIVED_CWSIA0190" , new Object [ ] { e , "JmsBytesMessageImpl.readLong" } , e , "JmsBytesMessageImpl.readLong#1" , this , tc ) ; } }
Read a signed 64 - bit integer from the stream message .
37,636
public String readUTF ( ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "readUTF" ) ; String result ; try { checkBodyReadable ( "readUTF" ) ; if ( requiresInit ) lazyInitForReading ( ) ; readStream . mark ( 8 ) ; result = readStream . readUTF ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "readUTF" , result ) ; return result ; } catch ( IOException e ) { try { readStream . reset ( ) ; } catch ( IOException e2 ) { } JMSException jmse = ( JMSException ) JmsErrorUtils . newThrowable ( MessageEOFException . class , "END_BYTESMESSAGE_CWSIA0183" , null , tc ) ; jmse . initCause ( e ) ; throw jmse ; } }
Read in a string that has been encoded using a modified UTF - 8 format from the stream message .
37,637
public void reset ( ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "reset" ) ; if ( ! isBodyReadOnly ( ) ) { if ( ! producerWontModifyPayloadAfterSet ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Body is writeable & producer might modify the payload, so encode the write stream" ) ; dataBuffer = _writeBytes . toByteArray ( ) ; lastEncoding = integerEncoding | floatEncoding ; jsBytesMsg . setBytes ( _exportBody ( lastEncoding ) ) ; bodySetInJsMsg = true ; writeStream = null ; _writeBytes = null ; } dataStart = 0 ; setBodyReadOnly ( ) ; } if ( dataBuffer == null ) dataBuffer = new byte [ 0 ] ; _readBytes = new ByteArrayInputStream ( dataBuffer ) ; readStream = new DataInputStream ( _readBytes ) ; try { readStream . skip ( dataStart ) ; } catch ( IOException e ) { } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "reset" ) ; }
Put the message in read - only mode and reposition the stream of bytes to the beginning .
37,638
public void writeBytes ( byte [ ] value ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "writeBytes" , value ) ; try { checkBodyWriteable ( "writeBytes" ) ; if ( producerWontModifyPayloadAfterSet ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Producer has promised not to modify the payload after setting it in the message - check if they've violated that promise" ) ; if ( ! writeByteArrayCalled ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "This is the first call to writeBytes(byte[] value) - storing the byte array reference directly in the underlying MFP object" ) ; writeByteArrayCalled = true ; jsBytesMsg . setBytes ( value ) ; dataBuffer = value ; dataStart = 0 ; } else { throw ( JMSException ) JmsErrorUtils . newThrowable ( IllegalStateException . class , "PROMISE_BROKEN_EXCEPTION_CWSIA0511" , null , null , "JmsBytesMessageImpl.writeBytes#3" , this , tc ) ; } } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Producer 'payload modification' promise is not in place - make a copy of the byte array" ) ; writeStream . write ( value , 0 , value . length ) ; bodySetInJsMsg = false ; } cachedBytesToString = null ; } catch ( IOException ex ) { throw ( JMSException ) JmsErrorUtils . newThrowable ( ResourceAllocationException . class , "WRITE_PROBLEM_CWSIA0186" , null , ex , "JmsBytesMessageImpl.writeBytes#4" , this , tc ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "writeBytes" ) ; }
Write a byte array to the stream message .
37,639
public void writeBytes ( byte [ ] value , int offset , int length ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "writeBytes" , new Object [ ] { value , offset , length } ) ; try { checkProducerPromise ( "writeBytes(byte[], int, int)" , "JmsBytesMessageImpl.writeBytes#2" ) ; checkBodyWriteable ( "writeBytes" ) ; writeStream . write ( value , offset , length ) ; cachedBytesToString = null ; bodySetInJsMsg = false ; } catch ( IOException ex ) { throw ( JMSException ) JmsErrorUtils . newThrowable ( ResourceAllocationException . class , "WRITE_PROBLEM_CWSIA0186" , null , ex , "JmsBytesMessageImpl.writeBytes#1" , this , tc ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "writeBytes" ) ; }
Write a portion of a byte array to the stream message .
37,640
public void writeObject ( Object value ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "writeObject" ) ; checkProducerPromise ( "writeObject(Object)" , "JmsBytesMessageImpl.writeObject#1" ) ; checkBodyWriteable ( "writeObject" ) ; if ( value instanceof byte [ ] ) writeBytes ( ( byte [ ] ) value ) ; else if ( value instanceof String ) writeUTF ( ( String ) value ) ; else if ( value instanceof Integer ) writeInt ( ( ( Integer ) value ) . intValue ( ) ) ; else if ( value instanceof Byte ) writeByte ( ( ( Byte ) value ) . byteValue ( ) ) ; else if ( value instanceof Short ) writeShort ( ( ( Short ) value ) . shortValue ( ) ) ; else if ( value instanceof Long ) writeLong ( ( ( Long ) value ) . longValue ( ) ) ; else if ( value instanceof Float ) writeFloat ( ( ( Float ) value ) . floatValue ( ) ) ; else if ( value instanceof Double ) writeDouble ( ( ( Double ) value ) . doubleValue ( ) ) ; else if ( value instanceof Character ) writeChar ( ( ( Character ) value ) . charValue ( ) ) ; else if ( value instanceof Boolean ) writeBoolean ( ( ( Boolean ) value ) . booleanValue ( ) ) ; else if ( value == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "given null, throwing NPE" ) ; throw new NullPointerException ( ) ; } else { throw ( JMSException ) JmsErrorUtils . newThrowable ( MessageFormatException . class , "BAD_OBJECT_CWSIA0185" , new Object [ ] { value . getClass ( ) . getName ( ) } , tc ) ; } cachedBytesToString = null ; bodySetInJsMsg = false ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "writeObject" ) ; }
Write a Java object to the stream message .
37,641
protected JsJmsMessage getMsgReference ( ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getMsgReference" ) ; if ( ! isBodyReadOnly ( ) && ! producerWontModifyPayloadAfterSet ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Body is writeable & producer hasn't promised not to modify the payload - attempt encoding" ) ; try { int encoding = integerEncoding | floatEncoding ; if ( propertyExists ( ApiJmsConstants . ENCODING_PROPERTY ) ) { encoding = getIntProperty ( ApiJmsConstants . ENCODING_PROPERTY ) ; } if ( bodySetInJsMsg && ( encoding == lastEncoding ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Body cached - encoding not necessary" ) ; } else { byte [ ] encodedBody = _exportBody ( encoding ) ; jsBytesMsg . setBytes ( encodedBody ) ; lastEncoding = encoding ; bodySetInJsMsg = true ; } } catch ( JMSException e ) { throw e ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getMsgReference" , jsBytesMsg ) ; return jsBytesMsg ; }
override the getMsgReference method of the parent class . We need to ensure that the message body is written into the JS message before returning the reference to it .
37,642
private void recordInteger ( int offset , int length ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "recordInteger" , new Object [ ] { offset , length } ) ; if ( integer_count == ARRAY_SIZE ) { if ( integers == null ) integers = new Vector ( ) ; integers . addElement ( integer_offsets ) ; integers . addElement ( integer_sizes ) ; integer_offsets = new int [ ARRAY_SIZE ] ; integer_sizes = new int [ ARRAY_SIZE ] ; integer_count = 0 ; } integer_offsets [ integer_count ] = offset ; integer_sizes [ integer_count ++ ] = length ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "recordInteger" ) ; }
Records the presence of an integer - style item in the bytes message stream . This method is called by the writeXXX methods to keep a track of where the integer items are so they can be byteswapped if necessary at send time .
37,643
private void reverse ( byte [ ] buffer , int offset , int length ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "reverse" , new Object [ ] { buffer , offset , length } ) ; byte temp ; for ( int i = 0 ; i < length / 2 ; i ++ ) { temp = buffer [ offset + i ] ; buffer [ offset + i ] = buffer [ offset + ( length - 1 ) - i ] ; buffer [ offset + ( length - 1 ) - i ] = temp ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "reverse" ) ; }
This method reverses a sequence of bytes within a byte array . It is used for byte swapping numeric values
37,644
private void checkProducerPromise ( String jmsMethod , String ffdcProbeID ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "checkProducerPromise" , new Object [ ] { jmsMethod , ffdcProbeID } ) ; if ( producerWontModifyPayloadAfterSet ) { throw ( JMSException ) JmsErrorUtils . newThrowable ( IllegalStateException . class , "PROMISE_BROKEN_EXCEPTION_CWSIA0510" , new Object [ ] { jmsMethod } , null , ffdcProbeID , this , tc ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "checkProducerPromise" ) ; }
Checks to see if the producer has promised not to modify the payload after it s been set . If they have then throw a JMS exception based on the parameters
37,645
public void stopConsumer ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "stopConsumer" ) ; try { synchronized ( consumerSession ) { consumerSession . getConsumerSession ( ) . stop ( ) ; consumerSession . started = false ; } } catch ( Throwable t ) { FFDCFilter . processException ( t , CLASS_NAME + ".consumeMessages" , CommsConstants . CATASYNCHRHREADER_CONSUME_MSGS_02 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Unable to stop consumer session due to Throwable: " + t ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "stopConsumer" ) ; }
Safely stop the consumer
37,646
public boolean setClassifications ( Flow [ ] newFlows ) throws InvalidFlowsException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setClassifications" , newFlows ) ; boolean noClassChange = true ; if ( flows == null || ( flows . length != newFlows . length ) ) { noClassChange = false ; } ArrayList < String > newClassificationNames = new ArrayList < String > ( ) ; HashMap < String , ClassWeight > newMessageClasses = new HashMap < String , ClassWeight > ( ) ; HashMap < Integer , Integer > newWeightMap = new HashMap < Integer , Integer > ( ) ; newClassificationNames . add ( 0 , "$SIdefault" ) ; for ( int i = 0 ; i < newFlows . length ; i ++ ) { String nextClassificationName = newFlows [ i ] . getClassification ( ) ; if ( noClassChange && ! classificationNames . contains ( nextClassificationName ) ) { noClassChange = false ; } ClassWeight classWeight = new ClassWeight ( i + 1 , newFlows [ i ] . getWeighting ( ) ) ; ClassWeight cw = newMessageClasses . put ( nextClassificationName , classWeight ) ; if ( cw != null ) { InvalidFlowsException ife = new InvalidFlowsException ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setClassifications" , ife ) ; throw ife ; } newClassificationNames . add ( i + 1 , nextClassificationName ) ; newWeightMap . put ( Integer . valueOf ( i + 1 ) , Integer . valueOf ( newFlows [ i ] . getWeighting ( ) ) ) ; } classificationNames = newClassificationNames ; messageClasses = newMessageClasses ; weightMap = newWeightMap ; this . flows = newFlows . clone ( ) ; numberOfClasses = flows . length ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setClassifications" , Boolean . valueOf ( noClassChange ) ) ; return noClassChange ; }
Supports the setting of a new set of classifications based on a set of Flows provided by the caller .
37,647
public int getNumberOfClasses ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getNumberOfClasses" ) ; SibTr . exit ( tc , "getNumberOfClasses" , Integer . valueOf ( numberOfClasses ) ) ; } return numberOfClasses ; }
Retrieve the number of classifications specified in the current set .
37,648
public int getPosition ( String classificationName ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getPosition" , classificationName ) ; int classPos = 0 ; ClassWeight cw = messageClasses . get ( classificationName ) ; if ( cw != null ) classPos = cw . getPosition ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getPosition" , Integer . valueOf ( classPos ) ) ; return classPos ; }
Get the index of a named classification .
37,649
public int getWeight ( String classificationName ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getWeight" , classificationName ) ; int weight = 0 ; ClassWeight cw = messageClasses . get ( classificationName ) ; if ( cw != null ) weight = cw . getWeight ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getWeight" , Integer . valueOf ( weight ) ) ; return weight ; }
Get the weight of a named classification .
37,650
public int findClassIndex ( HashMap < Integer , Integer > weightMap ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "findClassIndex" ) ; int classPos = 0 ; int randWeight = 0 ; int totalWeight = 0 ; Iterator < Integer > iter = weightMap . values ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { Integer weight = iter . next ( ) ; totalWeight = totalWeight + weight . intValue ( ) ; } if ( totalWeight > 0 ) { randWeight = Math . abs ( rand . nextInt ( ) % totalWeight ) ; Iterator < Map . Entry < Integer , Integer > > iter2 = weightMap . entrySet ( ) . iterator ( ) ; int aggregateWeight = 0 ; while ( iter2 . hasNext ( ) ) { Map . Entry entry = ( Map . Entry ) iter2 . next ( ) ; Integer mappos = ( Integer ) entry . getKey ( ) ; Integer weight = ( Integer ) entry . getValue ( ) ; aggregateWeight = aggregateWeight + weight . intValue ( ) ; classPos = mappos . intValue ( ) ; if ( randWeight <= aggregateWeight ) break ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "findClassIndex" , classPos ) ; return classPos ; }
Find a pseudo random classification index based on the weightings table .
37,651
public Flow [ ] getFlows ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getFlows" ) ; } Flow [ ] clonedFlows = flows . clone ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , "getFlows" , clonedFlows ) ; } return clonedFlows ; }
Returns the array of flows defined in this classification specified by XD .
37,652
public Map < Object , Object > getPropertyBag ( ) { if ( this . properties == null ) { this . properties = new HashMap < Object , Object > ( ) ; } return this . properties ; }
Fetch the property bag associated with this Chain .
37,653
public ChainDataImpl getExternalChainData ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( this , tc , "getExternalChainData" ) ; } ChannelData [ ] parents = new ChannelData [ this . channelDataArray . length ] ; for ( int i = 0 ; i < parents . length ; i ++ ) { parents [ i ] = ( ( ChildChannelDataImpl ) this . channelDataArray [ i ] ) . getParent ( ) ; } ChainDataImpl externalChainData = null ; try { externalChainData = new ChainDataImpl ( getName ( ) , getType ( ) , parents , null ) ; } catch ( IncoherentChainException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "Unable to build external version of chain data, " + getName ( ) ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( this , tc , "getExternalChainData" ) ; } return externalChainData ; }
Create a cloned representation of this chain data which only includes references to parent channel data objects . It hides the children and their names .
37,654
public final void addChainEventListener ( ChainEventListener listener ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "addChainEventListener: " + listener ) ; } if ( null != listener ) { this . chainEventListeners . add ( listener ) ; } }
Enables external entities to be notified of chain events described in ChainEventListener interface .
37,655
public final void removeChainEventListener ( ChainEventListener listener ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "removeChainEventListener: " + listener ) ; } if ( null != listener ) { if ( ! this . chainEventListeners . remove ( listener ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "Cannot find listener to be removed" ) ; } } } }
Removes a listener from the list of those being informed of chain events on this chain .
37,656
public Set < ChainEventListener > removeAllChainEventListeners ( ) { Set < ChainEventListener > returnListeners = new HashSet < ChainEventListener > ( this . chainEventListeners ) ; this . chainEventListeners . clear ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "removeAllChainEventListeners" , returnListeners ) ; } return returnListeners ; }
Remove the chain event listeners from this configuration and return them in a new hash set . This method is called during the updateChain in order to move the event listeners from the old config to the new one .
37,657
public void setChainEventListeners ( Set < ChainEventListener > newListeners ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "removeAllChainEventListeners" , newListeners ) ; } chainEventListeners . clear ( ) ; chainEventListeners . addAll ( newListeners ) ; }
Set the list of chain event listeners for this chain configuration . This method was originally created to pass along chain event listeners from one chain config to another chain config during the updateChain method .
37,658
public final void chainInitialized ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( this , tc , "chainInitialized, chain: " + this . name ) ; } for ( ChainEventListener listener : chainEventListeners ) { listener . chainInitialized ( this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( this , tc , "chainInitialized" ) ; } }
This method is called when the chain has been initialized . It informs each of the chain event listeners .
37,659
public final void chainStartFailed ( int attemptsMade , int attemptsLeft ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( this , tc , "chainStartFailed, chain: " + this . name ) ; } for ( ChainEventListener listener : chainEventListeners ) { if ( listener instanceof RetryableChainEventListener ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Calling chain retryable chain event listener" ) ; } ( ( RetryableChainEventListener ) listener ) . chainStartFailed ( this , attemptsMade , attemptsLeft ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( this , tc , "chainStartFailed" ) ; } }
This method is called when the chain start fails . It informs each of the chain event listeners .
37,660
public CFEndPoint getEndPoint ( ) throws ChannelFrameworkException { if ( null == this . endPoint ) { if ( FlowType . INBOUND . equals ( this . type ) ) { this . endPoint = new CFEndPointImpl ( this ) ; } else { throw new ChannelFrameworkException ( this . name + " is not inbound chain" ) ; } } return this . endPoint ; }
Access the possible endpoint representation of this chain . This will throw an exception if the chain is not inbound .
37,661
protected String getRawProperty ( String key ) { String rawValue = source . getValue ( key ) ; if ( rawValue != null ) { current . put ( key , rawValue ) ; } return rawValue ; }
Return the raw unconverted String associated with a key .
37,662
protected final TagAttribute getRequiredAttribute ( String localName ) throws TagException { TagAttribute attr = this . getAttribute ( localName ) ; if ( attr == null ) { throw new TagException ( this . tag , "Attribute '" + localName + "' is required" ) ; } return attr ; }
Utility method for fetching a required TagAttribute
37,663
public void setInputHandler ( ProducerInputHandler inputHandler ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setInputHandler" , inputHandler ) ; this . inputHandler = inputHandler ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setInputHandler" ) ; }
Sets the inputHandler for this destination .
37,664
void setBus ( String busName ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setBus" , busName ) ; this . busName = busName ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setBus" ) ; }
Sets the bus name for this destination .
37,665
public void setForeignBusSendAllowed ( boolean sendAllowed ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "setForeignBusSendAllowed" , Boolean . valueOf ( sendAllowed ) ) ; } _sendAllowedOnTargetForeignBus = Boolean . valueOf ( sendAllowed ) ; if ( aliasesThatTargetThisDest != null ) { synchronized ( aliasesThatTargetThisDest ) { Iterator i = aliasesThatTargetThisDest . iterator ( ) ; while ( i . hasNext ( ) ) { AbstractAliasDestinationHandler abstractAliasDestinationHandler = ( AbstractAliasDestinationHandler ) i . next ( ) ; abstractAliasDestinationHandler . setForeignBusSendAllowed ( sendAllowed ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , "setForeignBusSendAllowed" ) ; } }
Set the Foreign Bus Level sendAllowed flag
37,666
public static < U > CompletableFuture < U > failedFuture ( Throwable x ) { throw new UnsupportedOperationException ( Tr . formatMessage ( tc , "CWWKC1156.not.supported" , "ManagedExecutor.failedFuture" ) ) ; }
Because CompletableFuture . failedFuture is static this is not a true override . It will be difficult for the user to invoke this method because they would need to get the class of the CompletableFuture implementation and locate the static failedFuture method on that .
37,667
public static < U > CompletionStage < U > failedStage ( Throwable x ) { throw new UnsupportedOperationException ( Tr . formatMessage ( tc , "CWWKC1156.not.supported" , "ManagedExecutor.failedStage" ) ) ; }
Because CompletableFuture . failedStage is static this is not a true override . It will be difficult for the user to invoke this method because they would need to get the class of the CompletableFuture implementation and locate the static failedStage method on that .
37,668
public static < T > CompletableFuture < T > newIncompleteFuture ( Executor executor ) { if ( JAVA8 ) return new ManagedCompletableFuture < T > ( new CompletableFuture < T > ( ) , executor , null ) ; else return new ManagedCompletableFuture < T > ( executor , null ) ; }
Construct a new incomplete CompletableFuture that is backed by the specified executor .
37,669
public static CompletableFuture < Void > runAsync ( Runnable action ) { throw new UnsupportedOperationException ( Tr . formatMessage ( tc , "CWWKC1156.not.supported" , "ManagedExecutor.runAsync" ) ) ; }
Because CompletableFuture . runAsync is static this is not a true override . It will be difficult for the user to invoke this method because they would need to get the class of the CompletableFuture implementation and locate the static runAsync method on that .
37,670
public static < U > CompletableFuture < U > supplyAsync ( Supplier < U > action ) { throw new UnsupportedOperationException ( Tr . formatMessage ( tc , "CWWKC1156.not.supported" , "ManagedExecutor.supplyAsync" ) ) ; }
Because CompletableFuture . supplyAsync is static this is not a true override . It will be difficult for the user to invoke this method because they would need to get the class of the CompletableFuture implementation and locate the static supplyAsync method on that .
37,671
private ThreadContextDescriptor captureThreadContext ( Executor executor ) { WSManagedExecutorService managedExecutor = defaultExecutor instanceof WSManagedExecutorService ? ( WSManagedExecutorService ) defaultExecutor : executor != defaultExecutor && executor instanceof WSManagedExecutorService ? ( WSManagedExecutorService ) executor : null ; if ( managedExecutor == null ) return null ; @ SuppressWarnings ( "unchecked" ) ThreadContextDescriptor contextDescriptor = managedExecutor . getContextService ( ) . captureThreadContext ( XPROPS_SUSPEND_TRAN ) ; return contextDescriptor ; }
Captures thread context if possible first based on the default asynchronous execution facility otherwise based on the specified executor . If neither of these executors are a managed executor then thread context is not captured .
37,672
private final static FutureRefExecutor supportsAsync ( Executor executor ) { if ( executor instanceof ExecutorService ) return new FutureRefExecutor ( ( ExecutorService ) executor ) ; if ( executor instanceof UnusableExecutor ) throw new UnsupportedOperationException ( ) ; return null ; }
Convenience method to validate that an executor supports running asynchronously and to wrap the executor if an ExecutorService with FutureRefExecutor . This method is named supportsAsync to make failure stacks more meaningful to users .
37,673
static File validateDirectory ( final File directory ) { File newDirectory = null ; try { newDirectory = AccessController . doPrivileged ( new java . security . PrivilegedExceptionAction < File > ( ) { public File run ( ) throws Exception { boolean ok = true ; if ( ! directory . exists ( ) ) ok = directory . mkdirs ( ) || directory . exists ( ) ; if ( ! ok ) { Tr . error ( tc , "UNABLE_TO_DELETE_RESOURCE_NOEX" , new Object [ ] { directory . getAbsolutePath ( ) } ) ; return null ; } return directory ; } } ) ; } catch ( PrivilegedActionException e ) { Tr . error ( tc , "UNABLE_TO_DELETE_RESOURCE" , new Object [ ] { directory . getAbsolutePath ( ) , e } ) ; } return newDirectory ; }
This method will create the directory if it does not exist ensuring the specified location is writable .
37,674
static File createNewFile ( final FileLogSet fileLogSet ) { final File directory = fileLogSet . getDirectory ( ) ; final String fileName = fileLogSet . getFileName ( ) ; final String fileExtension = fileLogSet . getFileExtension ( ) ; File f = null ; try { f = AccessController . doPrivileged ( new java . security . PrivilegedExceptionAction < File > ( ) { public File run ( ) throws Exception { return fileLogSet . createNewFile ( ) ; } } ) ; } catch ( PrivilegedActionException e ) { File exf = new File ( directory , fileName + fileExtension ) ; Tr . error ( tc , "UNABLE_TO_DELETE_RESOURCE" , new Object [ ] { exf . getAbsolutePath ( ) , e } ) ; } return f ; }
This method will create a new file with the specified name and extension in the specified directory . If a unique file is required then it will add a timestamp to the file and if necessary a unqiue identifier to the file name .
37,675
public void releaseBuffers ( ) { if ( payloadBuffers != null ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "release payload buffers. number to release is: " + payloadCountOfBuffers ) ; } for ( int i = 0 ; i < payloadCountOfBuffers ; i ++ ) { payloadBuffers [ i ] . release ( ) ; } payloadBuffers = null ; payloadCountOfBuffers = 0 ; } else { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "release buffers from frame list. number to release is: " + countOfIOFrames ) ; } if ( countOfIOFrames > 0 ) { for ( int i = 0 ; i < countOfIOFrames ; i ++ ) { fpList [ i ] . releaseBuffers ( ) ; } } else { frameProcessor . releaseBuffers ( ) ; } } }
This is never called except in an exception case . frame buffers should be cleaned up when reset is called on the FrameReadProcessor
37,676
public static boolean methodParamsMatch ( List < String > typeNames , Class < ? > [ ] types ) { if ( typeNames . size ( ) != types . length ) { return false ; } for ( int i = 0 ; i < types . length ; i ++ ) { String typeName = typeNames . get ( i ) ; int typeNameEnd = typeName . length ( ) ; Class < ? > type = types [ i ] ; for ( ; type . isArray ( ) ; type = type . getComponentType ( ) ) { if ( typeNameEnd < 2 || typeName . charAt ( -- typeNameEnd ) != ']' || typeName . charAt ( -- typeNameEnd ) != '[' ) { return false ; } } if ( ! type . getName ( ) . regionMatches ( 0 , typeName , 0 , typeNameEnd ) ) { return false ; } } return true ; }
Checks if the specified method parameters object matches the specified method parameter types .
37,677
String evaluateExpression ( String expr ) throws ConfigEvaluatorException { ConfigExpressionScanner scanner = new ConfigExpressionScanner ( expr ) ; if ( ! parseOperand ( expr , scanner , true ) ) { return null ; } if ( resultExpr != null ) { return scanner . end ( ) ? resultExpr : null ; } subtotal = value ; while ( ! scanner . end ( ) ) { ConfigExpressionScanner . NumericOperator op = scanner . scanNumericOperator ( ) ; if ( op == null ) { return null ; } if ( ! parseOperand ( expr , scanner , false ) || ( resultExpr != null ) ) { return null ; } subtotal = op . evaluate ( subtotal , value ) ; } return String . valueOf ( subtotal ) ; }
Evaluate a variable expression .
37,678
private int evaluateCountExpression ( Object value ) { if ( value == null ) { return 0 ; } if ( value . getClass ( ) . isArray ( ) ) { return Array . getLength ( value ) ; } if ( value instanceof Vector < ? > ) { return ( ( Vector < ? > ) value ) . size ( ) ; } return 1 ; }
Evaluates the count expression function . If the value is null then 0 is returned . If the value is an array the length is returned . If the value is a vector the size is returned . Otherwise 1 is returned .
37,679
public Map < String , Object > getRequestCookieMap ( ) { if ( _requestCookieMap == null ) { checkHttpServletRequest ( ) ; _requestCookieMap = new CookieMap ( _httpServletRequest ) ; } return _requestCookieMap ; }
would be more elegant - = Simon Lessard = -
37,680
public LockingCursor getDefaultGetCursor ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getDefaultGetCursor" ) ; LockingCursor cursor = consumerKeyFilter [ 0 ] . getGetCursor ( ) ; if ( keyGroup != null ) cursor = keyGroup . getDefaultGetCursor ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getDefaultGetCursor" , cursor ) ; return cursor ; }
Return the getCursor for this consumer . This method is only called in the case where messages are not classified by XD .
37,681
private int chooseGetCursorIndex ( int classification ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "chooseGetCursorIndex" ) ; int classIndex = 0 ; if ( classifyingMessages ) classIndex = consumerSet . chooseGetCursorIndex ( classification ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "chooseGetCursorIndex" , classIndex ) ; return classIndex ; }
Determine the index of the getCursor to use based on the classifications defined for the ConsumerSet that a consumer belongs to . If SIB is not registered with XD and no classification is being performed then the default index is returned
37,682
public void detach ( ) throws SIResourceException , SINotPossibleInCurrentConfigurationException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "detach" ) ; notReady ( ) ; if ( keyGroup != null ) keyGroup . removeMember ( this ) ; consumerDispatcher . detachConsumerPoint ( this ) ; if ( classifyingMessages ) { consumerSet . takeClassificationReadLock ( ) ; int numFilters = consumerKeyFilter . length ; for ( int i = 0 ; i < numFilters ; i ++ ) consumerKeyFilter [ i ] . detach ( ) ; consumerSet . freeClassificationReadLock ( ) ; } else consumerKeyFilter [ 0 ] . detach ( ) ; synchronized ( this ) { detached = true ; } if ( classifyingMessages ) consumerSet . removeConsumer ( consumerPoint ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "detach" ) ; }
Detach this consumer
37,683
public SIBUuid12 getConnectionUuid ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getConnectionUuid" ) ; SibTr . exit ( tc , "getConnectionUuid" , connectionUuid ) ; } return connectionUuid ; }
Return the consumer s connection Uuid
37,684
public boolean requiresRecovery ( SIMPMessage msg ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "requiresRecovery" , new Object [ ] { msg } ) ; boolean recoverable ; Reliability msgReliability = msg . getReliability ( ) ; recoverable = msgReliability . compareTo ( unrecoverability ) > 0 ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "requiresRecovery" , Boolean . valueOf ( recoverable ) ) ; return recoverable ; }
Determine if this consumer will require this message to be recoverable
37,685
public void markNotReady ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "markNotReady" ) ; ready = false ; if ( keyGroup != null ) keyGroup . markNotReady ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "markNotReady" ) ; }
Make this key not ready
37,686
public JSConsumerKey getParent ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getParent" ) ; JSConsumerKey key = this ; if ( keyGroup != null ) key = keyGroup ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getParent" , key ) ; return key ; }
Return this key s parent if it is a member of a keyGroup
37,687
public void start ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "start" ) ; if ( ! started ) { started = true ; if ( keyGroup != null ) keyGroup . startMember ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "start" ) ; }
The ConsumerKey doesn t actually care if the consumer is started but its ConsumerKey does
37,688
public void stop ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "stop" ) ; if ( started ) { started = false ; if ( keyGroup != null ) keyGroup . stopMember ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "stop" ) ; }
The ConsumerKey doesn t actually care if the consumer is stopped but its ConsumerKey does
37,689
private void createNewFiltersAndCursors ( ItemStream itemStream ) throws SIResourceException , MessageStoreException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createNewFiltersAndCursors" , itemStream ) ; LockingCursor cursor = null ; if ( classifyingMessages ) { JSConsumerClassifications classifications = consumerSet . getClassifications ( ) ; int numClasses = classifications . getNumberOfClasses ( ) ; consumerKeyFilter = new LocalQPConsumerKeyFilter [ numClasses + 1 ] ; for ( int i = 0 ; i < numClasses + 1 ; i ++ ) { String classificationName = null ; if ( i > 0 ) classificationName = classifications . getClassification ( i ) ; consumerKeyFilter [ i ] = new LocalQPConsumerKeyFilter ( this , i , classificationName ) ; cursor = itemStream . newLockingItemCursor ( consumerKeyFilter [ i ] , ! forwardScanning ) ; consumerKeyFilter [ i ] . setLockingCursor ( cursor ) ; } } else { consumerKeyFilter = new LocalQPConsumerKeyFilter [ 1 ] ; consumerKeyFilter [ 0 ] = new LocalQPConsumerKeyFilter ( this , 0 , null ) ; cursor = itemStream . newLockingItemCursor ( consumerKeyFilter [ 0 ] , ! forwardScanning ) ; consumerKeyFilter [ 0 ] . setLockingCursor ( cursor ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createNewFiltersAndCursors" ) ; }
Create the filters and cursors for this Key . If XD has registered a MessageController we ll need a cursor - filter pair for each classification .
37,690
public JmsConnectionFactory createConnectionFactory ( ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "createConnectionFactory" ) ; JmsConnectionFactory jmscf = null ; JmsJcaFactory jcaFact = JmsJcaFactory . getInstance ( ) ; if ( jcaFact == null ) { throw ( JMSException ) JmsErrorUtils . newThrowable ( JMSException . class , "UNABLE_TO_CREATE_FACTORY_CWSIA0008" , new Object [ ] { "JmsJcaFactoryImpl" , "sib.api.jmsraOutboundImpl.jar" } , tc ) ; } JmsJcaManagedConnectionFactory jcamcf = jcaFact . createManagedConnectionFactory ( ) ; try { jmscf = ( JmsConnectionFactory ) jcamcf . createConnectionFactory ( ) ; } catch ( ResourceException re ) { throw ( JMSException ) JmsErrorUtils . newThrowable ( JMSException . class , "EXCEPTION_RECEIVED_CWSIA0007" , new Object [ ] { re , "JmsFactoryFactoryImpl.createConnectionFactory (#2)" } , re , "JmsFactoryFactoryImpl.createConnectionFactory#2" , this , tc ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "createConnectionFactory" , jmscf ) ; return jmscf ; }
This method is called by the application to retrieve its first ConnectionFactory object .
37,691
public JmsQueueConnectionFactory createQueueConnectionFactory ( ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "createQueueConnectionFactory" ) ; JmsQueueConnectionFactory jmsqcf = null ; JmsJcaManagedQueueConnectionFactory jcamqcf = JmsJcaFactory . getInstance ( ) . createManagedQueueConnectionFactory ( ) ; try { jmsqcf = ( JmsQueueConnectionFactory ) jcamqcf . createConnectionFactory ( ) ; } catch ( ResourceException re ) { throw ( JMSException ) JmsErrorUtils . newThrowable ( JMSException . class , "EXCEPTION_RECEIVED_CWSIA0007" , new Object [ ] { re , "JmsFactoryFactoryImpl.createQueueConnectionFactory (#1)" } , re , "JmsFactoryFactoryImpl.createQueueConnectionFactory#1" , this , tc ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "createQueueConnectionFactory" , jmsqcf ) ; return jmsqcf ; }
This method is called by the application to retrieve its first QueueConnectionFactory object .
37,692
public JmsTopicConnectionFactory createTopicConnectionFactory ( ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "createTopicConnectionFactory" ) ; JmsTopicConnectionFactory jmstcf = null ; JmsJcaManagedTopicConnectionFactory jcamtcf = JmsJcaFactory . getInstance ( ) . createManagedTopicConnectionFactory ( ) ; try { jmstcf = ( JmsTopicConnectionFactory ) jcamtcf . createConnectionFactory ( ) ; } catch ( ResourceException re ) { throw ( JMSException ) JmsErrorUtils . newThrowable ( JMSException . class , "EXCEPTION_RECEIVED_CWSIA0007" , new Object [ ] { re , "JmsFactoryFactoryImpl.createTopicConnectionFactory (#1)" } , re , "JmsFactoryFactoryImpl.createTopicConnectionFactory#1" , this , tc ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "createTopicConnectionFactory" , jmstcf ) ; return jmstcf ; }
This method is called by the application to retrieve its first TopicConnectionFactory object .
37,693
public JmsQueue createQueue ( String name ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "createQueue" , name ) ; JmsQueue queue = null ; if ( ( name == null ) || ( "" . equals ( name ) ) || ( JmsQueueImpl . QUEUE_PREFIX . equals ( name ) ) ) { throw ( InvalidDestinationException ) JmsErrorUtils . newThrowable ( InvalidDestinationException . class , "INVALID_VALUE_CWSIA0003" , new Object [ ] { "Queue name" , name } , tc ) ; } if ( name . startsWith ( JmsTopicImpl . TOPIC_PREFIX ) ) { throw ( InvalidDestinationException ) JmsErrorUtils . newThrowable ( InvalidDestinationException . class , "MALFORMED_DESCRIPTOR_CWSIA0047" , new Object [ ] { "Queue" , name } , tc ) ; } name = name . trim ( ) ; queue = ( JmsQueue ) destCreator . createDestinationFromString ( name , URIDestinationCreator . DestType . QUEUE ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "createQueue" , queue ) ; return queue ; }
This method is called by the application to create a jms administered queue object .
37,694
public JmsTopic createTopic ( String name ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "createTopic" , name ) ; JmsTopic topic = null ; if ( name == null ) { throw ( InvalidDestinationException ) JmsErrorUtils . newThrowable ( InvalidDestinationException . class , "INVALID_VALUE_CWSIA0003" , new Object [ ] { "Topic name" , null } , tc ) ; } if ( name != null && name . startsWith ( JmsQueueImpl . QUEUE_PREFIX ) ) { throw ( InvalidDestinationException ) JmsErrorUtils . newThrowable ( InvalidDestinationException . class , "MALFORMED_DESCRIPTOR_CWSIA0047" , new Object [ ] { "Topic" , name } , tc ) ; } name = name . trim ( ) ; topic = ( JmsTopic ) destCreator . createDestinationFromString ( name , URIDestinationCreator . DestType . TOPIC ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "createTopic" , topic ) ; return topic ; }
This method is called by the application to create a jms administered topic object .
37,695
void handlePut ( SimpleTest test , Conjunction selector , MatchTarget object , InternTable subExpr ) throws MatchingException { if ( tc . isEntryEnabled ( ) ) tc . entry ( this , cclass , "handlePut" , new Object [ ] { test , selector , object , subExpr } ) ; Object value = test . getValue ( ) ; if ( value == null ) throw new IllegalStateException ( ) ; handleEqualityPut ( value , selector , object , subExpr ) ; if ( tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "handlePut" ) ; }
Implement handlePut .
37,696
void handleEqualityPut ( Object value , Conjunction selector , MatchTarget object , InternTable subExpr ) throws MatchingException { if ( tc . isEntryEnabled ( ) ) tc . entry ( this , cclass , "handleEqualityPut" , new Object [ ] { value , selector , object , subExpr } ) ; ContentMatcher next = ( ContentMatcher ) ( ( children == null ) ? null : children . get ( value ) ) ; ContentMatcher newNext = nextMatcher ( selector , next ) ; if ( newNext != next ) { if ( children == null ) children = new HashMap ( INITIAL_CHILDREN_CAPACITY ) ; children . put ( value , newNext ) ; } newNext . put ( selector , object , subExpr ) ; if ( tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "handleEqualityPut" ) ; }
Perform the handlePut function when the test is an equality test
37,697
void handleEqualityRemove ( Object value , Conjunction selector , MatchTarget object , InternTable subExpr , OrdinalPosition parentId ) throws MatchingException { if ( tc . isEntryEnabled ( ) ) tc . entry ( this , cclass , "handleEqualityRemove" , new Object [ ] { value , selector , object , subExpr } ) ; ContentMatcher next = ( ContentMatcher ) children . get ( value ) ; ContentMatcher newNext = ( ContentMatcher ) next . remove ( selector , object , subExpr , ordinalPosition ) ; if ( newNext == null ) children . remove ( value ) ; else if ( newNext != next ) children . put ( value , newNext ) ; if ( tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "handleEqualityRemove" ) ; }
Perform the handleRemove function when the test is an equality test
37,698
boolean isEmpty ( ) { if ( tc . isEntryEnabled ( ) ) tc . entry ( this , cclass , "isEmpty" ) ; boolean ans = super . isEmpty ( ) && ! haveEqualityMatches ( ) ; if ( tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "isEmpty" , new Boolean ( ans ) ) ; return ans ; }
Override isEmpty to check whether children is empty
37,699
ContentMatcher nextMatcher ( Conjunction selector , ContentMatcher oldMatcher ) { if ( tc . isEntryEnabled ( ) ) tc . entry ( this , cclass , "nextMatcher" , "selector: " + selector + ", oldMatcher: " + oldMatcher ) ; ContentMatcher ans ; if ( ! cacheing ) ans = super . nextMatcher ( selector , oldMatcher ) ; else if ( oldMatcher == null ) ans = new CacheingMatcher ( ordinalPosition , super . nextMatcher ( selector , null ) ) ; else ans = oldMatcher ; if ( tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "nextMatcher" , ans ) ; return ans ; }
Override nextMatcher to handle possibility of cacheing