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
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
OpenLiberty/open-liberty
dev/com.ibm.ws.security.token.ltpa/src/com/ibm/ws/security/token/ltpa/internal/LTPAToken2.java
LTPAToken2.toUTF8String
private static final String toUTF8String(byte[] b) { String ns = null; try { ns = new String(b, "UTF8"); } catch (UnsupportedEncodingException e) { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "Error converting to string; " + e); } } return ns; }
java
private static final String toUTF8String(byte[] b) { String ns = null; try { ns = new String(b, "UTF8"); } catch (UnsupportedEncodingException e) { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "Error converting to string; " + e); } } return ns; }
[ "private", "static", "final", "String", "toUTF8String", "(", "byte", "[", "]", "b", ")", "{", "String", "ns", "=", "null", ";", "try", "{", "ns", "=", "new", "String", "(", "b", ",", "\"UTF8\"", ")", ";", "}", "catch", "(", "UnsupportedEncodingException", "e", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEventEnabled", "(", ")", ")", "{", "Tr", ".", "event", "(", "tc", ",", "\"Error converting to string; \"", "+", "e", ")", ";", "}", "}", "return", "ns", ";", "}" ]
Convert the byte representation to the UTF-8 String form. @param b The byte representation @return The UTF-8 String form
[ "Convert", "the", "byte", "representation", "to", "the", "UTF", "-", "8", "String", "form", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.token.ltpa/src/com/ibm/ws/security/token/ltpa/internal/LTPAToken2.java#L431-L441
train
OpenLiberty/open-liberty
dev/com.ibm.ws.security.token.ltpa/src/com/ibm/ws/security/token/ltpa/internal/LTPAToken2.java
LTPAToken2.toSimpleString
private static final String toSimpleString(byte[] b) { StringBuilder sb = new StringBuilder(); for (int i = 0, len = b.length; i < len; i++) { sb.append((char) (b[i] & 0xff)); } String str = sb.toString(); return str; }
java
private static final String toSimpleString(byte[] b) { StringBuilder sb = new StringBuilder(); for (int i = 0, len = b.length; i < len; i++) { sb.append((char) (b[i] & 0xff)); } String str = sb.toString(); return str; }
[ "private", "static", "final", "String", "toSimpleString", "(", "byte", "[", "]", "b", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "len", "=", "b", ".", "length", ";", "i", "<", "len", ";", "i", "++", ")", "{", "sb", ".", "append", "(", "(", "char", ")", "(", "b", "[", "i", "]", "&", "0xff", ")", ")", ";", "}", "String", "str", "=", "sb", ".", "toString", "(", ")", ";", "return", "str", ";", "}" ]
Convert the byte representation to the String form. @param b The byte representation @return The String form
[ "Convert", "the", "byte", "representation", "to", "the", "String", "form", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.token.ltpa/src/com/ibm/ws/security/token/ltpa/internal/LTPAToken2.java#L449-L456
train
OpenLiberty/open-liberty
dev/com.ibm.ws.security.token.ltpa/src/com/ibm/ws/security/token/ltpa/internal/LTPAToken2.java
LTPAToken2.getSimpleBytes
private static final byte[] getSimpleBytes(String str) { StringBuilder sb = new StringBuilder(str); byte[] b = new byte[sb.length()]; for (int i = 0, len = sb.length(); i < len; i++) { b[i] = (byte) sb.charAt(i); } return b; }
java
private static final byte[] getSimpleBytes(String str) { StringBuilder sb = new StringBuilder(str); byte[] b = new byte[sb.length()]; for (int i = 0, len = sb.length(); i < len; i++) { b[i] = (byte) sb.charAt(i); } return b; }
[ "private", "static", "final", "byte", "[", "]", "getSimpleBytes", "(", "String", "str", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", "str", ")", ";", "byte", "[", "]", "b", "=", "new", "byte", "[", "sb", ".", "length", "(", ")", "]", ";", "for", "(", "int", "i", "=", "0", ",", "len", "=", "sb", ".", "length", "(", ")", ";", "i", "<", "len", ";", "i", "++", ")", "{", "b", "[", "i", "]", "=", "(", "byte", ")", "sb", ".", "charAt", "(", "i", ")", ";", "}", "return", "b", ";", "}" ]
Convert the String form to the byte representation @param str The String form @return The byte representation
[ "Convert", "the", "String", "form", "to", "the", "byte", "representation" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.token.ltpa/src/com/ibm/ws/security/token/ltpa/internal/LTPAToken2.java#L464-L471
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jsp.2.3/src/org/apache/jasper/runtime/ProtectedFunctionMapper.java
ProtectedFunctionMapper.getInstance
public static ProtectedFunctionMapper getInstance() { ProtectedFunctionMapper funcMapper; if (System.getSecurityManager() != null) { funcMapper = (ProtectedFunctionMapper) AccessController.doPrivileged( new PrivilegedAction() { @Override public Object run() { return new ProtectedFunctionMapper(); } }); } else { funcMapper = new ProtectedFunctionMapper(); } funcMapper.fnmap = new java.util.HashMap(); return funcMapper; }
java
public static ProtectedFunctionMapper getInstance() { ProtectedFunctionMapper funcMapper; if (System.getSecurityManager() != null) { funcMapper = (ProtectedFunctionMapper) AccessController.doPrivileged( new PrivilegedAction() { @Override public Object run() { return new ProtectedFunctionMapper(); } }); } else { funcMapper = new ProtectedFunctionMapper(); } funcMapper.fnmap = new java.util.HashMap(); return funcMapper; }
[ "public", "static", "ProtectedFunctionMapper", "getInstance", "(", ")", "{", "ProtectedFunctionMapper", "funcMapper", ";", "if", "(", "System", ".", "getSecurityManager", "(", ")", "!=", "null", ")", "{", "funcMapper", "=", "(", "ProtectedFunctionMapper", ")", "AccessController", ".", "doPrivileged", "(", "new", "PrivilegedAction", "(", ")", "{", "@", "Override", "public", "Object", "run", "(", ")", "{", "return", "new", "ProtectedFunctionMapper", "(", ")", ";", "}", "}", ")", ";", "}", "else", "{", "funcMapper", "=", "new", "ProtectedFunctionMapper", "(", ")", ";", "}", "funcMapper", ".", "fnmap", "=", "new", "java", ".", "util", ".", "HashMap", "(", ")", ";", "return", "funcMapper", ";", "}" ]
Generated Servlet and Tag Handler implementations call this method to retrieve an instance of the ProtectedFunctionMapper. This is necessary since generated code does not have access to create instances of classes in this package. @return A new protected function mapper.
[ "Generated", "Servlet", "and", "Tag", "Handler", "implementations", "call", "this", "method", "to", "retrieve", "an", "instance", "of", "the", "ProtectedFunctionMapper", ".", "This", "is", "necessary", "since", "generated", "code", "does", "not", "have", "access", "to", "create", "instances", "of", "classes", "in", "this", "package", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsp.2.3/src/org/apache/jasper/runtime/ProtectedFunctionMapper.java#L103-L118
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jsp.2.3/src/org/apache/jasper/runtime/ProtectedFunctionMapper.java
ProtectedFunctionMapper.resolveFunction
@Override public Method resolveFunction(String prefix, String localName) { return (Method) this.fnmap.get(prefix + ":" + localName); }
java
@Override public Method resolveFunction(String prefix, String localName) { return (Method) this.fnmap.get(prefix + ":" + localName); }
[ "@", "Override", "public", "Method", "resolveFunction", "(", "String", "prefix", ",", "String", "localName", ")", "{", "return", "(", "Method", ")", "this", ".", "fnmap", ".", "get", "(", "prefix", "+", "\":\"", "+", "localName", ")", ";", "}" ]
Resolves the specified local name and prefix into a Java.lang.Method. Returns null if the prefix and local name are not found. @param prefix the prefix of the function @param localName the short name of the function @return the result of the method mapping. Null means no entry found.
[ "Resolves", "the", "specified", "local", "name", "and", "prefix", "into", "a", "Java", ".", "lang", ".", "Method", ".", "Returns", "null", "if", "the", "prefix", "and", "local", "name", "are", "not", "found", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsp.2.3/src/org/apache/jasper/runtime/ProtectedFunctionMapper.java#L177-L180
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSRepeated.java
JSRepeated.setItemType
public void setItemType(JMFType elem) { if (elem == null) throw new NullPointerException("Repeated item cannot be null"); itemType = (JSType)elem; itemType.parent = this; itemType.siblingPosition = 0; }
java
public void setItemType(JMFType elem) { if (elem == null) throw new NullPointerException("Repeated item cannot be null"); itemType = (JSType)elem; itemType.parent = this; itemType.siblingPosition = 0; }
[ "public", "void", "setItemType", "(", "JMFType", "elem", ")", "{", "if", "(", "elem", "==", "null", ")", "throw", "new", "NullPointerException", "(", "\"Repeated item cannot be null\"", ")", ";", "itemType", "=", "(", "JSType", ")", "elem", ";", "itemType", ".", "parent", "=", "this", ";", "itemType", ".", "siblingPosition", "=", "0", ";", "}" ]
Set the item type of the array
[ "Set", "the", "item", "type", "of", "the", "array" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSRepeated.java#L82-L88
train
OpenLiberty/open-liberty
dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/dispatcher/internal/channel/HttpDispatcherChannel.java
HttpDispatcherChannel.incrementActiveConns
protected void incrementActiveConns() { int count = this.activeConnections.incrementAndGet(); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Increment active, current=" + count); } }
java
protected void incrementActiveConns() { int count = this.activeConnections.incrementAndGet(); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Increment active, current=" + count); } }
[ "protected", "void", "incrementActiveConns", "(", ")", "{", "int", "count", "=", "this", ".", "activeConnections", ".", "incrementAndGet", "(", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"Increment active, current=\"", "+", "count", ")", ";", "}", "}" ]
Increase the number of active connections currently being processed inside the HTTP dispatcher.
[ "Increase", "the", "number", "of", "active", "connections", "currently", "being", "processed", "inside", "the", "HTTP", "dispatcher", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/dispatcher/internal/channel/HttpDispatcherChannel.java#L109-L114
train
OpenLiberty/open-liberty
dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/dispatcher/internal/channel/HttpDispatcherChannel.java
HttpDispatcherChannel.decrementActiveConns
protected void decrementActiveConns() { int count = this.activeConnections.decrementAndGet(); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Decrement active, current=" + count); } if (0 == count && this.quiescing) { signalNoConnections(); } }
java
protected void decrementActiveConns() { int count = this.activeConnections.decrementAndGet(); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Decrement active, current=" + count); } if (0 == count && this.quiescing) { signalNoConnections(); } }
[ "protected", "void", "decrementActiveConns", "(", ")", "{", "int", "count", "=", "this", ".", "activeConnections", ".", "decrementAndGet", "(", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"Decrement active, current=\"", "+", "count", ")", ";", "}", "if", "(", "0", "==", "count", "&&", "this", ".", "quiescing", ")", "{", "signalNoConnections", "(", ")", ";", "}", "}" ]
Decrement the number of active connections being processed by the dispatcher.
[ "Decrement", "the", "number", "of", "active", "connections", "being", "processed", "by", "the", "dispatcher", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/dispatcher/internal/channel/HttpDispatcherChannel.java#L119-L127
train
OpenLiberty/open-liberty
dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/cache/internal/ZipFileData.java
ZipFileData.enactOpen
@Trivial public void enactOpen(long openAt) { String methodName = "enactOpen"; if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled() ) { Tr.debug(tc, methodName + " On [ " + path + " ] at [ " + toRelSec(initialAt, openAt) + " (s) ]"); } if ( zipFileState == ZipFileState.OPEN ) { // OPEN -> OPEN openDuration += openAt - lastOpenAt; lastLastOpenAt = lastOpenAt; lastOpenAt = openAt; openCount++; } else if ( zipFileState == ZipFileState.PENDING ) { // PENDING -> OPEN long lastPendDuration = openAt - lastPendAt; pendToOpenDuration += lastPendDuration; pendToOpenCount++; lastLastOpenAt = lastOpenAt; lastOpenAt = openAt; openCount++; zipFileState = ZipFileState.OPEN; if ( ZIP_REAPER_COLLECT_TIMINGS ) { timing(" Pend Success [ " + toAbsSec(lastPendDuration) + " (s) ]"); } } else if ( zipFileState == ZipFileState.FULLY_CLOSED ) { // FULLY_CLOSED -> OPEN if ( firstOpenAt == -1L ) { firstOpenAt = openAt; } else { long lastFullCloseDuration = openAt - lastFullCloseAt; fullCloseToOpenDuration += lastFullCloseDuration; if ( ZIP_REAPER_COLLECT_TIMINGS ) { long lastPendDuration = ( (lastPendAt == -1L) ? 0 : (lastFullCloseAt - lastPendAt) ); timing(" Reopen; Pend [ " + toAbsSec(lastPendDuration) + " (s) ] " + " Close [ " + toAbsSec(lastFullCloseDuration) + " (s) ]"); } } fullCloseToOpenCount++; lastLastOpenAt = lastOpenAt; lastOpenAt = openAt; openCount++; zipFileState = ZipFileState.OPEN; } else { throw unknownState(); } if ( ZIP_REAPER_COLLECT_TIMINGS ) { timing(" Open " + dualTiming(openAt, initialAt) + " " + openState()); } }
java
@Trivial public void enactOpen(long openAt) { String methodName = "enactOpen"; if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled() ) { Tr.debug(tc, methodName + " On [ " + path + " ] at [ " + toRelSec(initialAt, openAt) + " (s) ]"); } if ( zipFileState == ZipFileState.OPEN ) { // OPEN -> OPEN openDuration += openAt - lastOpenAt; lastLastOpenAt = lastOpenAt; lastOpenAt = openAt; openCount++; } else if ( zipFileState == ZipFileState.PENDING ) { // PENDING -> OPEN long lastPendDuration = openAt - lastPendAt; pendToOpenDuration += lastPendDuration; pendToOpenCount++; lastLastOpenAt = lastOpenAt; lastOpenAt = openAt; openCount++; zipFileState = ZipFileState.OPEN; if ( ZIP_REAPER_COLLECT_TIMINGS ) { timing(" Pend Success [ " + toAbsSec(lastPendDuration) + " (s) ]"); } } else if ( zipFileState == ZipFileState.FULLY_CLOSED ) { // FULLY_CLOSED -> OPEN if ( firstOpenAt == -1L ) { firstOpenAt = openAt; } else { long lastFullCloseDuration = openAt - lastFullCloseAt; fullCloseToOpenDuration += lastFullCloseDuration; if ( ZIP_REAPER_COLLECT_TIMINGS ) { long lastPendDuration = ( (lastPendAt == -1L) ? 0 : (lastFullCloseAt - lastPendAt) ); timing(" Reopen; Pend [ " + toAbsSec(lastPendDuration) + " (s) ] " + " Close [ " + toAbsSec(lastFullCloseDuration) + " (s) ]"); } } fullCloseToOpenCount++; lastLastOpenAt = lastOpenAt; lastOpenAt = openAt; openCount++; zipFileState = ZipFileState.OPEN; } else { throw unknownState(); } if ( ZIP_REAPER_COLLECT_TIMINGS ) { timing(" Open " + dualTiming(openAt, initialAt) + " " + openState()); } }
[ "@", "Trivial", "public", "void", "enactOpen", "(", "long", "openAt", ")", "{", "String", "methodName", "=", "\"enactOpen\"", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "methodName", "+", "\" On [ \"", "+", "path", "+", "\" ] at [ \"", "+", "toRelSec", "(", "initialAt", ",", "openAt", ")", "+", "\" (s) ]\"", ")", ";", "}", "if", "(", "zipFileState", "==", "ZipFileState", ".", "OPEN", ")", "{", "// OPEN -> OPEN", "openDuration", "+=", "openAt", "-", "lastOpenAt", ";", "lastLastOpenAt", "=", "lastOpenAt", ";", "lastOpenAt", "=", "openAt", ";", "openCount", "++", ";", "}", "else", "if", "(", "zipFileState", "==", "ZipFileState", ".", "PENDING", ")", "{", "// PENDING -> OPEN", "long", "lastPendDuration", "=", "openAt", "-", "lastPendAt", ";", "pendToOpenDuration", "+=", "lastPendDuration", ";", "pendToOpenCount", "++", ";", "lastLastOpenAt", "=", "lastOpenAt", ";", "lastOpenAt", "=", "openAt", ";", "openCount", "++", ";", "zipFileState", "=", "ZipFileState", ".", "OPEN", ";", "if", "(", "ZIP_REAPER_COLLECT_TIMINGS", ")", "{", "timing", "(", "\" Pend Success [ \"", "+", "toAbsSec", "(", "lastPendDuration", ")", "+", "\" (s) ]\"", ")", ";", "}", "}", "else", "if", "(", "zipFileState", "==", "ZipFileState", ".", "FULLY_CLOSED", ")", "{", "// FULLY_CLOSED -> OPEN", "if", "(", "firstOpenAt", "==", "-", "1L", ")", "{", "firstOpenAt", "=", "openAt", ";", "}", "else", "{", "long", "lastFullCloseDuration", "=", "openAt", "-", "lastFullCloseAt", ";", "fullCloseToOpenDuration", "+=", "lastFullCloseDuration", ";", "if", "(", "ZIP_REAPER_COLLECT_TIMINGS", ")", "{", "long", "lastPendDuration", "=", "(", "(", "lastPendAt", "==", "-", "1L", ")", "?", "0", ":", "(", "lastFullCloseAt", "-", "lastPendAt", ")", ")", ";", "timing", "(", "\" Reopen; Pend [ \"", "+", "toAbsSec", "(", "lastPendDuration", ")", "+", "\" (s) ] \"", "+", "\" Close [ \"", "+", "toAbsSec", "(", "lastFullCloseDuration", ")", "+", "\" (s) ]\"", ")", ";", "}", "}", "fullCloseToOpenCount", "++", ";", "lastLastOpenAt", "=", "lastOpenAt", ";", "lastOpenAt", "=", "openAt", ";", "openCount", "++", ";", "zipFileState", "=", "ZipFileState", ".", "OPEN", ";", "}", "else", "{", "throw", "unknownState", "(", ")", ";", "}", "if", "(", "ZIP_REAPER_COLLECT_TIMINGS", ")", "{", "timing", "(", "\" Open \"", "+", "dualTiming", "(", "openAt", ",", "initialAt", ")", "+", "\" \"", "+", "openState", "(", ")", ")", ";", "}", "}" ]
PENDING -> FULLY_CLOSED
[ "PENDING", "-", ">", "FULLY_CLOSED" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/cache/internal/ZipFileData.java#L200-L264
train
OpenLiberty/open-liberty
dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/cache/internal/ZipFileData.java
ZipFileData.reacquireZipFile
@Trivial protected ZipFile reacquireZipFile() throws IOException, ZipException { String methodName = "reacquireZipFile"; File rawZipFile = new File(path); long newZipLength = FileUtils.fileLength(rawZipFile); long newZipLastModified = FileUtils.fileLastModified(rawZipFile); boolean zipFileChanged = false; if ( newZipLength != zipLength ) { zipFileChanged = true; if ( openCount > closeCount ) { // Tr.warning(tc, methodName + // " Zip [ " + path + " ]:" + // " Update length from [ " + Long.valueOf(zipLength) + " ]" + // " to [ " + Long.valueOf(newZipLength) + " ]"); Tr.warning(tc, "reaper.unexpected.length.change", path, Long.valueOf(zipLength), Long.valueOf(newZipLength)); } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled() ) { Tr.debug(tc, methodName + " Zip [ " + path + " ]:" + " Update length from [ " + Long.valueOf(zipLength) + " ]" + " to [ " + Long.valueOf(newZipLength) + " ]"); } } } if ( newZipLastModified != zipLastModified ) { zipFileChanged = true; if ( openCount > closeCount ) { // Tr.warning(tc, methodName + // " Zip [ " + path + " ]:" + // " Update last modified from [ " + Long.valueOf(zipLastModified) + " ]" + // " to [ " + Long.valueOf(newZipLastModified) + " ]"); Tr.warning(tc, "reaper.unexpected.lastmodified.change", path, Long.valueOf(zipLastModified), Long.valueOf(newZipLastModified)); } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled() ) { Tr.debug(tc, methodName + " Zip [ " + path + " ]:" + " Update last modified from [ " + Long.valueOf(zipLastModified) + " ]" + " to [ " + Long.valueOf(newZipLastModified) + " ]"); } } } if ( zipFileChanged ) { if ( openCount > closeCount ) { // Tr.warning(tc, methodName + " Reopen [ " + path + " ]"); Tr.warning(tc, "reaper.reopen.active", path); } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled() ) { Tr.debug(tc, methodName + " Reopen [ " + path + " ]"); } } @SuppressWarnings("unused") ZipFile oldZipFile = closeZipFile(); @SuppressWarnings("unused") ZipFile newZipFile = openZipFile(newZipLength, newZipLastModified); // throws IOException, ZipException } return zipFile; }
java
@Trivial protected ZipFile reacquireZipFile() throws IOException, ZipException { String methodName = "reacquireZipFile"; File rawZipFile = new File(path); long newZipLength = FileUtils.fileLength(rawZipFile); long newZipLastModified = FileUtils.fileLastModified(rawZipFile); boolean zipFileChanged = false; if ( newZipLength != zipLength ) { zipFileChanged = true; if ( openCount > closeCount ) { // Tr.warning(tc, methodName + // " Zip [ " + path + " ]:" + // " Update length from [ " + Long.valueOf(zipLength) + " ]" + // " to [ " + Long.valueOf(newZipLength) + " ]"); Tr.warning(tc, "reaper.unexpected.length.change", path, Long.valueOf(zipLength), Long.valueOf(newZipLength)); } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled() ) { Tr.debug(tc, methodName + " Zip [ " + path + " ]:" + " Update length from [ " + Long.valueOf(zipLength) + " ]" + " to [ " + Long.valueOf(newZipLength) + " ]"); } } } if ( newZipLastModified != zipLastModified ) { zipFileChanged = true; if ( openCount > closeCount ) { // Tr.warning(tc, methodName + // " Zip [ " + path + " ]:" + // " Update last modified from [ " + Long.valueOf(zipLastModified) + " ]" + // " to [ " + Long.valueOf(newZipLastModified) + " ]"); Tr.warning(tc, "reaper.unexpected.lastmodified.change", path, Long.valueOf(zipLastModified), Long.valueOf(newZipLastModified)); } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled() ) { Tr.debug(tc, methodName + " Zip [ " + path + " ]:" + " Update last modified from [ " + Long.valueOf(zipLastModified) + " ]" + " to [ " + Long.valueOf(newZipLastModified) + " ]"); } } } if ( zipFileChanged ) { if ( openCount > closeCount ) { // Tr.warning(tc, methodName + " Reopen [ " + path + " ]"); Tr.warning(tc, "reaper.reopen.active", path); } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled() ) { Tr.debug(tc, methodName + " Reopen [ " + path + " ]"); } } @SuppressWarnings("unused") ZipFile oldZipFile = closeZipFile(); @SuppressWarnings("unused") ZipFile newZipFile = openZipFile(newZipLength, newZipLastModified); // throws IOException, ZipException } return zipFile; }
[ "@", "Trivial", "protected", "ZipFile", "reacquireZipFile", "(", ")", "throws", "IOException", ",", "ZipException", "{", "String", "methodName", "=", "\"reacquireZipFile\"", ";", "File", "rawZipFile", "=", "new", "File", "(", "path", ")", ";", "long", "newZipLength", "=", "FileUtils", ".", "fileLength", "(", "rawZipFile", ")", ";", "long", "newZipLastModified", "=", "FileUtils", ".", "fileLastModified", "(", "rawZipFile", ")", ";", "boolean", "zipFileChanged", "=", "false", ";", "if", "(", "newZipLength", "!=", "zipLength", ")", "{", "zipFileChanged", "=", "true", ";", "if", "(", "openCount", ">", "closeCount", ")", "{", "// Tr.warning(tc, methodName +", "// \" Zip [ \" + path + \" ]:\" +", "// \" Update length from [ \" + Long.valueOf(zipLength) + \" ]\" +", "// \" to [ \" + Long.valueOf(newZipLength) + \" ]\");", "Tr", ".", "warning", "(", "tc", ",", "\"reaper.unexpected.length.change\"", ",", "path", ",", "Long", ".", "valueOf", "(", "zipLength", ")", ",", "Long", ".", "valueOf", "(", "newZipLength", ")", ")", ";", "}", "else", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "methodName", "+", "\" Zip [ \"", "+", "path", "+", "\" ]:\"", "+", "\" Update length from [ \"", "+", "Long", ".", "valueOf", "(", "zipLength", ")", "+", "\" ]\"", "+", "\" to [ \"", "+", "Long", ".", "valueOf", "(", "newZipLength", ")", "+", "\" ]\"", ")", ";", "}", "}", "}", "if", "(", "newZipLastModified", "!=", "zipLastModified", ")", "{", "zipFileChanged", "=", "true", ";", "if", "(", "openCount", ">", "closeCount", ")", "{", "// Tr.warning(tc, methodName +", "// \" Zip [ \" + path + \" ]:\" +", "// \" Update last modified from [ \" + Long.valueOf(zipLastModified) + \" ]\" +", "// \" to [ \" + Long.valueOf(newZipLastModified) + \" ]\");", "Tr", ".", "warning", "(", "tc", ",", "\"reaper.unexpected.lastmodified.change\"", ",", "path", ",", "Long", ".", "valueOf", "(", "zipLastModified", ")", ",", "Long", ".", "valueOf", "(", "newZipLastModified", ")", ")", ";", "}", "else", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "methodName", "+", "\" Zip [ \"", "+", "path", "+", "\" ]:\"", "+", "\" Update last modified from [ \"", "+", "Long", ".", "valueOf", "(", "zipLastModified", ")", "+", "\" ]\"", "+", "\" to [ \"", "+", "Long", ".", "valueOf", "(", "newZipLastModified", ")", "+", "\" ]\"", ")", ";", "}", "}", "}", "if", "(", "zipFileChanged", ")", "{", "if", "(", "openCount", ">", "closeCount", ")", "{", "// Tr.warning(tc, methodName + \" Reopen [ \" + path + \" ]\");", "Tr", ".", "warning", "(", "tc", ",", "\"reaper.reopen.active\"", ",", "path", ")", ";", "}", "else", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "methodName", "+", "\" Reopen [ \"", "+", "path", "+", "\" ]\"", ")", ";", "}", "}", "@", "SuppressWarnings", "(", "\"unused\"", ")", "ZipFile", "oldZipFile", "=", "closeZipFile", "(", ")", ";", "@", "SuppressWarnings", "(", "\"unused\"", ")", "ZipFile", "newZipFile", "=", "openZipFile", "(", "newZipLength", ",", "newZipLastModified", ")", ";", "// throws IOException, ZipException", "}", "return", "zipFile", ";", "}" ]
Re-acquire the ZIP file. If either the zip file length or last modified times changed since the zip file was set, re-open the zip file and update the length and last modified times. A warning is displayed if changes are detected and there are active opens. If there are no active opens, the data will be in a pending close state. Changes between a pending close and a re-open are expected. @return The zip file of the data. @throws IOException Thrown if the re-open of the zip file failed. @throws ZipException Thrown if the re-open of the zip file failed.
[ "Re", "-", "acquire", "the", "ZIP", "file", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/cache/internal/ZipFileData.java#L468-L535
train
OpenLiberty/open-liberty
dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/XMLUtils.java
XMLUtils.getAttribute
public static String getAttribute(XMLStreamReader reader, String localName) { int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { String name = reader.getAttributeLocalName(i); if (localName.equals(name)) { return reader.getAttributeValue(i); } } return null; }
java
public static String getAttribute(XMLStreamReader reader, String localName) { int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { String name = reader.getAttributeLocalName(i); if (localName.equals(name)) { return reader.getAttributeValue(i); } } return null; }
[ "public", "static", "String", "getAttribute", "(", "XMLStreamReader", "reader", ",", "String", "localName", ")", "{", "int", "count", "=", "reader", ".", "getAttributeCount", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "count", ";", "i", "++", ")", "{", "String", "name", "=", "reader", ".", "getAttributeLocalName", "(", "i", ")", ";", "if", "(", "localName", ".", "equals", "(", "name", ")", ")", "{", "return", "reader", ".", "getAttributeValue", "(", "i", ")", ";", "}", "}", "return", "null", ";", "}" ]
Get the element attribute value @param reader @param localName @return
[ "Get", "the", "element", "attribute", "value" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/XMLUtils.java#L29-L38
train
OpenLiberty/open-liberty
dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/XMLUtils.java
XMLUtils.createInstanceByElement
public static <T> T createInstanceByElement(XMLStreamReader reader, Class<T> clazz, Set<String> attrNames) { if (reader == null || clazz == null || attrNames == null) return null; try { T instance = clazz.newInstance(); int count = reader.getAttributeCount(); int matchCount = attrNames.size(); for (int i = 0; i < count && matchCount > 0; ++i) { String name = reader.getAttributeLocalName(i); String value = reader.getAttributeValue(i); if (attrNames.contains(name)) { Field field = clazz.getDeclaredField(name); field.setAccessible(true); field.set(instance, value); matchCount--; } } return instance; } catch (InstantiationException e) { throw new RuntimeException(e); } catch (IllegalAccessException e) { throw new RuntimeException(e); } catch (SecurityException e) { throw new RuntimeException(e); } catch (NoSuchFieldException e) { throw new RuntimeException(e); } }
java
public static <T> T createInstanceByElement(XMLStreamReader reader, Class<T> clazz, Set<String> attrNames) { if (reader == null || clazz == null || attrNames == null) return null; try { T instance = clazz.newInstance(); int count = reader.getAttributeCount(); int matchCount = attrNames.size(); for (int i = 0; i < count && matchCount > 0; ++i) { String name = reader.getAttributeLocalName(i); String value = reader.getAttributeValue(i); if (attrNames.contains(name)) { Field field = clazz.getDeclaredField(name); field.setAccessible(true); field.set(instance, value); matchCount--; } } return instance; } catch (InstantiationException e) { throw new RuntimeException(e); } catch (IllegalAccessException e) { throw new RuntimeException(e); } catch (SecurityException e) { throw new RuntimeException(e); } catch (NoSuchFieldException e) { throw new RuntimeException(e); } }
[ "public", "static", "<", "T", ">", "T", "createInstanceByElement", "(", "XMLStreamReader", "reader", ",", "Class", "<", "T", ">", "clazz", ",", "Set", "<", "String", ">", "attrNames", ")", "{", "if", "(", "reader", "==", "null", "||", "clazz", "==", "null", "||", "attrNames", "==", "null", ")", "return", "null", ";", "try", "{", "T", "instance", "=", "clazz", ".", "newInstance", "(", ")", ";", "int", "count", "=", "reader", ".", "getAttributeCount", "(", ")", ";", "int", "matchCount", "=", "attrNames", ".", "size", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "count", "&&", "matchCount", ">", "0", ";", "++", "i", ")", "{", "String", "name", "=", "reader", ".", "getAttributeLocalName", "(", "i", ")", ";", "String", "value", "=", "reader", ".", "getAttributeValue", "(", "i", ")", ";", "if", "(", "attrNames", ".", "contains", "(", "name", ")", ")", "{", "Field", "field", "=", "clazz", ".", "getDeclaredField", "(", "name", ")", ";", "field", ".", "setAccessible", "(", "true", ")", ";", "field", ".", "set", "(", "instance", ",", "value", ")", ";", "matchCount", "--", ";", "}", "}", "return", "instance", ";", "}", "catch", "(", "InstantiationException", "e", ")", "{", "throw", "new", "RuntimeException", "(", "e", ")", ";", "}", "catch", "(", "IllegalAccessException", "e", ")", "{", "throw", "new", "RuntimeException", "(", "e", ")", ";", "}", "catch", "(", "SecurityException", "e", ")", "{", "throw", "new", "RuntimeException", "(", "e", ")", ";", "}", "catch", "(", "NoSuchFieldException", "e", ")", "{", "throw", "new", "RuntimeException", "(", "e", ")", ";", "}", "}" ]
Create the instance by parse the element, the instance's class must have the empty construct. The clazz must have the fields in attrNames and all the fields type must be String @param reader @param clazz @param attrNames @return
[ "Create", "the", "instance", "by", "parse", "the", "element", "the", "instance", "s", "class", "must", "have", "the", "empty", "construct", ".", "The", "clazz", "must", "have", "the", "fields", "in", "attrNames", "and", "all", "the", "fields", "type", "must", "be", "String" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/XMLUtils.java#L49-L80
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/BindingsHelper.java
BindingsHelper.removeEjbBindings
public void removeEjbBindings() { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "removeEjbBindings called"); // Just loop through the values, not the keys, as the simple-binding-name // key may have a # in front of it when the bean was not simple, and that // won't match what is in the ServerContextBindingMap. d457053.1 for (String bindingName : ivEjbContextBindingMap.values()) { removeFromServerContextBindingMap(bindingName, true); } ivEjbContextBindingMap.clear(); }
java
public void removeEjbBindings() { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "removeEjbBindings called"); // Just loop through the values, not the keys, as the simple-binding-name // key may have a # in front of it when the bean was not simple, and that // won't match what is in the ServerContextBindingMap. d457053.1 for (String bindingName : ivEjbContextBindingMap.values()) { removeFromServerContextBindingMap(bindingName, true); } ivEjbContextBindingMap.clear(); }
[ "public", "void", "removeEjbBindings", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"removeEjbBindings called\"", ")", ";", "// Just loop through the values, not the keys, as the simple-binding-name", "// key may have a # in front of it when the bean was not simple, and that", "// won't match what is in the ServerContextBindingMap. d457053.1", "for", "(", "String", "bindingName", ":", "ivEjbContextBindingMap", ".", "values", "(", ")", ")", "{", "removeFromServerContextBindingMap", "(", "bindingName", ",", "true", ")", ";", "}", "ivEjbContextBindingMap", ".", "clear", "(", ")", ";", "}" ]
Removes all of the EJB bindings for this EJB from the bean specific and sever wide maps.
[ "Removes", "all", "of", "the", "EJB", "bindings", "for", "this", "EJB", "from", "the", "bean", "specific", "and", "sever", "wide", "maps", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/BindingsHelper.java#L162-L177
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/BindingsHelper.java
BindingsHelper.isUniqueShortDefaultBinding
public boolean isUniqueShortDefaultBinding(String interfaceName) { // If there were no explicit bindings, and only one implicit // binding, then it is considered uniquie. d457053.1 BindingData bdata = ivServerContextBindingMap.get(interfaceName); if (bdata != null && bdata.ivExplicitBean == null && bdata.ivImplicitBeans != null && bdata.ivImplicitBeans.size() == 1) { return true; } return false; }
java
public boolean isUniqueShortDefaultBinding(String interfaceName) { // If there were no explicit bindings, and only one implicit // binding, then it is considered uniquie. d457053.1 BindingData bdata = ivServerContextBindingMap.get(interfaceName); if (bdata != null && bdata.ivExplicitBean == null && bdata.ivImplicitBeans != null && bdata.ivImplicitBeans.size() == 1) { return true; } return false; }
[ "public", "boolean", "isUniqueShortDefaultBinding", "(", "String", "interfaceName", ")", "{", "// If there were no explicit bindings, and only one implicit", "// binding, then it is considered uniquie. d457053.1", "BindingData", "bdata", "=", "ivServerContextBindingMap", ".", "get", "(", "interfaceName", ")", ";", "if", "(", "bdata", "!=", "null", "&&", "bdata", ".", "ivExplicitBean", "==", "null", "&&", "bdata", ".", "ivImplicitBeans", "!=", "null", "&&", "bdata", ".", "ivImplicitBeans", ".", "size", "(", ")", "==", "1", ")", "{", "return", "true", ";", "}", "return", "false", ";", "}" ]
Returns true if a short form default binding is present for the specified interface, and the current bean is currently the only bean with this short form default binding, and there are no explicit bindings. @param interfaceName name of the EJB interface to check for a unique short form binding.
[ "Returns", "true", "if", "a", "short", "form", "default", "binding", "is", "present", "for", "the", "specified", "interface", "and", "the", "current", "bean", "is", "currently", "the", "only", "bean", "with", "this", "short", "form", "default", "binding", "and", "there", "are", "no", "explicit", "bindings", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/BindingsHelper.java#L200-L215
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/BindingsHelper.java
BindingsHelper.removeShortDefaultBindings
public void removeShortDefaultBindings() { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "removeShortDefaultBindings called"); for (String bindingName : ivEjbContextShortDefaultJndiNames) { removeFromServerContextBindingMap(bindingName, false); } ivEjbContextShortDefaultJndiNames.clear(); }
java
public void removeShortDefaultBindings() { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "removeShortDefaultBindings called"); for (String bindingName : ivEjbContextShortDefaultJndiNames) { removeFromServerContextBindingMap(bindingName, false); } ivEjbContextShortDefaultJndiNames.clear(); }
[ "public", "void", "removeShortDefaultBindings", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"removeShortDefaultBindings called\"", ")", ";", "for", "(", "String", "bindingName", ":", "ivEjbContextShortDefaultJndiNames", ")", "{", "removeFromServerContextBindingMap", "(", "bindingName", ",", "false", ")", ";", "}", "ivEjbContextShortDefaultJndiNames", ".", "clear", "(", ")", ";", "}" ]
Removes all of the short form default bindings for this EJB from the bean specific and sever wide maps.
[ "Removes", "all", "of", "the", "short", "form", "default", "bindings", "for", "this", "EJB", "from", "the", "bean", "specific", "and", "sever", "wide", "maps", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/BindingsHelper.java#L230-L241
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/BindingsHelper.java
BindingsHelper.addToServerContextBindingMap
private void addToServerContextBindingMap(String interfaceName, String bindingName) throws NameAlreadyBoundException { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "addToServerContextBindingMap : " + interfaceName + ", binding : " + bindingName); BindingData bdata = ivServerContextBindingMap.get(bindingName); if (bdata == null) { bdata = new BindingData(); ivServerContextBindingMap.put(bindingName, bdata); } if (bdata.ivExplicitBean == null) { bdata.ivExplicitBean = ivHomeRecord.j2eeName; bdata.ivExplicitInterface = interfaceName; if (bdata.ivImplicitBeans != null && bdata.ivImplicitBeans.size() > 1) { ivEjbContextAmbiguousMap.remove(interfaceName); } } else { J2EEName j2eeName = ivHomeRecord.j2eeName; if (bdata.ivExplicitBean.equals(j2eeName)) { Tr.error(tc, "NAME_ALREADY_BOUND_FOR_SAME_EJB_CNTR0173E", new Object[] { interfaceName, j2eeName.getComponent(), j2eeName.getModule(), j2eeName.getApplication(), bindingName, bdata.ivExplicitInterface }); // d479669 String message = "The " + interfaceName + " interface of the " + j2eeName.getComponent() + " bean in the " + j2eeName.getModule() + " module of the " + j2eeName.getApplication() + " application " + "cannot be bound to the " + bindingName + " name location. " + "The " + bdata.ivExplicitInterface + " interface of the " + "same bean has already been bound to the " + bindingName + " name location."; throw new NameAlreadyBoundException(message); } else { Tr.error(tc, "NAME_ALREADY_BOUND_FOR_EJB_CNTR0172E", new Object[] { interfaceName, j2eeName.getComponent(), j2eeName.getModule(), j2eeName.getApplication(), bindingName, bdata.ivExplicitInterface, bdata.ivExplicitBean.getComponent(), bdata.ivExplicitBean.getModule(), bdata.ivExplicitBean.getApplication() }); // d479669 String message = "The " + interfaceName + " interface of the " + j2eeName.getComponent() + " bean in the " + j2eeName.getModule() + " module of the " + j2eeName.getApplication() + " application " + "cannot be bound to the " + bindingName + " name location. " + "The " + bdata.ivExplicitInterface + " interface of the " + bdata.ivExplicitBean.getComponent() + " bean in the " + bdata.ivExplicitBean.getModule() + " module of the " + bdata.ivExplicitBean.getApplication() + " application " + "has already been bound to the " + bindingName + " name location."; throw new NameAlreadyBoundException(message); } } }
java
private void addToServerContextBindingMap(String interfaceName, String bindingName) throws NameAlreadyBoundException { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "addToServerContextBindingMap : " + interfaceName + ", binding : " + bindingName); BindingData bdata = ivServerContextBindingMap.get(bindingName); if (bdata == null) { bdata = new BindingData(); ivServerContextBindingMap.put(bindingName, bdata); } if (bdata.ivExplicitBean == null) { bdata.ivExplicitBean = ivHomeRecord.j2eeName; bdata.ivExplicitInterface = interfaceName; if (bdata.ivImplicitBeans != null && bdata.ivImplicitBeans.size() > 1) { ivEjbContextAmbiguousMap.remove(interfaceName); } } else { J2EEName j2eeName = ivHomeRecord.j2eeName; if (bdata.ivExplicitBean.equals(j2eeName)) { Tr.error(tc, "NAME_ALREADY_BOUND_FOR_SAME_EJB_CNTR0173E", new Object[] { interfaceName, j2eeName.getComponent(), j2eeName.getModule(), j2eeName.getApplication(), bindingName, bdata.ivExplicitInterface }); // d479669 String message = "The " + interfaceName + " interface of the " + j2eeName.getComponent() + " bean in the " + j2eeName.getModule() + " module of the " + j2eeName.getApplication() + " application " + "cannot be bound to the " + bindingName + " name location. " + "The " + bdata.ivExplicitInterface + " interface of the " + "same bean has already been bound to the " + bindingName + " name location."; throw new NameAlreadyBoundException(message); } else { Tr.error(tc, "NAME_ALREADY_BOUND_FOR_EJB_CNTR0172E", new Object[] { interfaceName, j2eeName.getComponent(), j2eeName.getModule(), j2eeName.getApplication(), bindingName, bdata.ivExplicitInterface, bdata.ivExplicitBean.getComponent(), bdata.ivExplicitBean.getModule(), bdata.ivExplicitBean.getApplication() }); // d479669 String message = "The " + interfaceName + " interface of the " + j2eeName.getComponent() + " bean in the " + j2eeName.getModule() + " module of the " + j2eeName.getApplication() + " application " + "cannot be bound to the " + bindingName + " name location. " + "The " + bdata.ivExplicitInterface + " interface of the " + bdata.ivExplicitBean.getComponent() + " bean in the " + bdata.ivExplicitBean.getModule() + " module of the " + bdata.ivExplicitBean.getApplication() + " application " + "has already been bound to the " + bindingName + " name location."; throw new NameAlreadyBoundException(message); } } }
[ "private", "void", "addToServerContextBindingMap", "(", "String", "interfaceName", ",", "String", "bindingName", ")", "throws", "NameAlreadyBoundException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"addToServerContextBindingMap : \"", "+", "interfaceName", "+", "\", binding : \"", "+", "bindingName", ")", ";", "BindingData", "bdata", "=", "ivServerContextBindingMap", ".", "get", "(", "bindingName", ")", ";", "if", "(", "bdata", "==", "null", ")", "{", "bdata", "=", "new", "BindingData", "(", ")", ";", "ivServerContextBindingMap", ".", "put", "(", "bindingName", ",", "bdata", ")", ";", "}", "if", "(", "bdata", ".", "ivExplicitBean", "==", "null", ")", "{", "bdata", ".", "ivExplicitBean", "=", "ivHomeRecord", ".", "j2eeName", ";", "bdata", ".", "ivExplicitInterface", "=", "interfaceName", ";", "if", "(", "bdata", ".", "ivImplicitBeans", "!=", "null", "&&", "bdata", ".", "ivImplicitBeans", ".", "size", "(", ")", ">", "1", ")", "{", "ivEjbContextAmbiguousMap", ".", "remove", "(", "interfaceName", ")", ";", "}", "}", "else", "{", "J2EEName", "j2eeName", "=", "ivHomeRecord", ".", "j2eeName", ";", "if", "(", "bdata", ".", "ivExplicitBean", ".", "equals", "(", "j2eeName", ")", ")", "{", "Tr", ".", "error", "(", "tc", ",", "\"NAME_ALREADY_BOUND_FOR_SAME_EJB_CNTR0173E\"", ",", "new", "Object", "[", "]", "{", "interfaceName", ",", "j2eeName", ".", "getComponent", "(", ")", ",", "j2eeName", ".", "getModule", "(", ")", ",", "j2eeName", ".", "getApplication", "(", ")", ",", "bindingName", ",", "bdata", ".", "ivExplicitInterface", "}", ")", ";", "// d479669", "String", "message", "=", "\"The \"", "+", "interfaceName", "+", "\" interface of the \"", "+", "j2eeName", ".", "getComponent", "(", ")", "+", "\" bean in the \"", "+", "j2eeName", ".", "getModule", "(", ")", "+", "\" module of the \"", "+", "j2eeName", ".", "getApplication", "(", ")", "+", "\" application \"", "+", "\"cannot be bound to the \"", "+", "bindingName", "+", "\" name location. \"", "+", "\"The \"", "+", "bdata", ".", "ivExplicitInterface", "+", "\" interface of the \"", "+", "\"same bean has already been bound to the \"", "+", "bindingName", "+", "\" name location.\"", ";", "throw", "new", "NameAlreadyBoundException", "(", "message", ")", ";", "}", "else", "{", "Tr", ".", "error", "(", "tc", ",", "\"NAME_ALREADY_BOUND_FOR_EJB_CNTR0172E\"", ",", "new", "Object", "[", "]", "{", "interfaceName", ",", "j2eeName", ".", "getComponent", "(", ")", ",", "j2eeName", ".", "getModule", "(", ")", ",", "j2eeName", ".", "getApplication", "(", ")", ",", "bindingName", ",", "bdata", ".", "ivExplicitInterface", ",", "bdata", ".", "ivExplicitBean", ".", "getComponent", "(", ")", ",", "bdata", ".", "ivExplicitBean", ".", "getModule", "(", ")", ",", "bdata", ".", "ivExplicitBean", ".", "getApplication", "(", ")", "}", ")", ";", "// d479669", "String", "message", "=", "\"The \"", "+", "interfaceName", "+", "\" interface of the \"", "+", "j2eeName", ".", "getComponent", "(", ")", "+", "\" bean in the \"", "+", "j2eeName", ".", "getModule", "(", ")", "+", "\" module of the \"", "+", "j2eeName", ".", "getApplication", "(", ")", "+", "\" application \"", "+", "\"cannot be bound to the \"", "+", "bindingName", "+", "\" name location. \"", "+", "\"The \"", "+", "bdata", ".", "ivExplicitInterface", "+", "\" interface of the \"", "+", "bdata", ".", "ivExplicitBean", ".", "getComponent", "(", ")", "+", "\" bean in the \"", "+", "bdata", ".", "ivExplicitBean", ".", "getModule", "(", ")", "+", "\" module of the \"", "+", "bdata", ".", "ivExplicitBean", ".", "getApplication", "(", ")", "+", "\" application \"", "+", "\"has already been bound to the \"", "+", "bindingName", "+", "\" name location.\"", ";", "throw", "new", "NameAlreadyBoundException", "(", "message", ")", ";", "}", "}", "}" ]
d457053.1
[ "d457053", ".", "1" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/BindingsHelper.java#L557-L631
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/BindingsHelper.java
BindingsHelper.getLocalHelper
public static BindingsHelper getLocalHelper(HomeRecord homeRecord) { if (homeRecord.ivLocalBindingsHelper == null) { homeRecord.ivLocalBindingsHelper = new BindingsHelper(homeRecord, cvAllLocalBindings, null); } return homeRecord.ivLocalBindingsHelper; }
java
public static BindingsHelper getLocalHelper(HomeRecord homeRecord) { if (homeRecord.ivLocalBindingsHelper == null) { homeRecord.ivLocalBindingsHelper = new BindingsHelper(homeRecord, cvAllLocalBindings, null); } return homeRecord.ivLocalBindingsHelper; }
[ "public", "static", "BindingsHelper", "getLocalHelper", "(", "HomeRecord", "homeRecord", ")", "{", "if", "(", "homeRecord", ".", "ivLocalBindingsHelper", "==", "null", ")", "{", "homeRecord", ".", "ivLocalBindingsHelper", "=", "new", "BindingsHelper", "(", "homeRecord", ",", "cvAllLocalBindings", ",", "null", ")", ";", "}", "return", "homeRecord", ".", "ivLocalBindingsHelper", ";", "}" ]
A method for obtaining a Binding Name Helper for use with the local jndi namespace. @param homeRecord The HomeRecord associated with the bean whose interfaces or home are to have jndi binding name(s) constructed. @return An instance of a BindingsHelper for generating jndi names intended to be bound into the local jndi namespace.
[ "A", "method", "for", "obtaining", "a", "Binding", "Name", "Helper", "for", "use", "with", "the", "local", "jndi", "namespace", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/BindingsHelper.java#L790-L800
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/BindingsHelper.java
BindingsHelper.getRemoteHelper
public static BindingsHelper getRemoteHelper(HomeRecord homeRecord) { if (homeRecord.ivRemoteBindingsHelper == null) { homeRecord.ivRemoteBindingsHelper = new BindingsHelper(homeRecord, cvAllRemoteBindings, "ejb/"); } return homeRecord.ivRemoteBindingsHelper; }
java
public static BindingsHelper getRemoteHelper(HomeRecord homeRecord) { if (homeRecord.ivRemoteBindingsHelper == null) { homeRecord.ivRemoteBindingsHelper = new BindingsHelper(homeRecord, cvAllRemoteBindings, "ejb/"); } return homeRecord.ivRemoteBindingsHelper; }
[ "public", "static", "BindingsHelper", "getRemoteHelper", "(", "HomeRecord", "homeRecord", ")", "{", "if", "(", "homeRecord", ".", "ivRemoteBindingsHelper", "==", "null", ")", "{", "homeRecord", ".", "ivRemoteBindingsHelper", "=", "new", "BindingsHelper", "(", "homeRecord", ",", "cvAllRemoteBindings", ",", "\"ejb/\"", ")", ";", "}", "return", "homeRecord", ".", "ivRemoteBindingsHelper", ";", "}" ]
A method for obtaining a Binding Name Helper for use with the remote jndi namespace. @param homeRecord The HomeRecord associated with the bean whose interfaces or home are to have jndi binding name(s) constructed. @return an instance of a BindingsHelper for generating jndi names intended to be bound into the remote jndi namespace.
[ "A", "method", "for", "obtaining", "a", "Binding", "Name", "Helper", "for", "use", "with", "the", "remote", "jndi", "namespace", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/BindingsHelper.java#L810-L820
train
OpenLiberty/open-liberty
dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/LogRepositoryManagerImpl.java
LogRepositoryManagerImpl.stop
public synchronized void stop() { if (timer != null) { timer.keepRunning = false; timer.interrupt(); timer = null; } // Remove this manager from the space alert list LogRepositorySpaceAlert.getInstance().removeRepositoryInfo(this); }
java
public synchronized void stop() { if (timer != null) { timer.keepRunning = false; timer.interrupt(); timer = null; } // Remove this manager from the space alert list LogRepositorySpaceAlert.getInstance().removeRepositoryInfo(this); }
[ "public", "synchronized", "void", "stop", "(", ")", "{", "if", "(", "timer", "!=", "null", ")", "{", "timer", ".", "keepRunning", "=", "false", ";", "timer", ".", "interrupt", "(", ")", ";", "timer", "=", "null", ";", "}", "// Remove this manager from the space alert list", "LogRepositorySpaceAlert", ".", "getInstance", "(", ")", ".", "removeRepositoryInfo", "(", "this", ")", ";", "}" ]
stop logging and thus stop the timer retention thread
[ "stop", "logging", "and", "thus", "stop", "the", "timer", "retention", "thread" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/LogRepositoryManagerImpl.java#L102-L110
train
OpenLiberty/open-liberty
dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/LogRepositoryManagerImpl.java
LogRepositoryManagerImpl.calculateFileSplit
protected static long calculateFileSplit(long repositorySize) { if (repositorySize <= 0) { return MAX_LOG_FILE_SIZE; } if (repositorySize < MIN_REPOSITORY_SIZE) { throw new IllegalArgumentException("Specified repository size is too small"); } long result = repositorySize / SPLIT_RATIO; if (result < MIN_LOG_FILE_SIZE) { result = MIN_LOG_FILE_SIZE; } else if (result > MAX_LOG_FILE_SIZE) { result = MAX_LOG_FILE_SIZE; } return result; }
java
protected static long calculateFileSplit(long repositorySize) { if (repositorySize <= 0) { return MAX_LOG_FILE_SIZE; } if (repositorySize < MIN_REPOSITORY_SIZE) { throw new IllegalArgumentException("Specified repository size is too small"); } long result = repositorySize / SPLIT_RATIO; if (result < MIN_LOG_FILE_SIZE) { result = MIN_LOG_FILE_SIZE; } else if (result > MAX_LOG_FILE_SIZE) { result = MAX_LOG_FILE_SIZE; } return result; }
[ "protected", "static", "long", "calculateFileSplit", "(", "long", "repositorySize", ")", "{", "if", "(", "repositorySize", "<=", "0", ")", "{", "return", "MAX_LOG_FILE_SIZE", ";", "}", "if", "(", "repositorySize", "<", "MIN_REPOSITORY_SIZE", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Specified repository size is too small\"", ")", ";", "}", "long", "result", "=", "repositorySize", "/", "SPLIT_RATIO", ";", "if", "(", "result", "<", "MIN_LOG_FILE_SIZE", ")", "{", "result", "=", "MIN_LOG_FILE_SIZE", ";", "}", "else", "if", "(", "result", ">", "MAX_LOG_FILE_SIZE", ")", "{", "result", "=", "MAX_LOG_FILE_SIZE", ";", "}", "return", "result", ";", "}" ]
calculates maximum size of repository files based on the required maximum limit on total size of the repository. @param repositorySize space constrain on the repository. @return size constrain of an individual file in the repository.
[ "calculates", "maximum", "size", "of", "repository", "files", "based", "on", "the", "required", "maximum", "limit", "on", "total", "size", "of", "the", "repository", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/LogRepositoryManagerImpl.java#L162-L179
train
OpenLiberty/open-liberty
dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/LogRepositoryManagerImpl.java
LogRepositoryManagerImpl.initFileList
private void initFileList(boolean force) { if (totalSize < 0 || force) { fileList.clear(); parentFilesMap.clear(); totalSize = 0L; File[] files = listRepositoryFiles(); if (files.length > 0) { Arrays.sort(files, fileComparator); for (File file: files) { long size = AccessHelper.getFileLength(file); // Intentional here to NOT add these files to activeFilesMap since they are legacy fileList.add(new FileDetails(file, getLogFileTimestamp(file), size, null)); totalSize += size; if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "initFileList", "add: "+file.getPath()+" sz: "+size+ " listSz: "+fileList.size()+" new totalSz: "+totalSize); } incrementFileCount(file); } debugListLL("fileListPrePop") ; } deleteEmptyRepositoryDirs(); if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()){ Iterator<File> parentKeys = parentFilesMap.keySet().iterator() ; while (parentKeys.hasNext()) { File parentNameKey = parentKeys.next() ; Integer fileCount = parentFilesMap.get(parentNameKey) ; debugLogger.logp(Level.FINE, thisClass, "initFileList", " Directory: "+parentNameKey+" file count: "+ fileCount) ; } } } }
java
private void initFileList(boolean force) { if (totalSize < 0 || force) { fileList.clear(); parentFilesMap.clear(); totalSize = 0L; File[] files = listRepositoryFiles(); if (files.length > 0) { Arrays.sort(files, fileComparator); for (File file: files) { long size = AccessHelper.getFileLength(file); // Intentional here to NOT add these files to activeFilesMap since they are legacy fileList.add(new FileDetails(file, getLogFileTimestamp(file), size, null)); totalSize += size; if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "initFileList", "add: "+file.getPath()+" sz: "+size+ " listSz: "+fileList.size()+" new totalSz: "+totalSize); } incrementFileCount(file); } debugListLL("fileListPrePop") ; } deleteEmptyRepositoryDirs(); if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()){ Iterator<File> parentKeys = parentFilesMap.keySet().iterator() ; while (parentKeys.hasNext()) { File parentNameKey = parentKeys.next() ; Integer fileCount = parentFilesMap.get(parentNameKey) ; debugLogger.logp(Level.FINE, thisClass, "initFileList", " Directory: "+parentNameKey+" file count: "+ fileCount) ; } } } }
[ "private", "void", "initFileList", "(", "boolean", "force", ")", "{", "if", "(", "totalSize", "<", "0", "||", "force", ")", "{", "fileList", ".", "clear", "(", ")", ";", "parentFilesMap", ".", "clear", "(", ")", ";", "totalSize", "=", "0L", ";", "File", "[", "]", "files", "=", "listRepositoryFiles", "(", ")", ";", "if", "(", "files", ".", "length", ">", "0", ")", "{", "Arrays", ".", "sort", "(", "files", ",", "fileComparator", ")", ";", "for", "(", "File", "file", ":", "files", ")", "{", "long", "size", "=", "AccessHelper", ".", "getFileLength", "(", "file", ")", ";", "// Intentional here to NOT add these files to activeFilesMap since they are legacy", "fileList", ".", "add", "(", "new", "FileDetails", "(", "file", ",", "getLogFileTimestamp", "(", "file", ")", ",", "size", ",", "null", ")", ")", ";", "totalSize", "+=", "size", ";", "if", "(", "debugLogger", ".", "isLoggable", "(", "Level", ".", "FINE", ")", "&&", "LogRepositoryBaseImpl", ".", "isDebugEnabled", "(", ")", ")", "{", "debugLogger", ".", "logp", "(", "Level", ".", "FINE", ",", "thisClass", ",", "\"initFileList\"", ",", "\"add: \"", "+", "file", ".", "getPath", "(", ")", "+", "\" sz: \"", "+", "size", "+", "\" listSz: \"", "+", "fileList", ".", "size", "(", ")", "+", "\" new totalSz: \"", "+", "totalSize", ")", ";", "}", "incrementFileCount", "(", "file", ")", ";", "}", "debugListLL", "(", "\"fileListPrePop\"", ")", ";", "}", "deleteEmptyRepositoryDirs", "(", ")", ";", "if", "(", "debugLogger", ".", "isLoggable", "(", "Level", ".", "FINE", ")", "&&", "LogRepositoryBaseImpl", ".", "isDebugEnabled", "(", ")", ")", "{", "Iterator", "<", "File", ">", "parentKeys", "=", "parentFilesMap", ".", "keySet", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "parentKeys", ".", "hasNext", "(", ")", ")", "{", "File", "parentNameKey", "=", "parentKeys", ".", "next", "(", ")", ";", "Integer", "fileCount", "=", "parentFilesMap", ".", "get", "(", "parentNameKey", ")", ";", "debugLogger", ".", "logp", "(", "Level", ".", "FINE", ",", "thisClass", ",", "\"initFileList\"", ",", "\" Directory: \"", "+", "parentNameKey", "+", "\" file count: \"", "+", "fileCount", ")", ";", "}", "}", "}", "}" ]
Initializes file list from the list of files in the repository. This method should be called while holding a lock on fileList. @param force indicator that the list should be initialized from the file system even if it was initialized before.
[ "Initializes", "file", "list", "from", "the", "list", "of", "files", "in", "the", "repository", ".", "This", "method", "should", "be", "called", "while", "holding", "a", "lock", "on", "fileList", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/LogRepositoryManagerImpl.java#L205-L238
train
OpenLiberty/open-liberty
dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/LogRepositoryManagerImpl.java
LogRepositoryManagerImpl.deleteEmptyRepositoryDirs
protected void deleteEmptyRepositoryDirs() { File[] directories = listRepositoryDirs(); //determine if the server/controller instance directory is empty for(int i = 0; i < directories.length; i++){ // This is a directory we should not delete boolean currentDir = ivSubDirectory != null && ivSubDirectory.compareTo(directories[i])==0; //if a server instance directory does not have a key in parentFilesMap, then it does not have any files if (debugLogger.isLoggable(Level.FINE) && isDebugEnabled()) debugLogger.logp(Level.FINE, thisClass, "deleteEmptyRepositoryDirs", "Instance directory name (controller): " + directories[i].getAbsolutePath()); //now look for empty servant directories File[] childFiles = AccessHelper.listFiles(directories[i], subprocFilter) ; for (File curFile : childFiles) { if (debugLogger.isLoggable(Level.FINE) && isDebugEnabled()) debugLogger.logp(Level.FINE, thisClass, "deleteEmptyRepositoryDirs", "Servant directory name: " + curFile.getAbsolutePath()); if (!currentDir && !parentFilesMap.containsKey(curFile)) { if (debugLogger.isLoggable(Level.FINE) && isDebugEnabled()) debugLogger.logp(Level.FINE, thisClass, "deleteEmptyRepositoryDirs", "Found an empty servant directory: " + curFile); deleteDirectory(curFile); } else { incrementFileCount(curFile); } } //delete directory if empty if (!currentDir && !parentFilesMap.containsKey(directories[i])) { if (debugLogger.isLoggable(Level.FINE) && isDebugEnabled()) debugLogger.logp(Level.FINE, thisClass, "listRepositoryFiles", "Found an empty directory: " + directories[i]); deleteDirectory(directories[i]); } } }
java
protected void deleteEmptyRepositoryDirs() { File[] directories = listRepositoryDirs(); //determine if the server/controller instance directory is empty for(int i = 0; i < directories.length; i++){ // This is a directory we should not delete boolean currentDir = ivSubDirectory != null && ivSubDirectory.compareTo(directories[i])==0; //if a server instance directory does not have a key in parentFilesMap, then it does not have any files if (debugLogger.isLoggable(Level.FINE) && isDebugEnabled()) debugLogger.logp(Level.FINE, thisClass, "deleteEmptyRepositoryDirs", "Instance directory name (controller): " + directories[i].getAbsolutePath()); //now look for empty servant directories File[] childFiles = AccessHelper.listFiles(directories[i], subprocFilter) ; for (File curFile : childFiles) { if (debugLogger.isLoggable(Level.FINE) && isDebugEnabled()) debugLogger.logp(Level.FINE, thisClass, "deleteEmptyRepositoryDirs", "Servant directory name: " + curFile.getAbsolutePath()); if (!currentDir && !parentFilesMap.containsKey(curFile)) { if (debugLogger.isLoggable(Level.FINE) && isDebugEnabled()) debugLogger.logp(Level.FINE, thisClass, "deleteEmptyRepositoryDirs", "Found an empty servant directory: " + curFile); deleteDirectory(curFile); } else { incrementFileCount(curFile); } } //delete directory if empty if (!currentDir && !parentFilesMap.containsKey(directories[i])) { if (debugLogger.isLoggable(Level.FINE) && isDebugEnabled()) debugLogger.logp(Level.FINE, thisClass, "listRepositoryFiles", "Found an empty directory: " + directories[i]); deleteDirectory(directories[i]); } } }
[ "protected", "void", "deleteEmptyRepositoryDirs", "(", ")", "{", "File", "[", "]", "directories", "=", "listRepositoryDirs", "(", ")", ";", "//determine if the server/controller instance directory is empty", "for", "(", "int", "i", "=", "0", ";", "i", "<", "directories", ".", "length", ";", "i", "++", ")", "{", "// This is a directory we should not delete", "boolean", "currentDir", "=", "ivSubDirectory", "!=", "null", "&&", "ivSubDirectory", ".", "compareTo", "(", "directories", "[", "i", "]", ")", "==", "0", ";", "//if a server instance directory does not have a key in parentFilesMap, then it does not have any files ", "if", "(", "debugLogger", ".", "isLoggable", "(", "Level", ".", "FINE", ")", "&&", "isDebugEnabled", "(", ")", ")", "debugLogger", ".", "logp", "(", "Level", ".", "FINE", ",", "thisClass", ",", "\"deleteEmptyRepositoryDirs\"", ",", "\"Instance directory name (controller): \"", "+", "directories", "[", "i", "]", ".", "getAbsolutePath", "(", ")", ")", ";", "//now look for empty servant directories", "File", "[", "]", "childFiles", "=", "AccessHelper", ".", "listFiles", "(", "directories", "[", "i", "]", ",", "subprocFilter", ")", ";", "for", "(", "File", "curFile", ":", "childFiles", ")", "{", "if", "(", "debugLogger", ".", "isLoggable", "(", "Level", ".", "FINE", ")", "&&", "isDebugEnabled", "(", ")", ")", "debugLogger", ".", "logp", "(", "Level", ".", "FINE", ",", "thisClass", ",", "\"deleteEmptyRepositoryDirs\"", ",", "\"Servant directory name: \"", "+", "curFile", ".", "getAbsolutePath", "(", ")", ")", ";", "if", "(", "!", "currentDir", "&&", "!", "parentFilesMap", ".", "containsKey", "(", "curFile", ")", ")", "{", "if", "(", "debugLogger", ".", "isLoggable", "(", "Level", ".", "FINE", ")", "&&", "isDebugEnabled", "(", ")", ")", "debugLogger", ".", "logp", "(", "Level", ".", "FINE", ",", "thisClass", ",", "\"deleteEmptyRepositoryDirs\"", ",", "\"Found an empty servant directory: \"", "+", "curFile", ")", ";", "deleteDirectory", "(", "curFile", ")", ";", "}", "else", "{", "incrementFileCount", "(", "curFile", ")", ";", "}", "}", "//delete directory if empty", "if", "(", "!", "currentDir", "&&", "!", "parentFilesMap", ".", "containsKey", "(", "directories", "[", "i", "]", ")", ")", "{", "if", "(", "debugLogger", ".", "isLoggable", "(", "Level", ".", "FINE", ")", "&&", "isDebugEnabled", "(", ")", ")", "debugLogger", ".", "logp", "(", "Level", ".", "FINE", ",", "thisClass", ",", "\"listRepositoryFiles\"", ",", "\"Found an empty directory: \"", "+", "directories", "[", "i", "]", ")", ";", "deleteDirectory", "(", "directories", "[", "i", "]", ")", ";", "}", "}", "}" ]
Deletes all empty server instance directories, including empty servant directories
[ "Deletes", "all", "empty", "server", "instance", "directories", "including", "empty", "servant", "directories" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/LogRepositoryManagerImpl.java#L244-L275
train
OpenLiberty/open-liberty
dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/LogRepositoryManagerImpl.java
LogRepositoryManagerImpl.deleteDirectory
protected void deleteDirectory(File directoryName){ if (debugLogger.isLoggable(Level.FINE) && isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "deleteDirectory", "empty directory "+((directoryName == null) ? "None": directoryName.getPath())); } if (AccessHelper.deleteFile(directoryName)) { // If directory is empty, delete if (debugLogger.isLoggable(Level.FINE) && isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "deleteDirectory", "delete "+directoryName.getName()); } } else { // Else the directory is not empty, and deletion fails if (isDebugEnabled()) { debugLogger.logp(Level.WARNING, thisClass, "deleteDirectory", "Failed to delete directory "+directoryName.getPath()); } } }
java
protected void deleteDirectory(File directoryName){ if (debugLogger.isLoggable(Level.FINE) && isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "deleteDirectory", "empty directory "+((directoryName == null) ? "None": directoryName.getPath())); } if (AccessHelper.deleteFile(directoryName)) { // If directory is empty, delete if (debugLogger.isLoggable(Level.FINE) && isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "deleteDirectory", "delete "+directoryName.getName()); } } else { // Else the directory is not empty, and deletion fails if (isDebugEnabled()) { debugLogger.logp(Level.WARNING, thisClass, "deleteDirectory", "Failed to delete directory "+directoryName.getPath()); } } }
[ "protected", "void", "deleteDirectory", "(", "File", "directoryName", ")", "{", "if", "(", "debugLogger", ".", "isLoggable", "(", "Level", ".", "FINE", ")", "&&", "isDebugEnabled", "(", ")", ")", "{", "debugLogger", ".", "logp", "(", "Level", ".", "FINE", ",", "thisClass", ",", "\"deleteDirectory\"", ",", "\"empty directory \"", "+", "(", "(", "directoryName", "==", "null", ")", "?", "\"None\"", ":", "directoryName", ".", "getPath", "(", ")", ")", ")", ";", "}", "if", "(", "AccessHelper", ".", "deleteFile", "(", "directoryName", ")", ")", "{", "// If directory is empty, delete", "if", "(", "debugLogger", ".", "isLoggable", "(", "Level", ".", "FINE", ")", "&&", "isDebugEnabled", "(", ")", ")", "{", "debugLogger", ".", "logp", "(", "Level", ".", "FINE", ",", "thisClass", ",", "\"deleteDirectory\"", ",", "\"delete \"", "+", "directoryName", ".", "getName", "(", ")", ")", ";", "}", "}", "else", "{", "// Else the directory is not empty, and deletion fails", "if", "(", "isDebugEnabled", "(", ")", ")", "{", "debugLogger", ".", "logp", "(", "Level", ".", "WARNING", ",", "thisClass", ",", "\"deleteDirectory\"", ",", "\"Failed to delete directory \"", "+", "directoryName", ".", "getPath", "(", ")", ")", ";", "}", "}", "}" ]
Deletes the specified directory @param the name of the directory to be deleted
[ "Deletes", "the", "specified", "directory" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/LogRepositoryManagerImpl.java#L281-L296
train
OpenLiberty/open-liberty
dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/LogRepositoryManagerImpl.java
LogRepositoryManagerImpl.purgeOldFiles
private boolean purgeOldFiles(long total) { boolean result = false; // Should delete some files. if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "purgeOldFiles", "total: "+total+" listSz: "+fileList.size()); } while(total > 0 && fileList.size() > 1) { FileDetails details = purgeOldestFile(); if (details != null) { if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "purgeOldFiles", "Purged: "+details.file.getPath()+" sz: "+details.size); } total -= details.size; result = true; } } return result; }
java
private boolean purgeOldFiles(long total) { boolean result = false; // Should delete some files. if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "purgeOldFiles", "total: "+total+" listSz: "+fileList.size()); } while(total > 0 && fileList.size() > 1) { FileDetails details = purgeOldestFile(); if (details != null) { if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "purgeOldFiles", "Purged: "+details.file.getPath()+" sz: "+details.size); } total -= details.size; result = true; } } return result; }
[ "private", "boolean", "purgeOldFiles", "(", "long", "total", ")", "{", "boolean", "result", "=", "false", ";", "// Should delete some files.", "if", "(", "debugLogger", ".", "isLoggable", "(", "Level", ".", "FINE", ")", "&&", "LogRepositoryBaseImpl", ".", "isDebugEnabled", "(", ")", ")", "{", "debugLogger", ".", "logp", "(", "Level", ".", "FINE", ",", "thisClass", ",", "\"purgeOldFiles\"", ",", "\"total: \"", "+", "total", "+", "\" listSz: \"", "+", "fileList", ".", "size", "(", ")", ")", ";", "}", "while", "(", "total", ">", "0", "&&", "fileList", ".", "size", "(", ")", ">", "1", ")", "{", "FileDetails", "details", "=", "purgeOldestFile", "(", ")", ";", "if", "(", "details", "!=", "null", ")", "{", "if", "(", "debugLogger", ".", "isLoggable", "(", "Level", ".", "FINE", ")", "&&", "LogRepositoryBaseImpl", ".", "isDebugEnabled", "(", ")", ")", "{", "debugLogger", ".", "logp", "(", "Level", ".", "FINE", ",", "thisClass", ",", "\"purgeOldFiles\"", ",", "\"Purged: \"", "+", "details", ".", "file", ".", "getPath", "(", ")", "+", "\" sz: \"", "+", "details", ".", "size", ")", ";", "}", "total", "-=", "details", ".", "size", ";", "result", "=", "true", ";", "}", "}", "return", "result", ";", "}" ]
Removes old files from the repository. This method does not remove the most recent file. This method should be called while holding a lock on fileList. @param total the amount in bytes of required free space. @return <code>true</code> if at least one file was removed from the repository.
[ "Removes", "old", "files", "from", "the", "repository", ".", "This", "method", "does", "not", "remove", "the", "most", "recent", "file", ".", "This", "method", "should", "be", "called", "while", "holding", "a", "lock", "on", "fileList", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/LogRepositoryManagerImpl.java#L356-L373
train
OpenLiberty/open-liberty
dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/LogRepositoryManagerImpl.java
LogRepositoryManagerImpl.purgeOldestFile
private FileDetails purgeOldestFile() { debugListLL("prepurgeOldestFile") ; debugListHM("prepurgeOldestFile") ; FileDetails returnFD = getOldestInactive() ; if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "purgeOldestFile", "oldestInactive: "+((returnFD == null) ? "None": returnFD.file.getPath())); } if (returnFD == null) return null ; if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "purgeOldestFile", "fileList size before remove: "+fileList.size()) ; } if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "purgeOldestFile", "fileList size after remove: "+fileList.size()) ; } if (AccessHelper.deleteFile(returnFD.file)) { fileList.remove(returnFD) ; totalSize -= returnFD.size; if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "purgeOldestFile", "delete: "+returnFD.file.getName()); } decrementFileCount(returnFD.file); notifyOfFileAction(LogEventListener.EVENTTYPEDELETE) ; // F004324 } else { // Assume the list is out of sync. if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "purgeOldestFile", "Failed to delete file: "+returnFD.file.getPath()); } initFileList(true); returnFD = null; } debugListLL("postpurgeOldestFile") ; return returnFD; }
java
private FileDetails purgeOldestFile() { debugListLL("prepurgeOldestFile") ; debugListHM("prepurgeOldestFile") ; FileDetails returnFD = getOldestInactive() ; if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "purgeOldestFile", "oldestInactive: "+((returnFD == null) ? "None": returnFD.file.getPath())); } if (returnFD == null) return null ; if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "purgeOldestFile", "fileList size before remove: "+fileList.size()) ; } if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "purgeOldestFile", "fileList size after remove: "+fileList.size()) ; } if (AccessHelper.deleteFile(returnFD.file)) { fileList.remove(returnFD) ; totalSize -= returnFD.size; if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "purgeOldestFile", "delete: "+returnFD.file.getName()); } decrementFileCount(returnFD.file); notifyOfFileAction(LogEventListener.EVENTTYPEDELETE) ; // F004324 } else { // Assume the list is out of sync. if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "purgeOldestFile", "Failed to delete file: "+returnFD.file.getPath()); } initFileList(true); returnFD = null; } debugListLL("postpurgeOldestFile") ; return returnFD; }
[ "private", "FileDetails", "purgeOldestFile", "(", ")", "{", "debugListLL", "(", "\"prepurgeOldestFile\"", ")", ";", "debugListHM", "(", "\"prepurgeOldestFile\"", ")", ";", "FileDetails", "returnFD", "=", "getOldestInactive", "(", ")", ";", "if", "(", "debugLogger", ".", "isLoggable", "(", "Level", ".", "FINE", ")", "&&", "LogRepositoryBaseImpl", ".", "isDebugEnabled", "(", ")", ")", "{", "debugLogger", ".", "logp", "(", "Level", ".", "FINE", ",", "thisClass", ",", "\"purgeOldestFile\"", ",", "\"oldestInactive: \"", "+", "(", "(", "returnFD", "==", "null", ")", "?", "\"None\"", ":", "returnFD", ".", "file", ".", "getPath", "(", ")", ")", ")", ";", "}", "if", "(", "returnFD", "==", "null", ")", "return", "null", ";", "if", "(", "debugLogger", ".", "isLoggable", "(", "Level", ".", "FINE", ")", "&&", "LogRepositoryBaseImpl", ".", "isDebugEnabled", "(", ")", ")", "{", "debugLogger", ".", "logp", "(", "Level", ".", "FINE", ",", "thisClass", ",", "\"purgeOldestFile\"", ",", "\"fileList size before remove: \"", "+", "fileList", ".", "size", "(", ")", ")", ";", "}", "if", "(", "debugLogger", ".", "isLoggable", "(", "Level", ".", "FINE", ")", "&&", "LogRepositoryBaseImpl", ".", "isDebugEnabled", "(", ")", ")", "{", "debugLogger", ".", "logp", "(", "Level", ".", "FINE", ",", "thisClass", ",", "\"purgeOldestFile\"", ",", "\"fileList size after remove: \"", "+", "fileList", ".", "size", "(", ")", ")", ";", "}", "if", "(", "AccessHelper", ".", "deleteFile", "(", "returnFD", ".", "file", ")", ")", "{", "fileList", ".", "remove", "(", "returnFD", ")", ";", "totalSize", "-=", "returnFD", ".", "size", ";", "if", "(", "debugLogger", ".", "isLoggable", "(", "Level", ".", "FINE", ")", "&&", "LogRepositoryBaseImpl", ".", "isDebugEnabled", "(", ")", ")", "{", "debugLogger", ".", "logp", "(", "Level", ".", "FINE", ",", "thisClass", ",", "\"purgeOldestFile\"", ",", "\"delete: \"", "+", "returnFD", ".", "file", ".", "getName", "(", ")", ")", ";", "}", "decrementFileCount", "(", "returnFD", ".", "file", ")", ";", "notifyOfFileAction", "(", "LogEventListener", ".", "EVENTTYPEDELETE", ")", ";", "// F004324", "}", "else", "{", "// Assume the list is out of sync.", "if", "(", "debugLogger", ".", "isLoggable", "(", "Level", ".", "FINE", ")", "&&", "LogRepositoryBaseImpl", ".", "isDebugEnabled", "(", ")", ")", "{", "debugLogger", ".", "logp", "(", "Level", ".", "FINE", ",", "thisClass", ",", "\"purgeOldestFile\"", ",", "\"Failed to delete file: \"", "+", "returnFD", ".", "file", ".", "getPath", "(", ")", ")", ";", "}", "initFileList", "(", "true", ")", ";", "returnFD", "=", "null", ";", "}", "debugListLL", "(", "\"postpurgeOldestFile\"", ")", ";", "return", "returnFD", ";", "}" ]
Removes the oldest file from the repository. This method has logic to avoid removing currently active files This method should be called with a lock on filelist already attained @return instance representing the deleted file or <code>null</code> if fileList was reinitinialized.
[ "Removes", "the", "oldest", "file", "from", "the", "repository", ".", "This", "method", "has", "logic", "to", "avoid", "removing", "currently", "active", "files", "This", "method", "should", "be", "called", "with", "a", "lock", "on", "filelist", "already", "attained" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/LogRepositoryManagerImpl.java#L382-L418
train
OpenLiberty/open-liberty
dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/LogRepositoryManagerImpl.java
LogRepositoryManagerImpl.addNewFileFromSubProcess
public synchronized String addNewFileFromSubProcess(long spTimeStamp, String spPid, String spLabel) { // TODO: It is theoretically possible that subProcess already created one of these (although it won't happen in our scenario. // Consider either pulling actual pid from the files on initFileList or looking for the file here before adding it. If found, // adjust the pid to this pid. checkSpaceConstrain(maxLogFileSize) ; if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "addNewFileFromSubProcess", "Tstamp: "+spTimeStamp+ " pid: "+spPid+" lbl: "+spLabel+" Max: "+maxLogFileSize); } if (ivSubDirectory == null) getControllingProcessDirectory(spTimeStamp, svPid) ; // Note: passing, pid of this region, not sending child region if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "addNewFileFromSubProcess", "Got ivSubDir: "+ivSubDirectory.getPath()); } File servantDirectory = new File(ivSubDirectory, getLogDirectoryName(-1, spPid, spLabel)) ; File servantFile = getLogFile(servantDirectory, spTimeStamp) ; FileDetails thisFile = new FileDetails(servantFile, spTimeStamp, maxLogFileSize, spPid) ; synchronized(fileList) { initFileList(false) ; fileList.add(thisFile) ; // Not active as new one was created incrementFileCount(servantFile); synchronized(activeFilesMap) { // In this block so that fileList always locked first activeFilesMap.put(spPid, thisFile) ; } } totalSize += maxLogFileSize ; if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "addNewFileFromSubProcess", "Added file: "+servantFile.getPath()+" sz:"+maxLogFileSize+" tstmp: "+spTimeStamp) ; debugListLL("postAddFromSP") ; debugListHM("postAddFromSP") ; } return servantFile.getPath() ; }
java
public synchronized String addNewFileFromSubProcess(long spTimeStamp, String spPid, String spLabel) { // TODO: It is theoretically possible that subProcess already created one of these (although it won't happen in our scenario. // Consider either pulling actual pid from the files on initFileList or looking for the file here before adding it. If found, // adjust the pid to this pid. checkSpaceConstrain(maxLogFileSize) ; if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "addNewFileFromSubProcess", "Tstamp: "+spTimeStamp+ " pid: "+spPid+" lbl: "+spLabel+" Max: "+maxLogFileSize); } if (ivSubDirectory == null) getControllingProcessDirectory(spTimeStamp, svPid) ; // Note: passing, pid of this region, not sending child region if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "addNewFileFromSubProcess", "Got ivSubDir: "+ivSubDirectory.getPath()); } File servantDirectory = new File(ivSubDirectory, getLogDirectoryName(-1, spPid, spLabel)) ; File servantFile = getLogFile(servantDirectory, spTimeStamp) ; FileDetails thisFile = new FileDetails(servantFile, spTimeStamp, maxLogFileSize, spPid) ; synchronized(fileList) { initFileList(false) ; fileList.add(thisFile) ; // Not active as new one was created incrementFileCount(servantFile); synchronized(activeFilesMap) { // In this block so that fileList always locked first activeFilesMap.put(spPid, thisFile) ; } } totalSize += maxLogFileSize ; if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "addNewFileFromSubProcess", "Added file: "+servantFile.getPath()+" sz:"+maxLogFileSize+" tstmp: "+spTimeStamp) ; debugListLL("postAddFromSP") ; debugListHM("postAddFromSP") ; } return servantFile.getPath() ; }
[ "public", "synchronized", "String", "addNewFileFromSubProcess", "(", "long", "spTimeStamp", ",", "String", "spPid", ",", "String", "spLabel", ")", "{", "// TODO: It is theoretically possible that subProcess already created one of these (although it won't happen in our scenario.", "// Consider either pulling actual pid from the files on initFileList or looking for the file here before adding it. If found,", "// adjust the pid to this pid.", "checkSpaceConstrain", "(", "maxLogFileSize", ")", ";", "if", "(", "debugLogger", ".", "isLoggable", "(", "Level", ".", "FINE", ")", "&&", "LogRepositoryBaseImpl", ".", "isDebugEnabled", "(", ")", ")", "{", "debugLogger", ".", "logp", "(", "Level", ".", "FINE", ",", "thisClass", ",", "\"addNewFileFromSubProcess\"", ",", "\"Tstamp: \"", "+", "spTimeStamp", "+", "\" pid: \"", "+", "spPid", "+", "\" lbl: \"", "+", "spLabel", "+", "\" Max: \"", "+", "maxLogFileSize", ")", ";", "}", "if", "(", "ivSubDirectory", "==", "null", ")", "getControllingProcessDirectory", "(", "spTimeStamp", ",", "svPid", ")", ";", "// Note: passing, pid of this region, not sending child region", "if", "(", "debugLogger", ".", "isLoggable", "(", "Level", ".", "FINE", ")", "&&", "LogRepositoryBaseImpl", ".", "isDebugEnabled", "(", ")", ")", "{", "debugLogger", ".", "logp", "(", "Level", ".", "FINE", ",", "thisClass", ",", "\"addNewFileFromSubProcess\"", ",", "\"Got ivSubDir: \"", "+", "ivSubDirectory", ".", "getPath", "(", ")", ")", ";", "}", "File", "servantDirectory", "=", "new", "File", "(", "ivSubDirectory", ",", "getLogDirectoryName", "(", "-", "1", ",", "spPid", ",", "spLabel", ")", ")", ";", "File", "servantFile", "=", "getLogFile", "(", "servantDirectory", ",", "spTimeStamp", ")", ";", "FileDetails", "thisFile", "=", "new", "FileDetails", "(", "servantFile", ",", "spTimeStamp", ",", "maxLogFileSize", ",", "spPid", ")", ";", "synchronized", "(", "fileList", ")", "{", "initFileList", "(", "false", ")", ";", "fileList", ".", "add", "(", "thisFile", ")", ";", "// Not active as new one was created", "incrementFileCount", "(", "servantFile", ")", ";", "synchronized", "(", "activeFilesMap", ")", "{", "// In this block so that fileList always locked first", "activeFilesMap", ".", "put", "(", "spPid", ",", "thisFile", ")", ";", "}", "}", "totalSize", "+=", "maxLogFileSize", ";", "if", "(", "debugLogger", ".", "isLoggable", "(", "Level", ".", "FINE", ")", "&&", "LogRepositoryBaseImpl", ".", "isDebugEnabled", "(", ")", ")", "{", "debugLogger", ".", "logp", "(", "Level", ".", "FINE", ",", "thisClass", ",", "\"addNewFileFromSubProcess\"", ",", "\"Added file: \"", "+", "servantFile", ".", "getPath", "(", ")", "+", "\" sz:\"", "+", "maxLogFileSize", "+", "\" tstmp: \"", "+", "spTimeStamp", ")", ";", "debugListLL", "(", "\"postAddFromSP\"", ")", ";", "debugListHM", "(", "\"postAddFromSP\"", ")", ";", "}", "return", "servantFile", ".", "getPath", "(", ")", ";", "}" ]
add information about a new file being created by a subProcess in order to maintain retention information. This is done for all files created by each subProcess. If IPC facility is not ready, subProcess may have to create first, then notify when IPC is up. @param spTimeStamp timestamp to associate with the file @param spPid ProcessId of the process that is creating the file (initiator of this action) @param spLabel Label to be used as part of the file name @return the full path of the file subprocess need to use for log records
[ "add", "information", "about", "a", "new", "file", "being", "created", "by", "a", "subProcess", "in", "order", "to", "maintain", "retention", "information", ".", "This", "is", "done", "for", "all", "files", "created", "by", "each", "subProcess", ".", "If", "IPC", "facility", "is", "not", "ready", "subProcess", "may", "have", "to", "create", "first", "then", "notify", "when", "IPC", "is", "up", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/LogRepositoryManagerImpl.java#L462-L496
train
OpenLiberty/open-liberty
dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/LogRepositoryManagerImpl.java
LogRepositoryManagerImpl.inactivateSubProcess
public void inactivateSubProcess(String spPid) { synchronized (fileList) { // always lock fileList first to avoid deadlock synchronized(activeFilesMap) { // Right into sync block because 99% case is that map contains pid activeFilesMap.remove(spPid) ; } } if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "inactivateSubProcess", "Inactivated pid: "+spPid) ; } }
java
public void inactivateSubProcess(String spPid) { synchronized (fileList) { // always lock fileList first to avoid deadlock synchronized(activeFilesMap) { // Right into sync block because 99% case is that map contains pid activeFilesMap.remove(spPid) ; } } if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) { debugLogger.logp(Level.FINE, thisClass, "inactivateSubProcess", "Inactivated pid: "+spPid) ; } }
[ "public", "void", "inactivateSubProcess", "(", "String", "spPid", ")", "{", "synchronized", "(", "fileList", ")", "{", "// always lock fileList first to avoid deadlock", "synchronized", "(", "activeFilesMap", ")", "{", "// Right into sync block because 99% case is that map contains pid", "activeFilesMap", ".", "remove", "(", "spPid", ")", ";", "}", "}", "if", "(", "debugLogger", ".", "isLoggable", "(", "Level", ".", "FINE", ")", "&&", "LogRepositoryBaseImpl", ".", "isDebugEnabled", "(", ")", ")", "{", "debugLogger", ".", "logp", "(", "Level", ".", "FINE", ",", "thisClass", ",", "\"inactivateSubProcess\"", ",", "\"Inactivated pid: \"", "+", "spPid", ")", ";", "}", "}" ]
inactivate active file for a given process. Should only be one file active for a process @param spPid
[ "inactivate", "active", "file", "for", "a", "given", "process", ".", "Should", "only", "be", "one", "file", "active", "for", "a", "process" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/LogRepositoryManagerImpl.java#L502-L511
train
OpenLiberty/open-liberty
dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/servlet/FileServletWrapper.java
FileServletWrapper.getContentLength
protected int getContentLength(boolean update) { if (update){ contentLength = (int) this.getFileSize(update); return contentLength; } else { if (contentLength==-1){ contentLength = (int) this.getFileSize(update); return contentLength; } else { return contentLength; } } }
java
protected int getContentLength(boolean update) { if (update){ contentLength = (int) this.getFileSize(update); return contentLength; } else { if (contentLength==-1){ contentLength = (int) this.getFileSize(update); return contentLength; } else { return contentLength; } } }
[ "protected", "int", "getContentLength", "(", "boolean", "update", ")", "{", "if", "(", "update", ")", "{", "contentLength", "=", "(", "int", ")", "this", ".", "getFileSize", "(", "update", ")", ";", "return", "contentLength", ";", "}", "else", "{", "if", "(", "contentLength", "==", "-", "1", ")", "{", "contentLength", "=", "(", "int", ")", "this", ".", "getFileSize", "(", "update", ")", ";", "return", "contentLength", ";", "}", "else", "{", "return", "contentLength", ";", "}", "}", "}" ]
PM92967, pulled up method
[ "PM92967", "pulled", "up", "method" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/servlet/FileServletWrapper.java#L744-L757
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/util/ScheduleExpressionParserException.java
ScheduleExpressionParserException.logError
public void logError(String moduleName, String beanName, String methodName) { Tr.error(tc, ivError.getMessageId(), new Object[] { beanName, moduleName, methodName, ivField }); }
java
public void logError(String moduleName, String beanName, String methodName) { Tr.error(tc, ivError.getMessageId(), new Object[] { beanName, moduleName, methodName, ivField }); }
[ "public", "void", "logError", "(", "String", "moduleName", ",", "String", "beanName", ",", "String", "methodName", ")", "{", "Tr", ".", "error", "(", "tc", ",", "ivError", ".", "getMessageId", "(", ")", ",", "new", "Object", "[", "]", "{", "beanName", ",", "moduleName", ",", "methodName", ",", "ivField", "}", ")", ";", "}" ]
Logs an error message corresponding to this exception. @param moduleName the module name @param beanName the bean name
[ "Logs", "an", "error", "message", "corresponding", "to", "this", "exception", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/util/ScheduleExpressionParserException.java#L95-L98
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/SIMPItem.java
SIMPItem.restore
protected void restore(ObjectInputStream ois, int dataVersion) throws SevereMessageStoreException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "restore", new Object[] { dataVersion}); checkPersistentVersionId(dataVersion); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "restore"); }
java
protected void restore(ObjectInputStream ois, int dataVersion) throws SevereMessageStoreException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "restore", new Object[] { dataVersion}); checkPersistentVersionId(dataVersion); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "restore"); }
[ "protected", "void", "restore", "(", "ObjectInputStream", "ois", ",", "int", "dataVersion", ")", "throws", "SevereMessageStoreException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"restore\"", ",", "new", "Object", "[", "]", "{", "dataVersion", "}", ")", ";", "checkPersistentVersionId", "(", "dataVersion", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"restore\"", ")", ";", "}" ]
Child classes should override this method to restore their persistent data. @param ois ObjectInputStream to restore data from. @param dataVersion Version number of object read from store. @throws SevereMessageStoreException
[ "Child", "classes", "should", "override", "this", "method", "to", "restore", "their", "persistent", "data", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/SIMPItem.java#L110-L118
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/FileDirObjectStore.java
FileDirObjectStore.captureCheckpointManagedObjects
synchronized void captureCheckpointManagedObjects() { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, "captureCheckpointManagedObjectsremove" ); // Now that we are synchronized check that we have not captured the checkpoint sets already. if (checkpointManagedObjectsToWrite == null) { // Take the tokens to write first, if we miss a delete we will catch it next time. // The managedObjectsToWrite and tokensToDelete sets are volatile so users of the store will move to them // promptly. checkpointManagedObjectsToWrite = managedObjectsToWrite; managedObjectsToWrite = new ConcurrentHashMap(concurrency); checkpointTokensToDelete = tokensToDelete; tokensToDelete = new ConcurrentHashMap(concurrency); } if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, "captureCheckpointManagedObjects"); }
java
synchronized void captureCheckpointManagedObjects() { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, "captureCheckpointManagedObjectsremove" ); // Now that we are synchronized check that we have not captured the checkpoint sets already. if (checkpointManagedObjectsToWrite == null) { // Take the tokens to write first, if we miss a delete we will catch it next time. // The managedObjectsToWrite and tokensToDelete sets are volatile so users of the store will move to them // promptly. checkpointManagedObjectsToWrite = managedObjectsToWrite; managedObjectsToWrite = new ConcurrentHashMap(concurrency); checkpointTokensToDelete = tokensToDelete; tokensToDelete = new ConcurrentHashMap(concurrency); } if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, "captureCheckpointManagedObjects"); }
[ "synchronized", "void", "captureCheckpointManagedObjects", "(", ")", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "\"captureCheckpointManagedObjectsremove\"", ")", ";", "// Now that we are synchronized check that we have not captured the checkpoint sets already. ", "if", "(", "checkpointManagedObjectsToWrite", "==", "null", ")", "{", "// Take the tokens to write first, if we miss a delete we will catch it next time. ", "// The managedObjectsToWrite and tokensToDelete sets are volatile so users of the store will move to them ", "// promptly.", "checkpointManagedObjectsToWrite", "=", "managedObjectsToWrite", ";", "managedObjectsToWrite", "=", "new", "ConcurrentHashMap", "(", "concurrency", ")", ";", "checkpointTokensToDelete", "=", "tokensToDelete", ";", "tokensToDelete", "=", "new", "ConcurrentHashMap", "(", "concurrency", ")", ";", "}", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"captureCheckpointManagedObjects\"", ")", ";", "}" ]
Capture the ManagedObjects to write and delete as part of the checkpoint.
[ "Capture", "the", "ManagedObjects", "to", "write", "and", "delete", "as", "part", "of", "the", "checkpoint", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/FileDirObjectStore.java#L436-L459
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/FileDirObjectStore.java
FileDirObjectStore.write
private void write(ManagedObject managedObject) throws ObjectManagerException { final String methodName = "write"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName, new Object[] { managedObject }); // Pick up and write the latest serialized bytes. ObjectManagerByteArrayOutputStream serializedBytes = null; if (usesSerializedForm) { // Pick up and write the latest serialized bytes. // It is possible that several threads requested a write one after the // other each getting the request added to a different managedObjetsToWrite table, // however the first of these through here will clear serializedBytes. // It is also possible that the transaction state of the managed object // was restored from a checkpoint, in which case the serialized object // may already be in the ObjectStore, and the serializedBytes will again be null. // Is the Object deleted? It may have got deleted after we release the // synchronize lock when we // captured the tokensToWrite hashtable but before we actually try to write it. if (managedObject.state != ManagedObject.stateDeleted) serializedBytes = managedObject.freeLatestSerializedBytes(); } else { // Not logged so use the current serialized bytes, as long as its not part of a transaction. // If it is part of a transaction then the transaction will hold the ManagedObject in memory. // Not locked because this is only used by SAVE_ONLY_ON_SHUTDOWN stores at shutdown // when no appliaction threads are active. if (managedObject.state == ManagedObject.stateReady) serializedBytes = managedObject.getSerializedBytes(); } // if ( usesSerializedForm ). // It is possible that several threads requested a write one after the other each getting the request added // to a different tokensToWrite table, however the first of these through here will clear serializedBytes. if (serializedBytes != null) { // Already done by another thread? try { java.io.FileOutputStream storeFileOutputStream = new java.io.FileOutputStream(storeDirectoryName + java.io.File.separator + managedObject.owningToken.storedObjectIdentifier); storeFileOutputStream.write(serializedBytes.getBuffer(), 0, serializedBytes.getCount()); storeFileOutputStream.flush(); storeFileOutputStream.close(); } catch (java.io.IOException exception) { // No FFDC Code Needed. ObjectManager.ffdc.processException(this, cclass, methodName, exception, "1:656:1.17"); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName, new Object[] { exception }); throw new PermanentIOException(this, exception); } // catch java.io.IOException. managedObjectsOnDisk.add(new Long(managedObject.owningToken.storedObjectIdentifier)); } // if (serializedBytes != null ). if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName); }
java
private void write(ManagedObject managedObject) throws ObjectManagerException { final String methodName = "write"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName, new Object[] { managedObject }); // Pick up and write the latest serialized bytes. ObjectManagerByteArrayOutputStream serializedBytes = null; if (usesSerializedForm) { // Pick up and write the latest serialized bytes. // It is possible that several threads requested a write one after the // other each getting the request added to a different managedObjetsToWrite table, // however the first of these through here will clear serializedBytes. // It is also possible that the transaction state of the managed object // was restored from a checkpoint, in which case the serialized object // may already be in the ObjectStore, and the serializedBytes will again be null. // Is the Object deleted? It may have got deleted after we release the // synchronize lock when we // captured the tokensToWrite hashtable but before we actually try to write it. if (managedObject.state != ManagedObject.stateDeleted) serializedBytes = managedObject.freeLatestSerializedBytes(); } else { // Not logged so use the current serialized bytes, as long as its not part of a transaction. // If it is part of a transaction then the transaction will hold the ManagedObject in memory. // Not locked because this is only used by SAVE_ONLY_ON_SHUTDOWN stores at shutdown // when no appliaction threads are active. if (managedObject.state == ManagedObject.stateReady) serializedBytes = managedObject.getSerializedBytes(); } // if ( usesSerializedForm ). // It is possible that several threads requested a write one after the other each getting the request added // to a different tokensToWrite table, however the first of these through here will clear serializedBytes. if (serializedBytes != null) { // Already done by another thread? try { java.io.FileOutputStream storeFileOutputStream = new java.io.FileOutputStream(storeDirectoryName + java.io.File.separator + managedObject.owningToken.storedObjectIdentifier); storeFileOutputStream.write(serializedBytes.getBuffer(), 0, serializedBytes.getCount()); storeFileOutputStream.flush(); storeFileOutputStream.close(); } catch (java.io.IOException exception) { // No FFDC Code Needed. ObjectManager.ffdc.processException(this, cclass, methodName, exception, "1:656:1.17"); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName, new Object[] { exception }); throw new PermanentIOException(this, exception); } // catch java.io.IOException. managedObjectsOnDisk.add(new Long(managedObject.owningToken.storedObjectIdentifier)); } // if (serializedBytes != null ). if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName); }
[ "private", "void", "write", "(", "ManagedObject", "managedObject", ")", "throws", "ObjectManagerException", "{", "final", "String", "methodName", "=", "\"write\"", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "methodName", ",", "new", "Object", "[", "]", "{", "managedObject", "}", ")", ";", "// Pick up and write the latest serialized bytes.", "ObjectManagerByteArrayOutputStream", "serializedBytes", "=", "null", ";", "if", "(", "usesSerializedForm", ")", "{", "// Pick up and write the latest serialized bytes.", "// It is possible that several threads requested a write one after the", "// other each getting the request added to a different managedObjetsToWrite table,", "// however the first of these through here will clear serializedBytes.", "// It is also possible that the transaction state of the managed object", "// was restored from a checkpoint, in which case the serialized object", "// may already be in the ObjectStore, and the serializedBytes will again be null.", "// Is the Object deleted? It may have got deleted after we release the", "// synchronize lock when we", "// captured the tokensToWrite hashtable but before we actually try to write it.", "if", "(", "managedObject", ".", "state", "!=", "ManagedObject", ".", "stateDeleted", ")", "serializedBytes", "=", "managedObject", ".", "freeLatestSerializedBytes", "(", ")", ";", "}", "else", "{", "// Not logged so use the current serialized bytes, as long as its not part of a transaction.", "// If it is part of a transaction then the transaction will hold the ManagedObject in memory.", "// Not locked because this is only used by SAVE_ONLY_ON_SHUTDOWN stores at shutdown", "// when no appliaction threads are active.", "if", "(", "managedObject", ".", "state", "==", "ManagedObject", ".", "stateReady", ")", "serializedBytes", "=", "managedObject", ".", "getSerializedBytes", "(", ")", ";", "}", "// if ( usesSerializedForm ).", "// It is possible that several threads requested a write one after the other each getting the request added", "// to a different tokensToWrite table, however the first of these through here will clear serializedBytes.", "if", "(", "serializedBytes", "!=", "null", ")", "{", "// Already done by another thread?", "try", "{", "java", ".", "io", ".", "FileOutputStream", "storeFileOutputStream", "=", "new", "java", ".", "io", ".", "FileOutputStream", "(", "storeDirectoryName", "+", "java", ".", "io", ".", "File", ".", "separator", "+", "managedObject", ".", "owningToken", ".", "storedObjectIdentifier", ")", ";", "storeFileOutputStream", ".", "write", "(", "serializedBytes", ".", "getBuffer", "(", ")", ",", "0", ",", "serializedBytes", ".", "getCount", "(", ")", ")", ";", "storeFileOutputStream", ".", "flush", "(", ")", ";", "storeFileOutputStream", ".", "close", "(", ")", ";", "}", "catch", "(", "java", ".", "io", ".", "IOException", "exception", ")", "{", "// No FFDC Code Needed.", "ObjectManager", ".", "ffdc", ".", "processException", "(", "this", ",", "cclass", ",", "methodName", ",", "exception", ",", "\"1:656:1.17\"", ")", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "methodName", ",", "new", "Object", "[", "]", "{", "exception", "}", ")", ";", "throw", "new", "PermanentIOException", "(", "this", ",", "exception", ")", ";", "}", "// catch java.io.IOException.", "managedObjectsOnDisk", ".", "add", "(", "new", "Long", "(", "managedObject", ".", "owningToken", ".", "storedObjectIdentifier", ")", ")", ";", "}", "// if (serializedBytes != null ).", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "methodName", ")", ";", "}" ]
Writes an object to hardened storage, but may return before the write completes. @param managedObject to be written. @throws ObjectManagerException
[ "Writes", "an", "object", "to", "hardened", "storage", "but", "may", "return", "before", "the", "write", "completes", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/FileDirObjectStore.java#L607-L679
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/FileDirObjectStore.java
FileDirObjectStore.writeHeader
public void writeHeader() throws ObjectManagerException { final String methodName = "writeHeader"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName); try { java.io.FileOutputStream headerOutputStream = new java.io.FileOutputStream(storeDirectoryName + java.io.File.separator + headerIdentifier); java.io.DataOutputStream dataOutputStream = new java.io.DataOutputStream(headerOutputStream); java.io.FileDescriptor fileDescriptor = headerOutputStream.getFD(); dataOutputStream.writeInt(version); dataOutputStream.writeLong(objectStoreIdentifier); dataOutputStream.writeLong(sequenceNumber); dataOutputStream.flush(); headerOutputStream.flush(); fileDescriptor.sync(); // Force buffered records to disk. headerOutputStream.close(); } catch (java.io.IOException exception) { // No FFDC Code Needed. ObjectManager.ffdc.processException(this, cclass, methodName, exception, "1:706:1.17"); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName, new Object[] { exception }); throw new PermanentIOException(this, exception); } // catch java.io.IOException. if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName); }
java
public void writeHeader() throws ObjectManagerException { final String methodName = "writeHeader"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName); try { java.io.FileOutputStream headerOutputStream = new java.io.FileOutputStream(storeDirectoryName + java.io.File.separator + headerIdentifier); java.io.DataOutputStream dataOutputStream = new java.io.DataOutputStream(headerOutputStream); java.io.FileDescriptor fileDescriptor = headerOutputStream.getFD(); dataOutputStream.writeInt(version); dataOutputStream.writeLong(objectStoreIdentifier); dataOutputStream.writeLong(sequenceNumber); dataOutputStream.flush(); headerOutputStream.flush(); fileDescriptor.sync(); // Force buffered records to disk. headerOutputStream.close(); } catch (java.io.IOException exception) { // No FFDC Code Needed. ObjectManager.ffdc.processException(this, cclass, methodName, exception, "1:706:1.17"); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName, new Object[] { exception }); throw new PermanentIOException(this, exception); } // catch java.io.IOException. if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName); }
[ "public", "void", "writeHeader", "(", ")", "throws", "ObjectManagerException", "{", "final", "String", "methodName", "=", "\"writeHeader\"", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "methodName", ")", ";", "try", "{", "java", ".", "io", ".", "FileOutputStream", "headerOutputStream", "=", "new", "java", ".", "io", ".", "FileOutputStream", "(", "storeDirectoryName", "+", "java", ".", "io", ".", "File", ".", "separator", "+", "headerIdentifier", ")", ";", "java", ".", "io", ".", "DataOutputStream", "dataOutputStream", "=", "new", "java", ".", "io", ".", "DataOutputStream", "(", "headerOutputStream", ")", ";", "java", ".", "io", ".", "FileDescriptor", "fileDescriptor", "=", "headerOutputStream", ".", "getFD", "(", ")", ";", "dataOutputStream", ".", "writeInt", "(", "version", ")", ";", "dataOutputStream", ".", "writeLong", "(", "objectStoreIdentifier", ")", ";", "dataOutputStream", ".", "writeLong", "(", "sequenceNumber", ")", ";", "dataOutputStream", ".", "flush", "(", ")", ";", "headerOutputStream", ".", "flush", "(", ")", ";", "fileDescriptor", ".", "sync", "(", ")", ";", "// Force buffered records to disk.", "headerOutputStream", ".", "close", "(", ")", ";", "}", "catch", "(", "java", ".", "io", ".", "IOException", "exception", ")", "{", "// No FFDC Code Needed.", "ObjectManager", ".", "ffdc", ".", "processException", "(", "this", ",", "cclass", ",", "methodName", ",", "exception", ",", "\"1:706:1.17\"", ")", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "methodName", ",", "new", "Object", "[", "]", "{", "exception", "}", ")", ";", "throw", "new", "PermanentIOException", "(", "this", ",", "exception", ")", ";", "}", "// catch java.io.IOException.", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "methodName", ")", ";", "}" ]
Write header information for disk in the file headerIdentifier and force it to disk. @throws ObjectManagerException
[ "Write", "header", "information", "for", "disk", "in", "the", "file", "headerIdentifier", "and", "force", "it", "to", "disk", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/FileDirObjectStore.java#L687-L727
train
OpenLiberty/open-liberty
dev/com.ibm.ws.repository.liberty/src/com/ibm/ws/repository/connections/liberty/MainRepository.java
MainRepository.createConnection
public static RestRepositoryConnection createConnection(RestRepositoryConnectionProxy proxy) throws RepositoryBackendIOException { readRepoProperties(proxy); RestRepositoryConnection connection = new RestRepositoryConnection(repoProperties.getProperty(REPOSITORY_URL_PROP).trim()); connection.setProxy(proxy); if (repoProperties.containsKey(API_KEY_PROP)) { connection.setApiKey(repoProperties.getProperty(API_KEY_PROP).trim()); } if (repoProperties.containsKey(USERID_PROP)) { connection.setUserId(repoProperties.getProperty(USERID_PROP).trim()); } if (repoProperties.containsKey(PASSWORD_PROP)) { connection.setPassword(repoProperties.getProperty(PASSWORD_PROP).trim()); } if (repoProperties.containsKey(SOFTLAYER_USERID_PROP)) { connection.setSoftlayerUserId(repoProperties.getProperty(SOFTLAYER_USERID_PROP).trim()); } if (repoProperties.containsKey(SOFTLAYER_PASSWORD_PROP)) { connection.setSoftlayerPassword(repoProperties.getProperty(SOFTLAYER_PASSWORD_PROP).trim()); } if (repoProperties.containsKey(ATTACHMENT_BASIC_AUTH_USERID_PROP)) { connection.setAttachmentBasicAuthUserId(repoProperties.getProperty(ATTACHMENT_BASIC_AUTH_USERID_PROP).trim()); } if (repoProperties.containsKey(ATTACHMENT_BASIC_AUTH_PASSWORD_PROP)) { connection.setAttachmentBasicAuthPassword(repoProperties.getProperty(ATTACHMENT_BASIC_AUTH_PASSWORD_PROP).trim()); } return connection; }
java
public static RestRepositoryConnection createConnection(RestRepositoryConnectionProxy proxy) throws RepositoryBackendIOException { readRepoProperties(proxy); RestRepositoryConnection connection = new RestRepositoryConnection(repoProperties.getProperty(REPOSITORY_URL_PROP).trim()); connection.setProxy(proxy); if (repoProperties.containsKey(API_KEY_PROP)) { connection.setApiKey(repoProperties.getProperty(API_KEY_PROP).trim()); } if (repoProperties.containsKey(USERID_PROP)) { connection.setUserId(repoProperties.getProperty(USERID_PROP).trim()); } if (repoProperties.containsKey(PASSWORD_PROP)) { connection.setPassword(repoProperties.getProperty(PASSWORD_PROP).trim()); } if (repoProperties.containsKey(SOFTLAYER_USERID_PROP)) { connection.setSoftlayerUserId(repoProperties.getProperty(SOFTLAYER_USERID_PROP).trim()); } if (repoProperties.containsKey(SOFTLAYER_PASSWORD_PROP)) { connection.setSoftlayerPassword(repoProperties.getProperty(SOFTLAYER_PASSWORD_PROP).trim()); } if (repoProperties.containsKey(ATTACHMENT_BASIC_AUTH_USERID_PROP)) { connection.setAttachmentBasicAuthUserId(repoProperties.getProperty(ATTACHMENT_BASIC_AUTH_USERID_PROP).trim()); } if (repoProperties.containsKey(ATTACHMENT_BASIC_AUTH_PASSWORD_PROP)) { connection.setAttachmentBasicAuthPassword(repoProperties.getProperty(ATTACHMENT_BASIC_AUTH_PASSWORD_PROP).trim()); } return connection; }
[ "public", "static", "RestRepositoryConnection", "createConnection", "(", "RestRepositoryConnectionProxy", "proxy", ")", "throws", "RepositoryBackendIOException", "{", "readRepoProperties", "(", "proxy", ")", ";", "RestRepositoryConnection", "connection", "=", "new", "RestRepositoryConnection", "(", "repoProperties", ".", "getProperty", "(", "REPOSITORY_URL_PROP", ")", ".", "trim", "(", ")", ")", ";", "connection", ".", "setProxy", "(", "proxy", ")", ";", "if", "(", "repoProperties", ".", "containsKey", "(", "API_KEY_PROP", ")", ")", "{", "connection", ".", "setApiKey", "(", "repoProperties", ".", "getProperty", "(", "API_KEY_PROP", ")", ".", "trim", "(", ")", ")", ";", "}", "if", "(", "repoProperties", ".", "containsKey", "(", "USERID_PROP", ")", ")", "{", "connection", ".", "setUserId", "(", "repoProperties", ".", "getProperty", "(", "USERID_PROP", ")", ".", "trim", "(", ")", ")", ";", "}", "if", "(", "repoProperties", ".", "containsKey", "(", "PASSWORD_PROP", ")", ")", "{", "connection", ".", "setPassword", "(", "repoProperties", ".", "getProperty", "(", "PASSWORD_PROP", ")", ".", "trim", "(", ")", ")", ";", "}", "if", "(", "repoProperties", ".", "containsKey", "(", "SOFTLAYER_USERID_PROP", ")", ")", "{", "connection", ".", "setSoftlayerUserId", "(", "repoProperties", ".", "getProperty", "(", "SOFTLAYER_USERID_PROP", ")", ".", "trim", "(", ")", ")", ";", "}", "if", "(", "repoProperties", ".", "containsKey", "(", "SOFTLAYER_PASSWORD_PROP", ")", ")", "{", "connection", ".", "setSoftlayerPassword", "(", "repoProperties", ".", "getProperty", "(", "SOFTLAYER_PASSWORD_PROP", ")", ".", "trim", "(", ")", ")", ";", "}", "if", "(", "repoProperties", ".", "containsKey", "(", "ATTACHMENT_BASIC_AUTH_USERID_PROP", ")", ")", "{", "connection", ".", "setAttachmentBasicAuthUserId", "(", "repoProperties", ".", "getProperty", "(", "ATTACHMENT_BASIC_AUTH_USERID_PROP", ")", ".", "trim", "(", ")", ")", ";", "}", "if", "(", "repoProperties", ".", "containsKey", "(", "ATTACHMENT_BASIC_AUTH_PASSWORD_PROP", ")", ")", "{", "connection", ".", "setAttachmentBasicAuthPassword", "(", "repoProperties", ".", "getProperty", "(", "ATTACHMENT_BASIC_AUTH_PASSWORD_PROP", ")", ".", "trim", "(", ")", ")", ";", "}", "return", "connection", ";", "}" ]
Creates a LoginInfoEntry with a proxy. This will then load the default repository using a hosted properties file on DHE. @param proxy @throws RepositoryBackendIOException
[ "Creates", "a", "LoginInfoEntry", "with", "a", "proxy", ".", "This", "will", "then", "load", "the", "default", "repository", "using", "a", "hosted", "properties", "file", "on", "DHE", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository.liberty/src/com/ibm/ws/repository/connections/liberty/MainRepository.java#L74-L103
train
OpenLiberty/open-liberty
dev/com.ibm.ws.repository.liberty/src/com/ibm/ws/repository/connections/liberty/MainRepository.java
MainRepository.repositoryDescriptionFileExists
public static boolean repositoryDescriptionFileExists(RestRepositoryConnectionProxy proxy) { boolean exists = false; try { URL propertiesFileURL = getPropertiesFileLocation(); // Are we accessing the properties file (from DHE) using a proxy ? if (proxy != null) { if (proxy.isHTTPorHTTPS()) { Proxy javaNetProxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxy.getProxyURL().getHost(), proxy.getProxyURL().getPort())); URLConnection connection = propertiesFileURL.openConnection(javaNetProxy); InputStream is = connection.getInputStream(); exists = true; is.close(); if (connection instanceof HttpURLConnection) { ((HttpURLConnection) connection).disconnect(); } } else { // The proxy is not an HTTP or HTTPS proxy we do not support this UnsupportedOperationException ue = new UnsupportedOperationException("Non-HTTP proxy not supported"); throw new IOException(ue); } } else { // not using a proxy InputStream is = propertiesFileURL.openStream(); exists = true; is.close(); } } catch (MalformedURLException e) { // ignore } catch (IOException e) { // ignore } return exists; }
java
public static boolean repositoryDescriptionFileExists(RestRepositoryConnectionProxy proxy) { boolean exists = false; try { URL propertiesFileURL = getPropertiesFileLocation(); // Are we accessing the properties file (from DHE) using a proxy ? if (proxy != null) { if (proxy.isHTTPorHTTPS()) { Proxy javaNetProxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxy.getProxyURL().getHost(), proxy.getProxyURL().getPort())); URLConnection connection = propertiesFileURL.openConnection(javaNetProxy); InputStream is = connection.getInputStream(); exists = true; is.close(); if (connection instanceof HttpURLConnection) { ((HttpURLConnection) connection).disconnect(); } } else { // The proxy is not an HTTP or HTTPS proxy we do not support this UnsupportedOperationException ue = new UnsupportedOperationException("Non-HTTP proxy not supported"); throw new IOException(ue); } } else { // not using a proxy InputStream is = propertiesFileURL.openStream(); exists = true; is.close(); } } catch (MalformedURLException e) { // ignore } catch (IOException e) { // ignore } return exists; }
[ "public", "static", "boolean", "repositoryDescriptionFileExists", "(", "RestRepositoryConnectionProxy", "proxy", ")", "{", "boolean", "exists", "=", "false", ";", "try", "{", "URL", "propertiesFileURL", "=", "getPropertiesFileLocation", "(", ")", ";", "// Are we accessing the properties file (from DHE) using a proxy ?", "if", "(", "proxy", "!=", "null", ")", "{", "if", "(", "proxy", ".", "isHTTPorHTTPS", "(", ")", ")", "{", "Proxy", "javaNetProxy", "=", "new", "Proxy", "(", "Proxy", ".", "Type", ".", "HTTP", ",", "new", "InetSocketAddress", "(", "proxy", ".", "getProxyURL", "(", ")", ".", "getHost", "(", ")", ",", "proxy", ".", "getProxyURL", "(", ")", ".", "getPort", "(", ")", ")", ")", ";", "URLConnection", "connection", "=", "propertiesFileURL", ".", "openConnection", "(", "javaNetProxy", ")", ";", "InputStream", "is", "=", "connection", ".", "getInputStream", "(", ")", ";", "exists", "=", "true", ";", "is", ".", "close", "(", ")", ";", "if", "(", "connection", "instanceof", "HttpURLConnection", ")", "{", "(", "(", "HttpURLConnection", ")", "connection", ")", ".", "disconnect", "(", ")", ";", "}", "}", "else", "{", "// The proxy is not an HTTP or HTTPS proxy we do not support this", "UnsupportedOperationException", "ue", "=", "new", "UnsupportedOperationException", "(", "\"Non-HTTP proxy not supported\"", ")", ";", "throw", "new", "IOException", "(", "ue", ")", ";", "}", "}", "else", "{", "// not using a proxy", "InputStream", "is", "=", "propertiesFileURL", ".", "openStream", "(", ")", ";", "exists", "=", "true", ";", "is", ".", "close", "(", ")", ";", "}", "}", "catch", "(", "MalformedURLException", "e", ")", "{", "// ignore", "}", "catch", "(", "IOException", "e", ")", "{", "// ignore", "}", "return", "exists", ";", "}" ]
Tests if the repository description properties file exists as defined by the location override system property or at the default location @return true if the properties file exists, otherwise false
[ "Tests", "if", "the", "repository", "description", "properties", "file", "exists", "as", "defined", "by", "the", "location", "override", "system", "property", "or", "at", "the", "default", "location" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository.liberty/src/com/ibm/ws/repository/connections/liberty/MainRepository.java#L118-L160
train
OpenLiberty/open-liberty
dev/com.ibm.ws.repository.liberty/src/com/ibm/ws/repository/connections/liberty/MainRepository.java
MainRepository.checkHttpResponseCodeValid
private static void checkHttpResponseCodeValid(URLConnection connection) throws RepositoryHttpException, IOException { // if HTTP URL not File URL if (connection instanceof HttpURLConnection) { HttpURLConnection conn = (HttpURLConnection) connection; conn.setRequestMethod("GET"); int respCode = conn.getResponseCode(); if (respCode < 200 || respCode >= 300) { throw new RepositoryHttpException("HTTP connection returned error code " + respCode, respCode, null); } } }
java
private static void checkHttpResponseCodeValid(URLConnection connection) throws RepositoryHttpException, IOException { // if HTTP URL not File URL if (connection instanceof HttpURLConnection) { HttpURLConnection conn = (HttpURLConnection) connection; conn.setRequestMethod("GET"); int respCode = conn.getResponseCode(); if (respCode < 200 || respCode >= 300) { throw new RepositoryHttpException("HTTP connection returned error code " + respCode, respCode, null); } } }
[ "private", "static", "void", "checkHttpResponseCodeValid", "(", "URLConnection", "connection", ")", "throws", "RepositoryHttpException", ",", "IOException", "{", "// if HTTP URL not File URL", "if", "(", "connection", "instanceof", "HttpURLConnection", ")", "{", "HttpURLConnection", "conn", "=", "(", "HttpURLConnection", ")", "connection", ";", "conn", ".", "setRequestMethod", "(", "\"GET\"", ")", ";", "int", "respCode", "=", "conn", ".", "getResponseCode", "(", ")", ";", "if", "(", "respCode", "<", "200", "||", "respCode", ">=", "300", ")", "{", "throw", "new", "RepositoryHttpException", "(", "\"HTTP connection returned error code \"", "+", "respCode", ",", "respCode", ",", "null", ")", ";", "}", "}", "}" ]
Checks for a valid response code and throws and exception with the response code if an error @param connection @throws RepositoryHttpException @throws IOException
[ "Checks", "for", "a", "valid", "response", "code", "and", "throws", "and", "exception", "with", "the", "response", "code", "if", "an", "error" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository.liberty/src/com/ibm/ws/repository/connections/liberty/MainRepository.java#L263-L273
train
OpenLiberty/open-liberty
dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/commands/ServerDumpUtil.java
ServerDumpUtil.isZos
public static boolean isZos() { String os = AccessController.doPrivileged(new PrivilegedAction<String>() { @Override public String run() { return System.getProperty("os.name"); } }); return os != null && (os.equalsIgnoreCase("OS/390") || os.equalsIgnoreCase("z/OS")); }
java
public static boolean isZos() { String os = AccessController.doPrivileged(new PrivilegedAction<String>() { @Override public String run() { return System.getProperty("os.name"); } }); return os != null && (os.equalsIgnoreCase("OS/390") || os.equalsIgnoreCase("z/OS")); }
[ "public", "static", "boolean", "isZos", "(", ")", "{", "String", "os", "=", "AccessController", ".", "doPrivileged", "(", "new", "PrivilegedAction", "<", "String", ">", "(", ")", "{", "@", "Override", "public", "String", "run", "(", ")", "{", "return", "System", ".", "getProperty", "(", "\"os.name\"", ")", ";", "}", "}", ")", ";", "return", "os", "!=", "null", "&&", "(", "os", ".", "equalsIgnoreCase", "(", "\"OS/390\"", ")", "||", "os", ".", "equalsIgnoreCase", "(", "\"z/OS\"", ")", ")", ";", "}" ]
In general find another way to do what you are trying, this is meant as a VERY VERY last resort and agreed to by Gary.
[ "In", "general", "find", "another", "way", "to", "do", "what", "you", "are", "trying", "this", "is", "meant", "as", "a", "VERY", "VERY", "last", "resort", "and", "agreed", "to", "by", "Gary", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/commands/ServerDumpUtil.java#L25-L35
train
OpenLiberty/open-liberty
dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/internal/DefaultWelcomePage.java
DefaultWelcomePage.safeOpen
private InputStream safeOpen(String file) { URL url = bundle.getEntry(file); if (url != null) { try { return url.openStream(); } catch (IOException e) { // if we get an IOException just return null for default page. } } return null; }
java
private InputStream safeOpen(String file) { URL url = bundle.getEntry(file); if (url != null) { try { return url.openStream(); } catch (IOException e) { // if we get an IOException just return null for default page. } } return null; }
[ "private", "InputStream", "safeOpen", "(", "String", "file", ")", "{", "URL", "url", "=", "bundle", ".", "getEntry", "(", "file", ")", ";", "if", "(", "url", "!=", "null", ")", "{", "try", "{", "return", "url", ".", "openStream", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "// if we get an IOException just return null for default page.", "}", "}", "return", "null", ";", "}" ]
Attempt to open the file in the bundle and return null if something goes wrong.
[ "Attempt", "to", "open", "the", "file", "in", "the", "bundle", "and", "return", "null", "if", "something", "goes", "wrong", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/internal/DefaultWelcomePage.java#L78-L88
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/SIMPUtils.java
SIMPUtils.parseTempPrefix
public static String parseTempPrefix(String destinationName) { //Temporary dests are of the form _Q/_T<Prefix>_<MEId><TempdestId> String prefix = null; if (destinationName != null && (destinationName .startsWith(SIMPConstants.TEMPORARY_PUBSUB_DESTINATION_PREFIX)) || destinationName.startsWith( SIMPConstants.TEMPORARY_QUEUE_DESTINATION_PREFIX)) { int index = destinationName.indexOf(SIMPConstants.SYSTEM_DESTINATION_SEPARATOR, 2); if (index > 1) { prefix = destinationName.substring(2, index); } } return prefix; }
java
public static String parseTempPrefix(String destinationName) { //Temporary dests are of the form _Q/_T<Prefix>_<MEId><TempdestId> String prefix = null; if (destinationName != null && (destinationName .startsWith(SIMPConstants.TEMPORARY_PUBSUB_DESTINATION_PREFIX)) || destinationName.startsWith( SIMPConstants.TEMPORARY_QUEUE_DESTINATION_PREFIX)) { int index = destinationName.indexOf(SIMPConstants.SYSTEM_DESTINATION_SEPARATOR, 2); if (index > 1) { prefix = destinationName.substring(2, index); } } return prefix; }
[ "public", "static", "String", "parseTempPrefix", "(", "String", "destinationName", ")", "{", "//Temporary dests are of the form _Q/_T<Prefix>_<MEId><TempdestId>", "String", "prefix", "=", "null", ";", "if", "(", "destinationName", "!=", "null", "&&", "(", "destinationName", ".", "startsWith", "(", "SIMPConstants", ".", "TEMPORARY_PUBSUB_DESTINATION_PREFIX", ")", ")", "||", "destinationName", ".", "startsWith", "(", "SIMPConstants", ".", "TEMPORARY_QUEUE_DESTINATION_PREFIX", ")", ")", "{", "int", "index", "=", "destinationName", ".", "indexOf", "(", "SIMPConstants", ".", "SYSTEM_DESTINATION_SEPARATOR", ",", "2", ")", ";", "if", "(", "index", ">", "1", ")", "{", "prefix", "=", "destinationName", ".", "substring", "(", "2", ",", "index", ")", ";", "}", "}", "return", "prefix", ";", "}" ]
Used to extract the destination prefix component of a full temporary destination name. @param destinationName @return temporary destination prefix
[ "Used", "to", "extract", "the", "destination", "prefix", "component", "of", "a", "full", "temporary", "destination", "name", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/SIMPUtils.java#L191-L210
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/SIMPUtils.java
SIMPUtils.setGuaranteedDeliveryProperties
public static void setGuaranteedDeliveryProperties(ControlMessage msg, SIBUuid8 sourceMEUuid, SIBUuid8 targetMEUuid, SIBUuid12 streamId, SIBUuid12 gatheringTargetDestUuid, SIBUuid12 targetDestUuid, ProtocolType protocolType, byte protocolVersion) { // Remote to local message properties msg.setGuaranteedSourceMessagingEngineUUID(sourceMEUuid); msg.setGuaranteedTargetMessagingEngineUUID(targetMEUuid); msg.setGuaranteedStreamUUID(streamId); msg.setGuaranteedGatheringTargetUUID(gatheringTargetDestUuid); msg.setGuaranteedTargetDestinationDefinitionUUID(targetDestUuid); if (protocolType != null) msg.setGuaranteedProtocolType(protocolType); msg.setGuaranteedProtocolVersion(protocolVersion); }
java
public static void setGuaranteedDeliveryProperties(ControlMessage msg, SIBUuid8 sourceMEUuid, SIBUuid8 targetMEUuid, SIBUuid12 streamId, SIBUuid12 gatheringTargetDestUuid, SIBUuid12 targetDestUuid, ProtocolType protocolType, byte protocolVersion) { // Remote to local message properties msg.setGuaranteedSourceMessagingEngineUUID(sourceMEUuid); msg.setGuaranteedTargetMessagingEngineUUID(targetMEUuid); msg.setGuaranteedStreamUUID(streamId); msg.setGuaranteedGatheringTargetUUID(gatheringTargetDestUuid); msg.setGuaranteedTargetDestinationDefinitionUUID(targetDestUuid); if (protocolType != null) msg.setGuaranteedProtocolType(protocolType); msg.setGuaranteedProtocolVersion(protocolVersion); }
[ "public", "static", "void", "setGuaranteedDeliveryProperties", "(", "ControlMessage", "msg", ",", "SIBUuid8", "sourceMEUuid", ",", "SIBUuid8", "targetMEUuid", ",", "SIBUuid12", "streamId", ",", "SIBUuid12", "gatheringTargetDestUuid", ",", "SIBUuid12", "targetDestUuid", ",", "ProtocolType", "protocolType", ",", "byte", "protocolVersion", ")", "{", "// Remote to local message properties", "msg", ".", "setGuaranteedSourceMessagingEngineUUID", "(", "sourceMEUuid", ")", ";", "msg", ".", "setGuaranteedTargetMessagingEngineUUID", "(", "targetMEUuid", ")", ";", "msg", ".", "setGuaranteedStreamUUID", "(", "streamId", ")", ";", "msg", ".", "setGuaranteedGatheringTargetUUID", "(", "gatheringTargetDestUuid", ")", ";", "msg", ".", "setGuaranteedTargetDestinationDefinitionUUID", "(", "targetDestUuid", ")", ";", "if", "(", "protocolType", "!=", "null", ")", "msg", ".", "setGuaranteedProtocolType", "(", "protocolType", ")", ";", "msg", ".", "setGuaranteedProtocolVersion", "(", "protocolVersion", ")", ";", "}" ]
Set up guaranteed delivery message properties. These are compulsory properties on a control message and are therefore set throughout the code. The method makes it easier to cope with new properties in the message. @param msg ControlMessage on which to set properties.
[ "Set", "up", "guaranteed", "delivery", "message", "properties", ".", "These", "are", "compulsory", "properties", "on", "a", "control", "message", "and", "are", "therefore", "set", "throughout", "the", "code", ".", "The", "method", "makes", "it", "easier", "to", "cope", "with", "new", "properties", "in", "the", "message", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/SIMPUtils.java#L334-L352
train
OpenLiberty/open-liberty
dev/com.ibm.ws.anno/src/com/ibm/ws/anno/util/internal/UtilImpl_InternMap.java
UtilImpl_InternMap.intern
@Override // Don't log this call: Rely on 'intern(String, boolean)' to log the intern call and result. @Trivial public String intern(String value) { return intern(value, Util_InternMap.DO_FORCE); }
java
@Override // Don't log this call: Rely on 'intern(String, boolean)' to log the intern call and result. @Trivial public String intern(String value) { return intern(value, Util_InternMap.DO_FORCE); }
[ "@", "Override", "// Don't log this call: Rely on 'intern(String, boolean)' to log the intern call and result. ", "@", "Trivial", "public", "String", "intern", "(", "String", "value", ")", "{", "return", "intern", "(", "value", ",", "Util_InternMap", ".", "DO_FORCE", ")", ";", "}" ]
Intern a string value. Do force the value to be interned. See {@link #intern(String, boolean) and {@link Util_InternMap#DO_FORCE}. @param value The string value which is to be interned. @return The interned string value. Only null if the string value is null.
[ "Intern", "a", "string", "value", ".", "Do", "force", "the", "value", "to", "be", "interned", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.anno/src/com/ibm/ws/anno/util/internal/UtilImpl_InternMap.java#L241-L246
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsMsgMap.java
JsMsgMap.isChanged
public boolean isChanged() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "isChanged"); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "isChanged", changed); return changed; }
java
public boolean isChanged() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "isChanged"); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "isChanged", changed); return changed; }
[ "public", "boolean", "isChanged", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"isChanged\"", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"isChanged\"", ",", "changed", ")", ";", "return", "changed", ";", "}" ]
Is the map 'fluffed up' into a HashMap? d317373.1
[ "Is", "the", "map", "fluffed", "up", "into", "a", "HashMap?", "d317373", ".", "1" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsMsgMap.java#L92-L96
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsMsgMap.java
JsMsgMap.setUnChanged
public void setUnChanged() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setUnChanged"); changed = false; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setUnChanged"); }
java
public void setUnChanged() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setUnChanged"); changed = false; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setUnChanged"); }
[ "public", "void", "setUnChanged", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"setUnChanged\"", ")", ";", "changed", "=", "false", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"setUnChanged\"", ")", ";", "}" ]
Set the changed flag back to false if the map is written back to JMF
[ "Set", "the", "changed", "flag", "back", "to", "false", "if", "the", "map", "is", "written", "back", "to", "JMF" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsMsgMap.java#L99-L103
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsMsgMap.java
JsMsgMap.setChanged
public void setChanged() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setChanged"); changed = true; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setChanged"); }
java
public void setChanged() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setChanged"); changed = true; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setChanged"); }
[ "public", "void", "setChanged", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"setChanged\"", ")", ";", "changed", "=", "true", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"setChanged\"", ")", ";", "}" ]
Set the changed flag to true if the caller knows better than the map itself
[ "Set", "the", "changed", "flag", "to", "true", "if", "the", "caller", "knows", "better", "than", "the", "map", "itself" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsMsgMap.java#L106-L110
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsMsgMap.java
JsMsgMap.put
public Object put(String key, Object value) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "put", new Object[]{key, PasswordUtils.replaceValueIfKeyIsPassword(key,value)}); // If the value is null (which is allowed for a Map Message) we can't tell // quickly whether the item is already in the map as null, or whether it doesn't exist, // so we just assume it will cause a change. // For properties we will never get a value of null, and it is properties we are really concerned with. if ((!changed)&& (value != null)) { Object old = get(key); if (value.equals(old)) { // may as well call equals immediately, as it checks for == and we know value!=null if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "put", "unchanged"); return old; } else { changed = true; Object result = copyMap().put(key, value); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "put", PasswordUtils.replaceValueIfKeyIsPassword(key,result)); return result; } } else { changed = true; Object result = copyMap().put(key, value); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "put", PasswordUtils.replaceValueIfKeyIsPassword(key,result)); return result; } }
java
public Object put(String key, Object value) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "put", new Object[]{key, PasswordUtils.replaceValueIfKeyIsPassword(key,value)}); // If the value is null (which is allowed for a Map Message) we can't tell // quickly whether the item is already in the map as null, or whether it doesn't exist, // so we just assume it will cause a change. // For properties we will never get a value of null, and it is properties we are really concerned with. if ((!changed)&& (value != null)) { Object old = get(key); if (value.equals(old)) { // may as well call equals immediately, as it checks for == and we know value!=null if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "put", "unchanged"); return old; } else { changed = true; Object result = copyMap().put(key, value); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "put", PasswordUtils.replaceValueIfKeyIsPassword(key,result)); return result; } } else { changed = true; Object result = copyMap().put(key, value); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "put", PasswordUtils.replaceValueIfKeyIsPassword(key,result)); return result; } }
[ "public", "Object", "put", "(", "String", "key", ",", "Object", "value", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"put\"", ",", "new", "Object", "[", "]", "{", "key", ",", "PasswordUtils", ".", "replaceValueIfKeyIsPassword", "(", "key", ",", "value", ")", "}", ")", ";", "// If the value is null (which is allowed for a Map Message) we can't tell", "// quickly whether the item is already in the map as null, or whether it doesn't exist,", "// so we just assume it will cause a change.", "// For properties we will never get a value of null, and it is properties we are really concerned with.", "if", "(", "(", "!", "changed", ")", "&&", "(", "value", "!=", "null", ")", ")", "{", "Object", "old", "=", "get", "(", "key", ")", ";", "if", "(", "value", ".", "equals", "(", "old", ")", ")", "{", "// may as well call equals immediately, as it checks for == and we know value!=null", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"put\"", ",", "\"unchanged\"", ")", ";", "return", "old", ";", "}", "else", "{", "changed", "=", "true", ";", "Object", "result", "=", "copyMap", "(", ")", ".", "put", "(", "key", ",", "value", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"put\"", ",", "PasswordUtils", ".", "replaceValueIfKeyIsPassword", "(", "key", ",", "result", ")", ")", ";", "return", "result", ";", "}", "}", "else", "{", "changed", "=", "true", ";", "Object", "result", "=", "copyMap", "(", ")", ".", "put", "(", "key", ",", "value", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"put\"", ",", "PasswordUtils", ".", "replaceValueIfKeyIsPassword", "(", "key", ",", "result", ")", ")", ";", "return", "result", ";", "}", "}" ]
Once we've made one update, others don't matter so save time by not checking. d317373.1
[ "Once", "we", "ve", "made", "one", "update", "others", "don", "t", "matter", "so", "save", "time", "by", "not", "checking", ".", "d317373", ".", "1" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsMsgMap.java#L142-L168
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/metadata/WebServiceRefInfo.java
WebServiceRefInfo.addWebServiceFeatureInfo
public void addWebServiceFeatureInfo(String seiName, WebServiceFeatureInfo featureInfo) { PortComponentRefInfo portComponentRefInfo = seiNamePortComponentRefInfoMap.get(seiName); if (portComponentRefInfo == null) { portComponentRefInfo = new PortComponentRefInfo(seiName); seiNamePortComponentRefInfoMap.put(seiName, portComponentRefInfo); } portComponentRefInfo.addWebServiceFeatureInfo(featureInfo); }
java
public void addWebServiceFeatureInfo(String seiName, WebServiceFeatureInfo featureInfo) { PortComponentRefInfo portComponentRefInfo = seiNamePortComponentRefInfoMap.get(seiName); if (portComponentRefInfo == null) { portComponentRefInfo = new PortComponentRefInfo(seiName); seiNamePortComponentRefInfoMap.put(seiName, portComponentRefInfo); } portComponentRefInfo.addWebServiceFeatureInfo(featureInfo); }
[ "public", "void", "addWebServiceFeatureInfo", "(", "String", "seiName", ",", "WebServiceFeatureInfo", "featureInfo", ")", "{", "PortComponentRefInfo", "portComponentRefInfo", "=", "seiNamePortComponentRefInfoMap", ".", "get", "(", "seiName", ")", ";", "if", "(", "portComponentRefInfo", "==", "null", ")", "{", "portComponentRefInfo", "=", "new", "PortComponentRefInfo", "(", "seiName", ")", ";", "seiNamePortComponentRefInfoMap", ".", "put", "(", "seiName", ",", "portComponentRefInfo", ")", ";", "}", "portComponentRefInfo", ".", "addWebServiceFeatureInfo", "(", "featureInfo", ")", ";", "}" ]
Add a feature info to the PortComponentRefInfo, if the target one does not exist, a new one with that port component interface will be created @param seiName port component interface name @param featureInfo feature info of the target port
[ "Add", "a", "feature", "info", "to", "the", "PortComponentRefInfo", "if", "the", "target", "one", "does", "not", "exist", "a", "new", "one", "with", "that", "port", "component", "interface", "will", "be", "created" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.clientcontainer/src/com/ibm/ws/jaxws/metadata/WebServiceRefInfo.java#L197-L204
train
OpenLiberty/open-liberty
dev/com.ibm.ws.concurrent/src/com/ibm/ws/concurrent/internal/ScheduledTask.java
ScheduledTask.getName
@Trivial final String getName() { Map<String, String> execProps = getExecutionProperties(); String taskName = execProps == null ? null : execProps.get(ManagedTask.IDENTITY_NAME); return taskName == null ? task.toString() : taskName; }
java
@Trivial final String getName() { Map<String, String> execProps = getExecutionProperties(); String taskName = execProps == null ? null : execProps.get(ManagedTask.IDENTITY_NAME); return taskName == null ? task.toString() : taskName; }
[ "@", "Trivial", "final", "String", "getName", "(", ")", "{", "Map", "<", "String", ",", "String", ">", "execProps", "=", "getExecutionProperties", "(", ")", ";", "String", "taskName", "=", "execProps", "==", "null", "?", "null", ":", "execProps", ".", "get", "(", "ManagedTask", ".", "IDENTITY_NAME", ")", ";", "return", "taskName", "==", "null", "?", "task", ".", "toString", "(", ")", ":", "taskName", ";", "}" ]
Returns the task name. @return the task name.
[ "Returns", "the", "task", "name", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.concurrent/src/com/ibm/ws/concurrent/internal/ScheduledTask.java#L638-L643
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/msgstore/WASConfiguration.java
WASConfiguration.getDefaultWasConfiguration
public static WASConfiguration getDefaultWasConfiguration() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getDefaultWasConfiguration()"); WASConfiguration config = new WASConfiguration(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getDefaultWasConfiguration()", config); return(config); }
java
public static WASConfiguration getDefaultWasConfiguration() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getDefaultWasConfiguration()"); WASConfiguration config = new WASConfiguration(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getDefaultWasConfiguration()", config); return(config); }
[ "public", "static", "WASConfiguration", "getDefaultWasConfiguration", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"getDefaultWasConfiguration()\"", ")", ";", "WASConfiguration", "config", "=", "new", "WASConfiguration", "(", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"getDefaultWasConfiguration()\"", ",", "config", ")", ";", "return", "(", "config", ")", ";", "}" ]
Create a new WASConfiguration object @return a new WASConfiguration object
[ "Create", "a", "new", "WASConfiguration", "object" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/msgstore/WASConfiguration.java#L47-L57
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/TransactionCommitLogRecord.java
TransactionCommitLogRecord.performRecovery
public void performRecovery(ObjectManagerState objectManagerState) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, "performRecovery", "ObjectManagerState=" + objectManagerState); if (Tracing.isAnyTracingEnabled() && trace.isDebugEnabled()) trace.debug(this, cclass, "logicalUnitOfWork.identifier=" + logicalUnitOfWork.identifier + "(long)"); Transaction transactionForRecovery = objectManagerState.getTransaction(logicalUnitOfWork); transactionForRecovery.commit(false); // Do not re use this Transaction. if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, "performRecovery"); }
java
public void performRecovery(ObjectManagerState objectManagerState) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, "performRecovery", "ObjectManagerState=" + objectManagerState); if (Tracing.isAnyTracingEnabled() && trace.isDebugEnabled()) trace.debug(this, cclass, "logicalUnitOfWork.identifier=" + logicalUnitOfWork.identifier + "(long)"); Transaction transactionForRecovery = objectManagerState.getTransaction(logicalUnitOfWork); transactionForRecovery.commit(false); // Do not re use this Transaction. if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, "performRecovery"); }
[ "public", "void", "performRecovery", "(", "ObjectManagerState", "objectManagerState", ")", "throws", "ObjectManagerException", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "\"performRecovery\"", ",", "\"ObjectManagerState=\"", "+", "objectManagerState", ")", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isDebugEnabled", "(", ")", ")", "trace", ".", "debug", "(", "this", ",", "cclass", ",", "\"logicalUnitOfWork.identifier=\"", "+", "logicalUnitOfWork", ".", "identifier", "+", "\"(long)\"", ")", ";", "Transaction", "transactionForRecovery", "=", "objectManagerState", ".", "getTransaction", "(", "logicalUnitOfWork", ")", ";", "transactionForRecovery", ".", "commit", "(", "false", ")", ";", "// Do not re use this Transaction.", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"performRecovery\"", ")", ";", "}" ]
Called to perform recovery action during a warm start of the objectManager. @param ObjectManagerState of the ObjectManager performing recovery.
[ "Called", "to", "perform", "recovery", "action", "during", "a", "warm", "start", "of", "the", "objectManager", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/TransactionCommitLogRecord.java#L118-L138
train
OpenLiberty/open-liberty
dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheUnitImpl.java
CacheUnitImpl.initialize
public void initialize(CacheConfig cc) { if (tc.isEntryEnabled()) Tr.entry(tc, "initialize"); cacheConfig = cc; if (null != cc){ try { if (tc.isDebugEnabled()) Tr.debug(tc, "Initializing CacheUnit " + uniqueServerNameFQ); nullRemoteServices.setCacheUnit(uniqueServerNameFQ, this); } catch (Exception ex) { //ex.printStackTrace(); com.ibm.ws.ffdc.FFDCFilter.processException(ex, "com.ibm.ws.cache.CacheUnitImpl.initialize", "120", this); Tr.error(tc, "dynacache.configerror", ex.getMessage()); throw new IllegalStateException("Unexpected exception: " + ex.getMessage()); } } if (tc.isEntryEnabled()) Tr.exit(tc, "initialize"); }
java
public void initialize(CacheConfig cc) { if (tc.isEntryEnabled()) Tr.entry(tc, "initialize"); cacheConfig = cc; if (null != cc){ try { if (tc.isDebugEnabled()) Tr.debug(tc, "Initializing CacheUnit " + uniqueServerNameFQ); nullRemoteServices.setCacheUnit(uniqueServerNameFQ, this); } catch (Exception ex) { //ex.printStackTrace(); com.ibm.ws.ffdc.FFDCFilter.processException(ex, "com.ibm.ws.cache.CacheUnitImpl.initialize", "120", this); Tr.error(tc, "dynacache.configerror", ex.getMessage()); throw new IllegalStateException("Unexpected exception: " + ex.getMessage()); } } if (tc.isEntryEnabled()) Tr.exit(tc, "initialize"); }
[ "public", "void", "initialize", "(", "CacheConfig", "cc", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"initialize\"", ")", ";", "cacheConfig", "=", "cc", ";", "if", "(", "null", "!=", "cc", ")", "{", "try", "{", "if", "(", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"Initializing CacheUnit \"", "+", "uniqueServerNameFQ", ")", ";", "nullRemoteServices", ".", "setCacheUnit", "(", "uniqueServerNameFQ", ",", "this", ")", ";", "}", "catch", "(", "Exception", "ex", ")", "{", "//ex.printStackTrace();", "com", ".", "ibm", ".", "ws", ".", "ffdc", ".", "FFDCFilter", ".", "processException", "(", "ex", ",", "\"com.ibm.ws.cache.CacheUnitImpl.initialize\"", ",", "\"120\"", ",", "this", ")", ";", "Tr", ".", "error", "(", "tc", ",", "\"dynacache.configerror\"", ",", "ex", ".", "getMessage", "(", ")", ")", ";", "throw", "new", "IllegalStateException", "(", "\"Unexpected exception: \"", "+", "ex", ".", "getMessage", "(", ")", ")", ";", "}", "}", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "tc", ",", "\"initialize\"", ")", ";", "}" ]
This is a helper method called by this CacheUnitImpl's constructor. It creates all the local objects - BatchUpdateDaemon, InvalidationAuditDaemon, and TimeLimitDaemon. These objects are used by all cache instances. @param The file name of the configuration xml file.
[ "This", "is", "a", "helper", "method", "called", "by", "this", "CacheUnitImpl", "s", "constructor", ".", "It", "creates", "all", "the", "local", "objects", "-", "BatchUpdateDaemon", "InvalidationAuditDaemon", "and", "TimeLimitDaemon", ".", "These", "objects", "are", "used", "by", "all", "cache", "instances", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheUnitImpl.java#L69-L90
train
OpenLiberty/open-liberty
dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheUnitImpl.java
CacheUnitImpl.batchUpdate
public void batchUpdate(String cacheName, HashMap invalidateIdEvents, HashMap invalidateTemplateEvents, ArrayList pushEntryEvents) { if (tc.isEntryEnabled()) Tr.entry(tc, "batchUpdate():"+cacheName); invalidationAuditDaemon.registerInvalidations(cacheName, invalidateIdEvents.values().iterator()); invalidationAuditDaemon.registerInvalidations(cacheName, invalidateTemplateEvents.values().iterator()); pushEntryEvents = invalidationAuditDaemon.filterEntryList(cacheName, pushEntryEvents); DCache cache = ServerCache.getCache(cacheName); if (cache!=null) { cache.batchUpdate(invalidateIdEvents, invalidateTemplateEvents, pushEntryEvents); if (cache.getCacheConfig().isEnableServletSupport() == true) { if (servletCacheUnit != null) { servletCacheUnit.invalidateExternalCaches(invalidateIdEvents, invalidateTemplateEvents); } else { if (tc.isDebugEnabled()) Tr.debug(tc, "batchUpdate() cannot do invalidateExternalCaches because servletCacheUnit=NULL."); } } } if (tc.isEntryEnabled()) Tr.exit(tc, "batchUpdate()"); }
java
public void batchUpdate(String cacheName, HashMap invalidateIdEvents, HashMap invalidateTemplateEvents, ArrayList pushEntryEvents) { if (tc.isEntryEnabled()) Tr.entry(tc, "batchUpdate():"+cacheName); invalidationAuditDaemon.registerInvalidations(cacheName, invalidateIdEvents.values().iterator()); invalidationAuditDaemon.registerInvalidations(cacheName, invalidateTemplateEvents.values().iterator()); pushEntryEvents = invalidationAuditDaemon.filterEntryList(cacheName, pushEntryEvents); DCache cache = ServerCache.getCache(cacheName); if (cache!=null) { cache.batchUpdate(invalidateIdEvents, invalidateTemplateEvents, pushEntryEvents); if (cache.getCacheConfig().isEnableServletSupport() == true) { if (servletCacheUnit != null) { servletCacheUnit.invalidateExternalCaches(invalidateIdEvents, invalidateTemplateEvents); } else { if (tc.isDebugEnabled()) Tr.debug(tc, "batchUpdate() cannot do invalidateExternalCaches because servletCacheUnit=NULL."); } } } if (tc.isEntryEnabled()) Tr.exit(tc, "batchUpdate()"); }
[ "public", "void", "batchUpdate", "(", "String", "cacheName", ",", "HashMap", "invalidateIdEvents", ",", "HashMap", "invalidateTemplateEvents", ",", "ArrayList", "pushEntryEvents", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"batchUpdate():\"", "+", "cacheName", ")", ";", "invalidationAuditDaemon", ".", "registerInvalidations", "(", "cacheName", ",", "invalidateIdEvents", ".", "values", "(", ")", ".", "iterator", "(", ")", ")", ";", "invalidationAuditDaemon", ".", "registerInvalidations", "(", "cacheName", ",", "invalidateTemplateEvents", ".", "values", "(", ")", ".", "iterator", "(", ")", ")", ";", "pushEntryEvents", "=", "invalidationAuditDaemon", ".", "filterEntryList", "(", "cacheName", ",", "pushEntryEvents", ")", ";", "DCache", "cache", "=", "ServerCache", ".", "getCache", "(", "cacheName", ")", ";", "if", "(", "cache", "!=", "null", ")", "{", "cache", ".", "batchUpdate", "(", "invalidateIdEvents", ",", "invalidateTemplateEvents", ",", "pushEntryEvents", ")", ";", "if", "(", "cache", ".", "getCacheConfig", "(", ")", ".", "isEnableServletSupport", "(", ")", "==", "true", ")", "{", "if", "(", "servletCacheUnit", "!=", "null", ")", "{", "servletCacheUnit", ".", "invalidateExternalCaches", "(", "invalidateIdEvents", ",", "invalidateTemplateEvents", ")", ";", "}", "else", "{", "if", "(", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"batchUpdate() cannot do invalidateExternalCaches because servletCacheUnit=NULL.\"", ")", ";", "}", "}", "}", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "tc", ",", "\"batchUpdate()\"", ")", ";", "}" ]
This implements the method in the CacheUnit interface. It applies the updates to the local internal caches and the external caches. It validates timestamps to prevent race conditions. @param invalidateIdEvents A HashMap of invalidate by id. @param invalidateTemplateEvents A HashMap of invalidate by template. @param pushEntryEvents A HashMap of cache entries.
[ "This", "implements", "the", "method", "in", "the", "CacheUnit", "interface", ".", "It", "applies", "the", "updates", "to", "the", "local", "internal", "caches", "and", "the", "external", "caches", ".", "It", "validates", "timestamps", "to", "prevent", "race", "conditions", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheUnitImpl.java#L116-L140
train
OpenLiberty/open-liberty
dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheUnitImpl.java
CacheUnitImpl.getEntry
public CacheEntry getEntry(String cacheName, Object id, boolean ignoreCounting ) { if (tc.isEntryEnabled()) Tr.entry(tc, "getEntry: {0}", id); DCache cache = ServerCache.getCache(cacheName); CacheEntry cacheEntry = null; if ( cache != null ) { cacheEntry = (CacheEntry) cache.getEntry(id, CachePerf.REMOTE, ignoreCounting, DCacheBase.INCREMENT_REFF_COUNT); } if (tc.isEntryEnabled()) Tr.exit(tc, "getEntry: {0}", id); return cacheEntry; }
java
public CacheEntry getEntry(String cacheName, Object id, boolean ignoreCounting ) { if (tc.isEntryEnabled()) Tr.entry(tc, "getEntry: {0}", id); DCache cache = ServerCache.getCache(cacheName); CacheEntry cacheEntry = null; if ( cache != null ) { cacheEntry = (CacheEntry) cache.getEntry(id, CachePerf.REMOTE, ignoreCounting, DCacheBase.INCREMENT_REFF_COUNT); } if (tc.isEntryEnabled()) Tr.exit(tc, "getEntry: {0}", id); return cacheEntry; }
[ "public", "CacheEntry", "getEntry", "(", "String", "cacheName", ",", "Object", "id", ",", "boolean", "ignoreCounting", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"getEntry: {0}\"", ",", "id", ")", ";", "DCache", "cache", "=", "ServerCache", ".", "getCache", "(", "cacheName", ")", ";", "CacheEntry", "cacheEntry", "=", "null", ";", "if", "(", "cache", "!=", "null", ")", "{", "cacheEntry", "=", "(", "CacheEntry", ")", "cache", ".", "getEntry", "(", "id", ",", "CachePerf", ".", "REMOTE", ",", "ignoreCounting", ",", "DCacheBase", ".", "INCREMENT_REFF_COUNT", ")", ";", "}", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "tc", ",", "\"getEntry: {0}\"", ",", "id", ")", ";", "return", "cacheEntry", ";", "}" ]
This implements the method in the CacheUnit interface. This is called by DRSNotificationService and DRSMessageListener. A returned null indicates that the local cache should execute it and return the result to the coordinating CacheUnit. @param cacheName The cache name @param id The cache id for the entry. The id cannot be null. @param ignoreCounting true to ignore statistics counting @return The entry indentified by the cache id.
[ "This", "implements", "the", "method", "in", "the", "CacheUnit", "interface", ".", "This", "is", "called", "by", "DRSNotificationService", "and", "DRSMessageListener", ".", "A", "returned", "null", "indicates", "that", "the", "local", "cache", "should", "execute", "it", "and", "return", "the", "result", "to", "the", "coordinating", "CacheUnit", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheUnitImpl.java#L153-L166
train
OpenLiberty/open-liberty
dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheUnitImpl.java
CacheUnitImpl.setEntry
public void setEntry(String cacheName, CacheEntry cacheEntry) { if (tc.isEntryEnabled()) Tr.entry(tc, "setEntry: {0}", cacheEntry.id); cacheEntry = invalidationAuditDaemon.filterEntry(cacheName, cacheEntry); if (cacheEntry != null) { DCache cache = ServerCache.getCache(cacheName); cache.setEntry(cacheEntry,CachePerf.REMOTE); } if (tc.isEntryEnabled()) Tr.exit(tc, "setEntry: {0}", cacheEntry==null?"null":cacheEntry.id ); }
java
public void setEntry(String cacheName, CacheEntry cacheEntry) { if (tc.isEntryEnabled()) Tr.entry(tc, "setEntry: {0}", cacheEntry.id); cacheEntry = invalidationAuditDaemon.filterEntry(cacheName, cacheEntry); if (cacheEntry != null) { DCache cache = ServerCache.getCache(cacheName); cache.setEntry(cacheEntry,CachePerf.REMOTE); } if (tc.isEntryEnabled()) Tr.exit(tc, "setEntry: {0}", cacheEntry==null?"null":cacheEntry.id ); }
[ "public", "void", "setEntry", "(", "String", "cacheName", ",", "CacheEntry", "cacheEntry", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"setEntry: {0}\"", ",", "cacheEntry", ".", "id", ")", ";", "cacheEntry", "=", "invalidationAuditDaemon", ".", "filterEntry", "(", "cacheName", ",", "cacheEntry", ")", ";", "if", "(", "cacheEntry", "!=", "null", ")", "{", "DCache", "cache", "=", "ServerCache", ".", "getCache", "(", "cacheName", ")", ";", "cache", ".", "setEntry", "(", "cacheEntry", ",", "CachePerf", ".", "REMOTE", ")", ";", "}", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "tc", ",", "\"setEntry: {0}\"", ",", "cacheEntry", "==", "null", "?", "\"null\"", ":", "cacheEntry", ".", "id", ")", ";", "}" ]
This implements the method in the CacheUnit interface. This is called by DRSNotificationService and DRSMessageListener. @param cacheName The cache name @param cacheEntry The entry to be set.
[ "This", "implements", "the", "method", "in", "the", "CacheUnit", "interface", ".", "This", "is", "called", "by", "DRSNotificationService", "and", "DRSMessageListener", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheUnitImpl.java#L175-L186
train
OpenLiberty/open-liberty
dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheUnitImpl.java
CacheUnitImpl.setExternalCacheFragment
public void setExternalCacheFragment(ExternalInvalidation externalCacheFragment) { if (tc.isEntryEnabled()) Tr.entry(tc, "setExternalCacheFragment: {0}", externalCacheFragment.getUri()); externalCacheFragment = invalidationAuditDaemon.filterExternalCacheFragment(ServerCache.cache.getCacheName(), externalCacheFragment); if (externalCacheFragment != null) { batchUpdateDaemon.pushExternalCacheFragment(externalCacheFragment, ServerCache.cache); } if (tc.isEntryEnabled()) Tr.exit(tc, "setExternalCacheFragment: {0}", externalCacheFragment.getUri()); }
java
public void setExternalCacheFragment(ExternalInvalidation externalCacheFragment) { if (tc.isEntryEnabled()) Tr.entry(tc, "setExternalCacheFragment: {0}", externalCacheFragment.getUri()); externalCacheFragment = invalidationAuditDaemon.filterExternalCacheFragment(ServerCache.cache.getCacheName(), externalCacheFragment); if (externalCacheFragment != null) { batchUpdateDaemon.pushExternalCacheFragment(externalCacheFragment, ServerCache.cache); } if (tc.isEntryEnabled()) Tr.exit(tc, "setExternalCacheFragment: {0}", externalCacheFragment.getUri()); }
[ "public", "void", "setExternalCacheFragment", "(", "ExternalInvalidation", "externalCacheFragment", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"setExternalCacheFragment: {0}\"", ",", "externalCacheFragment", ".", "getUri", "(", ")", ")", ";", "externalCacheFragment", "=", "invalidationAuditDaemon", ".", "filterExternalCacheFragment", "(", "ServerCache", ".", "cache", ".", "getCacheName", "(", ")", ",", "externalCacheFragment", ")", ";", "if", "(", "externalCacheFragment", "!=", "null", ")", "{", "batchUpdateDaemon", ".", "pushExternalCacheFragment", "(", "externalCacheFragment", ",", "ServerCache", ".", "cache", ")", ";", "}", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "tc", ",", "\"setExternalCacheFragment: {0}\"", ",", "externalCacheFragment", ".", "getUri", "(", ")", ")", ";", "}" ]
This implements the method in the CacheUnit interface. This is called by DRSRemoteService and NullRemoteServices. @param externalCacheFragment The external cache fragment to be relayed.
[ "This", "implements", "the", "method", "in", "the", "CacheUnit", "interface", ".", "This", "is", "called", "by", "DRSRemoteService", "and", "NullRemoteServices", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheUnitImpl.java#L194-L203
train
OpenLiberty/open-liberty
dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheUnitImpl.java
CacheUnitImpl.startServices
public void startServices(boolean startTLD) { synchronized (this.serviceMonitor) { //multiple threads can call this concurrently if (this.batchUpdateDaemon == null) { //---------------------------------------------- // Initialize BatchUpdateDaemon object //---------------------------------------------- batchUpdateDaemon = new BatchUpdateDaemon(cacheConfig.batchUpdateInterval); //---------------------------------------------- // Initialize InvalidationAuditDaemon object //---------------------------------------------- invalidationAuditDaemon = new InvalidationAuditDaemon(cacheConfig.timeHoldingInvalidations); //---------------------------------------------- // link invalidationAuditDaemon to BatchUpdateDaemon //---------------------------------------------- batchUpdateDaemon.setInvalidationAuditDaemon(invalidationAuditDaemon); if (tc.isDebugEnabled()) { Tr.debug(tc, "startServices() - starting BatchUpdateDaemon/invalidationAuditDaemon services. " + "These services should only start once for all cache instances. Settings are: " + " batchUpdateInterval=" + cacheConfig.batchUpdateInterval + " timeHoldingInvalidations=" + cacheConfig.timeHoldingInvalidations); } //---------------------------------------------- // start services //---------------------------------------------- batchUpdateDaemon.start(); invalidationAuditDaemon.start(); } if (startTLD && this.timeLimitDaemon == null) { //---------------------------------------------- // Initialize TimeLimitDaemon object //---------------------------------------------- // lruToDiskTriggerTime is set to the default (5 sec) under the following conditions // (1) less than 1 msec // (2) larger than timeGranularityInSeconds int lruToDiskTriggerTime = CacheConfig.DEFAULT_LRU_TO_DISK_TRIGGER_TIME; if (cacheConfig.lruToDiskTriggerTime > cacheConfig.timeGranularityInSeconds * 1000 || cacheConfig.lruToDiskTriggerTime < CacheConfig.MIN_LRU_TO_DISK_TRIGGER_TIME) { Tr.warning(tc, "DYNA0069W", new Object[] { new Integer(cacheConfig.lruToDiskTriggerTime), "lruToDiskTriggerTime", cacheConfig.cacheName, new Integer(CacheConfig.MIN_LRU_TO_DISK_TRIGGER_TIME), new Integer(cacheConfig.timeGranularityInSeconds * 1000), new Integer(CacheConfig.DEFAULT_LRU_TO_DISK_TRIGGER_TIME)}); cacheConfig.lruToDiskTriggerTime = lruToDiskTriggerTime; } else { lruToDiskTriggerTime = cacheConfig.lruToDiskTriggerTime; } if (lruToDiskTriggerTime == CacheConfig.DEFAULT_LRU_TO_DISK_TRIGGER_TIME && (cacheConfig.lruToDiskTriggerPercent > CacheConfig.DEFAULT_LRU_TO_DISK_TRIGGER_PERCENT || cacheConfig.memoryCacheSizeInMB != CacheConfig.DEFAULT_DISABLE_CACHE_SIZE_MB)) { lruToDiskTriggerTime = CacheConfig.DEFAULT_LRU_TO_DISK_TRIGGER_TIME_FOR_TRIMCACHE; cacheConfig.lruToDiskTriggerTime = lruToDiskTriggerTime; Tr.audit(tc, "DYNA1069I", new Object[] { new Integer(cacheConfig.lruToDiskTriggerTime)}); } //---------------------------------------------- // Initialize TimeLimitDaemon object //---------------------------------------------- timeLimitDaemon = new TimeLimitDaemon(cacheConfig.timeGranularityInSeconds, lruToDiskTriggerTime); if (tc.isDebugEnabled()) { Tr.debug(tc, "startServices() - starting TimeLimitDaemon service. " + "This service should only start once for all cache instances. Settings are: " + " timeGranularityInSeconds=" + cacheConfig.timeGranularityInSeconds + " lruToDiskTriggerTime=" + cacheConfig.lruToDiskTriggerTime); } //---------------------------------------------- // start service //---------------------------------------------- timeLimitDaemon.start(); } } }
java
public void startServices(boolean startTLD) { synchronized (this.serviceMonitor) { //multiple threads can call this concurrently if (this.batchUpdateDaemon == null) { //---------------------------------------------- // Initialize BatchUpdateDaemon object //---------------------------------------------- batchUpdateDaemon = new BatchUpdateDaemon(cacheConfig.batchUpdateInterval); //---------------------------------------------- // Initialize InvalidationAuditDaemon object //---------------------------------------------- invalidationAuditDaemon = new InvalidationAuditDaemon(cacheConfig.timeHoldingInvalidations); //---------------------------------------------- // link invalidationAuditDaemon to BatchUpdateDaemon //---------------------------------------------- batchUpdateDaemon.setInvalidationAuditDaemon(invalidationAuditDaemon); if (tc.isDebugEnabled()) { Tr.debug(tc, "startServices() - starting BatchUpdateDaemon/invalidationAuditDaemon services. " + "These services should only start once for all cache instances. Settings are: " + " batchUpdateInterval=" + cacheConfig.batchUpdateInterval + " timeHoldingInvalidations=" + cacheConfig.timeHoldingInvalidations); } //---------------------------------------------- // start services //---------------------------------------------- batchUpdateDaemon.start(); invalidationAuditDaemon.start(); } if (startTLD && this.timeLimitDaemon == null) { //---------------------------------------------- // Initialize TimeLimitDaemon object //---------------------------------------------- // lruToDiskTriggerTime is set to the default (5 sec) under the following conditions // (1) less than 1 msec // (2) larger than timeGranularityInSeconds int lruToDiskTriggerTime = CacheConfig.DEFAULT_LRU_TO_DISK_TRIGGER_TIME; if (cacheConfig.lruToDiskTriggerTime > cacheConfig.timeGranularityInSeconds * 1000 || cacheConfig.lruToDiskTriggerTime < CacheConfig.MIN_LRU_TO_DISK_TRIGGER_TIME) { Tr.warning(tc, "DYNA0069W", new Object[] { new Integer(cacheConfig.lruToDiskTriggerTime), "lruToDiskTriggerTime", cacheConfig.cacheName, new Integer(CacheConfig.MIN_LRU_TO_DISK_TRIGGER_TIME), new Integer(cacheConfig.timeGranularityInSeconds * 1000), new Integer(CacheConfig.DEFAULT_LRU_TO_DISK_TRIGGER_TIME)}); cacheConfig.lruToDiskTriggerTime = lruToDiskTriggerTime; } else { lruToDiskTriggerTime = cacheConfig.lruToDiskTriggerTime; } if (lruToDiskTriggerTime == CacheConfig.DEFAULT_LRU_TO_DISK_TRIGGER_TIME && (cacheConfig.lruToDiskTriggerPercent > CacheConfig.DEFAULT_LRU_TO_DISK_TRIGGER_PERCENT || cacheConfig.memoryCacheSizeInMB != CacheConfig.DEFAULT_DISABLE_CACHE_SIZE_MB)) { lruToDiskTriggerTime = CacheConfig.DEFAULT_LRU_TO_DISK_TRIGGER_TIME_FOR_TRIMCACHE; cacheConfig.lruToDiskTriggerTime = lruToDiskTriggerTime; Tr.audit(tc, "DYNA1069I", new Object[] { new Integer(cacheConfig.lruToDiskTriggerTime)}); } //---------------------------------------------- // Initialize TimeLimitDaemon object //---------------------------------------------- timeLimitDaemon = new TimeLimitDaemon(cacheConfig.timeGranularityInSeconds, lruToDiskTriggerTime); if (tc.isDebugEnabled()) { Tr.debug(tc, "startServices() - starting TimeLimitDaemon service. " + "This service should only start once for all cache instances. Settings are: " + " timeGranularityInSeconds=" + cacheConfig.timeGranularityInSeconds + " lruToDiskTriggerTime=" + cacheConfig.lruToDiskTriggerTime); } //---------------------------------------------- // start service //---------------------------------------------- timeLimitDaemon.start(); } } }
[ "public", "void", "startServices", "(", "boolean", "startTLD", ")", "{", "synchronized", "(", "this", ".", "serviceMonitor", ")", "{", "//multiple threads can call this concurrently ", "if", "(", "this", ".", "batchUpdateDaemon", "==", "null", ")", "{", "//----------------------------------------------", "// Initialize BatchUpdateDaemon object", "//----------------------------------------------", "batchUpdateDaemon", "=", "new", "BatchUpdateDaemon", "(", "cacheConfig", ".", "batchUpdateInterval", ")", ";", "//----------------------------------------------", "// Initialize InvalidationAuditDaemon object", "//----------------------------------------------", "invalidationAuditDaemon", "=", "new", "InvalidationAuditDaemon", "(", "cacheConfig", ".", "timeHoldingInvalidations", ")", ";", "//----------------------------------------------", "// link invalidationAuditDaemon to BatchUpdateDaemon", "//----------------------------------------------", "batchUpdateDaemon", ".", "setInvalidationAuditDaemon", "(", "invalidationAuditDaemon", ")", ";", "if", "(", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"startServices() - starting BatchUpdateDaemon/invalidationAuditDaemon services. \"", "+", "\"These services should only start once for all cache instances. Settings are: \"", "+", "\" batchUpdateInterval=\"", "+", "cacheConfig", ".", "batchUpdateInterval", "+", "\" timeHoldingInvalidations=\"", "+", "cacheConfig", ".", "timeHoldingInvalidations", ")", ";", "}", "//----------------------------------------------", "// start services", "//----------------------------------------------", "batchUpdateDaemon", ".", "start", "(", ")", ";", "invalidationAuditDaemon", ".", "start", "(", ")", ";", "}", "if", "(", "startTLD", "&&", "this", ".", "timeLimitDaemon", "==", "null", ")", "{", "//----------------------------------------------", "// Initialize TimeLimitDaemon object", "//----------------------------------------------", "// lruToDiskTriggerTime is set to the default (5 sec) under the following conditions", "// (1) less than 1 msec", "// (2) larger than timeGranularityInSeconds", "int", "lruToDiskTriggerTime", "=", "CacheConfig", ".", "DEFAULT_LRU_TO_DISK_TRIGGER_TIME", ";", "if", "(", "cacheConfig", ".", "lruToDiskTriggerTime", ">", "cacheConfig", ".", "timeGranularityInSeconds", "*", "1000", "||", "cacheConfig", ".", "lruToDiskTriggerTime", "<", "CacheConfig", ".", "MIN_LRU_TO_DISK_TRIGGER_TIME", ")", "{", "Tr", ".", "warning", "(", "tc", ",", "\"DYNA0069W\"", ",", "new", "Object", "[", "]", "{", "new", "Integer", "(", "cacheConfig", ".", "lruToDiskTriggerTime", ")", ",", "\"lruToDiskTriggerTime\"", ",", "cacheConfig", ".", "cacheName", ",", "new", "Integer", "(", "CacheConfig", ".", "MIN_LRU_TO_DISK_TRIGGER_TIME", ")", ",", "new", "Integer", "(", "cacheConfig", ".", "timeGranularityInSeconds", "*", "1000", ")", ",", "new", "Integer", "(", "CacheConfig", ".", "DEFAULT_LRU_TO_DISK_TRIGGER_TIME", ")", "}", ")", ";", "cacheConfig", ".", "lruToDiskTriggerTime", "=", "lruToDiskTriggerTime", ";", "}", "else", "{", "lruToDiskTriggerTime", "=", "cacheConfig", ".", "lruToDiskTriggerTime", ";", "}", "if", "(", "lruToDiskTriggerTime", "==", "CacheConfig", ".", "DEFAULT_LRU_TO_DISK_TRIGGER_TIME", "&&", "(", "cacheConfig", ".", "lruToDiskTriggerPercent", ">", "CacheConfig", ".", "DEFAULT_LRU_TO_DISK_TRIGGER_PERCENT", "||", "cacheConfig", ".", "memoryCacheSizeInMB", "!=", "CacheConfig", ".", "DEFAULT_DISABLE_CACHE_SIZE_MB", ")", ")", "{", "lruToDiskTriggerTime", "=", "CacheConfig", ".", "DEFAULT_LRU_TO_DISK_TRIGGER_TIME_FOR_TRIMCACHE", ";", "cacheConfig", ".", "lruToDiskTriggerTime", "=", "lruToDiskTriggerTime", ";", "Tr", ".", "audit", "(", "tc", ",", "\"DYNA1069I\"", ",", "new", "Object", "[", "]", "{", "new", "Integer", "(", "cacheConfig", ".", "lruToDiskTriggerTime", ")", "}", ")", ";", "}", "//----------------------------------------------", "// Initialize TimeLimitDaemon object", "//----------------------------------------------", "timeLimitDaemon", "=", "new", "TimeLimitDaemon", "(", "cacheConfig", ".", "timeGranularityInSeconds", ",", "lruToDiskTriggerTime", ")", ";", "if", "(", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"startServices() - starting TimeLimitDaemon service. \"", "+", "\"This service should only start once for all cache instances. Settings are: \"", "+", "\" timeGranularityInSeconds=\"", "+", "cacheConfig", ".", "timeGranularityInSeconds", "+", "\" lruToDiskTriggerTime=\"", "+", "cacheConfig", ".", "lruToDiskTriggerTime", ")", ";", "}", "//----------------------------------------------", "// start service", "//----------------------------------------------", "timeLimitDaemon", ".", "start", "(", ")", ";", "}", "}", "}" ]
This is called by ServerCache to start BatchUpdateDaemon, InvalidationAuditDaemon, TimeLimitDaemon and ExternalCacheServices These services should only start once for all cache instances @param startTLD this param is false for a third party cache provider
[ "This", "is", "called", "by", "ServerCache", "to", "start", "BatchUpdateDaemon", "InvalidationAuditDaemon", "TimeLimitDaemon", "and", "ExternalCacheServices", "These", "services", "should", "only", "start", "once", "for", "all", "cache", "instances" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheUnitImpl.java#L245-L321
train
OpenLiberty/open-liberty
dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheUnitImpl.java
CacheUnitImpl.addAlias
public void addAlias(String cacheName, Object id, Object[] aliasArray) { if (id != null && aliasArray != null) { DCache cache = ServerCache.getCache(cacheName); if (cache != null) { try { cache.addAlias(id, aliasArray, false, false); } catch (IllegalArgumentException e) { if (tc.isDebugEnabled()) { Tr.debug(tc, "Adding alias for cache id " + id + " failure: " + e.getMessage()); } } } } }
java
public void addAlias(String cacheName, Object id, Object[] aliasArray) { if (id != null && aliasArray != null) { DCache cache = ServerCache.getCache(cacheName); if (cache != null) { try { cache.addAlias(id, aliasArray, false, false); } catch (IllegalArgumentException e) { if (tc.isDebugEnabled()) { Tr.debug(tc, "Adding alias for cache id " + id + " failure: " + e.getMessage()); } } } } }
[ "public", "void", "addAlias", "(", "String", "cacheName", ",", "Object", "id", ",", "Object", "[", "]", "aliasArray", ")", "{", "if", "(", "id", "!=", "null", "&&", "aliasArray", "!=", "null", ")", "{", "DCache", "cache", "=", "ServerCache", ".", "getCache", "(", "cacheName", ")", ";", "if", "(", "cache", "!=", "null", ")", "{", "try", "{", "cache", ".", "addAlias", "(", "id", ",", "aliasArray", ",", "false", ",", "false", ")", ";", "}", "catch", "(", "IllegalArgumentException", "e", ")", "{", "if", "(", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"Adding alias for cache id \"", "+", "id", "+", "\" failure: \"", "+", "e", ".", "getMessage", "(", ")", ")", ";", "}", "}", "}", "}", "}" ]
This implements the method in the CacheUnit interface. This is called to add alias ids for cache id. @param cacheName The cache name @param id The cache id @param aliasArray The array of alias ids
[ "This", "implements", "the", "method", "in", "the", "CacheUnit", "interface", ".", "This", "is", "called", "to", "add", "alias", "ids", "for", "cache", "id", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheUnitImpl.java#L334-L347
train
OpenLiberty/open-liberty
dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheUnitImpl.java
CacheUnitImpl.removeAlias
public void removeAlias(String cacheName, Object alias) { if (alias != null) { DCache cache = ServerCache.getCache(cacheName); if (cache != null) { try { cache.removeAlias(alias, false, false); } catch (IllegalArgumentException e) { if (tc.isDebugEnabled()) { Tr.debug(tc, "Removing alias " + alias + " failure: " + e.getMessage()); } } } } }
java
public void removeAlias(String cacheName, Object alias) { if (alias != null) { DCache cache = ServerCache.getCache(cacheName); if (cache != null) { try { cache.removeAlias(alias, false, false); } catch (IllegalArgumentException e) { if (tc.isDebugEnabled()) { Tr.debug(tc, "Removing alias " + alias + " failure: " + e.getMessage()); } } } } }
[ "public", "void", "removeAlias", "(", "String", "cacheName", ",", "Object", "alias", ")", "{", "if", "(", "alias", "!=", "null", ")", "{", "DCache", "cache", "=", "ServerCache", ".", "getCache", "(", "cacheName", ")", ";", "if", "(", "cache", "!=", "null", ")", "{", "try", "{", "cache", ".", "removeAlias", "(", "alias", ",", "false", ",", "false", ")", ";", "}", "catch", "(", "IllegalArgumentException", "e", ")", "{", "if", "(", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"Removing alias \"", "+", "alias", "+", "\" failure: \"", "+", "e", ".", "getMessage", "(", ")", ")", ";", "}", "}", "}", "}", "}" ]
This implements the method in the CacheUnit interface. This is called to remove alias ids from cache id. @param cacheName The cache name @param alias The alias ids
[ "This", "implements", "the", "method", "in", "the", "CacheUnit", "interface", ".", "This", "is", "called", "to", "remove", "alias", "ids", "from", "cache", "id", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheUnitImpl.java#L356-L369
train
OpenLiberty/open-liberty
dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheUnitImpl.java
CacheUnitImpl.getCommandCache
public CommandCache getCommandCache(String cacheName) throws DynamicCacheServiceNotStarted, IllegalStateException { if (servletCacheUnit == null) { throw new DynamicCacheServiceNotStarted("Servlet cache service has not been started."); } return servletCacheUnit.getCommandCache(cacheName); }
java
public CommandCache getCommandCache(String cacheName) throws DynamicCacheServiceNotStarted, IllegalStateException { if (servletCacheUnit == null) { throw new DynamicCacheServiceNotStarted("Servlet cache service has not been started."); } return servletCacheUnit.getCommandCache(cacheName); }
[ "public", "CommandCache", "getCommandCache", "(", "String", "cacheName", ")", "throws", "DynamicCacheServiceNotStarted", ",", "IllegalStateException", "{", "if", "(", "servletCacheUnit", "==", "null", ")", "{", "throw", "new", "DynamicCacheServiceNotStarted", "(", "\"Servlet cache service has not been started.\"", ")", ";", "}", "return", "servletCacheUnit", ".", "getCommandCache", "(", "cacheName", ")", ";", "}" ]
This implements the method in the CacheUnit interface. This is called to get Command Cache object. @param cacheName The cache name @return CommandCache object
[ "This", "implements", "the", "method", "in", "the", "CacheUnit", "interface", ".", "This", "is", "called", "to", "get", "Command", "Cache", "object", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheUnitImpl.java#L388-L393
train
OpenLiberty/open-liberty
dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheUnitImpl.java
CacheUnitImpl.getJSPCache
public JSPCache getJSPCache(String cacheName) throws DynamicCacheServiceNotStarted, IllegalStateException { if (servletCacheUnit == null) { throw new DynamicCacheServiceNotStarted("Servlet cache service has not been started."); } return servletCacheUnit.getJSPCache(cacheName); }
java
public JSPCache getJSPCache(String cacheName) throws DynamicCacheServiceNotStarted, IllegalStateException { if (servletCacheUnit == null) { throw new DynamicCacheServiceNotStarted("Servlet cache service has not been started."); } return servletCacheUnit.getJSPCache(cacheName); }
[ "public", "JSPCache", "getJSPCache", "(", "String", "cacheName", ")", "throws", "DynamicCacheServiceNotStarted", ",", "IllegalStateException", "{", "if", "(", "servletCacheUnit", "==", "null", ")", "{", "throw", "new", "DynamicCacheServiceNotStarted", "(", "\"Servlet cache service has not been started.\"", ")", ";", "}", "return", "servletCacheUnit", ".", "getJSPCache", "(", "cacheName", ")", ";", "}" ]
This implements the method in the CacheUnit interface. This is called to get JSP Cache object. @param cacheName The cache name @return JSPCache object
[ "This", "implements", "the", "method", "in", "the", "CacheUnit", "interface", ".", "This", "is", "called", "to", "get", "JSP", "Cache", "object", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheUnitImpl.java#L402-L407
train
OpenLiberty/open-liberty
dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheUnitImpl.java
CacheUnitImpl.createObjectCache
public Object createObjectCache(String cacheName) throws DynamicCacheServiceNotStarted, IllegalStateException { if (objectCacheUnit == null) { throw new DynamicCacheServiceNotStarted("Object cache service has not been started."); } return objectCacheUnit.createObjectCache(cacheName); }
java
public Object createObjectCache(String cacheName) throws DynamicCacheServiceNotStarted, IllegalStateException { if (objectCacheUnit == null) { throw new DynamicCacheServiceNotStarted("Object cache service has not been started."); } return objectCacheUnit.createObjectCache(cacheName); }
[ "public", "Object", "createObjectCache", "(", "String", "cacheName", ")", "throws", "DynamicCacheServiceNotStarted", ",", "IllegalStateException", "{", "if", "(", "objectCacheUnit", "==", "null", ")", "{", "throw", "new", "DynamicCacheServiceNotStarted", "(", "\"Object cache service has not been started.\"", ")", ";", "}", "return", "objectCacheUnit", ".", "createObjectCache", "(", "cacheName", ")", ";", "}" ]
This implements the method in the CacheUnit interface. This is called to create object cache. It calls ObjectCacheUnit to perform this operation. @param cacheName The cache name
[ "This", "implements", "the", "method", "in", "the", "CacheUnit", "interface", ".", "This", "is", "called", "to", "create", "object", "cache", ".", "It", "calls", "ObjectCacheUnit", "to", "perform", "this", "operation", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheUnitImpl.java#L441-L446
train
OpenLiberty/open-liberty
dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheUnitImpl.java
CacheUnitImpl.createEventSource
public EventSource createEventSource(boolean createAsyncEventSource, String cacheName) throws DynamicCacheServiceNotStarted { if (objectCacheUnit == null) { throw new DynamicCacheServiceNotStarted("Object cache service has not been started."); } return objectCacheUnit.createEventSource(createAsyncEventSource, cacheName); }
java
public EventSource createEventSource(boolean createAsyncEventSource, String cacheName) throws DynamicCacheServiceNotStarted { if (objectCacheUnit == null) { throw new DynamicCacheServiceNotStarted("Object cache service has not been started."); } return objectCacheUnit.createEventSource(createAsyncEventSource, cacheName); }
[ "public", "EventSource", "createEventSource", "(", "boolean", "createAsyncEventSource", ",", "String", "cacheName", ")", "throws", "DynamicCacheServiceNotStarted", "{", "if", "(", "objectCacheUnit", "==", "null", ")", "{", "throw", "new", "DynamicCacheServiceNotStarted", "(", "\"Object cache service has not been started.\"", ")", ";", "}", "return", "objectCacheUnit", ".", "createEventSource", "(", "createAsyncEventSource", ",", "cacheName", ")", ";", "}" ]
This implements the method in the CacheUnit interface. This is called to create event source object. It calls ObjectCacheUnit to perform this operation. @param createAsyncEventSource boolean true - using async thread context for callback; false - using caller thread for callback @param cacheName The cache name @return EventSourceIntf The event source
[ "This", "implements", "the", "method", "in", "the", "CacheUnit", "interface", ".", "This", "is", "called", "to", "create", "event", "source", "object", ".", "It", "calls", "ObjectCacheUnit", "to", "perform", "this", "operation", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheUnitImpl.java#L457-L462
train
OpenLiberty/open-liberty
dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/asn1/x509/PolicyQualifierInfo.java
PolicyQualifierInfo.toASN1Object
public DERObject toASN1Object() { ASN1EncodableVector dev = new ASN1EncodableVector(); dev.add(policyQualifierId); dev.add(qualifier); return new DERSequence(dev); }
java
public DERObject toASN1Object() { ASN1EncodableVector dev = new ASN1EncodableVector(); dev.add(policyQualifierId); dev.add(qualifier); return new DERSequence(dev); }
[ "public", "DERObject", "toASN1Object", "(", ")", "{", "ASN1EncodableVector", "dev", "=", "new", "ASN1EncodableVector", "(", ")", ";", "dev", ".", "add", "(", "policyQualifierId", ")", ";", "dev", ".", "add", "(", "qualifier", ")", ";", "return", "new", "DERSequence", "(", "dev", ")", ";", "}" ]
Returns a DER-encodable representation of this instance. @return a <code>DERObject</code> value
[ "Returns", "a", "DER", "-", "encodable", "representation", "of", "this", "instance", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/asn1/x509/PolicyQualifierInfo.java#L99-L106
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPOutputHandler.java
PtoPOutputHandler.sendAckExpectedMessage
public void sendAckExpectedMessage(long ackExpStamp, int priority, Reliability reliability, SIBUuid12 stream) // not used for ptp throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "sendAckExpectedMessage", new Object[] { new Long(ackExpStamp), new Integer(priority), reliability }); if( routingMEUuid != null ) { ControlAckExpected ackexpMsg; try { ackexpMsg = cmf.createNewControlAckExpected(); } catch (Exception e) { // FFDC FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.PtoPOutputHandler.sendAckExpectedMessage", "1:733:1.241", this); SibTr.exception(tc, e); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "sendAckExpectedMessage", e); SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.PtoPOutputHandler", "1:744:1.241", e }); throw new SIResourceException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.PtoPOutputHandler", "1:752:1.241", e }, null), e); } // As we are using the Guaranteed Header - set all the attributes as // well as the ones we want. SIMPUtils.setGuaranteedDeliveryProperties(ackexpMsg, messageProcessor.getMessagingEngineUuid(), targetMEUuid, stream, null, destinationHandler.getUuid(), ProtocolType.UNICASTINPUT, GDConfig.PROTOCOL_VERSION); ackexpMsg.setTick(ackExpStamp); ackexpMsg.setPriority(priority); ackexpMsg.setReliability(reliability); // SIB0105 // Update the health state of this stream SourceStream sourceStream = (SourceStream)sourceStreamManager .getStreamSet() .getStream(priority, reliability); if (sourceStream != null) { sourceStream.setLatestAckExpected(ackExpStamp); sourceStream.getControlAdapter() .getHealthState().updateHealth(HealthStateListener.ACK_EXPECTED_STATE, HealthState.AMBER); } // If the destination in a Link add Link specific properties to message if( isLink ) { ackexpMsg = (ControlAckExpected)addLinkProps(ackexpMsg); } // If the destination is system or temporary then the // routingDestination into th message if( this.isSystemOrTemp ) { ackexpMsg.setRoutingDestination(routingDestination); } // Send ackExpected message to destination // Using MPIO mpio.sendToMe(routingMEUuid, priority, ackexpMsg ); } else { if(TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc,"Unable to send AckExpected as Link not started"); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "sendAckExpectedMessage"); }
java
public void sendAckExpectedMessage(long ackExpStamp, int priority, Reliability reliability, SIBUuid12 stream) // not used for ptp throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "sendAckExpectedMessage", new Object[] { new Long(ackExpStamp), new Integer(priority), reliability }); if( routingMEUuid != null ) { ControlAckExpected ackexpMsg; try { ackexpMsg = cmf.createNewControlAckExpected(); } catch (Exception e) { // FFDC FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.PtoPOutputHandler.sendAckExpectedMessage", "1:733:1.241", this); SibTr.exception(tc, e); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "sendAckExpectedMessage", e); SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.PtoPOutputHandler", "1:744:1.241", e }); throw new SIResourceException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.PtoPOutputHandler", "1:752:1.241", e }, null), e); } // As we are using the Guaranteed Header - set all the attributes as // well as the ones we want. SIMPUtils.setGuaranteedDeliveryProperties(ackexpMsg, messageProcessor.getMessagingEngineUuid(), targetMEUuid, stream, null, destinationHandler.getUuid(), ProtocolType.UNICASTINPUT, GDConfig.PROTOCOL_VERSION); ackexpMsg.setTick(ackExpStamp); ackexpMsg.setPriority(priority); ackexpMsg.setReliability(reliability); // SIB0105 // Update the health state of this stream SourceStream sourceStream = (SourceStream)sourceStreamManager .getStreamSet() .getStream(priority, reliability); if (sourceStream != null) { sourceStream.setLatestAckExpected(ackExpStamp); sourceStream.getControlAdapter() .getHealthState().updateHealth(HealthStateListener.ACK_EXPECTED_STATE, HealthState.AMBER); } // If the destination in a Link add Link specific properties to message if( isLink ) { ackexpMsg = (ControlAckExpected)addLinkProps(ackexpMsg); } // If the destination is system or temporary then the // routingDestination into th message if( this.isSystemOrTemp ) { ackexpMsg.setRoutingDestination(routingDestination); } // Send ackExpected message to destination // Using MPIO mpio.sendToMe(routingMEUuid, priority, ackexpMsg ); } else { if(TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc,"Unable to send AckExpected as Link not started"); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "sendAckExpectedMessage"); }
[ "public", "void", "sendAckExpectedMessage", "(", "long", "ackExpStamp", ",", "int", "priority", ",", "Reliability", "reliability", ",", "SIBUuid12", "stream", ")", "// not used for ptp", "throws", "SIResourceException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"sendAckExpectedMessage\"", ",", "new", "Object", "[", "]", "{", "new", "Long", "(", "ackExpStamp", ")", ",", "new", "Integer", "(", "priority", ")", ",", "reliability", "}", ")", ";", "if", "(", "routingMEUuid", "!=", "null", ")", "{", "ControlAckExpected", "ackexpMsg", ";", "try", "{", "ackexpMsg", "=", "cmf", ".", "createNewControlAckExpected", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "// FFDC", "FFDCFilter", ".", "processException", "(", "e", ",", "\"com.ibm.ws.sib.processor.impl.PtoPOutputHandler.sendAckExpectedMessage\"", ",", "\"1:733:1.241\"", ",", "this", ")", ";", "SibTr", ".", "exception", "(", "tc", ",", "e", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"sendAckExpectedMessage\"", ",", "e", ")", ";", "SibTr", ".", "error", "(", "tc", ",", "\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"", ",", "new", "Object", "[", "]", "{", "\"com.ibm.ws.sib.processor.impl.PtoPOutputHandler\"", ",", "\"1:744:1.241\"", ",", "e", "}", ")", ";", "throw", "new", "SIResourceException", "(", "nls", ".", "getFormattedMessage", "(", "\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"", ",", "new", "Object", "[", "]", "{", "\"com.ibm.ws.sib.processor.impl.PtoPOutputHandler\"", ",", "\"1:752:1.241\"", ",", "e", "}", ",", "null", ")", ",", "e", ")", ";", "}", "// As we are using the Guaranteed Header - set all the attributes as", "// well as the ones we want.", "SIMPUtils", ".", "setGuaranteedDeliveryProperties", "(", "ackexpMsg", ",", "messageProcessor", ".", "getMessagingEngineUuid", "(", ")", ",", "targetMEUuid", ",", "stream", ",", "null", ",", "destinationHandler", ".", "getUuid", "(", ")", ",", "ProtocolType", ".", "UNICASTINPUT", ",", "GDConfig", ".", "PROTOCOL_VERSION", ")", ";", "ackexpMsg", ".", "setTick", "(", "ackExpStamp", ")", ";", "ackexpMsg", ".", "setPriority", "(", "priority", ")", ";", "ackexpMsg", ".", "setReliability", "(", "reliability", ")", ";", "// SIB0105", "// Update the health state of this stream ", "SourceStream", "sourceStream", "=", "(", "SourceStream", ")", "sourceStreamManager", ".", "getStreamSet", "(", ")", ".", "getStream", "(", "priority", ",", "reliability", ")", ";", "if", "(", "sourceStream", "!=", "null", ")", "{", "sourceStream", ".", "setLatestAckExpected", "(", "ackExpStamp", ")", ";", "sourceStream", ".", "getControlAdapter", "(", ")", ".", "getHealthState", "(", ")", ".", "updateHealth", "(", "HealthStateListener", ".", "ACK_EXPECTED_STATE", ",", "HealthState", ".", "AMBER", ")", ";", "}", "// If the destination in a Link add Link specific properties to message", "if", "(", "isLink", ")", "{", "ackexpMsg", "=", "(", "ControlAckExpected", ")", "addLinkProps", "(", "ackexpMsg", ")", ";", "}", "// If the destination is system or temporary then the ", "// routingDestination into th message", "if", "(", "this", ".", "isSystemOrTemp", ")", "{", "ackexpMsg", ".", "setRoutingDestination", "(", "routingDestination", ")", ";", "}", "// Send ackExpected message to destination", "// Using MPIO", "mpio", ".", "sendToMe", "(", "routingMEUuid", ",", "priority", ",", "ackexpMsg", ")", ";", "}", "else", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "tc", ",", "\"Unable to send AckExpected as Link not started\"", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"sendAckExpectedMessage\"", ")", ";", "}" ]
sendAckExpectedMessage is called from SourceStream timer alarm
[ "sendAckExpectedMessage", "is", "called", "from", "SourceStream", "timer", "alarm" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPOutputHandler.java#L631-L737
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPOutputHandler.java
PtoPOutputHandler.sendSilenceMessage
public void sendSilenceMessage( long startStamp, long endStamp, long completedPrefix, boolean requestedOnly, int priority, Reliability reliability, SIBUuid12 stream) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "sendSilenceMessage"); ControlSilence sMsg; try { // Create new Silence message sMsg = cmf.createNewControlSilence(); } catch (Exception e) { // FFDC FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.PtoPOutputHandler.sendSilenceMessage", "1:849:1.241", this); SibTr.exception(tc, e); SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.PtoPOutputHandler", "1:856:1.241", e }); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "sendSilenceMessage", e); throw new SIResourceException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.PtoPOutputHandler", "1:867:1.241", e }, null), e); } // As we are using the Guaranteed Header - set all the attributes as // well as the ones we want. SIMPUtils.setGuaranteedDeliveryProperties(sMsg, messageProcessor.getMessagingEngineUuid(), targetMEUuid, stream, null, destinationHandler.getUuid(), ProtocolType.UNICASTINPUT, GDConfig.PROTOCOL_VERSION); sMsg.setStartTick(startStamp); sMsg.setEndTick(endStamp); sMsg.setPriority(priority); sMsg.setReliability(reliability); sMsg.setCompletedPrefix(completedPrefix); // If the destination in a Link add Link specific properties to message if( isLink ) { sMsg = (ControlSilence)addLinkProps(sMsg); } // If the destination is system or temporary then the // routingDestination into th message if( this.isSystemOrTemp ) { sMsg.setRoutingDestination(routingDestination); } // Send message to destination // Using MPIO // If requestedOnly then this is a response to a Nack so resend at priority+1 if( requestedOnly ) mpio.sendToMe(routingMEUuid, priority+1, sMsg); else mpio.sendToMe(routingMEUuid, priority, sMsg); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "sendSilenceMessage"); }
java
public void sendSilenceMessage( long startStamp, long endStamp, long completedPrefix, boolean requestedOnly, int priority, Reliability reliability, SIBUuid12 stream) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "sendSilenceMessage"); ControlSilence sMsg; try { // Create new Silence message sMsg = cmf.createNewControlSilence(); } catch (Exception e) { // FFDC FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.PtoPOutputHandler.sendSilenceMessage", "1:849:1.241", this); SibTr.exception(tc, e); SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.PtoPOutputHandler", "1:856:1.241", e }); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "sendSilenceMessage", e); throw new SIResourceException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.PtoPOutputHandler", "1:867:1.241", e }, null), e); } // As we are using the Guaranteed Header - set all the attributes as // well as the ones we want. SIMPUtils.setGuaranteedDeliveryProperties(sMsg, messageProcessor.getMessagingEngineUuid(), targetMEUuid, stream, null, destinationHandler.getUuid(), ProtocolType.UNICASTINPUT, GDConfig.PROTOCOL_VERSION); sMsg.setStartTick(startStamp); sMsg.setEndTick(endStamp); sMsg.setPriority(priority); sMsg.setReliability(reliability); sMsg.setCompletedPrefix(completedPrefix); // If the destination in a Link add Link specific properties to message if( isLink ) { sMsg = (ControlSilence)addLinkProps(sMsg); } // If the destination is system or temporary then the // routingDestination into th message if( this.isSystemOrTemp ) { sMsg.setRoutingDestination(routingDestination); } // Send message to destination // Using MPIO // If requestedOnly then this is a response to a Nack so resend at priority+1 if( requestedOnly ) mpio.sendToMe(routingMEUuid, priority+1, sMsg); else mpio.sendToMe(routingMEUuid, priority, sMsg); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "sendSilenceMessage"); }
[ "public", "void", "sendSilenceMessage", "(", "long", "startStamp", ",", "long", "endStamp", ",", "long", "completedPrefix", ",", "boolean", "requestedOnly", ",", "int", "priority", ",", "Reliability", "reliability", ",", "SIBUuid12", "stream", ")", "throws", "SIResourceException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"sendSilenceMessage\"", ")", ";", "ControlSilence", "sMsg", ";", "try", "{", "// Create new Silence message", "sMsg", "=", "cmf", ".", "createNewControlSilence", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "// FFDC", "FFDCFilter", ".", "processException", "(", "e", ",", "\"com.ibm.ws.sib.processor.impl.PtoPOutputHandler.sendSilenceMessage\"", ",", "\"1:849:1.241\"", ",", "this", ")", ";", "SibTr", ".", "exception", "(", "tc", ",", "e", ")", ";", "SibTr", ".", "error", "(", "tc", ",", "\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"", ",", "new", "Object", "[", "]", "{", "\"com.ibm.ws.sib.processor.impl.PtoPOutputHandler\"", ",", "\"1:856:1.241\"", ",", "e", "}", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"sendSilenceMessage\"", ",", "e", ")", ";", "throw", "new", "SIResourceException", "(", "nls", ".", "getFormattedMessage", "(", "\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"", ",", "new", "Object", "[", "]", "{", "\"com.ibm.ws.sib.processor.impl.PtoPOutputHandler\"", ",", "\"1:867:1.241\"", ",", "e", "}", ",", "null", ")", ",", "e", ")", ";", "}", "// As we are using the Guaranteed Header - set all the attributes as", "// well as the ones we want.", "SIMPUtils", ".", "setGuaranteedDeliveryProperties", "(", "sMsg", ",", "messageProcessor", ".", "getMessagingEngineUuid", "(", ")", ",", "targetMEUuid", ",", "stream", ",", "null", ",", "destinationHandler", ".", "getUuid", "(", ")", ",", "ProtocolType", ".", "UNICASTINPUT", ",", "GDConfig", ".", "PROTOCOL_VERSION", ")", ";", "sMsg", ".", "setStartTick", "(", "startStamp", ")", ";", "sMsg", ".", "setEndTick", "(", "endStamp", ")", ";", "sMsg", ".", "setPriority", "(", "priority", ")", ";", "sMsg", ".", "setReliability", "(", "reliability", ")", ";", "sMsg", ".", "setCompletedPrefix", "(", "completedPrefix", ")", ";", "// If the destination in a Link add Link specific properties to message", "if", "(", "isLink", ")", "{", "sMsg", "=", "(", "ControlSilence", ")", "addLinkProps", "(", "sMsg", ")", ";", "}", "// If the destination is system or temporary then the ", "// routingDestination into th message", "if", "(", "this", ".", "isSystemOrTemp", ")", "{", "sMsg", ".", "setRoutingDestination", "(", "routingDestination", ")", ";", "}", "// Send message to destination", "// Using MPIO", "// If requestedOnly then this is a response to a Nack so resend at priority+1 ", "if", "(", "requestedOnly", ")", "mpio", ".", "sendToMe", "(", "routingMEUuid", ",", "priority", "+", "1", ",", "sMsg", ")", ";", "else", "mpio", ".", "sendToMe", "(", "routingMEUuid", ",", "priority", ",", "sMsg", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"sendSilenceMessage\"", ")", ";", "}" ]
sendSilenceMessage may be called from SourceStream when a Nack is recevied
[ "sendSilenceMessage", "may", "be", "called", "from", "SourceStream", "when", "a", "Nack", "is", "recevied" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPOutputHandler.java#L743-L834
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPOutputHandler.java
PtoPOutputHandler.handleRollback
protected void handleRollback(LocalTransaction transaction) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "handleRollback", transaction); // Roll back the transaction if we created it. if (transaction != null) { try { transaction.rollback(); } catch (SIException e) { // FFDC FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.PtoPOutputHandler.handleRollback", "1:1644:1.241", this); SibTr.exception(tc, e); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "handleRollback"); }
java
protected void handleRollback(LocalTransaction transaction) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "handleRollback", transaction); // Roll back the transaction if we created it. if (transaction != null) { try { transaction.rollback(); } catch (SIException e) { // FFDC FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.PtoPOutputHandler.handleRollback", "1:1644:1.241", this); SibTr.exception(tc, e); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "handleRollback"); }
[ "protected", "void", "handleRollback", "(", "LocalTransaction", "transaction", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"handleRollback\"", ",", "transaction", ")", ";", "// Roll back the transaction if we created it.", "if", "(", "transaction", "!=", "null", ")", "{", "try", "{", "transaction", ".", "rollback", "(", ")", ";", "}", "catch", "(", "SIException", "e", ")", "{", "// FFDC", "FFDCFilter", ".", "processException", "(", "e", ",", "\"com.ibm.ws.sib.processor.impl.PtoPOutputHandler.handleRollback\"", ",", "\"1:1644:1.241\"", ",", "this", ")", ";", "SibTr", ".", "exception", "(", "tc", ",", "e", ")", ";", "}", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"handleRollback\"", ")", ";", "}" ]
This method checks to see if rollback is required @param transaction The transaction to rollback.
[ "This", "method", "checks", "to", "see", "if", "rollback", "is", "required" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPOutputHandler.java#L1542-L1569
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPOutputHandler.java
PtoPOutputHandler.updateTargetCellule
public void updateTargetCellule(SIBUuid8 targetMEUuid) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "updateTargetCellule", targetMEUuid); this.targetMEUuid = targetMEUuid; sourceStreamManager.updateTargetCellule(targetMEUuid); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "updateTargetCellule"); }
java
public void updateTargetCellule(SIBUuid8 targetMEUuid) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "updateTargetCellule", targetMEUuid); this.targetMEUuid = targetMEUuid; sourceStreamManager.updateTargetCellule(targetMEUuid); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "updateTargetCellule"); }
[ "public", "void", "updateTargetCellule", "(", "SIBUuid8", "targetMEUuid", ")", "throws", "SIResourceException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"updateTargetCellule\"", ",", "targetMEUuid", ")", ";", "this", ".", "targetMEUuid", "=", "targetMEUuid", ";", "sourceStreamManager", ".", "updateTargetCellule", "(", "targetMEUuid", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"updateTargetCellule\"", ")", ";", "}" ]
This method should only be called when the PtoPOutputHandler was created for a Link with an unknown targetCellule and WLM has now told us correct targetCellule.
[ "This", "method", "should", "only", "be", "called", "when", "the", "PtoPOutputHandler", "was", "created", "for", "a", "Link", "with", "an", "unknown", "targetCellule", "and", "WLM", "has", "now", "told", "us", "correct", "targetCellule", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPOutputHandler.java#L2542-L2554
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPOutputHandler.java
PtoPOutputHandler.updateRoutingCellule
public void updateRoutingCellule( SIBUuid8 routingME ) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "updateRoutingCellule", routingME); this.routingMEUuid = routingME; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "updateRoutingCellule"); }
java
public void updateRoutingCellule( SIBUuid8 routingME ) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "updateRoutingCellule", routingME); this.routingMEUuid = routingME; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "updateRoutingCellule"); }
[ "public", "void", "updateRoutingCellule", "(", "SIBUuid8", "routingME", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"updateRoutingCellule\"", ",", "routingME", ")", ";", "this", ".", "routingMEUuid", "=", "routingME", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"updateRoutingCellule\"", ")", ";", "}" ]
This method should only be called when the PtoPOutputHandler was created for a Link. It is called every time a message is sent
[ "This", "method", "should", "only", "be", "called", "when", "the", "PtoPOutputHandler", "was", "created", "for", "a", "Link", ".", "It", "is", "called", "every", "time", "a", "message", "is", "sent" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPOutputHandler.java#L2560-L2569
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/AsyncUpdateThread.java
AsyncUpdateThread.enqueueWork
public void enqueueWork(AsyncUpdate unit) throws ClosedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "enqueueWork", unit); synchronized (this) { if (closed) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "enqueueWork", "ClosedException"); throw new ClosedException(); } if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Enqueueing update: " + unit); enqueuedUnits.add(unit); if (executing) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "enqueueWork", "AsyncUpdateThread executing"); return; } // not executing enqueued updates if (enqueuedUnits.size() > batchThreshold) { executeSinceExpiry = true; try { startExecutingUpdates(); } catch (ClosedException e) { // No FFDC code needed if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "enqueueWork", e); throw e; } } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "enqueueWork"); }
java
public void enqueueWork(AsyncUpdate unit) throws ClosedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "enqueueWork", unit); synchronized (this) { if (closed) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "enqueueWork", "ClosedException"); throw new ClosedException(); } if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Enqueueing update: " + unit); enqueuedUnits.add(unit); if (executing) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "enqueueWork", "AsyncUpdateThread executing"); return; } // not executing enqueued updates if (enqueuedUnits.size() > batchThreshold) { executeSinceExpiry = true; try { startExecutingUpdates(); } catch (ClosedException e) { // No FFDC code needed if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "enqueueWork", e); throw e; } } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "enqueueWork"); }
[ "public", "void", "enqueueWork", "(", "AsyncUpdate", "unit", ")", "throws", "ClosedException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"enqueueWork\"", ",", "unit", ")", ";", "synchronized", "(", "this", ")", "{", "if", "(", "closed", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"enqueueWork\"", ",", "\"ClosedException\"", ")", ";", "throw", "new", "ClosedException", "(", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "tc", ",", "\"Enqueueing update: \"", "+", "unit", ")", ";", "enqueuedUnits", ".", "add", "(", "unit", ")", ";", "if", "(", "executing", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"enqueueWork\"", ",", "\"AsyncUpdateThread executing\"", ")", ";", "return", ";", "}", "// not executing enqueued updates", "if", "(", "enqueuedUnits", ".", "size", "(", ")", ">", "batchThreshold", ")", "{", "executeSinceExpiry", "=", "true", ";", "try", "{", "startExecutingUpdates", "(", ")", ";", "}", "catch", "(", "ClosedException", "e", ")", "{", "// No FFDC code needed", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"enqueueWork\"", ",", "e", ")", ";", "throw", "e", ";", "}", "}", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"enqueueWork\"", ")", ";", "}" ]
Enqueue an AsyncUpdate @param unit the AsyncUpdate
[ "Enqueue", "an", "AsyncUpdate" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/AsyncUpdateThread.java#L129-L174
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/AsyncUpdateThread.java
AsyncUpdateThread.startExecutingUpdates
private void startExecutingUpdates() throws ClosedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "startExecutingUpdates"); // swap the enqueuedUnits and executingUnits. ArrayList temp = executingUnits; executingUnits = enqueuedUnits; enqueuedUnits = temp; enqueuedUnits.clear(); // enqueuedUnits is now ready to accept AsyncUpdates in enqueueWork() executing = true; try { LocalTransaction tran = tranManager.createLocalTransaction(false); ExecutionThread thread = new ExecutionThread(executingUnits, tran); mp.startNewSystemThread(thread); } catch (InterruptedException e) { // this object cannot recover from this exception since we don't know how much work the ExecutionThread // has done. should not occur! FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.store.AsyncUpdateThread.startExecutingUpdates", "1:222:1.28", this); SibTr.exception(tc, e); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "startExecutingUpdates", e); closed = true; throw new ClosedException(e.getMessage()); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "startExecutingUpdates"); }
java
private void startExecutingUpdates() throws ClosedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "startExecutingUpdates"); // swap the enqueuedUnits and executingUnits. ArrayList temp = executingUnits; executingUnits = enqueuedUnits; enqueuedUnits = temp; enqueuedUnits.clear(); // enqueuedUnits is now ready to accept AsyncUpdates in enqueueWork() executing = true; try { LocalTransaction tran = tranManager.createLocalTransaction(false); ExecutionThread thread = new ExecutionThread(executingUnits, tran); mp.startNewSystemThread(thread); } catch (InterruptedException e) { // this object cannot recover from this exception since we don't know how much work the ExecutionThread // has done. should not occur! FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.store.AsyncUpdateThread.startExecutingUpdates", "1:222:1.28", this); SibTr.exception(tc, e); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "startExecutingUpdates", e); closed = true; throw new ClosedException(e.getMessage()); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "startExecutingUpdates"); }
[ "private", "void", "startExecutingUpdates", "(", ")", "throws", "ClosedException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"startExecutingUpdates\"", ")", ";", "// swap the enqueuedUnits and executingUnits.", "ArrayList", "temp", "=", "executingUnits", ";", "executingUnits", "=", "enqueuedUnits", ";", "enqueuedUnits", "=", "temp", ";", "enqueuedUnits", ".", "clear", "(", ")", ";", "// enqueuedUnits is now ready to accept AsyncUpdates in enqueueWork()", "executing", "=", "true", ";", "try", "{", "LocalTransaction", "tran", "=", "tranManager", ".", "createLocalTransaction", "(", "false", ")", ";", "ExecutionThread", "thread", "=", "new", "ExecutionThread", "(", "executingUnits", ",", "tran", ")", ";", "mp", ".", "startNewSystemThread", "(", "thread", ")", ";", "}", "catch", "(", "InterruptedException", "e", ")", "{", "// this object cannot recover from this exception since we don't know how much work the ExecutionThread", "// has done. should not occur!", "FFDCFilter", ".", "processException", "(", "e", ",", "\"com.ibm.ws.sib.processor.impl.store.AsyncUpdateThread.startExecutingUpdates\"", ",", "\"1:222:1.28\"", ",", "this", ")", ";", "SibTr", ".", "exception", "(", "tc", ",", "e", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"startExecutingUpdates\"", ",", "e", ")", ";", "closed", "=", "true", ";", "throw", "new", "ClosedException", "(", "e", ".", "getMessage", "(", ")", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"startExecutingUpdates\"", ")", ";", "}" ]
Internal method. Should be called from within a synchronized block.
[ "Internal", "method", ".", "Should", "be", "called", "from", "within", "a", "synchronized", "block", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/AsyncUpdateThread.java#L179-L219
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/AsyncUpdateThread.java
AsyncUpdateThread.alarm
public void alarm(Object thandle) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "alarm", new Object[] {this, mp.getMessagingEngineUuid()}); synchronized (this) { if (!closed) { if ((executeSinceExpiry) || executing) { // has committed recently executeSinceExpiry = false; } else { // has not committed recently try { if (enqueuedUnits.size() > 0) startExecutingUpdates(); } catch (ClosedException e) { // No FFDC code needed // do nothing as error already logged by startExecutingUpdates } } } } // end synchronized (this) if (maxCommitInterval > 0) { mp.getAlarmManager().create(maxCommitInterval, this); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "alarm"); }
java
public void alarm(Object thandle) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "alarm", new Object[] {this, mp.getMessagingEngineUuid()}); synchronized (this) { if (!closed) { if ((executeSinceExpiry) || executing) { // has committed recently executeSinceExpiry = false; } else { // has not committed recently try { if (enqueuedUnits.size() > 0) startExecutingUpdates(); } catch (ClosedException e) { // No FFDC code needed // do nothing as error already logged by startExecutingUpdates } } } } // end synchronized (this) if (maxCommitInterval > 0) { mp.getAlarmManager().create(maxCommitInterval, this); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "alarm"); }
[ "public", "void", "alarm", "(", "Object", "thandle", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"alarm\"", ",", "new", "Object", "[", "]", "{", "this", ",", "mp", ".", "getMessagingEngineUuid", "(", ")", "}", ")", ";", "synchronized", "(", "this", ")", "{", "if", "(", "!", "closed", ")", "{", "if", "(", "(", "executeSinceExpiry", ")", "||", "executing", ")", "{", "// has committed recently", "executeSinceExpiry", "=", "false", ";", "}", "else", "{", "// has not committed recently", "try", "{", "if", "(", "enqueuedUnits", ".", "size", "(", ")", ">", "0", ")", "startExecutingUpdates", "(", ")", ";", "}", "catch", "(", "ClosedException", "e", ")", "{", "// No FFDC code needed", "// do nothing as error already logged by startExecutingUpdates", "}", "}", "}", "}", "// end synchronized (this)", "if", "(", "maxCommitInterval", ">", "0", ")", "{", "mp", ".", "getAlarmManager", "(", ")", ".", "create", "(", "maxCommitInterval", ",", "this", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"alarm\"", ")", ";", "}" ]
end class ExecutionThread ...
[ "end", "class", "ExecutionThread", "..." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/AsyncUpdateThread.java#L462-L498
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/AsyncUpdateThread.java
AsyncUpdateThread.waitTillAllUpdatesExecuted
public void waitTillAllUpdatesExecuted() throws InterruptedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "waitTillAllUpdatesExecuted"); synchronized (this) { while (enqueuedUnits.size() > 0 || executing) { try { this.wait(); } catch (InterruptedException e) { // No FFDC code needed if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "waitTillAllUpdatesExecuted", e); throw e; } } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "waitTillAllUpdatesExecuted"); }
java
public void waitTillAllUpdatesExecuted() throws InterruptedException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "waitTillAllUpdatesExecuted"); synchronized (this) { while (enqueuedUnits.size() > 0 || executing) { try { this.wait(); } catch (InterruptedException e) { // No FFDC code needed if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "waitTillAllUpdatesExecuted", e); throw e; } } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "waitTillAllUpdatesExecuted"); }
[ "public", "void", "waitTillAllUpdatesExecuted", "(", ")", "throws", "InterruptedException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"waitTillAllUpdatesExecuted\"", ")", ";", "synchronized", "(", "this", ")", "{", "while", "(", "enqueuedUnits", ".", "size", "(", ")", ">", "0", "||", "executing", ")", "{", "try", "{", "this", ".", "wait", "(", ")", ";", "}", "catch", "(", "InterruptedException", "e", ")", "{", "// No FFDC code needed", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"waitTillAllUpdatesExecuted\"", ",", "e", ")", ";", "throw", "e", ";", "}", "}", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"waitTillAllUpdatesExecuted\"", ")", ";", "}" ]
This method blocks till there are 0 enqueued updates and 0 executing updates. Useful for unit testing.
[ "This", "method", "blocks", "till", "there", "are", "0", "enqueued", "updates", "and", "0", "executing", "updates", ".", "Useful", "for", "unit", "testing", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/AsyncUpdateThread.java#L519-L542
train
OpenLiberty/open-liberty
dev/com.ibm.ws.webcontainer/src/com/ibm/websphere/servlet/event/FilterErrorEvent.java
FilterErrorEvent.getRootCause
public Throwable getRootCause() { Throwable root = getError(); while(true) { if(root instanceof ServletException) { ServletException se = (ServletException)_error; Throwable seRoot = se.getRootCause(); if(seRoot == null) { return root; } else if(seRoot.equals(root)) {//prevent possible recursion return root; } else { root = seRoot; } } else { return root; } } }
java
public Throwable getRootCause() { Throwable root = getError(); while(true) { if(root instanceof ServletException) { ServletException se = (ServletException)_error; Throwable seRoot = se.getRootCause(); if(seRoot == null) { return root; } else if(seRoot.equals(root)) {//prevent possible recursion return root; } else { root = seRoot; } } else { return root; } } }
[ "public", "Throwable", "getRootCause", "(", ")", "{", "Throwable", "root", "=", "getError", "(", ")", ";", "while", "(", "true", ")", "{", "if", "(", "root", "instanceof", "ServletException", ")", "{", "ServletException", "se", "=", "(", "ServletException", ")", "_error", ";", "Throwable", "seRoot", "=", "se", ".", "getRootCause", "(", ")", ";", "if", "(", "seRoot", "==", "null", ")", "{", "return", "root", ";", "}", "else", "if", "(", "seRoot", ".", "equals", "(", "root", ")", ")", "{", "//prevent possible recursion", "return", "root", ";", "}", "else", "{", "root", "=", "seRoot", ";", "}", "}", "else", "{", "return", "root", ";", "}", "}", "}" ]
Get the original cause of the error. Use of ServletExceptions by the engine to rethrow errors can cause the original error to be buried within one or more exceptions. This method will sift through the wrapped ServletExceptions to return the original error.
[ "Get", "the", "original", "cause", "of", "the", "error", ".", "Use", "of", "ServletExceptions", "by", "the", "engine", "to", "rethrow", "errors", "can", "cause", "the", "original", "error", "to", "be", "buried", "within", "one", "or", "more", "exceptions", ".", "This", "method", "will", "sift", "through", "the", "wrapped", "ServletExceptions", "to", "return", "the", "original", "error", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/websphere/servlet/event/FilterErrorEvent.java#L53-L73
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jca.inbound.security/src/com/ibm/ws/jca/inbound/security/SecurityInflowContextProviderImpl.java
SecurityInflowContextProviderImpl.activate
protected void activate(ComponentContext context) { securityServiceRef.activate(context); unauthSubjectServiceRef.activate(context); authServiceRef.activate(context); credServiceRef.activate(context); }
java
protected void activate(ComponentContext context) { securityServiceRef.activate(context); unauthSubjectServiceRef.activate(context); authServiceRef.activate(context); credServiceRef.activate(context); }
[ "protected", "void", "activate", "(", "ComponentContext", "context", ")", "{", "securityServiceRef", ".", "activate", "(", "context", ")", ";", "unauthSubjectServiceRef", ".", "activate", "(", "context", ")", ";", "authServiceRef", ".", "activate", "(", "context", ")", ";", "credServiceRef", ".", "activate", "(", "context", ")", ";", "}" ]
Called during service activation. @param context
[ "Called", "during", "service", "activation", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.inbound.security/src/com/ibm/ws/jca/inbound/security/SecurityInflowContextProviderImpl.java#L66-L71
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java
ObjectManager.initialise
protected void initialise(String logFileName, int logFileType, java.util.Map objectStoreLocations, ObjectManagerEventCallback[] callbacks) throws ObjectManagerException { final String methodName = "initialise"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName, new Object[] { logFileName, new Integer(logFileType), objectStoreLocations, callbacks }); if (objectStoreLocations == null) objectStoreLocations = new java.util.HashMap(); // Repeat attempts to find or create an ObjectManagerState. for (;;) { // Look for existing ObjectManagerState. synchronized (objectManagerStates) { objectManagerState = (ObjectManagerState) objectManagerStates.get(logFileName); if (objectManagerState == null) { // None known, so make one. objectManagerState = createObjectManagerState(logFileName, logFileType, objectStoreLocations, callbacks); objectManagerStates.put(logFileName, objectManagerState); } } // synchronized (objectManagerStates). synchronized (objectManagerState) { if (objectManagerState.state == ObjectManagerState.stateColdStarted || objectManagerState.state == ObjectManagerState.stateWarmStarted) { // We are ready to go. break; } else { // Wait for the ObjectManager state to become usable or terminate. try { objectManagerState.wait(); // Let some other thread initialise the ObjectManager . } catch (InterruptedException exception) { // No FFDC Code Needed. ObjectManager.ffdc.processException(cclass, methodName, exception, "1:260:1.28"); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName, exception); throw new UnexpectedExceptionException(this, exception); } // catch (InterruptedException exception). } // if (objectManagerState.state... } // synchronized (objectManagerState) } // for (;;). if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName); }
java
protected void initialise(String logFileName, int logFileType, java.util.Map objectStoreLocations, ObjectManagerEventCallback[] callbacks) throws ObjectManagerException { final String methodName = "initialise"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName, new Object[] { logFileName, new Integer(logFileType), objectStoreLocations, callbacks }); if (objectStoreLocations == null) objectStoreLocations = new java.util.HashMap(); // Repeat attempts to find or create an ObjectManagerState. for (;;) { // Look for existing ObjectManagerState. synchronized (objectManagerStates) { objectManagerState = (ObjectManagerState) objectManagerStates.get(logFileName); if (objectManagerState == null) { // None known, so make one. objectManagerState = createObjectManagerState(logFileName, logFileType, objectStoreLocations, callbacks); objectManagerStates.put(logFileName, objectManagerState); } } // synchronized (objectManagerStates). synchronized (objectManagerState) { if (objectManagerState.state == ObjectManagerState.stateColdStarted || objectManagerState.state == ObjectManagerState.stateWarmStarted) { // We are ready to go. break; } else { // Wait for the ObjectManager state to become usable or terminate. try { objectManagerState.wait(); // Let some other thread initialise the ObjectManager . } catch (InterruptedException exception) { // No FFDC Code Needed. ObjectManager.ffdc.processException(cclass, methodName, exception, "1:260:1.28"); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName, exception); throw new UnexpectedExceptionException(this, exception); } // catch (InterruptedException exception). } // if (objectManagerState.state... } // synchronized (objectManagerState) } // for (;;). if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName); }
[ "protected", "void", "initialise", "(", "String", "logFileName", ",", "int", "logFileType", ",", "java", ".", "util", ".", "Map", "objectStoreLocations", ",", "ObjectManagerEventCallback", "[", "]", "callbacks", ")", "throws", "ObjectManagerException", "{", "final", "String", "methodName", "=", "\"initialise\"", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "methodName", ",", "new", "Object", "[", "]", "{", "logFileName", ",", "new", "Integer", "(", "logFileType", ")", ",", "objectStoreLocations", ",", "callbacks", "}", ")", ";", "if", "(", "objectStoreLocations", "==", "null", ")", "objectStoreLocations", "=", "new", "java", ".", "util", ".", "HashMap", "(", ")", ";", "// Repeat attempts to find or create an ObjectManagerState.", "for", "(", ";", ";", ")", "{", "// Look for existing ObjectManagerState.", "synchronized", "(", "objectManagerStates", ")", "{", "objectManagerState", "=", "(", "ObjectManagerState", ")", "objectManagerStates", ".", "get", "(", "logFileName", ")", ";", "if", "(", "objectManagerState", "==", "null", ")", "{", "// None known, so make one.", "objectManagerState", "=", "createObjectManagerState", "(", "logFileName", ",", "logFileType", ",", "objectStoreLocations", ",", "callbacks", ")", ";", "objectManagerStates", ".", "put", "(", "logFileName", ",", "objectManagerState", ")", ";", "}", "}", "// synchronized (objectManagerStates).", "synchronized", "(", "objectManagerState", ")", "{", "if", "(", "objectManagerState", ".", "state", "==", "ObjectManagerState", ".", "stateColdStarted", "||", "objectManagerState", ".", "state", "==", "ObjectManagerState", ".", "stateWarmStarted", ")", "{", "// We are ready to go.", "break", ";", "}", "else", "{", "// Wait for the ObjectManager state to become usable or terminate. ", "try", "{", "objectManagerState", ".", "wait", "(", ")", ";", "// Let some other thread initialise the ObjectManager . ", "}", "catch", "(", "InterruptedException", "exception", ")", "{", "// No FFDC Code Needed.", "ObjectManager", ".", "ffdc", ".", "processException", "(", "cclass", ",", "methodName", ",", "exception", ",", "\"1:260:1.28\"", ")", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "methodName", ",", "exception", ")", ";", "throw", "new", "UnexpectedExceptionException", "(", "this", ",", "exception", ")", ";", "}", "// catch (InterruptedException exception).", "}", "// if (objectManagerState.state...", "}", "// synchronized (objectManagerState)", "}", "// for (;;).", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "methodName", ")", ";", "}" ]
Create a handle for the ObjectManagerState and initialise it of necessary. @param logFileName of the transaction log file, all instances of the ObjectManager must use exactly the same log file name. @param logFileType one of LOG_FILE_TYPE_XXX. @param objectStoreLocations to map ObjectStore names to their disk locations. @param callbacks an array of ObjectManagerEventCallback to be registered with the ObjectManager before it starts, may be null. @throws ObjectManagerException
[ "Create", "a", "handle", "for", "the", "ObjectManagerState", "and", "initialise", "it", "of", "necessary", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java#L203-L261
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java
ObjectManager.createObjectManagerState
protected ObjectManagerState createObjectManagerState(String logFileName, int logFileType, java.util.Map objectStoreLocations, ObjectManagerEventCallback[] callbacks) throws ObjectManagerException { return new ObjectManagerState(logFileName, this, logFileType, objectStoreLocations, callbacks); }
java
protected ObjectManagerState createObjectManagerState(String logFileName, int logFileType, java.util.Map objectStoreLocations, ObjectManagerEventCallback[] callbacks) throws ObjectManagerException { return new ObjectManagerState(logFileName, this, logFileType, objectStoreLocations, callbacks); }
[ "protected", "ObjectManagerState", "createObjectManagerState", "(", "String", "logFileName", ",", "int", "logFileType", ",", "java", ".", "util", ".", "Map", "objectStoreLocations", ",", "ObjectManagerEventCallback", "[", "]", "callbacks", ")", "throws", "ObjectManagerException", "{", "return", "new", "ObjectManagerState", "(", "logFileName", ",", "this", ",", "logFileType", ",", "objectStoreLocations", ",", "callbacks", ")", ";", "}" ]
Instantiate the ObjectManagerState. A subclass of ObjectManager should override this method if a subclass of ObjecManagerState is required. @param logFileName of the transaction log file. @param logFileType one of LOG_FILE_TYPE_XXX. @param objectStoreLocations referring ObjectStore name to their disk location, filename. May be null. @param callbacks an array of ObjectManagerEventCallback to be registered with the ObjectManager before it starts, may be null. @return ObjectManagerState instantiated. @throws ObjectManagerException
[ "Instantiate", "the", "ObjectManagerState", ".", "A", "subclass", "of", "ObjectManager", "should", "override", "this", "method", "if", "a", "subclass", "of", "ObjecManagerState", "is", "required", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java#L277-L287
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java
ObjectManager.warmStarted
public final boolean warmStarted() { final String methodName = "warmStarted"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName); boolean isWarmStarted = false; if (objectManagerState.state == ObjectManagerState.stateWarmStarted) isWarmStarted = true; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName, new Boolean(isWarmStarted)); return isWarmStarted; }
java
public final boolean warmStarted() { final String methodName = "warmStarted"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName); boolean isWarmStarted = false; if (objectManagerState.state == ObjectManagerState.stateWarmStarted) isWarmStarted = true; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName, new Boolean(isWarmStarted)); return isWarmStarted; }
[ "public", "final", "boolean", "warmStarted", "(", ")", "{", "final", "String", "methodName", "=", "\"warmStarted\"", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "methodName", ")", ";", "boolean", "isWarmStarted", "=", "false", ";", "if", "(", "objectManagerState", ".", "state", "==", "ObjectManagerState", ".", "stateWarmStarted", ")", "isWarmStarted", "=", "true", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "methodName", ",", "new", "Boolean", "(", "isWarmStarted", ")", ")", ";", "return", "isWarmStarted", ";", "}" ]
returns true if the objectManager was warm started. @return boolean true if warm started.
[ "returns", "true", "if", "the", "objectManager", "was", "warm", "started", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java#L294-L312
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java
ObjectManager.shutdown
public final void shutdown() throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "shutdown" ); objectManagerState.shutdown(); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "shutdown" ); }
java
public final void shutdown() throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "shutdown" ); objectManagerState.shutdown(); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "shutdown" ); }
[ "public", "final", "void", "shutdown", "(", ")", "throws", "ObjectManagerException", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "\"shutdown\"", ")", ";", "objectManagerState", ".", "shutdown", "(", ")", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"shutdown\"", ")", ";", "}" ]
Terminates the ObjectManager. @throws ObjectManagerException
[ "Terminates", "the", "ObjectManager", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java#L319-L333
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java
ObjectManager.shutdownFast
public final void shutdownFast() throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "shutdownFast" ); if (!testInterfaces) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "shutdownFast" , "via InterfaceDisabledException" ); throw new InterfaceDisabledException(this , "shutdownFast"); } // if (!testInterfaces). objectManagerState.shutdownFast(); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "shutdownFast" ); }
java
public final void shutdownFast() throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "shutdownFast" ); if (!testInterfaces) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "shutdownFast" , "via InterfaceDisabledException" ); throw new InterfaceDisabledException(this , "shutdownFast"); } // if (!testInterfaces). objectManagerState.shutdownFast(); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "shutdownFast" ); }
[ "public", "final", "void", "shutdownFast", "(", ")", "throws", "ObjectManagerException", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "\"shutdownFast\"", ")", ";", "if", "(", "!", "testInterfaces", ")", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"shutdownFast\"", ",", "\"via InterfaceDisabledException\"", ")", ";", "throw", "new", "InterfaceDisabledException", "(", "this", ",", "\"shutdownFast\"", ")", ";", "}", "// if (!testInterfaces).", "objectManagerState", ".", "shutdownFast", "(", ")", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"shutdownFast\"", ")", ";", "}" ]
Terminates the ObjectManager, without taking a checkpoint. The allows the ObjectManager to be restarted as if it had crashed and is only intended for testing emergency restart. @throws ObjectManagerException
[ "Terminates", "the", "ObjectManager", "without", "taking", "a", "checkpoint", ".", "The", "allows", "the", "ObjectManager", "to", "be", "restarted", "as", "if", "it", "had", "crashed", "and", "is", "only", "intended", "for", "testing", "emergency", "restart", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java#L342-L366
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java
ObjectManager.waitForCheckpoint
public final void waitForCheckpoint() throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "waitForCheckpoint" ); if (!testInterfaces) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "waitForCheckpoint via InterfaceDisabledException" ); throw new InterfaceDisabledException(this , "waitForCheckpoint"); } // if (!testInterfaces). objectManagerState.waitForCheckpoint(true); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "waitForCheckpoint" ); }
java
public final void waitForCheckpoint() throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "waitForCheckpoint" ); if (!testInterfaces) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "waitForCheckpoint via InterfaceDisabledException" ); throw new InterfaceDisabledException(this , "waitForCheckpoint"); } // if (!testInterfaces). objectManagerState.waitForCheckpoint(true); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "waitForCheckpoint" ); }
[ "public", "final", "void", "waitForCheckpoint", "(", ")", "throws", "ObjectManagerException", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "\"waitForCheckpoint\"", ")", ";", "if", "(", "!", "testInterfaces", ")", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"waitForCheckpoint via InterfaceDisabledException\"", ")", ";", "throw", "new", "InterfaceDisabledException", "(", "this", ",", "\"waitForCheckpoint\"", ")", ";", "}", "// if (!testInterfaces). ", "objectManagerState", ".", "waitForCheckpoint", "(", "true", ")", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"waitForCheckpoint\"", ")", ";", "}" ]
Waits for one checkpoint to complete. @throws ObjectManagerException
[ "Waits", "for", "one", "checkpoint", "to", "complete", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java#L373-L396
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java
ObjectManager.getTransaction
public final Transaction getTransaction() throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "getTransaction" ); // If the log is full introduce a delay for a checkpoiunt before allowing the // application to proceed. objectManagerState.transactionPacing(); Transaction transaction = objectManagerState.getTransaction(); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "getTransaction" , "returns transaction=" + transaction + "(Transaction)" ); return transaction; }
java
public final Transaction getTransaction() throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "getTransaction" ); // If the log is full introduce a delay for a checkpoiunt before allowing the // application to proceed. objectManagerState.transactionPacing(); Transaction transaction = objectManagerState.getTransaction(); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "getTransaction" , "returns transaction=" + transaction + "(Transaction)" ); return transaction; }
[ "public", "final", "Transaction", "getTransaction", "(", ")", "throws", "ObjectManagerException", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "\"getTransaction\"", ")", ";", "// If the log is full introduce a delay for a checkpoiunt before allowing the ", "// application to proceed.", "objectManagerState", ".", "transactionPacing", "(", ")", ";", "Transaction", "transaction", "=", "objectManagerState", ".", "getTransaction", "(", ")", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"getTransaction\"", ",", "\"returns transaction=\"", "+", "transaction", "+", "\"(Transaction)\"", ")", ";", "return", "transaction", ";", "}" ]
Factory method to crate a new transaction for use with the ObjectManager. @return Transaction the new transaction. @throws ObjectManagerException
[ "Factory", "method", "to", "crate", "a", "new", "transaction", "for", "use", "with", "the", "ObjectManager", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java#L533-L551
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java
ObjectManager.getTransactionByXID
public final Transaction getTransactionByXID(byte[] XID) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "getTransactionByXID" , "XIDe=" + XID + "(byte[]" ); Transaction transaction = objectManagerState.getTransactionByXID(XID); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "getTransactionByXID" , "returns transaction=" + transaction + "(Transaction)" ); return transaction; }
java
public final Transaction getTransactionByXID(byte[] XID) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "getTransactionByXID" , "XIDe=" + XID + "(byte[]" ); Transaction transaction = objectManagerState.getTransactionByXID(XID); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "getTransactionByXID" , "returns transaction=" + transaction + "(Transaction)" ); return transaction; }
[ "public", "final", "Transaction", "getTransactionByXID", "(", "byte", "[", "]", "XID", ")", "throws", "ObjectManagerException", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "\"getTransactionByXID\"", ",", "\"XIDe=\"", "+", "XID", "+", "\"(byte[]\"", ")", ";", "Transaction", "transaction", "=", "objectManagerState", ".", "getTransactionByXID", "(", "XID", ")", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"getTransactionByXID\"", ",", "\"returns transaction=\"", "+", "transaction", "+", "\"(Transaction)\"", ")", ";", "return", "transaction", ";", "}" ]
Locate a transaction registered with this ObjectManager. with the same XID as the one passed. If a null XID is passed this will return any registered transaction with a null XID. @param XID Xopen identifier. @return Transaction identified by the XID. @throws ObjectManagerException
[ "Locate", "a", "transaction", "registered", "with", "this", "ObjectManager", ".", "with", "the", "same", "XID", "as", "the", "one", "passed", ".", "If", "a", "null", "XID", "is", "passed", "this", "will", "return", "any", "registered", "transaction", "with", "a", "null", "XID", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java#L562-L579
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java
ObjectManager.getTransactionIterator
public final java.util.Iterator getTransactionIterator() throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "getTransactionIterator" ); java.util.Iterator transactionIterator = objectManagerState.getTransactionIterator(); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "getTransactionIterator" , "returns transactionIterator" + transactionIterator + "(java.util.Iterator)" ); return transactionIterator; }
java
public final java.util.Iterator getTransactionIterator() throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "getTransactionIterator" ); java.util.Iterator transactionIterator = objectManagerState.getTransactionIterator(); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "getTransactionIterator" , "returns transactionIterator" + transactionIterator + "(java.util.Iterator)" ); return transactionIterator; }
[ "public", "final", "java", ".", "util", ".", "Iterator", "getTransactionIterator", "(", ")", "throws", "ObjectManagerException", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "\"getTransactionIterator\"", ")", ";", "java", ".", "util", ".", "Iterator", "transactionIterator", "=", "objectManagerState", ".", "getTransactionIterator", "(", ")", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"getTransactionIterator\"", ",", "\"returns transactionIterator\"", "+", "transactionIterator", "+", "\"(java.util.Iterator)\"", ")", ";", "return", "transactionIterator", ";", "}" ]
Create an iterator over all transactions known to this ObjectManager. The iterator returned is safe against concurrent modification of the set of transactions, new transactions created after the iterator is created may not be covered by the iterator. @return java.util.Iterator over Transactions. @throws ObjectManagerException
[ "Create", "an", "iterator", "over", "all", "transactions", "known", "to", "this", "ObjectManager", ".", "The", "iterator", "returned", "is", "safe", "against", "concurrent", "modification", "of", "the", "set", "of", "transactions", "new", "transactions", "created", "after", "the", "iterator", "is", "created", "may", "not", "be", "covered", "by", "the", "iterator", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java#L589-L604
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java
ObjectManager.getObjectStore
public final ObjectStore getObjectStore(String objectStoreName) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "getObjectStore" , "objectStoreName=" + objectStoreName + "(String)" ); ObjectStore objectStore = objectManagerState.getObjectStore(objectStoreName); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "getObjectStore" , "returns objectStore=" + objectStore + "(ObjectStore)" ); return objectStore; }
java
public final ObjectStore getObjectStore(String objectStoreName) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "getObjectStore" , "objectStoreName=" + objectStoreName + "(String)" ); ObjectStore objectStore = objectManagerState.getObjectStore(objectStoreName); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "getObjectStore" , "returns objectStore=" + objectStore + "(ObjectStore)" ); return objectStore; }
[ "public", "final", "ObjectStore", "getObjectStore", "(", "String", "objectStoreName", ")", "throws", "ObjectManagerException", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "\"getObjectStore\"", ",", "\"objectStoreName=\"", "+", "objectStoreName", "+", "\"(String)\"", ")", ";", "ObjectStore", "objectStore", "=", "objectManagerState", ".", "getObjectStore", "(", "objectStoreName", ")", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"getObjectStore\"", ",", "\"returns objectStore=\"", "+", "objectStore", "+", "\"(ObjectStore)\"", ")", ";", "return", "objectStore", ";", "}" ]
Locate an ObjectStore used by this objectManager. @param objectStoreName of the ObjectStore. @return ObjectStore found matching the identifier. @throws ObjectManagerException
[ "Locate", "an", "ObjectStore", "used", "by", "this", "objectManager", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java#L613-L630
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java
ObjectManager.getObjectStoreIterator
public final java.util.Iterator getObjectStoreIterator() throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "getObjectStoreIterator" ); java.util.Iterator objectStoreIterator = objectManagerState.getObjectStoreIterator(); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "getObjectStoreIterator" , new Object[] { objectStoreIterator } ); return objectStoreIterator; }
java
public final java.util.Iterator getObjectStoreIterator() throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "getObjectStoreIterator" ); java.util.Iterator objectStoreIterator = objectManagerState.getObjectStoreIterator(); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "getObjectStoreIterator" , new Object[] { objectStoreIterator } ); return objectStoreIterator; }
[ "public", "final", "java", ".", "util", ".", "Iterator", "getObjectStoreIterator", "(", ")", "throws", "ObjectManagerException", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "\"getObjectStoreIterator\"", ")", ";", "java", ".", "util", ".", "Iterator", "objectStoreIterator", "=", "objectManagerState", ".", "getObjectStoreIterator", "(", ")", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"getObjectStoreIterator\"", ",", "new", "Object", "[", "]", "{", "objectStoreIterator", "}", ")", ";", "return", "objectStoreIterator", ";", "}" ]
Create an iterator over all ObjectStores known to this ObjectManager. @return java.util.Iterator over Transactions. @throws ObjectManagerException
[ "Create", "an", "iterator", "over", "all", "ObjectStores", "known", "to", "this", "ObjectManager", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java#L638-L653
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java
ObjectManager.getNamedObject
public final Token getNamedObject(String name , Transaction transaction) throws ObjectManagerException { final String methodName = "getNamedObject"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , methodName , new Object[] { name, transaction } ); // Is the definitive tree assigned? if (objectManagerState.namedObjects == null) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , methodName , "via NoRestartableObjectStoresAvailableException" ); throw new NoRestartableObjectStoresAvailableException(this); } // if (objectManagerState.namedObjects == null). TreeMap namedObjectsTree = (TreeMap) objectManagerState.namedObjects.getManagedObject(); Token token = (Token) namedObjectsTree.get(name, transaction); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , methodName , new Object[] { token } ); return token; }
java
public final Token getNamedObject(String name , Transaction transaction) throws ObjectManagerException { final String methodName = "getNamedObject"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , methodName , new Object[] { name, transaction } ); // Is the definitive tree assigned? if (objectManagerState.namedObjects == null) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , methodName , "via NoRestartableObjectStoresAvailableException" ); throw new NoRestartableObjectStoresAvailableException(this); } // if (objectManagerState.namedObjects == null). TreeMap namedObjectsTree = (TreeMap) objectManagerState.namedObjects.getManagedObject(); Token token = (Token) namedObjectsTree.get(name, transaction); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , methodName , new Object[] { token } ); return token; }
[ "public", "final", "Token", "getNamedObject", "(", "String", "name", ",", "Transaction", "transaction", ")", "throws", "ObjectManagerException", "{", "final", "String", "methodName", "=", "\"getNamedObject\"", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "methodName", ",", "new", "Object", "[", "]", "{", "name", ",", "transaction", "}", ")", ";", "// Is the definitive tree assigned?", "if", "(", "objectManagerState", ".", "namedObjects", "==", "null", ")", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "methodName", ",", "\"via NoRestartableObjectStoresAvailableException\"", ")", ";", "throw", "new", "NoRestartableObjectStoresAvailableException", "(", "this", ")", ";", "}", "// if (objectManagerState.namedObjects == null).", "TreeMap", "namedObjectsTree", "=", "(", "TreeMap", ")", "objectManagerState", ".", "namedObjects", ".", "getManagedObject", "(", ")", ";", "Token", "token", "=", "(", "Token", ")", "namedObjectsTree", ".", "get", "(", "name", ",", "transaction", ")", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "methodName", ",", "new", "Object", "[", "]", "{", "token", "}", ")", ";", "return", "token", ";", "}" ]
Locate a Token by name within this objectManager. @param name The name of the Token to be located. @param transaction controlling visibility of the named ManagedObject. @return Token of the named ManagedObject or null. @throws ObjectManagerException
[ "Locate", "a", "Token", "by", "name", "within", "this", "objectManager", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java#L740-L770
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java
ObjectManager.removeNamedObject
public final Token removeNamedObject(String name , Transaction transaction) throws ObjectManagerException { final String methodName = "removeNamedObject"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , methodName , new Object[] { name, transaction } ); Token tokenOut = null; // For return. // See if there is a definitive namedObjdects tree. if (objectManagerState.namedObjects == null) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , methodName , "via NoRestartablebjectStoresAvailableException" ); throw new NoRestartableObjectStoresAvailableException(this); } // if (objectManagerState.namedObjects == null). // Loop over all of the ObjectStores. java.util.Iterator objectStoreIterator = objectManagerState.objectStores.values().iterator(); while (objectStoreIterator.hasNext()) { ObjectStore objectStore = (ObjectStore) objectStoreIterator.next(); // Don't bother with ObjectStores that can't be used for recovery. if (objectStore.getContainsRestartData()) { // Locate any existing copy. Token namedObjectsToken = new Token(objectStore, ObjectStore.namedObjectTreeIdentifier.longValue()); // Swap for the definitive Token, if there is one. namedObjectsToken = objectStore.like(namedObjectsToken); TreeMap namedObjectsTree = (TreeMap) namedObjectsToken.getManagedObject(); tokenOut = (Token) namedObjectsTree.remove(name, transaction); } // if (objectStore.getContainsRestartData()). } // While objectStoreIterator.hasNext(). if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , methodName , new Object[] { tokenOut }); return tokenOut; }
java
public final Token removeNamedObject(String name , Transaction transaction) throws ObjectManagerException { final String methodName = "removeNamedObject"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , methodName , new Object[] { name, transaction } ); Token tokenOut = null; // For return. // See if there is a definitive namedObjdects tree. if (objectManagerState.namedObjects == null) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , methodName , "via NoRestartablebjectStoresAvailableException" ); throw new NoRestartableObjectStoresAvailableException(this); } // if (objectManagerState.namedObjects == null). // Loop over all of the ObjectStores. java.util.Iterator objectStoreIterator = objectManagerState.objectStores.values().iterator(); while (objectStoreIterator.hasNext()) { ObjectStore objectStore = (ObjectStore) objectStoreIterator.next(); // Don't bother with ObjectStores that can't be used for recovery. if (objectStore.getContainsRestartData()) { // Locate any existing copy. Token namedObjectsToken = new Token(objectStore, ObjectStore.namedObjectTreeIdentifier.longValue()); // Swap for the definitive Token, if there is one. namedObjectsToken = objectStore.like(namedObjectsToken); TreeMap namedObjectsTree = (TreeMap) namedObjectsToken.getManagedObject(); tokenOut = (Token) namedObjectsTree.remove(name, transaction); } // if (objectStore.getContainsRestartData()). } // While objectStoreIterator.hasNext(). if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , methodName , new Object[] { tokenOut }); return tokenOut; }
[ "public", "final", "Token", "removeNamedObject", "(", "String", "name", ",", "Transaction", "transaction", ")", "throws", "ObjectManagerException", "{", "final", "String", "methodName", "=", "\"removeNamedObject\"", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "methodName", ",", "new", "Object", "[", "]", "{", "name", ",", "transaction", "}", ")", ";", "Token", "tokenOut", "=", "null", ";", "// For return.", "// See if there is a definitive namedObjdects tree. ", "if", "(", "objectManagerState", ".", "namedObjects", "==", "null", ")", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "methodName", ",", "\"via NoRestartablebjectStoresAvailableException\"", ")", ";", "throw", "new", "NoRestartableObjectStoresAvailableException", "(", "this", ")", ";", "}", "// if (objectManagerState.namedObjects == null).", "// Loop over all of the ObjectStores.", "java", ".", "util", ".", "Iterator", "objectStoreIterator", "=", "objectManagerState", ".", "objectStores", ".", "values", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "objectStoreIterator", ".", "hasNext", "(", ")", ")", "{", "ObjectStore", "objectStore", "=", "(", "ObjectStore", ")", "objectStoreIterator", ".", "next", "(", ")", ";", "// Don't bother with ObjectStores that can't be used for recovery.", "if", "(", "objectStore", ".", "getContainsRestartData", "(", ")", ")", "{", "// Locate any existing copy.", "Token", "namedObjectsToken", "=", "new", "Token", "(", "objectStore", ",", "ObjectStore", ".", "namedObjectTreeIdentifier", ".", "longValue", "(", ")", ")", ";", "// Swap for the definitive Token, if there is one.", "namedObjectsToken", "=", "objectStore", ".", "like", "(", "namedObjectsToken", ")", ";", "TreeMap", "namedObjectsTree", "=", "(", "TreeMap", ")", "namedObjectsToken", ".", "getManagedObject", "(", ")", ";", "tokenOut", "=", "(", "Token", ")", "namedObjectsTree", ".", "remove", "(", "name", ",", "transaction", ")", ";", "}", "// if (objectStore.getContainsRestartData()).", "}", "// While objectStoreIterator.hasNext().", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "methodName", ",", "new", "Object", "[", "]", "{", "tokenOut", "}", ")", ";", "return", "tokenOut", ";", "}" ]
Remove a named ManagedObject locatable by name within this objectManager. @param name The name of the ManagedObject to be removed. @param transaction The transaction which scopes the naming. @return Token of any existing ManagedObject associated with this name or null. @throws ObjectManagerException
[ "Remove", "a", "named", "ManagedObject", "locatable", "by", "name", "within", "this", "objectManager", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java#L780-L827
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java
ObjectManager.setTransactionsPerCheckpoint
public final void setTransactionsPerCheckpoint(long persistentTransactionsPerCheckpoint , long nonPersistentTransactionsPerCheckpoint , Transaction transaction) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "setTransactionsPerCheckpoint" , new Object[] { new Long(persistentTransactionsPerCheckpoint) , new Long(nonPersistentTransactionsPerCheckpoint) , transaction } ); transaction.lock(objectManagerState); objectManagerState.persistentTransactionsPerCheckpoint = persistentTransactionsPerCheckpoint; objectManagerState.nonPersistentTransactionsPerCheckpoint = nonPersistentTransactionsPerCheckpoint; // saveClonedState does not update the defaultStore. transaction.replace(objectManagerState); // Save the updates in the restartable ObjectStores. objectManagerState.saveClonedState(transaction); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "setTransactionsPerCheckpoint" ); }
java
public final void setTransactionsPerCheckpoint(long persistentTransactionsPerCheckpoint , long nonPersistentTransactionsPerCheckpoint , Transaction transaction) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "setTransactionsPerCheckpoint" , new Object[] { new Long(persistentTransactionsPerCheckpoint) , new Long(nonPersistentTransactionsPerCheckpoint) , transaction } ); transaction.lock(objectManagerState); objectManagerState.persistentTransactionsPerCheckpoint = persistentTransactionsPerCheckpoint; objectManagerState.nonPersistentTransactionsPerCheckpoint = nonPersistentTransactionsPerCheckpoint; // saveClonedState does not update the defaultStore. transaction.replace(objectManagerState); // Save the updates in the restartable ObjectStores. objectManagerState.saveClonedState(transaction); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "setTransactionsPerCheckpoint" ); }
[ "public", "final", "void", "setTransactionsPerCheckpoint", "(", "long", "persistentTransactionsPerCheckpoint", ",", "long", "nonPersistentTransactionsPerCheckpoint", ",", "Transaction", "transaction", ")", "throws", "ObjectManagerException", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "\"setTransactionsPerCheckpoint\"", ",", "new", "Object", "[", "]", "{", "new", "Long", "(", "persistentTransactionsPerCheckpoint", ")", ",", "new", "Long", "(", "nonPersistentTransactionsPerCheckpoint", ")", ",", "transaction", "}", ")", ";", "transaction", ".", "lock", "(", "objectManagerState", ")", ";", "objectManagerState", ".", "persistentTransactionsPerCheckpoint", "=", "persistentTransactionsPerCheckpoint", ";", "objectManagerState", ".", "nonPersistentTransactionsPerCheckpoint", "=", "nonPersistentTransactionsPerCheckpoint", ";", "// saveClonedState does not update the defaultStore.", "transaction", ".", "replace", "(", "objectManagerState", ")", ";", "// Save the updates in the restartable ObjectStores. ", "objectManagerState", ".", "saveClonedState", "(", "transaction", ")", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"setTransactionsPerCheckpoint\"", ")", ";", "}" ]
Create a named ManagedObject by name within this objectManager. @param persistentTransactionsPerCheckpoint the number of persistent transactions that can commit or backout before a checkpoint is written in the log. A high number results in long restart times a low number impacts runtime performance. @param nonPersistentTransactionsPerCheckpoint the number of transactions that can commit or rollback before disk based objects stores are written to disk. A high number may result in high memory usage, a low number may result in excessive disk activity. @param transaction controling the update. @throws ObjectManagerException
[ "Create", "a", "named", "ManagedObject", "by", "name", "within", "this", "objectManager", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java#L874-L899
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java
ObjectManager.setMaximumActiveTransactions
public final void setMaximumActiveTransactions(int maximumActiveTransactions , Transaction transaction) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "setMaximumActiveTransactions" , new Object[] { new Integer(maximumActiveTransactions) , transaction } ); transaction.lock(objectManagerState); objectManagerState.maximumActiveTransactions = maximumActiveTransactions; // saveClonedState does not update the defaultStore. transaction.replace(objectManagerState); // Save the updates in the restartable ObjectStores. objectManagerState.saveClonedState(transaction); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "setMaximumActiveTransactions" ); }
java
public final void setMaximumActiveTransactions(int maximumActiveTransactions , Transaction transaction) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "setMaximumActiveTransactions" , new Object[] { new Integer(maximumActiveTransactions) , transaction } ); transaction.lock(objectManagerState); objectManagerState.maximumActiveTransactions = maximumActiveTransactions; // saveClonedState does not update the defaultStore. transaction.replace(objectManagerState); // Save the updates in the restartable ObjectStores. objectManagerState.saveClonedState(transaction); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "setMaximumActiveTransactions" ); }
[ "public", "final", "void", "setMaximumActiveTransactions", "(", "int", "maximumActiveTransactions", ",", "Transaction", "transaction", ")", "throws", "ObjectManagerException", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "\"setMaximumActiveTransactions\"", ",", "new", "Object", "[", "]", "{", "new", "Integer", "(", "maximumActiveTransactions", ")", ",", "transaction", "}", ")", ";", "transaction", ".", "lock", "(", "objectManagerState", ")", ";", "objectManagerState", ".", "maximumActiveTransactions", "=", "maximumActiveTransactions", ";", "// saveClonedState does not update the defaultStore.", "transaction", ".", "replace", "(", "objectManagerState", ")", ";", "// Save the updates in the restartable ObjectStores. ", "objectManagerState", ".", "saveClonedState", "(", "transaction", ")", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"setMaximumActiveTransactions\"", ")", ";", "}" ]
Change the maximum active transactrions that the ObjectManager will allow to start. If this call reduces the maximum then existing transactions continue but no new ones are allowed until the total has fallen below the new maximum. @param maximumActiveTransactions to set. @param transaction controling the update. @throws ObjectManagerException
[ "Change", "the", "maximum", "active", "transactrions", "that", "the", "ObjectManager", "will", "allow", "to", "start", ".", "If", "this", "call", "reduces", "the", "maximum", "then", "existing", "transactions", "continue", "but", "no", "new", "ones", "are", "allowed", "until", "the", "total", "has", "fallen", "below", "the", "new", "maximum", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java#L920-L942
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java
ObjectManager.captureStatistics
public java.util.Map captureStatistics(String name ) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, "captureStatistics", new Object[] { name }); java.util.Map statistics = new java.util.HashMap(); // To be returned. synchronized (objectManagerState) { if (!(objectManagerState.state == ObjectManagerState.stateColdStarted) && !(objectManagerState.state == ObjectManagerState.stateWarmStarted)) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "addEntry" , new Object[] { new Integer(objectManagerState.state), ObjectManagerState.stateNames[objectManagerState.state] } ); throw new InvalidStateException(this, objectManagerState.state, ObjectManagerState.stateNames[objectManagerState.state]); } if (name.equals("*")) { statistics.putAll(objectManagerState.logOutput.captureStatistics()); statistics.putAll(captureStatistics()); } else if (name.equals("LogOutput")) { statistics.putAll(objectManagerState.logOutput.captureStatistics()); } else if (name.equals("ObjectManager")) { statistics.putAll(captureStatistics()); } else { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, "captureStatistics", new Object[] { name }); throw new StatisticsNameNotFoundException(this, name); } // if (name.equals... } // synchronized (objectManagerState). if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "captureStatistics" , statistics ); return statistics; }
java
public java.util.Map captureStatistics(String name ) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, "captureStatistics", new Object[] { name }); java.util.Map statistics = new java.util.HashMap(); // To be returned. synchronized (objectManagerState) { if (!(objectManagerState.state == ObjectManagerState.stateColdStarted) && !(objectManagerState.state == ObjectManagerState.stateWarmStarted)) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "addEntry" , new Object[] { new Integer(objectManagerState.state), ObjectManagerState.stateNames[objectManagerState.state] } ); throw new InvalidStateException(this, objectManagerState.state, ObjectManagerState.stateNames[objectManagerState.state]); } if (name.equals("*")) { statistics.putAll(objectManagerState.logOutput.captureStatistics()); statistics.putAll(captureStatistics()); } else if (name.equals("LogOutput")) { statistics.putAll(objectManagerState.logOutput.captureStatistics()); } else if (name.equals("ObjectManager")) { statistics.putAll(captureStatistics()); } else { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, "captureStatistics", new Object[] { name }); throw new StatisticsNameNotFoundException(this, name); } // if (name.equals... } // synchronized (objectManagerState). if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "captureStatistics" , statistics ); return statistics; }
[ "public", "java", ".", "util", ".", "Map", "captureStatistics", "(", "String", "name", ")", "throws", "ObjectManagerException", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "\"captureStatistics\"", ",", "new", "Object", "[", "]", "{", "name", "}", ")", ";", "java", ".", "util", ".", "Map", "statistics", "=", "new", "java", ".", "util", ".", "HashMap", "(", ")", ";", "// To be returned.", "synchronized", "(", "objectManagerState", ")", "{", "if", "(", "!", "(", "objectManagerState", ".", "state", "==", "ObjectManagerState", ".", "stateColdStarted", ")", "&&", "!", "(", "objectManagerState", ".", "state", "==", "ObjectManagerState", ".", "stateWarmStarted", ")", ")", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"addEntry\"", ",", "new", "Object", "[", "]", "{", "new", "Integer", "(", "objectManagerState", ".", "state", ")", ",", "ObjectManagerState", ".", "stateNames", "[", "objectManagerState", ".", "state", "]", "}", ")", ";", "throw", "new", "InvalidStateException", "(", "this", ",", "objectManagerState", ".", "state", ",", "ObjectManagerState", ".", "stateNames", "[", "objectManagerState", ".", "state", "]", ")", ";", "}", "if", "(", "name", ".", "equals", "(", "\"*\"", ")", ")", "{", "statistics", ".", "putAll", "(", "objectManagerState", ".", "logOutput", ".", "captureStatistics", "(", ")", ")", ";", "statistics", ".", "putAll", "(", "captureStatistics", "(", ")", ")", ";", "}", "else", "if", "(", "name", ".", "equals", "(", "\"LogOutput\"", ")", ")", "{", "statistics", ".", "putAll", "(", "objectManagerState", ".", "logOutput", ".", "captureStatistics", "(", ")", ")", ";", "}", "else", "if", "(", "name", ".", "equals", "(", "\"ObjectManager\"", ")", ")", "{", "statistics", ".", "putAll", "(", "captureStatistics", "(", ")", ")", ";", "}", "else", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"captureStatistics\"", ",", "new", "Object", "[", "]", "{", "name", "}", ")", ";", "throw", "new", "StatisticsNameNotFoundException", "(", "this", ",", "name", ")", ";", "}", "// if (name.equals...", "}", "// synchronized (objectManagerState).", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"captureStatistics\"", ",", "statistics", ")", ";", "return", "statistics", ";", "}" ]
Capture statistics. @param name The name of the component to capture statistics from. @return java.util.Map the captured statistics. @throws ObjectManagerException
[ "Capture", "statistics", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java#L1041-L1091
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java
ObjectManager.registerEventCallback
public void registerEventCallback(ObjectManagerEventCallback callback) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, "registerEventCallback", callback); objectManagerState.registerEventCallback(callback); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, "registerEventCallback"); }
java
public void registerEventCallback(ObjectManagerEventCallback callback) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, "registerEventCallback", callback); objectManagerState.registerEventCallback(callback); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, "registerEventCallback"); }
[ "public", "void", "registerEventCallback", "(", "ObjectManagerEventCallback", "callback", ")", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "\"registerEventCallback\"", ",", "callback", ")", ";", "objectManagerState", ".", "registerEventCallback", "(", "callback", ")", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"registerEventCallback\"", ")", ";", "}" ]
Defect 495856, 496893
[ "Defect", "495856", "496893" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/ObjectManager.java#L1117-L1126
train
OpenLiberty/open-liberty
dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/BootstrapDefaults.java
BootstrapDefaults.getLogProviderDefinition
public String getLogProviderDefinition(BootstrapConfig bootProps) { String logProvider = bootProps.get(BOOTPROP_LOG_PROVIDER); if (logProvider == null) logProvider = defaults.getProperty(MANIFEST_LOG_PROVIDER); if (logProvider != null) bootProps.put(BOOTPROP_LOG_PROVIDER, logProvider); return logProvider; }
java
public String getLogProviderDefinition(BootstrapConfig bootProps) { String logProvider = bootProps.get(BOOTPROP_LOG_PROVIDER); if (logProvider == null) logProvider = defaults.getProperty(MANIFEST_LOG_PROVIDER); if (logProvider != null) bootProps.put(BOOTPROP_LOG_PROVIDER, logProvider); return logProvider; }
[ "public", "String", "getLogProviderDefinition", "(", "BootstrapConfig", "bootProps", ")", "{", "String", "logProvider", "=", "bootProps", ".", "get", "(", "BOOTPROP_LOG_PROVIDER", ")", ";", "if", "(", "logProvider", "==", "null", ")", "logProvider", "=", "defaults", ".", "getProperty", "(", "MANIFEST_LOG_PROVIDER", ")", ";", "if", "(", "logProvider", "!=", "null", ")", "bootProps", ".", "put", "(", "BOOTPROP_LOG_PROVIDER", ",", "logProvider", ")", ";", "return", "logProvider", ";", "}" ]
Find and return the name of the log provider. Look in bootstrap properties first, if not explicitly defined there, get the default from the manifest. @return the selected log provider
[ "Find", "and", "return", "the", "name", "of", "the", "log", "provider", ".", "Look", "in", "bootstrap", "properties", "first", "if", "not", "explicitly", "defined", "there", "get", "the", "default", "from", "the", "manifest", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/BootstrapDefaults.java#L101-L111
train
OpenLiberty/open-liberty
dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/BootstrapDefaults.java
BootstrapDefaults.getOSExtensionDefinition
public String getOSExtensionDefinition(BootstrapConfig bootProps) { String osExtension = bootProps.get(BOOTPROP_OS_EXTENSIONS); if (osExtension == null) { String normalizedName = getNormalizedOperatingSystemName(bootProps.get("os.name")); osExtension = defaults.getProperty(MANIFEST_OS_EXTENSION + normalizedName); } if (osExtension != null) bootProps.put(BOOTPROP_OS_EXTENSIONS, osExtension); return osExtension; }
java
public String getOSExtensionDefinition(BootstrapConfig bootProps) { String osExtension = bootProps.get(BOOTPROP_OS_EXTENSIONS); if (osExtension == null) { String normalizedName = getNormalizedOperatingSystemName(bootProps.get("os.name")); osExtension = defaults.getProperty(MANIFEST_OS_EXTENSION + normalizedName); } if (osExtension != null) bootProps.put(BOOTPROP_OS_EXTENSIONS, osExtension); return osExtension; }
[ "public", "String", "getOSExtensionDefinition", "(", "BootstrapConfig", "bootProps", ")", "{", "String", "osExtension", "=", "bootProps", ".", "get", "(", "BOOTPROP_OS_EXTENSIONS", ")", ";", "if", "(", "osExtension", "==", "null", ")", "{", "String", "normalizedName", "=", "getNormalizedOperatingSystemName", "(", "bootProps", ".", "get", "(", "\"os.name\"", ")", ")", ";", "osExtension", "=", "defaults", ".", "getProperty", "(", "MANIFEST_OS_EXTENSION", "+", "normalizedName", ")", ";", "}", "if", "(", "osExtension", "!=", "null", ")", "bootProps", ".", "put", "(", "BOOTPROP_OS_EXTENSIONS", ",", "osExtension", ")", ";", "return", "osExtension", ";", "}" ]
Find and return the name of the os extension. Look in bootstrap properties first, if not explicitly defined there, get the default from the manifest. @return the selected log provider
[ "Find", "and", "return", "the", "name", "of", "the", "os", "extension", ".", "Look", "in", "bootstrap", "properties", "first", "if", "not", "explicitly", "defined", "there", "get", "the", "default", "from", "the", "manifest", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/internal/BootstrapDefaults.java#L120-L132
train
OpenLiberty/open-liberty
dev/com.ibm.ws.microprofile.config.1.1/src/com/ibm/ws/microprofile/config/archaius/cache/ConfigCache.java
ConfigCache.getProperty
private TypeContainer getProperty(String propName) { TypeContainer container = cache.get(propName); if (container == null) { container = new TypeContainer(propName, config, version); TypeContainer existing = cache.putIfAbsent(propName, container); if (existing != null) { return existing; } } return container; }
java
private TypeContainer getProperty(String propName) { TypeContainer container = cache.get(propName); if (container == null) { container = new TypeContainer(propName, config, version); TypeContainer existing = cache.putIfAbsent(propName, container); if (existing != null) { return existing; } } return container; }
[ "private", "TypeContainer", "getProperty", "(", "String", "propName", ")", "{", "TypeContainer", "container", "=", "cache", ".", "get", "(", "propName", ")", ";", "if", "(", "container", "==", "null", ")", "{", "container", "=", "new", "TypeContainer", "(", "propName", ",", "config", ",", "version", ")", ";", "TypeContainer", "existing", "=", "cache", ".", "putIfAbsent", "(", "propName", ",", "container", ")", ";", "if", "(", "existing", "!=", "null", ")", "{", "return", "existing", ";", "}", "}", "return", "container", ";", "}" ]
Gets the cached property container or make a new one, cache it and return it @param propName @return the property's container
[ "Gets", "the", "cached", "property", "container", "or", "make", "a", "new", "one", "cache", "it", "and", "return", "it" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.config.1.1/src/com/ibm/ws/microprofile/config/archaius/cache/ConfigCache.java#L63-L74
train
OpenLiberty/open-liberty
dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/execution/impl/RuntimeSplitFlowExecution.java
RuntimeSplitFlowExecution.publishStartedEvent
private void publishStartedEvent() { BatchEventsPublisher publisher = getBatchEventsPublisher(); if (publisher != null) { publisher.publishSplitFlowEvent(getSplitName(), getFlowName(), getTopLevelInstanceId(), getTopLevelExecutionId(), BatchEventsPublisher.TOPIC_EXECUTION_SPLIT_FLOW_STARTED, correlationId); } }
java
private void publishStartedEvent() { BatchEventsPublisher publisher = getBatchEventsPublisher(); if (publisher != null) { publisher.publishSplitFlowEvent(getSplitName(), getFlowName(), getTopLevelInstanceId(), getTopLevelExecutionId(), BatchEventsPublisher.TOPIC_EXECUTION_SPLIT_FLOW_STARTED, correlationId); } }
[ "private", "void", "publishStartedEvent", "(", ")", "{", "BatchEventsPublisher", "publisher", "=", "getBatchEventsPublisher", "(", ")", ";", "if", "(", "publisher", "!=", "null", ")", "{", "publisher", ".", "publishSplitFlowEvent", "(", "getSplitName", "(", ")", ",", "getFlowName", "(", ")", ",", "getTopLevelInstanceId", "(", ")", ",", "getTopLevelExecutionId", "(", ")", ",", "BatchEventsPublisher", ".", "TOPIC_EXECUTION_SPLIT_FLOW_STARTED", ",", "correlationId", ")", ";", "}", "}" ]
Publish started event
[ "Publish", "started", "event" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/execution/impl/RuntimeSplitFlowExecution.java#L152-L163
train
OpenLiberty/open-liberty
dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/execution/impl/RuntimeSplitFlowExecution.java
RuntimeSplitFlowExecution.publishEndedEvent
private void publishEndedEvent() { BatchEventsPublisher publisher = getBatchEventsPublisher(); if (publisher != null) { publisher.publishSplitFlowEvent(getSplitName(), getFlowName(), getTopLevelInstanceId(), getTopLevelExecutionId(), BatchEventsPublisher.TOPIC_EXECUTION_SPLIT_FLOW_ENDED, correlationId); } }
java
private void publishEndedEvent() { BatchEventsPublisher publisher = getBatchEventsPublisher(); if (publisher != null) { publisher.publishSplitFlowEvent(getSplitName(), getFlowName(), getTopLevelInstanceId(), getTopLevelExecutionId(), BatchEventsPublisher.TOPIC_EXECUTION_SPLIT_FLOW_ENDED, correlationId); } }
[ "private", "void", "publishEndedEvent", "(", ")", "{", "BatchEventsPublisher", "publisher", "=", "getBatchEventsPublisher", "(", ")", ";", "if", "(", "publisher", "!=", "null", ")", "{", "publisher", ".", "publishSplitFlowEvent", "(", "getSplitName", "(", ")", ",", "getFlowName", "(", ")", ",", "getTopLevelInstanceId", "(", ")", ",", "getTopLevelExecutionId", "(", ")", ",", "BatchEventsPublisher", ".", "TOPIC_EXECUTION_SPLIT_FLOW_ENDED", ",", "correlationId", ")", ";", "}", "}" ]
Publish ended event
[ "Publish", "ended", "event" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/execution/impl/RuntimeSplitFlowExecution.java#L168-L179
train
OpenLiberty/open-liberty
dev/com.ibm.ws.org.apache.cxf.cxf.rt.rs.client.3.2/src/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java
JAXRSClientFactoryBean.setHeaders
public void setHeaders(Map<String, String> map) { headers = new MetadataMap<String, String>(); for (Map.Entry<String, String> entry : map.entrySet()) { String[] values = entry.getValue().split(","); for (String v : values) { if (v.length() != 0) { headers.add(entry.getKey(), v); } } } }
java
public void setHeaders(Map<String, String> map) { headers = new MetadataMap<String, String>(); for (Map.Entry<String, String> entry : map.entrySet()) { String[] values = entry.getValue().split(","); for (String v : values) { if (v.length() != 0) { headers.add(entry.getKey(), v); } } } }
[ "public", "void", "setHeaders", "(", "Map", "<", "String", ",", "String", ">", "map", ")", "{", "headers", "=", "new", "MetadataMap", "<", "String", ",", "String", ">", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "String", ">", "entry", ":", "map", ".", "entrySet", "(", ")", ")", "{", "String", "[", "]", "values", "=", "entry", ".", "getValue", "(", ")", ".", "split", "(", "\",\"", ")", ";", "for", "(", "String", "v", ":", "values", ")", "{", "if", "(", "v", ".", "length", "(", ")", "!=", "0", ")", "{", "headers", ".", "add", "(", "entry", ".", "getKey", "(", ")", ",", "v", ")", ";", "}", "}", "}", "}" ]
Sets the headers new proxy or WebClient instances will be initialized with. @param map the headers
[ "Sets", "the", "headers", "new", "proxy", "or", "WebClient", "instances", "will", "be", "initialized", "with", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.org.apache.cxf.cxf.rt.rs.client.3.2/src/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java#L187-L197
train
OpenLiberty/open-liberty
dev/com.ibm.ws.org.apache.cxf.cxf.rt.rs.client.3.2/src/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java
JAXRSClientFactoryBean.createWebClient
public WebClient createWebClient() { String serviceAddress = getAddress(); int queryIndex = serviceAddress != null ? serviceAddress.lastIndexOf('?') : -1; if (queryIndex != -1) { serviceAddress = serviceAddress.substring(0, queryIndex); } Service service = new JAXRSServiceImpl(serviceAddress, getServiceName()); getServiceFactory().setService(service); try { Endpoint ep = createEndpoint(); this.getServiceFactory().sendEvent(FactoryBeanListener.Event.PRE_CLIENT_CREATE, ep); ClientState actualState = getActualState(); WebClient client = actualState == null ? new WebClient(getAddress()) : new WebClient(actualState); initClient(client, ep, actualState == null); notifyLifecycleManager(client); this.getServiceFactory().sendEvent(FactoryBeanListener.Event.CLIENT_CREATED, client, ep); return client; } catch (Exception ex) { LOG.severe(ex.getClass().getName() + " : " + ex.getLocalizedMessage()); throw new RuntimeException(ex); } }
java
public WebClient createWebClient() { String serviceAddress = getAddress(); int queryIndex = serviceAddress != null ? serviceAddress.lastIndexOf('?') : -1; if (queryIndex != -1) { serviceAddress = serviceAddress.substring(0, queryIndex); } Service service = new JAXRSServiceImpl(serviceAddress, getServiceName()); getServiceFactory().setService(service); try { Endpoint ep = createEndpoint(); this.getServiceFactory().sendEvent(FactoryBeanListener.Event.PRE_CLIENT_CREATE, ep); ClientState actualState = getActualState(); WebClient client = actualState == null ? new WebClient(getAddress()) : new WebClient(actualState); initClient(client, ep, actualState == null); notifyLifecycleManager(client); this.getServiceFactory().sendEvent(FactoryBeanListener.Event.CLIENT_CREATED, client, ep); return client; } catch (Exception ex) { LOG.severe(ex.getClass().getName() + " : " + ex.getLocalizedMessage()); throw new RuntimeException(ex); } }
[ "public", "WebClient", "createWebClient", "(", ")", "{", "String", "serviceAddress", "=", "getAddress", "(", ")", ";", "int", "queryIndex", "=", "serviceAddress", "!=", "null", "?", "serviceAddress", ".", "lastIndexOf", "(", "'", "'", ")", ":", "-", "1", ";", "if", "(", "queryIndex", "!=", "-", "1", ")", "{", "serviceAddress", "=", "serviceAddress", ".", "substring", "(", "0", ",", "queryIndex", ")", ";", "}", "Service", "service", "=", "new", "JAXRSServiceImpl", "(", "serviceAddress", ",", "getServiceName", "(", ")", ")", ";", "getServiceFactory", "(", ")", ".", "setService", "(", "service", ")", ";", "try", "{", "Endpoint", "ep", "=", "createEndpoint", "(", ")", ";", "this", ".", "getServiceFactory", "(", ")", ".", "sendEvent", "(", "FactoryBeanListener", ".", "Event", ".", "PRE_CLIENT_CREATE", ",", "ep", ")", ";", "ClientState", "actualState", "=", "getActualState", "(", ")", ";", "WebClient", "client", "=", "actualState", "==", "null", "?", "new", "WebClient", "(", "getAddress", "(", ")", ")", ":", "new", "WebClient", "(", "actualState", ")", ";", "initClient", "(", "client", ",", "ep", ",", "actualState", "==", "null", ")", ";", "notifyLifecycleManager", "(", "client", ")", ";", "this", ".", "getServiceFactory", "(", ")", ".", "sendEvent", "(", "FactoryBeanListener", ".", "Event", ".", "CLIENT_CREATED", ",", "client", ",", "ep", ")", ";", "return", "client", ";", "}", "catch", "(", "Exception", "ex", ")", "{", "LOG", ".", "severe", "(", "ex", ".", "getClass", "(", ")", ".", "getName", "(", ")", "+", "\" : \"", "+", "ex", ".", "getLocalizedMessage", "(", ")", ")", ";", "throw", "new", "RuntimeException", "(", "ex", ")", ";", "}", "}" ]
Creates a WebClient instance @return WebClient instance
[ "Creates", "a", "WebClient", "instance" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.org.apache.cxf.cxf.rt.rs.client.3.2/src/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java#L211-L236
train
OpenLiberty/open-liberty
dev/com.ibm.ws.org.apache.cxf.cxf.rt.rs.client.3.2/src/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java
JAXRSClientFactoryBean.create
public <T> T create(Class<T> cls, Object... varValues) { return cls.cast(createWithValues(varValues)); }
java
public <T> T create(Class<T> cls, Object... varValues) { return cls.cast(createWithValues(varValues)); }
[ "public", "<", "T", ">", "T", "create", "(", "Class", "<", "T", ">", "cls", ",", "Object", "...", "varValues", ")", "{", "return", "cls", ".", "cast", "(", "createWithValues", "(", "varValues", ")", ")", ";", "}" ]
Creates a proxy @param cls the proxy class @param varValues optional list of values which will be used to substitute template variables specified in the class-level JAX-RS Path annotations @return the proxy
[ "Creates", "a", "proxy" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.org.apache.cxf.cxf.rt.rs.client.3.2/src/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java#L263-L265
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jca.cm/src/com/ibm/ws/jca/cm/ConnectorService.java
ConnectorService.deserialize
public static final Object deserialize(byte[] bytes) throws Exception { final boolean trace = TraceComponent.isAnyTracingEnabled(); if (trace && tc.isEntryEnabled()) Tr.entry(tc, "deserialize"); Object o; try { ByteArrayInputStream bis = new ByteArrayInputStream(bytes); ObjectInputStream oin = new ObjectInputStream(bis); o = oin.readObject(); oin.close(); } catch (IOException e) { FFDCFilter.processException(e, ConnectorService.class.getName(), "151"); if (trace && tc.isEntryEnabled()) Tr.exit(tc, "deserialize", new Object[] { toString(bytes), e }); throw e; } if (trace && tc.isEntryEnabled()) Tr.exit(tc, "deserialize", o == null ? null : o.getClass()); return o; }
java
public static final Object deserialize(byte[] bytes) throws Exception { final boolean trace = TraceComponent.isAnyTracingEnabled(); if (trace && tc.isEntryEnabled()) Tr.entry(tc, "deserialize"); Object o; try { ByteArrayInputStream bis = new ByteArrayInputStream(bytes); ObjectInputStream oin = new ObjectInputStream(bis); o = oin.readObject(); oin.close(); } catch (IOException e) { FFDCFilter.processException(e, ConnectorService.class.getName(), "151"); if (trace && tc.isEntryEnabled()) Tr.exit(tc, "deserialize", new Object[] { toString(bytes), e }); throw e; } if (trace && tc.isEntryEnabled()) Tr.exit(tc, "deserialize", o == null ? null : o.getClass()); return o; }
[ "public", "static", "final", "Object", "deserialize", "(", "byte", "[", "]", "bytes", ")", "throws", "Exception", "{", "final", "boolean", "trace", "=", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", ";", "if", "(", "trace", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"deserialize\"", ")", ";", "Object", "o", ";", "try", "{", "ByteArrayInputStream", "bis", "=", "new", "ByteArrayInputStream", "(", "bytes", ")", ";", "ObjectInputStream", "oin", "=", "new", "ObjectInputStream", "(", "bis", ")", ";", "o", "=", "oin", ".", "readObject", "(", ")", ";", "oin", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "FFDCFilter", ".", "processException", "(", "e", ",", "ConnectorService", ".", "class", ".", "getName", "(", ")", ",", "\"151\"", ")", ";", "if", "(", "trace", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "tc", ",", "\"deserialize\"", ",", "new", "Object", "[", "]", "{", "toString", "(", "bytes", ")", ",", "e", "}", ")", ";", "throw", "e", ";", "}", "if", "(", "trace", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "tc", ",", "\"deserialize\"", ",", "o", "==", "null", "?", "null", ":", "o", ".", "getClass", "(", ")", ")", ";", "return", "o", ";", "}" ]
Deserialize from an array of bytes. @param bytes serialized bytes. @return deserialized object.
[ "Deserialize", "from", "an", "array", "of", "bytes", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ws/jca/cm/ConnectorService.java#L44-L65
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jca.cm/src/com/ibm/ws/jca/cm/ConnectorService.java
ConnectorService.getMessage
public static final String getMessage(String key, Object... args) { return NLS.getFormattedMessage(key, args, key); }
java
public static final String getMessage(String key, Object... args) { return NLS.getFormattedMessage(key, args, key); }
[ "public", "static", "final", "String", "getMessage", "(", "String", "key", ",", "Object", "...", "args", ")", "{", "return", "NLS", ".", "getFormattedMessage", "(", "key", ",", "args", ",", "key", ")", ";", "}" ]
Get a translated message from J2CAMessages file. @param key message key. @param args message parameters @return a translated message.
[ "Get", "a", "translated", "message", "from", "J2CAMessages", "file", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ws/jca/cm/ConnectorService.java#L79-L81
train