repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
sequence
docstring
stringlengths
3
16k
docstring_tokens
sequence
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
OpenLiberty/open-liberty
dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/ThreadPoolController.java
ThreadPoolController.deactivate
synchronized void deactivate() { paused = false; if (activeTask != null) { activeTask.cancel(); activeTask = null; } this.threadPool = null; }
java
synchronized void deactivate() { paused = false; if (activeTask != null) { activeTask.cancel(); activeTask = null; } this.threadPool = null; }
[ "synchronized", "void", "deactivate", "(", ")", "{", "paused", "=", "false", ";", "if", "(", "activeTask", "!=", "null", ")", "{", "activeTask", ".", "cancel", "(", ")", ";", "activeTask", "=", "null", ";", "}", "this", ".", "threadPool", "=", "null", ";", "}" ]
Deactivate the controller. Any scheduled tasks will be canceled.
[ "Deactivate", "the", "controller", ".", "Any", "scheduled", "tasks", "will", "be", "canceled", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/ThreadPoolController.java#L696-L703
train
OpenLiberty/open-liberty
dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/ThreadPoolController.java
ThreadPoolController.resume
synchronized void resume() { paused = false; if (activeTask == null) { activeTask = new IntervalTask(this); timer.schedule(activeTask, interval, interval); } }
java
synchronized void resume() { paused = false; if (activeTask == null) { activeTask = new IntervalTask(this); timer.schedule(activeTask, interval, interval); } }
[ "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.
[ "Resume", "monitoring", "and", "control", "of", "the", "associated", "thread", "pool", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/ThreadPoolController.java#L731-L737
train
OpenLiberty/open-liberty
dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/ThreadPoolController.java
ThreadPoolController.getThroughputDistribution
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; }
java
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; }
[ "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. @param activeThreads the number of active threads when the data was collected @param create whether to create and return a new throughput distribution if none currently exists @return the data representing the throughput distribution for the specified number of active threads
[ "Get", "the", "throughput", "distribution", "data", "associated", "with", "the", "specified", "number", "of", "active", "threads", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/ThreadPoolController.java#L752-L763
train
OpenLiberty/open-liberty
dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/ThreadPoolController.java
ThreadPoolController.manageIdlePool
boolean manageIdlePool(ThreadPoolExecutor threadPool, long intervalCompleted) { // Manage the intervalCompleted count if (intervalCompleted == 0 && threadPool.getActiveCount() == 0) { consecutiveIdleCount++; } else { consecutiveIdleCount = 0; } if (consecutiveIdleCount >= IDLE_INTERVALS_BEFORE_PAUSE) { pause(); lastAction = LastAction.PAUSE; return true; } return false; }
java
boolean manageIdlePool(ThreadPoolExecutor threadPool, long intervalCompleted) { // Manage the intervalCompleted count if (intervalCompleted == 0 && threadPool.getActiveCount() == 0) { consecutiveIdleCount++; } else { consecutiveIdleCount = 0; } if (consecutiveIdleCount >= IDLE_INTERVALS_BEFORE_PAUSE) { pause(); lastAction = LastAction.PAUSE; return true; } return false; }
[ "boolean", "manageIdlePool", "(", "ThreadPoolExecutor", "threadPool", ",", "long", "intervalCompleted", ")", "{", "// Manage the intervalCompleted count", "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. @param threadPool a reference to the thread pool @param intervalCompleted the tasks completed this interval @return true if the controller has been paused
[ "Determine", "whether", "or", "not", "the", "thread", "pool", "has", "been", "idle", "long", "enough", "to", "pause", "the", "monitoring", "task", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/ThreadPoolController.java#L774-L790
train
OpenLiberty/open-liberty
dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/ThreadPoolController.java
ThreadPoolController.handleOutliers
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; // 8/10/2012: Reset the data for this thread count when we hit an outlier // 1/20/2018: refine the distribution reset criteria if (currentIsOutlier) { /* * Decide whether to reset the distribution, which throws away the historical * ewma for the poolSize and replaces it with the new throughput. * We will use 3 criteria, any of which is sufficient to reset the distribution: * * 1) How much do we trust the historical data? * If the historical ewma is the result of many observations with similar throughput, * the standard deviation will be a small fraction of the ewma. If stddev/ewma is * greater than 10%, then the historical data is not really strong, let's reset. * * 2) How much different is the new tput from the ewma? * If the new throughput is very very different from the ewma, that suggests the workload * may have changed significantly, in which case the historical data would no longer be * valid. If the throughput change is greater than 50% of ewma, let's reset. * * 3) Is the throughput simply unstable? * If every new datapoint at this poolSize is more than 3 standard deviations off the * historical ewma, then we may as well follow the bouncing ball, rather than averaging * points which do not seem to want to cluster around a mean. If we get N outliers in a * row at this poolSize, let's reset. */ 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(); } // Check for repeated outliers // 1/20/2018: increment only after resetting a distribution, not a single outlier event if (lastAction != LastAction.NONE) { if (distributionReset) { consecutiveOutlierAfterAdjustment++; } else { consecutiveOutlierAfterAdjustment = 0; } } // If we repeatedly hit an outlier after changing the pool size // we should reset the statistics if (consecutiveOutlierAfterAdjustment >= MAX_OUTLIER_AFTER_CHANGE_BEFORE_RESET) { resetThreadPool(); return true; } return false; }
java
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; // 8/10/2012: Reset the data for this thread count when we hit an outlier // 1/20/2018: refine the distribution reset criteria if (currentIsOutlier) { /* * Decide whether to reset the distribution, which throws away the historical * ewma for the poolSize and replaces it with the new throughput. * We will use 3 criteria, any of which is sufficient to reset the distribution: * * 1) How much do we trust the historical data? * If the historical ewma is the result of many observations with similar throughput, * the standard deviation will be a small fraction of the ewma. If stddev/ewma is * greater than 10%, then the historical data is not really strong, let's reset. * * 2) How much different is the new tput from the ewma? * If the new throughput is very very different from the ewma, that suggests the workload * may have changed significantly, in which case the historical data would no longer be * valid. If the throughput change is greater than 50% of ewma, let's reset. * * 3) Is the throughput simply unstable? * If every new datapoint at this poolSize is more than 3 standard deviations off the * historical ewma, then we may as well follow the bouncing ball, rather than averaging * points which do not seem to want to cluster around a mean. If we get N outliers in a * row at this poolSize, let's reset. */ 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(); } // Check for repeated outliers // 1/20/2018: increment only after resetting a distribution, not a single outlier event if (lastAction != LastAction.NONE) { if (distributionReset) { consecutiveOutlierAfterAdjustment++; } else { consecutiveOutlierAfterAdjustment = 0; } } // If we repeatedly hit an outlier after changing the pool size // we should reset the statistics if (consecutiveOutlierAfterAdjustment >= MAX_OUTLIER_AFTER_CHANGE_BEFORE_RESET) { resetThreadPool(); return true; } return false; }
[ "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", ";", "// 8/10/2012: Reset the data for this thread count when we hit an outlier", "// 1/20/2018: refine the distribution reset criteria", "if", "(", "currentIsOutlier", ")", "{", "/*\n * Decide whether to reset the distribution, which throws away the historical\n * ewma for the poolSize and replaces it with the new throughput.\n * We will use 3 criteria, any of which is sufficient to reset the distribution:\n *\n * 1) How much do we trust the historical data?\n * If the historical ewma is the result of many observations with similar throughput,\n * the standard deviation will be a small fraction of the ewma. If stddev/ewma is\n * greater than 10%, then the historical data is not really strong, let's reset.\n *\n * 2) How much different is the new tput from the ewma?\n * If the new throughput is very very different from the ewma, that suggests the workload\n * may have changed significantly, in which case the historical data would no longer be\n * valid. If the throughput change is greater than 50% of ewma, let's reset.\n *\n * 3) Is the throughput simply unstable?\n * If every new datapoint at this poolSize is more than 3 standard deviations off the\n * historical ewma, then we may as well follow the bouncing ball, rather than averaging\n * points which do not seem to want to cluster around a mean. If we get N outliers in a\n * row at this poolSize, let's reset.\n */", "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", "(", ")", ";", "}", "// Check for repeated outliers", "// 1/20/2018: increment only after resetting a distribution, not a single outlier event", "if", "(", "lastAction", "!=", "LastAction", ".", "NONE", ")", "{", "if", "(", "distributionReset", ")", "{", "consecutiveOutlierAfterAdjustment", "++", ";", "}", "else", "{", "consecutiveOutlierAfterAdjustment", "=", "0", ";", "}", "}", "// If we repeatedly hit an outlier after changing the pool size", "// we should reset the statistics", "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. @param distribution the throughput distribution associated with throughput @param throughput the observed throughput @return true if the thread pool has been reset due to an aberrant workload
[ "Detect", "and", "handle", "aberrant", "data", "points", "by", "resetting", "the", "statistics", "in", "the", "throughput", "distribution", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/ThreadPoolController.java#L802-L872
train
OpenLiberty/open-liberty
dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/ThreadPoolController.java
ThreadPoolController.adjustPoolSize
int adjustPoolSize(int poolSize, int poolAdjustment) { if (threadPool == null) return poolSize; // arguably should return 0, but "least change" is safer... This happens during shutdown. int newPoolSize = poolSize + poolAdjustment; lastAction = LastAction.NONE; if (poolAdjustment != 0) { // don't shrink below coreThreads 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; }
java
int adjustPoolSize(int poolSize, int poolAdjustment) { if (threadPool == null) return poolSize; // arguably should return 0, but "least change" is safer... This happens during shutdown. int newPoolSize = poolSize + poolAdjustment; lastAction = LastAction.NONE; if (poolAdjustment != 0) { // don't shrink below coreThreads 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; }
[ "int", "adjustPoolSize", "(", "int", "poolSize", ",", "int", "poolAdjustment", ")", "{", "if", "(", "threadPool", "==", "null", ")", "return", "poolSize", ";", "// arguably should return 0, but \"least change\" is safer... This happens during shutdown.", "int", "newPoolSize", "=", "poolSize", "+", "poolAdjustment", ";", "lastAction", "=", "LastAction", ".", "NONE", ";", "if", "(", "poolAdjustment", "!=", "0", ")", "{", "// don't shrink below coreThreads", "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. @param poolSize the current pool size @param poolAdjustment the change to make to the pool @return the new pool size
[ "Adjust", "the", "size", "of", "the", "thread", "pool", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/ThreadPoolController.java#L1209-L1230
train
OpenLiberty/open-liberty
dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/ThreadPoolController.java
ThreadPoolController.poolTputRatioData
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(); }
java
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(); }
[ "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
[ "Utility", "method", "to", "format", "pool", "tput", "ratio", "data" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/ThreadPoolController.java#L1457-L1470
train
OpenLiberty/open-liberty
dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/ThreadPoolController.java
ThreadPoolController.resolveHang
private boolean resolveHang(long tasksCompleted, boolean queueEmpty, int poolSize) { boolean actionTaken = false; if (tasksCompleted == 0 && !queueEmpty) { /** * When a hang is detected the controller enters hang resolution mode. * The controller will run on a shorter-than-usual cycle for hangResolutionCycles * from the last hang detection, to resolve hang situations more quickly. */ if (hangResolutionCountdown == 0) { // cancel regular controller schedule activeTask.cancel(); // restart with shortened interval for quicker hang resolution activeTask = new IntervalTask(this); timer.schedule(activeTask, hangInterval, hangInterval); } hangResolutionCountdown = hangResolutionCycles; controllerCyclesWithoutHang = 0; // if this is the first time we detected a given deadlock, record how many threads there are // and print a message 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); // update the poolSize set to resolve the hang, plus a buffer amount int targetSize = poolSize + (compareRange * poolIncrement); if (hangBufferPoolSize < targetSize) { hangBufferPoolSize = targetSize; } actionTaken = true; } else { // there's a hang, but we can't add any more threads... emit a warning the first time this // happens for a given hang, but otherwise just bail if (hangMaxThreadsMessageEmitted == false && hangIntervalCounter > 0) { if (tc.isWarningEnabled()) { Tr.warning(tc, "unbreakableExecutorHang", poolSizeWhenHangDetected, poolSize); } hangMaxThreadsMessageEmitted = true; } } hangIntervalCounter++; } else { // no hang exists, so reset the appropriate variables that track hangs poolSizeWhenHangDetected = -1; hangIntervalCounter = 0; hangMaxThreadsMessageEmitted = false; // manage hang resolution mode if (hangResolutionCountdown > 0) { hangResolutionCountdown--; if (hangResolutionCountdown <= 0) { // move out of hang resolution cycle time activeTask.cancel(); // restart using regular cycle time activeTask = new IntervalTask(this); timer.schedule(activeTask, interval, interval); } } /** * if controller is running below hangResolutionPoolSize marker without hanging, * we can reduce that marker ... the workload must have changed, so prior hang * information is no longer valid. We will reduce it gradually, to maintain a * conservative stance toward avoiding hangs. */ if (hangBufferPoolSize > coreThreads) { if (hangBufferPoolSize > poolSize) { controllerCyclesWithoutHang++; if (controllerCyclesWithoutHang > noHangCyclesThreshold) { setPoolIncrementDecrement(poolSize); hangBufferPoolSize -= poolDecrement; controllerCyclesWithoutHang = 0; } } } } return actionTaken; }
java
private boolean resolveHang(long tasksCompleted, boolean queueEmpty, int poolSize) { boolean actionTaken = false; if (tasksCompleted == 0 && !queueEmpty) { /** * When a hang is detected the controller enters hang resolution mode. * The controller will run on a shorter-than-usual cycle for hangResolutionCycles * from the last hang detection, to resolve hang situations more quickly. */ if (hangResolutionCountdown == 0) { // cancel regular controller schedule activeTask.cancel(); // restart with shortened interval for quicker hang resolution activeTask = new IntervalTask(this); timer.schedule(activeTask, hangInterval, hangInterval); } hangResolutionCountdown = hangResolutionCycles; controllerCyclesWithoutHang = 0; // if this is the first time we detected a given deadlock, record how many threads there are // and print a message 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); // update the poolSize set to resolve the hang, plus a buffer amount int targetSize = poolSize + (compareRange * poolIncrement); if (hangBufferPoolSize < targetSize) { hangBufferPoolSize = targetSize; } actionTaken = true; } else { // there's a hang, but we can't add any more threads... emit a warning the first time this // happens for a given hang, but otherwise just bail if (hangMaxThreadsMessageEmitted == false && hangIntervalCounter > 0) { if (tc.isWarningEnabled()) { Tr.warning(tc, "unbreakableExecutorHang", poolSizeWhenHangDetected, poolSize); } hangMaxThreadsMessageEmitted = true; } } hangIntervalCounter++; } else { // no hang exists, so reset the appropriate variables that track hangs poolSizeWhenHangDetected = -1; hangIntervalCounter = 0; hangMaxThreadsMessageEmitted = false; // manage hang resolution mode if (hangResolutionCountdown > 0) { hangResolutionCountdown--; if (hangResolutionCountdown <= 0) { // move out of hang resolution cycle time activeTask.cancel(); // restart using regular cycle time activeTask = new IntervalTask(this); timer.schedule(activeTask, interval, interval); } } /** * if controller is running below hangResolutionPoolSize marker without hanging, * we can reduce that marker ... the workload must have changed, so prior hang * information is no longer valid. We will reduce it gradually, to maintain a * conservative stance toward avoiding hangs. */ if (hangBufferPoolSize > coreThreads) { if (hangBufferPoolSize > poolSize) { controllerCyclesWithoutHang++; if (controllerCyclesWithoutHang > noHangCyclesThreshold) { setPoolIncrementDecrement(poolSize); hangBufferPoolSize -= poolDecrement; controllerCyclesWithoutHang = 0; } } } } return actionTaken; }
[ "private", "boolean", "resolveHang", "(", "long", "tasksCompleted", ",", "boolean", "queueEmpty", ",", "int", "poolSize", ")", "{", "boolean", "actionTaken", "=", "false", ";", "if", "(", "tasksCompleted", "==", "0", "&&", "!", "queueEmpty", ")", "{", "/**\n * When a hang is detected the controller enters hang resolution mode.\n * The controller will run on a shorter-than-usual cycle for hangResolutionCycles\n * from the last hang detection, to resolve hang situations more quickly.\n */", "if", "(", "hangResolutionCountdown", "==", "0", ")", "{", "// cancel regular controller schedule", "activeTask", ".", "cancel", "(", ")", ";", "// restart with shortened interval for quicker hang resolution", "activeTask", "=", "new", "IntervalTask", "(", "this", ")", ";", "timer", ".", "schedule", "(", "activeTask", ",", "hangInterval", ",", "hangInterval", ")", ";", "}", "hangResolutionCountdown", "=", "hangResolutionCycles", ";", "controllerCyclesWithoutHang", "=", "0", ";", "// if this is the first time we detected a given deadlock, record how many threads there are", "// and print a message", "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", ")", ";", "// update the poolSize set to resolve the hang, plus a buffer amount", "int", "targetSize", "=", "poolSize", "+", "(", "compareRange", "*", "poolIncrement", ")", ";", "if", "(", "hangBufferPoolSize", "<", "targetSize", ")", "{", "hangBufferPoolSize", "=", "targetSize", ";", "}", "actionTaken", "=", "true", ";", "}", "else", "{", "// there's a hang, but we can't add any more threads... emit a warning the first time this", "// happens for a given hang, but otherwise just bail", "if", "(", "hangMaxThreadsMessageEmitted", "==", "false", "&&", "hangIntervalCounter", ">", "0", ")", "{", "if", "(", "tc", ".", "isWarningEnabled", "(", ")", ")", "{", "Tr", ".", "warning", "(", "tc", ",", "\"unbreakableExecutorHang\"", ",", "poolSizeWhenHangDetected", ",", "poolSize", ")", ";", "}", "hangMaxThreadsMessageEmitted", "=", "true", ";", "}", "}", "hangIntervalCounter", "++", ";", "}", "else", "{", "// no hang exists, so reset the appropriate variables that track hangs", "poolSizeWhenHangDetected", "=", "-", "1", ";", "hangIntervalCounter", "=", "0", ";", "hangMaxThreadsMessageEmitted", "=", "false", ";", "// manage hang resolution mode", "if", "(", "hangResolutionCountdown", ">", "0", ")", "{", "hangResolutionCountdown", "--", ";", "if", "(", "hangResolutionCountdown", "<=", "0", ")", "{", "// move out of hang resolution cycle time", "activeTask", ".", "cancel", "(", ")", ";", "// restart using regular cycle time", "activeTask", "=", "new", "IntervalTask", "(", "this", ")", ";", "timer", ".", "schedule", "(", "activeTask", ",", "interval", ",", "interval", ")", ";", "}", "}", "/**\n * if controller is running below hangResolutionPoolSize marker without hanging,\n * we can reduce that marker ... the workload must have changed, so prior hang\n * information is no longer valid. We will reduce it gradually, to maintain a\n * conservative stance toward avoiding hangs.\n */", "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. @return true if action was taken to resolve a hang, or false otherwise
[ "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", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/ThreadPoolController.java#L1478-L1562
train
OpenLiberty/open-liberty
dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/ThreadPoolController.java
ThreadPoolController.pruneData
private boolean pruneData(ThroughputDistribution priorStats, double forecast) { boolean prune = false; // if forecast tput is much greater or much smaller than priorStats, we suspect // priorStats is no longer relevant, so prune it double tputRatio = forecast / priorStats.getMovingAverage(); if (tputRatio > tputRatioPruneLevel || tputRatio < (1 / tputRatioPruneLevel)) { prune = true; } else { // age & reliability (represented by standard deviation) check int age = controllerCycle - priorStats.getLastUpdate(); double variability = (priorStats.getStddev() / priorStats.getMovingAverage()); if (age * variability > dataAgePruneLevel) prune = true; } return prune; }
java
private boolean pruneData(ThroughputDistribution priorStats, double forecast) { boolean prune = false; // if forecast tput is much greater or much smaller than priorStats, we suspect // priorStats is no longer relevant, so prune it double tputRatio = forecast / priorStats.getMovingAverage(); if (tputRatio > tputRatioPruneLevel || tputRatio < (1 / tputRatioPruneLevel)) { prune = true; } else { // age & reliability (represented by standard deviation) check int age = controllerCycle - priorStats.getLastUpdate(); double variability = (priorStats.getStddev() / priorStats.getMovingAverage()); if (age * variability > dataAgePruneLevel) prune = true; } return prune; }
[ "private", "boolean", "pruneData", "(", "ThroughputDistribution", "priorStats", ",", "double", "forecast", ")", "{", "boolean", "prune", "=", "false", ";", "// if forecast tput is much greater or much smaller than priorStats, we suspect", "// priorStats is no longer relevant, so prune it", "double", "tputRatio", "=", "forecast", "/", "priorStats", ".", "getMovingAverage", "(", ")", ";", "if", "(", "tputRatio", ">", "tputRatioPruneLevel", "||", "tputRatio", "<", "(", "1", "/", "tputRatioPruneLevel", ")", ")", "{", "prune", "=", "true", ";", "}", "else", "{", "// age & reliability (represented by standard deviation) check", "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. @param priorStats - ThroughputDistribution under evaluation @param forecast - expected throughput at the current poolSize @return - true if priorStats should be removed
[ "Evaluates", "a", "ThroughputDistribution", "for", "possible", "removal", "from", "the", "historical", "dataset", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/ThreadPoolController.java#L1583-L1600
train
OpenLiberty/open-liberty
dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/ThreadPoolController.java
ThreadPoolController.getSmallestValidPoolSize
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);; // prune data that is too old or outside believable range 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; }
java
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);; // prune data that is too old or outside believable range 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; }
[ "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", ")", ";", ";", "// prune data that is too old or outside believable range", "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. @param poolSize - current poolSize @param forecast - expected throughput at current poolSize @return - smallest valid poolSize found
[ "Returns", "the", "smallest", "valid", "poolSize", "in", "the", "current", "historical", "dataset", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/ThreadPoolController.java#L1609-L1629
train
OpenLiberty/open-liberty
dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/ThreadPoolController.java
ThreadPoolController.getLargestValidPoolSize
private Integer getLargestValidPoolSize(Integer poolSize, Double forecast) { Integer largestPoolSize = -1; // find largest poolSize with valid data boolean validLargeData = false; while (!validLargeData) { largestPoolSize = threadStats.lastKey(); ThroughputDistribution largestPoolSizeStats = getThroughputDistribution(largestPoolSize, false);; // prune any data that is too old or outside believable range if (pruneData(largestPoolSizeStats, forecast)) { threadStats.remove(largestPoolSize); } else { validLargeData = true; } } return largestPoolSize; }
java
private Integer getLargestValidPoolSize(Integer poolSize, Double forecast) { Integer largestPoolSize = -1; // find largest poolSize with valid data boolean validLargeData = false; while (!validLargeData) { largestPoolSize = threadStats.lastKey(); ThroughputDistribution largestPoolSizeStats = getThroughputDistribution(largestPoolSize, false);; // prune any data that is too old or outside believable range if (pruneData(largestPoolSizeStats, forecast)) { threadStats.remove(largestPoolSize); } else { validLargeData = true; } } return largestPoolSize; }
[ "private", "Integer", "getLargestValidPoolSize", "(", "Integer", "poolSize", ",", "Double", "forecast", ")", "{", "Integer", "largestPoolSize", "=", "-", "1", ";", "// find largest poolSize with valid data", "boolean", "validLargeData", "=", "false", ";", "while", "(", "!", "validLargeData", ")", "{", "largestPoolSize", "=", "threadStats", ".", "lastKey", "(", ")", ";", "ThroughputDistribution", "largestPoolSizeStats", "=", "getThroughputDistribution", "(", "largestPoolSize", ",", "false", ")", ";", ";", "// prune any data that is too old or outside believable range", "if", "(", "pruneData", "(", "largestPoolSizeStats", ",", "forecast", ")", ")", "{", "threadStats", ".", "remove", "(", "largestPoolSize", ")", ";", "}", "else", "{", "validLargeData", "=", "true", ";", "}", "}", "return", "largestPoolSize", ";", "}" ]
Returns the largest valid poolSize in the current historical dataset. @param poolSize - current poolSize @param forecast - expected throughput at current poolSize @return - largest valid poolSize found
[ "Returns", "the", "largest", "valid", "poolSize", "in", "the", "current", "historical", "dataset", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/ThreadPoolController.java#L1638-L1653
train
OpenLiberty/open-liberty
dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/ThreadPoolController.java
ThreadPoolController.leanTowardShrinking
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; // compare the poolSize ratio and tput ratio between current and largest poolSizes // if tput no better at larger poolSize, or not much better, lean toward shrinking if (tputRatio < 1.0) { // much larger poolSize has smaller tput - lean strongly (75%) toward shrinking shouldShrink = (flipCoin() && flipCoin()) ? false : true; } else if (poolTputRatio > poolTputRatioHigh) { // poolSize ratio is much larger than tput ratio - lean strongly (75%) toward shrinking shouldShrink = (flipCoin() && flipCoin()) ? false : true; } else if (poolTputRatio > poolTputRatioLow) { // poolSize ratio is slightly larger than tput ratio - lean weakly (50%) toward shrinking shouldShrink = (flipCoin()) ? false : true; } // Format an event level trace point with the key tput ratio data if (tc.isEventEnabled() && shouldShrink) Tr.event(tc, "Tput ratio shrinkScore adjustment, larger poolSizes", poolTputRatioData(poolTputRatio, poolRatio, tputRatio, smallerPoolTput, largerPoolTput, smallerPoolSize, largerPoolSize)); return shouldShrink; }
java
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; // compare the poolSize ratio and tput ratio between current and largest poolSizes // if tput no better at larger poolSize, or not much better, lean toward shrinking if (tputRatio < 1.0) { // much larger poolSize has smaller tput - lean strongly (75%) toward shrinking shouldShrink = (flipCoin() && flipCoin()) ? false : true; } else if (poolTputRatio > poolTputRatioHigh) { // poolSize ratio is much larger than tput ratio - lean strongly (75%) toward shrinking shouldShrink = (flipCoin() && flipCoin()) ? false : true; } else if (poolTputRatio > poolTputRatioLow) { // poolSize ratio is slightly larger than tput ratio - lean weakly (50%) toward shrinking shouldShrink = (flipCoin()) ? false : true; } // Format an event level trace point with the key tput ratio data if (tc.isEventEnabled() && shouldShrink) Tr.event(tc, "Tput ratio shrinkScore adjustment, larger poolSizes", poolTputRatioData(poolTputRatio, poolRatio, tputRatio, smallerPoolTput, largerPoolTput, smallerPoolSize, largerPoolSize)); return shouldShrink; }
[ "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", ";", "// compare the poolSize ratio and tput ratio between current and largest poolSizes", "// if tput no better at larger poolSize, or not much better, lean toward shrinking", "if", "(", "tputRatio", "<", "1.0", ")", "{", "// much larger poolSize has smaller tput - lean strongly (75%) toward shrinking", "shouldShrink", "=", "(", "flipCoin", "(", ")", "&&", "flipCoin", "(", ")", ")", "?", "false", ":", "true", ";", "}", "else", "if", "(", "poolTputRatio", ">", "poolTputRatioHigh", ")", "{", "// poolSize ratio is much larger than tput ratio - lean strongly (75%) toward shrinking", "shouldShrink", "=", "(", "flipCoin", "(", ")", "&&", "flipCoin", "(", ")", ")", "?", "false", ":", "true", ";", "}", "else", "if", "(", "poolTputRatio", ">", "poolTputRatioLow", ")", "{", "// poolSize ratio is slightly larger than tput ratio - lean weakly (50%) toward shrinking", "shouldShrink", "=", "(", "flipCoin", "(", ")", ")", "?", "false", ":", "true", ";", "}", "// Format an event level trace point with the key tput ratio data", "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. @param smallerPoolSize - smaller poolSize for comparison @param largerPoolSize - larger poolSize for comparison @param smallerPoolTput - tput (historical or expected) of smaller poolSize @param largerPoolTput - tput (historical or expected) of larger poolSize @return - true if the ratios and coinFlips favor shrinking
[ "Evaluate", "current", "poolSize", "against", "farthest", "poolSize", "to", "decide", "whether", "it", "makes", "sense", "to", "shrink", ".", "The", "final", "outcome", "is", "probabilistic", "not", "deterministic", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.threading/src/com/ibm/ws/threading/internal/ThreadPoolController.java#L1665-L1690
train
OpenLiberty/open-liberty
dev/com.ibm.tx.core/src/com/ibm/tx/jta/util/TxTMHelper.java
TxTMHelper.setConfigurationProvider
protected void setConfigurationProvider(ConfigurationProvider p) { if (tc.isEntryEnabled()) Tr.entry(tc, "setConfigurationProvider", p); try { ConfigurationProviderManager.setConfigurationProvider(p); // in an osgi environment we may get unconfigured and then reconfigured as bundles are // started/stopped. If we were previously unconfigured, then we would have shutdown and // our state will be 'stopped' (rather than inactive). If so, then re-start now. // The alternative would perhaps be to modify the checkTMState method to re-start for this state? 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"); }
java
protected void setConfigurationProvider(ConfigurationProvider p) { if (tc.isEntryEnabled()) Tr.entry(tc, "setConfigurationProvider", p); try { ConfigurationProviderManager.setConfigurationProvider(p); // in an osgi environment we may get unconfigured and then reconfigured as bundles are // started/stopped. If we were previously unconfigured, then we would have shutdown and // our state will be 'stopped' (rather than inactive). If so, then re-start now. // The alternative would perhaps be to modify the checkTMState method to re-start for this state? 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"); }
[ "protected", "void", "setConfigurationProvider", "(", "ConfigurationProvider", "p", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"setConfigurationProvider\"", ",", "p", ")", ";", "try", "{", "ConfigurationProviderManager", ".", "setConfigurationProvider", "(", "p", ")", ";", "// in an osgi environment we may get unconfigured and then reconfigured as bundles are", "// started/stopped. If we were previously unconfigured, then we would have shutdown and", "// our state will be 'stopped' (rather than inactive). If so, then re-start now.", "// The alternative would perhaps be to modify the checkTMState method to re-start for this state?", "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 @param p
[ "Called", "by", "DS", "to", "inject", "reference", "to", "Config", "Provider" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/util/TxTMHelper.java#L109-L128
train
OpenLiberty/open-liberty
dev/com.ibm.tx.core/src/com/ibm/tx/jta/util/TxTMHelper.java
TxTMHelper.setXaResourceFactory
protected void setXaResourceFactory(ServiceReference<ResourceFactory> ref) { if (tc.isEntryEnabled()) Tr.entry(tc, "setXaResourceFactory, ref " + ref); _xaResourceFactoryReady = true; if (ableToStartRecoveryNow()) { // Can start recovery now 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"); }
java
protected void setXaResourceFactory(ServiceReference<ResourceFactory> ref) { if (tc.isEntryEnabled()) Tr.entry(tc, "setXaResourceFactory, ref " + ref); _xaResourceFactoryReady = true; if (ableToStartRecoveryNow()) { // Can start recovery now 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"); }
[ "protected", "void", "setXaResourceFactory", "(", "ServiceReference", "<", "ResourceFactory", ">", "ref", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"setXaResourceFactory, ref \"", "+", "ref", ")", ";", "_xaResourceFactoryReady", "=", "true", ";", "if", "(", "ableToStartRecoveryNow", "(", ")", ")", "{", "// Can start recovery now", "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 @param ref
[ "Called", "by", "DS", "to", "inject", "reference", "to", "XaResource", "Factory" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/util/TxTMHelper.java#L157-L174
train
OpenLiberty/open-liberty
dev/com.ibm.tx.core/src/com/ibm/tx/jta/util/TxTMHelper.java
TxTMHelper.setRecoveryLogFactory
public void setRecoveryLogFactory(RecoveryLogFactory fac) { if (tc.isEntryEnabled()) Tr.entry(tc, "setRecoveryLogFactory, factory: " + fac, this); _recoveryLogFactory = fac; _recoveryLogFactoryReady = true; if (ableToStartRecoveryNow()) { // Can start recovery now 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"); }
java
public void setRecoveryLogFactory(RecoveryLogFactory fac) { if (tc.isEntryEnabled()) Tr.entry(tc, "setRecoveryLogFactory, factory: " + fac, this); _recoveryLogFactory = fac; _recoveryLogFactoryReady = true; if (ableToStartRecoveryNow()) { // Can start recovery now 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"); }
[ "public", "void", "setRecoveryLogFactory", "(", "RecoveryLogFactory", "fac", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"setRecoveryLogFactory, factory: \"", "+", "fac", ",", "this", ")", ";", "_recoveryLogFactory", "=", "fac", ";", "_recoveryLogFactoryReady", "=", "true", ";", "if", "(", "ableToStartRecoveryNow", "(", ")", ")", "{", "// Can start recovery now", "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 @param ref
[ "Called", "by", "DS", "to", "inject", "reference", "to", "RecoveryLog", "Factory" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/util/TxTMHelper.java#L186-L202
train
OpenLiberty/open-liberty
dev/com.ibm.tx.core/src/com/ibm/tx/jta/util/TxTMHelper.java
TxTMHelper.setRecoveryLogService
public void setRecoveryLogService(ServiceReference<RecLogServiceImpl> ref) { if (tc.isEntryEnabled()) Tr.entry(tc, "setRecoveryLogService", ref); _recoveryLogServiceReady = true; if (ableToStartRecoveryNow()) { // Can start recovery now 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"); }
java
public void setRecoveryLogService(ServiceReference<RecLogServiceImpl> ref) { if (tc.isEntryEnabled()) Tr.entry(tc, "setRecoveryLogService", ref); _recoveryLogServiceReady = true; if (ableToStartRecoveryNow()) { // Can start recovery now 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"); }
[ "public", "void", "setRecoveryLogService", "(", "ServiceReference", "<", "RecLogServiceImpl", ">", "ref", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"setRecoveryLogService\"", ",", "ref", ")", ";", "_recoveryLogServiceReady", "=", "true", ";", "if", "(", "ableToStartRecoveryNow", "(", ")", ")", "{", "// Can start recovery now", "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 @param ref
[ "Called", "by", "DS", "to", "inject", "reference", "to", "RecoveryLog", "Service" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/util/TxTMHelper.java#L214-L230
train
OpenLiberty/open-liberty
dev/com.ibm.tx.core/src/com/ibm/tx/jta/util/TxTMHelper.java
TxTMHelper.shutdown
public void shutdown(ConfigurationProvider cp) throws Exception { final int shutdownDelay; if (cp != null) { shutdownDelay = cp.getDefaultMaximumShutdownDelay(); } else { shutdownDelay = 0; } shutdown(false, shutdownDelay); }
java
public void shutdown(ConfigurationProvider cp) throws Exception { final int shutdownDelay; if (cp != null) { shutdownDelay = cp.getDefaultMaximumShutdownDelay(); } else { shutdownDelay = 0; } shutdown(false, shutdownDelay); }
[ "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
[ "Used", "by", "liberty" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/util/TxTMHelper.java#L512-L522
train
OpenLiberty/open-liberty
dev/com.ibm.tx.core/src/com/ibm/tx/jta/util/TxTMHelper.java
TxTMHelper.retrieveBundleContext
protected void retrieveBundleContext() { BundleContext bc = TxBundleTools.getBundleContext(); if (tc.isDebugEnabled()) Tr.debug(tc, "retrieveBundleContext, bc " + bc); _bc = bc; }
java
protected void retrieveBundleContext() { BundleContext bc = TxBundleTools.getBundleContext(); if (tc.isDebugEnabled()) Tr.debug(tc, "retrieveBundleContext, bc " + bc); _bc = bc; }
[ "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. @return
[ "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", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/util/TxTMHelper.java#L685-L691
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/rldispatcher/ReceiveListenerDispatchQueue.java
ReceiveListenerDispatchQueue.enqueue
protected void enqueue (final AbstractInvocation invocation) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "enqueue", invocation); barrier.pass(); // Block until allowed to pass // We need to ensure that the thread processing this queue does not change the "running" state before we decide whether a new // thread needs to be started or not so synchronize on "this" synchronized (this) { final boolean isEmpty = isEmpty(); // Remember whether queue is currently empty or not // Add the invocation to the queue synchronized (barrier) { queue.add(invocation); queueSize += invocation.getSize(); // Check to see if the queue limits have been exceeded and the queue should now be locked 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 queue was previously empty we need to either prompt the existing processing thread or start a new thread to // process the new invocation request if (isEmpty) { if (running) { // A processing thread already exists for this queue so wake it up if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Notifying existing thread"); notify(); } else { // We need to start a new processing thread 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) { // No FFDC code needed } } } } } // synchronized (this) if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "enqueue"); }
java
protected void enqueue (final AbstractInvocation invocation) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "enqueue", invocation); barrier.pass(); // Block until allowed to pass // We need to ensure that the thread processing this queue does not change the "running" state before we decide whether a new // thread needs to be started or not so synchronize on "this" synchronized (this) { final boolean isEmpty = isEmpty(); // Remember whether queue is currently empty or not // Add the invocation to the queue synchronized (barrier) { queue.add(invocation); queueSize += invocation.getSize(); // Check to see if the queue limits have been exceeded and the queue should now be locked 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 queue was previously empty we need to either prompt the existing processing thread or start a new thread to // process the new invocation request if (isEmpty) { if (running) { // A processing thread already exists for this queue so wake it up if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Notifying existing thread"); notify(); } else { // We need to start a new processing thread 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) { // No FFDC code needed } } } } } // synchronized (this) if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "enqueue"); }
[ "protected", "void", "enqueue", "(", "final", "AbstractInvocation", "invocation", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"enqueue\"", ",", "invocation", ")", ";", "barrier", ".", "pass", "(", ")", ";", "// Block until allowed to pass", "// We need to ensure that the thread processing this queue does not change the \"running\" state before we decide whether a new", "// thread needs to be started or not so synchronize on \"this\"", "synchronized", "(", "this", ")", "{", "final", "boolean", "isEmpty", "=", "isEmpty", "(", ")", ";", "// Remember whether queue is currently empty or not", "// Add the invocation to the queue", "synchronized", "(", "barrier", ")", "{", "queue", ".", "add", "(", "invocation", ")", ";", "queueSize", "+=", "invocation", ".", "getSize", "(", ")", ";", "// Check to see if the queue limits have been exceeded and the queue should now be locked", "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 queue was previously empty we need to either prompt the existing processing thread or start a new thread to", "// process the new invocation request", "if", "(", "isEmpty", ")", "{", "if", "(", "running", ")", "{", "// A processing thread already exists for this queue so wake it up", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "this", ",", "tc", ",", "\"Notifying existing thread\"", ")", ";", "notify", "(", ")", ";", "}", "else", "{", "// We need to start a new processing thread", "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", ")", "{", "// No FFDC code needed", "}", "}", "}", "}", "}", "// synchronized (this)", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"enqueue\"", ")", ";", "}" ]
Enqueue an invocation by adding it to the end of the queue
[ "Enqueue", "an", "invocation", "by", "adding", "it", "to", "the", "end", "of", "the", "queue" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/rldispatcher/ReceiveListenerDispatchQueue.java#L251-L302
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/rldispatcher/ReceiveListenerDispatchQueue.java
ReceiveListenerDispatchQueue.dequeue
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; }
java
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; }
[ "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
[ "Dequeue", "an", "invocation", "by", "removing", "it", "from", "the", "front", "of", "the", "queue" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/rldispatcher/ReceiveListenerDispatchQueue.java#L306-L317
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/rldispatcher/ReceiveListenerDispatchQueue.java
ReceiveListenerDispatchQueue.unlockBarrier
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 queue size is now below the maximum size for both data in bytes and number of msgs unlock the barrier (if not already unlocked) 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"); }
java
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 queue size is now below the maximum size for both data in bytes and number of msgs unlock the barrier (if not already unlocked) 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"); }
[ "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 queue size is now below the maximum size for both data in bytes and number of msgs unlock the barrier (if not already unlocked)", "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. @param size from last AbstractInvocation @param conversationType from last AbstractInvocation
[ "Unlock", "the", "barrier", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/rldispatcher/ReceiveListenerDispatchQueue.java#L325-L353
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/rldispatcher/ReceiveListenerDispatchQueue.java
ReceiveListenerDispatchQueue.isEmpty
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; }
java
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; }
[ "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
[ "Return", "true", "if", "the", "queue", "is", "empty" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/rldispatcher/ReceiveListenerDispatchQueue.java#L357-L368
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/rldispatcher/ReceiveListenerDispatchQueue.java
ReceiveListenerDispatchQueue.getDepth
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; }
java
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; }
[ "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
[ "Return", "the", "depth", "of", "the", "queue" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/rldispatcher/ReceiveListenerDispatchQueue.java#L372-L383
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/rldispatcher/ReceiveListenerDispatchQueue.java
ReceiveListenerDispatchQueue.doesQueueContainConversation
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; }
java
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; }
[ "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
[ "Return", "true", "if", "a", "conversation", "is", "already", "in", "this", "queue" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/rldispatcher/ReceiveListenerDispatchQueue.java#L560-L577
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/StatefulBeanReaper.java
StatefulBeanReaper.sweep
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 the bean has timed out, regardless of whether it has been // passivated, or is still in the cache ('active'), go ahead and try // to delete it. d112258 if (elt.isTimedOut()) // F61004.5 { deleteBean(elt.beanId); } } // Sweep failover cache if SFSB failover is enabled. if (ivSfFailoverCache != null) //LIDB2018-1 { ivSfFailoverCache.sweep(); //LIDB2018-1 } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "Sweep : Stateful Beans = " + ivStatefulBeanList.size()); }
java
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 the bean has timed out, regardless of whether it has been // passivated, or is still in the cache ('active'), go ahead and try // to delete it. d112258 if (elt.isTimedOut()) // F61004.5 { deleteBean(elt.beanId); } } // Sweep failover cache if SFSB failover is enabled. if (ivSfFailoverCache != null) //LIDB2018-1 { ivSfFailoverCache.sweep(); //LIDB2018-1 } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "Sweep : Stateful Beans = " + ivStatefulBeanList.size()); }
[ "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 the bean has timed out, regardless of whether it has been", "// passivated, or is still in the cache ('active'), go ahead and try", "// to delete it. d112258", "if", "(", "elt", ".", "isTimedOut", "(", ")", ")", "// F61004.5", "{", "deleteBean", "(", "elt", ".", "beanId", ")", ";", "}", "}", "// Sweep failover cache if SFSB failover is enabled.", "if", "(", "ivSfFailoverCache", "!=", "null", ")", "//LIDB2018-1", "{", "ivSfFailoverCache", ".", "sweep", "(", ")", ";", "//LIDB2018-1", "}", "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.
[ "Go", "through", "the", "list", "of", "bean", "ids", "and", "cleanup", "beans", "which", "have", "timed", "out", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/StatefulBeanReaper.java#L189-L213
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/StatefulBeanReaper.java
StatefulBeanReaper.finalSweep
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 the bean hasn't already been removed (possibly by the // regular sweep(), then go ahead and remove the file. d129562 if (remove(elt.beanId)) { passivator.remove(elt.beanId, false); //LIDB2018-1 } } 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 }); //p111002.3 } } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "finalSweep : Stateful Beans = " + ivStatefulBeanList.size()); }
java
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 the bean hasn't already been removed (possibly by the // regular sweep(), then go ahead and remove the file. d129562 if (remove(elt.beanId)) { passivator.remove(elt.beanId, false); //LIDB2018-1 } } 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 }); //p111002.3 } } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "finalSweep : Stateful Beans = " + ivStatefulBeanList.size()); }
[ "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 the bean hasn't already been removed (possibly by the", "// regular sweep(), then go ahead and remove the file. d129562", "if", "(", "remove", "(", "elt", ".", "beanId", ")", ")", "{", "passivator", ".", "remove", "(", "elt", ".", "beanId", ",", "false", ")", ";", "//LIDB2018-1", "}", "}", "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", "}", ")", ";", "//p111002.3", "}", "}", "}", "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.
[ "This", "method", "is", "invoked", "just", "before", "container", "termination", "to", "clean", "up", "stateful", "beans", "which", "have", "been", "passivated", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/StatefulBeanReaper.java#L219-L244
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/StatefulBeanReaper.java
StatefulBeanReaper.beanDoesNotExistOrHasTimedOut
public boolean beanDoesNotExistOrHasTimedOut(TimeoutElement elt, BeanId beanId) { if (elt == null) { // Not in the reaper list, but it might be in local // failover cache if not in reaper list. So check it if // there is a local SfFailoverCache object (e.g. when SFSB // failover is enabled to use failover cache). if (ivSfFailoverCache != null) { // Not in reaper list, but SFSB failover enabled. // Have local SfFailoverCache determine if bean does not exist // or has timed out. return ivSfFailoverCache.beanDoesNotExistOrHasTimedOut(beanId); } // Return true since bean not found in reaper list // and SFSB failover is not enabled so not in failover // cache list. return true; } // SFSB found in reaper list, so return whether it // has timed out or not. return elt.isTimedOut(); // F61004.5 }
java
public boolean beanDoesNotExistOrHasTimedOut(TimeoutElement elt, BeanId beanId) { if (elt == null) { // Not in the reaper list, but it might be in local // failover cache if not in reaper list. So check it if // there is a local SfFailoverCache object (e.g. when SFSB // failover is enabled to use failover cache). if (ivSfFailoverCache != null) { // Not in reaper list, but SFSB failover enabled. // Have local SfFailoverCache determine if bean does not exist // or has timed out. return ivSfFailoverCache.beanDoesNotExistOrHasTimedOut(beanId); } // Return true since bean not found in reaper list // and SFSB failover is not enabled so not in failover // cache list. return true; } // SFSB found in reaper list, so return whether it // has timed out or not. return elt.isTimedOut(); // F61004.5 }
[ "public", "boolean", "beanDoesNotExistOrHasTimedOut", "(", "TimeoutElement", "elt", ",", "BeanId", "beanId", ")", "{", "if", "(", "elt", "==", "null", ")", "{", "// Not in the reaper list, but it might be in local", "// failover cache if not in reaper list. So check it if", "// there is a local SfFailoverCache object (e.g. when SFSB", "// failover is enabled to use failover cache).", "if", "(", "ivSfFailoverCache", "!=", "null", ")", "{", "// Not in reaper list, but SFSB failover enabled.", "// Have local SfFailoverCache determine if bean does not exist", "// or has timed out.", "return", "ivSfFailoverCache", ".", "beanDoesNotExistOrHasTimedOut", "(", "beanId", ")", ";", "}", "// Return true since bean not found in reaper list", "// and SFSB failover is not enabled so not in failover", "// cache list.", "return", "true", ";", "}", "// SFSB found in reaper list, so return whether it", "// has timed out or not.", "return", "elt", ".", "isTimedOut", "(", ")", ";", "// F61004.5", "}" ]
LIDB2018-1 renamed old beanTimedOut method and clarified description.
[ "LIDB2018", "-", "1", "renamed", "old", "beanTimedOut", "method", "and", "clarified", "description", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/StatefulBeanReaper.java#L296-L318
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/StatefulBeanReaper.java
StatefulBeanReaper.add
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); // LIDB2775-23.4 Begins Object obj = ivStatefulBeanList.put(id, elt); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, (obj != null) ? "Stateful bean information replaced" : "Stateful bean information added"); // LIDB2775-23.4 Ends synchronized (this) { if (numObjects == 0 && !ivIsCanceled) // F743-33394 { startAlarm(); } numObjects++; numAdds++; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "add"); }
java
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); // LIDB2775-23.4 Begins Object obj = ivStatefulBeanList.put(id, elt); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, (obj != null) ? "Stateful bean information replaced" : "Stateful bean information added"); // LIDB2775-23.4 Ends synchronized (this) { if (numObjects == 0 && !ivIsCanceled) // F743-33394 { startAlarm(); } numObjects++; numAdds++; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "add"); }
[ "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", ")", ";", "// LIDB2775-23.4 Begins", "Object", "obj", "=", "ivStatefulBeanList", ".", "put", "(", "id", ",", "elt", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "(", "obj", "!=", "null", ")", "?", "\"Stateful bean information replaced\"", ":", "\"Stateful bean information added\"", ")", ";", "// LIDB2775-23.4 Ends", "synchronized", "(", "this", ")", "{", "if", "(", "numObjects", "==", "0", "&&", "!", "ivIsCanceled", ")", "// F743-33394", "{", "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
[ "Add", "a", "new", "bean", "to", "the", "list", "of", "beans", "to", "be", "checked", "for", "timeouts" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/StatefulBeanReaper.java#L346-L371
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/StatefulBeanReaper.java
StatefulBeanReaper.remove
public boolean remove(BeanId id) // d129562 { 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) { // F743-33394 stopAlarm(); } } else { numNullRemoves++; } } boolean result = elt != null; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "remove (" + result + ")"); return result; // d129562 }
java
public boolean remove(BeanId id) // d129562 { 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) { // F743-33394 stopAlarm(); } } else { numNullRemoves++; } } boolean result = elt != null; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "remove (" + result + ")"); return result; // d129562 }
[ "public", "boolean", "remove", "(", "BeanId", "id", ")", "// d129562", "{", "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", ")", "{", "// F743-33394", "stopAlarm", "(", ")", ";", "}", "}", "else", "{", "numNullRemoves", "++", ";", "}", "}", "boolean", "result", "=", "elt", "!=", "null", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "tc", ",", "\"remove (\"", "+", "result", "+", "\")\"", ")", ";", "return", "result", ";", "// d129562", "}" ]
Remove a bean from the list and return true if the bean was in the list and removed successfully; otherwise return false.
[ "Remove", "a", "bean", "from", "the", "list", "and", "return", "true", "if", "the", "bean", "was", "in", "the", "list", "and", "removed", "successfully", ";", "otherwise", "return", "false", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/StatefulBeanReaper.java#L377-L404
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/StatefulBeanReaper.java
StatefulBeanReaper.getPassivatedStatefulBeanIds
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()); }
java
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()); }
[ "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
[ "d103404", ".", "1" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/StatefulBeanReaper.java#L413-L424
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/StatefulBeanReaper.java
StatefulBeanReaper.getBeanTimeoutTime
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) { // F743-6605.1 timeoutTime = Long.MAX_VALUE; // F743-6605.1 } } } return timeoutTime; }
java
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) { // F743-6605.1 timeoutTime = Long.MAX_VALUE; // F743-6605.1 } } } return timeoutTime; }
[ "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", ")", "{", "// F743-6605.1", "timeoutTime", "=", "Long", ".", "MAX_VALUE", ";", "// F743-6605.1", "}", "}", "}", "return", "timeoutTime", ";", "}" ]
LIDB2775-23.4 Begins
[ "LIDB2775", "-", "23", ".", "4", "Begins" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/StatefulBeanReaper.java#L427-L439
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/StatefulBeanReaper.java
StatefulBeanReaper.dump
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; } }
java
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; } }
[ "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
[ "Dump", "the", "internal", "state", "of", "the", "cache" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/StatefulBeanReaper.java#L446-L464
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/StatefulBeanReaper.java
StatefulBeanReaper.cancel
public synchronized void cancel() // d583637 { ivIsCanceled = true; stopAlarm(); // F743-33394 - Wait for the sweep to finish. while (ivIsRunning) { try { wait(); } catch (InterruptedException ex) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "interrupted", ex); Thread.currentThread().interrupt(); } } ivActivator = null; }
java
public synchronized void cancel() // d583637 { ivIsCanceled = true; stopAlarm(); // F743-33394 - Wait for the sweep to finish. while (ivIsRunning) { try { wait(); } catch (InterruptedException ex) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "interrupted", ex); Thread.currentThread().interrupt(); } } ivActivator = null; }
[ "public", "synchronized", "void", "cancel", "(", ")", "// d583637", "{", "ivIsCanceled", "=", "true", ";", "stopAlarm", "(", ")", ";", "// F743-33394 - Wait for the sweep to finish.", "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
[ "Cancel", "this", "alarm" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/StatefulBeanReaper.java#L504-L521
train
OpenLiberty/open-liberty
dev/com.ibm.ws.session/src/com/ibm/ws/webcontainer/httpsession/SessionMgrComponentImpl.java
SessionMgrComponentImpl.getServerId
private String getServerId() { UUID fullServerId = null; WsLocationAdmin locationService = this.wsLocationAdmin; if (locationService != null) { fullServerId = locationService.getServerId(); } if (fullServerId == null) { fullServerId = UUID.randomUUID(); // shouldn't get here, but be careful just in case } return fullServerId.toString().toLowerCase(); // clone IDs need to be in lower case for consistency with tWAS }
java
private String getServerId() { UUID fullServerId = null; WsLocationAdmin locationService = this.wsLocationAdmin; if (locationService != null) { fullServerId = locationService.getServerId(); } if (fullServerId == null) { fullServerId = UUID.randomUUID(); // shouldn't get here, but be careful just in case } return fullServerId.toString().toLowerCase(); // clone IDs need to be in lower case for consistency with tWAS }
[ "private", "String", "getServerId", "(", ")", "{", "UUID", "fullServerId", "=", "null", ";", "WsLocationAdmin", "locationService", "=", "this", ".", "wsLocationAdmin", ";", "if", "(", "locationService", "!=", "null", ")", "{", "fullServerId", "=", "locationService", ".", "getServerId", "(", ")", ";", "}", "if", "(", "fullServerId", "==", "null", ")", "{", "fullServerId", "=", "UUID", ".", "randomUUID", "(", ")", ";", "// shouldn't get here, but be careful just in case", "}", "return", "fullServerId", ".", "toString", "(", ")", ".", "toLowerCase", "(", ")", ";", "// clone IDs need to be in lower case for consistency with tWAS", "}" ]
Derives a unique identifier for the current server. The result of this method is used to create a cloneId. @return a unique identifier for the current server (in lower case)
[ "Derives", "a", "unique", "identifier", "for", "the", "current", "server", ".", "The", "result", "of", "this", "method", "is", "used", "to", "create", "a", "cloneId", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.session/src/com/ibm/ws/webcontainer/httpsession/SessionMgrComponentImpl.java#L147-L157
train
OpenLiberty/open-liberty
dev/com.ibm.ws.session/src/com/ibm/ws/webcontainer/httpsession/SessionMgrComponentImpl.java
SessionMgrComponentImpl.initialize
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()) { /*- * In tWAS, WsSessionAffinityManager sets the CloneID to -1 when two conditions are both met: * A) Running in a standalone server (com.ibm.ws.runtime.service.WLM#getMemberUID()==null) * B) The HttpSessionCloneId custom property is not explicitly set * * In addition, tWAS will set the CloneID to "" (the empty String) if a third condition is also met: * C) The NoAdditionalSessionInfo custom property is set to "true" * * In lWAS, there's no notion of a "standalone" server, because potentially any lWAS server * could require a CloneID for session affinity. As a result, our logic for using an * empty Clone ID on lWAS needs to be different than our logic on tWAS. * * Since most customers who specify a session store will be interested in session affinity, * we'll assume that these customers are always interested in a non-empty Clone ID. * * We'll also assume that customers who do not specify a session store who also explicitly * set the noAdditionalInfo property to "true" would prefer an empty Clone ID. * * All customers can always explicitly set the cloneId property to override these assumptions. */ cloneId = ""; } else { String serverId = getServerId(); // never returns null 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); // never returns null } SessionManagerConfig.setCloneId(cloneId); } this.initialized=true; }
java
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()) { /*- * In tWAS, WsSessionAffinityManager sets the CloneID to -1 when two conditions are both met: * A) Running in a standalone server (com.ibm.ws.runtime.service.WLM#getMemberUID()==null) * B) The HttpSessionCloneId custom property is not explicitly set * * In addition, tWAS will set the CloneID to "" (the empty String) if a third condition is also met: * C) The NoAdditionalSessionInfo custom property is set to "true" * * In lWAS, there's no notion of a "standalone" server, because potentially any lWAS server * could require a CloneID for session affinity. As a result, our logic for using an * empty Clone ID on lWAS needs to be different than our logic on tWAS. * * Since most customers who specify a session store will be interested in session affinity, * we'll assume that these customers are always interested in a non-empty Clone ID. * * We'll also assume that customers who do not specify a session store who also explicitly * set the noAdditionalInfo property to "true" would prefer an empty Clone ID. * * All customers can always explicitly set the cloneId property to override these assumptions. */ cloneId = ""; } else { String serverId = getServerId(); // never returns null 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); // never returns null } SessionManagerConfig.setCloneId(cloneId); } this.initialized=true; }
[ "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", "(", ")", ")", "{", "/*-\n * In tWAS, WsSessionAffinityManager sets the CloneID to -1 when two conditions are both met:\n * A) Running in a standalone server (com.ibm.ws.runtime.service.WLM#getMemberUID()==null)\n * B) The HttpSessionCloneId custom property is not explicitly set\n * \n * In addition, tWAS will set the CloneID to \"\" (the empty String) if a third condition is also met:\n * C) The NoAdditionalSessionInfo custom property is set to \"true\"\n * \n * In lWAS, there's no notion of a \"standalone\" server, because potentially any lWAS server \n * could require a CloneID for session affinity. As a result, our logic for using an\n * empty Clone ID on lWAS needs to be different than our logic on tWAS.\n * \n * Since most customers who specify a session store will be interested in session affinity,\n * we'll assume that these customers are always interested in a non-empty Clone ID.\n * \n * We'll also assume that customers who do not specify a session store who also explicitly\n * set the noAdditionalInfo property to \"true\" would prefer an empty Clone ID.\n * \n * All customers can always explicitly set the cloneId property to override these assumptions.\n */", "cloneId", "=", "\"\"", ";", "}", "else", "{", "String", "serverId", "=", "getServerId", "(", ")", ";", "// never returns null", "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", ")", ";", "// never returns null", "}", "SessionManagerConfig", ".", "setCloneId", "(", "cloneId", ")", ";", "}", "this", ".", "initialized", "=", "true", ";", "}" ]
Delay initialization until a public method of this service is called
[ "Delay", "initialization", "until", "a", "public", "method", "of", "this", "service", "is", "called" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.session/src/com/ibm/ws/webcontainer/httpsession/SessionMgrComponentImpl.java#L207-L256
train
OpenLiberty/open-liberty
dev/com.ibm.ws.tx.embeddable/src/com/ibm/tx/jta/embeddable/impl/EmbeddableTranManagerSet.java
EmbeddableTranManagerSet.startInactivityTimer
public boolean startInactivityTimer (Transaction t, InactivityTimer iat) { if (t != null) return ((EmbeddableTransactionImpl) t).startInactivityTimer(iat); return false; }
java
public boolean startInactivityTimer (Transaction t, InactivityTimer iat) { if (t != null) return ((EmbeddableTransactionImpl) t).startInactivityTimer(iat); return false; }
[ "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. @param t Transaction associated with this timer. @param iat callback object to be notified when timer expires. @return boolean to indicate whether timer started
[ "Start", "an", "inactivity", "timer", "and", "call", "alarm", "method", "of", "parameter", "when", "timeout", "expires", ".", "Returns", "false", "if", "transaction", "is", "not", "active", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.tx.embeddable/src/com/ibm/tx/jta/embeddable/impl/EmbeddableTranManagerSet.java#L86-L92
train
OpenLiberty/open-liberty
dev/com.ibm.ws.tx.embeddable/src/com/ibm/tx/jta/embeddable/impl/EmbeddableTranManagerSet.java
EmbeddableTranManagerSet.registerSynchronization
public void registerSynchronization(UOWCoordinator coord, Synchronization sync) throws RollbackException, IllegalStateException, SystemException { registerSynchronization(coord, sync, EmbeddableWebSphereTransactionManager.SYNC_TIER_NORMAL); }
java
public void registerSynchronization(UOWCoordinator coord, Synchronization sync) throws RollbackException, IllegalStateException, SystemException { registerSynchronization(coord, sync, EmbeddableWebSphereTransactionManager.SYNC_TIER_NORMAL); }
[ "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. @param coord UOWCoordinator previously obtained from UOWCurrent. @param sync Synchronization object to be registered. We should deprecate this now that UOWCoordinator is a javax...Transaction
[ "Method", "to", "register", "synchronization", "object", "with", "JTA", "tran", "via", "UOWCoordinator", "for", "improved", "performance", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.tx.embeddable/src/com/ibm/tx/jta/embeddable/impl/EmbeddableTranManagerSet.java#L212-L217
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java
JmsDestinationImpl.setDestName
void setDestName(String destName) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setDestName", destName); if ((null == destName) || ("".equals(destName))) { // d238447 FFDC review. More likely to be an external rather than internal error, // so no FFDC. throw (JMSException) JmsErrorUtils.newThrowable( InvalidDestinationException.class, "INVALID_VALUE_CWSIA0281", new Object[] { "destName", destName }, tc ); } // Store the property updateProperty(DEST_NAME, destName); // Clear the cached destinationAddresses, as they may now be incorrect clearCachedProducerDestinationAddress(); clearCachedConsumerDestinationAddress(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setDestName"); }
java
void setDestName(String destName) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setDestName", destName); if ((null == destName) || ("".equals(destName))) { // d238447 FFDC review. More likely to be an external rather than internal error, // so no FFDC. throw (JMSException) JmsErrorUtils.newThrowable( InvalidDestinationException.class, "INVALID_VALUE_CWSIA0281", new Object[] { "destName", destName }, tc ); } // Store the property updateProperty(DEST_NAME, destName); // Clear the cached destinationAddresses, as they may now be incorrect clearCachedProducerDestinationAddress(); clearCachedConsumerDestinationAddress(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setDestName"); }
[ "void", "setDestName", "(", "String", "destName", ")", "throws", "JMSException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"setDestName\"", ",", "destName", ")", ";", "if", "(", "(", "null", "==", "destName", ")", "||", "(", "\"\"", ".", "equals", "(", "destName", ")", ")", ")", "{", "// d238447 FFDC review. More likely to be an external rather than internal error,", "// so no FFDC.", "throw", "(", "JMSException", ")", "JmsErrorUtils", ".", "newThrowable", "(", "InvalidDestinationException", ".", "class", ",", "\"INVALID_VALUE_CWSIA0281\"", ",", "new", "Object", "[", "]", "{", "\"destName\"", ",", "destName", "}", ",", "tc", ")", ";", "}", "// Store the property", "updateProperty", "(", "DEST_NAME", ",", "destName", ")", ";", "// Clear the cached destinationAddresses, as they may now be incorrect", "clearCachedProducerDestinationAddress", "(", ")", ";", "clearCachedConsumerDestinationAddress", "(", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"setDestName\"", ")", ";", "}" ]
setDestName Set the destName for this Destination. @param destName The value for the destName @exception JMSException Thrown if the destName is null or blank
[ "setDestName", "Set", "the", "destName", "for", "this", "Destination", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java#L215-L238
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java
JmsDestinationImpl.setDestDiscrim
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"); }
java
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"); }
[ "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. @param destDiscrim The value for the destDiscrim
[ "setDestDiscrim", "Set", "the", "destDiscrim", "for", "this", "Destination", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java#L261-L269
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java
JmsDestinationImpl.getReplyReliability
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; }
java
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; }
[ "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 @return the reply reliability
[ "Get", "the", "reply", "reliability", "to", "use", "for", "reply", "mesages", "on", "a", "replyTo", "destination" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java#L521-L531
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java
JmsDestinationImpl.setReplyReliability
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"); }
java
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"); }
[ "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 @param replyReliability The value to be set into this Destination.
[ "Set", "the", "reliability", "to", "use", "for", "reply", "messages", "on", "a", "replyTo", "destination" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java#L538-L544
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java
JmsDestinationImpl.isProducerTypeCheck
protected boolean isProducerTypeCheck() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "isProducerTypeCheck"); boolean checking = true; // We can carry out checking if there is no FRP, or the FRP has 0 size. 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; }
java
protected boolean isProducerTypeCheck() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "isProducerTypeCheck"); boolean checking = true; // We can carry out checking if there is no FRP, or the FRP has 0 size. 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; }
[ "protected", "boolean", "isProducerTypeCheck", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"isProducerTypeCheck\"", ")", ";", "boolean", "checking", "=", "true", ";", "// We can carry out checking if there is no FRP, or the FRP has 0 size.", "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.
[ "This", "method", "informs", "us", "whether", "we", "can", "carry", "out", "type", "checking", "on", "the", "producer", "connect", "call", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java#L619-L635
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java
JmsDestinationImpl.getProducerDestName
protected String getProducerDestName() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getProducerDestName"); String pDestName = null; // Get the forward routing path. 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"); // If the frp is null then we have the simple case of returning the // 'big' destination. pDestName = getDestName(); } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "There is a forward routing path to examine."); // There is an FRP to examine, and we want to return the name of the // first destination in the FRP. 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; }
java
protected String getProducerDestName() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getProducerDestName"); String pDestName = null; // Get the forward routing path. 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"); // If the frp is null then we have the simple case of returning the // 'big' destination. pDestName = getDestName(); } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "There is a forward routing path to examine."); // There is an FRP to examine, and we want to return the name of the // first destination in the FRP. 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; }
[ "protected", "String", "getProducerDestName", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"getProducerDestName\"", ")", ";", "String", "pDestName", "=", "null", ";", "// Get the forward routing path.", "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\"", ")", ";", "// If the frp is null then we have the simple case of returning the", "// 'big' destination.", "pDestName", "=", "getDestName", "(", ")", ";", "}", "else", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "this", ",", "tc", ",", "\"There is a forward routing path to examine.\"", ")", ";", "// There is an FRP to examine, and we want to return the name of the", "// first destination in the FRP.", "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. For a simple case this will be the same as the original destName, however if a forward routing path is present it will return the name of the first element in the forward routing path.
[ "This", "method", "returns", "the", "name", "of", "the", "destination", "to", "which", "producers", "should", "attach", "when", "sending", "messages", "via", "this", "JMS", "destination", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java#L645-L685
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java
JmsDestinationImpl.getConsumerDestName
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; }
java
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; }
[ "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. In the simple case this is the same as the original destName, however if a reverse routing path is present this method returns the name at the end of the logical forward routing path. (This will still be the same as the original dest name). THIS COMMENT APPEARS TO BE UNTRUE. @return String
[ "This", "method", "returns", "the", "name", "of", "the", "destination", "to", "which", "consumers", "should", "attach", "when", "receiving", "messages", "using", "this", "JMS", "destination", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java#L698-L707
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java
JmsDestinationImpl.getCopyOfProperties
Map<String, Object> getCopyOfProperties() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getCopyOfProperties"); Map<String, Object> temp = null; // Make sure no-one changes the properties underneath us. synchronized (properties) { temp = new HashMap<String, Object>(properties); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getCopyOfProperties", temp); return temp; }
java
Map<String, Object> getCopyOfProperties() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getCopyOfProperties"); Map<String, Object> temp = null; // Make sure no-one changes the properties underneath us. synchronized (properties) { temp = new HashMap<String, Object>(properties); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getCopyOfProperties", temp); return temp; }
[ "Map", "<", "String", ",", "Object", ">", "getCopyOfProperties", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"getCopyOfProperties\"", ")", ";", "Map", "<", "String", ",", "Object", ">", "temp", "=", "null", ";", "// Make sure no-one changes the properties underneath us.", "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! This method is used by MsgDestEncodingUtilsImpl to create a copy of the properties.
[ "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!" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java#L717-L731
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java
JmsDestinationImpl.getConvertedFRP
protected List getConvertedFRP() { List theList = null; StringArrayWrapper saw = (StringArrayWrapper) properties.get(FORWARD_ROUTING_PATH); if (saw != null) { // This list is the forward routing path for the message. theList = saw.getMsgForwardRoutingPath(); } return theList; }
java
protected List getConvertedFRP() { List theList = null; StringArrayWrapper saw = (StringArrayWrapper) properties.get(FORWARD_ROUTING_PATH); if (saw != null) { // This list is the forward routing path for the message. theList = saw.getMsgForwardRoutingPath(); } return theList; }
[ "protected", "List", "getConvertedFRP", "(", ")", "{", "List", "theList", "=", "null", ";", "StringArrayWrapper", "saw", "=", "(", "StringArrayWrapper", ")", "properties", ".", "get", "(", "FORWARD_ROUTING_PATH", ")", ";", "if", "(", "saw", "!=", "null", ")", "{", "// This list is the forward routing path for the message.", "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. Note that this takes the 'big' destination as being the end of the forward routing path.
[ "This", "method", "returns", "the", "List", "containing", "SIDestinationAddress", "form", "of", "the", "forward", "routing", "path", "that", "will", "be", "set", "into", "the", "message", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java#L849-L858
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java
JmsDestinationImpl.getConvertedRRP
protected List getConvertedRRP() { List theList = null; StringArrayWrapper saw = (StringArrayWrapper) properties.get(REVERSE_ROUTING_PATH); if (saw != null) theList = saw.getCorePath(); return theList; }
java
protected List getConvertedRRP() { List theList = null; StringArrayWrapper saw = (StringArrayWrapper) properties.get(REVERSE_ROUTING_PATH); if (saw != null) theList = saw.getCorePath(); return theList; }
[ "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.
[ "This", "method", "returns", "the", "List", "containing", "SIDestinationAddress", "form", "of", "the", "reverse", "routing", "path", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java#L864-L871
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java
JmsDestinationImpl.getProducerSIDestinationAddress
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) { // There is an actual forward routing path to investigate. if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Obtain from the frp data."); producerDestinationAddress = frp.getProducerSIDestAddress(); } if (producerDestinationAddress == null) { // Set up the producer address from the big destination info. if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Either FRP was empty, or no FRP at all - create from big dest info."); // Establish whether this producer should be scoped to a local queue point only. boolean localOnly = isLocalOnly(); // This variable should be initialised already since it is set up in the static // init for the class, which must have been run by the time we get to access it. producerDestinationAddress = JmsMessageImpl.destAddressFactory.createSIDestinationAddress(getProducerDestName(), localOnly, getBusName()); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getProducerSIDestinationAddress", producerDestinationAddress); return producerDestinationAddress; }
java
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) { // There is an actual forward routing path to investigate. if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Obtain from the frp data."); producerDestinationAddress = frp.getProducerSIDestAddress(); } if (producerDestinationAddress == null) { // Set up the producer address from the big destination info. if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Either FRP was empty, or no FRP at all - create from big dest info."); // Establish whether this producer should be scoped to a local queue point only. boolean localOnly = isLocalOnly(); // This variable should be initialised already since it is set up in the static // init for the class, which must have been run by the time we get to access it. producerDestinationAddress = JmsMessageImpl.destAddressFactory.createSIDestinationAddress(getProducerDestName(), localOnly, getBusName()); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getProducerSIDestinationAddress", producerDestinationAddress); return producerDestinationAddress; }
[ "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", ")", "{", "// There is an actual forward routing path to investigate.", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "this", ",", "tc", ",", "\"Obtain from the frp data.\"", ")", ";", "producerDestinationAddress", "=", "frp", ".", "getProducerSIDestAddress", "(", ")", ";", "}", "if", "(", "producerDestinationAddress", "==", "null", ")", "{", "// Set up the producer address from the big destination info.", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "this", ",", "tc", ",", "\"Either FRP was empty, or no FRP at all - create from big dest info.\"", ")", ";", "// Establish whether this producer should be scoped to a local queue point only.", "boolean", "localOnly", "=", "isLocalOnly", "(", ")", ";", "// This variable should be initialised already since it is set up in the static", "// init for the class, which must have been run by the time we get to access it.", "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. Parts of the JMS implementation that wish to obtain an SIDestinationAddress object for use with the coreSPI should call this method rather than creating their own new one in situations where it is might be possible to reuse the object.
[ "This", "method", "provides", "access", "to", "the", "cached", "SIDestinationAddress", "object", "for", "this", "JmsDestination", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java#L882-L916
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java
JmsDestinationImpl.isLocalOnly
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; }
java
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; }
[ "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. By default this is hardcoded as false, but can be overridden by subclasses where appropriate to provide customized behaviour. @return boolean
[ "Determines", "whether", "SIDestinationAddress", "objects", "created", "for", "this", "destination", "object", "should", "have", "the", "localOnly", "flag", "set", "or", "not", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java#L956-L962
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java
JmsDestinationImpl.checkNativeInstance
static JmsDestinationImpl checkNativeInstance(Destination destination) throws InvalidDestinationException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "checkNativeInstance", destination); JmsDestinationImpl castDest = null; // if the supplied destination is set to null, throw a jms // InvalidDestinationException. if (destination == null) { throw (InvalidDestinationException) JmsErrorUtils.newThrowable(InvalidDestinationException.class , "INVALID_VALUE_CWSIA0281" , new Object[] { "Destination", null } , tc ); } // Attempt to convert a non-native destination into a native one. if (!(destination instanceof JmsDestinationImpl)) { // Use the variable to pass the failed conversion exception if one occurs. Exception rootCause = null; //106556: if (destination instanceof java.lang.reflect.Proxy) is commented to generically support all types of Proxies. //We get a WovenProxy here when Apache Aries framework is used to deploy .eba files in liberty. //This WovenProxy is new type itself and it is not extending java.lang.reflect.Proxy. // 412946 workaround - the Spring framework passes in dynamic proxy objects // that wrap a real JmsDestinationImpl object if the application is using // Aspects to implement its transactional behaviour in an OSGi environment. // To work around this we have to take the unpleasant option of recreating // one of our objects using the toString of the object we have been given. // We should never normally rely on the format of a toString, but it seems to // be the only way to resolve the problem in this case. 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) { // No FFDC Code Needed 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 the supplied destination isn't a Jetstream destination, throw a jms // InvalidDestinationException. 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; }
java
static JmsDestinationImpl checkNativeInstance(Destination destination) throws InvalidDestinationException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "checkNativeInstance", destination); JmsDestinationImpl castDest = null; // if the supplied destination is set to null, throw a jms // InvalidDestinationException. if (destination == null) { throw (InvalidDestinationException) JmsErrorUtils.newThrowable(InvalidDestinationException.class , "INVALID_VALUE_CWSIA0281" , new Object[] { "Destination", null } , tc ); } // Attempt to convert a non-native destination into a native one. if (!(destination instanceof JmsDestinationImpl)) { // Use the variable to pass the failed conversion exception if one occurs. Exception rootCause = null; //106556: if (destination instanceof java.lang.reflect.Proxy) is commented to generically support all types of Proxies. //We get a WovenProxy here when Apache Aries framework is used to deploy .eba files in liberty. //This WovenProxy is new type itself and it is not extending java.lang.reflect.Proxy. // 412946 workaround - the Spring framework passes in dynamic proxy objects // that wrap a real JmsDestinationImpl object if the application is using // Aspects to implement its transactional behaviour in an OSGi environment. // To work around this we have to take the unpleasant option of recreating // one of our objects using the toString of the object we have been given. // We should never normally rely on the format of a toString, but it seems to // be the only way to resolve the problem in this case. 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) { // No FFDC Code Needed 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 the supplied destination isn't a Jetstream destination, throw a jms // InvalidDestinationException. 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; }
[ "static", "JmsDestinationImpl", "checkNativeInstance", "(", "Destination", "destination", ")", "throws", "InvalidDestinationException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"checkNativeInstance\"", ",", "destination", ")", ";", "JmsDestinationImpl", "castDest", "=", "null", ";", "// if the supplied destination is set to null, throw a jms", "// InvalidDestinationException.", "if", "(", "destination", "==", "null", ")", "{", "throw", "(", "InvalidDestinationException", ")", "JmsErrorUtils", ".", "newThrowable", "(", "InvalidDestinationException", ".", "class", ",", "\"INVALID_VALUE_CWSIA0281\"", ",", "new", "Object", "[", "]", "{", "\"Destination\"", ",", "null", "}", ",", "tc", ")", ";", "}", "// Attempt to convert a non-native destination into a native one.", "if", "(", "!", "(", "destination", "instanceof", "JmsDestinationImpl", ")", ")", "{", "// Use the variable to pass the failed conversion exception if one occurs.", "Exception", "rootCause", "=", "null", ";", "//106556: if (destination instanceof java.lang.reflect.Proxy) is commented to generically support all types of Proxies. ", "//We get a WovenProxy here when Apache Aries framework is used to deploy .eba files in liberty. ", "//This WovenProxy is new type itself and it is not extending java.lang.reflect.Proxy.", "// 412946 workaround - the Spring framework passes in dynamic proxy objects", "// that wrap a real JmsDestinationImpl object if the application is using", "// Aspects to implement its transactional behaviour in an OSGi environment.", "// To work around this we have to take the unpleasant option of recreating", "// one of our objects using the toString of the object we have been given.", "// We should never normally rely on the format of a toString, but it seems to", "// be the only way to resolve the problem in this case.", "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", ")", "{", "// No FFDC Code Needed", "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 the supplied destination isn't a Jetstream destination, throw a jms", "// InvalidDestinationException.", "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. Note: When using Spring in certain ways it provides a proxy objects in the place of native destination objects. It this method detects that situation then it returns a new queue or topic object that is created using the toString representation of the Spring proxy object (in tests the toString has been seen to be that of the wrappered native destination object). @param destination the JMS destination object to check @return The destination object cast to the implementation class @throws javax.jms.InvalidDestinationException if the destination object is null (INVALID_VALUE_CWSIA0281) or if it is from a foreign implementation (FOREIGN_IMPLEMENTATION_CWSIA0046).
[ "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", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java#L984-L1062
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java
JmsDestinationImpl.checkBlockedStatus
static void checkBlockedStatus(JmsDestinationImpl dest) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "checkBlockedStatus", dest); // get the status of the destinations blocked attribute Integer code = dest.getBlockedDestinationCode(); // check for specific known PSB reason for blockage if (code == null) { // default case of null value - don't want to throw exception } else if (code.equals(JmsInternalConstants.PSB_REPLY_DATA_MISSING)) { // throw specific PSB blocked JMSException throw (JMSException) JmsErrorUtils.newThrowable(JMSException.class , "DESTINATION_BLOCKED_PSBREPLY_CWSIA0284" , new Object[] { dest.toString() } , tc ); } else { // throw generic blocked JMSException throw (JMSException) JmsErrorUtils.newThrowable(JMSException.class , "DESTINATION_BLOCKED_CWSIA0283" , new Object[] { code } , tc ); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "checkBlockedStatus"); }
java
static void checkBlockedStatus(JmsDestinationImpl dest) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "checkBlockedStatus", dest); // get the status of the destinations blocked attribute Integer code = dest.getBlockedDestinationCode(); // check for specific known PSB reason for blockage if (code == null) { // default case of null value - don't want to throw exception } else if (code.equals(JmsInternalConstants.PSB_REPLY_DATA_MISSING)) { // throw specific PSB blocked JMSException throw (JMSException) JmsErrorUtils.newThrowable(JMSException.class , "DESTINATION_BLOCKED_PSBREPLY_CWSIA0284" , new Object[] { dest.toString() } , tc ); } else { // throw generic blocked JMSException throw (JMSException) JmsErrorUtils.newThrowable(JMSException.class , "DESTINATION_BLOCKED_CWSIA0283" , new Object[] { code } , tc ); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "checkBlockedStatus"); }
[ "static", "void", "checkBlockedStatus", "(", "JmsDestinationImpl", "dest", ")", "throws", "JMSException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"checkBlockedStatus\"", ",", "dest", ")", ";", "// get the status of the destinations blocked attribute", "Integer", "code", "=", "dest", ".", "getBlockedDestinationCode", "(", ")", ";", "// check for specific known PSB reason for blockage", "if", "(", "code", "==", "null", ")", "{", "// default case of null value - don't want to throw exception", "}", "else", "if", "(", "code", ".", "equals", "(", "JmsInternalConstants", ".", "PSB_REPLY_DATA_MISSING", ")", ")", "{", "// throw specific PSB blocked JMSException", "throw", "(", "JMSException", ")", "JmsErrorUtils", ".", "newThrowable", "(", "JMSException", ".", "class", ",", "\"DESTINATION_BLOCKED_PSBREPLY_CWSIA0284\"", ",", "new", "Object", "[", "]", "{", "dest", ".", "toString", "(", ")", "}", ",", "tc", ")", ";", "}", "else", "{", "// throw generic blocked JMSException", "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. @param dest The JmsDestinationImpl to check @throws JMSException if the destination is blocked
[ "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", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java#L1073-L1103
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java
JmsDestinationImpl.getJMSReplyToInternal
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; // Case a) - check for JMS specific data in compressed byte form. byte[] replyURIBytes = _msg.getJmsReplyTo(); if (replyURIBytes != null) { tempReplyTo = (JmsDestinationImpl) JmsInternalsFactory.getMessageDestEncodingUtils().getDestinationFromMsgRepresentation(replyURIBytes); } if (tempReplyTo == null) { // Cases b) & c) both depend on there being a reverse routing path, otherwise // there is no replyTo. // lookup the name of the dest in the reverse routing path SIDestinationAddress sida = null; if (rrp.size() > 0) { // The last element of the RRP becomes the reply to destination int lastDestInRRP = rrp.size() - 1; sida = rrp.get(lastDestInRRP); // Case b) - if we have a live connection, we can use that to query the dest type if (_siConn != null) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Determine reply dest type using SICoreConnection"); try { // get the destination configuration & type DestinationConfiguration destConfig = _siConn.getDestinationConfiguration(sida); DestinationType destType = destConfig.getDestinationType(); if (destType == DestinationType.TOPICSPACE) { tempReplyTo = new JmsTopicImpl(); } else { tempReplyTo = new JmsQueueImpl(); } } catch (SIException sice) { // No FFDC code needed // d246604 Trace exceptions, but don't throw on. Fall back to // case c) below. if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { SibTr.debug(tc, "failed to look up dest type because of " + sice); SibTr.debug(tc, "detail ", sice); } } } // Case c) - Guess based on the discriminator if (tempReplyTo == null) { // 239238 - make a stab at determining whether it's a queue or topic // reply destination based on the reply disciminator. 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(); } } } } // Now fill in the fields that were hidden in the reply header. if (tempReplyTo != null) { populateReplyToFromHeader(tempReplyTo, _msg, rrp); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getJMSReplyToInternal", tempReplyTo); return tempReplyTo; }
java
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; // Case a) - check for JMS specific data in compressed byte form. byte[] replyURIBytes = _msg.getJmsReplyTo(); if (replyURIBytes != null) { tempReplyTo = (JmsDestinationImpl) JmsInternalsFactory.getMessageDestEncodingUtils().getDestinationFromMsgRepresentation(replyURIBytes); } if (tempReplyTo == null) { // Cases b) & c) both depend on there being a reverse routing path, otherwise // there is no replyTo. // lookup the name of the dest in the reverse routing path SIDestinationAddress sida = null; if (rrp.size() > 0) { // The last element of the RRP becomes the reply to destination int lastDestInRRP = rrp.size() - 1; sida = rrp.get(lastDestInRRP); // Case b) - if we have a live connection, we can use that to query the dest type if (_siConn != null) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Determine reply dest type using SICoreConnection"); try { // get the destination configuration & type DestinationConfiguration destConfig = _siConn.getDestinationConfiguration(sida); DestinationType destType = destConfig.getDestinationType(); if (destType == DestinationType.TOPICSPACE) { tempReplyTo = new JmsTopicImpl(); } else { tempReplyTo = new JmsQueueImpl(); } } catch (SIException sice) { // No FFDC code needed // d246604 Trace exceptions, but don't throw on. Fall back to // case c) below. if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { SibTr.debug(tc, "failed to look up dest type because of " + sice); SibTr.debug(tc, "detail ", sice); } } } // Case c) - Guess based on the discriminator if (tempReplyTo == null) { // 239238 - make a stab at determining whether it's a queue or topic // reply destination based on the reply disciminator. 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(); } } } } // Now fill in the fields that were hidden in the reply header. if (tempReplyTo != null) { populateReplyToFromHeader(tempReplyTo, _msg, rrp); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getJMSReplyToInternal", tempReplyTo); return tempReplyTo; }
[ "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", ";", "// Case a) - check for JMS specific data in compressed byte form.", "byte", "[", "]", "replyURIBytes", "=", "_msg", ".", "getJmsReplyTo", "(", ")", ";", "if", "(", "replyURIBytes", "!=", "null", ")", "{", "tempReplyTo", "=", "(", "JmsDestinationImpl", ")", "JmsInternalsFactory", ".", "getMessageDestEncodingUtils", "(", ")", ".", "getDestinationFromMsgRepresentation", "(", "replyURIBytes", ")", ";", "}", "if", "(", "tempReplyTo", "==", "null", ")", "{", "// Cases b) & c) both depend on there being a reverse routing path, otherwise", "// there is no replyTo.", "// lookup the name of the dest in the reverse routing path", "SIDestinationAddress", "sida", "=", "null", ";", "if", "(", "rrp", ".", "size", "(", ")", ">", "0", ")", "{", "// The last element of the RRP becomes the reply to destination", "int", "lastDestInRRP", "=", "rrp", ".", "size", "(", ")", "-", "1", ";", "sida", "=", "rrp", ".", "get", "(", "lastDestInRRP", ")", ";", "// Case b) - if we have a live connection, we can use that to query the dest type", "if", "(", "_siConn", "!=", "null", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "tc", ",", "\"Determine reply dest type using SICoreConnection\"", ")", ";", "try", "{", "// get the destination configuration & type", "DestinationConfiguration", "destConfig", "=", "_siConn", ".", "getDestinationConfiguration", "(", "sida", ")", ";", "DestinationType", "destType", "=", "destConfig", ".", "getDestinationType", "(", ")", ";", "if", "(", "destType", "==", "DestinationType", ".", "TOPICSPACE", ")", "{", "tempReplyTo", "=", "new", "JmsTopicImpl", "(", ")", ";", "}", "else", "{", "tempReplyTo", "=", "new", "JmsQueueImpl", "(", ")", ";", "}", "}", "catch", "(", "SIException", "sice", ")", "{", "// No FFDC code needed", "// d246604 Trace exceptions, but don't throw on. Fall back to", "// case c) below.", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "SibTr", ".", "debug", "(", "tc", ",", "\"failed to look up dest type because of \"", "+", "sice", ")", ";", "SibTr", ".", "debug", "(", "tc", ",", "\"detail \"", ",", "sice", ")", ";", "}", "}", "}", "// Case c) - Guess based on the discriminator", "if", "(", "tempReplyTo", "==", "null", ")", "{", "// 239238 - make a stab at determining whether it's a queue or topic", "// reply destination based on the reply disciminator.", "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", "(", ")", ";", "}", "}", "}", "}", "// Now fill in the fields that were hidden in the reply header.", "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. @param _msg CoreSPI message for which the JMS replyTo dest should be generated @param rrp Reverse routing path of the message. Should not be queried directly from 'msg' for efficiency reasons. @param _siConn JMS Core connection object that can be used if necessary to help determine the type of the destination (optional) @return JmsDestinationImpl @throws JMSException
[ "Static", "method", "that", "allows", "a", "replyTo", "destination", "to", "be", "obtained", "from", "a", "JsJmsMessage", "a", "ReverseRoutingPath", "and", "an", "optional", "JMS", "Core", "Connection", "object", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java#L1117-L1196
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java
JmsDestinationImpl.fullEncode
String fullEncode() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "fullEncode"); String encoded = null; // If we have a cached version of the string, use it. if (cachedEncodedString != null) { encoded = cachedEncodedString; } // Otherwise, encode it else { // Get a copy of the properties which make up this Destination. We need a // copy since we remove the jms name before iterating over the other // properties, and encoding them. Map<String, Object> destProps = getCopyOfProperties(); // Pass off to a common helper method (between full and partial encodings). encoded = encodeMap(destProps); // Now store this string in the cache in case we need it later. cachedEncodedString = encoded; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "fullEncode", encoded); return encoded; }
java
String fullEncode() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "fullEncode"); String encoded = null; // If we have a cached version of the string, use it. if (cachedEncodedString != null) { encoded = cachedEncodedString; } // Otherwise, encode it else { // Get a copy of the properties which make up this Destination. We need a // copy since we remove the jms name before iterating over the other // properties, and encoding them. Map<String, Object> destProps = getCopyOfProperties(); // Pass off to a common helper method (between full and partial encodings). encoded = encodeMap(destProps); // Now store this string in the cache in case we need it later. cachedEncodedString = encoded; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "fullEncode", encoded); return encoded; }
[ "String", "fullEncode", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"fullEncode\"", ")", ";", "String", "encoded", "=", "null", ";", "// If we have a cached version of the string, use it.", "if", "(", "cachedEncodedString", "!=", "null", ")", "{", "encoded", "=", "cachedEncodedString", ";", "}", "// Otherwise, encode it", "else", "{", "// Get a copy of the properties which make up this Destination. We need a", "// copy since we remove the jms name before iterating over the other", "// properties, and encoding them.", "Map", "<", "String", ",", "Object", ">", "destProps", "=", "getCopyOfProperties", "(", ")", ";", "// Pass off to a common helper method (between full and partial encodings).", "encoded", "=", "encodeMap", "(", "destProps", ")", ";", "// Now store this string in the cache in case we need it later.", "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; queue://my.queue.name queue://my.queue.name?name1=value1&name2=value2 topic://my.topic.name?name1=value1&name2=value2 Note that the partialEncode method is used for the reply destination since some of the reply fields are stored in the message header for use by other coreSPI applications. This is not the case for the JMSDestination object, which should represent the destination to which the message was sent. The format of destinations here follows that implemented in feature 189318 (URIDestinationCreator). TODO: This is only used by toString() & Unit tests, so they should change to use toString() directly, and this should either become private, or move into toString()
[ "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", ";" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java#L1219-L1247
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java
JmsDestinationImpl.partialEncode
String partialEncode() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "partialEncode()"); String encoded = null; // If we have a cached version of the string, use it. if (cachedPartialEncodedString != null) { encoded = cachedPartialEncodedString; } else { // Get a copy of the properties which make up this Destination. We need a // copy since we remove the jms name before iterating over the other // properties, and encoding them. Map<String, Object> destProps = getCopyOfProperties(); // Remove the props that are stored in the reply header. // NB. The deliveryMode is used in the creation of the reply header, // but must still be carried. 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); // Pass off to a common helper method (between full and partial encodings). encoded = encodeMap(destProps); // Now store this string in the cache in case we need it later. cachedPartialEncodedString = encoded; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "partialEncode", encoded); return encoded; }
java
String partialEncode() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "partialEncode()"); String encoded = null; // If we have a cached version of the string, use it. if (cachedPartialEncodedString != null) { encoded = cachedPartialEncodedString; } else { // Get a copy of the properties which make up this Destination. We need a // copy since we remove the jms name before iterating over the other // properties, and encoding them. Map<String, Object> destProps = getCopyOfProperties(); // Remove the props that are stored in the reply header. // NB. The deliveryMode is used in the creation of the reply header, // but must still be carried. 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); // Pass off to a common helper method (between full and partial encodings). encoded = encodeMap(destProps); // Now store this string in the cache in case we need it later. cachedPartialEncodedString = encoded; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "partialEncode", encoded); return encoded; }
[ "String", "partialEncode", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"partialEncode()\"", ")", ";", "String", "encoded", "=", "null", ";", "// If we have a cached version of the string, use it.", "if", "(", "cachedPartialEncodedString", "!=", "null", ")", "{", "encoded", "=", "cachedPartialEncodedString", ";", "}", "else", "{", "// Get a copy of the properties which make up this Destination. We need a", "// copy since we remove the jms name before iterating over the other", "// properties, and encoding them.", "Map", "<", "String", ",", "Object", ">", "destProps", "=", "getCopyOfProperties", "(", ")", ";", "// Remove the props that are stored in the reply header.", "// NB. The deliveryMode is used in the creation of the reply header,", "// but must still be carried.", "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", ")", ";", "// Pass off to a common helper method (between full and partial encodings).", "encoded", "=", "encodeMap", "(", "destProps", ")", ";", "// Now store this string in the cache in case we need it later.", "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. This is different from full encode because some of the fields of the destination are stored in the message reply header so that they can be accessed and altered by core SPI applications / mediations. TODO: This is only used by Unit tests, and those tests appear to be simply testing this method - so scrap it & them?
[ "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", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java#L1260-L1298
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java
JmsDestinationImpl.configureDestinationFromRoutingPath
void configureDestinationFromRoutingPath(List fwdPath) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "configureDestinationFromRoutingPath", fwdPath); // Clear the cache of the encoding string since we are changing properties. clearCachedEncodings(); // Clear the producerDestinationAddress, as changing the FRP would make it out-of-date clearCachedProducerDestinationAddress(); // Store the property if it has entries... if ((fwdPath != null) && (fwdPath.size() > 0)) { // There is at least one element in this path. // The last element in the list is used to configure the 'big' destination. int lastEltIndex = fwdPath.size() - 1; // The last element of the reverse routing path becomes the destination, and // anything left over goes into the forward path of the destination. SIDestinationAddress lastElt = (SIDestinationAddress) fwdPath.get(lastEltIndex); // Fill in the destination name information early so that it is there when // the forward routing path is set. String destName = lastElt.getDestinationName(); setDestName(destName); // Set up the bus name to point at the bus of the last element as // well. //not setting the bus name for Liberty .. as in other config paths the bus name was not set. // this is leading the same destination with different properties. //String destBusName = lastElt.getBusName(); //setBusName(destBusName); // If there is more than one element then we store the rest of the path // in the wrapper object. if (fwdPath.size() > 1) { properties.put(FORWARD_ROUTING_PATH, new StringArrayWrapper(fwdPath)); } // Otherwise, i.e. if there is only one element, we stash away the destination // as we need to use it as the producerDestinationAddress. else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "caching producerDestinationAddress: " + lastElt); producerDestinationAddress = lastElt; } } // ...otherwise, remove it else { properties.remove(FORWARD_ROUTING_PATH); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "configureDestinationFromRoutingPath"); }
java
void configureDestinationFromRoutingPath(List fwdPath) throws JMSException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "configureDestinationFromRoutingPath", fwdPath); // Clear the cache of the encoding string since we are changing properties. clearCachedEncodings(); // Clear the producerDestinationAddress, as changing the FRP would make it out-of-date clearCachedProducerDestinationAddress(); // Store the property if it has entries... if ((fwdPath != null) && (fwdPath.size() > 0)) { // There is at least one element in this path. // The last element in the list is used to configure the 'big' destination. int lastEltIndex = fwdPath.size() - 1; // The last element of the reverse routing path becomes the destination, and // anything left over goes into the forward path of the destination. SIDestinationAddress lastElt = (SIDestinationAddress) fwdPath.get(lastEltIndex); // Fill in the destination name information early so that it is there when // the forward routing path is set. String destName = lastElt.getDestinationName(); setDestName(destName); // Set up the bus name to point at the bus of the last element as // well. //not setting the bus name for Liberty .. as in other config paths the bus name was not set. // this is leading the same destination with different properties. //String destBusName = lastElt.getBusName(); //setBusName(destBusName); // If there is more than one element then we store the rest of the path // in the wrapper object. if (fwdPath.size() > 1) { properties.put(FORWARD_ROUTING_PATH, new StringArrayWrapper(fwdPath)); } // Otherwise, i.e. if there is only one element, we stash away the destination // as we need to use it as the producerDestinationAddress. else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "caching producerDestinationAddress: " + lastElt); producerDestinationAddress = lastElt; } } // ...otherwise, remove it else { properties.remove(FORWARD_ROUTING_PATH); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "configureDestinationFromRoutingPath"); }
[ "void", "configureDestinationFromRoutingPath", "(", "List", "fwdPath", ")", "throws", "JMSException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"configureDestinationFromRoutingPath\"", ",", "fwdPath", ")", ";", "// Clear the cache of the encoding string since we are changing properties.", "clearCachedEncodings", "(", ")", ";", "// Clear the producerDestinationAddress, as changing the FRP would make it out-of-date", "clearCachedProducerDestinationAddress", "(", ")", ";", "// Store the property if it has entries...", "if", "(", "(", "fwdPath", "!=", "null", ")", "&&", "(", "fwdPath", ".", "size", "(", ")", ">", "0", ")", ")", "{", "// There is at least one element in this path.", "// The last element in the list is used to configure the 'big' destination.", "int", "lastEltIndex", "=", "fwdPath", ".", "size", "(", ")", "-", "1", ";", "// The last element of the reverse routing path becomes the destination, and", "// anything left over goes into the forward path of the destination.", "SIDestinationAddress", "lastElt", "=", "(", "SIDestinationAddress", ")", "fwdPath", ".", "get", "(", "lastEltIndex", ")", ";", "// Fill in the destination name information early so that it is there when", "// the forward routing path is set.", "String", "destName", "=", "lastElt", ".", "getDestinationName", "(", ")", ";", "setDestName", "(", "destName", ")", ";", "// Set up the bus name to point at the bus of the last element as", "// well.", "//not setting the bus name for Liberty .. as in other config paths the bus name was not set.", "// this is leading the same destination with different properties.", "//String destBusName = lastElt.getBusName();", "//setBusName(destBusName);", "// If there is more than one element then we store the rest of the path", "// in the wrapper object.", "if", "(", "fwdPath", ".", "size", "(", ")", ">", "1", ")", "{", "properties", ".", "put", "(", "FORWARD_ROUTING_PATH", ",", "new", "StringArrayWrapper", "(", "fwdPath", ")", ")", ";", "}", "// Otherwise, i.e. if there is only one element, we stash away the destination", "// as we need to use it as the producerDestinationAddress.", "else", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "this", ",", "tc", ",", "\"caching producerDestinationAddress: \"", "+", "lastElt", ")", ";", "producerDestinationAddress", "=", "lastElt", ";", "}", "}", "// ...otherwise, remove it", "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. This method configures the whole destination (including the 'big' destination and bus names).
[ "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", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java#L1351-L1406
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java
JmsDestinationImpl.clearCachedEncodings
private void clearCachedEncodings() { cachedEncodedString = null; cachedPartialEncodedString = null; for (int i = 0; i < cachedEncoding.length; i++) cachedEncoding[i] = null; }
java
private void clearCachedEncodings() { cachedEncodedString = null; cachedPartialEncodedString = null; for (int i = 0; i < cachedEncoding.length; i++) cachedEncoding[i] = null; }
[ "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.
[ "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", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsDestinationImpl.java#L1470-L1477
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java
MultiMEProxyHandler.initialiseNonPersistent
public void initialiseNonPersistent(MessageProcessor messageProcessor, SIMPTransactionManager txManager) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "initialiseNonPersistent", messageProcessor); //Release 1 has no Link Bundle IDs for this Neighbour // Cache the reference to the message processor _messageProcessor = messageProcessor; // Create the ObjectPool that will be used to store the // subscriptionMessages. Creating with an intial length of // 2, but this could be made a settable parameter for performance _subscriptionMessagePool = new ObjectPool("SubscriptionMessages", NUM_MESSAGES); // Create a new object to contain all the Neighbours _neighbours = new Neighbours(this, _messageProcessor.getMessagingEngineBus()); // Create a new LockManager instance _lockManager = new LockManager(); // Assign the transaction manager _transactionManager = txManager; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "initialiseNonPersistent"); }
java
public void initialiseNonPersistent(MessageProcessor messageProcessor, SIMPTransactionManager txManager) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "initialiseNonPersistent", messageProcessor); //Release 1 has no Link Bundle IDs for this Neighbour // Cache the reference to the message processor _messageProcessor = messageProcessor; // Create the ObjectPool that will be used to store the // subscriptionMessages. Creating with an intial length of // 2, but this could be made a settable parameter for performance _subscriptionMessagePool = new ObjectPool("SubscriptionMessages", NUM_MESSAGES); // Create a new object to contain all the Neighbours _neighbours = new Neighbours(this, _messageProcessor.getMessagingEngineBus()); // Create a new LockManager instance _lockManager = new LockManager(); // Assign the transaction manager _transactionManager = txManager; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "initialiseNonPersistent"); }
[ "public", "void", "initialiseNonPersistent", "(", "MessageProcessor", "messageProcessor", ",", "SIMPTransactionManager", "txManager", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"initialiseNonPersistent\"", ",", "messageProcessor", ")", ";", "//Release 1 has no Link Bundle IDs for this Neighbour", "// Cache the reference to the message processor", "_messageProcessor", "=", "messageProcessor", ";", "// Create the ObjectPool that will be used to store the ", "// subscriptionMessages. Creating with an intial length of", "// 2, but this could be made a settable parameter for performance", "_subscriptionMessagePool", "=", "new", "ObjectPool", "(", "\"SubscriptionMessages\"", ",", "NUM_MESSAGES", ")", ";", "// Create a new object to contain all the Neighbours", "_neighbours", "=", "new", "Neighbours", "(", "this", ",", "_messageProcessor", ".", "getMessagingEngineBus", "(", ")", ")", ";", "// Create a new LockManager instance", "_lockManager", "=", "new", "LockManager", "(", ")", ";", "// Assign the transaction manager", "_transactionManager", "=", "txManager", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"initialiseNonPersistent\"", ")", ";", "}" ]
Called to recover Neighbours from the MessageStore. @param messageProcessor The message processor instance @param txManager The transaction manager instance to create Local transactions under.
[ "Called", "to", "recover", "Neighbours", "from", "the", "MessageStore", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java#L140-L167
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java
MultiMEProxyHandler.initalised
public void initalised() throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "initalised"); try { _lockManager.lockExclusive(); // Flag that we are in a started state. _started = true; // If the Neighbour Listener hasn't been created, create it if (_proxyListener == null) createProxyListener(); // Indicate that reconciling is complete _reconciling = false; _neighbours.resetBusSubscriptionList(); } finally { _lockManager.unlockExclusive(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "initalised"); }
java
public void initalised() throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "initalised"); try { _lockManager.lockExclusive(); // Flag that we are in a started state. _started = true; // If the Neighbour Listener hasn't been created, create it if (_proxyListener == null) createProxyListener(); // Indicate that reconciling is complete _reconciling = false; _neighbours.resetBusSubscriptionList(); } finally { _lockManager.unlockExclusive(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "initalised"); }
[ "public", "void", "initalised", "(", ")", "throws", "SIResourceException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"initalised\"", ")", ";", "try", "{", "_lockManager", ".", "lockExclusive", "(", ")", ";", "// Flag that we are in a started state. ", "_started", "=", "true", ";", "// If the Neighbour Listener hasn't been created, create it", "if", "(", "_proxyListener", "==", "null", ")", "createProxyListener", "(", ")", ";", "// Indicate that reconciling is complete", "_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. The flag that indicates that reconciling is complete is also set
[ "When", "initialised", "is", "called", "each", "of", "the", "neighbours", "are", "sent", "the", "set", "of", "subscriptions", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java#L176-L204
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java
MultiMEProxyHandler.stop
public void stop() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "stop"); try { _lockManager.lockExclusive(); // Flag that we are in a started state. _started = false; } finally { _lockManager.unlockExclusive(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "stop"); }
java
public void stop() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "stop"); try { _lockManager.lockExclusive(); // Flag that we are in a started state. _started = false; } finally { _lockManager.unlockExclusive(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "stop"); }
[ "public", "void", "stop", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"stop\"", ")", ";", "try", "{", "_lockManager", ".", "lockExclusive", "(", ")", ";", "// Flag that we are in a started state. ", "_started", "=", "false", ";", "}", "finally", "{", "_lockManager", ".", "unlockExclusive", "(", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"stop\"", ")", ";", "}" ]
Stops the proxy handler from processing any more messages
[ "Stops", "the", "proxy", "handler", "from", "processing", "any", "more", "messages" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java#L209-L226
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java
MultiMEProxyHandler.removeUnusedNeighbours
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); // Enumerate through the Neighbours. while (neighbourList.hasMoreElements()) { final Neighbour neighbour = (Neighbour) neighbourList.nextElement(); // If the neigbour is a foreign neighbour and still has a link // definition associated with it then we leave it in the recovered // state. The link start operation will make the neighbour available. // Link deletion will remove the neighbour if (_messageProcessor. getDestinationManager(). getLinkDefinition(neighbour.getBusId()) == null) { // If the Neighbour was created at startup from the message // store, then this Neighbour can be deleted as it hasn't // been reinstated from Admin. // Delete this Neighbour with the forced option // as we don't know the state of this Neighbour. _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) { // FFDC 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"); }
java
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); // Enumerate through the Neighbours. while (neighbourList.hasMoreElements()) { final Neighbour neighbour = (Neighbour) neighbourList.nextElement(); // If the neigbour is a foreign neighbour and still has a link // definition associated with it then we leave it in the recovered // state. The link start operation will make the neighbour available. // Link deletion will remove the neighbour if (_messageProcessor. getDestinationManager(). getLinkDefinition(neighbour.getBusId()) == null) { // If the Neighbour was created at startup from the message // store, then this Neighbour can be deleted as it hasn't // been reinstated from Admin. // Delete this Neighbour with the forced option // as we don't know the state of this Neighbour. _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) { // FFDC 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"); }
[ "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", ")", ";", "// Enumerate through the Neighbours.", "while", "(", "neighbourList", ".", "hasMoreElements", "(", ")", ")", "{", "final", "Neighbour", "neighbour", "=", "(", "Neighbour", ")", "neighbourList", ".", "nextElement", "(", ")", ";", "// If the neigbour is a foreign neighbour and still has a link", "// definition associated with it then we leave it in the recovered", "// state. The link start operation will make the neighbour available.", "// Link deletion will remove the neighbour", "if", "(", "_messageProcessor", ".", "getDestinationManager", "(", ")", ".", "getLinkDefinition", "(", "neighbour", ".", "getBusId", "(", ")", ")", "==", "null", ")", "{", "// If the Neighbour was created at startup from the message ", "// store, then this Neighbour can be deleted as it hasn't ", "// been reinstated from Admin.", "// Delete this Neighbour with the forced option ", "// as we don't know the state of this Neighbour.", "_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", ")", "{", "// FFDC", "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. This will generate the reset state method to be sent to all Neighbouring ME's Also, this will check all Neighbours and ensure that they are all still valid and remove those that aren't
[ "removeUnusedNeighbours", "is", "called", "once", "all", "the", "Neighbours", "are", "defined", "from", "Admin", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java#L238-L317
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java
MultiMEProxyHandler.subscribeEvent
public void subscribeEvent( ConsumerDispatcherState subState, Transaction transaction) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry( tc, "subscribeEvent", new Object[] { subState, transaction }); try { // Get the lock Manager lock // multiple subscribes can happen at the same time - // this is allowed. _lockManager.lock(); if (!_started) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "subscribeEvent", "Returning as stopped"); return; } // Get the list of Buses that this subscription needs to be forwarded // onto final BusGroup[] buses = _neighbours.getAllBuses(); // Declaration of a message handler that can be used for // building up the proxy subscription message to be forwarded. SubscriptionMessageHandler messageHandler = null; // Loop through each of the Buses deciding if this // subscription event needs to be forwarded 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]); // Send the proxy always messageHandler = buses[i].addLocalSubscription( subState, messageHandler, transaction, true); // If the subscription message isn't null, then add it back into // the pool of subscription messages. if (messageHandler != null) { addMessageHandler(messageHandler); messageHandler = null; } } } finally { // Release the lock that was obtained _lockManager.unlock(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "subscribeEvent"); }
java
public void subscribeEvent( ConsumerDispatcherState subState, Transaction transaction) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry( tc, "subscribeEvent", new Object[] { subState, transaction }); try { // Get the lock Manager lock // multiple subscribes can happen at the same time - // this is allowed. _lockManager.lock(); if (!_started) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "subscribeEvent", "Returning as stopped"); return; } // Get the list of Buses that this subscription needs to be forwarded // onto final BusGroup[] buses = _neighbours.getAllBuses(); // Declaration of a message handler that can be used for // building up the proxy subscription message to be forwarded. SubscriptionMessageHandler messageHandler = null; // Loop through each of the Buses deciding if this // subscription event needs to be forwarded 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]); // Send the proxy always messageHandler = buses[i].addLocalSubscription( subState, messageHandler, transaction, true); // If the subscription message isn't null, then add it back into // the pool of subscription messages. if (messageHandler != null) { addMessageHandler(messageHandler); messageHandler = null; } } } finally { // Release the lock that was obtained _lockManager.unlock(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "subscribeEvent"); }
[ "public", "void", "subscribeEvent", "(", "ConsumerDispatcherState", "subState", ",", "Transaction", "transaction", ")", "throws", "SIResourceException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"subscribeEvent\"", ",", "new", "Object", "[", "]", "{", "subState", ",", "transaction", "}", ")", ";", "try", "{", "// Get the lock Manager lock ", "// multiple subscribes can happen at the same time - ", "// this is allowed.", "_lockManager", ".", "lock", "(", ")", ";", "if", "(", "!", "_started", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"subscribeEvent\"", ",", "\"Returning as stopped\"", ")", ";", "return", ";", "}", "// Get the list of Buses that this subscription needs to be forwarded", "// onto", "final", "BusGroup", "[", "]", "buses", "=", "_neighbours", ".", "getAllBuses", "(", ")", ";", "// Declaration of a message handler that can be used for ", "// building up the proxy subscription message to be forwarded.", "SubscriptionMessageHandler", "messageHandler", "=", "null", ";", "// Loop through each of the Buses deciding if this", "// subscription event needs to be forwarded", "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", "]", ")", ";", "// Send the proxy always", "messageHandler", "=", "buses", "[", "i", "]", ".", "addLocalSubscription", "(", "subState", ",", "messageHandler", ",", "transaction", ",", "true", ")", ";", "// If the subscription message isn't null, then add it back into ", "// the pool of subscription messages.", "if", "(", "messageHandler", "!=", "null", ")", "{", "addMessageHandler", "(", "messageHandler", ")", ";", "messageHandler", "=", "null", ";", "}", "}", "}", "finally", "{", "// Release the lock that was obtained", "_lockManager", ".", "unlock", "(", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"subscribeEvent\"", ")", ";", "}" ]
Forwards a subscription to all Neighbouring ME's To drive this subscribeEvent method, the subscription would have to have been registered on this ME which means that we can forward this subscription onto the Neighbours if required @param subState The subscription definition @param transaction The transaction to send the proxy update message under @exception SIResourceException
[ "Forwards", "a", "subscription", "to", "all", "Neighbouring", "ME", "s" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java#L331-L398
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java
MultiMEProxyHandler.topicSpaceCreatedEvent
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"); }
java
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"); }
[ "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. @param destination The destination object being created @exception SIDiscriminatorSyntaxException @exception SISelectorSyntaxException @exception SIResourceException
[ "When", "a", "topic", "space", "is", "created", "there", "may", "be", "proxy", "subscriptions", "already", "registered", "that", "need", "to", "attach", "to", "this", "topic", "space", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java#L798-L816
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java
MultiMEProxyHandler.topicSpaceDeletedEvent
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"); }
java
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"); }
[ "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 @param destination The destination topic space that has been deleted @exception SIResourceException
[ "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" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java#L827-L846
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java
MultiMEProxyHandler.linkStarted
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}); // Look for existing neighbour for the link Neighbour neighbour = getNeighbour(meUuid); if (neighbour == null) { // If the neighbour doesn't exist then create it now. LocalTransaction tran = _transactionManager.createLocalTransaction(true); neighbour = createNeighbour(meUuid, busId, (Transaction) tran); tran.commit(); } // Reset the list of subscriptions _neighbours.resetBusSubscriptionList(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "linkStarted"); }
java
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}); // Look for existing neighbour for the link Neighbour neighbour = getNeighbour(meUuid); if (neighbour == null) { // If the neighbour doesn't exist then create it now. LocalTransaction tran = _transactionManager.createLocalTransaction(true); neighbour = createNeighbour(meUuid, busId, (Transaction) tran); tran.commit(); } // Reset the list of subscriptions _neighbours.resetBusSubscriptionList(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "linkStarted"); }
[ "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", "}", ")", ";", "// Look for existing neighbour for the link", "Neighbour", "neighbour", "=", "getNeighbour", "(", "meUuid", ")", ";", "if", "(", "neighbour", "==", "null", ")", "{", "// If the neighbour doesn't exist then create it now.", "LocalTransaction", "tran", "=", "_transactionManager", ".", "createLocalTransaction", "(", "true", ")", ";", "neighbour", "=", "createNeighbour", "(", "meUuid", ",", "busId", ",", "(", "Transaction", ")", "tran", ")", ";", "tran", ".", "commit", "(", ")", ";", "}", "// Reset the list of subscriptions", "_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. If the neighbour was not found, then create it here as we don't want to start sending messages to it until the link has started. @param String The name of the foreign bus @param SIBUuid8 The uuid of the link localising ME on the foreign bus
[ "When", "a", "Link", "is", "started", "we", "want", "to", "send", "a", "reset", "message", "to", "the", "neighbouring", "bus", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java#L858-L885
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java
MultiMEProxyHandler.cleanupLinkNeighbour
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"); }
java
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"); }
[ "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. @param String The name of the foreign bus
[ "When", "a", "link", "is", "deleted", "we", "need", "to", "clean", "up", "any", "neighbours", "that", "won", "t", "be", "deleted", "at", "restart", "time", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java#L893-L918
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java
MultiMEProxyHandler.deleteNeighbourForced
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(); // Force remove the Neighbour _neighbours.removeNeighbour(meUUID, busId, transaction); } finally { _lockManager.unlockExclusive(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "deleteNeighbourForced"); }
java
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(); // Force remove the Neighbour _neighbours.removeNeighbour(meUUID, busId, transaction); } finally { _lockManager.unlockExclusive(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "deleteNeighbourForced"); }
[ "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", "(", ")", ";", "// Force remove the Neighbour", "_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. This will not leave the Neighbour marked as deleted and wait for the delete message, it will simply zap everything in site. This will forward on any deregistration Events to other Neighbours. @param neighbourUUID The UUID for the Neighbour @param busId The bus that this ME belongs to. @param transaction The transaction for deleting the Neighbour @exception SIDestinationNotFoundException Thrown if the Neighbour was not found @exception SIResourceException
[ "Removes", "a", "Neighbour", "by", "taking", "a", "brutal", "approach", "to", "remove", "all", "the", "proxy", "Subscriptions", "on", "this", "ME", "pointing", "at", "other", "Neighbours", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java#L990-L1016
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java
MultiMEProxyHandler.deleteAllNeighboursForced
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(); // Force remove the Neighbour _neighbours.removeNeighbour(neighbour.getUUID(), neighbour.getBusId(), transaction); } neighbs = _neighbours.getAllRecoveredNeighbours(); while (neighbs.hasMoreElements()) { Neighbour neighbour = (Neighbour)neighbs.nextElement(); // Force remove the Neighbour _neighbours.removeNeighbour(neighbour.getUUID(), neighbour.getBusId(), transaction); } } finally { _lockManager.unlockExclusive(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "deleteAllNeighboursForced"); }
java
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(); // Force remove the Neighbour _neighbours.removeNeighbour(neighbour.getUUID(), neighbour.getBusId(), transaction); } neighbs = _neighbours.getAllRecoveredNeighbours(); while (neighbs.hasMoreElements()) { Neighbour neighbour = (Neighbour)neighbs.nextElement(); // Force remove the Neighbour _neighbours.removeNeighbour(neighbour.getUUID(), neighbour.getBusId(), transaction); } } finally { _lockManager.unlockExclusive(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "deleteAllNeighboursForced"); }
[ "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", "(", ")", ";", "// Force remove the Neighbour", "_neighbours", ".", "removeNeighbour", "(", "neighbour", ".", "getUUID", "(", ")", ",", "neighbour", ".", "getBusId", "(", ")", ",", "transaction", ")", ";", "}", "neighbs", "=", "_neighbours", ".", "getAllRecoveredNeighbours", "(", ")", ";", "while", "(", "neighbs", ".", "hasMoreElements", "(", ")", ")", "{", "Neighbour", "neighbour", "=", "(", "Neighbour", ")", "neighbs", ".", "nextElement", "(", ")", ";", "// Force remove the Neighbour", "_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. @param neighbourUUID The UUID for the Neighbour @param busId The bus that this ME belongs to. @param transaction The transaction for deleting the Neighbour @exception SIDestinationNotFoundException Thrown if the Neighbour was not found @exception SIResourceException
[ "This", "is", "purely", "for", "unittests", ".", "Many", "unittests", "dont", "cleanup", "their", "neighbours", "so", "we", "now", "need", "this", "to", "ensure", "certain", "tests", "are", "clean", "before", "starting", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java#L1029-L1068
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java
MultiMEProxyHandler.recoverNeighbours
public void recoverNeighbours() throws SIResourceException, MessageStoreException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "recoverNeighbours"); try { // Lock the manager exclusively _lockManager.lockExclusive(); // Indicate that we are now reconciling _reconciling = true; _neighbours.recoverNeighbours(); } finally { _lockManager.unlockExclusive(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "recoverNeighbours"); }
java
public void recoverNeighbours() throws SIResourceException, MessageStoreException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "recoverNeighbours"); try { // Lock the manager exclusively _lockManager.lockExclusive(); // Indicate that we are now reconciling _reconciling = true; _neighbours.recoverNeighbours(); } finally { _lockManager.unlockExclusive(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "recoverNeighbours"); }
[ "public", "void", "recoverNeighbours", "(", ")", "throws", "SIResourceException", ",", "MessageStoreException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"recoverNeighbours\"", ")", ";", "try", "{", "// Lock the manager exclusively", "_lockManager", ".", "lockExclusive", "(", ")", ";", "// Indicate that we are now reconciling", "_reconciling", "=", "true", ";", "_neighbours", ".", "recoverNeighbours", "(", ")", ";", "}", "finally", "{", "_lockManager", ".", "unlockExclusive", "(", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"recoverNeighbours\"", ")", ";", "}" ]
Recovers the Neighbours from the MessageStore. @exception WsException Thrown if there was a problem recovering the Neighbours.
[ "Recovers", "the", "Neighbours", "from", "the", "MessageStore", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java#L1077-L1099
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java
MultiMEProxyHandler.reportAllNeighbours
Enumeration reportAllNeighbours() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "reportAllNeighbours"); // Call out to the Neighbours class to get the list of Neighbours. final Enumeration neighbours = _neighbours.getAllNeighbours(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "reportAllNeighbours"); return neighbours; }
java
Enumeration reportAllNeighbours() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "reportAllNeighbours"); // Call out to the Neighbours class to get the list of Neighbours. final Enumeration neighbours = _neighbours.getAllNeighbours(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "reportAllNeighbours"); return neighbours; }
[ "Enumeration", "reportAllNeighbours", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"reportAllNeighbours\"", ")", ";", "// Call out to the Neighbours class to get the list of Neighbours.", "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 @return An Enumeration of all the Neighbours.
[ "Method", "reports", "all", "currently", "known", "ME", "s", "in", "a", "Enumeration", "format" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java#L1106-L1118
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java
MultiMEProxyHandler.addMessageHandler
void addMessageHandler(SubscriptionMessageHandler messageHandler) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "addMessageHandler", messageHandler); final boolean inserted = _subscriptionMessagePool.add(messageHandler); // If the message wasn't inserted, then the pool was exceeded if (!inserted) if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug( tc, "SubscriptionObjectPool size exceeded"); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "addMessageHandler"); }
java
void addMessageHandler(SubscriptionMessageHandler messageHandler) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "addMessageHandler", messageHandler); final boolean inserted = _subscriptionMessagePool.add(messageHandler); // If the message wasn't inserted, then the pool was exceeded if (!inserted) if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug( tc, "SubscriptionObjectPool size exceeded"); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "addMessageHandler"); }
[ "void", "addMessageHandler", "(", "SubscriptionMessageHandler", "messageHandler", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"addMessageHandler\"", ",", "messageHandler", ")", ";", "final", "boolean", "inserted", "=", "_subscriptionMessagePool", ".", "add", "(", "messageHandler", ")", ";", "// If the message wasn't inserted, then the pool was exceeded", "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. @param messageHandler The message handler to add back to the pool
[ "Adds", "a", "message", "back", "into", "the", "Pool", "of", "available", "messages", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java#L1144-L1159
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java
MultiMEProxyHandler.getMessageHandler
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; }
java
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; }
[ "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 It will check the message pool and if none are available, it will create a new instance @return SubscriptionMessageHandler The message handling class.
[ "Returns", "the", "Message", "Handler", "to", "be", "used", "for", "this", "operation" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java#L1169-L1192
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java
MultiMEProxyHandler.createProxyListener
private void createProxyListener() throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createProxyListener"); // Create the proxy listener instance _proxyListener = new NeighbourProxyListener(_neighbours, this); /* * Now we can create our asynchronous consumer to listen on * SYSTEM.MENAME.PROXY.QUEUE Queue for receiving subscription * updates */ // 169897.1 modified parameters try { _proxyAsyncConsumer = _messageProcessor .getSystemConnection() .createSystemConsumerSession( _messageProcessor.getProxyHandlerDestAddr(), // destination name null, //Destination filter null, // SelectionCriteria - discriminator and selector Reliability.ASSURED_PERSISTENT, // reliability false, // enable read ahead false, null, false); // 169897.1 modified parameters _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"); // The Exceptions should already be NLS'd throw new SIResourceException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createProxyListener"); }
java
private void createProxyListener() throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createProxyListener"); // Create the proxy listener instance _proxyListener = new NeighbourProxyListener(_neighbours, this); /* * Now we can create our asynchronous consumer to listen on * SYSTEM.MENAME.PROXY.QUEUE Queue for receiving subscription * updates */ // 169897.1 modified parameters try { _proxyAsyncConsumer = _messageProcessor .getSystemConnection() .createSystemConsumerSession( _messageProcessor.getProxyHandlerDestAddr(), // destination name null, //Destination filter null, // SelectionCriteria - discriminator and selector Reliability.ASSURED_PERSISTENT, // reliability false, // enable read ahead false, null, false); // 169897.1 modified parameters _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"); // The Exceptions should already be NLS'd throw new SIResourceException(e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createProxyListener"); }
[ "private", "void", "createProxyListener", "(", ")", "throws", "SIResourceException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"createProxyListener\"", ")", ";", "// Create the proxy listener instance", "_proxyListener", "=", "new", "NeighbourProxyListener", "(", "_neighbours", ",", "this", ")", ";", "/*\n * Now we can create our asynchronous consumer to listen on \n * SYSTEM.MENAME.PROXY.QUEUE Queue for receiving subscription\n * updates \n */", "// 169897.1 modified parameters", "try", "{", "_proxyAsyncConsumer", "=", "_messageProcessor", ".", "getSystemConnection", "(", ")", ".", "createSystemConsumerSession", "(", "_messageProcessor", ".", "getProxyHandlerDestAddr", "(", ")", ",", "// destination name", "null", ",", "//Destination filter", "null", ",", "// SelectionCriteria - discriminator and selector", "Reliability", ".", "ASSURED_PERSISTENT", ",", "// reliability", "false", ",", "// enable read ahead", "false", ",", "null", ",", "false", ")", ";", "// 169897.1 modified parameters", "_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\"", ")", ";", "// The Exceptions should already be NLS'd", "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 @throws SIResourceException Thrown if there are errors while creating the
[ "Method", "that", "creates", "the", "NeighbourProxyListener", "instance", "for", "reading", "messages", "from", "the", "Neighbours", ".", "It", "then", "registers", "the", "listener", "to", "start", "receiving", "messages" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java#L1202-L1259
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java
MultiMEProxyHandler.getNeighbour
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; }
java
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; }
[ "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 @param neighbourUUID The uuid to find @param includeRecovered Also look for the neighbour in the recovered list @return The neighbour object
[ "Returns", "the", "neighbour", "for", "the", "given", "UUID" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/MultiMEProxyHandler.java#L1297-L1311
train
OpenLiberty/open-liberty
dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/Lock.java
Lock.getSharedLock
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 this thread does not have any existing shared locks and there is a thread waiting to get the exclusive // lock or a thread (other than this thread) who already holds the exclusive lock then we will have to wait // until the exclusive lock is eventually dropped before granting the shared lock. 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"); // This exception is recieved if another thread interrupts this thread by calling this threads // Thread.interrupt method. The Lock class does not use this mechanism for breaking out of the // wait call - it uses notifyAll to wake up all waiting threads. This exception should never // be generated. If for some reason it is called then ignore it and start to wait again. } } 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"); }
java
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 this thread does not have any existing shared locks and there is a thread waiting to get the exclusive // lock or a thread (other than this thread) who already holds the exclusive lock then we will have to wait // until the exclusive lock is eventually dropped before granting the shared lock. 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"); // This exception is recieved if another thread interrupts this thread by calling this threads // Thread.interrupt method. The Lock class does not use this mechanism for breaking out of the // wait call - it uses notifyAll to wake up all waiting threads. This exception should never // be generated. If for some reason it is called then ignore it and start to wait again. } } 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"); }
[ "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 this thread does not have any existing shared locks and there is a thread waiting to get the exclusive", "// lock or a thread (other than this thread) who already holds the exclusive lock then we will have to wait", "// until the exclusive lock is eventually dropped before granting the shared lock.", "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\"", ")", ";", "// This exception is recieved if another thread interrupts this thread by calling this threads ", "// Thread.interrupt method. The Lock class does not use this mechanism for breaking out of the", "// wait call - it uses notifyAll to wake up all waiting threads. This exception should never", "// be generated. If for some reason it is called then ignore it and start to wait again.", "}", "}", "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. @param requestId The 'identifier' of the lock requester. This is used ONLY for trace output. It should be used to 'pair up' get/set pairs in the code.
[ "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", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/Lock.java#L153-L207
train
OpenLiberty/open-liberty
dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/Lock.java
Lock.releaseSharedLock
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 this thread no longer holds any shared locks then inform those waiting of this // fact. 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"); }
java
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 this thread no longer holds any shared locks then inform those waiting of this // fact. 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"); }
[ "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 this thread no longer holds any shared locks then inform those waiting of this", "// fact.", "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. @exception NoSharedLockException The caller does not hold a shared lock to release @param requestId The 'identifier' of the lock requester. This is used ONLY for trace output. It should be used to 'pair up' get/set pairs in the code.
[ "Releases", "a", "single", "shared", "lock", "from", "thread", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/Lock.java#L221-L270
train
OpenLiberty/open-liberty
dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/h2internal/H2InboundLink.java
H2InboundLink.handleHTTP2AlpnConnect
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); // remove the HttpDispatcherLink from the map, so a new one will be created and used by this new H2 stream h2VC.getStateMap().remove(HttpDispatcherLink.LINK_ID); H2HttpInboundLinkWrap wrap = new H2HttpInboundLinkWrap(httpInboundChannel, h2VC, streamID, this); // create the initial stream processor, add it to the link stream table, and add it to the write queue 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; }
java
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); // remove the HttpDispatcherLink from the map, so a new one will be created and used by this new H2 stream h2VC.getStateMap().remove(HttpDispatcherLink.LINK_ID); H2HttpInboundLinkWrap wrap = new H2HttpInboundLinkWrap(httpInboundChannel, h2VC, streamID, this); // create the initial stream processor, add it to the link stream table, and add it to the write queue 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; }
[ "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", ")", ";", "// remove the HttpDispatcherLink from the map, so a new one will be created and used by this new H2 stream", "h2VC", ".", "getStateMap", "(", ")", ".", "remove", "(", "HttpDispatcherLink", ".", "LINK_ID", ")", ";", "H2HttpInboundLinkWrap", "wrap", "=", "new", "H2HttpInboundLinkWrap", "(", "httpInboundChannel", ",", "h2VC", ",", "streamID", ",", "this", ")", ";", "// create the initial stream processor, add it to the link stream table, and add it to the write queue", "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" @param link the initial inbound link @return true if the upgrade was sucessful
[ "Handle", "a", "connection", "initiated", "via", "ALPN", "h2" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/h2internal/H2InboundLink.java#L291-L315
train
OpenLiberty/open-liberty
dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/h2internal/H2InboundLink.java
H2InboundLink.handleHTTP2UpgradeRequest
public boolean handleHTTP2UpgradeRequest(Map<String, String> headers, HttpInboundLink link) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "handleHTTP2UpgradeRequest entry"); } //1) Send the 101 response //2) Setup the new streams and Links //3) Place the new stream into the existing links 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"); } // if the above call goes async, not sure if we will then have a race condition, need to check further.System.out.println("H2InboundLink.handleHTTP2UpgradeRequest sent out 101"); Integer streamID = new Integer(1); H2VirtualConnectionImpl h2VC = new H2VirtualConnectionImpl(initialVC); // remove the HttpDispatcherLink from the map, so a new one will be created and used by this new H2 stream 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); } // first stream on this connection will have the root as parent, exclusive isn't an option // not sure yet if priority can be anything other than the default for setting up the first stream on a connection writeQ.addNewNodeToQ(streamID, Node.ROOT_STREAM_ID, Node.DEFAULT_NODE_PRIORITY, false); streamTable.put(streamID, streamProcessor); highestClientStreamId = streamID; // add stream 0 to the table, in case we need to write out any control frames prior to initialization completion streamID = 0; streamProcessor = new H2StreamProcessor(streamID, wrap, this, StreamState.OPEN); streamTable.put(streamID, streamProcessor); // pull the settings header out of the request; // process it and apply it to the stream 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; }
java
public boolean handleHTTP2UpgradeRequest(Map<String, String> headers, HttpInboundLink link) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "handleHTTP2UpgradeRequest entry"); } //1) Send the 101 response //2) Setup the new streams and Links //3) Place the new stream into the existing links 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"); } // if the above call goes async, not sure if we will then have a race condition, need to check further.System.out.println("H2InboundLink.handleHTTP2UpgradeRequest sent out 101"); Integer streamID = new Integer(1); H2VirtualConnectionImpl h2VC = new H2VirtualConnectionImpl(initialVC); // remove the HttpDispatcherLink from the map, so a new one will be created and used by this new H2 stream 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); } // first stream on this connection will have the root as parent, exclusive isn't an option // not sure yet if priority can be anything other than the default for setting up the first stream on a connection writeQ.addNewNodeToQ(streamID, Node.ROOT_STREAM_ID, Node.DEFAULT_NODE_PRIORITY, false); streamTable.put(streamID, streamProcessor); highestClientStreamId = streamID; // add stream 0 to the table, in case we need to write out any control frames prior to initialization completion streamID = 0; streamProcessor = new H2StreamProcessor(streamID, wrap, this, StreamState.OPEN); streamTable.put(streamID, streamProcessor); // pull the settings header out of the request; // process it and apply it to the stream 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; }
[ "public", "boolean", "handleHTTP2UpgradeRequest", "(", "Map", "<", "String", ",", "String", ">", "headers", ",", "HttpInboundLink", "link", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"handleHTTP2UpgradeRequest entry\"", ")", ";", "}", "//1) Send the 101 response", "//2) Setup the new streams and Links", "//3) Place the new stream into the existing links", "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\"", ")", ";", "}", "// if the above call goes async, not sure if we will then have a race condition, need to check further.System.out.println(\"H2InboundLink.handleHTTP2UpgradeRequest sent out 101\");", "Integer", "streamID", "=", "new", "Integer", "(", "1", ")", ";", "H2VirtualConnectionImpl", "h2VC", "=", "new", "H2VirtualConnectionImpl", "(", "initialVC", ")", ";", "// remove the HttpDispatcherLink from the map, so a new one will be created and used by this new H2 stream", "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", ")", ";", "}", "// first stream on this connection will have the root as parent, exclusive isn't an option", "// not sure yet if priority can be anything other than the default for setting up the first stream on a connection", "writeQ", ".", "addNewNodeToQ", "(", "streamID", ",", "Node", ".", "ROOT_STREAM_ID", ",", "Node", ".", "DEFAULT_NODE_PRIORITY", ",", "false", ")", ";", "streamTable", ".", "put", "(", "streamID", ",", "streamProcessor", ")", ";", "highestClientStreamId", "=", "streamID", ";", "// add stream 0 to the table, in case we need to write out any control frames prior to initialization completion", "streamID", "=", "0", ";", "streamProcessor", "=", "new", "H2StreamProcessor", "(", "streamID", ",", "wrap", ",", "this", ",", "StreamState", ".", "OPEN", ")", ";", "streamTable", ".", "put", "(", "streamID", ",", "streamProcessor", ")", ";", "// pull the settings header out of the request;", "// process it and apply it to the stream", "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 @param headers a map of the headers for this request @param link the initial inbound link @return true if the http2 upgrade was successful
[ "Handle", "an", "h2c", "upgrade", "request" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/h2internal/H2InboundLink.java#L324-L397
train
OpenLiberty/open-liberty
dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/h2internal/H2InboundLink.java
H2InboundLink.updateHighestStreamId
protected void updateHighestStreamId(int proposedHighestStreamId) throws ProtocolException { if ((proposedHighestStreamId & 1) == 0) { // even number, server-initialized stream 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); } } }
java
protected void updateHighestStreamId(int proposedHighestStreamId) throws ProtocolException { if ((proposedHighestStreamId & 1) == 0) { // even number, server-initialized stream 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); } } }
[ "protected", "void", "updateHighestStreamId", "(", "int", "proposedHighestStreamId", ")", "throws", "ProtocolException", "{", "if", "(", "(", "proposedHighestStreamId", "&", "1", ")", "==", "0", ")", "{", "// even number, server-initialized stream", "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 @param proposedHighestStreamId @throws ProtocolException if the proposed stream ID is lower than a previous streams'
[ "Keep", "track", "of", "the", "highest", "-", "valued", "local", "and", "remote", "stream", "IDs", "for", "this", "connection" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/h2internal/H2InboundLink.java#L405-L429
train
OpenLiberty/open-liberty
dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/h2internal/H2InboundLink.java
H2InboundLink.destroy
@Override 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(); }
java
@Override 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(); }
[ "@", "Override", "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
[ "A", "GOAWAY", "frame", "has", "been", "received", ";", "start", "shutting", "down", "this", "connection" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/h2internal/H2InboundLink.java#L676-L692
train
OpenLiberty/open-liberty
dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/h2internal/H2InboundLink.java
H2InboundLink.incrementConnectionWindowUpdateLimit
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(); } } } }
java
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(); } } } }
[ "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 @param int amount to increment connection window @throws FlowControlException
[ "Increment", "the", "connection", "window", "limit", "but", "the", "given", "amount" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/h2internal/H2InboundLink.java#L812-L823
train
OpenLiberty/open-liberty
dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/h2internal/H2InboundLink.java
H2InboundLink.closeStream
public void closeStream(H2StreamProcessor p) { // only place that should be dealing with the closed stream table, // be called by multiple stream objects at the same time, so sync access synchronized (streamOpenCloseSync) { if (p.getId() != 0) { writeQ.removeNodeFromQ(p.getId()); this.closedStreams.add(p); if (p.getId() % 2 == 0) { this.openPushStreams--; } else { decrementActiveClientStreams(); } } // Removes all streams that are older than STREAM_CLOSE_DELAY from the streamTable long currentTime = System.currentTimeMillis(); while (closedStreams.peek() != null && currentTime - closedStreams.peek().getCloseTime() > STREAM_CLOSE_DELAY) { streamTable.remove(closedStreams.remove().getId()); } } }
java
public void closeStream(H2StreamProcessor p) { // only place that should be dealing with the closed stream table, // be called by multiple stream objects at the same time, so sync access synchronized (streamOpenCloseSync) { if (p.getId() != 0) { writeQ.removeNodeFromQ(p.getId()); this.closedStreams.add(p); if (p.getId() % 2 == 0) { this.openPushStreams--; } else { decrementActiveClientStreams(); } } // Removes all streams that are older than STREAM_CLOSE_DELAY from the streamTable long currentTime = System.currentTimeMillis(); while (closedStreams.peek() != null && currentTime - closedStreams.peek().getCloseTime() > STREAM_CLOSE_DELAY) { streamTable.remove(closedStreams.remove().getId()); } } }
[ "public", "void", "closeStream", "(", "H2StreamProcessor", "p", ")", "{", "// only place that should be dealing with the closed stream table,", "// be called by multiple stream objects at the same time, so sync access", "synchronized", "(", "streamOpenCloseSync", ")", "{", "if", "(", "p", ".", "getId", "(", ")", "!=", "0", ")", "{", "writeQ", ".", "removeNodeFromQ", "(", "p", ".", "getId", "(", ")", ")", ";", "this", ".", "closedStreams", ".", "add", "(", "p", ")", ";", "if", "(", "p", ".", "getId", "(", ")", "%", "2", "==", "0", ")", "{", "this", ".", "openPushStreams", "--", ";", "}", "else", "{", "decrementActiveClientStreams", "(", ")", ";", "}", "}", "// Removes all streams that are older than STREAM_CLOSE_DELAY from the streamTable", "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. @param int streamID
[ "Remove", "the", "stream", "matching", "the", "given", "ID", "from", "the", "write", "tree", "and", "decrement", "the", "number", "of", "open", "streams", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/h2internal/H2InboundLink.java#L1242-L1263
train
OpenLiberty/open-liberty
dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/h2internal/H2InboundLink.java
H2InboundLink.getStream
public H2StreamProcessor getStream(int streamID) { H2StreamProcessor streamProcessor = null; streamProcessor = streamTable.get(streamID); return streamProcessor; }
java
public H2StreamProcessor getStream(int streamID) { H2StreamProcessor streamProcessor = null; streamProcessor = streamTable.get(streamID); return streamProcessor; }
[ "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 @param streamID of the desired stream @return a stream object if it's in the open stream table, or null if the ID is new or has already been removed from the stream table
[ "Get", "the", "stream", "processor", "for", "a", "given", "stream", "ID", "if", "it", "exists" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/h2internal/H2InboundLink.java#L1272-L1277
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/passivator/StatefulPassivator.java
StatefulPassivator.remove
public void remove(BeanId beanId, boolean removeFromFailoverCache) throws RemoteException //LIDB2018-1 { // LIDB2018-1 begins if (ivStatefulFailoverCache == null || !ivStatefulFailoverCache.beanExists(beanId)) { //PK69093 - beanStore.remove will access a file, as such lets synch this call //such that only one file can be open for remove at a time. synchronized (ivRemoveLock) { // failover cache does not exist (e.g. SFSB failover is not enabled) // or SFSB is not in failover cache. Therefore, SFSB must be in // the passivation file for the bean. So remove it from bean store. ivBeanStore.remove(beanId); } } else { // SFSB is in the failover cache, so remove it from failover Cache. if (removeFromFailoverCache) { ivStatefulFailoverCache.removeCacheEntry(beanId); } } // LIDB2018-1 ends }
java
public void remove(BeanId beanId, boolean removeFromFailoverCache) throws RemoteException //LIDB2018-1 { // LIDB2018-1 begins if (ivStatefulFailoverCache == null || !ivStatefulFailoverCache.beanExists(beanId)) { //PK69093 - beanStore.remove will access a file, as such lets synch this call //such that only one file can be open for remove at a time. synchronized (ivRemoveLock) { // failover cache does not exist (e.g. SFSB failover is not enabled) // or SFSB is not in failover cache. Therefore, SFSB must be in // the passivation file for the bean. So remove it from bean store. ivBeanStore.remove(beanId); } } else { // SFSB is in the failover cache, so remove it from failover Cache. if (removeFromFailoverCache) { ivStatefulFailoverCache.removeCacheEntry(beanId); } } // LIDB2018-1 ends }
[ "public", "void", "remove", "(", "BeanId", "beanId", ",", "boolean", "removeFromFailoverCache", ")", "throws", "RemoteException", "//LIDB2018-1", "{", "// LIDB2018-1 begins", "if", "(", "ivStatefulFailoverCache", "==", "null", "||", "!", "ivStatefulFailoverCache", ".", "beanExists", "(", "beanId", ")", ")", "{", "//PK69093 - beanStore.remove will access a file, as such lets synch this call", "//such that only one file can be open for remove at a time.", "synchronized", "(", "ivRemoveLock", ")", "{", "// failover cache does not exist (e.g. SFSB failover is not enabled)", "// or SFSB is not in failover cache. Therefore, SFSB must be in", "// the passivation file for the bean. So remove it from bean store.", "ivBeanStore", ".", "remove", "(", "beanId", ")", ";", "}", "}", "else", "{", "// SFSB is in the failover cache, so remove it from failover Cache.", "if", "(", "removeFromFailoverCache", ")", "{", "ivStatefulFailoverCache", ".", "removeCacheEntry", "(", "beanId", ")", ";", "}", "}", "// LIDB2018-1 ends", "}" ]
Version of remove which can be used with only a beanId passed in as input. @param beanId of the SFSB to be removed. @param removeFromFailoverCache indicates whether or not to remove from failover cache if found in failover cache. Note, the intent is only a timeout or SFSB.remove() call should cause failover cache entry to be removed. Shutdown of server should not cause failover cache entry to be removed. Thus, the caller of this method uses this parameter to indicate whether or not to remove SFSB from local failover cache. @throws RemoteException if a failure occurs removing the bean.
[ "Version", "of", "remove", "which", "can", "be", "used", "with", "only", "a", "beanId", "passed", "in", "as", "input", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/passivator/StatefulPassivator.java#L597-L622
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/passivator/StatefulPassivator.java
StatefulPassivator.getCompressedBytes
private byte[] getCompressedBytes(Object sb, long lastAccessTime, Object exPC) throws IOException // d367572.7 { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "getCompressedBytes", sb); // Serialize SessionBean to a byte[]. ByteArrayOutputStream baos = new ByteArrayOutputStream(1024); GZIPOutputStream gout = new GZIPOutputStream(baos); ObjectOutputStream beanStream2 = createPassivationOutputStream(gout); if (isTraceOn && tc.isDebugEnabled()) //d204278.2 Tr.debug(tc, "writing failover data with last access time set to: " + lastAccessTime); // First write the last access time. beanStream2.writeLong(lastAccessTime); //d204278.2 // Write the persistence context beanStream2.writeObject(exPC); // Now the SFSB data. 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; }
java
private byte[] getCompressedBytes(Object sb, long lastAccessTime, Object exPC) throws IOException // d367572.7 { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "getCompressedBytes", sb); // Serialize SessionBean to a byte[]. ByteArrayOutputStream baos = new ByteArrayOutputStream(1024); GZIPOutputStream gout = new GZIPOutputStream(baos); ObjectOutputStream beanStream2 = createPassivationOutputStream(gout); if (isTraceOn && tc.isDebugEnabled()) //d204278.2 Tr.debug(tc, "writing failover data with last access time set to: " + lastAccessTime); // First write the last access time. beanStream2.writeLong(lastAccessTime); //d204278.2 // Write the persistence context beanStream2.writeObject(exPC); // Now the SFSB data. 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; }
[ "private", "byte", "[", "]", "getCompressedBytes", "(", "Object", "sb", ",", "long", "lastAccessTime", ",", "Object", "exPC", ")", "throws", "IOException", "// d367572.7", "{", "final", "boolean", "isTraceOn", "=", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", ";", "if", "(", "isTraceOn", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"getCompressedBytes\"", ",", "sb", ")", ";", "// Serialize SessionBean to a byte[].", "ByteArrayOutputStream", "baos", "=", "new", "ByteArrayOutputStream", "(", "1024", ")", ";", "GZIPOutputStream", "gout", "=", "new", "GZIPOutputStream", "(", "baos", ")", ";", "ObjectOutputStream", "beanStream2", "=", "createPassivationOutputStream", "(", "gout", ")", ";", "if", "(", "isTraceOn", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "//d204278.2", "Tr", ".", "debug", "(", "tc", ",", "\"writing failover data with last access time set to: \"", "+", "lastAccessTime", ")", ";", "// First write the last access time.", "beanStream2", ".", "writeLong", "(", "lastAccessTime", ")", ";", "//d204278.2", "// Write the persistence context", "beanStream2", ".", "writeObject", "(", "exPC", ")", ";", "// Now the SFSB data.", "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.
[ "LIDB2018", "-", "1", "added", "entire", "method", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/passivator/StatefulPassivator.java#L687-L721
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/passivator/StatefulPassivator.java
StatefulPassivator.getPassivatorFields
public Map<String, Map<String, Field>> getPassivatorFields(final BeanMetaData bmd) // d648122 { // Volatile data race. We do not care if multiple threads do the work // since they will all get the same result. Map<String, Map<String, Field>> result = bmd.ivPassivatorFields; if (result == null) { result = AccessController.doPrivileged(new PrivilegedAction<Map<String, Map<String, Field>>>() { @Override 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; }
java
public Map<String, Map<String, Field>> getPassivatorFields(final BeanMetaData bmd) // d648122 { // Volatile data race. We do not care if multiple threads do the work // since they will all get the same result. Map<String, Map<String, Field>> result = bmd.ivPassivatorFields; if (result == null) { result = AccessController.doPrivileged(new PrivilegedAction<Map<String, Map<String, Field>>>() { @Override 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; }
[ "public", "Map", "<", "String", ",", "Map", "<", "String", ",", "Field", ">", ">", "getPassivatorFields", "(", "final", "BeanMetaData", "bmd", ")", "// d648122", "{", "// Volatile data race. We do not care if multiple threads do the work", "// since they will all get the same result.", "Map", "<", "String", ",", "Map", "<", "String", ",", "Field", ">", ">", "result", "=", "bmd", ".", "ivPassivatorFields", ";", "if", "(", "result", "==", "null", ")", "{", "result", "=", "AccessController", ".", "doPrivileged", "(", "new", "PrivilegedAction", "<", "Map", "<", "String", ",", "Map", "<", "String", ",", "Field", ">", ">", ">", "(", ")", "{", "@", "Override", "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. @param bmd the bean metadata @return the passivator fields
[ "Get", "the", "passivator", "fields", "for", "the", "specified", "bean", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/passivator/StatefulPassivator.java#L791-L822
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/AbstractList.java
AbstractList.removeFirst
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(); }
java
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(); }
[ "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. @param transaction the transaction cotroling the ultimate removal. @return the object removed. @exception java.util.NoSuchElementException if there is nothing in the list or it has already been deleted by some other uncommited transaction. @throws ObjectManagerException.
[ "Remove", "the", "first", "element", "in", "the", "list", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/AbstractList.java#L122-L129
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/NeighbourFlexHandler.java
NeighbourFlexHandler.postProcessMatches
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 security is enabled then we'll do the permissions check if(authorization.isBusSecure()) { if(topicSpace != null && topicSpace.isTopicAccessCheckRequired()) // Bypass security checks { while (itr.hasNext()) { ControllableProxySubscription cps = (ControllableProxySubscription) itr.next(); if(cps.isForeignSecuredProxy()) { // The proxy sub originated in a foreign bus 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])) { // Not authorized to subscribe to topic, need to remove from results if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Not authorized, remove from PSOH results"); itr.remove(); } } catch (Exception e) { // No FFDC code needed } } } } } } else { // Its a glitch and I need to feed this back. } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "postProcessMatches"); }
java
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 security is enabled then we'll do the permissions check if(authorization.isBusSecure()) { if(topicSpace != null && topicSpace.isTopicAccessCheckRequired()) // Bypass security checks { while (itr.hasNext()) { ControllableProxySubscription cps = (ControllableProxySubscription) itr.next(); if(cps.isForeignSecuredProxy()) { // The proxy sub originated in a foreign bus 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])) { // Not authorized to subscribe to topic, need to remove from results if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Not authorized, remove from PSOH results"); itr.remove(); } } catch (Exception e) { // No FFDC code needed } } } } } } else { // Its a glitch and I need to feed this back. } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "postProcessMatches"); }
[ "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 security is enabled then we'll do the permissions check", "if", "(", "authorization", ".", "isBusSecure", "(", ")", ")", "{", "if", "(", "topicSpace", "!=", "null", "&&", "topicSpace", ".", "isTopicAccessCheckRequired", "(", ")", ")", "// Bypass security checks", "{", "while", "(", "itr", ".", "hasNext", "(", ")", ")", "{", "ControllableProxySubscription", "cps", "=", "(", "ControllableProxySubscription", ")", "itr", ".", "next", "(", ")", ";", "if", "(", "cps", ".", "isForeignSecuredProxy", "(", ")", ")", "{", "// The proxy sub originated in a foreign bus", "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", "]", ")", ")", "{", "// Not authorized to subscribe to topic, need to remove from results", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "tc", ",", "\"Not authorized, remove from PSOH results\"", ")", ";", "itr", ".", "remove", "(", ")", ";", "}", "}", "catch", "(", "Exception", "e", ")", "{", "// No FFDC code needed", "}", "}", "}", "}", "}", "}", "else", "{", "// Its a glitch and I need to feed this back. \t", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"postProcessMatches\"", ")", ";", "}" ]
Complete processing of results for this handler after completely traversing MatchSpace. ACL checking takes place at this point. @param results Vector of results for all handlers; results of MatchTarget types whose index is less than that of this MatchTarget type have already been postprocessed. @param index Index in results vector of accumulated results of this MatchTarget type
[ "Complete", "processing", "of", "results", "for", "this", "handler", "after", "completely", "traversing", "MatchSpace", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/NeighbourFlexHandler.java#L111-L173
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/JsAdminFactory.java
JsAdminFactory.createInstance
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); // TODO: HIGH: Is this the correct error? throw e; } if (tc.isEntryEnabled()) SibTr.exit(tc, "createInstance"); }
java
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); // TODO: HIGH: Is this the correct error? throw e; } if (tc.isEntryEnabled()) SibTr.exit(tc, "createInstance"); }
[ "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", ")", ";", "// TODO: HIGH: Is this the correct error?", "throw", "e", ";", "}", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"createInstance\"", ")", ";", "}" ]
Create the singleton instance of this factory class @throws Exception
[ "Create", "the", "singleton", "instance", "of", "this", "factory", "class" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/JsAdminFactory.java#L59-L75
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/BifurcatedConsumerSessionProxy.java
BifurcatedConsumerSessionProxy.readSet
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) { // No FFDC Code needed } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "readSet"); return messages; }
java
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) { // No FFDC Code needed } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "readSet"); return messages; }
[ "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", ")", "{", "// No FFDC Code needed", "}", "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. @param msgHandles An array of message ids that denote the messages to be read. @return Returns an array of SIBusMessages @throws com.ibm.wsspi.sib.core.exception.SISessionUnavailableException @throws com.ibm.wsspi.sib.core.exception.SISessionDroppedException @throws com.ibm.wsspi.sib.core.exception.SIConnectionUnavailableException @throws com.ibm.wsspi.sib.core.exception.SIConnectionDroppedException @throws com.ibm.websphere.sib.exception.SIResourceException @throws com.ibm.wsspi.sib.core.exception.SIConnectionLostException @throws com.ibm.websphere.sib.exception.SIIncorrectCallException @throws com.ibm.wsspi.sib.core.exception.SIMessageNotLockedException @throws com.ibm.websphere.sib.exception.SIErrorException
[ "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", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/BifurcatedConsumerSessionProxy.java#L261-L337
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/BifurcatedConsumerSessionProxy.java
BifurcatedConsumerSessionProxy.readAndDeleteSet
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(); // Now we need to synchronise on the transaction object if there is one. if (tran != null) { synchronized (tran) { // Check transaction is in a valid state. // Enlisted for an XA UOW and not rolledback or // completed for a local transaction. 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) { // No FFDC Code needed } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "readAndDeleteSet"); return messages; }
java
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(); // Now we need to synchronise on the transaction object if there is one. if (tran != null) { synchronized (tran) { // Check transaction is in a valid state. // Enlisted for an XA UOW and not rolledback or // completed for a local transaction. 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) { // No FFDC Code needed } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "readAndDeleteSet"); return messages; }
[ "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", "(", ")", ";", "// Now we need to synchronise on the transaction object if there is one.", "if", "(", "tran", "!=", "null", ")", "{", "synchronized", "(", "tran", ")", "{", "// Check transaction is in a valid state.", "// Enlisted for an XA UOW and not rolledback or", "// completed for a local transaction.", "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", ")", "{", "// No FFDC Code needed", "}", "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. @param msgHandles An array of message ids that denote the messages to be read and then deleted. @param tran The transaction to which the delete should be performed. @return Returns an array of SIBusMessages @throws com.ibm.wsspi.sib.core.exception.SISessionUnavailableException @throws com.ibm.wsspi.sib.core.exception.SISessionDroppedException @throws com.ibm.wsspi.sib.core.exception.SIConnectionUnavailableException @throws com.ibm.wsspi.sib.core.exception.SIConnectionDroppedException @throws com.ibm.websphere.sib.exception.SIResourceException @throws com.ibm.wsspi.sib.core.exception.SIConnectionLostException @throws com.ibm.wsspi.sib.core.exception.SILimitExceededException @throws com.ibm.websphere.sib.exception.SIIncorrectCallException @throws com.ibm.wsspi.sib.core.exception.SIMessageNotLockedException @throws com.ibm.websphere.sib.exception.SIErrorException
[ "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", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/BifurcatedConsumerSessionProxy.java#L360-L419
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/BifurcatedConsumerSessionProxy.java
BifurcatedConsumerSessionProxy._readAndDeleteSet
private 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 }); // 531458 Allow minimal tracing to include message ids and tran id if (TraceComponent.isAnyTracingEnabled()) { CommsLightTrace.traceMessageIds(tc, "ReadAndDeleteSetMsgTrace", msgHandles); } SIBusMessage[] messages = null; CommsByteBuffer request = getCommsByteBuffer(); request.putShort(getConnectionObjectID()); request.putShort(getProxyID()); request.putSITransaction(tran); request.putSIMessageHandles(msgHandles); CommsByteBuffer reply = jfapExchange(request, JFapChannelConstants.SEG_READ_AND_DELETE_SET, JFapChannelConstants.PRIORITY_MEDIUM, true); try { short err = reply.getCommandCompletionCode(JFapChannelConstants.SEG_READ_AND_DELETE_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_SILimitExceededException(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); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "_readAndDeleteSet", messages); return messages; }
java
private 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 }); // 531458 Allow minimal tracing to include message ids and tran id if (TraceComponent.isAnyTracingEnabled()) { CommsLightTrace.traceMessageIds(tc, "ReadAndDeleteSetMsgTrace", msgHandles); } SIBusMessage[] messages = null; CommsByteBuffer request = getCommsByteBuffer(); request.putShort(getConnectionObjectID()); request.putShort(getProxyID()); request.putSITransaction(tran); request.putSIMessageHandles(msgHandles); CommsByteBuffer reply = jfapExchange(request, JFapChannelConstants.SEG_READ_AND_DELETE_SET, JFapChannelConstants.PRIORITY_MEDIUM, true); try { short err = reply.getCommandCompletionCode(JFapChannelConstants.SEG_READ_AND_DELETE_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_SILimitExceededException(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); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "_readAndDeleteSet", messages); return messages; }
[ "private", "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", "}", ")", ";", "// 531458 Allow minimal tracing to include message ids and tran id", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", ")", "{", "CommsLightTrace", ".", "traceMessageIds", "(", "tc", ",", "\"ReadAndDeleteSetMsgTrace\"", ",", "msgHandles", ")", ";", "}", "SIBusMessage", "[", "]", "messages", "=", "null", ";", "CommsByteBuffer", "request", "=", "getCommsByteBuffer", "(", ")", ";", "request", ".", "putShort", "(", "getConnectionObjectID", "(", ")", ")", ";", "request", ".", "putShort", "(", "getProxyID", "(", ")", ")", ";", "request", ".", "putSITransaction", "(", "tran", ")", ";", "request", ".", "putSIMessageHandles", "(", "msgHandles", ")", ";", "CommsByteBuffer", "reply", "=", "jfapExchange", "(", "request", ",", "JFapChannelConstants", ".", "SEG_READ_AND_DELETE_SET", ",", "JFapChannelConstants", ".", "PRIORITY_MEDIUM", ",", "true", ")", ";", "try", "{", "short", "err", "=", "reply", ".", "getCommandCompletionCode", "(", "JFapChannelConstants", ".", "SEG_READ_AND_DELETE_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_SILimitExceededException", "(", "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", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"_readAndDeleteSet\"", ",", "messages", ")", ";", "return", "messages", ";", "}" ]
Actually performs the read and delete. @param msgHandles @param tran @return Returns the requested messages. @throws SISessionUnavailableException @throws SISessionDroppedException @throws SIConnectionUnavailableException @throws SIConnectionDroppedException @throws SIResourceException @throws SIConnectionLostException @throws SILimitExceededException @throws SIIncorrectCallException @throws SIMessageNotLockedException @throws SIErrorException
[ "Actually", "performs", "the", "read", "and", "delete", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/BifurcatedConsumerSessionProxy.java#L440-L506
train
OpenLiberty/open-liberty
dev/com.ibm.websphere.security.wim.base/src/com/ibm/websphere/security/wim/ras/WIMMessageHelper.java
WIMMessageHelper.generateMsgParms
public static Object[] generateMsgParms(Object parm1, Object parm2, Object parm3, Object parm4, Object parm5, Object parm6, Object parm7) { Object parms[] = new Object[7]; parms[0] = parm1; parms[1] = parm2; parms[2] = parm3; parms[3] = parm4; parms[4] = parm5; parms[5] = parm6; parms[6] = parm7; return parms; }
java
public static Object[] generateMsgParms(Object parm1, Object parm2, Object parm3, Object parm4, Object parm5, Object parm6, Object parm7) { Object parms[] = new Object[7]; parms[0] = parm1; parms[1] = parm2; parms[2] = parm3; parms[3] = parm4; parms[4] = parm5; parms[5] = parm6; parms[6] = parm7; return parms; }
[ "public", "static", "Object", "[", "]", "generateMsgParms", "(", "Object", "parm1", ",", "Object", "parm2", ",", "Object", "parm3", ",", "Object", "parm4", ",", "Object", "parm5", ",", "Object", "parm6", ",", "Object", "parm7", ")", "{", "Object", "parms", "[", "]", "=", "new", "Object", "[", "7", "]", ";", "parms", "[", "0", "]", "=", "parm1", ";", "parms", "[", "1", "]", "=", "parm2", ";", "parms", "[", "2", "]", "=", "parm3", ";", "parms", "[", "3", "]", "=", "parm4", ";", "parms", "[", "4", "]", "=", "parm5", ";", "parms", "[", "5", "]", "=", "parm6", ";", "parms", "[", "6", "]", "=", "parm7", ";", "return", "parms", ";", "}" ]
Create an object array to be used as parameters to be passed to a message. @param parm1 Value of the first parameter to be substituted into the message text. @param parm2 Value of the second parameter to be substituted into the message text. @param parm3 Value of the third parameter to be substituted into the message text. @param parm4 Value of the fourth parameter to be substituted into the message text. @param parm5 Value of the fifth parameter to be substituted into the message text. @param parm6 Value of the sixth parameter to be substituted into the message text. @param parm7 Value of the seventh parameter to be substituted into the message text. *
[ "Create", "an", "object", "array", "to", "be", "used", "as", "parameters", "to", "be", "passed", "to", "a", "message", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.security.wim.base/src/com/ibm/websphere/security/wim/ras/WIMMessageHelper.java#L137-L148
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/metadata/ejb/ByteCodeMetaData.java
ByteCodeMetaData.scan
private void scan() { if (ivScanned) { return; } ivScanned = true; final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); for (Class<?> klass = ivClass; klass != null && klass != Object.class; klass = klass.getSuperclass()) { if (isTraceOn && (tc.isDebugEnabled() || tcMetaData.isDebugEnabled())) Tr.debug(tc.isDebugEnabled() ? tc : tcMetaData, "scanning " + klass.getName()); ivCurrentClassName = klass.getName(); ivCurrentPrivateMethodMetaData = null; ClassLoader classLoader = klass.getClassLoader(); if (classLoader == null) { classLoader = getBootClassLoader(); // d742751 } String resourceName = klass.getName().replace('.', '/') + ".class"; InputStream input = classLoader.getResourceAsStream(resourceName); if (input == null) // d728537 { if (isTraceOn && (tc.isDebugEnabled() || tcMetaData.isDebugEnabled())) Tr.debug(tc.isDebugEnabled() ? tc : tcMetaData, "failed to find " + resourceName + " from " + classLoader); ivScanException = new FileNotFoundException(resourceName); return; } try { ClassReader classReader = new ClassReader(input); classReader.accept(this, ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES); } // If the class is malformed, ASM might throw any exception. d728537 catch (Throwable t) { FFDCFilter.processException(t, CLASS_NAME + ".scan", "168", this, new Object[] { resourceName, klass, classLoader }); if (isTraceOn && (tc.isDebugEnabled() || tcMetaData.isDebugEnabled())) Tr.debug(tc.isDebugEnabled() ? tc : tcMetaData, "scan exception", t); ivScanException = t; return; } finally { try { input.close(); } catch (IOException ex) { if (isTraceOn && tc.isDebugEnabled()) Tr.debug(tc, "error closing input stream", ex); } } } }
java
private void scan() { if (ivScanned) { return; } ivScanned = true; final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); for (Class<?> klass = ivClass; klass != null && klass != Object.class; klass = klass.getSuperclass()) { if (isTraceOn && (tc.isDebugEnabled() || tcMetaData.isDebugEnabled())) Tr.debug(tc.isDebugEnabled() ? tc : tcMetaData, "scanning " + klass.getName()); ivCurrentClassName = klass.getName(); ivCurrentPrivateMethodMetaData = null; ClassLoader classLoader = klass.getClassLoader(); if (classLoader == null) { classLoader = getBootClassLoader(); // d742751 } String resourceName = klass.getName().replace('.', '/') + ".class"; InputStream input = classLoader.getResourceAsStream(resourceName); if (input == null) // d728537 { if (isTraceOn && (tc.isDebugEnabled() || tcMetaData.isDebugEnabled())) Tr.debug(tc.isDebugEnabled() ? tc : tcMetaData, "failed to find " + resourceName + " from " + classLoader); ivScanException = new FileNotFoundException(resourceName); return; } try { ClassReader classReader = new ClassReader(input); classReader.accept(this, ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES); } // If the class is malformed, ASM might throw any exception. d728537 catch (Throwable t) { FFDCFilter.processException(t, CLASS_NAME + ".scan", "168", this, new Object[] { resourceName, klass, classLoader }); if (isTraceOn && (tc.isDebugEnabled() || tcMetaData.isDebugEnabled())) Tr.debug(tc.isDebugEnabled() ? tc : tcMetaData, "scan exception", t); ivScanException = t; return; } finally { try { input.close(); } catch (IOException ex) { if (isTraceOn && tc.isDebugEnabled()) Tr.debug(tc, "error closing input stream", ex); } } } }
[ "private", "void", "scan", "(", ")", "{", "if", "(", "ivScanned", ")", "{", "return", ";", "}", "ivScanned", "=", "true", ";", "final", "boolean", "isTraceOn", "=", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", ";", "for", "(", "Class", "<", "?", ">", "klass", "=", "ivClass", ";", "klass", "!=", "null", "&&", "klass", "!=", "Object", ".", "class", ";", "klass", "=", "klass", ".", "getSuperclass", "(", ")", ")", "{", "if", "(", "isTraceOn", "&&", "(", "tc", ".", "isDebugEnabled", "(", ")", "||", "tcMetaData", ".", "isDebugEnabled", "(", ")", ")", ")", "Tr", ".", "debug", "(", "tc", ".", "isDebugEnabled", "(", ")", "?", "tc", ":", "tcMetaData", ",", "\"scanning \"", "+", "klass", ".", "getName", "(", ")", ")", ";", "ivCurrentClassName", "=", "klass", ".", "getName", "(", ")", ";", "ivCurrentPrivateMethodMetaData", "=", "null", ";", "ClassLoader", "classLoader", "=", "klass", ".", "getClassLoader", "(", ")", ";", "if", "(", "classLoader", "==", "null", ")", "{", "classLoader", "=", "getBootClassLoader", "(", ")", ";", "// d742751", "}", "String", "resourceName", "=", "klass", ".", "getName", "(", ")", ".", "replace", "(", "'", "'", ",", "'", "'", ")", "+", "\".class\"", ";", "InputStream", "input", "=", "classLoader", ".", "getResourceAsStream", "(", "resourceName", ")", ";", "if", "(", "input", "==", "null", ")", "// d728537", "{", "if", "(", "isTraceOn", "&&", "(", "tc", ".", "isDebugEnabled", "(", ")", "||", "tcMetaData", ".", "isDebugEnabled", "(", ")", ")", ")", "Tr", ".", "debug", "(", "tc", ".", "isDebugEnabled", "(", ")", "?", "tc", ":", "tcMetaData", ",", "\"failed to find \"", "+", "resourceName", "+", "\" from \"", "+", "classLoader", ")", ";", "ivScanException", "=", "new", "FileNotFoundException", "(", "resourceName", ")", ";", "return", ";", "}", "try", "{", "ClassReader", "classReader", "=", "new", "ClassReader", "(", "input", ")", ";", "classReader", ".", "accept", "(", "this", ",", "ClassReader", ".", "SKIP_DEBUG", "|", "ClassReader", ".", "SKIP_FRAMES", ")", ";", "}", "// If the class is malformed, ASM might throw any exception. d728537", "catch", "(", "Throwable", "t", ")", "{", "FFDCFilter", ".", "processException", "(", "t", ",", "CLASS_NAME", "+", "\".scan\"", ",", "\"168\"", ",", "this", ",", "new", "Object", "[", "]", "{", "resourceName", ",", "klass", ",", "classLoader", "}", ")", ";", "if", "(", "isTraceOn", "&&", "(", "tc", ".", "isDebugEnabled", "(", ")", "||", "tcMetaData", ".", "isDebugEnabled", "(", ")", ")", ")", "Tr", ".", "debug", "(", "tc", ".", "isDebugEnabled", "(", ")", "?", "tc", ":", "tcMetaData", ",", "\"scan exception\"", ",", "t", ")", ";", "ivScanException", "=", "t", ";", "return", ";", "}", "finally", "{", "try", "{", "input", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "ex", ")", "{", "if", "(", "isTraceOn", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"error closing input stream\"", ",", "ex", ")", ";", "}", "}", "}", "}" ]
Scan the bytecode of all classes in the hierarchy unless already done.
[ "Scan", "the", "bytecode", "of", "all", "classes", "in", "the", "hierarchy", "unless", "already", "done", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/metadata/ejb/ByteCodeMetaData.java#L134-L192
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/metadata/ejb/ByteCodeMetaData.java
ByteCodeMetaData.getBridgeMethodTarget
public Method getBridgeMethodTarget(Method method) { scan(); if (ivBridgeMethodMetaData == null) { return null; } BridgeMethodMetaData md = ivBridgeMethodMetaData.get(getNonPrivateMethodKey(method)); return md == null ? null : md.ivTarget; }
java
public Method getBridgeMethodTarget(Method method) { scan(); if (ivBridgeMethodMetaData == null) { return null; } BridgeMethodMetaData md = ivBridgeMethodMetaData.get(getNonPrivateMethodKey(method)); return md == null ? null : md.ivTarget; }
[ "public", "Method", "getBridgeMethodTarget", "(", "Method", "method", ")", "{", "scan", "(", ")", ";", "if", "(", "ivBridgeMethodMetaData", "==", "null", ")", "{", "return", "null", ";", "}", "BridgeMethodMetaData", "md", "=", "ivBridgeMethodMetaData", ".", "get", "(", "getNonPrivateMethodKey", "(", "method", ")", ")", ";", "return", "md", "==", "null", "?", "null", ":", "md", ".", "ivTarget", ";", "}" ]
Get the target method of a bridge method, or null if not found @param method the bridge method (Modifiers.isBridge returns true)
[ "Get", "the", "target", "method", "of", "a", "bridge", "method", "or", "null", "if", "not", "found" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/metadata/ejb/ByteCodeMetaData.java#L206-L215
train
OpenLiberty/open-liberty
dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/impl/ExceptionMatcher.java
ExceptionMatcher.isInElementSet
public boolean isInElementSet(Set<String> skipList, Class<?> excClass) throws ClassNotFoundException { //String mName = "isInElementSet(Set<String> skipList, Class<?> excClass)"; boolean retVal = false; ClassLoader tccl = Thread.currentThread().getContextClassLoader(); for(String value : skipList) { Class<?> clazz = tccl.loadClass(value); if(clazz.isAssignableFrom(excClass)) { retVal = true; break; } } return retVal; }
java
public boolean isInElementSet(Set<String> skipList, Class<?> excClass) throws ClassNotFoundException { //String mName = "isInElementSet(Set<String> skipList, Class<?> excClass)"; boolean retVal = false; ClassLoader tccl = Thread.currentThread().getContextClassLoader(); for(String value : skipList) { Class<?> clazz = tccl.loadClass(value); if(clazz.isAssignableFrom(excClass)) { retVal = true; break; } } return retVal; }
[ "public", "boolean", "isInElementSet", "(", "Set", "<", "String", ">", "skipList", ",", "Class", "<", "?", ">", "excClass", ")", "throws", "ClassNotFoundException", "{", "//String mName = \"isInElementSet(Set<String> skipList, Class<?> excClass)\";", "boolean", "retVal", "=", "false", ";", "ClassLoader", "tccl", "=", "Thread", ".", "currentThread", "(", ")", ".", "getContextClassLoader", "(", ")", ";", "for", "(", "String", "value", ":", "skipList", ")", "{", "Class", "<", "?", ">", "clazz", "=", "tccl", ".", "loadClass", "(", "value", ")", ";", "if", "(", "clazz", ".", "isAssignableFrom", "(", "excClass", ")", ")", "{", "retVal", "=", "true", ";", "break", ";", "}", "}", "return", "retVal", ";", "}" ]
Determines if the given exception is a subclass of an element @param skipList - Set of elements @param excClass - The thrown exception @return True or False if skipList contains an element that is a superclass of the thrown exception @throws ClassNotFoundException
[ "Determines", "if", "the", "given", "exception", "is", "a", "subclass", "of", "an", "element" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/impl/ExceptionMatcher.java#L91-L103
train
OpenLiberty/open-liberty
dev/com.ibm.ws.httpservice/src/com/ibm/ws/httpsvc/session/internal/SessionConfig.java
SessionConfig.updated
public void updated(Dictionary<?, ?> props) { String value = (String) props.get(PROP_IDNAME); if (null != value) { this.idName = value.trim(); } value = (String) props.get(PROP_USE_URLS); if (null != value && Boolean.parseBoolean(value.trim())) { this.urlRewritingMarker = ";" + getIDName() + "=" + getSessionVersion(); } value = (String) props.get(PROP_USE_COOKIES); if (null != value) { this.enableCookies = Boolean.parseBoolean(value.trim()); } if (this.enableCookies) { // we're using cookies for session information value = (String) props.get(PROP_COOKIE_SECURE); if (null != value) { this.cookieSecure = Boolean.parseBoolean(value.trim()); } value = (String) props.get(PROP_COOKIE_PATH); if (null != value) { this.cookiePath = value.trim(); } value = (String) props.get(PROP_COOKIE_DOMAIN); if (null != value) { this.cookieDomain = value.trim(); } value = (String) props.get(PROP_COOKIE_MAXAGE); if (null != value) { try { this.cookieMaxAge = Integer.parseInt(value.trim()); } catch (NumberFormatException nfe) { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "Ignoring incorrect max-age [" + value + "]", nfe.getMessage()); } } } } if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "Config: id name [" + this.idName + "]"); if (isURLRewriting()) { Tr.event(tc, "Config: use URL rewriting [" + this.urlRewritingMarker + "]"); } if (this.enableCookies) { Tr.event(tc, "Config: cookie max-age [" + this.cookieMaxAge + "]"); Tr.event(tc, "Config: cookie secure [" + this.cookieSecure + "]"); Tr.event(tc, "Config: cookie domain [" + this.cookieDomain + "]"); Tr.event(tc, "Config: cookie path [" + this.cookiePath + "]"); } else { Tr.event(tc, "Config: cookies disabled"); } } }
java
public void updated(Dictionary<?, ?> props) { String value = (String) props.get(PROP_IDNAME); if (null != value) { this.idName = value.trim(); } value = (String) props.get(PROP_USE_URLS); if (null != value && Boolean.parseBoolean(value.trim())) { this.urlRewritingMarker = ";" + getIDName() + "=" + getSessionVersion(); } value = (String) props.get(PROP_USE_COOKIES); if (null != value) { this.enableCookies = Boolean.parseBoolean(value.trim()); } if (this.enableCookies) { // we're using cookies for session information value = (String) props.get(PROP_COOKIE_SECURE); if (null != value) { this.cookieSecure = Boolean.parseBoolean(value.trim()); } value = (String) props.get(PROP_COOKIE_PATH); if (null != value) { this.cookiePath = value.trim(); } value = (String) props.get(PROP_COOKIE_DOMAIN); if (null != value) { this.cookieDomain = value.trim(); } value = (String) props.get(PROP_COOKIE_MAXAGE); if (null != value) { try { this.cookieMaxAge = Integer.parseInt(value.trim()); } catch (NumberFormatException nfe) { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "Ignoring incorrect max-age [" + value + "]", nfe.getMessage()); } } } } if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "Config: id name [" + this.idName + "]"); if (isURLRewriting()) { Tr.event(tc, "Config: use URL rewriting [" + this.urlRewritingMarker + "]"); } if (this.enableCookies) { Tr.event(tc, "Config: cookie max-age [" + this.cookieMaxAge + "]"); Tr.event(tc, "Config: cookie secure [" + this.cookieSecure + "]"); Tr.event(tc, "Config: cookie domain [" + this.cookieDomain + "]"); Tr.event(tc, "Config: cookie path [" + this.cookiePath + "]"); } else { Tr.event(tc, "Config: cookies disabled"); } } }
[ "public", "void", "updated", "(", "Dictionary", "<", "?", ",", "?", ">", "props", ")", "{", "String", "value", "=", "(", "String", ")", "props", ".", "get", "(", "PROP_IDNAME", ")", ";", "if", "(", "null", "!=", "value", ")", "{", "this", ".", "idName", "=", "value", ".", "trim", "(", ")", ";", "}", "value", "=", "(", "String", ")", "props", ".", "get", "(", "PROP_USE_URLS", ")", ";", "if", "(", "null", "!=", "value", "&&", "Boolean", ".", "parseBoolean", "(", "value", ".", "trim", "(", ")", ")", ")", "{", "this", ".", "urlRewritingMarker", "=", "\";\"", "+", "getIDName", "(", ")", "+", "\"=\"", "+", "getSessionVersion", "(", ")", ";", "}", "value", "=", "(", "String", ")", "props", ".", "get", "(", "PROP_USE_COOKIES", ")", ";", "if", "(", "null", "!=", "value", ")", "{", "this", ".", "enableCookies", "=", "Boolean", ".", "parseBoolean", "(", "value", ".", "trim", "(", ")", ")", ";", "}", "if", "(", "this", ".", "enableCookies", ")", "{", "// we're using cookies for session information", "value", "=", "(", "String", ")", "props", ".", "get", "(", "PROP_COOKIE_SECURE", ")", ";", "if", "(", "null", "!=", "value", ")", "{", "this", ".", "cookieSecure", "=", "Boolean", ".", "parseBoolean", "(", "value", ".", "trim", "(", ")", ")", ";", "}", "value", "=", "(", "String", ")", "props", ".", "get", "(", "PROP_COOKIE_PATH", ")", ";", "if", "(", "null", "!=", "value", ")", "{", "this", ".", "cookiePath", "=", "value", ".", "trim", "(", ")", ";", "}", "value", "=", "(", "String", ")", "props", ".", "get", "(", "PROP_COOKIE_DOMAIN", ")", ";", "if", "(", "null", "!=", "value", ")", "{", "this", ".", "cookieDomain", "=", "value", ".", "trim", "(", ")", ";", "}", "value", "=", "(", "String", ")", "props", ".", "get", "(", "PROP_COOKIE_MAXAGE", ")", ";", "if", "(", "null", "!=", "value", ")", "{", "try", "{", "this", ".", "cookieMaxAge", "=", "Integer", ".", "parseInt", "(", "value", ".", "trim", "(", ")", ")", ";", "}", "catch", "(", "NumberFormatException", "nfe", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEventEnabled", "(", ")", ")", "{", "Tr", ".", "event", "(", "tc", ",", "\"Ignoring incorrect max-age [\"", "+", "value", "+", "\"]\"", ",", "nfe", ".", "getMessage", "(", ")", ")", ";", "}", "}", "}", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEventEnabled", "(", ")", ")", "{", "Tr", ".", "event", "(", "tc", ",", "\"Config: id name [\"", "+", "this", ".", "idName", "+", "\"]\"", ")", ";", "if", "(", "isURLRewriting", "(", ")", ")", "{", "Tr", ".", "event", "(", "tc", ",", "\"Config: use URL rewriting [\"", "+", "this", ".", "urlRewritingMarker", "+", "\"]\"", ")", ";", "}", "if", "(", "this", ".", "enableCookies", ")", "{", "Tr", ".", "event", "(", "tc", ",", "\"Config: cookie max-age [\"", "+", "this", ".", "cookieMaxAge", "+", "\"]\"", ")", ";", "Tr", ".", "event", "(", "tc", ",", "\"Config: cookie secure [\"", "+", "this", ".", "cookieSecure", "+", "\"]\"", ")", ";", "Tr", ".", "event", "(", "tc", ",", "\"Config: cookie domain [\"", "+", "this", ".", "cookieDomain", "+", "\"]\"", ")", ";", "Tr", ".", "event", "(", "tc", ",", "\"Config: cookie path [\"", "+", "this", ".", "cookiePath", "+", "\"]\"", ")", ";", "}", "else", "{", "Tr", ".", "event", "(", "tc", ",", "\"Config: cookies disabled\"", ")", ";", "}", "}", "}" ]
Session configuration has been updated with the provided properties. @param props
[ "Session", "configuration", "has", "been", "updated", "with", "the", "provided", "properties", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.httpservice/src/com/ibm/ws/httpsvc/session/internal/SessionConfig.java#L71-L125
train
OpenLiberty/open-liberty
dev/com.ibm.ws.clientcontainer.remote.common/src/com/ibm/ws/clientcontainer/remote/common/internal/ClientSupportFactoryImpl.java
ClientSupportFactoryImpl.run
@Trivial @Override public synchronized void run() { clientSupport = null; if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "run : cached ClientSupport reference cleared"); } }
java
@Trivial @Override public synchronized void run() { clientSupport = null; if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "run : cached ClientSupport reference cleared"); } }
[ "@", "Trivial", "@", "Override", "public", "synchronized", "void", "run", "(", ")", "{", "clientSupport", "=", "null", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"run : cached ClientSupport reference cleared\"", ")", ";", "}", "}" ]
Scheduled Runnable implementation to reset the ClientSupport so that it will be obtained again later, in case the server is restarted.
[ "Scheduled", "Runnable", "implementation", "to", "reset", "the", "ClientSupport", "so", "that", "it", "will", "be", "obtained", "again", "later", "in", "case", "the", "server", "is", "restarted", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.clientcontainer.remote.common/src/com/ibm/ws/clientcontainer/remote/common/internal/ClientSupportFactoryImpl.java#L140-L147
train
OpenLiberty/open-liberty
dev/com.ibm.ws.security.jaspic/src/com/ibm/ws/security/jaspi/JaspiRequest.java
JaspiRequest.isProtected
public boolean isProtected() { List<String> requiredRoles = null; return !webRequest.isUnprotectedURI() && webRequest.getMatchResponse() != null && (requiredRoles = webRequest.getRequiredRoles()) != null && !requiredRoles.isEmpty(); }
java
public boolean isProtected() { List<String> requiredRoles = null; return !webRequest.isUnprotectedURI() && webRequest.getMatchResponse() != null && (requiredRoles = webRequest.getRequiredRoles()) != null && !requiredRoles.isEmpty(); }
[ "public", "boolean", "isProtected", "(", ")", "{", "List", "<", "String", ">", "requiredRoles", "=", "null", ";", "return", "!", "webRequest", ".", "isUnprotectedURI", "(", ")", "&&", "webRequest", ".", "getMatchResponse", "(", ")", "!=", "null", "&&", "(", "requiredRoles", "=", "webRequest", ".", "getRequiredRoles", "(", ")", ")", "!=", "null", "&&", "!", "requiredRoles", ".", "isEmpty", "(", ")", ";", "}" ]
The request is protected if there are required roles or it's not mapped everyones role @return true if there is a proected url.
[ "The", "request", "is", "protected", "if", "there", "are", "required", "roles", "or", "it", "s", "not", "mapped", "everyones", "role" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.jaspic/src/com/ibm/ws/security/jaspi/JaspiRequest.java#L121-L127
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jaxrs.2.0.server/src/com/ibm/ws/jaxrs20/server/LibertyJaxRsInvoker.java
LibertyJaxRsInvoker.performInvocation
@Override protected Object performInvocation(Exchange exchange, Object serviceObject, Method m, Object[] paramArray) throws Exception { paramArray = insertExchange(m, paramArray, exchange); return this.libertyJaxRsServerFactoryBean.performInvocation(exchange, serviceObject, m, paramArray); }
java
@Override protected Object performInvocation(Exchange exchange, Object serviceObject, Method m, Object[] paramArray) throws Exception { paramArray = insertExchange(m, paramArray, exchange); return this.libertyJaxRsServerFactoryBean.performInvocation(exchange, serviceObject, m, paramArray); }
[ "@", "Override", "protected", "Object", "performInvocation", "(", "Exchange", "exchange", ",", "Object", "serviceObject", ",", "Method", "m", ",", "Object", "[", "]", "paramArray", ")", "throws", "Exception", "{", "paramArray", "=", "insertExchange", "(", "m", ",", "paramArray", ",", "exchange", ")", ";", "return", "this", ".", "libertyJaxRsServerFactoryBean", ".", "performInvocation", "(", "exchange", ",", "serviceObject", ",", "m", ",", "paramArray", ")", ";", "}" ]
using LibertyJaxRsServerFactoryBean.performInvocation to support POJO, EJB, CDI resource
[ "using", "LibertyJaxRsServerFactoryBean", ".", "performInvocation", "to", "support", "POJO", "EJB", "CDI", "resource" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxrs.2.0.server/src/com/ibm/ws/jaxrs20/server/LibertyJaxRsInvoker.java#L157-L161
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jaxrs.2.0.server/src/com/ibm/ws/jaxrs20/server/LibertyJaxRsInvoker.java
LibertyJaxRsInvoker.callValidationMethod
@FFDCIgnore(value = { SecurityException.class, IllegalAccessException.class, IllegalArgumentException.class, InvocationTargetException.class }) private void callValidationMethod(String methodName, Object[] paramValues, Object theProvider) { if (theProvider == null) { return; } Method m = cxfBeanValidationProviderMethodsMap.get(methodName); if (m == null) { return; } try { m.invoke(theProvider, paramValues); } catch (SecurityException e) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Can't access the method \"" + m.getName() + "\" due to security issue." + e.getMessage()); } } catch (IllegalAccessException e) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Can't access the method \"" + m.getName() + "\"." + e.getMessage()); } } catch (IllegalArgumentException e) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Illegal argument to the method \"" + m.getName() + "\"." + e.getMessage()); } } catch (InvocationTargetException e) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Invocation of the method \"" + m.getName() + "\" fails" + e.getMessage()); } /** * throw the javax.validation.ValidationException to keep the same behavior as CXF expected */ Throwable validationException = e.getTargetException(); if (null != validationException && validationException instanceof RuntimeException) { throw (RuntimeException) validationException; } } }
java
@FFDCIgnore(value = { SecurityException.class, IllegalAccessException.class, IllegalArgumentException.class, InvocationTargetException.class }) private void callValidationMethod(String methodName, Object[] paramValues, Object theProvider) { if (theProvider == null) { return; } Method m = cxfBeanValidationProviderMethodsMap.get(methodName); if (m == null) { return; } try { m.invoke(theProvider, paramValues); } catch (SecurityException e) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Can't access the method \"" + m.getName() + "\" due to security issue." + e.getMessage()); } } catch (IllegalAccessException e) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Can't access the method \"" + m.getName() + "\"." + e.getMessage()); } } catch (IllegalArgumentException e) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Illegal argument to the method \"" + m.getName() + "\"." + e.getMessage()); } } catch (InvocationTargetException e) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Invocation of the method \"" + m.getName() + "\" fails" + e.getMessage()); } /** * throw the javax.validation.ValidationException to keep the same behavior as CXF expected */ Throwable validationException = e.getTargetException(); if (null != validationException && validationException instanceof RuntimeException) { throw (RuntimeException) validationException; } } }
[ "@", "FFDCIgnore", "(", "value", "=", "{", "SecurityException", ".", "class", ",", "IllegalAccessException", ".", "class", ",", "IllegalArgumentException", ".", "class", ",", "InvocationTargetException", ".", "class", "}", ")", "private", "void", "callValidationMethod", "(", "String", "methodName", ",", "Object", "[", "]", "paramValues", ",", "Object", "theProvider", ")", "{", "if", "(", "theProvider", "==", "null", ")", "{", "return", ";", "}", "Method", "m", "=", "cxfBeanValidationProviderMethodsMap", ".", "get", "(", "methodName", ")", ";", "if", "(", "m", "==", "null", ")", "{", "return", ";", "}", "try", "{", "m", ".", "invoke", "(", "theProvider", ",", "paramValues", ")", ";", "}", "catch", "(", "SecurityException", "e", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"Can't access the method \\\"\"", "+", "m", ".", "getName", "(", ")", "+", "\"\\\" due to security issue.\"", "+", "e", ".", "getMessage", "(", ")", ")", ";", "}", "}", "catch", "(", "IllegalAccessException", "e", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"Can't access the method \\\"\"", "+", "m", ".", "getName", "(", ")", "+", "\"\\\".\"", "+", "e", ".", "getMessage", "(", ")", ")", ";", "}", "}", "catch", "(", "IllegalArgumentException", "e", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"Illegal argument to the method \\\"\"", "+", "m", ".", "getName", "(", ")", "+", "\"\\\".\"", "+", "e", ".", "getMessage", "(", ")", ")", ";", "}", "}", "catch", "(", "InvocationTargetException", "e", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"Invocation of the method \\\"\"", "+", "m", ".", "getName", "(", ")", "+", "\"\\\" fails\"", "+", "e", ".", "getMessage", "(", ")", ")", ";", "}", "/**\n * throw the javax.validation.ValidationException to keep the same behavior as CXF expected\n */", "Throwable", "validationException", "=", "e", ".", "getTargetException", "(", ")", ";", "if", "(", "null", "!=", "validationException", "&&", "validationException", "instanceof", "RuntimeException", ")", "{", "throw", "(", "RuntimeException", ")", "validationException", ";", "}", "}", "}" ]
call validation method ignore the exception to pass the FAT @param methodName @param paramValues @param theProvider
[ "call", "validation", "method", "ignore", "the", "exception", "to", "pass", "the", "FAT" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxrs.2.0.server/src/com/ibm/ws/jaxrs20/server/LibertyJaxRsInvoker.java#L358-L399
train