idx int64 0 41.2k | question stringlengths 83 4.15k | target stringlengths 5 715 |
|---|---|---|
40,900 | public String [ ] getPath ( ) { if ( path != null ) return path ; else if ( instanceName == null && type == TYPE_SUBMODULE ) return new String [ ] { moduleID , submoduleName } ; else return super . getPath ( ) ; } | overwrite getPath method |
40,901 | public final static SubscriptionMessageType getSubscriptionMessageType ( int aValue ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Value = " + aValue ) ; return set [ aValue ] ; } | Returns the corresponding SubscriptionMessageType for a given integer . This method should NOT be called by any code outside the MFP component . It is only public so that it can be accessed by sub - packages . |
40,902 | private void fail ( final K key ) { final String methodName = "fail(): " ; stateLock . writeLock ( ) . lock ( ) ; try { Integer index = actualIndices . remove ( key ) ; if ( index == null ) throw new IllegalArgumentException ( "unknown key: " + key ) ; elements [ index ] = FAILED ; ( failedKeys == null ? failedKeys = new ArrayList < K > ( actualIndices . size ( ) + 1 ) : failedKeys ) . add ( key ) ; checkForCompletion ( ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , methodName , "permanent fail for key " + key ) ; stateLock . postEvent ( ) ; } finally { stateLock . writeLock ( ) . unlock ( ) ; } } | Permanently fail to retrieve the element associated with the key independently of any timeout . |
40,903 | private void checkForCompletion ( ) { final String methodName = "checkForCompletion(): " ; if ( actualIndices . isEmpty ( ) ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , methodName + "setting state=COMPLETE" ) ; state = failedKeys == null ? COMPLETE : COMPLETE_WITH_FAILURES ; } } | if all the keys have been satisfied or permanently failed mark this list as being complete |
40,904 | public int size ( ) { stateLock . readLock ( ) . lock ( ) ; try { switch ( state ) { default : preFetchAll ( ) ; return size ( ) ; case TIMED_OUT : return currentSize ( ) ; case COMPLETE_WITH_FAILURES : return elements . length - failedKeys . size ( ) ; case COMPLETE : return elements . length ; } } finally { stateLock . readLock ( ) . unlock ( ) ; } } | Find the size of this list attempting to retrieve all elements if necessary . |
40,905 | @ FFDCIgnore ( IndexOutOfBoundsException . class ) private boolean ensureElement ( int index ) { try { get ( index ) ; return true ; } catch ( IndexOutOfBoundsException e ) { return false ; } } | Blocking call to ensure an element is available |
40,906 | public Set < K > getUnmatchedKeys ( ) { stateLock . readLock ( ) . lock ( ) ; try { return new HashSet < K > ( this . actualIndices . keySet ( ) ) ; } finally { stateLock . readLock ( ) . unlock ( ) ; } } | Get a point - in - time view of the unmatched keys . This may be immediately out of date unless additional synchronization is performed to prevent concurrent updates . |
40,907 | private String getTopic ( FrameworkEvent frameworkEvent ) { StringBuilder topic = new StringBuilder ( FRAMEWORK_EVENT_TOPIC_PREFIX ) ; switch ( frameworkEvent . getType ( ) ) { case FrameworkEvent . STARTED : topic . append ( "STARTED" ) ; break ; case FrameworkEvent . ERROR : topic . append ( "ERROR" ) ; break ; case FrameworkEvent . PACKAGES_REFRESHED : topic . append ( "PACKAGES_REFRESHED" ) ; break ; case FrameworkEvent . STARTLEVEL_CHANGED : topic . append ( "STARTLEVEL_CHANGED" ) ; break ; case FrameworkEvent . WARNING : topic . append ( "WARNING" ) ; break ; case FrameworkEvent . INFO : topic . append ( "INFO" ) ; break ; default : return null ; } return topic . toString ( ) ; } | Determine the appropriate topic to use for the Framework Event . |
40,908 | void resetStatistics ( boolean clearHistory ) { lastTimerPop = System . currentTimeMillis ( ) ; previousCompleted = threadPool == null ? 0 : threadPool . getCompletedTaskCount ( ) ; previousThroughput = 0 ; consecutiveQueueEmptyCount = 0 ; consecutiveNoAdjustment = 0 ; consecutiveOutlierAfterAdjustment = 0 ; consecutiveIdleCount = 0 ; if ( clearHistory ) { threadStats = new TreeMap < Integer , ThroughputDistribution > ( ) ; } lastAction = LastAction . NONE ; } | Reset all statistics associated with the target thread pool . |
40,909 | void resetThreadPool ( ) { if ( threadPool == null ) return ; final int availableProcessors = NUMBER_CPUS ; int factor = 2500 * availableProcessors / Math . max ( 1 , ( int ) previousThroughput ) ; factor = Math . min ( factor , 4 ) ; factor = Math . max ( factor , 2 ) ; int newThreads = Math . min ( factor * availableProcessors , maxThreads ) ; newThreads = Math . max ( newThreads , coreThreads ) ; targetPoolSize = newThreads ; setPoolSize ( newThreads ) ; resetStatistics ( true ) ; } | Reset all statistics associated with the thread pool and reset the pool size to a value that s based on the number of hardware threads available to the JVM . |
40,910 | synchronized void deactivate ( ) { paused = false ; if ( activeTask != null ) { activeTask . cancel ( ) ; activeTask = null ; } this . threadPool = null ; } | Deactivate the controller . Any scheduled tasks will be canceled . |
40,911 | synchronized void resume ( ) { paused = false ; if ( activeTask == null ) { activeTask = new IntervalTask ( this ) ; timer . schedule ( activeTask , interval , interval ) ; } } | Resume monitoring and control of the associated thread pool . |
40,912 | ThroughputDistribution getThroughputDistribution ( int activeThreads , boolean create ) { if ( activeThreads < coreThreads ) activeThreads = coreThreads ; Integer threads = Integer . valueOf ( activeThreads ) ; ThroughputDistribution throughput = threadStats . get ( threads ) ; if ( ( throughput == null ) && create ) { throughput = new ThroughputDistribution ( ) ; throughput . setLastUpdate ( controllerCycle ) ; threadStats . put ( threads , throughput ) ; } return throughput ; } | Get the throughput distribution data associated with the specified number of active threads . |
40,913 | boolean manageIdlePool ( ThreadPoolExecutor threadPool , long intervalCompleted ) { if ( intervalCompleted == 0 && threadPool . getActiveCount ( ) == 0 ) { consecutiveIdleCount ++ ; } else { consecutiveIdleCount = 0 ; } if ( consecutiveIdleCount >= IDLE_INTERVALS_BEFORE_PAUSE ) { pause ( ) ; lastAction = LastAction . PAUSE ; return true ; } return false ; } | Determine whether or not the thread pool has been idle long enough to pause the monitoring task . |
40,914 | boolean handleOutliers ( ThroughputDistribution distribution , double throughput ) { if ( throughput < 0.0 ) { resetStatistics ( false ) ; return true ; } else if ( throughput == 0.0 ) { return false ; } double zScore = distribution . getZScore ( throughput ) ; boolean currentIsOutlier = zScore <= - 3.0 || zScore >= 3.0 ; if ( currentIsOutlier ) { double ewma = distribution . getMovingAverage ( ) ; double stddev = distribution . getStddev ( ) ; if ( ( stddev / ewma ) > resetDistroStdDevEwmaRatio || ( Math . abs ( throughput - ewma ) / ewma ) > resetDistroNewTputEwmaRatio || distribution . incrementAndGetConsecutiveOutliers ( ) >= resetDistroConsecutiveOutliers ) { if ( tc . isEventEnabled ( ) ) { Tr . event ( tc , "reset distribution" , ( " distribution: " + distribution + ", new throughput: " + throughput ) ) ; } distribution . reset ( throughput , controllerCycle ) ; distributionReset = true ; } else if ( tc . isEventEnabled ( ) ) { Tr . event ( tc , "outlier detected" , ( " distribution: " + distribution + ", new throughput: " + throughput ) ) ; } } else { distribution . resetConsecutiveOutliers ( ) ; } if ( lastAction != LastAction . NONE ) { if ( distributionReset ) { consecutiveOutlierAfterAdjustment ++ ; } else { consecutiveOutlierAfterAdjustment = 0 ; } } if ( consecutiveOutlierAfterAdjustment >= MAX_OUTLIER_AFTER_CHANGE_BEFORE_RESET ) { resetThreadPool ( ) ; return true ; } return false ; } | Detect and handle aberrant data points by resetting the statistics in the throughput distribution . |
40,915 | int adjustPoolSize ( int poolSize , int poolAdjustment ) { if ( threadPool == null ) return poolSize ; int newPoolSize = poolSize + poolAdjustment ; lastAction = LastAction . NONE ; if ( poolAdjustment != 0 ) { if ( poolAdjustment < 0 && newPoolSize >= coreThreads ) { lastAction = LastAction . SHRINK ; setPoolSize ( newPoolSize ) ; } else if ( poolAdjustment > 0 && newPoolSize <= maxThreads ) { lastAction = LastAction . GROW ; setPoolSize ( newPoolSize ) ; } else { newPoolSize = poolSize ; } } return newPoolSize ; } | Adjust the size of the thread pool . |
40,916 | private String poolTputRatioData ( double poolTputRatio , double poolRatio , double tputRatio , double smallerPoolTput , double largerPoolTput , int smallerPoolSize , int largerPoolSize ) { StringBuilder sb = new StringBuilder ( ) ; sb . append ( "\n " ) ; sb . append ( String . format ( " poolTputRatio: %.3f" , Double . valueOf ( poolTputRatio ) ) ) ; sb . append ( String . format ( " poolRatio: %.3f" , Double . valueOf ( poolRatio ) ) ) ; sb . append ( String . format ( " tputRatio: %.3f" , Double . valueOf ( tputRatio ) ) ) ; sb . append ( "\n " ) ; sb . append ( String . format ( " smallerPoolSize: %d" , Integer . valueOf ( smallerPoolSize ) ) ) ; sb . append ( String . format ( " largerPoolSize: %d" , Integer . valueOf ( largerPoolSize ) ) ) ; sb . append ( String . format ( " smallerPoolTput: %.3f" , Double . valueOf ( smallerPoolTput ) ) ) ; sb . append ( String . format ( " largerPoolTput: %.3f" , Double . valueOf ( largerPoolTput ) ) ) ; return sb . toString ( ) ; } | Utility method to format pool tput ratio data |
40,917 | private boolean resolveHang ( long tasksCompleted , boolean queueEmpty , int poolSize ) { boolean actionTaken = false ; if ( tasksCompleted == 0 && ! queueEmpty ) { if ( hangResolutionCountdown == 0 ) { activeTask . cancel ( ) ; activeTask = new IntervalTask ( this ) ; timer . schedule ( activeTask , hangInterval , hangInterval ) ; } hangResolutionCountdown = hangResolutionCycles ; controllerCyclesWithoutHang = 0 ; if ( poolSizeWhenHangDetected < 0 ) { poolSizeWhenHangDetected = poolSize ; if ( tc . isEventEnabled ( ) ) { Tr . event ( tc , "Executor hang detected at poolSize=" + poolSizeWhenHangDetected , threadPool ) ; } } else if ( tc . isEventEnabled ( ) ) { Tr . event ( tc , "Executor hang continued at poolSize=" + poolSize , threadPool ) ; } setPoolIncrementDecrement ( poolSize ) ; if ( poolSize + poolIncrement <= maxThreads && poolSize < MAX_THREADS_TO_BREAK_HANG ) { targetPoolSize = adjustPoolSize ( poolSize , poolIncrement ) ; int targetSize = poolSize + ( compareRange * poolIncrement ) ; if ( hangBufferPoolSize < targetSize ) { hangBufferPoolSize = targetSize ; } actionTaken = true ; } else { if ( hangMaxThreadsMessageEmitted == false && hangIntervalCounter > 0 ) { if ( tc . isWarningEnabled ( ) ) { Tr . warning ( tc , "unbreakableExecutorHang" , poolSizeWhenHangDetected , poolSize ) ; } hangMaxThreadsMessageEmitted = true ; } } hangIntervalCounter ++ ; } else { poolSizeWhenHangDetected = - 1 ; hangIntervalCounter = 0 ; hangMaxThreadsMessageEmitted = false ; if ( hangResolutionCountdown > 0 ) { hangResolutionCountdown -- ; if ( hangResolutionCountdown <= 0 ) { activeTask . cancel ( ) ; activeTask = new IntervalTask ( this ) ; timer . schedule ( activeTask , interval , interval ) ; } } if ( hangBufferPoolSize > coreThreads ) { if ( hangBufferPoolSize > poolSize ) { controllerCyclesWithoutHang ++ ; if ( controllerCyclesWithoutHang > noHangCyclesThreshold ) { setPoolIncrementDecrement ( poolSize ) ; hangBufferPoolSize -= poolDecrement ; controllerCyclesWithoutHang = 0 ; } } } } return actionTaken ; } | Detects a hang in the underlying executor . When a hang is detected increases the poolSize in hopes of relieving the hang unless poolSize has reached maxThreads . |
40,918 | private boolean pruneData ( ThroughputDistribution priorStats , double forecast ) { boolean prune = false ; double tputRatio = forecast / priorStats . getMovingAverage ( ) ; if ( tputRatio > tputRatioPruneLevel || tputRatio < ( 1 / tputRatioPruneLevel ) ) { prune = true ; } else { int age = controllerCycle - priorStats . getLastUpdate ( ) ; double variability = ( priorStats . getStddev ( ) / priorStats . getMovingAverage ( ) ) ; if ( age * variability > dataAgePruneLevel ) prune = true ; } return prune ; } | Evaluates a ThroughputDistribution for possible removal from the historical dataset . |
40,919 | private Integer getSmallestValidPoolSize ( Integer poolSize , Double forecast ) { Integer smallestPoolSize = threadStats . firstKey ( ) ; Integer nextPoolSize = threadStats . higherKey ( smallestPoolSize ) ; Integer pruneSize = - 1 ; boolean validSmallData = false ; while ( ! validSmallData && nextPoolSize != null ) { ThroughputDistribution smallestPoolSizeStats = getThroughputDistribution ( smallestPoolSize , false ) ; ; if ( pruneData ( smallestPoolSizeStats , forecast ) ) { pruneSize = smallestPoolSize ; smallestPoolSize = nextPoolSize ; nextPoolSize = threadStats . higherKey ( smallestPoolSize ) ; if ( pruneSize > hangBufferPoolSize && pruneSize > coreThreads ) { threadStats . remove ( pruneSize ) ; } } else { validSmallData = true ; } } return smallestPoolSize ; } | Returns the smallest valid poolSize in the current historical dataset . |
40,920 | private Integer getLargestValidPoolSize ( Integer poolSize , Double forecast ) { Integer largestPoolSize = - 1 ; boolean validLargeData = false ; while ( ! validLargeData ) { largestPoolSize = threadStats . lastKey ( ) ; ThroughputDistribution largestPoolSizeStats = getThroughputDistribution ( largestPoolSize , false ) ; ; if ( pruneData ( largestPoolSizeStats , forecast ) ) { threadStats . remove ( largestPoolSize ) ; } else { validLargeData = true ; } } return largestPoolSize ; } | Returns the largest valid poolSize in the current historical dataset . |
40,921 | private boolean leanTowardShrinking ( Integer smallerPoolSize , int largerPoolSize , double smallerPoolTput , double largerPoolTput ) { boolean shouldShrink = false ; double poolRatio = largerPoolSize / smallerPoolSize ; double tputRatio = largerPoolTput / smallerPoolTput ; double poolTputRatio = poolRatio / tputRatio ; if ( tputRatio < 1.0 ) { shouldShrink = ( flipCoin ( ) && flipCoin ( ) ) ? false : true ; } else if ( poolTputRatio > poolTputRatioHigh ) { shouldShrink = ( flipCoin ( ) && flipCoin ( ) ) ? false : true ; } else if ( poolTputRatio > poolTputRatioLow ) { shouldShrink = ( flipCoin ( ) ) ? false : true ; } if ( tc . isEventEnabled ( ) && shouldShrink ) Tr . event ( tc , "Tput ratio shrinkScore adjustment, larger poolSizes" , poolTputRatioData ( poolTputRatio , poolRatio , tputRatio , smallerPoolTput , largerPoolTput , smallerPoolSize , largerPoolSize ) ) ; return shouldShrink ; } | Evaluate current poolSize against farthest poolSize to decide whether it makes sense to shrink . The final outcome is probabilistic not deterministic . |
40,922 | protected void setConfigurationProvider ( ConfigurationProvider p ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "setConfigurationProvider" , p ) ; try { ConfigurationProviderManager . setConfigurationProvider ( p ) ; if ( _state == TMService . TMStates . STOPPED ) { start ( ) ; } } catch ( Exception e ) { FFDCFilter . processException ( e , "com.ibm.tx.jta.util.impl.TxTMHelper.setConfigurationProvider" , "37" , this ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "setConfigurationProvider" ) ; } | Called by DS to inject reference to Config Provider |
40,923 | protected void setXaResourceFactory ( ServiceReference < ResourceFactory > ref ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "setXaResourceFactory, ref " + ref ) ; _xaResourceFactoryReady = true ; if ( ableToStartRecoveryNow ( ) ) { try { startRecovery ( ) ; } catch ( Exception e ) { FFDCFilter . processException ( e , "com.ibm.tx.jta.util.impl.TxTMHelper.setXaResourceFactory" , "148" , this ) ; } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "setXaResourceFactory" ) ; } | Called by DS to inject reference to XaResource Factory |
40,924 | public void setRecoveryLogFactory ( RecoveryLogFactory fac ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "setRecoveryLogFactory, factory: " + fac , this ) ; _recoveryLogFactory = fac ; _recoveryLogFactoryReady = true ; if ( ableToStartRecoveryNow ( ) ) { try { startRecovery ( ) ; } catch ( Exception e ) { FFDCFilter . processException ( e , "com.ibm.tx.jta.util.impl.TxTMHelper.setRecoveryLogFactory" , "206" , this ) ; } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "setRecoveryLogFactory" ) ; } | Called by DS to inject reference to RecoveryLog Factory |
40,925 | public void setRecoveryLogService ( ServiceReference < RecLogServiceImpl > ref ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "setRecoveryLogService" , ref ) ; _recoveryLogServiceReady = true ; if ( ableToStartRecoveryNow ( ) ) { try { startRecovery ( ) ; } catch ( Exception e ) { FFDCFilter . processException ( e , "com.ibm.tx.jta.util.impl.TxTMHelper.setRecoveryLogService" , "148" , this ) ; } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "setRecoveryLogService" ) ; } | Called by DS to inject reference to RecoveryLog Service |
40,926 | public void shutdown ( ConfigurationProvider cp ) throws Exception { final int shutdownDelay ; if ( cp != null ) { shutdownDelay = cp . getDefaultMaximumShutdownDelay ( ) ; } else { shutdownDelay = 0 ; } shutdown ( false , shutdownDelay ) ; } | Used by liberty |
40,927 | protected void retrieveBundleContext ( ) { BundleContext bc = TxBundleTools . getBundleContext ( ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "retrieveBundleContext, bc " + bc ) ; _bc = bc ; } | This method retrieves bundle context . There is a requirement to lookup the DS Services Registry during recovery . Any bundle context will do for the lookup - this method is overridden in the ws . tx . embeddable bundle so that if that bundle has started before the tx . jta bundle then we are still able to access the Service Registry . |
40,928 | protected void enqueue ( final AbstractInvocation invocation ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "enqueue" , invocation ) ; barrier . pass ( ) ; synchronized ( this ) { final boolean isEmpty = isEmpty ( ) ; synchronized ( barrier ) { queue . add ( invocation ) ; queueSize += invocation . getSize ( ) ; if ( queueSize >= maxQueueSize || ( maxQueueMsgs > 0 && queue . size ( ) >= maxQueueMsgs ) ) { barrier . lock ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Locked the barrier: bytes=" + queueSize + " (" + maxQueueSize + ") msgs=" + queue . size ( ) + " (" + maxQueueMsgs + ")" ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Leaving barrier unlocked: bytes=" + queueSize + " (" + maxQueueSize + ") msgs=" + queue . size ( ) + " (" + maxQueueMsgs + ")" ) ; } } if ( isEmpty ) { if ( running ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Notifying existing thread" ) ; notify ( ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Starting a new thread" ) ; boolean interrupted = true ; while ( interrupted ) { try { threadPool . execute ( this ) ; interrupted = false ; } catch ( InterruptedException e ) { } } } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "enqueue" ) ; } | Enqueue an invocation by adding it to the end of the queue |
40,929 | private AbstractInvocation dequeue ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "dequeue" ) ; AbstractInvocation invocation ; synchronized ( barrier ) { invocation = queue . remove ( 0 ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "dequeue" , invocation ) ; return invocation ; } | Dequeue an invocation by removing it from the front of the queue |
40,930 | private void unlockBarrier ( final int size , final Conversation . ConversationType conversationType ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "unlockBarrier" , new Object [ ] { Integer . valueOf ( size ) , conversationType } ) ; synchronized ( barrier ) { queueSize -= size ; if ( queueSize < maxQueueSize && ( maxQueueMsgs == 0 || ( maxQueueMsgs > 0 && queue . size ( ) < maxQueueMsgs ) ) ) { if ( barrier . unlock ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Unlocked the barrier: bytes=" + queueSize + " (" + maxQueueSize + ") msgs=" + queue . size ( ) + " (" + maxQueueMsgs + ")" ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Barrier already unlocked: bytes=" + queueSize + " (" + maxQueueSize + ") msgs=" + queue . size ( ) + " (" + maxQueueMsgs + ")" ) ; } } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Leaving barrier locked: bytes=" + queueSize + " (" + maxQueueSize + ") msgs=" + queue . size ( ) + " (" + maxQueueMsgs + ")" ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "unlockBarrier" ) ; } | Unlock the barrier . |
40,931 | protected boolean isEmpty ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "isEmpty" ) ; boolean rc ; synchronized ( barrier ) { rc = queue . isEmpty ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "isEmpty" , rc ) ; return rc ; } | Return true if the queue is empty |
40,932 | protected int getDepth ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getDepth" ) ; int depth ; synchronized ( barrier ) { depth = queue . size ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getDepth" , depth ) ; return depth ; } | Return the depth of the queue |
40,933 | protected boolean doesQueueContainConversation ( final Conversation conversation ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "doesQueueContainConversation" , conversation ) ; boolean rc = false ; synchronized ( barrier ) { for ( int i = 0 ; i < queue . size ( ) ; i ++ ) { final AbstractInvocation invocation = queue . get ( i ) ; if ( invocation . getConversation ( ) . equals ( conversation ) ) { rc = true ; break ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "doesQueueContainConversation" , rc ) ; return rc ; } | Return true if a conversation is already in this queue |
40,934 | public void sweep ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "Sweep : Stateful Beans = " + ivStatefulBeanList . size ( ) ) ; for ( Enumeration < TimeoutElement > e = ivStatefulBeanList . elements ( ) ; e . hasMoreElements ( ) ; ) { TimeoutElement elt = e . nextElement ( ) ; if ( elt . isTimedOut ( ) ) { deleteBean ( elt . beanId ) ; } } if ( ivSfFailoverCache != null ) { ivSfFailoverCache . sweep ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "Sweep : Stateful Beans = " + ivStatefulBeanList . size ( ) ) ; } | Go through the list of bean ids and cleanup beans which have timed out . |
40,935 | public void finalSweep ( StatefulPassivator passivator ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "finalSweep : Stateful Beans = " + ivStatefulBeanList . size ( ) ) ; for ( Enumeration < TimeoutElement > e = ivStatefulBeanList . elements ( ) ; e . hasMoreElements ( ) ; ) { TimeoutElement elt = e . nextElement ( ) ; if ( elt . passivated ) { try { if ( remove ( elt . beanId ) ) { passivator . remove ( elt . beanId , false ) ; } } catch ( RemoteException ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".finalSweep" , "298" , this ) ; Tr . warning ( tc , "REMOVE_FROM_PASSIVATION_STORE_FAILED_CNTR0016W" , new Object [ ] { elt . beanId , ex } ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "finalSweep : Stateful Beans = " + ivStatefulBeanList . size ( ) ) ; } | This method is invoked just before container termination to clean up stateful beans which have been passivated . |
40,936 | public boolean beanDoesNotExistOrHasTimedOut ( TimeoutElement elt , BeanId beanId ) { if ( elt == null ) { if ( ivSfFailoverCache != null ) { return ivSfFailoverCache . beanDoesNotExistOrHasTimedOut ( beanId ) ; } return true ; } return elt . isTimedOut ( ) ; } | LIDB2018 - 1 renamed old beanTimedOut method and clarified description . |
40,937 | public void add ( StatefulBeanO beanO ) { BeanId id = beanO . beanId ; TimeoutElement elt = beanO . ivTimeoutElement ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "add " + beanO . beanId + ", " + elt . timeout ) ; Object obj = ivStatefulBeanList . put ( id , elt ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , ( obj != null ) ? "Stateful bean information replaced" : "Stateful bean information added" ) ; synchronized ( this ) { if ( numObjects == 0 && ! ivIsCanceled ) { startAlarm ( ) ; } numObjects ++ ; numAdds ++ ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "add" ) ; } | Add a new bean to the list of beans to be checked for timeouts |
40,938 | public boolean remove ( BeanId id ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "remove (" + id + ")" ) ; TimeoutElement elt = null ; elt = ivStatefulBeanList . remove ( id ) ; synchronized ( this ) { if ( elt != null ) { numObjects -- ; numRemoves ++ ; if ( numObjects == 0 ) { stopAlarm ( ) ; } } else { numNullRemoves ++ ; } } boolean result = elt != null ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "remove (" + result + ")" ) ; return result ; } | Remove a bean from the list and return true if the bean was in the list and removed successfully ; otherwise return false . |
40,939 | public synchronized Iterator < BeanId > getPassivatedStatefulBeanIds ( J2EEName homeName ) { ArrayList < BeanId > beanList = new ArrayList < BeanId > ( ) ; for ( Enumeration < TimeoutElement > e = ivStatefulBeanList . elements ( ) ; e . hasMoreElements ( ) ; ) { TimeoutElement elt = e . nextElement ( ) ; if ( homeName . equals ( elt . beanId . getJ2EEName ( ) ) && ( elt . passivated ) ) beanList . add ( elt . beanId ) ; } return ( beanList . iterator ( ) ) ; } | d103404 . 1 |
40,940 | public long getBeanTimeoutTime ( BeanId beanId ) { TimeoutElement elt = ivStatefulBeanList . get ( beanId ) ; long timeoutTime = 0 ; if ( elt != null ) { if ( elt . timeout != 0 ) { timeoutTime = elt . lastAccessTime + elt . timeout ; if ( timeoutTime < 0 ) { timeoutTime = Long . MAX_VALUE ; } } } return timeoutTime ; } | LIDB2775 - 23 . 4 Begins |
40,941 | public void dump ( ) { if ( dumped ) { return ; } try { Tr . dump ( tc , "-- StatefulBeanReaper Dump -- " , this ) ; synchronized ( this ) { Tr . dump ( tc , "Number of objects: " + this . numObjects ) ; Tr . dump ( tc , "Number of adds: " + this . numAdds ) ; Tr . dump ( tc , "Number of removes: " + this . numRemoves ) ; Tr . dump ( tc , "Number of null removes: " + this . numNullRemoves ) ; Tr . dump ( tc , "Number of deletes: " + this . numDeletes ) ; } } finally { dumped = true ; } } | Dump the internal state of the cache |
40,942 | public synchronized void cancel ( ) { ivIsCanceled = true ; stopAlarm ( ) ; while ( ivIsRunning ) { try { wait ( ) ; } catch ( InterruptedException ex ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "interrupted" , ex ) ; Thread . currentThread ( ) . interrupt ( ) ; } } ivActivator = null ; } | Cancel this alarm |
40,943 | private String getServerId ( ) { UUID fullServerId = null ; WsLocationAdmin locationService = this . wsLocationAdmin ; if ( locationService != null ) { fullServerId = locationService . getServerId ( ) ; } if ( fullServerId == null ) { fullServerId = UUID . randomUUID ( ) ; } return fullServerId . toString ( ) . toLowerCase ( ) ; } | Derives a unique identifier for the current server . The result of this method is used to create a cloneId . |
40,944 | private void initialize ( ) { if ( this . initialized ) { return ; } if ( LoggingUtil . SESSION_LOGGER_CORE . isLoggable ( Level . INFO ) ) { if ( this . sessionStoreService == null ) { LoggingUtil . SESSION_LOGGER_CORE . logp ( Level . INFO , methodClassName , "initialize" , "SessionMgrComponentImpl.noPersistence" ) ; } else { String modeName = "sessionPersistenceMode" ; Object modeValue = this . mergedConfiguration . get ( modeName ) ; LoggingUtil . SESSION_LOGGER_CORE . logp ( Level . INFO , methodClassName , "initialize" , "SessionMgrComponentImpl.persistenceMode" , new Object [ ] { modeValue } ) ; } } SessionProperties . setPropertiesInSMC ( this . serverLevelSessionManagerConfig , this . mergedConfiguration ) ; String cloneId = SessionManagerConfig . getCloneId ( ) ; if ( cloneId == null ) { if ( this . sessionStoreService == null && SessionManagerConfig . isTurnOffCloneId ( ) ) { cloneId = "" ; } else { String serverId = getServerId ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && LoggingUtil . SESSION_LOGGER_CORE . isLoggable ( Level . FINE ) ) { LoggingUtil . SESSION_LOGGER_CORE . logp ( Level . FINE , methodClassName , "initialize" , "serverId=" + serverId ) ; } SessionManagerConfig . setServerId ( serverId ) ; cloneId = EncodeCloneID . encodeString ( serverId ) ; } SessionManagerConfig . setCloneId ( cloneId ) ; } this . initialized = true ; } | Delay initialization until a public method of this service is called |
40,945 | public boolean startInactivityTimer ( Transaction t , InactivityTimer iat ) { if ( t != null ) return ( ( EmbeddableTransactionImpl ) t ) . startInactivityTimer ( iat ) ; return false ; } | Start an inactivity timer and call alarm method of parameter when timeout expires . Returns false if transaction is not active . |
40,946 | public void registerSynchronization ( UOWCoordinator coord , Synchronization sync ) throws RollbackException , IllegalStateException , SystemException { registerSynchronization ( coord , sync , EmbeddableWebSphereTransactionManager . SYNC_TIER_NORMAL ) ; } | Method to register synchronization object with JTA tran via UOWCoordinator for improved performance . |
40,947 | void setDestName ( String destName ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setDestName" , destName ) ; if ( ( null == destName ) || ( "" . equals ( destName ) ) ) { throw ( JMSException ) JmsErrorUtils . newThrowable ( InvalidDestinationException . class , "INVALID_VALUE_CWSIA0281" , new Object [ ] { "destName" , destName } , tc ) ; } updateProperty ( DEST_NAME , destName ) ; clearCachedProducerDestinationAddress ( ) ; clearCachedConsumerDestinationAddress ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setDestName" ) ; } | setDestName Set the destName for this Destination . |
40,948 | void setDestDiscrim ( String destDiscrim ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setDestDiscrim" , destDiscrim ) ; updateProperty ( DEST_DISCRIM , destDiscrim ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setDestDiscrim" ) ; } | setDestDiscrim Set the destDiscrim for this Destination . |
40,949 | protected Reliability getReplyReliability ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getReplyReliability" ) ; Reliability result = null ; if ( replyReliabilityByte != - 1 ) { result = Reliability . getReliability ( replyReliabilityByte ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getReplyReliability" , result ) ; return result ; } | Get the reply reliability to use for reply mesages on a replyTo destination |
40,950 | protected void setReplyReliability ( Reliability replyReliability ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setReplyReliability" , replyReliability ) ; this . replyReliabilityByte = replyReliability . toByte ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setReplyReliability" ) ; } | Set the reliability to use for reply messages on a replyTo destination |
40,951 | protected boolean isProducerTypeCheck ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "isProducerTypeCheck" ) ; boolean checking = true ; StringArrayWrapper frp = ( StringArrayWrapper ) properties . get ( FORWARD_ROUTING_PATH ) ; if ( frp != null ) { List totalPath = frp . getMsgForwardRoutingPath ( ) ; if ( ( totalPath != null ) && ( totalPath . size ( ) > 0 ) ) checking = false ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "isProducerTypeCheck" , checking ) ; return checking ; } | This method informs us whether we can carry out type checking on the producer connect call . |
40,952 | protected String getProducerDestName ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getProducerDestName" ) ; String pDestName = null ; StringArrayWrapper frp = ( StringArrayWrapper ) properties . get ( FORWARD_ROUTING_PATH ) ; if ( frp == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "No forward routing path to examine" ) ; pDestName = getDestName ( ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "There is a forward routing path to examine." ) ; SIDestinationAddress producerAddr = frp . getProducerSIDestAddress ( ) ; if ( producerAddr != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Using first element of FRP as producer dest name" ) ; pDestName = producerAddr . getDestinationName ( ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "FRP is empty - use original dest name" ) ; pDestName = getDestName ( ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getProducerDestName" , pDestName ) ; return pDestName ; } | This method returns the name of the destination to which producers should attach when sending messages via this JMS destination . |
40,953 | protected String getConsumerDestName ( ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getConsumerDestName" ) ; String cDestName = getDestName ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getConsumerDestName" , cDestName ) ; return cDestName ; } | This method returns the name of the destination to which consumers should attach when receiving messages using this JMS destination . |
40,954 | Map < String , Object > getCopyOfProperties ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getCopyOfProperties" ) ; Map < String , Object > temp = null ; synchronized ( properties ) { temp = new HashMap < String , Object > ( properties ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getCopyOfProperties" , temp ) ; return temp ; } | Creates a new Map object and duplicates the properties into the new Map . Note that it does not _copy_ the parameter keys and values so if the map contains objects which are mutable you may get strange behaviour . In short - only use immutable objects for keys and values! |
40,955 | protected List getConvertedFRP ( ) { List theList = null ; StringArrayWrapper saw = ( StringArrayWrapper ) properties . get ( FORWARD_ROUTING_PATH ) ; if ( saw != null ) { theList = saw . getMsgForwardRoutingPath ( ) ; } return theList ; } | This method returns the List containing SIDestinationAddress form of the forward routing path that will be set into the message . |
40,956 | protected List getConvertedRRP ( ) { List theList = null ; StringArrayWrapper saw = ( StringArrayWrapper ) properties . get ( REVERSE_ROUTING_PATH ) ; if ( saw != null ) theList = saw . getCorePath ( ) ; return theList ; } | This method returns the List containing SIDestinationAddress form of the reverse routing path . |
40,957 | protected SIDestinationAddress getProducerSIDestinationAddress ( ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getProducerSIDestinationAddress" ) ; if ( producerDestinationAddress == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "No cached value" ) ; StringArrayWrapper frp = ( StringArrayWrapper ) properties . get ( FORWARD_ROUTING_PATH ) ; if ( frp != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Obtain from the frp data." ) ; producerDestinationAddress = frp . getProducerSIDestAddress ( ) ; } if ( producerDestinationAddress == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Either FRP was empty, or no FRP at all - create from big dest info." ) ; boolean localOnly = isLocalOnly ( ) ; producerDestinationAddress = JmsMessageImpl . destAddressFactory . createSIDestinationAddress ( getProducerDestName ( ) , localOnly , getBusName ( ) ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getProducerSIDestinationAddress" , producerDestinationAddress ) ; return producerDestinationAddress ; } | This method provides access to the cached SIDestinationAddress object for this JmsDestination . |
40,958 | protected boolean isLocalOnly ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "isLocalOnly" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "isLocalOnly" , false ) ; return false ; } | Determines whether SIDestinationAddress objects created for this destination object should have the localOnly flag set or not . |
40,959 | static JmsDestinationImpl checkNativeInstance ( Destination destination ) throws InvalidDestinationException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkNativeInstance" , destination ) ; JmsDestinationImpl castDest = null ; if ( destination == null ) { throw ( InvalidDestinationException ) JmsErrorUtils . newThrowable ( InvalidDestinationException . class , "INVALID_VALUE_CWSIA0281" , new Object [ ] { "Destination" , null } , tc ) ; } if ( ! ( destination instanceof JmsDestinationImpl ) ) { Exception rootCause = null ; String destToString = destination . toString ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Dynamic proxy has been provided instead of a destination: " + destToString ) ; try { if ( destination instanceof Queue ) { castDest = ( JmsDestinationImpl ) JmsFactoryFactory . getInstance ( ) . createQueue ( destToString ) ; } else if ( destination instanceof Topic ) { castDest = ( JmsDestinationImpl ) JmsFactoryFactory . getInstance ( ) . createTopic ( destToString ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "A destination must be either a queue or a topic" ) ; } } catch ( JMSException jmse ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Failed to convert the dynamic proxy to a JmsDestinationImpl object;" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . exception ( tc , jmse ) ; rootCause = jmse ; } if ( castDest == null ) { throw ( InvalidDestinationException ) JmsErrorUtils . newThrowable ( InvalidDestinationException . class , "FOREIGN_IMPLEMENTATION_CWSIA0046" , new Object [ ] { destination } , rootCause , null , JmsDestinationImpl . class , tc ) ; } } else { castDest = ( JmsDestinationImpl ) destination ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkNativeInstance" , castDest ) ; return castDest ; } | Check that the supplied destination is a native JMS destination object . If it is then exit quietly . If it is not then throw an exception . |
40,960 | static void checkBlockedStatus ( JmsDestinationImpl dest ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkBlockedStatus" , dest ) ; Integer code = dest . getBlockedDestinationCode ( ) ; if ( code == null ) { } else if ( code . equals ( JmsInternalConstants . PSB_REPLY_DATA_MISSING ) ) { throw ( JMSException ) JmsErrorUtils . newThrowable ( JMSException . class , "DESTINATION_BLOCKED_PSBREPLY_CWSIA0284" , new Object [ ] { dest . toString ( ) } , tc ) ; } else { throw ( JMSException ) JmsErrorUtils . newThrowable ( JMSException . class , "DESTINATION_BLOCKED_CWSIA0283" , new Object [ ] { code } , tc ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkBlockedStatus" ) ; } | This method takes a JmsDestinationImpl object and checks the blocked destination code . If the code signals that the destination is blocked a suitable JMSException will be thrown tailored to the code received . |
40,961 | static JmsDestinationImpl getJMSReplyToInternal ( JsJmsMessage _msg , List < SIDestinationAddress > rrp , SICoreConnection _siConn ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getJMSReplyToInternal" , new Object [ ] { _msg , rrp , _siConn } ) ; JmsDestinationImpl tempReplyTo = null ; byte [ ] replyURIBytes = _msg . getJmsReplyTo ( ) ; if ( replyURIBytes != null ) { tempReplyTo = ( JmsDestinationImpl ) JmsInternalsFactory . getMessageDestEncodingUtils ( ) . getDestinationFromMsgRepresentation ( replyURIBytes ) ; } if ( tempReplyTo == null ) { SIDestinationAddress sida = null ; if ( rrp . size ( ) > 0 ) { int lastDestInRRP = rrp . size ( ) - 1 ; sida = rrp . get ( lastDestInRRP ) ; if ( _siConn != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Determine reply dest type using SICoreConnection" ) ; try { DestinationConfiguration destConfig = _siConn . getDestinationConfiguration ( sida ) ; DestinationType destType = destConfig . getDestinationType ( ) ; if ( destType == DestinationType . TOPICSPACE ) { tempReplyTo = new JmsTopicImpl ( ) ; } else { tempReplyTo = new JmsQueueImpl ( ) ; } } catch ( SIException sice ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , "failed to look up dest type because of " + sice ) ; SibTr . debug ( tc , "detail " , sice ) ; } } } if ( tempReplyTo == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Guess reply dest type using reply discriminator" ) ; String replyDiscrim = _msg . getReplyDiscriminator ( ) ; if ( ( replyDiscrim == null ) || ( "" . equals ( replyDiscrim ) ) ) { tempReplyTo = new JmsQueueImpl ( ) ; } else { tempReplyTo = new JmsTopicImpl ( ) ; } } } } if ( tempReplyTo != null ) { populateReplyToFromHeader ( tempReplyTo , _msg , rrp ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getJMSReplyToInternal" , tempReplyTo ) ; return tempReplyTo ; } | Static method that allows a replyTo destination to be obtained from a JsJmsMessage a ReverseRoutingPath and an optional JMS Core Connection object . |
40,962 | String fullEncode ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "fullEncode" ) ; String encoded = null ; if ( cachedEncodedString != null ) { encoded = cachedEncodedString ; } else { Map < String , Object > destProps = getCopyOfProperties ( ) ; encoded = encodeMap ( destProps ) ; cachedEncodedString = encoded ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "fullEncode" , encoded ) ; return encoded ; } | This method is used to encode the JMS Destination information for transmission with the message and subsequent recreation on the other side . The format of the string is as follows ; |
40,963 | String partialEncode ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "partialEncode()" ) ; String encoded = null ; if ( cachedPartialEncodedString != null ) { encoded = cachedPartialEncodedString ; } else { Map < String , Object > destProps = getCopyOfProperties ( ) ; destProps . remove ( JmsInternalConstants . DEST_NAME ) ; destProps . remove ( JmsInternalConstants . DEST_DISCRIM ) ; destProps . remove ( JmsInternalConstants . PRIORITY ) ; destProps . remove ( JmsInternalConstants . TIME_TO_LIVE ) ; destProps . remove ( JmsInternalConstants . FORWARD_ROUTING_PATH ) ; destProps . remove ( JmsInternalConstants . REVERSE_ROUTING_PATH ) ; encoded = encodeMap ( destProps ) ; cachedPartialEncodedString = encoded ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "partialEncode" , encoded ) ; return encoded ; } | A variant of the fullEncode method that is used for URI - encoding for the purposes of setting it into the jmsReplyTo field of the core message . |
40,964 | void configureDestinationFromRoutingPath ( List fwdPath ) throws JMSException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "configureDestinationFromRoutingPath" , fwdPath ) ; clearCachedEncodings ( ) ; clearCachedProducerDestinationAddress ( ) ; if ( ( fwdPath != null ) && ( fwdPath . size ( ) > 0 ) ) { int lastEltIndex = fwdPath . size ( ) - 1 ; SIDestinationAddress lastElt = ( SIDestinationAddress ) fwdPath . get ( lastEltIndex ) ; String destName = lastElt . getDestinationName ( ) ; setDestName ( destName ) ; if ( fwdPath . size ( ) > 1 ) { properties . put ( FORWARD_ROUTING_PATH , new StringArrayWrapper ( fwdPath ) ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "caching producerDestinationAddress: " + lastElt ) ; producerDestinationAddress = lastElt ; } } else { properties . remove ( FORWARD_ROUTING_PATH ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "configureDestinationFromRoutingPath" ) ; } | configureReplyDestinationFromRoutingPath Configure the ReplyDestination from the ReplyRoutingPath . The RRP from the message is used as the FRP for this Reply Destination so most of the function is performed by configureDestinationFromRoutingPath . This method keeps hold of the bus names as well as the destination names . |
40,965 | private void clearCachedEncodings ( ) { cachedEncodedString = null ; cachedPartialEncodedString = null ; for ( int i = 0 ; i < cachedEncoding . length ; i ++ ) cachedEncoding [ i ] = null ; } | This method should be called by all setter methods if they alter the state information of this destination . Doing so will cause the string encoded version of this destination to be recreated when necessary . |
40,966 | public void initialiseNonPersistent ( MessageProcessor messageProcessor , SIMPTransactionManager txManager ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "initialiseNonPersistent" , messageProcessor ) ; _messageProcessor = messageProcessor ; _subscriptionMessagePool = new ObjectPool ( "SubscriptionMessages" , NUM_MESSAGES ) ; _neighbours = new Neighbours ( this , _messageProcessor . getMessagingEngineBus ( ) ) ; _lockManager = new LockManager ( ) ; _transactionManager = txManager ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "initialiseNonPersistent" ) ; } | Called to recover Neighbours from the MessageStore . |
40,967 | public void initalised ( ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "initalised" ) ; try { _lockManager . lockExclusive ( ) ; _started = true ; if ( _proxyListener == null ) createProxyListener ( ) ; _reconciling = false ; _neighbours . resetBusSubscriptionList ( ) ; } finally { _lockManager . unlockExclusive ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "initalised" ) ; } | When initialised is called each of the neighbours are sent the set of subscriptions . |
40,968 | public void stop ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "stop" ) ; try { _lockManager . lockExclusive ( ) ; _started = false ; } finally { _lockManager . unlockExclusive ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "stop" ) ; } | Stops the proxy handler from processing any more messages |
40,969 | public void removeUnusedNeighbours ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeUnusedNeighbours" ) ; final Enumeration neighbourList = _neighbours . getAllRecoveredNeighbours ( ) ; LocalTransaction transaction = null ; try { _lockManager . lockExclusive ( ) ; transaction = _transactionManager . createLocalTransaction ( true ) ; while ( neighbourList . hasMoreElements ( ) ) { final Neighbour neighbour = ( Neighbour ) neighbourList . nextElement ( ) ; if ( _messageProcessor . getDestinationManager ( ) . getLinkDefinition ( neighbour . getBusId ( ) ) == null ) { _neighbours . removeRecoveredNeighbour ( neighbour . getUUID ( ) , ( Transaction ) transaction ) ; } } transaction . commit ( ) ; } catch ( SIException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.proxyhandler.MultiMEProxyHandler.removeUnusedNeighbours" , "1:310:1.96" , this ) ; try { if ( transaction != null ) transaction . rollback ( ) ; } catch ( SIException e1 ) { FFDCFilter . processException ( e1 , "com.ibm.ws.sib.processor.proxyhandler.MultiMEProxyHandler.removeUnusedNeighbours" , "1:324:1.96" , this ) ; SibTr . exception ( tc , e1 ) ; } SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeUnusedNeighbours" , "SIErrorException" ) ; throw new SIErrorException ( e ) ; } finally { _lockManager . unlockExclusive ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeUnusedNeighbours" ) ; } | removeUnusedNeighbours is called once all the Neighbours are defined from Admin . |
40,970 | public void subscribeEvent ( ConsumerDispatcherState subState , Transaction transaction ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "subscribeEvent" , new Object [ ] { subState , transaction } ) ; try { _lockManager . lock ( ) ; if ( ! _started ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "subscribeEvent" , "Returning as stopped" ) ; return ; } final BusGroup [ ] buses = _neighbours . getAllBuses ( ) ; SubscriptionMessageHandler messageHandler = null ; if ( ! _reconciling ) for ( int i = 0 ; i < buses . length ; ++ i ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Forwarding topic " + subState . getTopic ( ) + " to Bus " + buses [ i ] ) ; messageHandler = buses [ i ] . addLocalSubscription ( subState , messageHandler , transaction , true ) ; if ( messageHandler != null ) { addMessageHandler ( messageHandler ) ; messageHandler = null ; } } } finally { _lockManager . unlock ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "subscribeEvent" ) ; } | Forwards a subscription to all Neighbouring ME s |
40,971 | public void topicSpaceCreatedEvent ( DestinationHandler destination ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "topicSpaceCreatedEvent" , destination ) ; try { _lockManager . lockExclusive ( ) ; _neighbours . topicSpaceCreated ( destination ) ; } finally { _lockManager . unlockExclusive ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "topicSpaceCreatedEvent" ) ; } | When a topic space is created there may be proxy subscriptions already registered that need to attach to this topic space . |
40,972 | public void topicSpaceDeletedEvent ( DestinationHandler destination ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "topicSpaceDeletedEvent" , destination ) ; try { _lockManager . lockExclusive ( ) ; _neighbours . topicSpaceDeleted ( destination ) ; } finally { _lockManager . unlockExclusive ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "topicSpaceDeletedEvent" ) ; } | When a topic space is deleted there may be proxy subscriptions that need removing from the match space and putting into limbo until the delete proxy subscriptions request is made |
40,973 | public void linkStarted ( String busId , SIBUuid8 meUuid ) throws SIIncorrectCallException , SIErrorException , SIDiscriminatorSyntaxException , SISelectorSyntaxException , SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "linkStarted" , new Object [ ] { busId , meUuid } ) ; Neighbour neighbour = getNeighbour ( meUuid ) ; if ( neighbour == null ) { LocalTransaction tran = _transactionManager . createLocalTransaction ( true ) ; neighbour = createNeighbour ( meUuid , busId , ( Transaction ) tran ) ; tran . commit ( ) ; } _neighbours . resetBusSubscriptionList ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "linkStarted" ) ; } | When a Link is started we want to send a reset message to the neighbouring bus . |
40,974 | public void cleanupLinkNeighbour ( String busName ) throws SIRollbackException , SIConnectionLostException , SIIncorrectCallException , SIResourceException , SIErrorException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "cleanupLinkNeighbour" ) ; Neighbour neighbour = _neighbours . getBusNeighbour ( busName ) ; if ( neighbour != null ) { LocalTransaction tran = _messageProcessor . getTXManager ( ) . createLocalTransaction ( true ) ; deleteNeighbourForced ( neighbour . getUUID ( ) , busName , ( Transaction ) tran ) ; tran . commit ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "cleanupLinkNeighbour" ) ; } | When a link is deleted we need to clean up any neighbours that won t be deleted at restart time . |
40,975 | public void deleteNeighbourForced ( SIBUuid8 meUUID , String busId , Transaction transaction ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "deleteNeighbourForced" , new Object [ ] { meUUID , busId , transaction } ) ; try { _lockManager . lockExclusive ( ) ; _neighbours . removeNeighbour ( meUUID , busId , transaction ) ; } finally { _lockManager . unlockExclusive ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "deleteNeighbourForced" ) ; } | Removes a Neighbour by taking a brutal approach to remove all the proxy Subscriptions on this ME pointing at other Neighbours . |
40,976 | public void deleteAllNeighboursForced ( Transaction transaction ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "deleteAllNeighboursForced" , new Object [ ] { transaction } ) ; try { _lockManager . lockExclusive ( ) ; Enumeration neighbs = _neighbours . getAllNeighbours ( ) ; while ( neighbs . hasMoreElements ( ) ) { Neighbour neighbour = ( Neighbour ) neighbs . nextElement ( ) ; _neighbours . removeNeighbour ( neighbour . getUUID ( ) , neighbour . getBusId ( ) , transaction ) ; } neighbs = _neighbours . getAllRecoveredNeighbours ( ) ; while ( neighbs . hasMoreElements ( ) ) { Neighbour neighbour = ( Neighbour ) neighbs . nextElement ( ) ; _neighbours . removeNeighbour ( neighbour . getUUID ( ) , neighbour . getBusId ( ) , transaction ) ; } } finally { _lockManager . unlockExclusive ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "deleteAllNeighboursForced" ) ; } | This is purely for unittests . Many unittests dont cleanup their neighbours so we now need this to ensure certain tests are clean before starting . |
40,977 | public void recoverNeighbours ( ) throws SIResourceException , MessageStoreException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "recoverNeighbours" ) ; try { _lockManager . lockExclusive ( ) ; _reconciling = true ; _neighbours . recoverNeighbours ( ) ; } finally { _lockManager . unlockExclusive ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "recoverNeighbours" ) ; } | Recovers the Neighbours from the MessageStore . |
40,978 | Enumeration reportAllNeighbours ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "reportAllNeighbours" ) ; final Enumeration neighbours = _neighbours . getAllNeighbours ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "reportAllNeighbours" ) ; return neighbours ; } | Method reports all currently known ME s in a Enumeration format |
40,979 | void addMessageHandler ( SubscriptionMessageHandler messageHandler ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "addMessageHandler" , messageHandler ) ; final boolean inserted = _subscriptionMessagePool . add ( messageHandler ) ; if ( ! inserted ) if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "SubscriptionObjectPool size exceeded" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "addMessageHandler" ) ; } | Adds a message back into the Pool of available messages . |
40,980 | SubscriptionMessageHandler getMessageHandler ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getMessageHandler" ) ; SubscriptionMessageHandler messageHandler = ( SubscriptionMessageHandler ) _subscriptionMessagePool . remove ( ) ; if ( messageHandler == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "doProxySubscribeOp" , "Creating a new Message Handler as none available" ) ; messageHandler = new SubscriptionMessageHandler ( this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getMessageHandler" , messageHandler ) ; return messageHandler ; } | Returns the Message Handler to be used for this operation |
40,981 | private void createProxyListener ( ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createProxyListener" ) ; _proxyListener = new NeighbourProxyListener ( _neighbours , this ) ; try { _proxyAsyncConsumer = _messageProcessor . getSystemConnection ( ) . createSystemConsumerSession ( _messageProcessor . getProxyHandlerDestAddr ( ) , null , null , Reliability . ASSURED_PERSISTENT , false , false , null , false ) ; _proxyAsyncConsumer . registerAsynchConsumerCallback ( _proxyListener , 0 , 0 , 1 , null ) ; _proxyAsyncConsumer . start ( false ) ; } catch ( SIException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.proxyhandler.MultiMEProxyHandler.createProxyListener" , "1:1271:1.96" , this ) ; SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createProxyListener" , "SIResourceException" ) ; throw new SIResourceException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createProxyListener" ) ; } | Method that creates the NeighbourProxyListener instance for reading messages from the Neighbours . It then registers the listener to start receiving messages |
40,982 | public final Neighbour getNeighbour ( SIBUuid8 neighbourUUID , boolean includeRecovered ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getNeighbour" , new Object [ ] { neighbourUUID , Boolean . valueOf ( includeRecovered ) } ) ; Neighbour neighbour = _neighbours . getNeighbour ( neighbourUUID ) ; if ( ( neighbour == null ) && includeRecovered ) neighbour = _neighbours . getRecoveredNeighbour ( neighbourUUID ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getNeighbour" , neighbour ) ; return neighbour ; } | Returns the neighbour for the given UUID |
40,983 | public void getSharedLock ( int requestId ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getSharedLock" , new Object [ ] { this , new Integer ( requestId ) } ) ; Thread currentThread = Thread . currentThread ( ) ; Integer count = null ; synchronized ( this ) { if ( ( ! _sharedThreads . containsKey ( currentThread ) ) && ( ( _threadRequestingExclusiveLock != null ) || ( ( _threadHoldingExclusiveLock != null ) && ( ! _threadHoldingExclusiveLock . equals ( currentThread ) ) ) ) ) { while ( ( _threadHoldingExclusiveLock != null ) || ( _threadRequestingExclusiveLock != null ) ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Thread " + Integer . toHexString ( currentThread . hashCode ( ) ) + " is waiting for the exclusive lock to be released" ) ; try { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Thread " + Integer . toHexString ( currentThread . hashCode ( ) ) + " waiting.." ) ; this . wait ( ) ; } catch ( java . lang . InterruptedException exc ) { FFDCFilter . processException ( exc , "com.ibm.ws.recoverylog.spi.Lock.getSharedLock" , "180" , this ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Thread " + Integer . toHexString ( currentThread . hashCode ( ) ) + " was interrupted unexpectedly during wait. Retesting condition" ) ; } } if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Thread " + Integer . toHexString ( currentThread . hashCode ( ) ) + " is has detected that the exclusive lock has been released" ) ; } count = ( Integer ) _sharedThreads . get ( currentThread ) ; if ( count == null ) { count = new Integer ( 1 ) ; } else { count = new Integer ( count . intValue ( ) + 1 ) ; } _sharedThreads . put ( currentThread , count ) ; } if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Count: " + count ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getSharedLock" ) ; } | This method is called to request a shared lock . There are conditions under which a shared lock cannot be granted and this method will block until no such conditions apply . When the method returns the thread has been granted an additional shared lock . A single thread may hold any number of shared locks but the number of requests must be matched by an equal number of releases . |
40,984 | public void releaseSharedLock ( int requestId ) throws NoSharedLockException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "releaseSharedLock" , new Object [ ] { this , new Integer ( requestId ) } ) ; Thread currentThread = Thread . currentThread ( ) ; int newValue = 0 ; synchronized ( this ) { Integer count = ( Integer ) _sharedThreads . get ( currentThread ) ; if ( count == null ) { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "releaseSharedLock" , "NoSharedLockException" ) ; throw new NoSharedLockException ( ) ; } newValue = count . intValue ( ) - 1 ; if ( newValue > 0 ) { count = new Integer ( newValue ) ; _sharedThreads . put ( currentThread , count ) ; } else { count = null ; _sharedThreads . remove ( currentThread ) ; } if ( count == null ) { this . notifyAll ( ) ; } } if ( tc . isDebugEnabled ( ) ) { int countValue = 0 ; Integer count = ( Integer ) _sharedThreads . get ( currentThread ) ; if ( count != null ) countValue = count . intValue ( ) ; Tr . debug ( tc , "Count: " + count ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "releaseSharedLock" ) ; } | Releases a single shared lock from thread . |
40,985 | public boolean handleHTTP2AlpnConnect ( HttpInboundLink link ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "handleHTTP2AlpnConnect entry" ) ; } initialHttpInboundLink = link ; Integer streamID = new Integer ( 0 ) ; H2VirtualConnectionImpl h2VC = new H2VirtualConnectionImpl ( initialVC ) ; h2VC . getStateMap ( ) . remove ( HttpDispatcherLink . LINK_ID ) ; H2HttpInboundLinkWrap wrap = new H2HttpInboundLinkWrap ( httpInboundChannel , h2VC , streamID , this ) ; H2StreamProcessor streamProcessor = new H2StreamProcessor ( streamID , wrap , this , StreamState . OPEN ) ; streamTable . put ( streamID , streamProcessor ) ; writeQ . addNewNodeToQ ( streamID , Node . ROOT_STREAM_ID , Node . DEFAULT_NODE_PRIORITY , false ) ; this . setDeviceLink ( ( ConnectionLink ) myTSC ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "handleHTTP2AlpnConnect, exit" ) ; } return true ; } | Handle a connection initiated via ALPN h2 |
40,986 | public boolean handleHTTP2UpgradeRequest ( Map < String , String > headers , HttpInboundLink link ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "handleHTTP2UpgradeRequest entry" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "handleHTTP2UpgradeRequest, sending 101 response" ) ; } link . getHTTPContext ( ) . send101SwitchingProtocol ( "h2c" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "handleHTTP2UpgradeRequest, sent 101 response" ) ; } Integer streamID = new Integer ( 1 ) ; H2VirtualConnectionImpl h2VC = new H2VirtualConnectionImpl ( initialVC ) ; h2VC . getStateMap ( ) . remove ( HttpDispatcherLink . LINK_ID ) ; H2HttpInboundLinkWrap wrap = new H2HttpInboundLinkWrap ( httpInboundChannel , h2VC , streamID , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "handleHTTP2UpgradeRequest, creating stream processor" ) ; } H2StreamProcessor streamProcessor = new H2StreamProcessor ( streamID , wrap , this , StreamState . HALF_CLOSED_REMOTE ) ; incrementActiveClientStreams ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "handleHTTP2UpgradeRequest, created stream processor : " + streamProcessor ) ; } writeQ . addNewNodeToQ ( streamID , Node . ROOT_STREAM_ID , Node . DEFAULT_NODE_PRIORITY , false ) ; streamTable . put ( streamID , streamProcessor ) ; highestClientStreamId = streamID ; streamID = 0 ; streamProcessor = new H2StreamProcessor ( streamID , wrap , this , StreamState . OPEN ) ; streamTable . put ( streamID , streamProcessor ) ; String settings = headers . get ( "HTTP2-Settings" ) ; try { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "handleHTTP2UpgradeRequest, processing upgrade header settings : " + settings ) ; } getRemoteConnectionSettings ( ) . processUpgradeHeaderSettings ( settings ) ; } catch ( Http2Exception e1 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "handleHTTP2UpgradeRequest an error occurred processing the settings during connection initialization" ) ; } return false ; } initialHttpInboundLink = link ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "handleHTTP2UpgradeRequest, reinit the link : " + link ) ; } link . reinit ( wrap . getConnectionContext ( ) , wrap . getVirtualConnection ( ) , wrap ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "handleHTTP2UpgradeRequest, exit" ) ; } return true ; } | Handle an h2c upgrade request |
40,987 | protected void updateHighestStreamId ( int proposedHighestStreamId ) throws ProtocolException { if ( ( proposedHighestStreamId & 1 ) == 0 ) { if ( proposedHighestStreamId > highestLocalStreamId ) { highestLocalStreamId = proposedHighestStreamId ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "highestLocalStreamId set to stream-id: " + proposedHighestStreamId ) ; } } else if ( proposedHighestStreamId < highestLocalStreamId ) { throw new ProtocolException ( "received a new stream with a lower ID than previous; " + "current stream-id: " + proposedHighestStreamId + " highest stream-id: " + highestLocalStreamId ) ; } } else { if ( proposedHighestStreamId > highestClientStreamId ) { highestClientStreamId = proposedHighestStreamId ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "highestClientStreamId set to stream-id: " + proposedHighestStreamId ) ; } } else if ( proposedHighestStreamId < highestClientStreamId ) { throw new ProtocolException ( "received a new stream with a lower ID than previous; " + "current stream-id: " + proposedHighestStreamId + " highest stream-id: " + highestClientStreamId ) ; } } } | Keep track of the highest - valued local and remote stream IDs for this connection |
40,988 | public void destroy ( ) { httpInboundChannel . stop ( 50 ) ; initialVC = null ; frameReadProcessor = null ; h2MuxReadCallback = null ; h2MuxTCPConnectionContext = null ; h2MuxTCPReadContext = null ; h2MuxTCPWriteContext = null ; localConnectionSettings = null ; remoteConnectionSettings = null ; readContextTable = null ; writeContextTable = null ; super . destroy ( ) ; } | A GOAWAY frame has been received ; start shutting down this connection |
40,989 | public void incrementConnectionWindowUpdateLimit ( int x ) throws FlowControlException { if ( ! checkIfGoAwaySendingOrClosing ( ) ) { writeQ . incrementConnectionWindowUpdateLimit ( x ) ; H2StreamProcessor stream ; for ( Integer i : streamTable . keySet ( ) ) { stream = streamTable . get ( i ) ; if ( stream != null ) { stream . connectionWindowSizeUpdated ( ) ; } } } } | Increment the connection window limit but the given amount |
40,990 | public void closeStream ( H2StreamProcessor p ) { synchronized ( streamOpenCloseSync ) { if ( p . getId ( ) != 0 ) { writeQ . removeNodeFromQ ( p . getId ( ) ) ; this . closedStreams . add ( p ) ; if ( p . getId ( ) % 2 == 0 ) { this . openPushStreams -- ; } else { decrementActiveClientStreams ( ) ; } } long currentTime = System . currentTimeMillis ( ) ; while ( closedStreams . peek ( ) != null && currentTime - closedStreams . peek ( ) . getCloseTime ( ) > STREAM_CLOSE_DELAY ) { streamTable . remove ( closedStreams . remove ( ) . getId ( ) ) ; } } } | Remove the stream matching the given ID from the write tree and decrement the number of open streams . |
40,991 | public H2StreamProcessor getStream ( int streamID ) { H2StreamProcessor streamProcessor = null ; streamProcessor = streamTable . get ( streamID ) ; return streamProcessor ; } | Get the stream processor for a given stream ID if it exists |
40,992 | public void remove ( BeanId beanId , boolean removeFromFailoverCache ) throws RemoteException { if ( ivStatefulFailoverCache == null || ! ivStatefulFailoverCache . beanExists ( beanId ) ) { synchronized ( ivRemoveLock ) { ivBeanStore . remove ( beanId ) ; } } else { if ( removeFromFailoverCache ) { ivStatefulFailoverCache . removeCacheEntry ( beanId ) ; } } } | Version of remove which can be used with only a beanId passed in as input . |
40,993 | private byte [ ] getCompressedBytes ( Object sb , long lastAccessTime , Object exPC ) throws IOException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getCompressedBytes" , sb ) ; ByteArrayOutputStream baos = new ByteArrayOutputStream ( 1024 ) ; GZIPOutputStream gout = new GZIPOutputStream ( baos ) ; ObjectOutputStream beanStream2 = createPassivationOutputStream ( gout ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "writing failover data with last access time set to: " + lastAccessTime ) ; beanStream2 . writeLong ( lastAccessTime ) ; beanStream2 . writeObject ( exPC ) ; beanStream2 . writeObject ( sb ) ; gout . finish ( ) ; gout . close ( ) ; beanStream2 . close ( ) ; byte [ ] bytes = baos . toByteArray ( ) ; baos . close ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getCompressedBytes" ) ; return bytes ; } | LIDB2018 - 1 added entire method . |
40,994 | public Map < String , Map < String , Field > > getPassivatorFields ( final BeanMetaData bmd ) { Map < String , Map < String , Field > > result = bmd . ivPassivatorFields ; if ( result == null ) { result = AccessController . doPrivileged ( new PrivilegedAction < Map < String , Map < String , Field > > > ( ) { public Map < String , Map < String , Field > > run ( ) { Map < String , Map < String , Field > > allFields = new HashMap < String , Map < String , Field > > ( ) ; collectPassivatorFields ( bmd . enterpriseBeanClass , allFields ) ; if ( bmd . ivInterceptorMetaData != null ) { for ( Class < ? > klass : bmd . ivInterceptorMetaData . ivInterceptorClasses ) { collectPassivatorFields ( klass , allFields ) ; } } return allFields ; } } ) ; bmd . ivPassivatorFields = result ; } return result ; } | Get the passivator fields for the specified bean . |
40,995 | public Token removeFirst ( Transaction transaction ) throws ObjectManagerException { Iterator iterator = entrySet ( ) . iterator ( ) ; List . Entry entry = ( List . Entry ) iterator . next ( transaction ) ; iterator . remove ( transaction ) ; return entry . getValue ( ) ; } | Remove the first element in the list . |
40,996 | public void postProcessMatches ( DestinationHandler topicSpace , String topic , Object [ ] results , int index ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "postProcessMatches" , "results: " + Arrays . toString ( results ) + ";index: " + index + ";topic" + topic ) ; Set subRes = ( Set ) results [ index ] ; Iterator itr = subRes . iterator ( ) ; if ( authorization != null ) { if ( authorization . isBusSecure ( ) ) { if ( topicSpace != null && topicSpace . isTopicAccessCheckRequired ( ) ) { while ( itr . hasNext ( ) ) { ControllableProxySubscription cps = ( ControllableProxySubscription ) itr . next ( ) ; if ( cps . isForeignSecuredProxy ( ) ) { String userid = cps . getMESubUserId ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Foreign bus proxy in a secured env for user, " + userid + ", on topic, " + topic ) ; try { if ( ! authorization . checkPermissionToSubscribe ( topicSpace , topic , userid , ( TopicAclTraversalResults ) results [ MessageProcessorMatchTarget . ACL_TYPE ] ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Not authorized, remove from PSOH results" ) ; itr . remove ( ) ; } } catch ( Exception e ) { } } } } } } else { } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "postProcessMatches" ) ; } | Complete processing of results for this handler after completely traversing MatchSpace . |
40,997 | private static void createInstance ( ) throws Exception { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createInstance" , null ) ; try { Class cls = Class . forName ( JsConstants . JS_ADMIN_FACTORY_CLASS ) ; _instance = ( JsAdminFactory ) cls . newInstance ( ) ; } catch ( Exception e ) { com . ibm . ws . ffdc . FFDCFilter . processException ( e , CLASS_NAME + ".<clinit>" , JsConstants . PROBE_10 ) ; SibTr . error ( tc , "EXCP_DURING_INIT_SIEG0001" , e ) ; throw e ; } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createInstance" ) ; } | Create the singleton instance of this factory class |
40,998 | public SIBusMessage [ ] readSet ( SIMessageHandle [ ] msgHandles ) throws SISessionUnavailableException , SISessionDroppedException , SIConnectionUnavailableException , SIConnectionDroppedException , SIResourceException , SIConnectionLostException , SIIncorrectCallException , SIMessageNotLockedException , SIErrorException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "readSet" , new Object [ ] { msgHandles . length + " msg ids" } ) ; SIBusMessage [ ] messages = null ; try { closeLock . readLock ( ) . lockInterruptibly ( ) ; try { checkAlreadyClosed ( ) ; CommsByteBuffer request = getCommsByteBuffer ( ) ; request . putShort ( getConnectionObjectID ( ) ) ; request . putShort ( getProxyID ( ) ) ; request . putSIMessageHandles ( msgHandles ) ; CommsByteBuffer reply = jfapExchange ( request , JFapChannelConstants . SEG_READ_SET , JFapChannelConstants . PRIORITY_MEDIUM , true ) ; try { short err = reply . getCommandCompletionCode ( JFapChannelConstants . SEG_READ_SET_R ) ; if ( err != CommsConstants . SI_NO_EXCEPTION ) { checkFor_SISessionUnavailableException ( reply , err ) ; checkFor_SISessionDroppedException ( reply , err ) ; checkFor_SIConnectionUnavailableException ( reply , err ) ; checkFor_SIConnectionDroppedException ( reply , err ) ; checkFor_SIResourceException ( reply , err ) ; checkFor_SIConnectionLostException ( reply , err ) ; checkFor_SIIncorrectCallException ( reply , err ) ; checkFor_SIMessageNotLockedException ( reply , err ) ; checkFor_SIErrorException ( reply , err ) ; defaultChecker ( reply , err ) ; } int numberOfMessages = reply . getInt ( ) ; messages = new SIBusMessage [ numberOfMessages ] ; for ( int x = 0 ; x < numberOfMessages ; x ++ ) { messages [ x ] = reply . getMessage ( getCommsConnection ( ) ) ; } } finally { reply . release ( false ) ; } } finally { closeLock . readLock ( ) . unlock ( ) ; } } catch ( InterruptedException e ) { } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "readSet" ) ; return messages ; } | This method is used to read a set of locked messages held by the message processor . This call will simply be passed onto the server who will call the method on the real bifurcated consumer session residing on the server . |
40,999 | public SIBusMessage [ ] readAndDeleteSet ( SIMessageHandle [ ] msgHandles , SITransaction tran ) throws SISessionUnavailableException , SISessionDroppedException , SIConnectionUnavailableException , SIConnectionDroppedException , SIResourceException , SIConnectionLostException , SILimitExceededException , SIIncorrectCallException , SIMessageNotLockedException , SIErrorException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "readAndDeleteSet" , new Object [ ] { msgHandles . length + " msg ids" , tran } ) ; SIBusMessage [ ] messages = null ; try { closeLock . readLock ( ) . lockInterruptibly ( ) ; try { checkAlreadyClosed ( ) ; if ( tran != null ) { synchronized ( tran ) { if ( ! ( ( Transaction ) tran ) . isValid ( ) ) { throw new SIIncorrectCallException ( nls . getFormattedMessage ( "TRANSACTION_COMPLETE_SICO1066" , null , null ) ) ; } messages = _readAndDeleteSet ( msgHandles , tran ) ; } } else { messages = _readAndDeleteSet ( msgHandles , null ) ; } } finally { closeLock . readLock ( ) . unlock ( ) ; } } catch ( InterruptedException e ) { } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "readAndDeleteSet" ) ; return messages ; } | This method is used to read and then delete a set of locked messages held by the message processor . This call will simply be passed onto the server who will call the method on the real bifurcated consumer session residing on the server . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.