repo
stringlengths 7
58
| path
stringlengths 12
218
| func_name
stringlengths 3
140
| original_string
stringlengths 73
34.1k
| language
stringclasses 1
value | code
stringlengths 73
34.1k
| code_tokens
sequence | docstring
stringlengths 3
16k
| docstring_tokens
sequence | sha
stringlengths 40
40
| url
stringlengths 105
339
| partition
stringclasses 1
value |
---|---|---|---|---|---|---|---|---|---|---|---|
OpenLiberty/open-liberty | dev/com.ibm.ws.diagnostics/src/com/ibm/ws/diagnostics/java/JavaRuntimeInformation.java | JavaRuntimeInformation.introspect | @Override
public void introspect(PrintWriter writer) {
RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
introspectUptime(runtime, writer);
introspectVendorVersion(runtime, writer);
introspectInputArguments(runtime, writer);
Map<String, String> props = introspectSystemProperties(runtime, writer);
//introspectPaths(runtime, writer);
introspectDirsFromSystemProperties(runtime, writer, "java.ext.dirs", props);
introspectDirsFromSystemProperties(runtime, writer, "java.endorsed.dirs", props);
} | java | @Override
public void introspect(PrintWriter writer) {
RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
introspectUptime(runtime, writer);
introspectVendorVersion(runtime, writer);
introspectInputArguments(runtime, writer);
Map<String, String> props = introspectSystemProperties(runtime, writer);
//introspectPaths(runtime, writer);
introspectDirsFromSystemProperties(runtime, writer, "java.ext.dirs", props);
introspectDirsFromSystemProperties(runtime, writer, "java.endorsed.dirs", props);
} | [
"@",
"Override",
"public",
"void",
"introspect",
"(",
"PrintWriter",
"writer",
")",
"{",
"RuntimeMXBean",
"runtime",
"=",
"ManagementFactory",
".",
"getRuntimeMXBean",
"(",
")",
";",
"introspectUptime",
"(",
"runtime",
",",
"writer",
")",
";",
"introspectVendorVersion",
"(",
"runtime",
",",
"writer",
")",
";",
"introspectInputArguments",
"(",
"runtime",
",",
"writer",
")",
";",
"Map",
"<",
"String",
",",
"String",
">",
"props",
"=",
"introspectSystemProperties",
"(",
"runtime",
",",
"writer",
")",
";",
"//introspectPaths(runtime, writer);",
"introspectDirsFromSystemProperties",
"(",
"runtime",
",",
"writer",
",",
"\"java.ext.dirs\"",
",",
"props",
")",
";",
"introspectDirsFromSystemProperties",
"(",
"runtime",
",",
"writer",
",",
"\"java.endorsed.dirs\"",
",",
"props",
")",
";",
"}"
] | Grab a snapshot of the current system properties.
@param out the output stream to write diagnostics to | [
"Grab",
"a",
"snapshot",
"of",
"the",
"current",
"system",
"properties",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.diagnostics/src/com/ibm/ws/diagnostics/java/JavaRuntimeInformation.java#L53-L64 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/wsspi/cache/ConfigEntry.java | ConfigEntry.getProperties | public ArrayList getProperties(){
ArrayList properties = new ArrayList();
if (configEntry.properties != null){
Iterator it = configEntry.properties.values().iterator();
while (it.hasNext()){
Property property = new Property((com.ibm.ws.cache.config.Property)it.next());
properties.add(property);
}
}
return properties;
} | java | public ArrayList getProperties(){
ArrayList properties = new ArrayList();
if (configEntry.properties != null){
Iterator it = configEntry.properties.values().iterator();
while (it.hasNext()){
Property property = new Property((com.ibm.ws.cache.config.Property)it.next());
properties.add(property);
}
}
return properties;
} | [
"public",
"ArrayList",
"getProperties",
"(",
")",
"{",
"ArrayList",
"properties",
"=",
"new",
"ArrayList",
"(",
")",
";",
"if",
"(",
"configEntry",
".",
"properties",
"!=",
"null",
")",
"{",
"Iterator",
"it",
"=",
"configEntry",
".",
"properties",
".",
"values",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"it",
".",
"hasNext",
"(",
")",
")",
"{",
"Property",
"property",
"=",
"new",
"Property",
"(",
"(",
"com",
".",
"ibm",
".",
"ws",
".",
"cache",
".",
"config",
".",
"Property",
")",
"it",
".",
"next",
"(",
")",
")",
";",
"properties",
".",
"add",
"(",
"property",
")",
";",
"}",
"}",
"return",
"properties",
";",
"}"
] | This method returns a list of properties defined on a cache-entry
@return A list of properties | [
"This",
"method",
"returns",
"a",
"list",
"of",
"properties",
"defined",
"on",
"a",
"cache",
"-",
"entry"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/wsspi/cache/ConfigEntry.java#L73-L83 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/wsspi/cache/ConfigEntry.java | ConfigEntry.getCacheIds | public CacheId[] getCacheIds(){
CacheId[] cacheIds = new CacheId[configEntry.cacheIds.length];
for ( int i=0; i<configEntry.cacheIds.length; i++ ){
cacheIds[i] = new CacheId(configEntry.cacheIds[i]);
}
return cacheIds;
} | java | public CacheId[] getCacheIds(){
CacheId[] cacheIds = new CacheId[configEntry.cacheIds.length];
for ( int i=0; i<configEntry.cacheIds.length; i++ ){
cacheIds[i] = new CacheId(configEntry.cacheIds[i]);
}
return cacheIds;
} | [
"public",
"CacheId",
"[",
"]",
"getCacheIds",
"(",
")",
"{",
"CacheId",
"[",
"]",
"cacheIds",
"=",
"new",
"CacheId",
"[",
"configEntry",
".",
"cacheIds",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"configEntry",
".",
"cacheIds",
".",
"length",
";",
"i",
"++",
")",
"{",
"cacheIds",
"[",
"i",
"]",
"=",
"new",
"CacheId",
"(",
"configEntry",
".",
"cacheIds",
"[",
"i",
"]",
")",
";",
"}",
"return",
"cacheIds",
";",
"}"
] | This method returns an array of CacheId objects that contain cache ID generation rules
used to produce a valid cache ID.
@return Array of CacheId objects | [
"This",
"method",
"returns",
"an",
"array",
"of",
"CacheId",
"objects",
"that",
"contain",
"cache",
"ID",
"generation",
"rules",
"used",
"to",
"produce",
"a",
"valid",
"cache",
"ID",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/wsspi/cache/ConfigEntry.java#L91-L97 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/wsspi/cache/ConfigEntry.java | ConfigEntry.getDependencyIds | public DependencyId[] getDependencyIds(){
DependencyId[] depIds = new DependencyId[configEntry.dependencyIds.length];
for ( int i=0; i<configEntry.dependencyIds.length; i++ ){
depIds[i] = new DependencyId(configEntry.dependencyIds[i]);
}
return depIds;
} | java | public DependencyId[] getDependencyIds(){
DependencyId[] depIds = new DependencyId[configEntry.dependencyIds.length];
for ( int i=0; i<configEntry.dependencyIds.length; i++ ){
depIds[i] = new DependencyId(configEntry.dependencyIds[i]);
}
return depIds;
} | [
"public",
"DependencyId",
"[",
"]",
"getDependencyIds",
"(",
")",
"{",
"DependencyId",
"[",
"]",
"depIds",
"=",
"new",
"DependencyId",
"[",
"configEntry",
".",
"dependencyIds",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"configEntry",
".",
"dependencyIds",
".",
"length",
";",
"i",
"++",
")",
"{",
"depIds",
"[",
"i",
"]",
"=",
"new",
"DependencyId",
"(",
"configEntry",
".",
"dependencyIds",
"[",
"i",
"]",
")",
";",
"}",
"return",
"depIds",
";",
"}"
] | This method returns an array of DependencyId objects that specified addditional cache
indentifers that associated multiple cache entries to the same group identiifier.
@return Array of DependencyId objects | [
"This",
"method",
"returns",
"an",
"array",
"of",
"DependencyId",
"objects",
"that",
"specified",
"addditional",
"cache",
"indentifers",
"that",
"associated",
"multiple",
"cache",
"entries",
"to",
"the",
"same",
"group",
"identiifier",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/wsspi/cache/ConfigEntry.java#L105-L111 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/wsspi/cache/ConfigEntry.java | ConfigEntry.getInvalidations | public Invalidation[] getInvalidations(){
Invalidation[] invalidations = new Invalidation[configEntry.invalidations.length];
for ( int i=0; i<configEntry.invalidations.length; i++ ){
invalidations[i] = new Invalidation(configEntry.invalidations[i]);
}
return invalidations;
} | java | public Invalidation[] getInvalidations(){
Invalidation[] invalidations = new Invalidation[configEntry.invalidations.length];
for ( int i=0; i<configEntry.invalidations.length; i++ ){
invalidations[i] = new Invalidation(configEntry.invalidations[i]);
}
return invalidations;
} | [
"public",
"Invalidation",
"[",
"]",
"getInvalidations",
"(",
")",
"{",
"Invalidation",
"[",
"]",
"invalidations",
"=",
"new",
"Invalidation",
"[",
"configEntry",
".",
"invalidations",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"configEntry",
".",
"invalidations",
".",
"length",
";",
"i",
"++",
")",
"{",
"invalidations",
"[",
"i",
"]",
"=",
"new",
"Invalidation",
"(",
"configEntry",
".",
"invalidations",
"[",
"i",
"]",
")",
";",
"}",
"return",
"invalidations",
";",
"}"
] | This method returns an array of Invalidation objects that written custom Java code or through
rules that are defined in the cache policy of each entry.
@return Array of Invalidation objects | [
"This",
"method",
"returns",
"an",
"array",
"of",
"Invalidation",
"objects",
"that",
"written",
"custom",
"Java",
"code",
"or",
"through",
"rules",
"that",
"are",
"defined",
"in",
"the",
"cache",
"policy",
"of",
"each",
"entry",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/wsspi/cache/ConfigEntry.java#L119-L125 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/tcpchannel/internal/NBAcceptChannelSelector.java | NBAcceptChannelSelector.closeSocketChannel | private void closeSocketChannel(SocketChannel sc) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
try {
Tr.event(this, tc, "Closing connection, local: " + sc.socket().getLocalSocketAddress() + " remote: " + sc.socket().getRemoteSocketAddress());
} catch (Throwable t) {
// protect against JDK PK42970 throwing illegal arg
}
}
try {
sc.close();
} catch (IOException ioe) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(this, tc, "IOException caught while closing connection " + ioe);
}
}
} | java | private void closeSocketChannel(SocketChannel sc) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
try {
Tr.event(this, tc, "Closing connection, local: " + sc.socket().getLocalSocketAddress() + " remote: " + sc.socket().getRemoteSocketAddress());
} catch (Throwable t) {
// protect against JDK PK42970 throwing illegal arg
}
}
try {
sc.close();
} catch (IOException ioe) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(this, tc, "IOException caught while closing connection " + ioe);
}
}
} | [
"private",
"void",
"closeSocketChannel",
"(",
"SocketChannel",
"sc",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"{",
"try",
"{",
"Tr",
".",
"event",
"(",
"this",
",",
"tc",
",",
"\"Closing connection, local: \"",
"+",
"sc",
".",
"socket",
"(",
")",
".",
"getLocalSocketAddress",
"(",
")",
"+",
"\" remote: \"",
"+",
"sc",
".",
"socket",
"(",
")",
".",
"getRemoteSocketAddress",
"(",
")",
")",
";",
"}",
"catch",
"(",
"Throwable",
"t",
")",
"{",
"// protect against JDK PK42970 throwing illegal arg",
"}",
"}",
"try",
"{",
"sc",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"ioe",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"event",
"(",
"this",
",",
"tc",
",",
"\"IOException caught while closing connection \"",
"+",
"ioe",
")",
";",
"}",
"}",
"}"
] | Handle closing the socket channel with appropriate debug and error
protection.
@param sc | [
"Handle",
"closing",
"the",
"socket",
"channel",
"with",
"appropriate",
"debug",
"and",
"error",
"protection",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/tcpchannel/internal/NBAcceptChannelSelector.java#L374-L392 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.org.apache.jasper.el/src/org/apache/el/util/ReflectionUtil.java | ReflectionUtil.toTypeArray | public static Class<?>[] toTypeArray(String[] s) throws ClassNotFoundException {
if (s == null)
return null;
Class<?>[] c = new Class[s.length];
for (int i = 0; i < s.length; i++) {
c[i] = forName(s[i]);
}
return c;
} | java | public static Class<?>[] toTypeArray(String[] s) throws ClassNotFoundException {
if (s == null)
return null;
Class<?>[] c = new Class[s.length];
for (int i = 0; i < s.length; i++) {
c[i] = forName(s[i]);
}
return c;
} | [
"public",
"static",
"Class",
"<",
"?",
">",
"[",
"]",
"toTypeArray",
"(",
"String",
"[",
"]",
"s",
")",
"throws",
"ClassNotFoundException",
"{",
"if",
"(",
"s",
"==",
"null",
")",
"return",
"null",
";",
"Class",
"<",
"?",
">",
"[",
"]",
"c",
"=",
"new",
"Class",
"[",
"s",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"s",
".",
"length",
";",
"i",
"++",
")",
"{",
"c",
"[",
"i",
"]",
"=",
"forName",
"(",
"s",
"[",
"i",
"]",
")",
";",
"}",
"return",
"c",
";",
"}"
] | Converts an array of Class names to Class types.
@param s The array of class names
@return An array of Class instance where the element at index i in the
result is an instance of the class with the name at index i in
the input
@throws ClassNotFoundException If a class of a given name cannot be found | [
"Converts",
"an",
"array",
"of",
"Class",
"names",
"to",
"Class",
"types",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.org.apache.jasper.el/src/org/apache/el/util/ReflectionUtil.java#L105-L113 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.org.apache.jasper.el/src/org/apache/el/util/ReflectionUtil.java | ReflectionUtil.toTypeNameArray | public static String[] toTypeNameArray(Class<?>[] c) {
if (c == null)
return null;
String[] s = new String[c.length];
for (int i = 0; i < c.length; i++) {
s[i] = c[i].getName();
}
return s;
} | java | public static String[] toTypeNameArray(Class<?>[] c) {
if (c == null)
return null;
String[] s = new String[c.length];
for (int i = 0; i < c.length; i++) {
s[i] = c[i].getName();
}
return s;
} | [
"public",
"static",
"String",
"[",
"]",
"toTypeNameArray",
"(",
"Class",
"<",
"?",
">",
"[",
"]",
"c",
")",
"{",
"if",
"(",
"c",
"==",
"null",
")",
"return",
"null",
";",
"String",
"[",
"]",
"s",
"=",
"new",
"String",
"[",
"c",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"c",
".",
"length",
";",
"i",
"++",
")",
"{",
"s",
"[",
"i",
"]",
"=",
"c",
"[",
"i",
"]",
".",
"getName",
"(",
")",
";",
"}",
"return",
"s",
";",
"}"
] | Converts an array of Class types to Class names.
@param c The array of class instances
@return An array of Class names where the element at index i in the
result is the name of the class instance at index i in the input | [
"Converts",
"an",
"array",
"of",
"Class",
"types",
"to",
"Class",
"names",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.org.apache.jasper.el/src/org/apache/el/util/ReflectionUtil.java#L121-L129 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.container.service.compat/src/com/ibm/ws/util/ObjectPool.java | ObjectPool.add | public boolean add(Object o) {
synchronized (pool) {
if (index < pool.length) {
pool[index++] = o;
// if (DEBUG && tc.isDebugEnabled() )
// Tr.debug(tc,"added to pool " + name + " at " + index);
return true;
}
}
// if (DEBUG && tc.isDebugEnabled() )
// Tr.debug(tc,"pool " + name + " is full");
return false;
} | java | public boolean add(Object o) {
synchronized (pool) {
if (index < pool.length) {
pool[index++] = o;
// if (DEBUG && tc.isDebugEnabled() )
// Tr.debug(tc,"added to pool " + name + " at " + index);
return true;
}
}
// if (DEBUG && tc.isDebugEnabled() )
// Tr.debug(tc,"pool " + name + " is full");
return false;
} | [
"public",
"boolean",
"add",
"(",
"Object",
"o",
")",
"{",
"synchronized",
"(",
"pool",
")",
"{",
"if",
"(",
"index",
"<",
"pool",
".",
"length",
")",
"{",
"pool",
"[",
"index",
"++",
"]",
"=",
"o",
";",
"// if (DEBUG && tc.isDebugEnabled() )",
"// Tr.debug(tc,\"added to pool \" + name + \" at \" + index);",
"return",
"true",
";",
"}",
"}",
"// if (DEBUG && tc.isDebugEnabled() )",
"// Tr.debug(tc,\"pool \" + name + \" is full\");",
"return",
"false",
";",
"}"
] | Returns true if the object was added back to the pool | [
"Returns",
"true",
"if",
"the",
"object",
"was",
"added",
"back",
"to",
"the",
"pool"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.container.service.compat/src/com/ibm/ws/util/ObjectPool.java#L38-L50 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/rldispatcher/ConversationReceiveListenerDataReceivedInvocation.java | ConversationReceiveListenerDataReceivedInvocation.getThreadContext | protected synchronized Dispatchable getThreadContext()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getThreadContext");
// Start D202625
// Save the position of the data
int currentPos = data.position();
int currentLimit = data.limit();
Dispatchable dis = null;
try
{
dis = listener.getThreadContext(conversation, data, segmentType);
}
catch (Throwable t)
{
FFDCFilter.processException(t, "com.ibm.ws.sib.jfapchannel.impl.rldispatcher.ConversationReceiveListenerDataReceivedInvocation.getThreadContext",
JFapChannelConstants.CRLDATARECEIVEDINVOKE_GETTHREADCONTEXT_01,
this);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "exception thrown by getThreadContext");
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.exception(this, tc, t);
// User has thrown an exception from getThreadContext method. Probably
// the best way to deal with this is to invalidate their connection.
// That'll learn 'em.
connection.invalidate(true, t, "exception thrown from getThreadContext - "+t.getMessage()); // D224570
// Throw this bad boy to indicate to the dispatcher that something has gone wrong and
// that it should abort processing this segment.
throw new SIErrorException(TraceNLS.getFormattedMessage(JFapChannelConstants.MSG_BUNDLE, "CRLDRI_INTERNAL_SICJ0065", null, "CRLDRI_INTERNAL_SICJ0065")); // D226223
}
// Make sure we re-position the data
data.position(currentPos);
data.limit(currentLimit);
// End D202625
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getThreadContext",dis);
return dis;
} | java | protected synchronized Dispatchable getThreadContext()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getThreadContext");
// Start D202625
// Save the position of the data
int currentPos = data.position();
int currentLimit = data.limit();
Dispatchable dis = null;
try
{
dis = listener.getThreadContext(conversation, data, segmentType);
}
catch (Throwable t)
{
FFDCFilter.processException(t, "com.ibm.ws.sib.jfapchannel.impl.rldispatcher.ConversationReceiveListenerDataReceivedInvocation.getThreadContext",
JFapChannelConstants.CRLDATARECEIVEDINVOKE_GETTHREADCONTEXT_01,
this);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "exception thrown by getThreadContext");
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.exception(this, tc, t);
// User has thrown an exception from getThreadContext method. Probably
// the best way to deal with this is to invalidate their connection.
// That'll learn 'em.
connection.invalidate(true, t, "exception thrown from getThreadContext - "+t.getMessage()); // D224570
// Throw this bad boy to indicate to the dispatcher that something has gone wrong and
// that it should abort processing this segment.
throw new SIErrorException(TraceNLS.getFormattedMessage(JFapChannelConstants.MSG_BUNDLE, "CRLDRI_INTERNAL_SICJ0065", null, "CRLDRI_INTERNAL_SICJ0065")); // D226223
}
// Make sure we re-position the data
data.position(currentPos);
data.limit(currentLimit);
// End D202625
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getThreadContext",dis);
return dis;
} | [
"protected",
"synchronized",
"Dispatchable",
"getThreadContext",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"getThreadContext\"",
")",
";",
"// Start D202625",
"// Save the position of the data",
"int",
"currentPos",
"=",
"data",
".",
"position",
"(",
")",
";",
"int",
"currentLimit",
"=",
"data",
".",
"limit",
"(",
")",
";",
"Dispatchable",
"dis",
"=",
"null",
";",
"try",
"{",
"dis",
"=",
"listener",
".",
"getThreadContext",
"(",
"conversation",
",",
"data",
",",
"segmentType",
")",
";",
"}",
"catch",
"(",
"Throwable",
"t",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"t",
",",
"\"com.ibm.ws.sib.jfapchannel.impl.rldispatcher.ConversationReceiveListenerDataReceivedInvocation.getThreadContext\"",
",",
"JFapChannelConstants",
".",
"CRLDATARECEIVEDINVOKE_GETTHREADCONTEXT_01",
",",
"this",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"exception thrown by getThreadContext\"",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"SibTr",
".",
"exception",
"(",
"this",
",",
"tc",
",",
"t",
")",
";",
"// User has thrown an exception from getThreadContext method. Probably",
"// the best way to deal with this is to invalidate their connection.",
"// That'll learn 'em.",
"connection",
".",
"invalidate",
"(",
"true",
",",
"t",
",",
"\"exception thrown from getThreadContext - \"",
"+",
"t",
".",
"getMessage",
"(",
")",
")",
";",
"// D224570",
"// Throw this bad boy to indicate to the dispatcher that something has gone wrong and",
"// that it should abort processing this segment.",
"throw",
"new",
"SIErrorException",
"(",
"TraceNLS",
".",
"getFormattedMessage",
"(",
"JFapChannelConstants",
".",
"MSG_BUNDLE",
",",
"\"CRLDRI_INTERNAL_SICJ0065\"",
",",
"null",
",",
"\"CRLDRI_INTERNAL_SICJ0065\"",
")",
")",
";",
"// D226223",
"}",
"// Make sure we re-position the data",
"data",
".",
"position",
"(",
"currentPos",
")",
";",
"data",
".",
"limit",
"(",
"currentLimit",
")",
";",
"// End D202625",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"getThreadContext\"",
",",
"dis",
")",
";",
"return",
"dis",
";",
"}"
] | This method will ask the receive listener for the thread context.
@return Returns any thread context that the receive listener has for this data. | [
"This",
"method",
"will",
"ask",
"the",
"receive",
"listener",
"for",
"the",
"thread",
"context",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/rldispatcher/ConversationReceiveListenerDataReceivedInvocation.java#L94-L134 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/handlers/LogRepositoryConfiguration.java | LogRepositoryConfiguration.setLogDataDirectory | public void setLogDataDirectory(String logDataDirectory) {
LogState state = ivLog.setDataDirectory(logDataDirectory);
if (state != null) {
updateLogConfiguration(state);
state.copyTo(ivLog);
}
} | java | public void setLogDataDirectory(String logDataDirectory) {
LogState state = ivLog.setDataDirectory(logDataDirectory);
if (state != null) {
updateLogConfiguration(state);
state.copyTo(ivLog);
}
} | [
"public",
"void",
"setLogDataDirectory",
"(",
"String",
"logDataDirectory",
")",
"{",
"LogState",
"state",
"=",
"ivLog",
".",
"setDataDirectory",
"(",
"logDataDirectory",
")",
";",
"if",
"(",
"state",
"!=",
"null",
")",
"{",
"updateLogConfiguration",
"(",
"state",
")",
";",
"state",
".",
"copyTo",
"(",
"ivLog",
")",
";",
"}",
"}"
] | Setters for Log Data | [
"Setters",
"for",
"Log",
"Data"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/handlers/LogRepositoryConfiguration.java#L323-L329 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/handlers/LogRepositoryConfiguration.java | LogRepositoryConfiguration.updateTraceConfiguration | private void updateTraceConfiguration(TraceState state) {
if (DIRECTORY_TYPE.equals(state.ivStorageType)) {
LogRepositoryComponent.setTraceDirectoryDestination(state.ivDataDirectory, state.ivPurgeBySizeEnabled, state.ivPurgeByTimeEnabled,
state.ivFileSwitchEnabled, state.ivBufferingEnabled, state.ivPurgeMaxSize * ONE_MEG , state.ivPurgeMinTime * MILLIS_IN_HOURS,
state.ivFileSwitchTime, state.ivOutOfSpaceAction);
} else if (MEMORYBUFFER_TYPE.equals(state.ivStorageType)) {
LogRepositoryComponent.setTraceMemoryDestination(state.ivDataDirectory, state.ivMemoryBufferSize * ONE_MEG);
} else {
throw new IllegalArgumentException("Unknown value for trace storage type: " + state.ivStorageType);
}
} | java | private void updateTraceConfiguration(TraceState state) {
if (DIRECTORY_TYPE.equals(state.ivStorageType)) {
LogRepositoryComponent.setTraceDirectoryDestination(state.ivDataDirectory, state.ivPurgeBySizeEnabled, state.ivPurgeByTimeEnabled,
state.ivFileSwitchEnabled, state.ivBufferingEnabled, state.ivPurgeMaxSize * ONE_MEG , state.ivPurgeMinTime * MILLIS_IN_HOURS,
state.ivFileSwitchTime, state.ivOutOfSpaceAction);
} else if (MEMORYBUFFER_TYPE.equals(state.ivStorageType)) {
LogRepositoryComponent.setTraceMemoryDestination(state.ivDataDirectory, state.ivMemoryBufferSize * ONE_MEG);
} else {
throw new IllegalArgumentException("Unknown value for trace storage type: " + state.ivStorageType);
}
} | [
"private",
"void",
"updateTraceConfiguration",
"(",
"TraceState",
"state",
")",
"{",
"if",
"(",
"DIRECTORY_TYPE",
".",
"equals",
"(",
"state",
".",
"ivStorageType",
")",
")",
"{",
"LogRepositoryComponent",
".",
"setTraceDirectoryDestination",
"(",
"state",
".",
"ivDataDirectory",
",",
"state",
".",
"ivPurgeBySizeEnabled",
",",
"state",
".",
"ivPurgeByTimeEnabled",
",",
"state",
".",
"ivFileSwitchEnabled",
",",
"state",
".",
"ivBufferingEnabled",
",",
"state",
".",
"ivPurgeMaxSize",
"*",
"ONE_MEG",
",",
"state",
".",
"ivPurgeMinTime",
"*",
"MILLIS_IN_HOURS",
",",
"state",
".",
"ivFileSwitchTime",
",",
"state",
".",
"ivOutOfSpaceAction",
")",
";",
"}",
"else",
"if",
"(",
"MEMORYBUFFER_TYPE",
".",
"equals",
"(",
"state",
".",
"ivStorageType",
")",
")",
"{",
"LogRepositoryComponent",
".",
"setTraceMemoryDestination",
"(",
"state",
".",
"ivDataDirectory",
",",
"state",
".",
"ivMemoryBufferSize",
"*",
"ONE_MEG",
")",
";",
"}",
"else",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Unknown value for trace storage type: \"",
"+",
"state",
".",
"ivStorageType",
")",
";",
"}",
"}"
] | update all info for Trace Repository | [
"update",
"all",
"info",
"for",
"Trace",
"Repository"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/handlers/LogRepositoryConfiguration.java#L399-L409 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/handlers/LogRepositoryConfiguration.java | LogRepositoryConfiguration.setTraceMemory | public void setTraceMemory(String dataDirectory, long memoryBufferSize) {
TraceState state = (TraceState)ivTrace.clone();
state.ivStorageType = MEMORYBUFFER_TYPE;
state.ivDataDirectory = dataDirectory;
state.ivMemoryBufferSize = memoryBufferSize;
updateTraceConfiguration(state);
state.copyTo(ivTrace);
} | java | public void setTraceMemory(String dataDirectory, long memoryBufferSize) {
TraceState state = (TraceState)ivTrace.clone();
state.ivStorageType = MEMORYBUFFER_TYPE;
state.ivDataDirectory = dataDirectory;
state.ivMemoryBufferSize = memoryBufferSize;
updateTraceConfiguration(state);
state.copyTo(ivTrace);
} | [
"public",
"void",
"setTraceMemory",
"(",
"String",
"dataDirectory",
",",
"long",
"memoryBufferSize",
")",
"{",
"TraceState",
"state",
"=",
"(",
"TraceState",
")",
"ivTrace",
".",
"clone",
"(",
")",
";",
"state",
".",
"ivStorageType",
"=",
"MEMORYBUFFER_TYPE",
";",
"state",
".",
"ivDataDirectory",
"=",
"dataDirectory",
";",
"state",
".",
"ivMemoryBufferSize",
"=",
"memoryBufferSize",
";",
"updateTraceConfiguration",
"(",
"state",
")",
";",
"state",
".",
"copyTo",
"(",
"ivTrace",
")",
";",
"}"
] | Modify the trace to use a memory buffer
@param dataDirectory directory where buffer will be dumped if requested
@param memoryBufferSize amount of memory (in Mb) to be used for this circular buffer | [
"Modify",
"the",
"trace",
"to",
"use",
"a",
"memory",
"buffer"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/handlers/LogRepositoryConfiguration.java#L436-L445 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/internal/utils/OAuthClientUtil.java | OAuthClientUtil.getWrappedServletRequestObject | private static HttpServletRequest getWrappedServletRequestObject(HttpServletRequest sr) {
if (sr instanceof HttpServletRequestWrapper) {
HttpServletRequestWrapper w = (HttpServletRequestWrapper) sr;
// make sure we drill all the way down to an
// SRTServletRequest...there
// may be multiple proxied objects
sr = (HttpServletRequest) w.getRequest();
while (sr instanceof HttpServletRequestWrapper)
sr = (HttpServletRequest) ((HttpServletRequestWrapper) sr).getRequest();
}
return sr;
} | java | private static HttpServletRequest getWrappedServletRequestObject(HttpServletRequest sr) {
if (sr instanceof HttpServletRequestWrapper) {
HttpServletRequestWrapper w = (HttpServletRequestWrapper) sr;
// make sure we drill all the way down to an
// SRTServletRequest...there
// may be multiple proxied objects
sr = (HttpServletRequest) w.getRequest();
while (sr instanceof HttpServletRequestWrapper)
sr = (HttpServletRequest) ((HttpServletRequestWrapper) sr).getRequest();
}
return sr;
} | [
"private",
"static",
"HttpServletRequest",
"getWrappedServletRequestObject",
"(",
"HttpServletRequest",
"sr",
")",
"{",
"if",
"(",
"sr",
"instanceof",
"HttpServletRequestWrapper",
")",
"{",
"HttpServletRequestWrapper",
"w",
"=",
"(",
"HttpServletRequestWrapper",
")",
"sr",
";",
"// make sure we drill all the way down to an",
"// SRTServletRequest...there",
"// may be multiple proxied objects",
"sr",
"=",
"(",
"HttpServletRequest",
")",
"w",
".",
"getRequest",
"(",
")",
";",
"while",
"(",
"sr",
"instanceof",
"HttpServletRequestWrapper",
")",
"sr",
"=",
"(",
"HttpServletRequest",
")",
"(",
"(",
"HttpServletRequestWrapper",
")",
"sr",
")",
".",
"getRequest",
"(",
")",
";",
"}",
"return",
"sr",
";",
"}"
] | Drill down through any possible HttpServletRequestWrapper objects.
@param sr
@return | [
"Drill",
"down",
"through",
"any",
"possible",
"HttpServletRequestWrapper",
"objects",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.social/src/com/ibm/ws/security/social/internal/utils/OAuthClientUtil.java#L481-L492 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/FileSharedServerLeaseLog.java | FileSharedServerLeaseLog.getFileSharedServerLeaseLog | public static FileSharedServerLeaseLog getFileSharedServerLeaseLog(String logDirStem, String localRecoveryIdentity, String recoveryGroup) {
if (tc.isEntryEnabled())
Tr.entry(tc, "FileSharedServerLeaseLog", new Object[] { logDirStem, localRecoveryIdentity, recoveryGroup });
if (_serverInstallLeaseLogDir == null)
setLeaseLog(logDirStem, localRecoveryIdentity, recoveryGroup);
if (tc.isEntryEnabled())
Tr.exit(tc, "FileSharedServerLeaseLog", _fileLeaseLog);
return _fileLeaseLog;
} | java | public static FileSharedServerLeaseLog getFileSharedServerLeaseLog(String logDirStem, String localRecoveryIdentity, String recoveryGroup) {
if (tc.isEntryEnabled())
Tr.entry(tc, "FileSharedServerLeaseLog", new Object[] { logDirStem, localRecoveryIdentity, recoveryGroup });
if (_serverInstallLeaseLogDir == null)
setLeaseLog(logDirStem, localRecoveryIdentity, recoveryGroup);
if (tc.isEntryEnabled())
Tr.exit(tc, "FileSharedServerLeaseLog", _fileLeaseLog);
return _fileLeaseLog;
} | [
"public",
"static",
"FileSharedServerLeaseLog",
"getFileSharedServerLeaseLog",
"(",
"String",
"logDirStem",
",",
"String",
"localRecoveryIdentity",
",",
"String",
"recoveryGroup",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"FileSharedServerLeaseLog\"",
",",
"new",
"Object",
"[",
"]",
"{",
"logDirStem",
",",
"localRecoveryIdentity",
",",
"recoveryGroup",
"}",
")",
";",
"if",
"(",
"_serverInstallLeaseLogDir",
"==",
"null",
")",
"setLeaseLog",
"(",
"logDirStem",
",",
"localRecoveryIdentity",
",",
"recoveryGroup",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"FileSharedServerLeaseLog\"",
",",
"_fileLeaseLog",
")",
";",
"return",
"_fileLeaseLog",
";",
"}"
] | Access the singleton instance of the FileSystem Lease log.
@return ChannelFrameworkImpl | [
"Access",
"the",
"singleton",
"instance",
"of",
"the",
"FileSystem",
"Lease",
"log",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/FileSharedServerLeaseLog.java#L106-L116 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/wsspi/ejbcontainer/JITDeploy.java | JITDeploy.parseRMICCompatible | public static int parseRMICCompatible(String options) // PM46698
{
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(tc, "parseRMICCompatible: " + options);
int flags;
if (options == null)
{
flags = RMIC_COMPATIBLE_DEFAULT;
}
else if (options.equals("none"))
{
flags = 0;
}
else if (options.isEmpty() || options.equals("all"))
{
flags = -1;
}
else
{
flags = 0;
for (String option : options.split(","))
{
if (option.equals("values"))
{
flags |= RMIC_COMPATIBLE_VALUES;
}
else if (option.equals("exceptions")) // PM94096
{
flags |= RMIC_COMPATIBLE_EXCEPTIONS;
}
else
{
throw new IllegalArgumentException("unknown RMIC compatibility option: " + option);
}
}
}
if (isTraceOn && tc.isEntryEnabled())
Tr.exit(tc, "parseRMICCompatible: " + Integer.toHexString(flags));
return flags;
} | java | public static int parseRMICCompatible(String options) // PM46698
{
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(tc, "parseRMICCompatible: " + options);
int flags;
if (options == null)
{
flags = RMIC_COMPATIBLE_DEFAULT;
}
else if (options.equals("none"))
{
flags = 0;
}
else if (options.isEmpty() || options.equals("all"))
{
flags = -1;
}
else
{
flags = 0;
for (String option : options.split(","))
{
if (option.equals("values"))
{
flags |= RMIC_COMPATIBLE_VALUES;
}
else if (option.equals("exceptions")) // PM94096
{
flags |= RMIC_COMPATIBLE_EXCEPTIONS;
}
else
{
throw new IllegalArgumentException("unknown RMIC compatibility option: " + option);
}
}
}
if (isTraceOn && tc.isEntryEnabled())
Tr.exit(tc, "parseRMICCompatible: " + Integer.toHexString(flags));
return flags;
} | [
"public",
"static",
"int",
"parseRMICCompatible",
"(",
"String",
"options",
")",
"// PM46698",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"parseRMICCompatible: \"",
"+",
"options",
")",
";",
"int",
"flags",
";",
"if",
"(",
"options",
"==",
"null",
")",
"{",
"flags",
"=",
"RMIC_COMPATIBLE_DEFAULT",
";",
"}",
"else",
"if",
"(",
"options",
".",
"equals",
"(",
"\"none\"",
")",
")",
"{",
"flags",
"=",
"0",
";",
"}",
"else",
"if",
"(",
"options",
".",
"isEmpty",
"(",
")",
"||",
"options",
".",
"equals",
"(",
"\"all\"",
")",
")",
"{",
"flags",
"=",
"-",
"1",
";",
"}",
"else",
"{",
"flags",
"=",
"0",
";",
"for",
"(",
"String",
"option",
":",
"options",
".",
"split",
"(",
"\",\"",
")",
")",
"{",
"if",
"(",
"option",
".",
"equals",
"(",
"\"values\"",
")",
")",
"{",
"flags",
"|=",
"RMIC_COMPATIBLE_VALUES",
";",
"}",
"else",
"if",
"(",
"option",
".",
"equals",
"(",
"\"exceptions\"",
")",
")",
"// PM94096",
"{",
"flags",
"|=",
"RMIC_COMPATIBLE_EXCEPTIONS",
";",
"}",
"else",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"unknown RMIC compatibility option: \"",
"+",
"option",
")",
";",
"}",
"}",
"}",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"parseRMICCompatible: \"",
"+",
"Integer",
".",
"toHexString",
"(",
"flags",
")",
")",
";",
"return",
"flags",
";",
"}"
] | Parse an rmic compatibility options string.
@param options the options string
@return the compatibility flags
@see #isRMICCompatibleValues | [
"Parse",
"an",
"rmic",
"compatibility",
"options",
"string",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/wsspi/ejbcontainer/JITDeploy.java#L83-L126 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/wsspi/ejbcontainer/JITDeploy.java | JITDeploy.registerJIT_StubClassPlugin | public static void registerJIT_StubClassPlugin(ClassLoader classloader)
{
boolean isRegistered = JIT_StubPluginImpl.register(classloader);
if (!isRegistered)
{
throw new IllegalArgumentException("Specified ClassLoader does not support JIT_StubClassPlugin : " + classloader);
}
} | java | public static void registerJIT_StubClassPlugin(ClassLoader classloader)
{
boolean isRegistered = JIT_StubPluginImpl.register(classloader);
if (!isRegistered)
{
throw new IllegalArgumentException("Specified ClassLoader does not support JIT_StubClassPlugin : " + classloader);
}
} | [
"public",
"static",
"void",
"registerJIT_StubClassPlugin",
"(",
"ClassLoader",
"classloader",
")",
"{",
"boolean",
"isRegistered",
"=",
"JIT_StubPluginImpl",
".",
"register",
"(",
"classloader",
")",
";",
"if",
"(",
"!",
"isRegistered",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Specified ClassLoader does not support JIT_StubClassPlugin : \"",
"+",
"classloader",
")",
";",
"}",
"}"
] | F1339-8988 | [
"F1339",
"-",
"8988"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/wsspi/ejbcontainer/JITDeploy.java#L255-L263 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.event/src/com/ibm/ws/event/internal/TopicBasedCache.java | TopicBasedCache.setStageTopics | synchronized void setStageTopics(String stageName, String[] topics) {
for (String t : topics) {
if (t.equals("*")) {
wildcardStageTopics.put("", stageName);
} else if (t.endsWith("/*")) {
wildcardStageTopics.put(t.substring(0, t.length() - 1), stageName);
} else {
discreteStageTopics.put(t, stageName);
}
}
// Clear the cache since it's no longer up to date
clearTopicDataCache();
} | java | synchronized void setStageTopics(String stageName, String[] topics) {
for (String t : topics) {
if (t.equals("*")) {
wildcardStageTopics.put("", stageName);
} else if (t.endsWith("/*")) {
wildcardStageTopics.put(t.substring(0, t.length() - 1), stageName);
} else {
discreteStageTopics.put(t, stageName);
}
}
// Clear the cache since it's no longer up to date
clearTopicDataCache();
} | [
"synchronized",
"void",
"setStageTopics",
"(",
"String",
"stageName",
",",
"String",
"[",
"]",
"topics",
")",
"{",
"for",
"(",
"String",
"t",
":",
"topics",
")",
"{",
"if",
"(",
"t",
".",
"equals",
"(",
"\"*\"",
")",
")",
"{",
"wildcardStageTopics",
".",
"put",
"(",
"\"\"",
",",
"stageName",
")",
";",
"}",
"else",
"if",
"(",
"t",
".",
"endsWith",
"(",
"\"/*\"",
")",
")",
"{",
"wildcardStageTopics",
".",
"put",
"(",
"t",
".",
"substring",
"(",
"0",
",",
"t",
".",
"length",
"(",
")",
"-",
"1",
")",
",",
"stageName",
")",
";",
"}",
"else",
"{",
"discreteStageTopics",
".",
"put",
"(",
"t",
",",
"stageName",
")",
";",
"}",
"}",
"// Clear the cache since it's no longer up to date",
"clearTopicDataCache",
"(",
")",
";",
"}"
] | Set the list of topics to be associated with the specified work stage.
@param stageName
the work stage name
@param topics
the topics associated with the work stage | [
"Set",
"the",
"list",
"of",
"topics",
"to",
"be",
"associated",
"with",
"the",
"specified",
"work",
"stage",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.event/src/com/ibm/ws/event/internal/TopicBasedCache.java#L95-L108 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.event/src/com/ibm/ws/event/internal/TopicBasedCache.java | TopicBasedCache.getTopicData | TopicData getTopicData(Topic topic, String topicName) {
TopicData topicData = null;
if (topic != null) {
topicData = topic.getTopicData();
}
if (topicData == null) {
topicData = topicDataCache.get(topicName);
if (topic != null && topicData != null) {
topic.setTopicDataReference(topicData.getReference());
}
}
if (topicData == null) {
synchronized (this) {
topicData = buildTopicData(topicName);
if (topic != null) {
topic.setTopicDataReference(topicData.getReference());
}
}
}
return topicData;
} | java | TopicData getTopicData(Topic topic, String topicName) {
TopicData topicData = null;
if (topic != null) {
topicData = topic.getTopicData();
}
if (topicData == null) {
topicData = topicDataCache.get(topicName);
if (topic != null && topicData != null) {
topic.setTopicDataReference(topicData.getReference());
}
}
if (topicData == null) {
synchronized (this) {
topicData = buildTopicData(topicName);
if (topic != null) {
topic.setTopicDataReference(topicData.getReference());
}
}
}
return topicData;
} | [
"TopicData",
"getTopicData",
"(",
"Topic",
"topic",
",",
"String",
"topicName",
")",
"{",
"TopicData",
"topicData",
"=",
"null",
";",
"if",
"(",
"topic",
"!=",
"null",
")",
"{",
"topicData",
"=",
"topic",
".",
"getTopicData",
"(",
")",
";",
"}",
"if",
"(",
"topicData",
"==",
"null",
")",
"{",
"topicData",
"=",
"topicDataCache",
".",
"get",
"(",
"topicName",
")",
";",
"if",
"(",
"topic",
"!=",
"null",
"&&",
"topicData",
"!=",
"null",
")",
"{",
"topic",
".",
"setTopicDataReference",
"(",
"topicData",
".",
"getReference",
"(",
")",
")",
";",
"}",
"}",
"if",
"(",
"topicData",
"==",
"null",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"topicData",
"=",
"buildTopicData",
"(",
"topicName",
")",
";",
"if",
"(",
"topic",
"!=",
"null",
")",
"{",
"topic",
".",
"setTopicDataReference",
"(",
"topicData",
".",
"getReference",
"(",
")",
")",
";",
"}",
"}",
"}",
"return",
"topicData",
";",
"}"
] | Get the cached information about the specified topic. The cached data
will allow us to avoid the expense of finding various and sundry data
associated with a specific topic and topic hierarchies.
@param topic
the topic associated with an event
@param topicName
the topic name associated with an event
@return the cached information | [
"Get",
"the",
"cached",
"information",
"about",
"the",
"specified",
"topic",
".",
"The",
"cached",
"data",
"will",
"allow",
"us",
"to",
"avoid",
"the",
"expense",
"of",
"finding",
"various",
"and",
"sundry",
"data",
"associated",
"with",
"a",
"specific",
"topic",
"and",
"topic",
"hierarchies",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.event/src/com/ibm/ws/event/internal/TopicBasedCache.java#L233-L257 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/tcpchannel/internal/AccessLists.java | AccessLists.accessDenied | public boolean accessDenied(InetAddress remoteAddr) {
String hostname = null; //F184719
// check the inclusion lists first to see if the client matches
if (includeAccess.getActive() || includeAccessNames.getActive()) {
boolean closeSocket = true;
if (includeAccess.getActive()) {
if (remoteAddr instanceof Inet6Address) {
if (includeAccess.findInList6(remoteAddr.getAddress())) {
closeSocket = false;
}
} else {
if (includeAccess.findInList(remoteAddr.getAddress())) {
closeSocket = false;
}
}
}
if (closeSocket && includeAccessNames.getActive()) {
// look at hostnames to check inclusion
hostname = remoteAddr.getHostName();
if (caseInsensitiveHostnames && (hostname != null)) {
hostname = hostname.toLowerCase();
}
if (includeAccessNames.findInList(hostname)) {
closeSocket = false;
}
}
if (closeSocket) {
// close the excluded socket connection
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
Tr.event(tc, "Address and host name not in include list, address: " + remoteAddr.getHostAddress() + " host name: " + remoteAddr.getHostName());
return true;
}
}
if (excludeAccess.getActive() || excludeAccessNames.getActive()) {
boolean closeSocket = false;
if (excludeAccess.getActive()) {
if (remoteAddr instanceof Inet6Address) {
if (excludeAccess.findInList6(remoteAddr.getAddress())) {
// close the excluded socket connection
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
Tr.event(tc, "Address (IPv6) in exclude list, address: " + remoteAddr.getHostAddress());
return true;
}
} else {
if (excludeAccess.findInList(remoteAddr.getAddress())) {
// close the excluded socket connection
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
Tr.event(tc, "Address in exclude list, address: " + remoteAddr.getHostAddress());
return true;
}
}
}
if (closeSocket == false && excludeAccessNames.getActive()) {
// look at hostnames to check exclusion
hostname = remoteAddr.getHostName();
if (caseInsensitiveHostnames && (hostname != null)) {
hostname = hostname.toLowerCase();
}
if (excludeAccessNames.findInList(hostname)) {
// close the excluded socket connection
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
Tr.event(tc, "Host name in exclude list, host name: " + remoteAddr.getHostName());
return true;
}
}
} // end if(there are excludes to check)
return false;
} | java | public boolean accessDenied(InetAddress remoteAddr) {
String hostname = null; //F184719
// check the inclusion lists first to see if the client matches
if (includeAccess.getActive() || includeAccessNames.getActive()) {
boolean closeSocket = true;
if (includeAccess.getActive()) {
if (remoteAddr instanceof Inet6Address) {
if (includeAccess.findInList6(remoteAddr.getAddress())) {
closeSocket = false;
}
} else {
if (includeAccess.findInList(remoteAddr.getAddress())) {
closeSocket = false;
}
}
}
if (closeSocket && includeAccessNames.getActive()) {
// look at hostnames to check inclusion
hostname = remoteAddr.getHostName();
if (caseInsensitiveHostnames && (hostname != null)) {
hostname = hostname.toLowerCase();
}
if (includeAccessNames.findInList(hostname)) {
closeSocket = false;
}
}
if (closeSocket) {
// close the excluded socket connection
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
Tr.event(tc, "Address and host name not in include list, address: " + remoteAddr.getHostAddress() + " host name: " + remoteAddr.getHostName());
return true;
}
}
if (excludeAccess.getActive() || excludeAccessNames.getActive()) {
boolean closeSocket = false;
if (excludeAccess.getActive()) {
if (remoteAddr instanceof Inet6Address) {
if (excludeAccess.findInList6(remoteAddr.getAddress())) {
// close the excluded socket connection
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
Tr.event(tc, "Address (IPv6) in exclude list, address: " + remoteAddr.getHostAddress());
return true;
}
} else {
if (excludeAccess.findInList(remoteAddr.getAddress())) {
// close the excluded socket connection
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
Tr.event(tc, "Address in exclude list, address: " + remoteAddr.getHostAddress());
return true;
}
}
}
if (closeSocket == false && excludeAccessNames.getActive()) {
// look at hostnames to check exclusion
hostname = remoteAddr.getHostName();
if (caseInsensitiveHostnames && (hostname != null)) {
hostname = hostname.toLowerCase();
}
if (excludeAccessNames.findInList(hostname)) {
// close the excluded socket connection
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
Tr.event(tc, "Host name in exclude list, host name: " + remoteAddr.getHostName());
return true;
}
}
} // end if(there are excludes to check)
return false;
} | [
"public",
"boolean",
"accessDenied",
"(",
"InetAddress",
"remoteAddr",
")",
"{",
"String",
"hostname",
"=",
"null",
";",
"//F184719",
"// check the inclusion lists first to see if the client matches",
"if",
"(",
"includeAccess",
".",
"getActive",
"(",
")",
"||",
"includeAccessNames",
".",
"getActive",
"(",
")",
")",
"{",
"boolean",
"closeSocket",
"=",
"true",
";",
"if",
"(",
"includeAccess",
".",
"getActive",
"(",
")",
")",
"{",
"if",
"(",
"remoteAddr",
"instanceof",
"Inet6Address",
")",
"{",
"if",
"(",
"includeAccess",
".",
"findInList6",
"(",
"remoteAddr",
".",
"getAddress",
"(",
")",
")",
")",
"{",
"closeSocket",
"=",
"false",
";",
"}",
"}",
"else",
"{",
"if",
"(",
"includeAccess",
".",
"findInList",
"(",
"remoteAddr",
".",
"getAddress",
"(",
")",
")",
")",
"{",
"closeSocket",
"=",
"false",
";",
"}",
"}",
"}",
"if",
"(",
"closeSocket",
"&&",
"includeAccessNames",
".",
"getActive",
"(",
")",
")",
"{",
"// look at hostnames to check inclusion",
"hostname",
"=",
"remoteAddr",
".",
"getHostName",
"(",
")",
";",
"if",
"(",
"caseInsensitiveHostnames",
"&&",
"(",
"hostname",
"!=",
"null",
")",
")",
"{",
"hostname",
"=",
"hostname",
".",
"toLowerCase",
"(",
")",
";",
"}",
"if",
"(",
"includeAccessNames",
".",
"findInList",
"(",
"hostname",
")",
")",
"{",
"closeSocket",
"=",
"false",
";",
"}",
"}",
"if",
"(",
"closeSocket",
")",
"{",
"// close the excluded socket connection",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"Address and host name not in include list, address: \"",
"+",
"remoteAddr",
".",
"getHostAddress",
"(",
")",
"+",
"\" host name: \"",
"+",
"remoteAddr",
".",
"getHostName",
"(",
")",
")",
";",
"return",
"true",
";",
"}",
"}",
"if",
"(",
"excludeAccess",
".",
"getActive",
"(",
")",
"||",
"excludeAccessNames",
".",
"getActive",
"(",
")",
")",
"{",
"boolean",
"closeSocket",
"=",
"false",
";",
"if",
"(",
"excludeAccess",
".",
"getActive",
"(",
")",
")",
"{",
"if",
"(",
"remoteAddr",
"instanceof",
"Inet6Address",
")",
"{",
"if",
"(",
"excludeAccess",
".",
"findInList6",
"(",
"remoteAddr",
".",
"getAddress",
"(",
")",
")",
")",
"{",
"// close the excluded socket connection",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"Address (IPv6) in exclude list, address: \"",
"+",
"remoteAddr",
".",
"getHostAddress",
"(",
")",
")",
";",
"return",
"true",
";",
"}",
"}",
"else",
"{",
"if",
"(",
"excludeAccess",
".",
"findInList",
"(",
"remoteAddr",
".",
"getAddress",
"(",
")",
")",
")",
"{",
"// close the excluded socket connection",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"Address in exclude list, address: \"",
"+",
"remoteAddr",
".",
"getHostAddress",
"(",
")",
")",
";",
"return",
"true",
";",
"}",
"}",
"}",
"if",
"(",
"closeSocket",
"==",
"false",
"&&",
"excludeAccessNames",
".",
"getActive",
"(",
")",
")",
"{",
"// look at hostnames to check exclusion",
"hostname",
"=",
"remoteAddr",
".",
"getHostName",
"(",
")",
";",
"if",
"(",
"caseInsensitiveHostnames",
"&&",
"(",
"hostname",
"!=",
"null",
")",
")",
"{",
"hostname",
"=",
"hostname",
".",
"toLowerCase",
"(",
")",
";",
"}",
"if",
"(",
"excludeAccessNames",
".",
"findInList",
"(",
"hostname",
")",
")",
"{",
"// close the excluded socket connection",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"Host name in exclude list, host name: \"",
"+",
"remoteAddr",
".",
"getHostName",
"(",
")",
")",
";",
"return",
"true",
";",
"}",
"}",
"}",
"// end if(there are excludes to check)",
"return",
"false",
";",
"}"
] | Query whether a given client address is denied by this configuration.
@param remoteAddr
@return boolean | [
"Query",
"whether",
"a",
"given",
"client",
"address",
"is",
"denied",
"by",
"this",
"configuration",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/tcpchannel/internal/AccessLists.java#L112-L191 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPInputHandler.java | PtoPInputHandler.eventPrecommitAdd | final protected void eventPrecommitAdd(MessageItem msg, final TransactionCommon transaction) throws SIDiscriminatorSyntaxException, SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "eventPrecommitAdd", new Object[] { msg, transaction });
if (!(_destination.isToBeDeleted()))
{
if (msg.isTransacted() && (!(msg.isToBeStoredAtSendTime())))
{
// LockR the destination to prevent reallocation from occurring on the chosen localisation
LockManager reallocationLock = _destination.getReallocationLockManager();
reallocationLock.lock();
try
{
// If we fixed the ME it'll be in the routing address in the message
SIBUuid8 fixedME = null;
JsDestinationAddress routingAddr = msg.getMessage().getRoutingDestination();
if (routingAddr != null)
fixedME = routingAddr.getME();
// If the sender prefers any local ME over others then we'll give it a go
SIBUuid8 preferredME = null;
if (msg.preferLocal())
{
if (_destination.hasLocal())
preferredME = _messageProcessor.getMessagingEngineUuid();
}
// 176658.3.5
OutputHandler handler = _destination.choosePtoPOutputHandler(fixedME,
preferredME,
!msg.isFromRemoteME(),
msg.isForcePut(),
null);
if (handler == null)
{
// We can't find a suitable localisation.
// Although a queue must have at least one localisation this is
// possible if the sender restricted the potential localisations
// using a fixed ME or a scoping alias (to an out-of-date set of
// localisation)
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
SibTr.debug(tc, "No suitable OutputHandler found for " + _destination.getName() + " (" + fixedME + ")");
}
//Put the message to the exception destination.
handleUndeliverableMessage(_destination
, null // null LinkHandler
, msg
, SIRCConstants.SIRC0026_NO_LOCALISATIONS_FOUND_ERROR
, new String[] { _destination.getName() }
, transaction);
}
else
{
//Indicate in the message if this was a guess
msg.setStreamIsGuess(handler.isWLMGuess());
// put the message to the output handler
handler.put(msg, transaction, null, true);
}
} finally
{
// unlock the reallocation lock
reallocationLock.unlock();
}
}
}
else
{
//The destination has been deleted. Put the message to the exception destination#
ExceptionDestinationHandlerImpl exceptionDestinationHandlerImpl =
(ExceptionDestinationHandlerImpl) _messageProcessor.createExceptionDestinationHandler(null);
//Set indicator to send the message to the exception destination immediately,
//rather than registering it for pre-prepare of the transaction, as this is
//pre-prepare of the transaction!
msg.setStoreAtSendTime(true);
String destName = _destination.getName();
if (_destination.isLink())
destName = ((LinkHandler) _destination).getBusName();
final UndeliverableReturnCode rc =
exceptionDestinationHandlerImpl.handleUndeliverableMessage(msg
, transaction
, SIRCConstants.SIRC0032_DESTINATION_DELETED_ERROR
, new String[] { destName,
_messageProcessor.getMessagingEngineName() });
if (rc != UndeliverableReturnCode.OK)
{
if (rc == UndeliverableReturnCode.DISCARD)
{
//The message is to be discarded. Do nothing and it will disappear.
}
else
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "eventPrecommitAdd", "WsRuntimeException");
//We cannot put the message to the exception destination. All we can
//do in this case is rollback the users transaction. This is done by
//throwing an exception that is caught by the transaction manager.
throw new WsRuntimeException(
nls.getFormattedMessage(
"DESTINATION_DELETED_ERROR_CWSIP0247",
new Object[] { _destination.getName(),
rc },
null));
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "eventPrecommitAdd");
} | java | final protected void eventPrecommitAdd(MessageItem msg, final TransactionCommon transaction) throws SIDiscriminatorSyntaxException, SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "eventPrecommitAdd", new Object[] { msg, transaction });
if (!(_destination.isToBeDeleted()))
{
if (msg.isTransacted() && (!(msg.isToBeStoredAtSendTime())))
{
// LockR the destination to prevent reallocation from occurring on the chosen localisation
LockManager reallocationLock = _destination.getReallocationLockManager();
reallocationLock.lock();
try
{
// If we fixed the ME it'll be in the routing address in the message
SIBUuid8 fixedME = null;
JsDestinationAddress routingAddr = msg.getMessage().getRoutingDestination();
if (routingAddr != null)
fixedME = routingAddr.getME();
// If the sender prefers any local ME over others then we'll give it a go
SIBUuid8 preferredME = null;
if (msg.preferLocal())
{
if (_destination.hasLocal())
preferredME = _messageProcessor.getMessagingEngineUuid();
}
// 176658.3.5
OutputHandler handler = _destination.choosePtoPOutputHandler(fixedME,
preferredME,
!msg.isFromRemoteME(),
msg.isForcePut(),
null);
if (handler == null)
{
// We can't find a suitable localisation.
// Although a queue must have at least one localisation this is
// possible if the sender restricted the potential localisations
// using a fixed ME or a scoping alias (to an out-of-date set of
// localisation)
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
SibTr.debug(tc, "No suitable OutputHandler found for " + _destination.getName() + " (" + fixedME + ")");
}
//Put the message to the exception destination.
handleUndeliverableMessage(_destination
, null // null LinkHandler
, msg
, SIRCConstants.SIRC0026_NO_LOCALISATIONS_FOUND_ERROR
, new String[] { _destination.getName() }
, transaction);
}
else
{
//Indicate in the message if this was a guess
msg.setStreamIsGuess(handler.isWLMGuess());
// put the message to the output handler
handler.put(msg, transaction, null, true);
}
} finally
{
// unlock the reallocation lock
reallocationLock.unlock();
}
}
}
else
{
//The destination has been deleted. Put the message to the exception destination#
ExceptionDestinationHandlerImpl exceptionDestinationHandlerImpl =
(ExceptionDestinationHandlerImpl) _messageProcessor.createExceptionDestinationHandler(null);
//Set indicator to send the message to the exception destination immediately,
//rather than registering it for pre-prepare of the transaction, as this is
//pre-prepare of the transaction!
msg.setStoreAtSendTime(true);
String destName = _destination.getName();
if (_destination.isLink())
destName = ((LinkHandler) _destination).getBusName();
final UndeliverableReturnCode rc =
exceptionDestinationHandlerImpl.handleUndeliverableMessage(msg
, transaction
, SIRCConstants.SIRC0032_DESTINATION_DELETED_ERROR
, new String[] { destName,
_messageProcessor.getMessagingEngineName() });
if (rc != UndeliverableReturnCode.OK)
{
if (rc == UndeliverableReturnCode.DISCARD)
{
//The message is to be discarded. Do nothing and it will disappear.
}
else
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "eventPrecommitAdd", "WsRuntimeException");
//We cannot put the message to the exception destination. All we can
//do in this case is rollback the users transaction. This is done by
//throwing an exception that is caught by the transaction manager.
throw new WsRuntimeException(
nls.getFormattedMessage(
"DESTINATION_DELETED_ERROR_CWSIP0247",
new Object[] { _destination.getName(),
rc },
null));
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "eventPrecommitAdd");
} | [
"final",
"protected",
"void",
"eventPrecommitAdd",
"(",
"MessageItem",
"msg",
",",
"final",
"TransactionCommon",
"transaction",
")",
"throws",
"SIDiscriminatorSyntaxException",
",",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"eventPrecommitAdd\"",
",",
"new",
"Object",
"[",
"]",
"{",
"msg",
",",
"transaction",
"}",
")",
";",
"if",
"(",
"!",
"(",
"_destination",
".",
"isToBeDeleted",
"(",
")",
")",
")",
"{",
"if",
"(",
"msg",
".",
"isTransacted",
"(",
")",
"&&",
"(",
"!",
"(",
"msg",
".",
"isToBeStoredAtSendTime",
"(",
")",
")",
")",
")",
"{",
"// LockR the destination to prevent reallocation from occurring on the chosen localisation",
"LockManager",
"reallocationLock",
"=",
"_destination",
".",
"getReallocationLockManager",
"(",
")",
";",
"reallocationLock",
".",
"lock",
"(",
")",
";",
"try",
"{",
"// If we fixed the ME it'll be in the routing address in the message",
"SIBUuid8",
"fixedME",
"=",
"null",
";",
"JsDestinationAddress",
"routingAddr",
"=",
"msg",
".",
"getMessage",
"(",
")",
".",
"getRoutingDestination",
"(",
")",
";",
"if",
"(",
"routingAddr",
"!=",
"null",
")",
"fixedME",
"=",
"routingAddr",
".",
"getME",
"(",
")",
";",
"// If the sender prefers any local ME over others then we'll give it a go",
"SIBUuid8",
"preferredME",
"=",
"null",
";",
"if",
"(",
"msg",
".",
"preferLocal",
"(",
")",
")",
"{",
"if",
"(",
"_destination",
".",
"hasLocal",
"(",
")",
")",
"preferredME",
"=",
"_messageProcessor",
".",
"getMessagingEngineUuid",
"(",
")",
";",
"}",
"// 176658.3.5",
"OutputHandler",
"handler",
"=",
"_destination",
".",
"choosePtoPOutputHandler",
"(",
"fixedME",
",",
"preferredME",
",",
"!",
"msg",
".",
"isFromRemoteME",
"(",
")",
",",
"msg",
".",
"isForcePut",
"(",
")",
",",
"null",
")",
";",
"if",
"(",
"handler",
"==",
"null",
")",
"{",
"// We can't find a suitable localisation.",
"// Although a queue must have at least one localisation this is",
"// possible if the sender restricted the potential localisations",
"// using a fixed ME or a scoping alias (to an out-of-date set of",
"// localisation)",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"No suitable OutputHandler found for \"",
"+",
"_destination",
".",
"getName",
"(",
")",
"+",
"\" (\"",
"+",
"fixedME",
"+",
"\")\"",
")",
";",
"}",
"//Put the message to the exception destination.",
"handleUndeliverableMessage",
"(",
"_destination",
",",
"null",
"// null LinkHandler",
",",
"msg",
",",
"SIRCConstants",
".",
"SIRC0026_NO_LOCALISATIONS_FOUND_ERROR",
",",
"new",
"String",
"[",
"]",
"{",
"_destination",
".",
"getName",
"(",
")",
"}",
",",
"transaction",
")",
";",
"}",
"else",
"{",
"//Indicate in the message if this was a guess",
"msg",
".",
"setStreamIsGuess",
"(",
"handler",
".",
"isWLMGuess",
"(",
")",
")",
";",
"// put the message to the output handler",
"handler",
".",
"put",
"(",
"msg",
",",
"transaction",
",",
"null",
",",
"true",
")",
";",
"}",
"}",
"finally",
"{",
"// unlock the reallocation lock",
"reallocationLock",
".",
"unlock",
"(",
")",
";",
"}",
"}",
"}",
"else",
"{",
"//The destination has been deleted. Put the message to the exception destination#",
"ExceptionDestinationHandlerImpl",
"exceptionDestinationHandlerImpl",
"=",
"(",
"ExceptionDestinationHandlerImpl",
")",
"_messageProcessor",
".",
"createExceptionDestinationHandler",
"(",
"null",
")",
";",
"//Set indicator to send the message to the exception destination immediately,",
"//rather than registering it for pre-prepare of the transaction, as this is",
"//pre-prepare of the transaction!",
"msg",
".",
"setStoreAtSendTime",
"(",
"true",
")",
";",
"String",
"destName",
"=",
"_destination",
".",
"getName",
"(",
")",
";",
"if",
"(",
"_destination",
".",
"isLink",
"(",
")",
")",
"destName",
"=",
"(",
"(",
"LinkHandler",
")",
"_destination",
")",
".",
"getBusName",
"(",
")",
";",
"final",
"UndeliverableReturnCode",
"rc",
"=",
"exceptionDestinationHandlerImpl",
".",
"handleUndeliverableMessage",
"(",
"msg",
",",
"transaction",
",",
"SIRCConstants",
".",
"SIRC0032_DESTINATION_DELETED_ERROR",
",",
"new",
"String",
"[",
"]",
"{",
"destName",
",",
"_messageProcessor",
".",
"getMessagingEngineName",
"(",
")",
"}",
")",
";",
"if",
"(",
"rc",
"!=",
"UndeliverableReturnCode",
".",
"OK",
")",
"{",
"if",
"(",
"rc",
"==",
"UndeliverableReturnCode",
".",
"DISCARD",
")",
"{",
"//The message is to be discarded. Do nothing and it will disappear.",
"}",
"else",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"eventPrecommitAdd\"",
",",
"\"WsRuntimeException\"",
")",
";",
"//We cannot put the message to the exception destination. All we can",
"//do in this case is rollback the users transaction. This is done by",
"//throwing an exception that is caught by the transaction manager.",
"throw",
"new",
"WsRuntimeException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"DESTINATION_DELETED_ERROR_CWSIP0247\"",
",",
"new",
"Object",
"[",
"]",
"{",
"_destination",
".",
"getName",
"(",
")",
",",
"rc",
"}",
",",
"null",
")",
")",
";",
"}",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"eventPrecommitAdd\"",
")",
";",
"}"
] | Method eventPrecommitAdd.
@param msg
@param transaction
@throws SIStoreException
@throws SIResourceException | [
"Method",
"eventPrecommitAdd",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPInputHandler.java#L1129-L1245 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPInputHandler.java | PtoPInputHandler.sendAckMessage | @Override
public void sendAckMessage(SIBUuid8 sourceMEUuid,
SIBUuid12 destUuid,
SIBUuid8 busUuid,
long ackPrefix,
int priority,
Reliability reliability,
SIBUuid12 stream,
boolean consolidate) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "sendAckMessage", new Long(ackPrefix));
ControlAck ackMsg = createControlAckMessage();
// As we are using the Guaranteed Header - set all the attributes as
// well as the ones we want.
SIMPUtils.setGuaranteedDeliveryProperties(ackMsg,
_messageProcessor.getMessagingEngineUuid(),
sourceMEUuid,
stream,
null,
destUuid,
ProtocolType.UNICASTOUTPUT,
GDConfig.PROTOCOL_VERSION);
ackMsg.setPriority(priority);
ackMsg.setReliability(reliability);
ackMsg.setAckPrefix(ackPrefix);
// Send Ack messages at the priority of the original message +1
sendToME(ackMsg, sourceMEUuid, busUuid, priority + 1);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "sendAckMessage");
} | java | @Override
public void sendAckMessage(SIBUuid8 sourceMEUuid,
SIBUuid12 destUuid,
SIBUuid8 busUuid,
long ackPrefix,
int priority,
Reliability reliability,
SIBUuid12 stream,
boolean consolidate) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "sendAckMessage", new Long(ackPrefix));
ControlAck ackMsg = createControlAckMessage();
// As we are using the Guaranteed Header - set all the attributes as
// well as the ones we want.
SIMPUtils.setGuaranteedDeliveryProperties(ackMsg,
_messageProcessor.getMessagingEngineUuid(),
sourceMEUuid,
stream,
null,
destUuid,
ProtocolType.UNICASTOUTPUT,
GDConfig.PROTOCOL_VERSION);
ackMsg.setPriority(priority);
ackMsg.setReliability(reliability);
ackMsg.setAckPrefix(ackPrefix);
// Send Ack messages at the priority of the original message +1
sendToME(ackMsg, sourceMEUuid, busUuid, priority + 1);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "sendAckMessage");
} | [
"@",
"Override",
"public",
"void",
"sendAckMessage",
"(",
"SIBUuid8",
"sourceMEUuid",
",",
"SIBUuid12",
"destUuid",
",",
"SIBUuid8",
"busUuid",
",",
"long",
"ackPrefix",
",",
"int",
"priority",
",",
"Reliability",
"reliability",
",",
"SIBUuid12",
"stream",
",",
"boolean",
"consolidate",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"sendAckMessage\"",
",",
"new",
"Long",
"(",
"ackPrefix",
")",
")",
";",
"ControlAck",
"ackMsg",
"=",
"createControlAckMessage",
"(",
")",
";",
"// As we are using the Guaranteed Header - set all the attributes as",
"// well as the ones we want.",
"SIMPUtils",
".",
"setGuaranteedDeliveryProperties",
"(",
"ackMsg",
",",
"_messageProcessor",
".",
"getMessagingEngineUuid",
"(",
")",
",",
"sourceMEUuid",
",",
"stream",
",",
"null",
",",
"destUuid",
",",
"ProtocolType",
".",
"UNICASTOUTPUT",
",",
"GDConfig",
".",
"PROTOCOL_VERSION",
")",
";",
"ackMsg",
".",
"setPriority",
"(",
"priority",
")",
";",
"ackMsg",
".",
"setReliability",
"(",
"reliability",
")",
";",
"ackMsg",
".",
"setAckPrefix",
"(",
"ackPrefix",
")",
";",
"// Send Ack messages at the priority of the original message +1",
"sendToME",
"(",
"ackMsg",
",",
"sourceMEUuid",
",",
"busUuid",
",",
"priority",
"+",
"1",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"sendAckMessage\"",
")",
";",
"}"
] | sendAckMessage is called from preCommitCallback after
the message has been delivered to the final destination | [
"sendAckMessage",
"is",
"called",
"from",
"preCommitCallback",
"after",
"the",
"message",
"has",
"been",
"delivered",
"to",
"the",
"final",
"destination"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPInputHandler.java#L1293-L1330 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPInputHandler.java | PtoPInputHandler.sendNackMessage | @Override
public void sendNackMessage(SIBUuid8 sourceMEUuid,
SIBUuid12 destUuid,
SIBUuid8 busUuid,
long startTick,
long endTick,
int priority,
Reliability reliability,
SIBUuid12 stream)
throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"sendNackMessage",
new Object[] { new Long(startTick), new Long(endTick) });
ControlNack nackMsg = createControlNackMessage();
// As we are using the Guaranteed Header - set all the attributes as
// well as the ones we want.
SIMPUtils.setGuaranteedDeliveryProperties(nackMsg,
_messageProcessor.getMessagingEngineUuid(),
sourceMEUuid,
stream,
null,
destUuid,
ProtocolType.UNICASTOUTPUT,
GDConfig.PROTOCOL_VERSION);
nackMsg.setPriority(priority);
nackMsg.setReliability(reliability);
nackMsg.setStartTick(startTick);
nackMsg.setEndTick(endTick);
// Send Nack messages at original message priority +2
sendToME(nackMsg, sourceMEUuid, busUuid, priority + 2);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "sendNackMessage ");
} | java | @Override
public void sendNackMessage(SIBUuid8 sourceMEUuid,
SIBUuid12 destUuid,
SIBUuid8 busUuid,
long startTick,
long endTick,
int priority,
Reliability reliability,
SIBUuid12 stream)
throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"sendNackMessage",
new Object[] { new Long(startTick), new Long(endTick) });
ControlNack nackMsg = createControlNackMessage();
// As we are using the Guaranteed Header - set all the attributes as
// well as the ones we want.
SIMPUtils.setGuaranteedDeliveryProperties(nackMsg,
_messageProcessor.getMessagingEngineUuid(),
sourceMEUuid,
stream,
null,
destUuid,
ProtocolType.UNICASTOUTPUT,
GDConfig.PROTOCOL_VERSION);
nackMsg.setPriority(priority);
nackMsg.setReliability(reliability);
nackMsg.setStartTick(startTick);
nackMsg.setEndTick(endTick);
// Send Nack messages at original message priority +2
sendToME(nackMsg, sourceMEUuid, busUuid, priority + 2);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "sendNackMessage ");
} | [
"@",
"Override",
"public",
"void",
"sendNackMessage",
"(",
"SIBUuid8",
"sourceMEUuid",
",",
"SIBUuid12",
"destUuid",
",",
"SIBUuid8",
"busUuid",
",",
"long",
"startTick",
",",
"long",
"endTick",
",",
"int",
"priority",
",",
"Reliability",
"reliability",
",",
"SIBUuid12",
"stream",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"sendNackMessage\"",
",",
"new",
"Object",
"[",
"]",
"{",
"new",
"Long",
"(",
"startTick",
")",
",",
"new",
"Long",
"(",
"endTick",
")",
"}",
")",
";",
"ControlNack",
"nackMsg",
"=",
"createControlNackMessage",
"(",
")",
";",
"// As we are using the Guaranteed Header - set all the attributes as",
"// well as the ones we want.",
"SIMPUtils",
".",
"setGuaranteedDeliveryProperties",
"(",
"nackMsg",
",",
"_messageProcessor",
".",
"getMessagingEngineUuid",
"(",
")",
",",
"sourceMEUuid",
",",
"stream",
",",
"null",
",",
"destUuid",
",",
"ProtocolType",
".",
"UNICASTOUTPUT",
",",
"GDConfig",
".",
"PROTOCOL_VERSION",
")",
";",
"nackMsg",
".",
"setPriority",
"(",
"priority",
")",
";",
"nackMsg",
".",
"setReliability",
"(",
"reliability",
")",
";",
"nackMsg",
".",
"setStartTick",
"(",
"startTick",
")",
";",
"nackMsg",
".",
"setEndTick",
"(",
"endTick",
")",
";",
"// Send Nack messages at original message priority +2",
"sendToME",
"(",
"nackMsg",
",",
"sourceMEUuid",
",",
"busUuid",
",",
"priority",
"+",
"2",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"sendNackMessage \"",
")",
";",
"}"
] | Sends a Nack message back to the originating ME | [
"Sends",
"a",
"Nack",
"message",
"back",
"to",
"the",
"originating",
"ME"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPInputHandler.java#L1335-L1377 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPInputHandler.java | PtoPInputHandler.createControlNackMessage | private ControlNack createControlNackMessage()
throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "createControlNackMessage");
ControlNack nackMsg = null;
// Create new NackMessage
try
{
nackMsg = _cmf.createNewControlNack();
} catch (MessageCreateFailedException e)
{
// FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.PtoPInputHandler.createControlNackMessage",
"1:1604:1.323",
this);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.exception(tc, e);
SibTr.exit(tc, "createControlNackMessage", e);
}
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.impl.PtoPInputHandler",
"1:1616:1.323",
e });
throw new SIResourceException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.impl.PtoPInputHandler",
"1:1624:1.323",
e },
null),
e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "createControlNackMessage");
return nackMsg;
} | java | private ControlNack createControlNackMessage()
throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "createControlNackMessage");
ControlNack nackMsg = null;
// Create new NackMessage
try
{
nackMsg = _cmf.createNewControlNack();
} catch (MessageCreateFailedException e)
{
// FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.PtoPInputHandler.createControlNackMessage",
"1:1604:1.323",
this);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.exception(tc, e);
SibTr.exit(tc, "createControlNackMessage", e);
}
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.impl.PtoPInputHandler",
"1:1616:1.323",
e });
throw new SIResourceException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.impl.PtoPInputHandler",
"1:1624:1.323",
e },
null),
e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "createControlNackMessage");
return nackMsg;
} | [
"private",
"ControlNack",
"createControlNackMessage",
"(",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"createControlNackMessage\"",
")",
";",
"ControlNack",
"nackMsg",
"=",
"null",
";",
"// Create new NackMessage",
"try",
"{",
"nackMsg",
"=",
"_cmf",
".",
"createNewControlNack",
"(",
")",
";",
"}",
"catch",
"(",
"MessageCreateFailedException",
"e",
")",
"{",
"// FFDC",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.impl.PtoPInputHandler.createControlNackMessage\"",
",",
"\"1:1604:1.323\"",
",",
"this",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"createControlNackMessage\"",
",",
"e",
")",
";",
"}",
"SibTr",
".",
"error",
"(",
"tc",
",",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.impl.PtoPInputHandler\"",
",",
"\"1:1616:1.323\"",
",",
"e",
"}",
")",
";",
"throw",
"new",
"SIResourceException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.impl.PtoPInputHandler\"",
",",
"\"1:1624:1.323\"",
",",
"e",
"}",
",",
"null",
")",
",",
"e",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"createControlNackMessage\"",
")",
";",
"return",
"nackMsg",
";",
"}"
] | Creates an NACK message for sending
@return the new NACK message
@throws SIResourceException if the message can't be created. | [
"Creates",
"an",
"NACK",
"message",
"for",
"sending"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPInputHandler.java#L1442-L1490 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPInputHandler.java | PtoPInputHandler.createControlRequestFlush | protected ControlRequestFlush createControlRequestFlush() throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "createControlRequestFlush");
ControlRequestFlush rflushMsg = null;
// Create new message
try
{
rflushMsg = _cmf.createNewControlRequestFlush();
} catch (MessageCreateFailedException e)
{
// FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.PtoPInputHandler.createControlRequestFlush",
"1:1717:1.323",
this);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.exception(tc, e);
SibTr.exit(tc, "createControlRequestFlush", e);
}
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.impl.PtoPInputHandler",
"1:1729:1.323",
e });
throw new SIResourceException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.impl.PtoPInputHandler",
"1:1737:1.323",
e },
null),
e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "createControlRequestFlush", rflushMsg);
return rflushMsg;
} | java | protected ControlRequestFlush createControlRequestFlush() throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "createControlRequestFlush");
ControlRequestFlush rflushMsg = null;
// Create new message
try
{
rflushMsg = _cmf.createNewControlRequestFlush();
} catch (MessageCreateFailedException e)
{
// FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.PtoPInputHandler.createControlRequestFlush",
"1:1717:1.323",
this);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.exception(tc, e);
SibTr.exit(tc, "createControlRequestFlush", e);
}
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.impl.PtoPInputHandler",
"1:1729:1.323",
e });
throw new SIResourceException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.impl.PtoPInputHandler",
"1:1737:1.323",
e },
null),
e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "createControlRequestFlush", rflushMsg);
return rflushMsg;
} | [
"protected",
"ControlRequestFlush",
"createControlRequestFlush",
"(",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"createControlRequestFlush\"",
")",
";",
"ControlRequestFlush",
"rflushMsg",
"=",
"null",
";",
"// Create new message",
"try",
"{",
"rflushMsg",
"=",
"_cmf",
".",
"createNewControlRequestFlush",
"(",
")",
";",
"}",
"catch",
"(",
"MessageCreateFailedException",
"e",
")",
"{",
"// FFDC",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.impl.PtoPInputHandler.createControlRequestFlush\"",
",",
"\"1:1717:1.323\"",
",",
"this",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"createControlRequestFlush\"",
",",
"e",
")",
";",
"}",
"SibTr",
".",
"error",
"(",
"tc",
",",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.impl.PtoPInputHandler\"",
",",
"\"1:1729:1.323\"",
",",
"e",
"}",
")",
";",
"throw",
"new",
"SIResourceException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.impl.PtoPInputHandler\"",
",",
"\"1:1737:1.323\"",
",",
"e",
"}",
",",
"null",
")",
",",
"e",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"createControlRequestFlush\"",
",",
"rflushMsg",
")",
";",
"return",
"rflushMsg",
";",
"}"
] | Creates a REQUESTFLUSH message for sending
@return the new REQUESTFLUSH message
@throws SIResourceException if the message can't be created. | [
"Creates",
"a",
"REQUESTFLUSH",
"message",
"for",
"sending"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPInputHandler.java#L1554-L1601 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPInputHandler.java | PtoPInputHandler.checkCanExceptionMessage | private int checkCanExceptionMessage(DestinationHandler destinationHandler)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"checkCanExceptionMessage",
new Object[] { destinationHandler });
// Destination exception destination handler
ExceptionDestinationHandlerImpl exceptionDestinationHandler = null;
// Instantiate an ExceptionDestinationHandlerImpl for the destination
exceptionDestinationHandler = new ExceptionDestinationHandlerImpl(destinationHandler);
int returnValue = exceptionDestinationHandler.checkCanExceptionMessage();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "checkCanExceptionMessage", Integer.valueOf(returnValue));
return returnValue;
} | java | private int checkCanExceptionMessage(DestinationHandler destinationHandler)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"checkCanExceptionMessage",
new Object[] { destinationHandler });
// Destination exception destination handler
ExceptionDestinationHandlerImpl exceptionDestinationHandler = null;
// Instantiate an ExceptionDestinationHandlerImpl for the destination
exceptionDestinationHandler = new ExceptionDestinationHandlerImpl(destinationHandler);
int returnValue = exceptionDestinationHandler.checkCanExceptionMessage();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "checkCanExceptionMessage", Integer.valueOf(returnValue));
return returnValue;
} | [
"private",
"int",
"checkCanExceptionMessage",
"(",
"DestinationHandler",
"destinationHandler",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"checkCanExceptionMessage\"",
",",
"new",
"Object",
"[",
"]",
"{",
"destinationHandler",
"}",
")",
";",
"// Destination exception destination handler",
"ExceptionDestinationHandlerImpl",
"exceptionDestinationHandler",
"=",
"null",
";",
"// Instantiate an ExceptionDestinationHandlerImpl for the destination",
"exceptionDestinationHandler",
"=",
"new",
"ExceptionDestinationHandlerImpl",
"(",
"destinationHandler",
")",
";",
"int",
"returnValue",
"=",
"exceptionDestinationHandler",
".",
"checkCanExceptionMessage",
"(",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"checkCanExceptionMessage\"",
",",
"Integer",
".",
"valueOf",
"(",
"returnValue",
")",
")",
";",
"return",
"returnValue",
";",
"}"
] | Check whether it will be possible to place a message on the exception destination belonging
to a destination.
@param destinationHandler
@return an integer reason code | [
"Check",
"whether",
"it",
"will",
"be",
"possible",
"to",
"place",
"a",
"message",
"on",
"the",
"exception",
"destination",
"belonging",
"to",
"a",
"destination",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPInputHandler.java#L2926-L2946 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPInputHandler.java | PtoPInputHandler.checkTargetAbleToAcceptOrExceptionMessage | private int checkTargetAbleToAcceptOrExceptionMessage(JsDestinationAddress targetDestinationAddr)
throws SITemporaryDestinationNotFoundException, SIResourceException, SINotPossibleInCurrentConfigurationException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "checkTargetAbleToAcceptOrExceptionMessage", targetDestinationAddr);
int blockingReason = DestinationHandler.OUTPUT_HANDLER_NOT_FOUND;
// If the original routingDestination address in the message was blank we simply return
// 'not found'.
if (targetDestinationAddr != null)
{
// Lookup the routing (target) destination. This may throw a SIMPNotPossibleInCurrentConfigurationException.
DestinationHandler targetDestination =
_messageProcessor.getDestinationManager().getDestination(targetDestinationAddr, false);
SIBUuid8 targetDestinationMEUuid = targetDestinationAddr.getME();
// Can the routing destination accept a message
blockingReason = targetDestination.checkCanAcceptMessage(targetDestinationMEUuid, null);
// If the target is full (or put-disabled, etc) then we want to go on & see if we can
// put to the exception destination of the target destination
if (blockingReason != DestinationHandler.OUTPUT_HANDLER_FOUND)
{
int linkBlockingReason = checkCanExceptionMessage(targetDestination);
// If we can exception the message then reset the blockingReason return code
if (linkBlockingReason == DestinationHandler.OUTPUT_HANDLER_FOUND)
blockingReason = DestinationHandler.OUTPUT_HANDLER_FOUND;
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "checkTargetAbleToAcceptOrExceptionMessage", Integer.valueOf(blockingReason));
return blockingReason;
} | java | private int checkTargetAbleToAcceptOrExceptionMessage(JsDestinationAddress targetDestinationAddr)
throws SITemporaryDestinationNotFoundException, SIResourceException, SINotPossibleInCurrentConfigurationException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "checkTargetAbleToAcceptOrExceptionMessage", targetDestinationAddr);
int blockingReason = DestinationHandler.OUTPUT_HANDLER_NOT_FOUND;
// If the original routingDestination address in the message was blank we simply return
// 'not found'.
if (targetDestinationAddr != null)
{
// Lookup the routing (target) destination. This may throw a SIMPNotPossibleInCurrentConfigurationException.
DestinationHandler targetDestination =
_messageProcessor.getDestinationManager().getDestination(targetDestinationAddr, false);
SIBUuid8 targetDestinationMEUuid = targetDestinationAddr.getME();
// Can the routing destination accept a message
blockingReason = targetDestination.checkCanAcceptMessage(targetDestinationMEUuid, null);
// If the target is full (or put-disabled, etc) then we want to go on & see if we can
// put to the exception destination of the target destination
if (blockingReason != DestinationHandler.OUTPUT_HANDLER_FOUND)
{
int linkBlockingReason = checkCanExceptionMessage(targetDestination);
// If we can exception the message then reset the blockingReason return code
if (linkBlockingReason == DestinationHandler.OUTPUT_HANDLER_FOUND)
blockingReason = DestinationHandler.OUTPUT_HANDLER_FOUND;
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "checkTargetAbleToAcceptOrExceptionMessage", Integer.valueOf(blockingReason));
return blockingReason;
} | [
"private",
"int",
"checkTargetAbleToAcceptOrExceptionMessage",
"(",
"JsDestinationAddress",
"targetDestinationAddr",
")",
"throws",
"SITemporaryDestinationNotFoundException",
",",
"SIResourceException",
",",
"SINotPossibleInCurrentConfigurationException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"checkTargetAbleToAcceptOrExceptionMessage\"",
",",
"targetDestinationAddr",
")",
";",
"int",
"blockingReason",
"=",
"DestinationHandler",
".",
"OUTPUT_HANDLER_NOT_FOUND",
";",
"// If the original routingDestination address in the message was blank we simply return",
"// 'not found'.",
"if",
"(",
"targetDestinationAddr",
"!=",
"null",
")",
"{",
"// Lookup the routing (target) destination. This may throw a SIMPNotPossibleInCurrentConfigurationException.",
"DestinationHandler",
"targetDestination",
"=",
"_messageProcessor",
".",
"getDestinationManager",
"(",
")",
".",
"getDestination",
"(",
"targetDestinationAddr",
",",
"false",
")",
";",
"SIBUuid8",
"targetDestinationMEUuid",
"=",
"targetDestinationAddr",
".",
"getME",
"(",
")",
";",
"// Can the routing destination accept a message",
"blockingReason",
"=",
"targetDestination",
".",
"checkCanAcceptMessage",
"(",
"targetDestinationMEUuid",
",",
"null",
")",
";",
"// If the target is full (or put-disabled, etc) then we want to go on & see if we can",
"// put to the exception destination of the target destination",
"if",
"(",
"blockingReason",
"!=",
"DestinationHandler",
".",
"OUTPUT_HANDLER_FOUND",
")",
"{",
"int",
"linkBlockingReason",
"=",
"checkCanExceptionMessage",
"(",
"targetDestination",
")",
";",
"// If we can exception the message then reset the blockingReason return code",
"if",
"(",
"linkBlockingReason",
"==",
"DestinationHandler",
".",
"OUTPUT_HANDLER_FOUND",
")",
"blockingReason",
"=",
"DestinationHandler",
".",
"OUTPUT_HANDLER_FOUND",
";",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"checkTargetAbleToAcceptOrExceptionMessage\"",
",",
"Integer",
".",
"valueOf",
"(",
"blockingReason",
")",
")",
";",
"return",
"blockingReason",
";",
"}"
] | See if a target destination or, if necessary, its exception destination, can
handle any more messages.
@return reason code signifying whether the destination can accept messages or the reason for
not being able to do so.
@throws SINotPossibleInCurrentConfigurationException
@throws SIResourceException
@throws SITemporaryDestinationNotFoundException | [
"See",
"if",
"a",
"target",
"destination",
"or",
"if",
"necessary",
"its",
"exception",
"destination",
"can",
"handle",
"any",
"more",
"messages",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPInputHandler.java#L3324-L3360 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPInputHandler.java | PtoPInputHandler.checkLinkAbleToExceptionMessage | private int checkLinkAbleToExceptionMessage()
throws SIException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "checkLinkAbleToExceptionMessage");
int blockingReason = DestinationHandler.OUTPUT_HANDLER_NOT_FOUND;
blockingReason = checkCanExceptionMessage(_destination);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "checkLinkAbleToExceptionMessage", Integer.valueOf(blockingReason));
return blockingReason;
} | java | private int checkLinkAbleToExceptionMessage()
throws SIException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "checkLinkAbleToExceptionMessage");
int blockingReason = DestinationHandler.OUTPUT_HANDLER_NOT_FOUND;
blockingReason = checkCanExceptionMessage(_destination);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "checkLinkAbleToExceptionMessage", Integer.valueOf(blockingReason));
return blockingReason;
} | [
"private",
"int",
"checkLinkAbleToExceptionMessage",
"(",
")",
"throws",
"SIException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"checkLinkAbleToExceptionMessage\"",
")",
";",
"int",
"blockingReason",
"=",
"DestinationHandler",
".",
"OUTPUT_HANDLER_NOT_FOUND",
";",
"blockingReason",
"=",
"checkCanExceptionMessage",
"(",
"_destination",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"checkLinkAbleToExceptionMessage\"",
",",
"Integer",
".",
"valueOf",
"(",
"blockingReason",
")",
")",
";",
"return",
"blockingReason",
";",
"}"
] | See if a link's exception destination can handle any more messages.
@return reason code signifying whether the destination can accept messages or the reason for
not being able to do so. | [
"See",
"if",
"a",
"link",
"s",
"exception",
"destination",
"can",
"handle",
"any",
"more",
"messages",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPInputHandler.java#L3368-L3382 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPInputHandler.java | PtoPInputHandler.checkStillBlocked | @Override
public int checkStillBlocked()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "checkStillBlocked");
// For safety, we assume that the destination is blocked (def 244425 and 464463)
int blockingReason = DestinationHandler.OUTPUT_HANDLER_NOT_FOUND;
if (!_isLink)
{
// For non-links we want to process ackExpecteds as normal
blockingReason = DestinationHandler.OUTPUT_HANDLER_FOUND;
}
else
{
// If this is a link then we are potentially interested in a number of destinations: the destination
// currently blocking the link, its exception destination, the link's exception destination and maybe
// the system exception destination. For example, if no link exception destination is defined and a
// message could not be delivered on either the target destination or the target's exception destination,
// then the entire link will be blocked until that message can be delivered or has been deleted at the
// source end.
//
// If a link does have an exception destination defined then there are situations where that exception
// destination itself may be unable to accept messages and will therefore lead to the link being blocked.
// If the condition that led to the blocking of the link no longer applies and if no other blocking
// condition has arisen then we can start sending NACKs to the source as there will be space for what
// might be returned. If it still cannot accept messages then we are still not able to send NACKs.
// If the link was blocked because the routing destination or the configured exception destinations
// were full, then check that they now have room
boolean checkedTarget = false;
try
{
// Do a general message acceptance test on the link blocking destination and any associated
// exception destination if the link is still marked as blocked.
blockingReason =
checkTargetAbleToAcceptOrExceptionMessage(_linkBlockingDestination);
// We've checked the target and have a return code
checkedTarget = true;
} catch (SIMPNotPossibleInCurrentConfigurationException e)
{
// No FFDC code needed
// There's a problem with the configuration of the target destination - so set checkedTarget to
// true, retain the OUTPUT_HANDLER_NOT_FOUND return code and continue processing. If we find that
// the link exception destination is also unable to accept the message then we want to report
// the target blocking reason rather than the link blocking reason, which may be different.
checkedTarget = true;
// Log the exception
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.exception(tc, e);
} catch (SIException e)
{
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.PtoPInputHandler.checkStillBlocked",
"1:3720:1.323",
this);
}
// If still blocked, then are we able to exploit the link exception destination
try
{
if (blockingReason != DestinationHandler.OUTPUT_HANDLER_FOUND)
{
int linkBlockingReason = checkLinkAbleToExceptionMessage();
// If we can exception the message then reset the blockingReason return code
if (linkBlockingReason == DestinationHandler.OUTPUT_HANDLER_FOUND)
blockingReason = DestinationHandler.OUTPUT_HANDLER_FOUND;
// If we didn't get a reason code from checking the target or its exception destination
// then use the link's.
else if (!checkedTarget)
blockingReason = linkBlockingReason;
}
} catch (SIException e)
{
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.PtoPInputHandler.checkStillBlocked",
"1:3745:1.323",
this);
}
// If the link is no longer blocked, clear out the blocking destination
if (blockingReason == DestinationHandler.OUTPUT_HANDLER_FOUND)
_linkBlockingDestination = null;
} // eof processing specific to link
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "checkStillBlocked", new Integer(blockingReason));
return blockingReason;
} | java | @Override
public int checkStillBlocked()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "checkStillBlocked");
// For safety, we assume that the destination is blocked (def 244425 and 464463)
int blockingReason = DestinationHandler.OUTPUT_HANDLER_NOT_FOUND;
if (!_isLink)
{
// For non-links we want to process ackExpecteds as normal
blockingReason = DestinationHandler.OUTPUT_HANDLER_FOUND;
}
else
{
// If this is a link then we are potentially interested in a number of destinations: the destination
// currently blocking the link, its exception destination, the link's exception destination and maybe
// the system exception destination. For example, if no link exception destination is defined and a
// message could not be delivered on either the target destination or the target's exception destination,
// then the entire link will be blocked until that message can be delivered or has been deleted at the
// source end.
//
// If a link does have an exception destination defined then there are situations where that exception
// destination itself may be unable to accept messages and will therefore lead to the link being blocked.
// If the condition that led to the blocking of the link no longer applies and if no other blocking
// condition has arisen then we can start sending NACKs to the source as there will be space for what
// might be returned. If it still cannot accept messages then we are still not able to send NACKs.
// If the link was blocked because the routing destination or the configured exception destinations
// were full, then check that they now have room
boolean checkedTarget = false;
try
{
// Do a general message acceptance test on the link blocking destination and any associated
// exception destination if the link is still marked as blocked.
blockingReason =
checkTargetAbleToAcceptOrExceptionMessage(_linkBlockingDestination);
// We've checked the target and have a return code
checkedTarget = true;
} catch (SIMPNotPossibleInCurrentConfigurationException e)
{
// No FFDC code needed
// There's a problem with the configuration of the target destination - so set checkedTarget to
// true, retain the OUTPUT_HANDLER_NOT_FOUND return code and continue processing. If we find that
// the link exception destination is also unable to accept the message then we want to report
// the target blocking reason rather than the link blocking reason, which may be different.
checkedTarget = true;
// Log the exception
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.exception(tc, e);
} catch (SIException e)
{
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.PtoPInputHandler.checkStillBlocked",
"1:3720:1.323",
this);
}
// If still blocked, then are we able to exploit the link exception destination
try
{
if (blockingReason != DestinationHandler.OUTPUT_HANDLER_FOUND)
{
int linkBlockingReason = checkLinkAbleToExceptionMessage();
// If we can exception the message then reset the blockingReason return code
if (linkBlockingReason == DestinationHandler.OUTPUT_HANDLER_FOUND)
blockingReason = DestinationHandler.OUTPUT_HANDLER_FOUND;
// If we didn't get a reason code from checking the target or its exception destination
// then use the link's.
else if (!checkedTarget)
blockingReason = linkBlockingReason;
}
} catch (SIException e)
{
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.PtoPInputHandler.checkStillBlocked",
"1:3745:1.323",
this);
}
// If the link is no longer blocked, clear out the blocking destination
if (blockingReason == DestinationHandler.OUTPUT_HANDLER_FOUND)
_linkBlockingDestination = null;
} // eof processing specific to link
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "checkStillBlocked", new Integer(blockingReason));
return blockingReason;
} | [
"@",
"Override",
"public",
"int",
"checkStillBlocked",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"checkStillBlocked\"",
")",
";",
"// For safety, we assume that the destination is blocked (def 244425 and 464463)",
"int",
"blockingReason",
"=",
"DestinationHandler",
".",
"OUTPUT_HANDLER_NOT_FOUND",
";",
"if",
"(",
"!",
"_isLink",
")",
"{",
"// For non-links we want to process ackExpecteds as normal",
"blockingReason",
"=",
"DestinationHandler",
".",
"OUTPUT_HANDLER_FOUND",
";",
"}",
"else",
"{",
"// If this is a link then we are potentially interested in a number of destinations: the destination",
"// currently blocking the link, its exception destination, the link's exception destination and maybe",
"// the system exception destination. For example, if no link exception destination is defined and a",
"// message could not be delivered on either the target destination or the target's exception destination,",
"// then the entire link will be blocked until that message can be delivered or has been deleted at the",
"// source end.",
"//",
"// If a link does have an exception destination defined then there are situations where that exception",
"// destination itself may be unable to accept messages and will therefore lead to the link being blocked.",
"// If the condition that led to the blocking of the link no longer applies and if no other blocking",
"// condition has arisen then we can start sending NACKs to the source as there will be space for what",
"// might be returned. If it still cannot accept messages then we are still not able to send NACKs.",
"// If the link was blocked because the routing destination or the configured exception destinations",
"// were full, then check that they now have room",
"boolean",
"checkedTarget",
"=",
"false",
";",
"try",
"{",
"// Do a general message acceptance test on the link blocking destination and any associated",
"// exception destination if the link is still marked as blocked.",
"blockingReason",
"=",
"checkTargetAbleToAcceptOrExceptionMessage",
"(",
"_linkBlockingDestination",
")",
";",
"// We've checked the target and have a return code",
"checkedTarget",
"=",
"true",
";",
"}",
"catch",
"(",
"SIMPNotPossibleInCurrentConfigurationException",
"e",
")",
"{",
"// No FFDC code needed",
"// There's a problem with the configuration of the target destination - so set checkedTarget to",
"// true, retain the OUTPUT_HANDLER_NOT_FOUND return code and continue processing. If we find that",
"// the link exception destination is also unable to accept the message then we want to report",
"// the target blocking reason rather than the link blocking reason, which may be different.",
"checkedTarget",
"=",
"true",
";",
"// Log the exception",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"}",
"catch",
"(",
"SIException",
"e",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.impl.PtoPInputHandler.checkStillBlocked\"",
",",
"\"1:3720:1.323\"",
",",
"this",
")",
";",
"}",
"// If still blocked, then are we able to exploit the link exception destination",
"try",
"{",
"if",
"(",
"blockingReason",
"!=",
"DestinationHandler",
".",
"OUTPUT_HANDLER_FOUND",
")",
"{",
"int",
"linkBlockingReason",
"=",
"checkLinkAbleToExceptionMessage",
"(",
")",
";",
"// If we can exception the message then reset the blockingReason return code",
"if",
"(",
"linkBlockingReason",
"==",
"DestinationHandler",
".",
"OUTPUT_HANDLER_FOUND",
")",
"blockingReason",
"=",
"DestinationHandler",
".",
"OUTPUT_HANDLER_FOUND",
";",
"// If we didn't get a reason code from checking the target or its exception destination",
"// then use the link's.",
"else",
"if",
"(",
"!",
"checkedTarget",
")",
"blockingReason",
"=",
"linkBlockingReason",
";",
"}",
"}",
"catch",
"(",
"SIException",
"e",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.impl.PtoPInputHandler.checkStillBlocked\"",
",",
"\"1:3745:1.323\"",
",",
"this",
")",
";",
"}",
"// If the link is no longer blocked, clear out the blocking destination",
"if",
"(",
"blockingReason",
"==",
"DestinationHandler",
".",
"OUTPUT_HANDLER_FOUND",
")",
"_linkBlockingDestination",
"=",
"null",
";",
"}",
"// eof processing specific to link",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"checkStillBlocked\"",
",",
"new",
"Integer",
"(",
"blockingReason",
")",
")",
";",
"return",
"blockingReason",
";",
"}"
] | See if the condition that led to the link being blocked has been resolved. The block could have been
caused by a number of factors, such as the routing destination being full or put-disabled or the
link exception destination being full, etc, etc.
This code is called by the processAckExpected code in the target stream
in order to determine whether NACKs can be sent.
WARNING - specific to stream full case
=======
Once a stream is full it should not be considered not_full until the stream has reduced the
backlog a bit. Therefore there is some hysteresis in the switching of destinations from full
to not_full.
@return true if the destination or link is unable to accept messages. | [
"See",
"if",
"the",
"condition",
"that",
"led",
"to",
"the",
"link",
"being",
"blocked",
"has",
"been",
"resolved",
".",
"The",
"block",
"could",
"have",
"been",
"caused",
"by",
"a",
"number",
"of",
"factors",
"such",
"as",
"the",
"routing",
"destination",
"being",
"full",
"or",
"put",
"-",
"disabled",
"or",
"the",
"link",
"exception",
"destination",
"being",
"full",
"etc",
"etc",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PtoPInputHandler.java#L3400-L3495 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/msgstore/gbs/NodeStack.java | NodeStack.balancedPush | void balancedPush(
int state,
GBSNode node)
{
push(state, node);
if (node.balance() != 0)
_bpidx = _cidx;
} | java | void balancedPush(
int state,
GBSNode node)
{
push(state, node);
if (node.balance() != 0)
_bpidx = _cidx;
} | [
"void",
"balancedPush",
"(",
"int",
"state",
",",
"GBSNode",
"node",
")",
"{",
"push",
"(",
"state",
",",
"node",
")",
";",
"if",
"(",
"node",
".",
"balance",
"(",
")",
"!=",
"0",
")",
"_bpidx",
"=",
"_cidx",
";",
"}"
] | Push a node and associated state onto the stack, remembering
a height imbalance if there is one. | [
"Push",
"a",
"node",
"and",
"associated",
"state",
"onto",
"the",
"stack",
"remembering",
"a",
"height",
"imbalance",
"if",
"there",
"is",
"one",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/msgstore/gbs/NodeStack.java#L186-L193 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/msgstore/gbs/NodeStack.java | NodeStack.processSubFringe | void processSubFringe(
GBSNode p)
{
/* Depth of a balanced T-zero tree for */
/* this tree's K factor */
int t0_depth = _tree.tZeroDepth();
/* Determine top-most node we must visit in the tree walk */
int ntop = 0; /* This is the index within the */
/* NodeStack that represents the top */
/* of the sub-tree. We start by */
/* assuming we have to walk the whole */
/* tree. */
int xChild = 0; /* Assume current node has no children */
if (p.hasChild())
xChild = 1; /* Allow for terminal child */
if (index() > t0_depth) /* Have at least a whole t0 sub-tree */
ntop = index() - (t0_depth - xChild);
innerProcessSubTree(p, NodeStack.VISIT_RIGHT, ntop);
} | java | void processSubFringe(
GBSNode p)
{
/* Depth of a balanced T-zero tree for */
/* this tree's K factor */
int t0_depth = _tree.tZeroDepth();
/* Determine top-most node we must visit in the tree walk */
int ntop = 0; /* This is the index within the */
/* NodeStack that represents the top */
/* of the sub-tree. We start by */
/* assuming we have to walk the whole */
/* tree. */
int xChild = 0; /* Assume current node has no children */
if (p.hasChild())
xChild = 1; /* Allow for terminal child */
if (index() > t0_depth) /* Have at least a whole t0 sub-tree */
ntop = index() - (t0_depth - xChild);
innerProcessSubTree(p, NodeStack.VISIT_RIGHT, ntop);
} | [
"void",
"processSubFringe",
"(",
"GBSNode",
"p",
")",
"{",
"/* Depth of a balanced T-zero tree for */",
"/* this tree's K factor */",
"int",
"t0_depth",
"=",
"_tree",
".",
"tZeroDepth",
"(",
")",
";",
"/* Determine top-most node we must visit in the tree walk */",
"int",
"ntop",
"=",
"0",
";",
"/* This is the index within the */",
"/* NodeStack that represents the top */",
"/* of the sub-tree. We start by */",
"/* assuming we have to walk the whole */",
"/* tree. */",
"int",
"xChild",
"=",
"0",
";",
"/* Assume current node has no children */",
"if",
"(",
"p",
".",
"hasChild",
"(",
")",
")",
"xChild",
"=",
"1",
";",
"/* Allow for terminal child */",
"if",
"(",
"index",
"(",
")",
">",
"t0_depth",
")",
"/* Have at least a whole t0 sub-tree */",
"ntop",
"=",
"index",
"(",
")",
"-",
"(",
"t0_depth",
"-",
"xChild",
")",
";",
"innerProcessSubTree",
"(",
"p",
",",
"NodeStack",
".",
"VISIT_RIGHT",
",",
"ntop",
")",
";",
"}"
] | Walk through a fringe of the tree.
<p>We are positioned at a node that is within a fringe of a tree.
This method will go through every node in the fringe, invoking
processNode on every node in the tree. processNode is an abstract
method that is implemented by all subclasses.</p>
@param p The node at which to start. | [
"Walk",
"through",
"a",
"fringe",
"of",
"the",
"tree",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/msgstore/gbs/NodeStack.java#L260-L279 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/msgstore/gbs/NodeStack.java | NodeStack.innerProcessSubTree | private void innerProcessSubTree(
GBSNode p,
int initialState,
int topIndex)
{
boolean done = false;
_topIndex = topIndex;
_endp = p;
_endIndex = _idx;
GBSNode q; /* Used for tree walking */
int s = initialState;
while ( !done )
{
switch(s)
{
case NodeStack.VISIT_LEFT:
s = NodeStack.PROCESS_CURRENT;
q = p.leftChild();
while (q != null)
{
push(s, p);
p = q;
q = p.leftChild();
}
break;
case NodeStack.PROCESS_CURRENT:
s = NodeStack.VISIT_RIGHT;
done = processNode(p);
_endp = p; /* Last node processed */
_endIndex = _idx; /* Index to parent of last node processed*/
break;
case NodeStack.VISIT_RIGHT:
s = NodeStack.DONE_VISITS;
q = p.rightChild();
if (q != null)
{
push(s, p);
s = NodeStack.VISIT_LEFT;
p = p.rightChild();
}
break;
case NodeStack.DONE_VISITS:
if (_idx == topIndex) /* Have finally hit end of sub-tree */
done = true;
else
{
s = _state[_cidx];
p = _node[_cidx];
pop();
}
break;
default:
throw new RuntimeException("Help!, s = " + s + ".");
// break;
} /* switch(s) */
} /* while ( !done ) */
} | java | private void innerProcessSubTree(
GBSNode p,
int initialState,
int topIndex)
{
boolean done = false;
_topIndex = topIndex;
_endp = p;
_endIndex = _idx;
GBSNode q; /* Used for tree walking */
int s = initialState;
while ( !done )
{
switch(s)
{
case NodeStack.VISIT_LEFT:
s = NodeStack.PROCESS_CURRENT;
q = p.leftChild();
while (q != null)
{
push(s, p);
p = q;
q = p.leftChild();
}
break;
case NodeStack.PROCESS_CURRENT:
s = NodeStack.VISIT_RIGHT;
done = processNode(p);
_endp = p; /* Last node processed */
_endIndex = _idx; /* Index to parent of last node processed*/
break;
case NodeStack.VISIT_RIGHT:
s = NodeStack.DONE_VISITS;
q = p.rightChild();
if (q != null)
{
push(s, p);
s = NodeStack.VISIT_LEFT;
p = p.rightChild();
}
break;
case NodeStack.DONE_VISITS:
if (_idx == topIndex) /* Have finally hit end of sub-tree */
done = true;
else
{
s = _state[_cidx];
p = _node[_cidx];
pop();
}
break;
default:
throw new RuntimeException("Help!, s = " + s + ".");
// break;
} /* switch(s) */
} /* while ( !done ) */
} | [
"private",
"void",
"innerProcessSubTree",
"(",
"GBSNode",
"p",
",",
"int",
"initialState",
",",
"int",
"topIndex",
")",
"{",
"boolean",
"done",
"=",
"false",
";",
"_topIndex",
"=",
"topIndex",
";",
"_endp",
"=",
"p",
";",
"_endIndex",
"=",
"_idx",
";",
"GBSNode",
"q",
";",
"/* Used for tree walking */",
"int",
"s",
"=",
"initialState",
";",
"while",
"(",
"!",
"done",
")",
"{",
"switch",
"(",
"s",
")",
"{",
"case",
"NodeStack",
".",
"VISIT_LEFT",
":",
"s",
"=",
"NodeStack",
".",
"PROCESS_CURRENT",
";",
"q",
"=",
"p",
".",
"leftChild",
"(",
")",
";",
"while",
"(",
"q",
"!=",
"null",
")",
"{",
"push",
"(",
"s",
",",
"p",
")",
";",
"p",
"=",
"q",
";",
"q",
"=",
"p",
".",
"leftChild",
"(",
")",
";",
"}",
"break",
";",
"case",
"NodeStack",
".",
"PROCESS_CURRENT",
":",
"s",
"=",
"NodeStack",
".",
"VISIT_RIGHT",
";",
"done",
"=",
"processNode",
"(",
"p",
")",
";",
"_endp",
"=",
"p",
";",
"/* Last node processed */",
"_endIndex",
"=",
"_idx",
";",
"/* Index to parent of last node processed*/",
"break",
";",
"case",
"NodeStack",
".",
"VISIT_RIGHT",
":",
"s",
"=",
"NodeStack",
".",
"DONE_VISITS",
";",
"q",
"=",
"p",
".",
"rightChild",
"(",
")",
";",
"if",
"(",
"q",
"!=",
"null",
")",
"{",
"push",
"(",
"s",
",",
"p",
")",
";",
"s",
"=",
"NodeStack",
".",
"VISIT_LEFT",
";",
"p",
"=",
"p",
".",
"rightChild",
"(",
")",
";",
"}",
"break",
";",
"case",
"NodeStack",
".",
"DONE_VISITS",
":",
"if",
"(",
"_idx",
"==",
"topIndex",
")",
"/* Have finally hit end of sub-tree */",
"done",
"=",
"true",
";",
"else",
"{",
"s",
"=",
"_state",
"[",
"_cidx",
"]",
";",
"p",
"=",
"_node",
"[",
"_cidx",
"]",
";",
"pop",
"(",
")",
";",
"}",
"break",
";",
"default",
":",
"throw",
"new",
"RuntimeException",
"(",
"\"Help!, s = \"",
"+",
"s",
"+",
"\".\"",
")",
";",
"// break;",
"}",
"/* switch(s) */",
"}",
"/* while ( !done ) */",
"}"
] | Walk through an entire sub-tree, invoking processNode on each node.
<p>Walk through a sub-tree, invoking processNode on each node.
processNode is an abstract megthod that is implemented by
subclasses.</p>
@param p The node at which to start.
@param initialState The initial state of the walk, which is one of
VISIT_LEFT or VISIT_RIGHT. VISIT_LEFT is the
initial state for visiting a whole sub-tree.
VISIT_RIGHT is the initial state for visiting a
sub-fringe.
@param topIndex The index within the NodeStack that is considered
to be the top of the tree. | [
"Walk",
"through",
"an",
"entire",
"sub",
"-",
"tree",
"invoking",
"processNode",
"on",
"each",
"node",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/msgstore/gbs/NodeStack.java#L309-L367 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/msgstore/gbs/NodeStack.java | NodeStack.stateName | public String stateName(
int state)
{
String name = "Unknown state = " + state;
switch(state)
{
case NodeStack.VISIT_LEFT:
name = "VISIT_LEFT";
break;
case NodeStack.PROCESS_CURRENT:
name = "PROCESS_CURRENT";
break;
case NodeStack.VISIT_RIGHT:
name = "VISIT_RIGHT";
break;
case NodeStack.DONE_VISITS:
name = "DONE_VISITS";
break;
}
return name;
} | java | public String stateName(
int state)
{
String name = "Unknown state = " + state;
switch(state)
{
case NodeStack.VISIT_LEFT:
name = "VISIT_LEFT";
break;
case NodeStack.PROCESS_CURRENT:
name = "PROCESS_CURRENT";
break;
case NodeStack.VISIT_RIGHT:
name = "VISIT_RIGHT";
break;
case NodeStack.DONE_VISITS:
name = "DONE_VISITS";
break;
}
return name;
} | [
"public",
"String",
"stateName",
"(",
"int",
"state",
")",
"{",
"String",
"name",
"=",
"\"Unknown state = \"",
"+",
"state",
";",
"switch",
"(",
"state",
")",
"{",
"case",
"NodeStack",
".",
"VISIT_LEFT",
":",
"name",
"=",
"\"VISIT_LEFT\"",
";",
"break",
";",
"case",
"NodeStack",
".",
"PROCESS_CURRENT",
":",
"name",
"=",
"\"PROCESS_CURRENT\"",
";",
"break",
";",
"case",
"NodeStack",
".",
"VISIT_RIGHT",
":",
"name",
"=",
"\"VISIT_RIGHT\"",
";",
"break",
";",
"case",
"NodeStack",
".",
"DONE_VISITS",
":",
"name",
"=",
"\"DONE_VISITS\"",
";",
"break",
";",
"}",
"return",
"name",
";",
"}"
] | Return the name of a node state | [
"Return",
"the",
"name",
"of",
"a",
"node",
"state"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/msgstore/gbs/NodeStack.java#L390-L410 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/util/ExceptionUtil.java | ExceptionUtil.logException | public final static void logException(TraceComponent compTc, Throwable t, EJBMethodMetaData m, BeanO bean) {
//d408351 - only log recursive exceptions if they have not been logged before
if (hasBeenLogged(t)) {
return;
}
BeanId beanId = null;
if (bean != null) {
beanId = bean.getId();
}
if (m == null) {
if (beanId == null) {
Tr.error(compTc, "NON_APPLICATION_EXCEPTION_CNTR0018E", t);
} else {
Tr.error(compTc, "NON_APPLICATION_EXCEPTION_ON_BEAN_CNTR0021E", new Object[] { t, beanId });
}
} else {
String methodName = m.getMethodName();
if (beanId == null) {
Tr.error(compTc, "NON_APPLICATION_EXCEPTION_METHOD_CNTR0019E", new Object[] { t, methodName });
} else {
Tr.error(compTc, "NON_APPLICATION_EXCEPTION_METHOD_ON_BEAN_CNTR0020E", new Object[] { t, methodName, beanId });
}
}
} | java | public final static void logException(TraceComponent compTc, Throwable t, EJBMethodMetaData m, BeanO bean) {
//d408351 - only log recursive exceptions if they have not been logged before
if (hasBeenLogged(t)) {
return;
}
BeanId beanId = null;
if (bean != null) {
beanId = bean.getId();
}
if (m == null) {
if (beanId == null) {
Tr.error(compTc, "NON_APPLICATION_EXCEPTION_CNTR0018E", t);
} else {
Tr.error(compTc, "NON_APPLICATION_EXCEPTION_ON_BEAN_CNTR0021E", new Object[] { t, beanId });
}
} else {
String methodName = m.getMethodName();
if (beanId == null) {
Tr.error(compTc, "NON_APPLICATION_EXCEPTION_METHOD_CNTR0019E", new Object[] { t, methodName });
} else {
Tr.error(compTc, "NON_APPLICATION_EXCEPTION_METHOD_ON_BEAN_CNTR0020E", new Object[] { t, methodName, beanId });
}
}
} | [
"public",
"final",
"static",
"void",
"logException",
"(",
"TraceComponent",
"compTc",
",",
"Throwable",
"t",
",",
"EJBMethodMetaData",
"m",
",",
"BeanO",
"bean",
")",
"{",
"//d408351 - only log recursive exceptions if they have not been logged before",
"if",
"(",
"hasBeenLogged",
"(",
"t",
")",
")",
"{",
"return",
";",
"}",
"BeanId",
"beanId",
"=",
"null",
";",
"if",
"(",
"bean",
"!=",
"null",
")",
"{",
"beanId",
"=",
"bean",
".",
"getId",
"(",
")",
";",
"}",
"if",
"(",
"m",
"==",
"null",
")",
"{",
"if",
"(",
"beanId",
"==",
"null",
")",
"{",
"Tr",
".",
"error",
"(",
"compTc",
",",
"\"NON_APPLICATION_EXCEPTION_CNTR0018E\"",
",",
"t",
")",
";",
"}",
"else",
"{",
"Tr",
".",
"error",
"(",
"compTc",
",",
"\"NON_APPLICATION_EXCEPTION_ON_BEAN_CNTR0021E\"",
",",
"new",
"Object",
"[",
"]",
"{",
"t",
",",
"beanId",
"}",
")",
";",
"}",
"}",
"else",
"{",
"String",
"methodName",
"=",
"m",
".",
"getMethodName",
"(",
")",
";",
"if",
"(",
"beanId",
"==",
"null",
")",
"{",
"Tr",
".",
"error",
"(",
"compTc",
",",
"\"NON_APPLICATION_EXCEPTION_METHOD_CNTR0019E\"",
",",
"new",
"Object",
"[",
"]",
"{",
"t",
",",
"methodName",
"}",
")",
";",
"}",
"else",
"{",
"Tr",
".",
"error",
"(",
"compTc",
",",
"\"NON_APPLICATION_EXCEPTION_METHOD_ON_BEAN_CNTR0020E\"",
",",
"new",
"Object",
"[",
"]",
"{",
"t",
",",
"methodName",
",",
"beanId",
"}",
")",
";",
"}",
"}",
"}"
] | d408351 - added new signature with customizable TraceComponent | [
"d408351",
"-",
"added",
"new",
"signature",
"with",
"customizable",
"TraceComponent"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/util/ExceptionUtil.java#L82-L109 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/util/ExceptionUtil.java | ExceptionUtil.findRootCause | static public Throwable findRootCause(Throwable throwable) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "findRootCause: " + throwable);
}
Throwable root = throwable;
Throwable next = root;
while (next != null) {
root = next;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "finding cause of: " + root.getClass().getName());
}
if (root instanceof java.rmi.RemoteException) {
next = ((java.rmi.RemoteException) root).detail;
} else if (root instanceof WsNestedException) // d162976
{
next = ((WsNestedException) root).getCause(); // d162976
} else if (root instanceof TransactionRolledbackLocalException) //d180095 begin
{
next = ((TransactionRolledbackLocalException) root).getCause();
} else if (root instanceof AccessLocalException) {
next = ((AccessLocalException) root).getCause();
} else if (root instanceof NoSuchObjectLocalException) {
next = ((NoSuchObjectLocalException) root).getCause();
} else if (root instanceof TransactionRequiredLocalException) {
next = ((TransactionRequiredLocalException) root).getCause();
}
// else if (root instanceof InvalidActivityLocalException)
// {
// root = ((InvalidActivityLocalException) root).getCause();
// }
// else if (root instanceof ActivityRequiredLocalException)
// {
// root = ((ActivityRequiredLocalException) root).getCause();
// }
// else if (root instanceof ActivityCompletedLocalException)
// {
// next = ((ActivityCompletedLocalException) root).getCause(); //d180095 end
// }
else if (root instanceof NamingException) {
next = ((NamingException) root).getRootCause();
} else if (root instanceof InvocationTargetException) {
next = ((InvocationTargetException) root).getTargetException();
} else if (root instanceof org.omg.CORBA.portable.UnknownException) {
next = ((org.omg.CORBA.portable.UnknownException) root).originalEx;
} else if (root instanceof InjectionException) // d436080
{
next = root.getCause();
} else {
next = null;
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.exit(tc, "findRootCause returning: " + root);
return root;
} | java | static public Throwable findRootCause(Throwable throwable) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "findRootCause: " + throwable);
}
Throwable root = throwable;
Throwable next = root;
while (next != null) {
root = next;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "finding cause of: " + root.getClass().getName());
}
if (root instanceof java.rmi.RemoteException) {
next = ((java.rmi.RemoteException) root).detail;
} else if (root instanceof WsNestedException) // d162976
{
next = ((WsNestedException) root).getCause(); // d162976
} else if (root instanceof TransactionRolledbackLocalException) //d180095 begin
{
next = ((TransactionRolledbackLocalException) root).getCause();
} else if (root instanceof AccessLocalException) {
next = ((AccessLocalException) root).getCause();
} else if (root instanceof NoSuchObjectLocalException) {
next = ((NoSuchObjectLocalException) root).getCause();
} else if (root instanceof TransactionRequiredLocalException) {
next = ((TransactionRequiredLocalException) root).getCause();
}
// else if (root instanceof InvalidActivityLocalException)
// {
// root = ((InvalidActivityLocalException) root).getCause();
// }
// else if (root instanceof ActivityRequiredLocalException)
// {
// root = ((ActivityRequiredLocalException) root).getCause();
// }
// else if (root instanceof ActivityCompletedLocalException)
// {
// next = ((ActivityCompletedLocalException) root).getCause(); //d180095 end
// }
else if (root instanceof NamingException) {
next = ((NamingException) root).getRootCause();
} else if (root instanceof InvocationTargetException) {
next = ((InvocationTargetException) root).getTargetException();
} else if (root instanceof org.omg.CORBA.portable.UnknownException) {
next = ((org.omg.CORBA.portable.UnknownException) root).originalEx;
} else if (root instanceof InjectionException) // d436080
{
next = root.getCause();
} else {
next = null;
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.exit(tc, "findRootCause returning: " + root);
return root;
} | [
"static",
"public",
"Throwable",
"findRootCause",
"(",
"Throwable",
"throwable",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"findRootCause: \"",
"+",
"throwable",
")",
";",
"}",
"Throwable",
"root",
"=",
"throwable",
";",
"Throwable",
"next",
"=",
"root",
";",
"while",
"(",
"next",
"!=",
"null",
")",
"{",
"root",
"=",
"next",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"finding cause of: \"",
"+",
"root",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
")",
";",
"}",
"if",
"(",
"root",
"instanceof",
"java",
".",
"rmi",
".",
"RemoteException",
")",
"{",
"next",
"=",
"(",
"(",
"java",
".",
"rmi",
".",
"RemoteException",
")",
"root",
")",
".",
"detail",
";",
"}",
"else",
"if",
"(",
"root",
"instanceof",
"WsNestedException",
")",
"// d162976",
"{",
"next",
"=",
"(",
"(",
"WsNestedException",
")",
"root",
")",
".",
"getCause",
"(",
")",
";",
"// d162976",
"}",
"else",
"if",
"(",
"root",
"instanceof",
"TransactionRolledbackLocalException",
")",
"//d180095 begin",
"{",
"next",
"=",
"(",
"(",
"TransactionRolledbackLocalException",
")",
"root",
")",
".",
"getCause",
"(",
")",
";",
"}",
"else",
"if",
"(",
"root",
"instanceof",
"AccessLocalException",
")",
"{",
"next",
"=",
"(",
"(",
"AccessLocalException",
")",
"root",
")",
".",
"getCause",
"(",
")",
";",
"}",
"else",
"if",
"(",
"root",
"instanceof",
"NoSuchObjectLocalException",
")",
"{",
"next",
"=",
"(",
"(",
"NoSuchObjectLocalException",
")",
"root",
")",
".",
"getCause",
"(",
")",
";",
"}",
"else",
"if",
"(",
"root",
"instanceof",
"TransactionRequiredLocalException",
")",
"{",
"next",
"=",
"(",
"(",
"TransactionRequiredLocalException",
")",
"root",
")",
".",
"getCause",
"(",
")",
";",
"}",
"// else if (root instanceof InvalidActivityLocalException)",
"// {",
"// root = ((InvalidActivityLocalException) root).getCause();",
"// }",
"// else if (root instanceof ActivityRequiredLocalException)",
"// {",
"// root = ((ActivityRequiredLocalException) root).getCause();",
"// }",
"// else if (root instanceof ActivityCompletedLocalException)",
"// {",
"// next = ((ActivityCompletedLocalException) root).getCause(); //d180095 end",
"// }",
"else",
"if",
"(",
"root",
"instanceof",
"NamingException",
")",
"{",
"next",
"=",
"(",
"(",
"NamingException",
")",
"root",
")",
".",
"getRootCause",
"(",
")",
";",
"}",
"else",
"if",
"(",
"root",
"instanceof",
"InvocationTargetException",
")",
"{",
"next",
"=",
"(",
"(",
"InvocationTargetException",
")",
"root",
")",
".",
"getTargetException",
"(",
")",
";",
"}",
"else",
"if",
"(",
"root",
"instanceof",
"org",
".",
"omg",
".",
"CORBA",
".",
"portable",
".",
"UnknownException",
")",
"{",
"next",
"=",
"(",
"(",
"org",
".",
"omg",
".",
"CORBA",
".",
"portable",
".",
"UnknownException",
")",
"root",
")",
".",
"originalEx",
";",
"}",
"else",
"if",
"(",
"root",
"instanceof",
"InjectionException",
")",
"// d436080",
"{",
"next",
"=",
"root",
".",
"getCause",
"(",
")",
";",
"}",
"else",
"{",
"next",
"=",
"null",
";",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"findRootCause returning: \"",
"+",
"root",
")",
";",
"return",
"root",
";",
"}"
] | Finds the root cause of a Throwable that occured. This routine will continue to
look through chained Throwables until it cannot find another chained Throwable
and return the last one in the chain as the root cause.
@param throwable must be a non-null reference of a Throwable object
to be processed. | [
"Finds",
"the",
"root",
"cause",
"of",
"a",
"Throwable",
"that",
"occured",
".",
"This",
"routine",
"will",
"continue",
"to",
"look",
"through",
"chained",
"Throwables",
"until",
"it",
"cannot",
"find",
"another",
"chained",
"Throwable",
"and",
"return",
"the",
"last",
"one",
"in",
"the",
"chain",
"as",
"the",
"root",
"cause",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/util/ExceptionUtil.java#L127-L186 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/util/ExceptionUtil.java | ExceptionUtil.Exception | public static Exception Exception(Throwable cause) {
return (cause instanceof Exception) ? (Exception) cause : new Exception("See nested Throwable", cause);
} | java | public static Exception Exception(Throwable cause) {
return (cause instanceof Exception) ? (Exception) cause : new Exception("See nested Throwable", cause);
} | [
"public",
"static",
"Exception",
"Exception",
"(",
"Throwable",
"cause",
")",
"{",
"return",
"(",
"cause",
"instanceof",
"Exception",
")",
"?",
"(",
"Exception",
")",
"cause",
":",
"new",
"Exception",
"(",
"\"See nested Throwable\"",
",",
"cause",
")",
";",
"}"
] | F71894.1 | [
"F71894",
".",
"1"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/util/ExceptionUtil.java#L266-L268 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/composite/ClientBehaviorHandler.java | ClientBehaviorHandler.createAttachedObjectTarget | protected ClientBehaviorAttachedObjectTargetImpl createAttachedObjectTarget(FaceletContext ctx)
{
ClientBehaviorAttachedObjectTargetImpl target = new ClientBehaviorAttachedObjectTargetImpl();
if (_event != null)
{
target.setEvent(_event.getValueExpression(ctx, String.class));
}
if (_name != null)
{
target.setName(_name.getValueExpression(ctx, String.class));
}
if (_default != null)
{
target.setDefault(_default.getBoolean(ctx));
}
if (_targets != null)
{
target.setTargets(_targets.getValueExpression(ctx, String.class));
}
return target;
} | java | protected ClientBehaviorAttachedObjectTargetImpl createAttachedObjectTarget(FaceletContext ctx)
{
ClientBehaviorAttachedObjectTargetImpl target = new ClientBehaviorAttachedObjectTargetImpl();
if (_event != null)
{
target.setEvent(_event.getValueExpression(ctx, String.class));
}
if (_name != null)
{
target.setName(_name.getValueExpression(ctx, String.class));
}
if (_default != null)
{
target.setDefault(_default.getBoolean(ctx));
}
if (_targets != null)
{
target.setTargets(_targets.getValueExpression(ctx, String.class));
}
return target;
} | [
"protected",
"ClientBehaviorAttachedObjectTargetImpl",
"createAttachedObjectTarget",
"(",
"FaceletContext",
"ctx",
")",
"{",
"ClientBehaviorAttachedObjectTargetImpl",
"target",
"=",
"new",
"ClientBehaviorAttachedObjectTargetImpl",
"(",
")",
";",
"if",
"(",
"_event",
"!=",
"null",
")",
"{",
"target",
".",
"setEvent",
"(",
"_event",
".",
"getValueExpression",
"(",
"ctx",
",",
"String",
".",
"class",
")",
")",
";",
"}",
"if",
"(",
"_name",
"!=",
"null",
")",
"{",
"target",
".",
"setName",
"(",
"_name",
".",
"getValueExpression",
"(",
"ctx",
",",
"String",
".",
"class",
")",
")",
";",
"}",
"if",
"(",
"_default",
"!=",
"null",
")",
"{",
"target",
".",
"setDefault",
"(",
"_default",
".",
"getBoolean",
"(",
"ctx",
")",
")",
";",
"}",
"if",
"(",
"_targets",
"!=",
"null",
")",
"{",
"target",
".",
"setTargets",
"(",
"_targets",
".",
"getValueExpression",
"(",
"ctx",
",",
"String",
".",
"class",
")",
")",
";",
"}",
"return",
"target",
";",
"}"
] | Create a new AttachedObjectTarget instance to be added on the
target list.
@return | [
"Create",
"a",
"new",
"AttachedObjectTarget",
"instance",
"to",
"be",
"added",
"on",
"the",
"target",
"list",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/composite/ClientBehaviorHandler.java#L195-L216 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/chains/EndPointMgrImpl.java | EndPointMgrImpl.registerEndpointMBean | private void registerEndpointMBean(String name, EndPointInfoImpl ep) {
endpointMBeans.put(name, registerMBeanAsService(name, ep));
} | java | private void registerEndpointMBean(String name, EndPointInfoImpl ep) {
endpointMBeans.put(name, registerMBeanAsService(name, ep));
} | [
"private",
"void",
"registerEndpointMBean",
"(",
"String",
"name",
",",
"EndPointInfoImpl",
"ep",
")",
"{",
"endpointMBeans",
".",
"put",
"(",
"name",
",",
"registerMBeanAsService",
"(",
"name",
",",
"ep",
")",
")",
";",
"}"
] | Register an endpoint MBean and publish it.
@param endpoint | [
"Register",
"an",
"endpoint",
"MBean",
"and",
"publish",
"it",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/chains/EndPointMgrImpl.java#L134-L136 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/chains/EndPointMgrImpl.java | EndPointMgrImpl.updateEndpointMBean | private EndPointInfoImpl updateEndpointMBean(String name, String host, int port) {
EndPointInfoImpl existingEP = endpoints.get(name);
existingEP.updateHost(host);
existingEP.updatePort(port);
return existingEP;
} | java | private EndPointInfoImpl updateEndpointMBean(String name, String host, int port) {
EndPointInfoImpl existingEP = endpoints.get(name);
existingEP.updateHost(host);
existingEP.updatePort(port);
return existingEP;
} | [
"private",
"EndPointInfoImpl",
"updateEndpointMBean",
"(",
"String",
"name",
",",
"String",
"host",
",",
"int",
"port",
")",
"{",
"EndPointInfoImpl",
"existingEP",
"=",
"endpoints",
".",
"get",
"(",
"name",
")",
";",
"existingEP",
".",
"updateHost",
"(",
"host",
")",
";",
"existingEP",
".",
"updatePort",
"(",
"port",
")",
";",
"return",
"existingEP",
";",
"}"
] | Update an existing endpoint MBean, which will emit change notifications.
@param name The name of the EndPoint which was updated
@param host The current host value (may or may not have changed)
@param port The current port value (may or may not have changed) | [
"Update",
"an",
"existing",
"endpoint",
"MBean",
"which",
"will",
"emit",
"change",
"notifications",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/chains/EndPointMgrImpl.java#L145-L150 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/chains/EndPointMgrImpl.java | EndPointMgrImpl.destroyEndpointMBeans | private void destroyEndpointMBeans() {
for (Map.Entry<String, ServiceRegistration<DynamicMBean>> mbean : endpointMBeans.entrySet()) {
String mbeanName = mbean.getKey();
endpointMBeans.remove(mbeanName);
mbean.getValue().unregister();
}
} | java | private void destroyEndpointMBeans() {
for (Map.Entry<String, ServiceRegistration<DynamicMBean>> mbean : endpointMBeans.entrySet()) {
String mbeanName = mbean.getKey();
endpointMBeans.remove(mbeanName);
mbean.getValue().unregister();
}
} | [
"private",
"void",
"destroyEndpointMBeans",
"(",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"ServiceRegistration",
"<",
"DynamicMBean",
">",
">",
"mbean",
":",
"endpointMBeans",
".",
"entrySet",
"(",
")",
")",
"{",
"String",
"mbeanName",
"=",
"mbean",
".",
"getKey",
"(",
")",
";",
"endpointMBeans",
".",
"remove",
"(",
"mbeanName",
")",
";",
"mbean",
".",
"getValue",
"(",
")",
".",
"unregister",
"(",
")",
";",
"}",
"}"
] | For each registered MBean, unpublish, unregister and remove from the map. | [
"For",
"each",
"registered",
"MBean",
"unpublish",
"unregister",
"and",
"remove",
"from",
"the",
"map",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/chains/EndPointMgrImpl.java#L155-L161 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/chains/EndPointMgrImpl.java | EndPointMgrImpl.destroyEndpoints | public static void destroyEndpoints() {
EndPointMgrImpl _this = (EndPointMgrImpl) getRef();
synchronized (_this.endpoints) {
_this.destroyEndpointMBeans();
_this.endpoints.clear();
}
} | java | public static void destroyEndpoints() {
EndPointMgrImpl _this = (EndPointMgrImpl) getRef();
synchronized (_this.endpoints) {
_this.destroyEndpointMBeans();
_this.endpoints.clear();
}
} | [
"public",
"static",
"void",
"destroyEndpoints",
"(",
")",
"{",
"EndPointMgrImpl",
"_this",
"=",
"(",
"EndPointMgrImpl",
")",
"getRef",
"(",
")",
";",
"synchronized",
"(",
"_this",
".",
"endpoints",
")",
"{",
"_this",
".",
"destroyEndpointMBeans",
"(",
")",
";",
"_this",
".",
"endpoints",
".",
"clear",
"(",
")",
";",
"}",
"}"
] | Destroy all of the defined endpoints. | [
"Destroy",
"all",
"of",
"the",
"defined",
"endpoints",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/chains/EndPointMgrImpl.java#L166-L172 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/chains/EndPointMgrImpl.java | EndPointMgrImpl.unregisterMBeanInService | private void unregisterMBeanInService(String name) {
ServiceRegistration<DynamicMBean> existingMBean = endpointMBeans.remove(name);
if (existingMBean != null) {
existingMBean.unregister();
}
} | java | private void unregisterMBeanInService(String name) {
ServiceRegistration<DynamicMBean> existingMBean = endpointMBeans.remove(name);
if (existingMBean != null) {
existingMBean.unregister();
}
} | [
"private",
"void",
"unregisterMBeanInService",
"(",
"String",
"name",
")",
"{",
"ServiceRegistration",
"<",
"DynamicMBean",
">",
"existingMBean",
"=",
"endpointMBeans",
".",
"remove",
"(",
"name",
")",
";",
"if",
"(",
"existingMBean",
"!=",
"null",
")",
"{",
"existingMBean",
".",
"unregister",
"(",
")",
";",
"}",
"}"
] | Remove the MBean from the map of registered MBeans and unregister it.
@param name endpoint name of the mbean to be unregistered | [
"Remove",
"the",
"MBean",
"from",
"the",
"map",
"of",
"registered",
"MBeans",
"and",
"unregister",
"it",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/chains/EndPointMgrImpl.java#L214-L219 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/chains/EndPointMgrImpl.java | EndPointMgrImpl.removeEndPoint | @Override
public void removeEndPoint(String name) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Deleting endpoint: " + name);
}
synchronized (this.endpoints) {
if (this.endpoints.remove(name) != null) {
unregisterMBeanInService(name);
}
}
} | java | @Override
public void removeEndPoint(String name) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Deleting endpoint: " + name);
}
synchronized (this.endpoints) {
if (this.endpoints.remove(name) != null) {
unregisterMBeanInService(name);
}
}
} | [
"@",
"Override",
"public",
"void",
"removeEndPoint",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Deleting endpoint: \"",
"+",
"name",
")",
";",
"}",
"synchronized",
"(",
"this",
".",
"endpoints",
")",
"{",
"if",
"(",
"this",
".",
"endpoints",
".",
"remove",
"(",
"name",
")",
"!=",
"null",
")",
"{",
"unregisterMBeanInService",
"(",
"name",
")",
";",
"}",
"}",
"}"
] | Delete the endpoint that matches the provided name.
@param name | [
"Delete",
"the",
"endpoint",
"that",
"matches",
"the",
"provided",
"name",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/chains/EndPointMgrImpl.java#L226-L237 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/TagUtils.java | TagUtils.getTokensArray | private static String[] getTokensArray(String tokenComposite)
throws ParseException
{
if (tokenComposite == null || "".equals(tokenComposite))
{
return null;
}
return parseNameTokens(tokenComposite);
} | java | private static String[] getTokensArray(String tokenComposite)
throws ParseException
{
if (tokenComposite == null || "".equals(tokenComposite))
{
return null;
}
return parseNameTokens(tokenComposite);
} | [
"private",
"static",
"String",
"[",
"]",
"getTokensArray",
"(",
"String",
"tokenComposite",
")",
"throws",
"ParseException",
"{",
"if",
"(",
"tokenComposite",
"==",
"null",
"||",
"\"\"",
".",
"equals",
"(",
"tokenComposite",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"parseNameTokens",
"(",
"tokenComposite",
")",
";",
"}"
] | Takes a string that is a composite of tokens, extracts tokens delimited
by any whitespace character sequence combination and returns a String
array of such tokens.
@throws ParseException In case of invalid character in the specified
composite. The only invalid character is a comma (','). | [
"Takes",
"a",
"string",
"that",
"is",
"a",
"composite",
"of",
"tokens",
"extracts",
"tokens",
"delimited",
"by",
"any",
"whitespace",
"character",
"sequence",
"combination",
"and",
"returns",
"a",
"String",
"array",
"of",
"such",
"tokens",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/TagUtils.java#L278-L287 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/TagUtils.java | TagUtils.parseNameTokens | static public String[] parseNameTokens(String stringValue)
{
if (stringValue == null)
{
return null;
}
ArrayList<String> list = new ArrayList<String>(5);
int length = stringValue.length();
boolean inSpace = true;
int start = 0;
for (int i = 0; i < length; i++)
{
char ch = stringValue.charAt(i);
// We're in whitespace; if we've just departed
// a run of non-whitespace, append a string.
// Now, why do we use the supposedly deprecated "Character.isSpace()"
// function instead of "isWhitespace"? We're following XML rules
// here for the meaning of whitespace, which specifically
// EXCLUDES general Unicode spaces.
if (Character.isWhitespace(ch))
{
if (!inSpace)
{
list.add(stringValue.substring(start, i));
inSpace = true;
}
}
// We're out of whitespace; if we've just departed
// a run of whitespace, start keeping track of this string
else
{
if (inSpace)
{
start = i;
inSpace = false;
}
}
}
if (!inSpace)
{
list.add(stringValue.substring(start));
}
if (list.isEmpty())
{
return null;
}
return list.toArray(new String[list.size()]);
} | java | static public String[] parseNameTokens(String stringValue)
{
if (stringValue == null)
{
return null;
}
ArrayList<String> list = new ArrayList<String>(5);
int length = stringValue.length();
boolean inSpace = true;
int start = 0;
for (int i = 0; i < length; i++)
{
char ch = stringValue.charAt(i);
// We're in whitespace; if we've just departed
// a run of non-whitespace, append a string.
// Now, why do we use the supposedly deprecated "Character.isSpace()"
// function instead of "isWhitespace"? We're following XML rules
// here for the meaning of whitespace, which specifically
// EXCLUDES general Unicode spaces.
if (Character.isWhitespace(ch))
{
if (!inSpace)
{
list.add(stringValue.substring(start, i));
inSpace = true;
}
}
// We're out of whitespace; if we've just departed
// a run of whitespace, start keeping track of this string
else
{
if (inSpace)
{
start = i;
inSpace = false;
}
}
}
if (!inSpace)
{
list.add(stringValue.substring(start));
}
if (list.isEmpty())
{
return null;
}
return list.toArray(new String[list.size()]);
} | [
"static",
"public",
"String",
"[",
"]",
"parseNameTokens",
"(",
"String",
"stringValue",
")",
"{",
"if",
"(",
"stringValue",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"ArrayList",
"<",
"String",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
"5",
")",
";",
"int",
"length",
"=",
"stringValue",
".",
"length",
"(",
")",
";",
"boolean",
"inSpace",
"=",
"true",
";",
"int",
"start",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"length",
";",
"i",
"++",
")",
"{",
"char",
"ch",
"=",
"stringValue",
".",
"charAt",
"(",
"i",
")",
";",
"// We're in whitespace; if we've just departed",
"// a run of non-whitespace, append a string.",
"// Now, why do we use the supposedly deprecated \"Character.isSpace()\"",
"// function instead of \"isWhitespace\"? We're following XML rules",
"// here for the meaning of whitespace, which specifically",
"// EXCLUDES general Unicode spaces.",
"if",
"(",
"Character",
".",
"isWhitespace",
"(",
"ch",
")",
")",
"{",
"if",
"(",
"!",
"inSpace",
")",
"{",
"list",
".",
"add",
"(",
"stringValue",
".",
"substring",
"(",
"start",
",",
"i",
")",
")",
";",
"inSpace",
"=",
"true",
";",
"}",
"}",
"// We're out of whitespace; if we've just departed",
"// a run of whitespace, start keeping track of this string",
"else",
"{",
"if",
"(",
"inSpace",
")",
"{",
"start",
"=",
"i",
";",
"inSpace",
"=",
"false",
";",
"}",
"}",
"}",
"if",
"(",
"!",
"inSpace",
")",
"{",
"list",
".",
"add",
"(",
"stringValue",
".",
"substring",
"(",
"start",
")",
")",
";",
"}",
"if",
"(",
"list",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"list",
".",
"toArray",
"(",
"new",
"String",
"[",
"list",
".",
"size",
"(",
")",
"]",
")",
";",
"}"
] | Parses a whitespace separated series of name tokens.
@param stringValue the full string
@return an array of each constituent value, or null
if there are no tokens (that is, the string is empty or
all whitespace) | [
"Parses",
"a",
"whitespace",
"separated",
"series",
"of",
"name",
"tokens",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/TagUtils.java#L318-L371 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/websphere/channelfw/FlowType.java | FlowType.getKey | public static FlowType getKey(int ordinal) {
if (ordinal >= 0 && ordinal < _values.length) {
return _values[ordinal];
}
return null;
} | java | public static FlowType getKey(int ordinal) {
if (ordinal >= 0 && ordinal < _values.length) {
return _values[ordinal];
}
return null;
} | [
"public",
"static",
"FlowType",
"getKey",
"(",
"int",
"ordinal",
")",
"{",
"if",
"(",
"ordinal",
">=",
"0",
"&&",
"ordinal",
"<",
"_values",
".",
"length",
")",
"{",
"return",
"_values",
"[",
"ordinal",
"]",
";",
"}",
"return",
"null",
";",
"}"
] | Fetch the FlowType for a particular integer.
@param ordinal The integer to find a FlowType for.
@return FlowType, null if it does match a defined FlowType | [
"Fetch",
"the",
"FlowType",
"for",
"a",
"particular",
"integer",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/websphere/channelfw/FlowType.java#L84-L89 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/chains/Chain.java | Chain.containsChannel | public boolean containsChannel(String channelName) {
boolean found = false;
for (int i = 0; i < channels.length; i++) {
if (channels[i].getName().equals(channelName)) {
found = true;
break;
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "containsChannel: " + channelName + "=" + found);
}
return found;
} | java | public boolean containsChannel(String channelName) {
boolean found = false;
for (int i = 0; i < channels.length; i++) {
if (channels[i].getName().equals(channelName)) {
found = true;
break;
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "containsChannel: " + channelName + "=" + found);
}
return found;
} | [
"public",
"boolean",
"containsChannel",
"(",
"String",
"channelName",
")",
"{",
"boolean",
"found",
"=",
"false",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"channels",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"channels",
"[",
"i",
"]",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"channelName",
")",
")",
"{",
"found",
"=",
"true",
";",
"break",
";",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"containsChannel: \"",
"+",
"channelName",
"+",
"\"=\"",
"+",
"found",
")",
";",
"}",
"return",
"found",
";",
"}"
] | Check whether this chain contains the input channel name.
@param channelName
@return boolean | [
"Check",
"whether",
"this",
"chain",
"contains",
"the",
"input",
"channel",
"name",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/chains/Chain.java#L135-L147 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.org.apache.cxf.cxf.rt.frontend.jaxrs.3.2/src/com/ibm/ws/jaxrs20/utils/UriEncoder.java | UriEncoder.needsEncoding | private static boolean needsEncoding(String s, boolean relax, boolean[] unreserved) {
int len = s.length();
for (int i = 0; i < len; ++i) {
char c = s.charAt(i);
if (c == '%' && relax) {
continue;
}
if (c > unreserved.length) {
return true;
}
if (unreserved[c] == false) {
return true;
}
}
return false;
} | java | private static boolean needsEncoding(String s, boolean relax, boolean[] unreserved) {
int len = s.length();
for (int i = 0; i < len; ++i) {
char c = s.charAt(i);
if (c == '%' && relax) {
continue;
}
if (c > unreserved.length) {
return true;
}
if (unreserved[c] == false) {
return true;
}
}
return false;
} | [
"private",
"static",
"boolean",
"needsEncoding",
"(",
"String",
"s",
",",
"boolean",
"relax",
",",
"boolean",
"[",
"]",
"unreserved",
")",
"{",
"int",
"len",
"=",
"s",
".",
"length",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"len",
";",
"++",
"i",
")",
"{",
"char",
"c",
"=",
"s",
".",
"charAt",
"(",
"i",
")",
";",
"if",
"(",
"c",
"==",
"'",
"'",
"&&",
"relax",
")",
"{",
"continue",
";",
"}",
"if",
"(",
"c",
">",
"unreserved",
".",
"length",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"unreserved",
"[",
"c",
"]",
"==",
"false",
")",
"{",
"return",
"true",
";",
"}",
"}",
"return",
"false",
";",
"}"
] | Determines if the input string contains any invalid URI characters that
require encoding
@param uri the string to test
@return true if the the input string contains only valid URI characters | [
"Determines",
"if",
"the",
"input",
"string",
"contains",
"any",
"invalid",
"URI",
"characters",
"that",
"require",
"encoding"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.org.apache.cxf.cxf.rt.frontend.jaxrs.3.2/src/com/ibm/ws/jaxrs20/utils/UriEncoder.java#L411-L426 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/comms/ConnectionProperties.java | ConnectionProperties.getWLMEndPointData | public Object getWLMEndPointData()
{
if (mode != PropertiesType.WLM_EP)
{
throw new SIErrorException(
nls.getFormattedMessage("INVALID_METHOD_FOR_OBJECT_TYPE_SICO0006", null, "INVALID_METHOD_FOR_OBJECT_TYPE_SICO0006") // D270373
);
}
return wlmEndPointData;
} | java | public Object getWLMEndPointData()
{
if (mode != PropertiesType.WLM_EP)
{
throw new SIErrorException(
nls.getFormattedMessage("INVALID_METHOD_FOR_OBJECT_TYPE_SICO0006", null, "INVALID_METHOD_FOR_OBJECT_TYPE_SICO0006") // D270373
);
}
return wlmEndPointData;
} | [
"public",
"Object",
"getWLMEndPointData",
"(",
")",
"{",
"if",
"(",
"mode",
"!=",
"PropertiesType",
".",
"WLM_EP",
")",
"{",
"throw",
"new",
"SIErrorException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"INVALID_METHOD_FOR_OBJECT_TYPE_SICO0006\"",
",",
"null",
",",
"\"INVALID_METHOD_FOR_OBJECT_TYPE_SICO0006\"",
")",
"// D270373",
")",
";",
"}",
"return",
"wlmEndPointData",
";",
"}"
] | Returns the WLM endpoint data associated with this instance
of connection properties. This is only valid if the instance
was created to use the WLM endpoint mode of operation. An
IllegalArgumentException will be thrown, otherwise. | [
"Returns",
"the",
"WLM",
"endpoint",
"data",
"associated",
"with",
"this",
"instance",
"of",
"connection",
"properties",
".",
"This",
"is",
"only",
"valid",
"if",
"the",
"instance",
"was",
"created",
"to",
"use",
"the",
"WLM",
"endpoint",
"mode",
"of",
"operation",
".",
"An",
"IllegalArgumentException",
"will",
"be",
"thrown",
"otherwise",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/comms/ConnectionProperties.java#L110-L119 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/dispatcher/internal/HttpDispatcher.java | HttpDispatcher.getContextRootNotFoundMessage | public static String getContextRootNotFoundMessage() {
// this does not return a default string, since the caller may (and does in our case) choose to build a runtime
// dependent string.
HttpDispatcher f = instance.get().get();
if (f != null)
return f.appOrContextRootNotFound;
return null;
} | java | public static String getContextRootNotFoundMessage() {
// this does not return a default string, since the caller may (and does in our case) choose to build a runtime
// dependent string.
HttpDispatcher f = instance.get().get();
if (f != null)
return f.appOrContextRootNotFound;
return null;
} | [
"public",
"static",
"String",
"getContextRootNotFoundMessage",
"(",
")",
"{",
"// this does not return a default string, since the caller may (and does in our case) choose to build a runtime",
"// dependent string.",
"HttpDispatcher",
"f",
"=",
"instance",
".",
"get",
"(",
")",
".",
"get",
"(",
")",
";",
"if",
"(",
"f",
"!=",
"null",
")",
"return",
"f",
".",
"appOrContextRootNotFound",
";",
"return",
"null",
";",
"}"
] | Get the value for the appOrContextRootMissingMessage custom property. return null if it was not set.
@return String the value for the appOrContextRootMissingMessage custom property, null if it was not set. | [
"Get",
"the",
"value",
"for",
"the",
"appOrContextRootMissingMessage",
"custom",
"property",
".",
"return",
"null",
"if",
"it",
"was",
"not",
"set",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/dispatcher/internal/HttpDispatcher.java#L253-L262 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/dispatcher/internal/HttpDispatcher.java | HttpDispatcher.isTrusted | public boolean isTrusted(String hostAddr, String headerName) {
if (!wcTrusted) {
return false;
}
if (HttpHeaderKeys.isSensitivePrivateHeader(headerName)) {
// if this is a sensitive private header, check trustedSensitiveHeaderOrigin values
return isTrustedForSensitiveHeaders(hostAddr);
}
if (!usePrivateHeaders) {
// trustedHeaderOrigin list is explicitly set to "none"
return isTrustedForSensitiveHeaders(hostAddr);
}
if (restrictPrivateHeaderOrigin == null) {
// trustedHeaderOrigin list is set to "*"
return true;
} else {
// check trustedHeaderOrigin for given host IP
boolean trustedOrigin = restrictPrivateHeaderOrigin.contains(hostAddr.toLowerCase());
if (!trustedOrigin) {
// if hostAddr is not in trustedHeaderOrigin, allow trustedSensitiveHeaderOrigin to override trust
trustedOrigin = isTrustedForSensitiveHeaders(hostAddr);
}
return trustedOrigin;
}
} | java | public boolean isTrusted(String hostAddr, String headerName) {
if (!wcTrusted) {
return false;
}
if (HttpHeaderKeys.isSensitivePrivateHeader(headerName)) {
// if this is a sensitive private header, check trustedSensitiveHeaderOrigin values
return isTrustedForSensitiveHeaders(hostAddr);
}
if (!usePrivateHeaders) {
// trustedHeaderOrigin list is explicitly set to "none"
return isTrustedForSensitiveHeaders(hostAddr);
}
if (restrictPrivateHeaderOrigin == null) {
// trustedHeaderOrigin list is set to "*"
return true;
} else {
// check trustedHeaderOrigin for given host IP
boolean trustedOrigin = restrictPrivateHeaderOrigin.contains(hostAddr.toLowerCase());
if (!trustedOrigin) {
// if hostAddr is not in trustedHeaderOrigin, allow trustedSensitiveHeaderOrigin to override trust
trustedOrigin = isTrustedForSensitiveHeaders(hostAddr);
}
return trustedOrigin;
}
} | [
"public",
"boolean",
"isTrusted",
"(",
"String",
"hostAddr",
",",
"String",
"headerName",
")",
"{",
"if",
"(",
"!",
"wcTrusted",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"HttpHeaderKeys",
".",
"isSensitivePrivateHeader",
"(",
"headerName",
")",
")",
"{",
"// if this is a sensitive private header, check trustedSensitiveHeaderOrigin values",
"return",
"isTrustedForSensitiveHeaders",
"(",
"hostAddr",
")",
";",
"}",
"if",
"(",
"!",
"usePrivateHeaders",
")",
"{",
"// trustedHeaderOrigin list is explicitly set to \"none\"",
"return",
"isTrustedForSensitiveHeaders",
"(",
"hostAddr",
")",
";",
"}",
"if",
"(",
"restrictPrivateHeaderOrigin",
"==",
"null",
")",
"{",
"// trustedHeaderOrigin list is set to \"*\"",
"return",
"true",
";",
"}",
"else",
"{",
"// check trustedHeaderOrigin for given host IP",
"boolean",
"trustedOrigin",
"=",
"restrictPrivateHeaderOrigin",
".",
"contains",
"(",
"hostAddr",
".",
"toLowerCase",
"(",
")",
")",
";",
"if",
"(",
"!",
"trustedOrigin",
")",
"{",
"// if hostAddr is not in trustedHeaderOrigin, allow trustedSensitiveHeaderOrigin to override trust",
"trustedOrigin",
"=",
"isTrustedForSensitiveHeaders",
"(",
"hostAddr",
")",
";",
"}",
"return",
"trustedOrigin",
";",
"}",
"}"
] | Check to see if the source host address is one we allow for specification of private headers
This takes into account the hosts defined in trustedHeaderOrigin and trustedSensitiveHeaderOrigin. Note,
trustedSensitiveHeaderOrigin takes precedence over trustedHeaderOrigin; so if trustedHeaderOrigin="none"
while trustedSensitiveHeaderOrigin="*", non-sensitive headers will still be trusted for all hosts.
@param hostAddr The source host address
@return true if hostAddr is a trusted source of private headers | [
"Check",
"to",
"see",
"if",
"the",
"source",
"host",
"address",
"is",
"one",
"we",
"allow",
"for",
"specification",
"of",
"private",
"headers"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/dispatcher/internal/HttpDispatcher.java#L442-L466 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/dispatcher/internal/HttpDispatcher.java | HttpDispatcher.isTrustedForSensitiveHeaders | public boolean isTrustedForSensitiveHeaders(String hostAddr) {
if (!useSensitivePrivateHeaders) {
// trustedSensitiveHeaderOrigin list is either unset (defaults to "none") or explicitly set to "none"
return false;
}
if (restrictSensitiveHeaderOrigin == null) {
// trustedSensitiveHeaderOrigin is set to "*"
return true;
} else {
// check trustedSensitiveHeaderOrigin list for given host IP
return restrictSensitiveHeaderOrigin.contains(hostAddr.toLowerCase());
}
} | java | public boolean isTrustedForSensitiveHeaders(String hostAddr) {
if (!useSensitivePrivateHeaders) {
// trustedSensitiveHeaderOrigin list is either unset (defaults to "none") or explicitly set to "none"
return false;
}
if (restrictSensitiveHeaderOrigin == null) {
// trustedSensitiveHeaderOrigin is set to "*"
return true;
} else {
// check trustedSensitiveHeaderOrigin list for given host IP
return restrictSensitiveHeaderOrigin.contains(hostAddr.toLowerCase());
}
} | [
"public",
"boolean",
"isTrustedForSensitiveHeaders",
"(",
"String",
"hostAddr",
")",
"{",
"if",
"(",
"!",
"useSensitivePrivateHeaders",
")",
"{",
"// trustedSensitiveHeaderOrigin list is either unset (defaults to \"none\") or explicitly set to \"none\"",
"return",
"false",
";",
"}",
"if",
"(",
"restrictSensitiveHeaderOrigin",
"==",
"null",
")",
"{",
"// trustedSensitiveHeaderOrigin is set to \"*\"",
"return",
"true",
";",
"}",
"else",
"{",
"// check trustedSensitiveHeaderOrigin list for given host IP",
"return",
"restrictSensitiveHeaderOrigin",
".",
"contains",
"(",
"hostAddr",
".",
"toLowerCase",
"(",
")",
")",
";",
"}",
"}"
] | Check to see if the source host address is one we allow for specification of sensitive private headers
@param hostAddr The source host address
@return true if hostAddr is a trusted source of sensitive private headers | [
"Check",
"to",
"see",
"if",
"the",
"source",
"host",
"address",
"is",
"one",
"we",
"allow",
"for",
"specification",
"of",
"sensitive",
"private",
"headers"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/dispatcher/internal/HttpDispatcher.java#L474-L486 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/dispatcher/internal/HttpDispatcher.java | HttpDispatcher.getExecutorService | public static ExecutorService getExecutorService() {
HttpDispatcher f = instance.get().get();
if (f == null) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "HttpDispatcher instance not found");
}
return null;
} else {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "HttpDispatcher instance: " + f.toString());
}
return f.executorService;
}
} | java | public static ExecutorService getExecutorService() {
HttpDispatcher f = instance.get().get();
if (f == null) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "HttpDispatcher instance not found");
}
return null;
} else {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "HttpDispatcher instance: " + f.toString());
}
return f.executorService;
}
} | [
"public",
"static",
"ExecutorService",
"getExecutorService",
"(",
")",
"{",
"HttpDispatcher",
"f",
"=",
"instance",
".",
"get",
"(",
")",
".",
"get",
"(",
")",
";",
"if",
"(",
"f",
"==",
"null",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"HttpDispatcher instance not found\"",
")",
";",
"}",
"return",
"null",
";",
"}",
"else",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"HttpDispatcher instance: \"",
"+",
"f",
".",
"toString",
"(",
")",
")",
";",
"}",
"return",
"f",
".",
"executorService",
";",
"}",
"}"
] | Access the collaboration engine.
@return CollaborationEngine - null if not found | [
"Access",
"the",
"collaboration",
"engine",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/dispatcher/internal/HttpDispatcher.java#L597-L611 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/dispatcher/internal/HttpDispatcher.java | HttpDispatcher.getCHFWBundle | public static CHFWBundle getCHFWBundle() {
HttpDispatcher f = instance.get().get();
if (f != null)
return f.chfw;
return null;
} | java | public static CHFWBundle getCHFWBundle() {
HttpDispatcher f = instance.get().get();
if (f != null)
return f.chfw;
return null;
} | [
"public",
"static",
"CHFWBundle",
"getCHFWBundle",
"(",
")",
"{",
"HttpDispatcher",
"f",
"=",
"instance",
".",
"get",
"(",
")",
".",
"get",
"(",
")",
";",
"if",
"(",
"f",
"!=",
"null",
")",
"return",
"f",
".",
"chfw",
";",
"return",
"null",
";",
"}"
] | Access the channel framework bundle.
@return CHFWBundle | [
"Access",
"the",
"channel",
"framework",
"bundle",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/dispatcher/internal/HttpDispatcher.java#L670-L676 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/dispatcher/internal/HttpDispatcher.java | HttpDispatcher.getBufferManager | public static WsByteBufferPoolManager getBufferManager() {
final CHFWBundle chfw = getCHFWBundle();
if (null == chfw) {
return ChannelFrameworkFactory.getBufferManager();
}
return chfw.getBufferManager();
} | java | public static WsByteBufferPoolManager getBufferManager() {
final CHFWBundle chfw = getCHFWBundle();
if (null == chfw) {
return ChannelFrameworkFactory.getBufferManager();
}
return chfw.getBufferManager();
} | [
"public",
"static",
"WsByteBufferPoolManager",
"getBufferManager",
"(",
")",
"{",
"final",
"CHFWBundle",
"chfw",
"=",
"getCHFWBundle",
"(",
")",
";",
"if",
"(",
"null",
"==",
"chfw",
")",
"{",
"return",
"ChannelFrameworkFactory",
".",
"getBufferManager",
"(",
")",
";",
"}",
"return",
"chfw",
".",
"getBufferManager",
"(",
")",
";",
"}"
] | Access the current reference to the bytebuffer pool manager.
@return WsByteBufferPoolManager | [
"Access",
"the",
"current",
"reference",
"to",
"the",
"bytebuffer",
"pool",
"manager",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/dispatcher/internal/HttpDispatcher.java#L683-L689 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/dispatcher/internal/HttpDispatcher.java | HttpDispatcher.getFramework | public static ChannelFramework getFramework() {
final CHFWBundle chfw = getCHFWBundle();
if (null == chfw) {
return ChannelFrameworkFactory.getChannelFramework();
}
return chfw.getFramework();
} | java | public static ChannelFramework getFramework() {
final CHFWBundle chfw = getCHFWBundle();
if (null == chfw) {
return ChannelFrameworkFactory.getChannelFramework();
}
return chfw.getFramework();
} | [
"public",
"static",
"ChannelFramework",
"getFramework",
"(",
")",
"{",
"final",
"CHFWBundle",
"chfw",
"=",
"getCHFWBundle",
"(",
")",
";",
"if",
"(",
"null",
"==",
"chfw",
")",
"{",
"return",
"ChannelFrameworkFactory",
".",
"getChannelFramework",
"(",
")",
";",
"}",
"return",
"chfw",
".",
"getFramework",
"(",
")",
";",
"}"
] | Access the current reference to the channel framework instance.
@return ChannelFramework | [
"Access",
"the",
"current",
"reference",
"to",
"the",
"channel",
"framework",
"instance",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/dispatcher/internal/HttpDispatcher.java#L696-L702 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/dispatcher/internal/HttpDispatcher.java | HttpDispatcher.setWorkClassifier | @Reference(name = "workClassifier", policy = ReferencePolicy.DYNAMIC, cardinality = ReferenceCardinality.OPTIONAL)
protected void setWorkClassifier(WorkClassifier service) {
workClassifier = service;
} | java | @Reference(name = "workClassifier", policy = ReferencePolicy.DYNAMIC, cardinality = ReferenceCardinality.OPTIONAL)
protected void setWorkClassifier(WorkClassifier service) {
workClassifier = service;
} | [
"@",
"Reference",
"(",
"name",
"=",
"\"workClassifier\"",
",",
"policy",
"=",
"ReferencePolicy",
".",
"DYNAMIC",
",",
"cardinality",
"=",
"ReferenceCardinality",
".",
"OPTIONAL",
")",
"protected",
"void",
"setWorkClassifier",
"(",
"WorkClassifier",
"service",
")",
"{",
"workClassifier",
"=",
"service",
";",
"}"
] | DS method for setting the Work Classification service reference.
@param service | [
"DS",
"method",
"for",
"setting",
"the",
"Work",
"Classification",
"service",
"reference",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/dispatcher/internal/HttpDispatcher.java#L739-L742 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/dispatcher/internal/HttpDispatcher.java | HttpDispatcher.getWorkClassifier | public static WorkClassifier getWorkClassifier() {
HttpDispatcher f = instance.get().get();
if (f != null)
return f.workClassifier;
return null;
} | java | public static WorkClassifier getWorkClassifier() {
HttpDispatcher f = instance.get().get();
if (f != null)
return f.workClassifier;
return null;
} | [
"public",
"static",
"WorkClassifier",
"getWorkClassifier",
"(",
")",
"{",
"HttpDispatcher",
"f",
"=",
"instance",
".",
"get",
"(",
")",
".",
"get",
"(",
")",
";",
"if",
"(",
"f",
"!=",
"null",
")",
"return",
"f",
".",
"workClassifier",
";",
"return",
"null",
";",
"}"
] | Access to the WorkClassifier
@return WorkClassifier - null if not found | [
"Access",
"to",
"the",
"WorkClassifier"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/dispatcher/internal/HttpDispatcher.java#L760-L766 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.management.j2ee/src/com/ibm/websphere/management/j2ee/J2EEManagementObjectNameFactory.java | J2EEManagementObjectNameFactory.createObjectName | private static ObjectName createObjectName(String type, String name, Hashtable<String, String> props) {
props.put(KEY_TYPE, type);
props.put(KEY_NAME, name);
try {
return new ObjectName(DOMAIN_NAME, props);
} catch (MalformedObjectNameException e) {
throw new IllegalArgumentException(e);
}
} | java | private static ObjectName createObjectName(String type, String name, Hashtable<String, String> props) {
props.put(KEY_TYPE, type);
props.put(KEY_NAME, name);
try {
return new ObjectName(DOMAIN_NAME, props);
} catch (MalformedObjectNameException e) {
throw new IllegalArgumentException(e);
}
} | [
"private",
"static",
"ObjectName",
"createObjectName",
"(",
"String",
"type",
",",
"String",
"name",
",",
"Hashtable",
"<",
"String",
",",
"String",
">",
"props",
")",
"{",
"props",
".",
"put",
"(",
"KEY_TYPE",
",",
"type",
")",
";",
"props",
".",
"put",
"(",
"KEY_NAME",
",",
"name",
")",
";",
"try",
"{",
"return",
"new",
"ObjectName",
"(",
"DOMAIN_NAME",
",",
"props",
")",
";",
"}",
"catch",
"(",
"MalformedObjectNameException",
"e",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"e",
")",
";",
"}",
"}"
] | Common object name factory method.
The properties table must be an {@link Hashtable} because the object name
constructor {@link Object#ObjectName String, Hashtable)} takes a parameter of
this type.
@param type The type of the object name. See {@link #KEY_TYPE}.
@param name The name of the object name. See {@link #KEY_NAME}.
@param props Properties expressing the attribute values of the object name. | [
"Common",
"object",
"name",
"factory",
"method",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.management.j2ee/src/com/ibm/websphere/management/j2ee/J2EEManagementObjectNameFactory.java#L105-L114 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.management.j2ee/src/com/ibm/websphere/management/j2ee/J2EEManagementObjectNameFactory.java | J2EEManagementObjectNameFactory.createApplicationObjectName | public static ObjectName createApplicationObjectName(String name, String serverName) {
Hashtable<String, String> props = new Hashtable<String, String>();
props.put(TYPE_SERVER, serverName);
return createObjectName(TYPE_APPLICATION, name, props);
} | java | public static ObjectName createApplicationObjectName(String name, String serverName) {
Hashtable<String, String> props = new Hashtable<String, String>();
props.put(TYPE_SERVER, serverName);
return createObjectName(TYPE_APPLICATION, name, props);
} | [
"public",
"static",
"ObjectName",
"createApplicationObjectName",
"(",
"String",
"name",
",",
"String",
"serverName",
")",
"{",
"Hashtable",
"<",
"String",
",",
"String",
">",
"props",
"=",
"new",
"Hashtable",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"props",
".",
"put",
"(",
"TYPE_SERVER",
",",
"serverName",
")",
";",
"return",
"createObjectName",
"(",
"TYPE_APPLICATION",
",",
"name",
",",
"props",
")",
";",
"}"
] | Application and module factory methods ... | [
"Application",
"and",
"module",
"factory",
"methods",
"..."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.management.j2ee/src/com/ibm/websphere/management/j2ee/J2EEManagementObjectNameFactory.java#L134-L138 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.management.j2ee/src/com/ibm/websphere/management/j2ee/J2EEManagementObjectNameFactory.java | J2EEManagementObjectNameFactory.createEJBModuleObjectName | public static ObjectName createEJBModuleObjectName(String uri, String appName, String serverName) {
return createModuleObjectName(ModuleType.EJBModule, uri, appName, serverName);
} | java | public static ObjectName createEJBModuleObjectName(String uri, String appName, String serverName) {
return createModuleObjectName(ModuleType.EJBModule, uri, appName, serverName);
} | [
"public",
"static",
"ObjectName",
"createEJBModuleObjectName",
"(",
"String",
"uri",
",",
"String",
"appName",
",",
"String",
"serverName",
")",
"{",
"return",
"createModuleObjectName",
"(",
"ModuleType",
".",
"EJBModule",
",",
"uri",
",",
"appName",
",",
"serverName",
")",
";",
"}"
] | EJB factory methods ... | [
"EJB",
"factory",
"methods",
"..."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.management.j2ee/src/com/ibm/websphere/management/j2ee/J2EEManagementObjectNameFactory.java#L149-L151 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.management.j2ee/src/com/ibm/websphere/management/j2ee/J2EEManagementObjectNameFactory.java | J2EEManagementObjectNameFactory.createWebModuleObjectName | public static ObjectName createWebModuleObjectName(String moduleURI, String appName, String serverName) {
return createModuleObjectName(ModuleType.WebModule, moduleURI, appName, serverName);
} | java | public static ObjectName createWebModuleObjectName(String moduleURI, String appName, String serverName) {
return createModuleObjectName(ModuleType.WebModule, moduleURI, appName, serverName);
} | [
"public",
"static",
"ObjectName",
"createWebModuleObjectName",
"(",
"String",
"moduleURI",
",",
"String",
"appName",
",",
"String",
"serverName",
")",
"{",
"return",
"createModuleObjectName",
"(",
"ModuleType",
".",
"WebModule",
",",
"moduleURI",
",",
"appName",
",",
"serverName",
")",
";",
"}"
] | Servlet factory methods ... | [
"Servlet",
"factory",
"methods",
"..."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.management.j2ee/src/com/ibm/websphere/management/j2ee/J2EEManagementObjectNameFactory.java#L163-L165 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.management.j2ee/src/com/ibm/websphere/management/j2ee/J2EEManagementObjectNameFactory.java | J2EEManagementObjectNameFactory.createJavaMailObjectName | public static ObjectName createJavaMailObjectName(String serverName, String mailSessionID, int resourceCounter) {
Hashtable<String, String> props = new Hashtable<String, String>();
props.put(TYPE_SERVER, serverName);
props.put(MAIL_SESSION_ID, mailSessionID);
props.put(RESOURCE_ID, TYPE_JAVA_MAIL_RESOURCE + "-" + resourceCounter);
ObjectName objectName;
try {
objectName = createObjectName(TYPE_JAVA_MAIL_RESOURCE, NAME_JAVA_MAIL_RESOURCE, props);
} catch (IllegalArgumentException e) {
// mailSessionID contains illegal characters
props.remove(MAIL_SESSION_ID);
objectName = createObjectName(TYPE_JAVA_MAIL_RESOURCE, NAME_JAVA_MAIL_RESOURCE, props);
}
return objectName;
} | java | public static ObjectName createJavaMailObjectName(String serverName, String mailSessionID, int resourceCounter) {
Hashtable<String, String> props = new Hashtable<String, String>();
props.put(TYPE_SERVER, serverName);
props.put(MAIL_SESSION_ID, mailSessionID);
props.put(RESOURCE_ID, TYPE_JAVA_MAIL_RESOURCE + "-" + resourceCounter);
ObjectName objectName;
try {
objectName = createObjectName(TYPE_JAVA_MAIL_RESOURCE, NAME_JAVA_MAIL_RESOURCE, props);
} catch (IllegalArgumentException e) {
// mailSessionID contains illegal characters
props.remove(MAIL_SESSION_ID);
objectName = createObjectName(TYPE_JAVA_MAIL_RESOURCE, NAME_JAVA_MAIL_RESOURCE, props);
}
return objectName;
} | [
"public",
"static",
"ObjectName",
"createJavaMailObjectName",
"(",
"String",
"serverName",
",",
"String",
"mailSessionID",
",",
"int",
"resourceCounter",
")",
"{",
"Hashtable",
"<",
"String",
",",
"String",
">",
"props",
"=",
"new",
"Hashtable",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"props",
".",
"put",
"(",
"TYPE_SERVER",
",",
"serverName",
")",
";",
"props",
".",
"put",
"(",
"MAIL_SESSION_ID",
",",
"mailSessionID",
")",
";",
"props",
".",
"put",
"(",
"RESOURCE_ID",
",",
"TYPE_JAVA_MAIL_RESOURCE",
"+",
"\"-\"",
"+",
"resourceCounter",
")",
";",
"ObjectName",
"objectName",
";",
"try",
"{",
"objectName",
"=",
"createObjectName",
"(",
"TYPE_JAVA_MAIL_RESOURCE",
",",
"NAME_JAVA_MAIL_RESOURCE",
",",
"props",
")",
";",
"}",
"catch",
"(",
"IllegalArgumentException",
"e",
")",
"{",
"// mailSessionID contains illegal characters",
"props",
".",
"remove",
"(",
"MAIL_SESSION_ID",
")",
";",
"objectName",
"=",
"createObjectName",
"(",
"TYPE_JAVA_MAIL_RESOURCE",
",",
"NAME_JAVA_MAIL_RESOURCE",
",",
"props",
")",
";",
"}",
"return",
"objectName",
";",
"}"
] | Java mail factory methods ... | [
"Java",
"mail",
"factory",
"methods",
"..."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.management.j2ee/src/com/ibm/websphere/management/j2ee/J2EEManagementObjectNameFactory.java#L177-L191 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.management.j2ee/src/com/ibm/websphere/management/j2ee/J2EEManagementObjectNameFactory.java | J2EEManagementObjectNameFactory.createResourceObjectName | public static ObjectName createResourceObjectName(String serverName, String resourceType, String keyName) {
ObjectName objectName;
Hashtable<String, String> props = new Hashtable<String, String>();
props.put(TYPE_SERVER, serverName);
objectName = createObjectName(resourceType, keyName, props);
return objectName;
} | java | public static ObjectName createResourceObjectName(String serverName, String resourceType, String keyName) {
ObjectName objectName;
Hashtable<String, String> props = new Hashtable<String, String>();
props.put(TYPE_SERVER, serverName);
objectName = createObjectName(resourceType, keyName, props);
return objectName;
} | [
"public",
"static",
"ObjectName",
"createResourceObjectName",
"(",
"String",
"serverName",
",",
"String",
"resourceType",
",",
"String",
"keyName",
")",
"{",
"ObjectName",
"objectName",
";",
"Hashtable",
"<",
"String",
",",
"String",
">",
"props",
"=",
"new",
"Hashtable",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"props",
".",
"put",
"(",
"TYPE_SERVER",
",",
"serverName",
")",
";",
"objectName",
"=",
"createObjectName",
"(",
"resourceType",
",",
"keyName",
",",
"props",
")",
";",
"return",
"objectName",
";",
"}"
] | Creates a Resource ObjectName for a Resource MBean
@param serverName
@param keyName
@return ObjectName is the JSR77 spec naming convention for Resource MBeans | [
"Creates",
"a",
"Resource",
"ObjectName",
"for",
"a",
"Resource",
"MBean"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.management.j2ee/src/com/ibm/websphere/management/j2ee/J2EEManagementObjectNameFactory.java#L200-L209 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/application/ResourceHandlerImpl.java | ResourceHandlerImpl.libraryExists | @Override
public boolean libraryExists(String libraryName)
{
FacesContext facesContext = FacesContext.getCurrentInstance();
String localePrefix = getLocalePrefixForLocateResource(facesContext);
final List<String> contracts = facesContext.getResourceLibraryContracts();
String pathToLib = null;
Boolean libraryFound = null;
if (libraryName != null && !ResourceValidationUtils.isValidLibraryName(
libraryName, isAllowSlashesLibraryName()))
{
return false;
}
if (localePrefix != null)
{
//Check with locale
pathToLib = localePrefix + '/' + libraryName;
libraryFound = getResourceLoaderCache().libraryExists(pathToLib);
if (libraryFound != null)
{
return libraryFound.booleanValue();
}
}
libraryFound = getResourceLoaderCache().libraryExists(libraryName);
if (libraryFound != null)
{
return libraryFound.booleanValue();
}
if (localePrefix != null)
{
if (!contracts.isEmpty())
{
for (String contract : contracts)
{
for (ContractResourceLoader loader : getResourceHandlerSupport()
.getContractResourceLoaders())
{
if (loader.libraryExists(pathToLib, contract))
{
getResourceLoaderCache().confirmLibraryExists(pathToLib);
return true;
}
}
}
}
for (ResourceLoader loader : getResourceHandlerSupport()
.getResourceLoaders())
{
if (loader.libraryExists(pathToLib))
{
getResourceLoaderCache().confirmLibraryExists(pathToLib);
return true;
}
}
}
//Check without locale
if (!contracts.isEmpty())
{
for (String contract : contracts)
{
for (ContractResourceLoader loader : getResourceHandlerSupport()
.getContractResourceLoaders())
{
if (loader.libraryExists(libraryName, contract))
{
getResourceLoaderCache().confirmLibraryExists(libraryName);
return true;
}
}
}
}
for (ResourceLoader loader : getResourceHandlerSupport()
.getResourceLoaders())
{
if (loader.libraryExists(libraryName))
{
getResourceLoaderCache().confirmLibraryExists(libraryName);
return true;
}
}
if (localePrefix != null)
{
//Check with locale
getResourceLoaderCache().confirmLibraryNotExists(pathToLib);
}
else
{
getResourceLoaderCache().confirmLibraryNotExists(libraryName);
}
return false;
} | java | @Override
public boolean libraryExists(String libraryName)
{
FacesContext facesContext = FacesContext.getCurrentInstance();
String localePrefix = getLocalePrefixForLocateResource(facesContext);
final List<String> contracts = facesContext.getResourceLibraryContracts();
String pathToLib = null;
Boolean libraryFound = null;
if (libraryName != null && !ResourceValidationUtils.isValidLibraryName(
libraryName, isAllowSlashesLibraryName()))
{
return false;
}
if (localePrefix != null)
{
//Check with locale
pathToLib = localePrefix + '/' + libraryName;
libraryFound = getResourceLoaderCache().libraryExists(pathToLib);
if (libraryFound != null)
{
return libraryFound.booleanValue();
}
}
libraryFound = getResourceLoaderCache().libraryExists(libraryName);
if (libraryFound != null)
{
return libraryFound.booleanValue();
}
if (localePrefix != null)
{
if (!contracts.isEmpty())
{
for (String contract : contracts)
{
for (ContractResourceLoader loader : getResourceHandlerSupport()
.getContractResourceLoaders())
{
if (loader.libraryExists(pathToLib, contract))
{
getResourceLoaderCache().confirmLibraryExists(pathToLib);
return true;
}
}
}
}
for (ResourceLoader loader : getResourceHandlerSupport()
.getResourceLoaders())
{
if (loader.libraryExists(pathToLib))
{
getResourceLoaderCache().confirmLibraryExists(pathToLib);
return true;
}
}
}
//Check without locale
if (!contracts.isEmpty())
{
for (String contract : contracts)
{
for (ContractResourceLoader loader : getResourceHandlerSupport()
.getContractResourceLoaders())
{
if (loader.libraryExists(libraryName, contract))
{
getResourceLoaderCache().confirmLibraryExists(libraryName);
return true;
}
}
}
}
for (ResourceLoader loader : getResourceHandlerSupport()
.getResourceLoaders())
{
if (loader.libraryExists(libraryName))
{
getResourceLoaderCache().confirmLibraryExists(libraryName);
return true;
}
}
if (localePrefix != null)
{
//Check with locale
getResourceLoaderCache().confirmLibraryNotExists(pathToLib);
}
else
{
getResourceLoaderCache().confirmLibraryNotExists(libraryName);
}
return false;
} | [
"@",
"Override",
"public",
"boolean",
"libraryExists",
"(",
"String",
"libraryName",
")",
"{",
"FacesContext",
"facesContext",
"=",
"FacesContext",
".",
"getCurrentInstance",
"(",
")",
";",
"String",
"localePrefix",
"=",
"getLocalePrefixForLocateResource",
"(",
"facesContext",
")",
";",
"final",
"List",
"<",
"String",
">",
"contracts",
"=",
"facesContext",
".",
"getResourceLibraryContracts",
"(",
")",
";",
"String",
"pathToLib",
"=",
"null",
";",
"Boolean",
"libraryFound",
"=",
"null",
";",
"if",
"(",
"libraryName",
"!=",
"null",
"&&",
"!",
"ResourceValidationUtils",
".",
"isValidLibraryName",
"(",
"libraryName",
",",
"isAllowSlashesLibraryName",
"(",
")",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"localePrefix",
"!=",
"null",
")",
"{",
"//Check with locale",
"pathToLib",
"=",
"localePrefix",
"+",
"'",
"'",
"+",
"libraryName",
";",
"libraryFound",
"=",
"getResourceLoaderCache",
"(",
")",
".",
"libraryExists",
"(",
"pathToLib",
")",
";",
"if",
"(",
"libraryFound",
"!=",
"null",
")",
"{",
"return",
"libraryFound",
".",
"booleanValue",
"(",
")",
";",
"}",
"}",
"libraryFound",
"=",
"getResourceLoaderCache",
"(",
")",
".",
"libraryExists",
"(",
"libraryName",
")",
";",
"if",
"(",
"libraryFound",
"!=",
"null",
")",
"{",
"return",
"libraryFound",
".",
"booleanValue",
"(",
")",
";",
"}",
"if",
"(",
"localePrefix",
"!=",
"null",
")",
"{",
"if",
"(",
"!",
"contracts",
".",
"isEmpty",
"(",
")",
")",
"{",
"for",
"(",
"String",
"contract",
":",
"contracts",
")",
"{",
"for",
"(",
"ContractResourceLoader",
"loader",
":",
"getResourceHandlerSupport",
"(",
")",
".",
"getContractResourceLoaders",
"(",
")",
")",
"{",
"if",
"(",
"loader",
".",
"libraryExists",
"(",
"pathToLib",
",",
"contract",
")",
")",
"{",
"getResourceLoaderCache",
"(",
")",
".",
"confirmLibraryExists",
"(",
"pathToLib",
")",
";",
"return",
"true",
";",
"}",
"}",
"}",
"}",
"for",
"(",
"ResourceLoader",
"loader",
":",
"getResourceHandlerSupport",
"(",
")",
".",
"getResourceLoaders",
"(",
")",
")",
"{",
"if",
"(",
"loader",
".",
"libraryExists",
"(",
"pathToLib",
")",
")",
"{",
"getResourceLoaderCache",
"(",
")",
".",
"confirmLibraryExists",
"(",
"pathToLib",
")",
";",
"return",
"true",
";",
"}",
"}",
"}",
"//Check without locale",
"if",
"(",
"!",
"contracts",
".",
"isEmpty",
"(",
")",
")",
"{",
"for",
"(",
"String",
"contract",
":",
"contracts",
")",
"{",
"for",
"(",
"ContractResourceLoader",
"loader",
":",
"getResourceHandlerSupport",
"(",
")",
".",
"getContractResourceLoaders",
"(",
")",
")",
"{",
"if",
"(",
"loader",
".",
"libraryExists",
"(",
"libraryName",
",",
"contract",
")",
")",
"{",
"getResourceLoaderCache",
"(",
")",
".",
"confirmLibraryExists",
"(",
"libraryName",
")",
";",
"return",
"true",
";",
"}",
"}",
"}",
"}",
"for",
"(",
"ResourceLoader",
"loader",
":",
"getResourceHandlerSupport",
"(",
")",
".",
"getResourceLoaders",
"(",
")",
")",
"{",
"if",
"(",
"loader",
".",
"libraryExists",
"(",
"libraryName",
")",
")",
"{",
"getResourceLoaderCache",
"(",
")",
".",
"confirmLibraryExists",
"(",
"libraryName",
")",
";",
"return",
"true",
";",
"}",
"}",
"if",
"(",
"localePrefix",
"!=",
"null",
")",
"{",
"//Check with locale",
"getResourceLoaderCache",
"(",
")",
".",
"confirmLibraryNotExists",
"(",
"pathToLib",
")",
";",
"}",
"else",
"{",
"getResourceLoaderCache",
"(",
")",
".",
"confirmLibraryNotExists",
"(",
"libraryName",
")",
";",
"}",
"return",
"false",
";",
"}"
] | Check if a library exists or not. This is done delegating
to each ResourceLoader used, because each one has a different
prefix and way to load resources. | [
"Check",
"if",
"a",
"library",
"exists",
"or",
"not",
".",
"This",
"is",
"done",
"delegating",
"to",
"each",
"ResourceLoader",
"used",
"because",
"each",
"one",
"has",
"a",
"different",
"prefix",
"and",
"way",
"to",
"load",
"resources",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/application/ResourceHandlerImpl.java#L793-L891 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/AbstractMapEntry.java | AbstractMapEntry.setValue | public Object setValue(Token object) {
Object result = value;
value = object;
return result;
} | java | public Object setValue(Token object) {
Object result = value;
value = object;
return result;
} | [
"public",
"Object",
"setValue",
"(",
"Token",
"object",
")",
"{",
"Object",
"result",
"=",
"value",
";",
"value",
"=",
"object",
";",
"return",
"result",
";",
"}"
] | Sets the value for this entry
@param object the new value
@return the previous value | [
"Sets",
"the",
"value",
"for",
"this",
"entry"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/AbstractMapEntry.java#L73-L77 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/metadata/StandardMatchingStrategy.java | StandardMatchingStrategy.getMatchResponse | @Override
protected MatchResponse getMatchResponse(SecurityConstraint securityConstraint, String resourceName, String method) {
CollectionMatch collectionMatch = getCollectionMatch(securityConstraint.getWebResourceCollections(), resourceName, method);
if (CollectionMatch.RESPONSE_NO_MATCH.equals(collectionMatch)) {
return MatchResponse.NO_MATCH_RESPONSE;
}
if (com.ibm.ws.webcontainer.osgi.WebContainer.getServletContainerSpecLevel() >= 31) {
if (collectionMatch.isExactMatch() && securityConstraint.isAccessUncovered() && securityConstraint.isFromHttpConstraint()) {
return new MatchResponse(securityConstraint.getRoles(), securityConstraint.isSSLRequired(),
securityConstraint.isAccessPrecluded(), CollectionMatch.RESPONSE_PERMIT);
}
}
return new MatchResponse(securityConstraint.getRoles(), securityConstraint.isSSLRequired(),
securityConstraint.isAccessPrecluded(), collectionMatch);
} | java | @Override
protected MatchResponse getMatchResponse(SecurityConstraint securityConstraint, String resourceName, String method) {
CollectionMatch collectionMatch = getCollectionMatch(securityConstraint.getWebResourceCollections(), resourceName, method);
if (CollectionMatch.RESPONSE_NO_MATCH.equals(collectionMatch)) {
return MatchResponse.NO_MATCH_RESPONSE;
}
if (com.ibm.ws.webcontainer.osgi.WebContainer.getServletContainerSpecLevel() >= 31) {
if (collectionMatch.isExactMatch() && securityConstraint.isAccessUncovered() && securityConstraint.isFromHttpConstraint()) {
return new MatchResponse(securityConstraint.getRoles(), securityConstraint.isSSLRequired(),
securityConstraint.isAccessPrecluded(), CollectionMatch.RESPONSE_PERMIT);
}
}
return new MatchResponse(securityConstraint.getRoles(), securityConstraint.isSSLRequired(),
securityConstraint.isAccessPrecluded(), collectionMatch);
} | [
"@",
"Override",
"protected",
"MatchResponse",
"getMatchResponse",
"(",
"SecurityConstraint",
"securityConstraint",
",",
"String",
"resourceName",
",",
"String",
"method",
")",
"{",
"CollectionMatch",
"collectionMatch",
"=",
"getCollectionMatch",
"(",
"securityConstraint",
".",
"getWebResourceCollections",
"(",
")",
",",
"resourceName",
",",
"method",
")",
";",
"if",
"(",
"CollectionMatch",
".",
"RESPONSE_NO_MATCH",
".",
"equals",
"(",
"collectionMatch",
")",
")",
"{",
"return",
"MatchResponse",
".",
"NO_MATCH_RESPONSE",
";",
"}",
"if",
"(",
"com",
".",
"ibm",
".",
"ws",
".",
"webcontainer",
".",
"osgi",
".",
"WebContainer",
".",
"getServletContainerSpecLevel",
"(",
")",
">=",
"31",
")",
"{",
"if",
"(",
"collectionMatch",
".",
"isExactMatch",
"(",
")",
"&&",
"securityConstraint",
".",
"isAccessUncovered",
"(",
")",
"&&",
"securityConstraint",
".",
"isFromHttpConstraint",
"(",
")",
")",
"{",
"return",
"new",
"MatchResponse",
"(",
"securityConstraint",
".",
"getRoles",
"(",
")",
",",
"securityConstraint",
".",
"isSSLRequired",
"(",
")",
",",
"securityConstraint",
".",
"isAccessPrecluded",
"(",
")",
",",
"CollectionMatch",
".",
"RESPONSE_PERMIT",
")",
";",
"}",
"}",
"return",
"new",
"MatchResponse",
"(",
"securityConstraint",
".",
"getRoles",
"(",
")",
",",
"securityConstraint",
".",
"isSSLRequired",
"(",
")",
",",
"securityConstraint",
".",
"isAccessPrecluded",
"(",
")",
",",
"collectionMatch",
")",
";",
"}"
] | Gets the response object that contains the roles, the SSL required
and access precluded indicators. Gets the response using the standard method algorithm.
@param resourceName The resource name.
@param method The HTTP method.
@return | [
"Gets",
"the",
"response",
"object",
"that",
"contains",
"the",
"roles",
"the",
"SSL",
"required",
"and",
"access",
"precluded",
"indicators",
".",
"Gets",
"the",
"response",
"using",
"the",
"standard",
"method",
"algorithm",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/metadata/StandardMatchingStrategy.java#L47-L64 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/osgi/DynamicVirtualHostManager.java | DynamicVirtualHostManager.purge | public void purge() {
synchronized(this){
// Clear all references to VirtualHost objects
for (DynamicVirtualHost host : hostMap.values()) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Purge host : " + host.hashCode() + ", this : " +this);
}
host.getHostConfiguration().setConfiguration(null);
}
hostMap.clear();
}
//do not clear the transport map.
//DS looks after the transport map via set/unset/updateVirtualHost
//transportMap.clear();
} | java | public void purge() {
synchronized(this){
// Clear all references to VirtualHost objects
for (DynamicVirtualHost host : hostMap.values()) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Purge host : " + host.hashCode() + ", this : " +this);
}
host.getHostConfiguration().setConfiguration(null);
}
hostMap.clear();
}
//do not clear the transport map.
//DS looks after the transport map via set/unset/updateVirtualHost
//transportMap.clear();
} | [
"public",
"void",
"purge",
"(",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"// Clear all references to VirtualHost objects",
"for",
"(",
"DynamicVirtualHost",
"host",
":",
"hostMap",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Purge host : \"",
"+",
"host",
".",
"hashCode",
"(",
")",
"+",
"\", this : \"",
"+",
"this",
")",
";",
"}",
"host",
".",
"getHostConfiguration",
"(",
")",
".",
"setConfiguration",
"(",
"null",
")",
";",
"}",
"hostMap",
".",
"clear",
"(",
")",
";",
"}",
"//do not clear the transport map. ",
"//DS looks after the transport map via set/unset/updateVirtualHost",
"//transportMap.clear();",
"}"
] | Called when the webcontainer is deactivated. This will clean up
all maps within the host manager to facilitate garbage collection
and clean up. | [
"Called",
"when",
"the",
"webcontainer",
"is",
"deactivated",
".",
"This",
"will",
"clean",
"up",
"all",
"maps",
"within",
"the",
"host",
"manager",
"to",
"facilitate",
"garbage",
"collection",
"and",
"clean",
"up",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/osgi/DynamicVirtualHostManager.java#L115-L131 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.credentials.ssotoken/src/com/ibm/ws/security/credentials/ssotoken/internal/SSOTokenCredentialProvider.java | SSOTokenCredentialProvider.setSsoTokenCredential | private void setSsoTokenCredential(Subject subject, String principalAccessId)
throws CredentialException {
try {
TokenManager tokenManager = tokenManagerRef.getService();
SingleSignonToken ssoToken = null;
Set<Token> tokens = subject.getPrivateCredentials(Token.class);
if (tokens.isEmpty() == false) {
Token ssoLtpaToken = tokens.iterator().next();
subject.getPrivateCredentials().remove(ssoLtpaToken);
ssoToken = tokenManager.createSSOToken(ssoLtpaToken);
} else {
Map<String, Object> tokenData = new HashMap<String, Object>();
tokenData.put("unique_id", principalAccessId);
ssoToken = tokenManager.createSSOToken(tokenData);
}
subject.getPrivateCredentials().add(ssoToken);
} catch (TokenCreationFailedException e) {
throw new CredentialException(e.getLocalizedMessage());
}
} | java | private void setSsoTokenCredential(Subject subject, String principalAccessId)
throws CredentialException {
try {
TokenManager tokenManager = tokenManagerRef.getService();
SingleSignonToken ssoToken = null;
Set<Token> tokens = subject.getPrivateCredentials(Token.class);
if (tokens.isEmpty() == false) {
Token ssoLtpaToken = tokens.iterator().next();
subject.getPrivateCredentials().remove(ssoLtpaToken);
ssoToken = tokenManager.createSSOToken(ssoLtpaToken);
} else {
Map<String, Object> tokenData = new HashMap<String, Object>();
tokenData.put("unique_id", principalAccessId);
ssoToken = tokenManager.createSSOToken(tokenData);
}
subject.getPrivateCredentials().add(ssoToken);
} catch (TokenCreationFailedException e) {
throw new CredentialException(e.getLocalizedMessage());
}
} | [
"private",
"void",
"setSsoTokenCredential",
"(",
"Subject",
"subject",
",",
"String",
"principalAccessId",
")",
"throws",
"CredentialException",
"{",
"try",
"{",
"TokenManager",
"tokenManager",
"=",
"tokenManagerRef",
".",
"getService",
"(",
")",
";",
"SingleSignonToken",
"ssoToken",
"=",
"null",
";",
"Set",
"<",
"Token",
">",
"tokens",
"=",
"subject",
".",
"getPrivateCredentials",
"(",
"Token",
".",
"class",
")",
";",
"if",
"(",
"tokens",
".",
"isEmpty",
"(",
")",
"==",
"false",
")",
"{",
"Token",
"ssoLtpaToken",
"=",
"tokens",
".",
"iterator",
"(",
")",
".",
"next",
"(",
")",
";",
"subject",
".",
"getPrivateCredentials",
"(",
")",
".",
"remove",
"(",
"ssoLtpaToken",
")",
";",
"ssoToken",
"=",
"tokenManager",
".",
"createSSOToken",
"(",
"ssoLtpaToken",
")",
";",
"}",
"else",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"tokenData",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"tokenData",
".",
"put",
"(",
"\"unique_id\"",
",",
"principalAccessId",
")",
";",
"ssoToken",
"=",
"tokenManager",
".",
"createSSOToken",
"(",
"tokenData",
")",
";",
"}",
"subject",
".",
"getPrivateCredentials",
"(",
")",
".",
"add",
"(",
"ssoToken",
")",
";",
"}",
"catch",
"(",
"TokenCreationFailedException",
"e",
")",
"{",
"throw",
"new",
"CredentialException",
"(",
"e",
".",
"getLocalizedMessage",
"(",
")",
")",
";",
"}",
"}"
] | Create an SSO token for the specified accessId.
@param subject
@param principalAccessId
@throws TokenCreationFailedException | [
"Create",
"an",
"SSO",
"token",
"for",
"the",
"specified",
"accessId",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.credentials.ssotoken/src/com/ibm/ws/security/credentials/ssotoken/internal/SSOTokenCredentialProvider.java#L95-L115 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/MemoryObjectStore.java | MemoryObjectStore.get | public ManagedObject get(Token token)
{
if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) {
trace.entry(this,
cclass,
"get",
token);
trace.exit(this,
cclass,
"get returns null");
}
return null;
// TODO If the memory object store has been restarted after a restart of the ObjectManager,
// TODO we may have reused an ObjectSequenceNumber, in which case rathet than findingin null
// TODO getManagedObject will find a newly created MAnagedObject instead of null.
// TODO Need some kind of ObjectManagerCycle number in the Token!
// TODO Alternatively we know that any Token trying to find the currentToken after restart
// TODO of the ObjectMAnager must have been restored from previous run so it must return
// TODO null and leave the get method the to throw an exception.
// TODO Alternatively we could occasionally save a safe staer sequencenumber, perhaps on e
// TODO checkpoint when the ObjectStopre is serialized anyway.
} | java | public ManagedObject get(Token token)
{
if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) {
trace.entry(this,
cclass,
"get",
token);
trace.exit(this,
cclass,
"get returns null");
}
return null;
// TODO If the memory object store has been restarted after a restart of the ObjectManager,
// TODO we may have reused an ObjectSequenceNumber, in which case rathet than findingin null
// TODO getManagedObject will find a newly created MAnagedObject instead of null.
// TODO Need some kind of ObjectManagerCycle number in the Token!
// TODO Alternatively we know that any Token trying to find the currentToken after restart
// TODO of the ObjectMAnager must have been restored from previous run so it must return
// TODO null and leave the get method the to throw an exception.
// TODO Alternatively we could occasionally save a safe staer sequencenumber, perhaps on e
// TODO checkpoint when the ObjectStopre is serialized anyway.
} | [
"public",
"ManagedObject",
"get",
"(",
"Token",
"token",
")",
"{",
"if",
"(",
"Tracing",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"trace",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"trace",
".",
"entry",
"(",
"this",
",",
"cclass",
",",
"\"get\"",
",",
"token",
")",
";",
"trace",
".",
"exit",
"(",
"this",
",",
"cclass",
",",
"\"get returns null\"",
")",
";",
"}",
"return",
"null",
";",
"// TODO If the memory object store has been restarted after a restart of the ObjectManager,",
"// TODO we may have reused an ObjectSequenceNumber, in which case rathet than findingin null",
"// TODO getManagedObject will find a newly created MAnagedObject instead of null.",
"// TODO Need some kind of ObjectManagerCycle number in the Token!",
"// TODO Alternatively we know that any Token trying to find the currentToken after restart",
"// TODO of the ObjectMAnager must have been restored from previous run so it must return",
"// TODO null and leave the get method the to throw an exception.",
"// TODO Alternatively we could occasionally save a safe staer sequencenumber, perhaps on e",
"// TODO checkpoint when the ObjectStopre is serialized anyway.",
"}"
] | Retrieve an object in the store. For MemoryObjectStores this should only be called for a ManagedObject that was
lost over a restart so null is returned.
@param token representing the object to be retrieved.
@return ManagedObject the object from the store, always null. | [
"Retrieve",
"an",
"object",
"in",
"the",
"store",
".",
"For",
"MemoryObjectStores",
"this",
"should",
"only",
"be",
"called",
"for",
"a",
"ManagedObject",
"that",
"was",
"lost",
"over",
"a",
"restart",
"so",
"null",
"is",
"returned",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/MemoryObjectStore.java#L90-L113 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/MemoryObjectStore.java | MemoryObjectStore.flush | public synchronized void flush()
throws ObjectManagerException
{
if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) {
trace.entry(this,
cclass,
"flush");
trace.exit(this,
cclass,
"flush");
}
} | java | public synchronized void flush()
throws ObjectManagerException
{
if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) {
trace.entry(this,
cclass,
"flush");
trace.exit(this,
cclass,
"flush");
}
} | [
"public",
"synchronized",
"void",
"flush",
"(",
")",
"throws",
"ObjectManagerException",
"{",
"if",
"(",
"Tracing",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"trace",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"trace",
".",
"entry",
"(",
"this",
",",
"cclass",
",",
"\"flush\"",
")",
";",
"trace",
".",
"exit",
"(",
"this",
",",
"cclass",
",",
"\"flush\"",
")",
";",
"}",
"}"
] | For MemoryObjectstore there is nothing to do.
@see com.ibm.ws.objectManager.ObjectStore#flush() | [
"For",
"MemoryObjectstore",
"there",
"is",
"nothing",
"to",
"do",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/MemoryObjectStore.java#L191-L202 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jaxws.ejb/src/com/ibm/ws/jaxws/ejb/EJBJaxWsModuleInfoBuilderHelper.java | EJBJaxWsModuleInfoBuilderHelper.buildEjbWebServiceEndpointInfos | static void buildEjbWebServiceEndpointInfos(EndpointInfoBuilder endpointInfoBuilder, EndpointInfoBuilderContext ctx, JaxWsServerMetaData jaxWsServerMetaData,
List<EJBEndpoint> ejbEndpoints, JaxWsModuleInfo jaxWsModuleInfo) throws UnableToAdaptException {
Set<String> presentedServices = jaxWsModuleInfo.getEndpointImplBeanClassNames();
for (EJBEndpoint ejbEndpoint : ejbEndpoints) {
if (!ejbEndpoint.isWebService()) {
continue;
}
if (presentedServices.contains(ejbEndpoint.getClassName())) {
continue;
}
String ejbName = ejbEndpoint.getJ2EEName().getComponent();
ctx.addContextEnv(JaxWsConstants.ENV_ATTRIBUTE_ENDPOINT_BEAN_NAME, ejbName);
EndpointInfo endpointInfo = endpointInfoBuilder.build(ctx, ejbEndpoint.getClassName(), EndpointType.EJB);
if (endpointInfo != null) {
jaxWsModuleInfo.addEndpointInfo(ejbEndpoint.getName(), endpointInfo);
jaxWsServerMetaData.putEndpointNameAndJ2EENameEntry(ejbName, ejbEndpoint.getJ2EEName());
}
}
} | java | static void buildEjbWebServiceEndpointInfos(EndpointInfoBuilder endpointInfoBuilder, EndpointInfoBuilderContext ctx, JaxWsServerMetaData jaxWsServerMetaData,
List<EJBEndpoint> ejbEndpoints, JaxWsModuleInfo jaxWsModuleInfo) throws UnableToAdaptException {
Set<String> presentedServices = jaxWsModuleInfo.getEndpointImplBeanClassNames();
for (EJBEndpoint ejbEndpoint : ejbEndpoints) {
if (!ejbEndpoint.isWebService()) {
continue;
}
if (presentedServices.contains(ejbEndpoint.getClassName())) {
continue;
}
String ejbName = ejbEndpoint.getJ2EEName().getComponent();
ctx.addContextEnv(JaxWsConstants.ENV_ATTRIBUTE_ENDPOINT_BEAN_NAME, ejbName);
EndpointInfo endpointInfo = endpointInfoBuilder.build(ctx, ejbEndpoint.getClassName(), EndpointType.EJB);
if (endpointInfo != null) {
jaxWsModuleInfo.addEndpointInfo(ejbEndpoint.getName(), endpointInfo);
jaxWsServerMetaData.putEndpointNameAndJ2EENameEntry(ejbName, ejbEndpoint.getJ2EEName());
}
}
} | [
"static",
"void",
"buildEjbWebServiceEndpointInfos",
"(",
"EndpointInfoBuilder",
"endpointInfoBuilder",
",",
"EndpointInfoBuilderContext",
"ctx",
",",
"JaxWsServerMetaData",
"jaxWsServerMetaData",
",",
"List",
"<",
"EJBEndpoint",
">",
"ejbEndpoints",
",",
"JaxWsModuleInfo",
"jaxWsModuleInfo",
")",
"throws",
"UnableToAdaptException",
"{",
"Set",
"<",
"String",
">",
"presentedServices",
"=",
"jaxWsModuleInfo",
".",
"getEndpointImplBeanClassNames",
"(",
")",
";",
"for",
"(",
"EJBEndpoint",
"ejbEndpoint",
":",
"ejbEndpoints",
")",
"{",
"if",
"(",
"!",
"ejbEndpoint",
".",
"isWebService",
"(",
")",
")",
"{",
"continue",
";",
"}",
"if",
"(",
"presentedServices",
".",
"contains",
"(",
"ejbEndpoint",
".",
"getClassName",
"(",
")",
")",
")",
"{",
"continue",
";",
"}",
"String",
"ejbName",
"=",
"ejbEndpoint",
".",
"getJ2EEName",
"(",
")",
".",
"getComponent",
"(",
")",
";",
"ctx",
".",
"addContextEnv",
"(",
"JaxWsConstants",
".",
"ENV_ATTRIBUTE_ENDPOINT_BEAN_NAME",
",",
"ejbName",
")",
";",
"EndpointInfo",
"endpointInfo",
"=",
"endpointInfoBuilder",
".",
"build",
"(",
"ctx",
",",
"ejbEndpoint",
".",
"getClassName",
"(",
")",
",",
"EndpointType",
".",
"EJB",
")",
";",
"if",
"(",
"endpointInfo",
"!=",
"null",
")",
"{",
"jaxWsModuleInfo",
".",
"addEndpointInfo",
"(",
"ejbEndpoint",
".",
"getName",
"(",
")",
",",
"endpointInfo",
")",
";",
"jaxWsServerMetaData",
".",
"putEndpointNameAndJ2EENameEntry",
"(",
"ejbName",
",",
"ejbEndpoint",
".",
"getJ2EEName",
"(",
")",
")",
";",
"}",
"}",
"}"
] | build Web Service endpoint infos
@param endpointInfoBuilder
@param ctx
@param jaxWsServerMetaData
@param ejbEndpoints
@param jaxWsModuleInfo
@return
@throws UnableToAdaptException | [
"build",
"Web",
"Service",
"endpoint",
"infos"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxws.ejb/src/com/ibm/ws/jaxws/ejb/EJBJaxWsModuleInfoBuilderHelper.java#L41-L61 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.common.jsonwebkey/src/com/ibm/ws/security/common/jwk/impl/Jose4jRsaJWK.java | Jose4jRsaJWK.getInstance | public static Jose4jRsaJWK getInstance(int size, String alg, String use, String type) {
String kid = RandomUtils.getRandomAlphaNumeric(KID_LENGTH);
KeyPairGenerator keyGenerator = null;
try {
keyGenerator = KeyPairGenerator.getInstance("RSA");
} catch (NoSuchAlgorithmException e) {
// This should not happen, since we hardcoded as "RSA"
if (tc.isDebugEnabled()) {
Tr.debug(tc, "Caught unexpected exception: " + e.getLocalizedMessage(), e);
}
return null;
}
keyGenerator.initialize(size);
KeyPair keypair = keyGenerator.generateKeyPair();
RSAPublicKey pubKey = (RSAPublicKey) keypair.getPublic();
RSAPrivateKey priKey = (RSAPrivateKey) keypair.getPrivate();
Jose4jRsaJWK jwk = new Jose4jRsaJWK(pubKey);
jwk.setPrivateKey(priKey);
jwk.setAlgorithm(alg);
jwk.setKeyId(kid);
jwk.setUse((use == null) ? JwkConstants.sig : use);
return jwk;
} | java | public static Jose4jRsaJWK getInstance(int size, String alg, String use, String type) {
String kid = RandomUtils.getRandomAlphaNumeric(KID_LENGTH);
KeyPairGenerator keyGenerator = null;
try {
keyGenerator = KeyPairGenerator.getInstance("RSA");
} catch (NoSuchAlgorithmException e) {
// This should not happen, since we hardcoded as "RSA"
if (tc.isDebugEnabled()) {
Tr.debug(tc, "Caught unexpected exception: " + e.getLocalizedMessage(), e);
}
return null;
}
keyGenerator.initialize(size);
KeyPair keypair = keyGenerator.generateKeyPair();
RSAPublicKey pubKey = (RSAPublicKey) keypair.getPublic();
RSAPrivateKey priKey = (RSAPrivateKey) keypair.getPrivate();
Jose4jRsaJWK jwk = new Jose4jRsaJWK(pubKey);
jwk.setPrivateKey(priKey);
jwk.setAlgorithm(alg);
jwk.setKeyId(kid);
jwk.setUse((use == null) ? JwkConstants.sig : use);
return jwk;
} | [
"public",
"static",
"Jose4jRsaJWK",
"getInstance",
"(",
"int",
"size",
",",
"String",
"alg",
",",
"String",
"use",
",",
"String",
"type",
")",
"{",
"String",
"kid",
"=",
"RandomUtils",
".",
"getRandomAlphaNumeric",
"(",
"KID_LENGTH",
")",
";",
"KeyPairGenerator",
"keyGenerator",
"=",
"null",
";",
"try",
"{",
"keyGenerator",
"=",
"KeyPairGenerator",
".",
"getInstance",
"(",
"\"RSA\"",
")",
";",
"}",
"catch",
"(",
"NoSuchAlgorithmException",
"e",
")",
"{",
"// This should not happen, since we hardcoded as \"RSA\"",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Caught unexpected exception: \"",
"+",
"e",
".",
"getLocalizedMessage",
"(",
")",
",",
"e",
")",
";",
"}",
"return",
"null",
";",
"}",
"keyGenerator",
".",
"initialize",
"(",
"size",
")",
";",
"KeyPair",
"keypair",
"=",
"keyGenerator",
".",
"generateKeyPair",
"(",
")",
";",
"RSAPublicKey",
"pubKey",
"=",
"(",
"RSAPublicKey",
")",
"keypair",
".",
"getPublic",
"(",
")",
";",
"RSAPrivateKey",
"priKey",
"=",
"(",
"RSAPrivateKey",
")",
"keypair",
".",
"getPrivate",
"(",
")",
";",
"Jose4jRsaJWK",
"jwk",
"=",
"new",
"Jose4jRsaJWK",
"(",
"pubKey",
")",
";",
"jwk",
".",
"setPrivateKey",
"(",
"priKey",
")",
";",
"jwk",
".",
"setAlgorithm",
"(",
"alg",
")",
";",
"jwk",
".",
"setKeyId",
"(",
"kid",
")",
";",
"jwk",
".",
"setUse",
"(",
"(",
"use",
"==",
"null",
")",
"?",
"JwkConstants",
".",
"sig",
":",
"use",
")",
";",
"return",
"jwk",
";",
"}"
] | generate a new JWK with the specified parameters
@param size
@param alg
@param use
@param type
@return | [
"generate",
"a",
"new",
"JWK",
"with",
"the",
"specified",
"parameters"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.common.jsonwebkey/src/com/ibm/ws/security/common/jwk/impl/Jose4jRsaJWK.java#L60-L87 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.common.jsonwebkey/src/com/ibm/ws/security/common/jwk/impl/Jose4jRsaJWK.java | Jose4jRsaJWK.getInstance | public static Jose4jRsaJWK getInstance(String alg, String use, PublicKey publicKey, PrivateKey privateKey, String kid) {
//String kid = RandomUtils.getRandomAlphaNumeric(KID_LENGTH);
RSAPublicKey pubKey = (RSAPublicKey) publicKey;
RSAPrivateKey priKey = (RSAPrivateKey) privateKey;
Jose4jRsaJWK jwk = new Jose4jRsaJWK(pubKey);
jwk.setPrivateKey(priKey);
jwk.setAlgorithm(alg);
jwk.setKeyId(kid);
jwk.setUse(use == null ? JwkConstants.sig : use);
return jwk;
} | java | public static Jose4jRsaJWK getInstance(String alg, String use, PublicKey publicKey, PrivateKey privateKey, String kid) {
//String kid = RandomUtils.getRandomAlphaNumeric(KID_LENGTH);
RSAPublicKey pubKey = (RSAPublicKey) publicKey;
RSAPrivateKey priKey = (RSAPrivateKey) privateKey;
Jose4jRsaJWK jwk = new Jose4jRsaJWK(pubKey);
jwk.setPrivateKey(priKey);
jwk.setAlgorithm(alg);
jwk.setKeyId(kid);
jwk.setUse(use == null ? JwkConstants.sig : use);
return jwk;
} | [
"public",
"static",
"Jose4jRsaJWK",
"getInstance",
"(",
"String",
"alg",
",",
"String",
"use",
",",
"PublicKey",
"publicKey",
",",
"PrivateKey",
"privateKey",
",",
"String",
"kid",
")",
"{",
"//String kid = RandomUtils.getRandomAlphaNumeric(KID_LENGTH);",
"RSAPublicKey",
"pubKey",
"=",
"(",
"RSAPublicKey",
")",
"publicKey",
";",
"RSAPrivateKey",
"priKey",
"=",
"(",
"RSAPrivateKey",
")",
"privateKey",
";",
"Jose4jRsaJWK",
"jwk",
"=",
"new",
"Jose4jRsaJWK",
"(",
"pubKey",
")",
";",
"jwk",
".",
"setPrivateKey",
"(",
"priKey",
")",
";",
"jwk",
".",
"setAlgorithm",
"(",
"alg",
")",
";",
"jwk",
".",
"setKeyId",
"(",
"kid",
")",
";",
"jwk",
".",
"setUse",
"(",
"use",
"==",
"null",
"?",
"JwkConstants",
".",
"sig",
":",
"use",
")",
";",
"return",
"jwk",
";",
"}"
] | alg, use, publicKey, privateKey | [
"alg",
"use",
"publicKey",
"privateKey"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.common.jsonwebkey/src/com/ibm/ws/security/common/jwk/impl/Jose4jRsaJWK.java#L118-L131 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.org.apache.cxf.cxf.rt.frontend.jaxrs.3.2/src/org/apache/cxf/jaxrs/JAXRSInvoker.java | JAXRSInvoker.reprocessFormParams | private List<Object> reprocessFormParams(Method method, List<Object> origParams, Message m) {
Form form = null;
boolean hasFormParamAnnotations = false;
Object[] newValues = new Object[origParams.size()];
java.lang.reflect.Parameter[] methodParams = method.getParameters();
for (int i = 0; i < methodParams.length; i++) {
if (Form.class.equals(methodParams[i].getType())) {
form = (Form) origParams.get(i);
}
if (methodParams[i].getAnnotation(FormParam.class) != null) {
hasFormParamAnnotations = true;
} else {
newValues[i] = origParams.get(i);
}
}
if (!hasFormParamAnnotations || form == null) {
return origParams;
}
for (int i = 0; i < newValues.length; i++) {
if (newValues[i] == null) {
String formFieldName = methodParams[i].getAnnotation(FormParam.class).value();
List<String> values = form.asMap().get(formFieldName);
newValues[i] = InjectionUtils.createParameterObject(values,
methodParams[i].getType(),
methodParams[i].getParameterizedType(),
methodParams[i].getAnnotations(),
(String) origParams.get(i),
false,
ParameterType.FORM,
m);
if (LOG.isLoggable(Level.FINEST)) {
LOG.log(Level.FINEST, "replacing @FormParam value of {0} with {1}",
new Object[]{origParams.get(i), newValues[i]});
}
}
}
return Arrays.asList(newValues);
} | java | private List<Object> reprocessFormParams(Method method, List<Object> origParams, Message m) {
Form form = null;
boolean hasFormParamAnnotations = false;
Object[] newValues = new Object[origParams.size()];
java.lang.reflect.Parameter[] methodParams = method.getParameters();
for (int i = 0; i < methodParams.length; i++) {
if (Form.class.equals(methodParams[i].getType())) {
form = (Form) origParams.get(i);
}
if (methodParams[i].getAnnotation(FormParam.class) != null) {
hasFormParamAnnotations = true;
} else {
newValues[i] = origParams.get(i);
}
}
if (!hasFormParamAnnotations || form == null) {
return origParams;
}
for (int i = 0; i < newValues.length; i++) {
if (newValues[i] == null) {
String formFieldName = methodParams[i].getAnnotation(FormParam.class).value();
List<String> values = form.asMap().get(formFieldName);
newValues[i] = InjectionUtils.createParameterObject(values,
methodParams[i].getType(),
methodParams[i].getParameterizedType(),
methodParams[i].getAnnotations(),
(String) origParams.get(i),
false,
ParameterType.FORM,
m);
if (LOG.isLoggable(Level.FINEST)) {
LOG.log(Level.FINEST, "replacing @FormParam value of {0} with {1}",
new Object[]{origParams.get(i), newValues[i]});
}
}
}
return Arrays.asList(newValues);
} | [
"private",
"List",
"<",
"Object",
">",
"reprocessFormParams",
"(",
"Method",
"method",
",",
"List",
"<",
"Object",
">",
"origParams",
",",
"Message",
"m",
")",
"{",
"Form",
"form",
"=",
"null",
";",
"boolean",
"hasFormParamAnnotations",
"=",
"false",
";",
"Object",
"[",
"]",
"newValues",
"=",
"new",
"Object",
"[",
"origParams",
".",
"size",
"(",
")",
"]",
";",
"java",
".",
"lang",
".",
"reflect",
".",
"Parameter",
"[",
"]",
"methodParams",
"=",
"method",
".",
"getParameters",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"methodParams",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"Form",
".",
"class",
".",
"equals",
"(",
"methodParams",
"[",
"i",
"]",
".",
"getType",
"(",
")",
")",
")",
"{",
"form",
"=",
"(",
"Form",
")",
"origParams",
".",
"get",
"(",
"i",
")",
";",
"}",
"if",
"(",
"methodParams",
"[",
"i",
"]",
".",
"getAnnotation",
"(",
"FormParam",
".",
"class",
")",
"!=",
"null",
")",
"{",
"hasFormParamAnnotations",
"=",
"true",
";",
"}",
"else",
"{",
"newValues",
"[",
"i",
"]",
"=",
"origParams",
".",
"get",
"(",
"i",
")",
";",
"}",
"}",
"if",
"(",
"!",
"hasFormParamAnnotations",
"||",
"form",
"==",
"null",
")",
"{",
"return",
"origParams",
";",
"}",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"newValues",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"newValues",
"[",
"i",
"]",
"==",
"null",
")",
"{",
"String",
"formFieldName",
"=",
"methodParams",
"[",
"i",
"]",
".",
"getAnnotation",
"(",
"FormParam",
".",
"class",
")",
".",
"value",
"(",
")",
";",
"List",
"<",
"String",
">",
"values",
"=",
"form",
".",
"asMap",
"(",
")",
".",
"get",
"(",
"formFieldName",
")",
";",
"newValues",
"[",
"i",
"]",
"=",
"InjectionUtils",
".",
"createParameterObject",
"(",
"values",
",",
"methodParams",
"[",
"i",
"]",
".",
"getType",
"(",
")",
",",
"methodParams",
"[",
"i",
"]",
".",
"getParameterizedType",
"(",
")",
",",
"methodParams",
"[",
"i",
"]",
".",
"getAnnotations",
"(",
")",
",",
"(",
"String",
")",
"origParams",
".",
"get",
"(",
"i",
")",
",",
"false",
",",
"ParameterType",
".",
"FORM",
",",
"m",
")",
";",
"if",
"(",
"LOG",
".",
"isLoggable",
"(",
"Level",
".",
"FINEST",
")",
")",
"{",
"LOG",
".",
"log",
"(",
"Level",
".",
"FINEST",
",",
"\"replacing @FormParam value of {0} with {1}\"",
",",
"new",
"Object",
"[",
"]",
"{",
"origParams",
".",
"get",
"(",
"i",
")",
",",
"newValues",
"[",
"i",
"]",
"}",
")",
";",
"}",
"}",
"}",
"return",
"Arrays",
".",
"asList",
"(",
"newValues",
")",
";",
"}"
] | Liberty change start - CXF-7860 | [
"Liberty",
"change",
"start",
"-",
"CXF",
"-",
"7860"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.org.apache.cxf.cxf.rt.frontend.jaxrs.3.2/src/org/apache/cxf/jaxrs/JAXRSInvoker.java#L313-L352 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/RepositoryResolutionException.java | RepositoryResolutionException.filterVersions | private Collection<LibertyVersion> filterVersions(Collection<LibertyVersion> minimumVersions, String version) {
LibertyVersion versionToMatch = LibertyVersion.valueOf(version);
if (versionToMatch == null) {
return minimumVersions;
}
Collection<LibertyVersion> filteredVersions = new HashSet<LibertyVersion>();
for (LibertyVersion versionToTest : minimumVersions) {
if (versionToTest.matchesToMicros(versionToMatch)) {
filteredVersions.add(versionToTest);
}
}
return filteredVersions;
} | java | private Collection<LibertyVersion> filterVersions(Collection<LibertyVersion> minimumVersions, String version) {
LibertyVersion versionToMatch = LibertyVersion.valueOf(version);
if (versionToMatch == null) {
return minimumVersions;
}
Collection<LibertyVersion> filteredVersions = new HashSet<LibertyVersion>();
for (LibertyVersion versionToTest : minimumVersions) {
if (versionToTest.matchesToMicros(versionToMatch)) {
filteredVersions.add(versionToTest);
}
}
return filteredVersions;
} | [
"private",
"Collection",
"<",
"LibertyVersion",
">",
"filterVersions",
"(",
"Collection",
"<",
"LibertyVersion",
">",
"minimumVersions",
",",
"String",
"version",
")",
"{",
"LibertyVersion",
"versionToMatch",
"=",
"LibertyVersion",
".",
"valueOf",
"(",
"version",
")",
";",
"if",
"(",
"versionToMatch",
"==",
"null",
")",
"{",
"return",
"minimumVersions",
";",
"}",
"Collection",
"<",
"LibertyVersion",
">",
"filteredVersions",
"=",
"new",
"HashSet",
"<",
"LibertyVersion",
">",
"(",
")",
";",
"for",
"(",
"LibertyVersion",
"versionToTest",
":",
"minimumVersions",
")",
"{",
"if",
"(",
"versionToTest",
".",
"matchesToMicros",
"(",
"versionToMatch",
")",
")",
"{",
"filteredVersions",
".",
"add",
"(",
"versionToTest",
")",
";",
"}",
"}",
"return",
"filteredVersions",
";",
"}"
] | This will filter the supplied versions to make sure they all have the same major, minor and micro parts as the supplied version. This may return the original collection.
@param minimumVersions
@param version
@return The filtered versions, may be empty but won't be <code>null</code> | [
"This",
"will",
"filter",
"the",
"supplied",
"versions",
"to",
"make",
"sure",
"they",
"all",
"have",
"the",
"same",
"major",
"minor",
"and",
"micro",
"parts",
"as",
"the",
"supplied",
"version",
".",
"This",
"may",
"return",
"the",
"original",
"collection",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/RepositoryResolutionException.java#L125-L137 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/flow/impl/DefaultFacesFlowProvider.java | DefaultFacesFlowProvider.createOrRestoreMap | Map<Object, Object> createOrRestoreMap(FacesContext context, String prefix,
boolean create)
{
ExternalContext external = context.getExternalContext();
Map<String, Object> sessionMap = external.getSessionMap();
Map<Object, Object> map = (Map<Object, Object>) sessionMap.get(prefix);
if (map == null && create)
{
map = new ConcurrentHashMap<Object, Object>();
sessionMap.put(prefix, map);
}
return map;
} | java | Map<Object, Object> createOrRestoreMap(FacesContext context, String prefix,
boolean create)
{
ExternalContext external = context.getExternalContext();
Map<String, Object> sessionMap = external.getSessionMap();
Map<Object, Object> map = (Map<Object, Object>) sessionMap.get(prefix);
if (map == null && create)
{
map = new ConcurrentHashMap<Object, Object>();
sessionMap.put(prefix, map);
}
return map;
} | [
"Map",
"<",
"Object",
",",
"Object",
">",
"createOrRestoreMap",
"(",
"FacesContext",
"context",
",",
"String",
"prefix",
",",
"boolean",
"create",
")",
"{",
"ExternalContext",
"external",
"=",
"context",
".",
"getExternalContext",
"(",
")",
";",
"Map",
"<",
"String",
",",
"Object",
">",
"sessionMap",
"=",
"external",
".",
"getSessionMap",
"(",
")",
";",
"Map",
"<",
"Object",
",",
"Object",
">",
"map",
"=",
"(",
"Map",
"<",
"Object",
",",
"Object",
">",
")",
"sessionMap",
".",
"get",
"(",
"prefix",
")",
";",
"if",
"(",
"map",
"==",
"null",
"&&",
"create",
")",
"{",
"map",
"=",
"new",
"ConcurrentHashMap",
"<",
"Object",
",",
"Object",
">",
"(",
")",
";",
"sessionMap",
".",
"put",
"(",
"prefix",
",",
"map",
")",
";",
"}",
"return",
"map",
";",
"}"
] | Create a new subkey-wrapper of the session map with the given prefix.
This wrapper is used to implement the maps for the flash scope.
For more information see the SubKeyMap doc. | [
"Create",
"a",
"new",
"subkey",
"-",
"wrapper",
"of",
"the",
"session",
"map",
"with",
"the",
"given",
"prefix",
".",
"This",
"wrapper",
"is",
"used",
"to",
"implement",
"the",
"maps",
"for",
"the",
"flash",
"scope",
".",
"For",
"more",
"information",
"see",
"the",
"SubKeyMap",
"doc",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/flow/impl/DefaultFacesFlowProvider.java#L122-L135 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/security/config/tss/TSSConfigHelper.java | TSSConfigHelper.getTSSConfig | public static TSSConfig getTSSConfig(Map<String, Object> props, Map<OptionsKey, List<TransportAddress>> addrMap, Bundle bundle) throws Exception {
TSSConfig tssConfig = new TSSConfig();
List<Map<String, Object>> tssConfigs = Nester.nest(CSIV2_CONFIGURATION, props);
if (!tssConfigs.isEmpty()) {
Map<String, Object> properties = tssConfigs.get(0);
// tssConfig.setInherit((Boolean) properties.get(INHERIT));
List<Map<String, Object>> mechList = Nester.nest(COMPOUND_SEC_MECH_TYPE_LIST, properties);
//TODO liberty get the ssl transport info from the corbabean?
// List<Map<String, Object>> transportMechGroups = mechInfo.get(SSL_OPTIONS);
// if (!transportMechGroups.isEmpty()) {
// Map<String, Object> transportMechGroup = transportMechGroups.get(0);
// String type = (String) transportMechGroup.get(CONFIG_REFERENCE_TYPE);
// if (SSL_TRANSPORT_MECH.equals(type)) {
// tssConfig.setTransport_mech(extractSSL(transportMechGroup));
// } else if (SECIOP_TRANSPORT_MECH.equals(type)) {
// throw new IllegalStateException("SECIOP processing not implemented");
// } else {
// throw new IllegalStateException("Unrecognized transport mech type: " + type);
// }
// } else {
// tssConfig.setTransport_mech(new TSSNULLTransportConfig());
// }
// List<Map<String, Object>> secmechlists = mechInfo.get(COMPOUND_SEC_MECH_TYPE_LIST);
// if (!secmechlists.isEmpty()) {
// Map<String, Object> secMechList = secmechlists.get(0);
TSSCompoundSecMechListConfig mechListConfig = tssConfig.getMechListConfig();
mechListConfig.setStateful((Boolean) properties.get(STATEFUL));
// List<Map<String, Object>> mechList = Nester.nest(COMPOUND_SECH_MECH_LIST, secMechList);
for (Map<String, Object> mech : mechList) {
TSSCompoundSecMechConfig cMech = extractCompoundSecMech(mech, addrMap, bundle);
// cMech.setTransport_mech(tssConfig.getTransport_mech());
mechListConfig.add(cMech);
}
// }
}
return tssConfig;
} | java | public static TSSConfig getTSSConfig(Map<String, Object> props, Map<OptionsKey, List<TransportAddress>> addrMap, Bundle bundle) throws Exception {
TSSConfig tssConfig = new TSSConfig();
List<Map<String, Object>> tssConfigs = Nester.nest(CSIV2_CONFIGURATION, props);
if (!tssConfigs.isEmpty()) {
Map<String, Object> properties = tssConfigs.get(0);
// tssConfig.setInherit((Boolean) properties.get(INHERIT));
List<Map<String, Object>> mechList = Nester.nest(COMPOUND_SEC_MECH_TYPE_LIST, properties);
//TODO liberty get the ssl transport info from the corbabean?
// List<Map<String, Object>> transportMechGroups = mechInfo.get(SSL_OPTIONS);
// if (!transportMechGroups.isEmpty()) {
// Map<String, Object> transportMechGroup = transportMechGroups.get(0);
// String type = (String) transportMechGroup.get(CONFIG_REFERENCE_TYPE);
// if (SSL_TRANSPORT_MECH.equals(type)) {
// tssConfig.setTransport_mech(extractSSL(transportMechGroup));
// } else if (SECIOP_TRANSPORT_MECH.equals(type)) {
// throw new IllegalStateException("SECIOP processing not implemented");
// } else {
// throw new IllegalStateException("Unrecognized transport mech type: " + type);
// }
// } else {
// tssConfig.setTransport_mech(new TSSNULLTransportConfig());
// }
// List<Map<String, Object>> secmechlists = mechInfo.get(COMPOUND_SEC_MECH_TYPE_LIST);
// if (!secmechlists.isEmpty()) {
// Map<String, Object> secMechList = secmechlists.get(0);
TSSCompoundSecMechListConfig mechListConfig = tssConfig.getMechListConfig();
mechListConfig.setStateful((Boolean) properties.get(STATEFUL));
// List<Map<String, Object>> mechList = Nester.nest(COMPOUND_SECH_MECH_LIST, secMechList);
for (Map<String, Object> mech : mechList) {
TSSCompoundSecMechConfig cMech = extractCompoundSecMech(mech, addrMap, bundle);
// cMech.setTransport_mech(tssConfig.getTransport_mech());
mechListConfig.add(cMech);
}
// }
}
return tssConfig;
} | [
"public",
"static",
"TSSConfig",
"getTSSConfig",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"props",
",",
"Map",
"<",
"OptionsKey",
",",
"List",
"<",
"TransportAddress",
">",
">",
"addrMap",
",",
"Bundle",
"bundle",
")",
"throws",
"Exception",
"{",
"TSSConfig",
"tssConfig",
"=",
"new",
"TSSConfig",
"(",
")",
";",
"List",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
"tssConfigs",
"=",
"Nester",
".",
"nest",
"(",
"CSIV2_CONFIGURATION",
",",
"props",
")",
";",
"if",
"(",
"!",
"tssConfigs",
".",
"isEmpty",
"(",
")",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
"=",
"tssConfigs",
".",
"get",
"(",
"0",
")",
";",
"// tssConfig.setInherit((Boolean) properties.get(INHERIT));",
"List",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
"mechList",
"=",
"Nester",
".",
"nest",
"(",
"COMPOUND_SEC_MECH_TYPE_LIST",
",",
"properties",
")",
";",
"//TODO liberty get the ssl transport info from the corbabean?",
"// List<Map<String, Object>> transportMechGroups = mechInfo.get(SSL_OPTIONS);",
"// if (!transportMechGroups.isEmpty()) {",
"// Map<String, Object> transportMechGroup = transportMechGroups.get(0);",
"// String type = (String) transportMechGroup.get(CONFIG_REFERENCE_TYPE);",
"// if (SSL_TRANSPORT_MECH.equals(type)) {",
"// tssConfig.setTransport_mech(extractSSL(transportMechGroup));",
"// } else if (SECIOP_TRANSPORT_MECH.equals(type)) {",
"// throw new IllegalStateException(\"SECIOP processing not implemented\");",
"// } else {",
"// throw new IllegalStateException(\"Unrecognized transport mech type: \" + type);",
"// }",
"// } else {",
"// tssConfig.setTransport_mech(new TSSNULLTransportConfig());",
"// }",
"// List<Map<String, Object>> secmechlists = mechInfo.get(COMPOUND_SEC_MECH_TYPE_LIST);",
"// if (!secmechlists.isEmpty()) {",
"// Map<String, Object> secMechList = secmechlists.get(0);",
"TSSCompoundSecMechListConfig",
"mechListConfig",
"=",
"tssConfig",
".",
"getMechListConfig",
"(",
")",
";",
"mechListConfig",
".",
"setStateful",
"(",
"(",
"Boolean",
")",
"properties",
".",
"get",
"(",
"STATEFUL",
")",
")",
";",
"// List<Map<String, Object>> mechList = Nester.nest(COMPOUND_SECH_MECH_LIST, secMechList);",
"for",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"mech",
":",
"mechList",
")",
"{",
"TSSCompoundSecMechConfig",
"cMech",
"=",
"extractCompoundSecMech",
"(",
"mech",
",",
"addrMap",
",",
"bundle",
")",
";",
"// cMech.setTransport_mech(tssConfig.getTransport_mech());",
"mechListConfig",
".",
"add",
"(",
"cMech",
")",
";",
"}",
"// }",
"}",
"return",
"tssConfig",
";",
"}"
] | Returns a TSSConfig object initialized with the input object
as an XML string.
@param addrMap TODO
@return a TSSConfig object
@throws org.apache.geronimo.common.propertyeditor.PropertyEditorException
An IOException occured. | [
"Returns",
"a",
"TSSConfig",
"object",
"initialized",
"with",
"the",
"input",
"object",
"as",
"an",
"XML",
"string",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/security/config/tss/TSSConfigHelper.java#L81-L120 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/cache/internal/ZipFileDataStore.java | ZipFileDataStore.addFirst | public ZipFileData addFirst(ZipFileData newFirstData) {
String newFirstPath = newFirstData.path;
Cell dupCell = cells.get(newFirstPath);
if ( dupCell != null ) {
throw new IllegalArgumentException("Path [ " + newFirstPath + " ] is already stored");
}
Cell oldFirstCell = anchor.next;
Cell newFirstCell = new Cell(newFirstData);
cells.put(newFirstPath, newFirstCell);
newFirstCell.putBetween(anchor, oldFirstCell);
return oldFirstCell.data;
} | java | public ZipFileData addFirst(ZipFileData newFirstData) {
String newFirstPath = newFirstData.path;
Cell dupCell = cells.get(newFirstPath);
if ( dupCell != null ) {
throw new IllegalArgumentException("Path [ " + newFirstPath + " ] is already stored");
}
Cell oldFirstCell = anchor.next;
Cell newFirstCell = new Cell(newFirstData);
cells.put(newFirstPath, newFirstCell);
newFirstCell.putBetween(anchor, oldFirstCell);
return oldFirstCell.data;
} | [
"public",
"ZipFileData",
"addFirst",
"(",
"ZipFileData",
"newFirstData",
")",
"{",
"String",
"newFirstPath",
"=",
"newFirstData",
".",
"path",
";",
"Cell",
"dupCell",
"=",
"cells",
".",
"get",
"(",
"newFirstPath",
")",
";",
"if",
"(",
"dupCell",
"!=",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Path [ \"",
"+",
"newFirstPath",
"+",
"\" ] is already stored\"",
")",
";",
"}",
"Cell",
"oldFirstCell",
"=",
"anchor",
".",
"next",
";",
"Cell",
"newFirstCell",
"=",
"new",
"Cell",
"(",
"newFirstData",
")",
";",
"cells",
".",
"put",
"(",
"newFirstPath",
",",
"newFirstCell",
")",
";",
"newFirstCell",
".",
"putBetween",
"(",
"anchor",
",",
"oldFirstCell",
")",
";",
"return",
"oldFirstCell",
".",
"data",
";",
"}"
] | Add data as new first data.
Answer the previous first data.
Throw an exception if the path of the new data is already stored.
@param newFirstData The new data to put as the first stored data.
@return The data which was previously the first stored data. Null
if the store was empty. | [
"Add",
"data",
"as",
"new",
"first",
"data",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/cache/internal/ZipFileDataStore.java#L264-L280 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/cache/internal/ZipFileDataStore.java | ZipFileDataStore.addLast | public ZipFileData addLast(ZipFileData newLastData) {
String newLastPath = newLastData.path;
Cell dupCell = cells.get(newLastPath);
if ( dupCell != null ) {
throw new IllegalArgumentException("Path [ " + newLastPath + " ] is already stored");
}
Cell oldLastCell = anchor.prev;
Cell newLastCell = new Cell(newLastData);
cells.put(newLastPath, newLastCell);
newLastCell.putBetween(oldLastCell, anchor);
return oldLastCell.data;
} | java | public ZipFileData addLast(ZipFileData newLastData) {
String newLastPath = newLastData.path;
Cell dupCell = cells.get(newLastPath);
if ( dupCell != null ) {
throw new IllegalArgumentException("Path [ " + newLastPath + " ] is already stored");
}
Cell oldLastCell = anchor.prev;
Cell newLastCell = new Cell(newLastData);
cells.put(newLastPath, newLastCell);
newLastCell.putBetween(oldLastCell, anchor);
return oldLastCell.data;
} | [
"public",
"ZipFileData",
"addLast",
"(",
"ZipFileData",
"newLastData",
")",
"{",
"String",
"newLastPath",
"=",
"newLastData",
".",
"path",
";",
"Cell",
"dupCell",
"=",
"cells",
".",
"get",
"(",
"newLastPath",
")",
";",
"if",
"(",
"dupCell",
"!=",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Path [ \"",
"+",
"newLastPath",
"+",
"\" ] is already stored\"",
")",
";",
"}",
"Cell",
"oldLastCell",
"=",
"anchor",
".",
"prev",
";",
"Cell",
"newLastCell",
"=",
"new",
"Cell",
"(",
"newLastData",
")",
";",
"cells",
".",
"put",
"(",
"newLastPath",
",",
"newLastCell",
")",
";",
"newLastCell",
".",
"putBetween",
"(",
"oldLastCell",
",",
"anchor",
")",
";",
"return",
"oldLastCell",
".",
"data",
";",
"}"
] | Add data as new last data.
Answer the previous last data.
Throw an exception if the path of the new data is already stored.
@param newLastData The new data to put as the last stored data.
@return The data which was previously the last stored data. Null
if the store was empty. | [
"Add",
"data",
"as",
"new",
"last",
"data",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/cache/internal/ZipFileDataStore.java#L294-L310 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/cache/internal/ZipFileDataStore.java | ZipFileDataStore.addLast | public ZipFileData addLast(ZipFileData newLastData, int maximumSize) {
String newLastPath = newLastData.path;
Cell dupCell = cells.get(newLastPath);
if ( dupCell != null ) {
throw new IllegalArgumentException("Path [ " + newLastPath + " ] is already stored");
}
int size = size();
if ( (maximumSize == -1) || (size < maximumSize) ) {
@SuppressWarnings("unused")
ZipFileData oldLastData = addLast(newLastData);
return null;
}
Cell oldFirstCell = anchor.next;
ZipFileData oldFirstData = oldFirstCell.data;
String oldFirstPath = oldFirstData.path;
if ( oldFirstCell != cells.remove(oldFirstPath) ) {
throw new IllegalStateException("Bad cell alignment on path [ " + oldFirstPath + " ]");
}
oldFirstCell.data = newLastData;
cells.put(newLastPath, oldFirstCell);
if ( size != 1 ) {
oldFirstCell.excise();
oldFirstCell.putBetween(anchor.prev, anchor);
}
return oldFirstData;
} | java | public ZipFileData addLast(ZipFileData newLastData, int maximumSize) {
String newLastPath = newLastData.path;
Cell dupCell = cells.get(newLastPath);
if ( dupCell != null ) {
throw new IllegalArgumentException("Path [ " + newLastPath + " ] is already stored");
}
int size = size();
if ( (maximumSize == -1) || (size < maximumSize) ) {
@SuppressWarnings("unused")
ZipFileData oldLastData = addLast(newLastData);
return null;
}
Cell oldFirstCell = anchor.next;
ZipFileData oldFirstData = oldFirstCell.data;
String oldFirstPath = oldFirstData.path;
if ( oldFirstCell != cells.remove(oldFirstPath) ) {
throw new IllegalStateException("Bad cell alignment on path [ " + oldFirstPath + " ]");
}
oldFirstCell.data = newLastData;
cells.put(newLastPath, oldFirstCell);
if ( size != 1 ) {
oldFirstCell.excise();
oldFirstCell.putBetween(anchor.prev, anchor);
}
return oldFirstData;
} | [
"public",
"ZipFileData",
"addLast",
"(",
"ZipFileData",
"newLastData",
",",
"int",
"maximumSize",
")",
"{",
"String",
"newLastPath",
"=",
"newLastData",
".",
"path",
";",
"Cell",
"dupCell",
"=",
"cells",
".",
"get",
"(",
"newLastPath",
")",
";",
"if",
"(",
"dupCell",
"!=",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Path [ \"",
"+",
"newLastPath",
"+",
"\" ] is already stored\"",
")",
";",
"}",
"int",
"size",
"=",
"size",
"(",
")",
";",
"if",
"(",
"(",
"maximumSize",
"==",
"-",
"1",
")",
"||",
"(",
"size",
"<",
"maximumSize",
")",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"ZipFileData",
"oldLastData",
"=",
"addLast",
"(",
"newLastData",
")",
";",
"return",
"null",
";",
"}",
"Cell",
"oldFirstCell",
"=",
"anchor",
".",
"next",
";",
"ZipFileData",
"oldFirstData",
"=",
"oldFirstCell",
".",
"data",
";",
"String",
"oldFirstPath",
"=",
"oldFirstData",
".",
"path",
";",
"if",
"(",
"oldFirstCell",
"!=",
"cells",
".",
"remove",
"(",
"oldFirstPath",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Bad cell alignment on path [ \"",
"+",
"oldFirstPath",
"+",
"\" ]\"",
")",
";",
"}",
"oldFirstCell",
".",
"data",
"=",
"newLastData",
";",
"cells",
".",
"put",
"(",
"newLastPath",
",",
"oldFirstCell",
")",
";",
"if",
"(",
"size",
"!=",
"1",
")",
"{",
"oldFirstCell",
".",
"excise",
"(",
")",
";",
"oldFirstCell",
".",
"putBetween",
"(",
"anchor",
".",
"prev",
",",
"anchor",
")",
";",
"}",
"return",
"oldFirstData",
";",
"}"
] | Add data as the last data of the store. If the addition pushes a cell
out of the list, answer the data of the cell which was removed.
Throw an exception if the path of the new data is already stored.
@param newLastData The new data to add as the last data of the store.
@param maximumSize The maximum size of the store. '-1' to allow the
store to grow indefinitely.
@return Data which was removed from the store. Null if the store maximum
size has not yet been reached. | [
"Add",
"data",
"as",
"the",
"last",
"data",
"of",
"the",
"store",
".",
"If",
"the",
"addition",
"pushes",
"a",
"cell",
"out",
"of",
"the",
"list",
"answer",
"the",
"data",
"of",
"the",
"cell",
"which",
"was",
"removed",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/cache/internal/ZipFileDataStore.java#L325-L358 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.app.manager/src/com/ibm/ws/app/manager/internal/monitor/ApplicationMonitor.java | ApplicationMonitor.refresh | public void refresh(ApplicationMonitorConfig config) {
_config.set(config);
UpdateTrigger trigger = config.getUpdateTrigger();
if (trigger != UpdateTrigger.DISABLED) {
// Start all existing listeners
for (ApplicationListeners listeners : _appListeners.values()) {
listeners.startListeners(config.getPollingRate(), config.getUpdateTrigger() == UpdateTrigger.MBEAN);
}
} else {
// Stop all existing listeners
for (ApplicationListeners listeners : _appListeners.values()) {
listeners.stopListeners(false);
}
}
} | java | public void refresh(ApplicationMonitorConfig config) {
_config.set(config);
UpdateTrigger trigger = config.getUpdateTrigger();
if (trigger != UpdateTrigger.DISABLED) {
// Start all existing listeners
for (ApplicationListeners listeners : _appListeners.values()) {
listeners.startListeners(config.getPollingRate(), config.getUpdateTrigger() == UpdateTrigger.MBEAN);
}
} else {
// Stop all existing listeners
for (ApplicationListeners listeners : _appListeners.values()) {
listeners.stopListeners(false);
}
}
} | [
"public",
"void",
"refresh",
"(",
"ApplicationMonitorConfig",
"config",
")",
"{",
"_config",
".",
"set",
"(",
"config",
")",
";",
"UpdateTrigger",
"trigger",
"=",
"config",
".",
"getUpdateTrigger",
"(",
")",
";",
"if",
"(",
"trigger",
"!=",
"UpdateTrigger",
".",
"DISABLED",
")",
"{",
"// Start all existing listeners",
"for",
"(",
"ApplicationListeners",
"listeners",
":",
"_appListeners",
".",
"values",
"(",
")",
")",
"{",
"listeners",
".",
"startListeners",
"(",
"config",
".",
"getPollingRate",
"(",
")",
",",
"config",
".",
"getUpdateTrigger",
"(",
")",
"==",
"UpdateTrigger",
".",
"MBEAN",
")",
";",
"}",
"}",
"else",
"{",
"// Stop all existing listeners",
"for",
"(",
"ApplicationListeners",
"listeners",
":",
"_appListeners",
".",
"values",
"(",
")",
")",
"{",
"listeners",
".",
"stopListeners",
"(",
"false",
")",
";",
"}",
"}",
"}"
] | Starts the service with properties
@param properties - a collection of optional variables set by the user in the server xml | [
"Starts",
"the",
"service",
"with",
"properties"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.app.manager/src/com/ibm/ws/app/manager/internal/monitor/ApplicationMonitor.java#L101-L118 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.app.manager/src/com/ibm/ws/app/manager/internal/monitor/ApplicationMonitor.java | ApplicationMonitor.addApplication | @FFDCIgnore(value = UnableToAdaptException.class)
public void addApplication(ApplicationInstallInfo installInfo) {
// ...and now create the new... start by asking the handler what needs monitoring
final Collection<Notification> notificationsToMonitor;
final boolean listenForRootStructuralChanges;
ApplicationMonitoringInformation ami = installInfo.getApplicationMonitoringInformation();
if (ami != null) {
notificationsToMonitor = ami.getNotificationsToMonitor();
listenForRootStructuralChanges = ami.isListeningForRootStructuralChanges();
} else {
notificationsToMonitor = null;
listenForRootStructuralChanges = true;
}
try {
// Now create the listeners for these notifications
ApplicationListeners listeners = new ApplicationListeners(installInfo.getUpdateHandler(), _executorService);
/*
* Go through all of the notifications to monitor and create a listener for it. Note we also always create a different type of listener for root so if the app is
* deleted we
* know about it. Optionally (based on the handler) this might also monitor for files being added or removed from the root to trigger an update, i.e. if a WAR gets
* added to
* the root of an EAR.
*/
if (notificationsToMonitor != null) {
for (Notification notificationToMonitor : notificationsToMonitor) {
ApplicationListener listener = new ApplicationListener(notificationToMonitor, listeners, installInfo);
listeners.addListener(listener);
}
// If the handler did request monitoring then we still need a non-recursive handler to check root
listeners.addListener(new RootApplicationListener(installInfo.getContainer(), listenForRootStructuralChanges, listeners));
} else {
/*
* If the handler didn't give us any information about what to monitor then monitor the whole application, note we use another type of listener again here that will
* monitor for root deletions or updates to any part of the application
*/
listeners.addListener(new CompleteApplicationListener(installInfo.getContainer(), listeners));
}
ApplicationListeners old = _appListeners.put(installInfo.getPid(), listeners);
if (old != null) {
old.stopListeners(true);
}
// If we're actively scanning, start the new listener
ApplicationMonitorConfig config = _config.get();
if (config.getUpdateTrigger() != UpdateTrigger.DISABLED) {
listeners.startListeners(config.getPollingRate(), config.getUpdateTrigger() == UpdateTrigger.MBEAN);
}
} catch (UnableToAdaptException e) {
// Ignore, we just won't monitor this application but do put out a warning message
AppMessageHelper.get(installInfo.getHandler()).warning("APPLICATION_MONITORING_FAIL", installInfo.getName());
}
} | java | @FFDCIgnore(value = UnableToAdaptException.class)
public void addApplication(ApplicationInstallInfo installInfo) {
// ...and now create the new... start by asking the handler what needs monitoring
final Collection<Notification> notificationsToMonitor;
final boolean listenForRootStructuralChanges;
ApplicationMonitoringInformation ami = installInfo.getApplicationMonitoringInformation();
if (ami != null) {
notificationsToMonitor = ami.getNotificationsToMonitor();
listenForRootStructuralChanges = ami.isListeningForRootStructuralChanges();
} else {
notificationsToMonitor = null;
listenForRootStructuralChanges = true;
}
try {
// Now create the listeners for these notifications
ApplicationListeners listeners = new ApplicationListeners(installInfo.getUpdateHandler(), _executorService);
/*
* Go through all of the notifications to monitor and create a listener for it. Note we also always create a different type of listener for root so if the app is
* deleted we
* know about it. Optionally (based on the handler) this might also monitor for files being added or removed from the root to trigger an update, i.e. if a WAR gets
* added to
* the root of an EAR.
*/
if (notificationsToMonitor != null) {
for (Notification notificationToMonitor : notificationsToMonitor) {
ApplicationListener listener = new ApplicationListener(notificationToMonitor, listeners, installInfo);
listeners.addListener(listener);
}
// If the handler did request monitoring then we still need a non-recursive handler to check root
listeners.addListener(new RootApplicationListener(installInfo.getContainer(), listenForRootStructuralChanges, listeners));
} else {
/*
* If the handler didn't give us any information about what to monitor then monitor the whole application, note we use another type of listener again here that will
* monitor for root deletions or updates to any part of the application
*/
listeners.addListener(new CompleteApplicationListener(installInfo.getContainer(), listeners));
}
ApplicationListeners old = _appListeners.put(installInfo.getPid(), listeners);
if (old != null) {
old.stopListeners(true);
}
// If we're actively scanning, start the new listener
ApplicationMonitorConfig config = _config.get();
if (config.getUpdateTrigger() != UpdateTrigger.DISABLED) {
listeners.startListeners(config.getPollingRate(), config.getUpdateTrigger() == UpdateTrigger.MBEAN);
}
} catch (UnableToAdaptException e) {
// Ignore, we just won't monitor this application but do put out a warning message
AppMessageHelper.get(installInfo.getHandler()).warning("APPLICATION_MONITORING_FAIL", installInfo.getName());
}
} | [
"@",
"FFDCIgnore",
"(",
"value",
"=",
"UnableToAdaptException",
".",
"class",
")",
"public",
"void",
"addApplication",
"(",
"ApplicationInstallInfo",
"installInfo",
")",
"{",
"// ...and now create the new... start by asking the handler what needs monitoring",
"final",
"Collection",
"<",
"Notification",
">",
"notificationsToMonitor",
";",
"final",
"boolean",
"listenForRootStructuralChanges",
";",
"ApplicationMonitoringInformation",
"ami",
"=",
"installInfo",
".",
"getApplicationMonitoringInformation",
"(",
")",
";",
"if",
"(",
"ami",
"!=",
"null",
")",
"{",
"notificationsToMonitor",
"=",
"ami",
".",
"getNotificationsToMonitor",
"(",
")",
";",
"listenForRootStructuralChanges",
"=",
"ami",
".",
"isListeningForRootStructuralChanges",
"(",
")",
";",
"}",
"else",
"{",
"notificationsToMonitor",
"=",
"null",
";",
"listenForRootStructuralChanges",
"=",
"true",
";",
"}",
"try",
"{",
"// Now create the listeners for these notifications",
"ApplicationListeners",
"listeners",
"=",
"new",
"ApplicationListeners",
"(",
"installInfo",
".",
"getUpdateHandler",
"(",
")",
",",
"_executorService",
")",
";",
"/*\n * Go through all of the notifications to monitor and create a listener for it. Note we also always create a different type of listener for root so if the app is\n * deleted we\n * know about it. Optionally (based on the handler) this might also monitor for files being added or removed from the root to trigger an update, i.e. if a WAR gets\n * added to\n * the root of an EAR.\n */",
"if",
"(",
"notificationsToMonitor",
"!=",
"null",
")",
"{",
"for",
"(",
"Notification",
"notificationToMonitor",
":",
"notificationsToMonitor",
")",
"{",
"ApplicationListener",
"listener",
"=",
"new",
"ApplicationListener",
"(",
"notificationToMonitor",
",",
"listeners",
",",
"installInfo",
")",
";",
"listeners",
".",
"addListener",
"(",
"listener",
")",
";",
"}",
"// If the handler did request monitoring then we still need a non-recursive handler to check root",
"listeners",
".",
"addListener",
"(",
"new",
"RootApplicationListener",
"(",
"installInfo",
".",
"getContainer",
"(",
")",
",",
"listenForRootStructuralChanges",
",",
"listeners",
")",
")",
";",
"}",
"else",
"{",
"/*\n * If the handler didn't give us any information about what to monitor then monitor the whole application, note we use another type of listener again here that will\n * monitor for root deletions or updates to any part of the application\n */",
"listeners",
".",
"addListener",
"(",
"new",
"CompleteApplicationListener",
"(",
"installInfo",
".",
"getContainer",
"(",
")",
",",
"listeners",
")",
")",
";",
"}",
"ApplicationListeners",
"old",
"=",
"_appListeners",
".",
"put",
"(",
"installInfo",
".",
"getPid",
"(",
")",
",",
"listeners",
")",
";",
"if",
"(",
"old",
"!=",
"null",
")",
"{",
"old",
".",
"stopListeners",
"(",
"true",
")",
";",
"}",
"// If we're actively scanning, start the new listener",
"ApplicationMonitorConfig",
"config",
"=",
"_config",
".",
"get",
"(",
")",
";",
"if",
"(",
"config",
".",
"getUpdateTrigger",
"(",
")",
"!=",
"UpdateTrigger",
".",
"DISABLED",
")",
"{",
"listeners",
".",
"startListeners",
"(",
"config",
".",
"getPollingRate",
"(",
")",
",",
"config",
".",
"getUpdateTrigger",
"(",
")",
"==",
"UpdateTrigger",
".",
"MBEAN",
")",
";",
"}",
"}",
"catch",
"(",
"UnableToAdaptException",
"e",
")",
"{",
"// Ignore, we just won't monitor this application but do put out a warning message",
"AppMessageHelper",
".",
"get",
"(",
"installInfo",
".",
"getHandler",
"(",
")",
")",
".",
"warning",
"(",
"\"APPLICATION_MONITORING_FAIL\"",
",",
"installInfo",
".",
"getName",
"(",
")",
")",
";",
"}",
"}"
] | adds an application's information to the update monitor | [
"adds",
"an",
"application",
"s",
"information",
"to",
"the",
"update",
"monitor"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.app.manager/src/com/ibm/ws/app/manager/internal/monitor/ApplicationMonitor.java#L123-L179 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.app.manager/src/com/ibm/ws/app/manager/internal/monitor/ApplicationMonitor.java | ApplicationMonitor.removeApplication | public void removeApplication(String pid) {
// remove the application listener from the set we know about and stop it
ApplicationListeners listeners = _appListeners.remove(pid);
//check that the app is known, this can be run after the app is already removed.
if (listeners != null) {
listeners.stopListeners(true);
}
} | java | public void removeApplication(String pid) {
// remove the application listener from the set we know about and stop it
ApplicationListeners listeners = _appListeners.remove(pid);
//check that the app is known, this can be run after the app is already removed.
if (listeners != null) {
listeners.stopListeners(true);
}
} | [
"public",
"void",
"removeApplication",
"(",
"String",
"pid",
")",
"{",
"// remove the application listener from the set we know about and stop it",
"ApplicationListeners",
"listeners",
"=",
"_appListeners",
".",
"remove",
"(",
"pid",
")",
";",
"//check that the app is known, this can be run after the app is already removed.",
"if",
"(",
"listeners",
"!=",
"null",
")",
"{",
"listeners",
".",
"stopListeners",
"(",
"true",
")",
";",
"}",
"}"
] | Removes an application from the update monitor
@param pid | [
"Removes",
"an",
"application",
"from",
"the",
"update",
"monitor"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.app.manager/src/com/ibm/ws/app/manager/internal/monitor/ApplicationMonitor.java#L186-L194 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TEBeanLifeCycleInfo.java | TEBeanLifeCycleInfo.traceEJBCallEntry | public static void traceEJBCallEntry(String methodDesc)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
StringBuffer sbuf = new StringBuffer();
sbuf
.append(BeanLifeCycle_EJBCallEntry_Type_Str).append(DataDelimiter)
.append(BeanLifeCycle_EJBCallEntry_Type).append(DataDelimiter)
.append(methodDesc);
Tr.debug(tc, sbuf.toString());
}
} | java | public static void traceEJBCallEntry(String methodDesc)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
StringBuffer sbuf = new StringBuffer();
sbuf
.append(BeanLifeCycle_EJBCallEntry_Type_Str).append(DataDelimiter)
.append(BeanLifeCycle_EJBCallEntry_Type).append(DataDelimiter)
.append(methodDesc);
Tr.debug(tc, sbuf.toString());
}
} | [
"public",
"static",
"void",
"traceEJBCallEntry",
"(",
"String",
"methodDesc",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"StringBuffer",
"sbuf",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"sbuf",
".",
"append",
"(",
"BeanLifeCycle_EJBCallEntry_Type_Str",
")",
".",
"append",
"(",
"DataDelimiter",
")",
".",
"append",
"(",
"BeanLifeCycle_EJBCallEntry_Type",
")",
".",
"append",
"(",
"DataDelimiter",
")",
".",
"append",
"(",
"methodDesc",
")",
";",
"Tr",
".",
"debug",
"(",
"tc",
",",
"sbuf",
".",
"toString",
"(",
")",
")",
";",
"}",
"}"
] | This is called by the EJB container server code to write a
ejb method callback entry record to the trace log, if enabled. | [
"This",
"is",
"called",
"by",
"the",
"EJB",
"container",
"server",
"code",
"to",
"write",
"a",
"ejb",
"method",
"callback",
"entry",
"record",
"to",
"the",
"trace",
"log",
"if",
"enabled",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TEBeanLifeCycleInfo.java#L30-L43 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TEBeanLifeCycleInfo.java | TEBeanLifeCycleInfo.traceEJBCallExit | public static void traceEJBCallExit(String methodDesc)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
StringBuffer sbuf = new StringBuffer();
sbuf
.append(BeanLifeCycle_EJBCallExit_Type_Str).append(DataDelimiter)
.append(BeanLifeCycle_EJBCallExit_Type).append(DataDelimiter)
.append(methodDesc);
Tr.debug(tc, sbuf.toString());
}
} | java | public static void traceEJBCallExit(String methodDesc)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
StringBuffer sbuf = new StringBuffer();
sbuf
.append(BeanLifeCycle_EJBCallExit_Type_Str).append(DataDelimiter)
.append(BeanLifeCycle_EJBCallExit_Type).append(DataDelimiter)
.append(methodDesc);
Tr.debug(tc, sbuf.toString());
}
} | [
"public",
"static",
"void",
"traceEJBCallExit",
"(",
"String",
"methodDesc",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"StringBuffer",
"sbuf",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"sbuf",
".",
"append",
"(",
"BeanLifeCycle_EJBCallExit_Type_Str",
")",
".",
"append",
"(",
"DataDelimiter",
")",
".",
"append",
"(",
"BeanLifeCycle_EJBCallExit_Type",
")",
".",
"append",
"(",
"DataDelimiter",
")",
".",
"append",
"(",
"methodDesc",
")",
";",
"Tr",
".",
"debug",
"(",
"tc",
",",
"sbuf",
".",
"toString",
"(",
")",
")",
";",
"}",
"}"
] | This is called by the EJB container server code to write a
ejb method callback exit record to the trace log, if enabled. | [
"This",
"is",
"called",
"by",
"the",
"EJB",
"container",
"server",
"code",
"to",
"write",
"a",
"ejb",
"method",
"callback",
"exit",
"record",
"to",
"the",
"trace",
"log",
"if",
"enabled",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TEBeanLifeCycleInfo.java#L49-L62 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TEBeanLifeCycleInfo.java | TEBeanLifeCycleInfo.traceBeanState | public static void traceBeanState(int oldState, String oldString, int newState, String newString) // d167264
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
StringBuffer sbuf = new StringBuffer();
sbuf
.append(BeanLifeCycle_State_Type_Str).append(DataDelimiter)
.append(BeanLifeCycle_State_Type).append(DataDelimiter)
.append(oldState).append(DataDelimiter) // d167264
.append(oldString).append(DataDelimiter) // d167264
.append(newState).append(DataDelimiter) // d167264
.append(newString).append(DataDelimiter) // d167264
;
Tr.debug(tc, sbuf.toString());
}
} | java | public static void traceBeanState(int oldState, String oldString, int newState, String newString) // d167264
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
StringBuffer sbuf = new StringBuffer();
sbuf
.append(BeanLifeCycle_State_Type_Str).append(DataDelimiter)
.append(BeanLifeCycle_State_Type).append(DataDelimiter)
.append(oldState).append(DataDelimiter) // d167264
.append(oldString).append(DataDelimiter) // d167264
.append(newState).append(DataDelimiter) // d167264
.append(newString).append(DataDelimiter) // d167264
;
Tr.debug(tc, sbuf.toString());
}
} | [
"public",
"static",
"void",
"traceBeanState",
"(",
"int",
"oldState",
",",
"String",
"oldString",
",",
"int",
"newState",
",",
"String",
"newString",
")",
"// d167264",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"StringBuffer",
"sbuf",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"sbuf",
".",
"append",
"(",
"BeanLifeCycle_State_Type_Str",
")",
".",
"append",
"(",
"DataDelimiter",
")",
".",
"append",
"(",
"BeanLifeCycle_State_Type",
")",
".",
"append",
"(",
"DataDelimiter",
")",
".",
"append",
"(",
"oldState",
")",
".",
"append",
"(",
"DataDelimiter",
")",
"// d167264",
".",
"append",
"(",
"oldString",
")",
".",
"append",
"(",
"DataDelimiter",
")",
"// d167264",
".",
"append",
"(",
"newState",
")",
".",
"append",
"(",
"DataDelimiter",
")",
"// d167264",
".",
"append",
"(",
"newString",
")",
".",
"append",
"(",
"DataDelimiter",
")",
"// d167264",
";",
"Tr",
".",
"debug",
"(",
"tc",
",",
"sbuf",
".",
"toString",
"(",
")",
")",
";",
"}",
"}"
] | This is called by the EJB container server code to write a
ejb bean state record to the trace log, if enabled. | [
"This",
"is",
"called",
"by",
"the",
"EJB",
"container",
"server",
"code",
"to",
"write",
"a",
"ejb",
"bean",
"state",
"record",
"to",
"the",
"trace",
"log",
"if",
"enabled",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TEBeanLifeCycleInfo.java#L68-L85 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODInvalidationBuffer.java | HTODInvalidationBuffer.add | protected synchronized void add(Object id, int bufferType, int cause, int source, boolean fromDepIdTemplateInvalidation, boolean fireEvent,
boolean isAlias) {
final String methodName = "add(Object)";
if (id == null) {
return;
}
if (bufferType == EXPLICIT_BUFFER) {
byte info = 0;
if (cause != 0 && source != 0) {
info = (byte) cause;
if (source == CachePerf.REMOTE) {
info = (byte) (info | STATUS_REMOTE);
}
if (fromDepIdTemplateInvalidation) {
info = (byte) (info | STATUS_FROM_DEPID_TEMPLATE);
}
if (isAlias) {
info = (byte) (info | STATUS_ALIAS);
}
if (fireEvent) {
info = (byte) (info | STATUS_FIRE_EVENT);
}
}
this.explicitBuffer.put(id, new Byte(info));
this.scanBuffer.remove(id);
} else if (bufferType == SCAN_BUFFER) {
if (!this.explicitBuffer.containsKey(id)) {
this.scanBuffer.add(id);
}
} else if (bufferType == GC_BUFFER) {
this.garbageCollectorBuffer.add(id);
}
traceDebug(methodName, "cacheName=" + this.cod.cacheName + " id=" + id + " bufferType=" + bufferType + " ExplicitBuffer="
+ this.explicitBuffer.size() + " ScanBuffer=" + this.scanBuffer.size() + " GCBuffer=" + this.garbageCollectorBuffer.size()
+ " cause=" + cause + " source=" + source + " fireEvent=" + fireEvent);
if (isFull() || bufferType == GC_BUFFER) { // 3821 NK end
invokeBackgroundInvalidation(!SCAN);
}
} | java | protected synchronized void add(Object id, int bufferType, int cause, int source, boolean fromDepIdTemplateInvalidation, boolean fireEvent,
boolean isAlias) {
final String methodName = "add(Object)";
if (id == null) {
return;
}
if (bufferType == EXPLICIT_BUFFER) {
byte info = 0;
if (cause != 0 && source != 0) {
info = (byte) cause;
if (source == CachePerf.REMOTE) {
info = (byte) (info | STATUS_REMOTE);
}
if (fromDepIdTemplateInvalidation) {
info = (byte) (info | STATUS_FROM_DEPID_TEMPLATE);
}
if (isAlias) {
info = (byte) (info | STATUS_ALIAS);
}
if (fireEvent) {
info = (byte) (info | STATUS_FIRE_EVENT);
}
}
this.explicitBuffer.put(id, new Byte(info));
this.scanBuffer.remove(id);
} else if (bufferType == SCAN_BUFFER) {
if (!this.explicitBuffer.containsKey(id)) {
this.scanBuffer.add(id);
}
} else if (bufferType == GC_BUFFER) {
this.garbageCollectorBuffer.add(id);
}
traceDebug(methodName, "cacheName=" + this.cod.cacheName + " id=" + id + " bufferType=" + bufferType + " ExplicitBuffer="
+ this.explicitBuffer.size() + " ScanBuffer=" + this.scanBuffer.size() + " GCBuffer=" + this.garbageCollectorBuffer.size()
+ " cause=" + cause + " source=" + source + " fireEvent=" + fireEvent);
if (isFull() || bufferType == GC_BUFFER) { // 3821 NK end
invokeBackgroundInvalidation(!SCAN);
}
} | [
"protected",
"synchronized",
"void",
"add",
"(",
"Object",
"id",
",",
"int",
"bufferType",
",",
"int",
"cause",
",",
"int",
"source",
",",
"boolean",
"fromDepIdTemplateInvalidation",
",",
"boolean",
"fireEvent",
",",
"boolean",
"isAlias",
")",
"{",
"final",
"String",
"methodName",
"=",
"\"add(Object)\"",
";",
"if",
"(",
"id",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"bufferType",
"==",
"EXPLICIT_BUFFER",
")",
"{",
"byte",
"info",
"=",
"0",
";",
"if",
"(",
"cause",
"!=",
"0",
"&&",
"source",
"!=",
"0",
")",
"{",
"info",
"=",
"(",
"byte",
")",
"cause",
";",
"if",
"(",
"source",
"==",
"CachePerf",
".",
"REMOTE",
")",
"{",
"info",
"=",
"(",
"byte",
")",
"(",
"info",
"|",
"STATUS_REMOTE",
")",
";",
"}",
"if",
"(",
"fromDepIdTemplateInvalidation",
")",
"{",
"info",
"=",
"(",
"byte",
")",
"(",
"info",
"|",
"STATUS_FROM_DEPID_TEMPLATE",
")",
";",
"}",
"if",
"(",
"isAlias",
")",
"{",
"info",
"=",
"(",
"byte",
")",
"(",
"info",
"|",
"STATUS_ALIAS",
")",
";",
"}",
"if",
"(",
"fireEvent",
")",
"{",
"info",
"=",
"(",
"byte",
")",
"(",
"info",
"|",
"STATUS_FIRE_EVENT",
")",
";",
"}",
"}",
"this",
".",
"explicitBuffer",
".",
"put",
"(",
"id",
",",
"new",
"Byte",
"(",
"info",
")",
")",
";",
"this",
".",
"scanBuffer",
".",
"remove",
"(",
"id",
")",
";",
"}",
"else",
"if",
"(",
"bufferType",
"==",
"SCAN_BUFFER",
")",
"{",
"if",
"(",
"!",
"this",
".",
"explicitBuffer",
".",
"containsKey",
"(",
"id",
")",
")",
"{",
"this",
".",
"scanBuffer",
".",
"add",
"(",
"id",
")",
";",
"}",
"}",
"else",
"if",
"(",
"bufferType",
"==",
"GC_BUFFER",
")",
"{",
"this",
".",
"garbageCollectorBuffer",
".",
"add",
"(",
"id",
")",
";",
"}",
"traceDebug",
"(",
"methodName",
",",
"\"cacheName=\"",
"+",
"this",
".",
"cod",
".",
"cacheName",
"+",
"\" id=\"",
"+",
"id",
"+",
"\" bufferType=\"",
"+",
"bufferType",
"+",
"\" ExplicitBuffer=\"",
"+",
"this",
".",
"explicitBuffer",
".",
"size",
"(",
")",
"+",
"\" ScanBuffer=\"",
"+",
"this",
".",
"scanBuffer",
".",
"size",
"(",
")",
"+",
"\" GCBuffer=\"",
"+",
"this",
".",
"garbageCollectorBuffer",
".",
"size",
"(",
")",
"+",
"\" cause=\"",
"+",
"cause",
"+",
"\" source=\"",
"+",
"source",
"+",
"\" fireEvent=\"",
"+",
"fireEvent",
")",
";",
"if",
"(",
"isFull",
"(",
")",
"||",
"bufferType",
"==",
"GC_BUFFER",
")",
"{",
"// 3821 NK end",
"invokeBackgroundInvalidation",
"(",
"!",
"SCAN",
")",
";",
"}",
"}"
] | Call this method to store a cache id in the one of invalidation buffers. The entry is going to remove from the
disk using LPBT.
@param id
- Object
@param eventAlreadyFired
- boolean to select which invalidation buffer is used to store. | [
"Call",
"this",
"method",
"to",
"store",
"a",
"cache",
"id",
"in",
"the",
"one",
"of",
"invalidation",
"buffers",
".",
"The",
"entry",
"is",
"going",
"to",
"remove",
"from",
"the",
"disk",
"using",
"LPBT",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODInvalidationBuffer.java#L92-L132 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODInvalidationBuffer.java | HTODInvalidationBuffer.add | protected synchronized void add(ValueSet idSet, int bufferType, int cause, int source, boolean fromDepIdTemplateInvalidation, boolean fireEvent,
boolean checkFull) {
final String methodName = "add(ValueSet)";
if (idSet == null || idSet.isEmpty()) {
return;
}
int size = idSet.size();
if (bufferType == EXPLICIT_BUFFER) {
byte info = 0;
if (cause != 0 && source != 0) {
info = (byte) cause;
if (source == CachePerf.REMOTE) {
info = (byte) (info | STATUS_REMOTE);
}
if (fromDepIdTemplateInvalidation) {
info = (byte) (info | STATUS_FROM_DEPID_TEMPLATE);
}
if (fireEvent) {
info = (byte) (info | STATUS_FIRE_EVENT);
}
}
Iterator it = idSet.iterator();
while (it.hasNext()) {
Object entryId = it.next();
this.explicitBuffer.put(entryId, new Byte(info));
}
if (!this.scanBuffer.isEmpty()) {
filter(this.scanBuffer, idSet);
}
} else if (bufferType == SCAN_BUFFER) {
if (!explicitBuffer.isEmpty()) {
filter(idSet, this.explicitBuffer);
}
this.scanBuffer.addAll(idSet);
} else if (bufferType == GC_BUFFER) {
this.garbageCollectorBuffer.addAll(idSet);
}
// if (size > 50) {
traceDebug(methodName, "cacheName=" + this.cod.cacheName + " idSet=" + size + " idSetFilter=" + idSet.size() + " bufferType=" + bufferType
+ " explicitBuffer=" + this.explicitBuffer.size() + " scanBuffer=" + this.scanBuffer.size() + " GCBuffer="
+ this.garbageCollectorBuffer.size());
// }
if ((checkFull && isFull()) || bufferType == GC_BUFFER) { // 3821 NK end
invokeBackgroundInvalidation(!SCAN);
}
} | java | protected synchronized void add(ValueSet idSet, int bufferType, int cause, int source, boolean fromDepIdTemplateInvalidation, boolean fireEvent,
boolean checkFull) {
final String methodName = "add(ValueSet)";
if (idSet == null || idSet.isEmpty()) {
return;
}
int size = idSet.size();
if (bufferType == EXPLICIT_BUFFER) {
byte info = 0;
if (cause != 0 && source != 0) {
info = (byte) cause;
if (source == CachePerf.REMOTE) {
info = (byte) (info | STATUS_REMOTE);
}
if (fromDepIdTemplateInvalidation) {
info = (byte) (info | STATUS_FROM_DEPID_TEMPLATE);
}
if (fireEvent) {
info = (byte) (info | STATUS_FIRE_EVENT);
}
}
Iterator it = idSet.iterator();
while (it.hasNext()) {
Object entryId = it.next();
this.explicitBuffer.put(entryId, new Byte(info));
}
if (!this.scanBuffer.isEmpty()) {
filter(this.scanBuffer, idSet);
}
} else if (bufferType == SCAN_BUFFER) {
if (!explicitBuffer.isEmpty()) {
filter(idSet, this.explicitBuffer);
}
this.scanBuffer.addAll(idSet);
} else if (bufferType == GC_BUFFER) {
this.garbageCollectorBuffer.addAll(idSet);
}
// if (size > 50) {
traceDebug(methodName, "cacheName=" + this.cod.cacheName + " idSet=" + size + " idSetFilter=" + idSet.size() + " bufferType=" + bufferType
+ " explicitBuffer=" + this.explicitBuffer.size() + " scanBuffer=" + this.scanBuffer.size() + " GCBuffer="
+ this.garbageCollectorBuffer.size());
// }
if ((checkFull && isFull()) || bufferType == GC_BUFFER) { // 3821 NK end
invokeBackgroundInvalidation(!SCAN);
}
} | [
"protected",
"synchronized",
"void",
"add",
"(",
"ValueSet",
"idSet",
",",
"int",
"bufferType",
",",
"int",
"cause",
",",
"int",
"source",
",",
"boolean",
"fromDepIdTemplateInvalidation",
",",
"boolean",
"fireEvent",
",",
"boolean",
"checkFull",
")",
"{",
"final",
"String",
"methodName",
"=",
"\"add(ValueSet)\"",
";",
"if",
"(",
"idSet",
"==",
"null",
"||",
"idSet",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"int",
"size",
"=",
"idSet",
".",
"size",
"(",
")",
";",
"if",
"(",
"bufferType",
"==",
"EXPLICIT_BUFFER",
")",
"{",
"byte",
"info",
"=",
"0",
";",
"if",
"(",
"cause",
"!=",
"0",
"&&",
"source",
"!=",
"0",
")",
"{",
"info",
"=",
"(",
"byte",
")",
"cause",
";",
"if",
"(",
"source",
"==",
"CachePerf",
".",
"REMOTE",
")",
"{",
"info",
"=",
"(",
"byte",
")",
"(",
"info",
"|",
"STATUS_REMOTE",
")",
";",
"}",
"if",
"(",
"fromDepIdTemplateInvalidation",
")",
"{",
"info",
"=",
"(",
"byte",
")",
"(",
"info",
"|",
"STATUS_FROM_DEPID_TEMPLATE",
")",
";",
"}",
"if",
"(",
"fireEvent",
")",
"{",
"info",
"=",
"(",
"byte",
")",
"(",
"info",
"|",
"STATUS_FIRE_EVENT",
")",
";",
"}",
"}",
"Iterator",
"it",
"=",
"idSet",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"it",
".",
"hasNext",
"(",
")",
")",
"{",
"Object",
"entryId",
"=",
"it",
".",
"next",
"(",
")",
";",
"this",
".",
"explicitBuffer",
".",
"put",
"(",
"entryId",
",",
"new",
"Byte",
"(",
"info",
")",
")",
";",
"}",
"if",
"(",
"!",
"this",
".",
"scanBuffer",
".",
"isEmpty",
"(",
")",
")",
"{",
"filter",
"(",
"this",
".",
"scanBuffer",
",",
"idSet",
")",
";",
"}",
"}",
"else",
"if",
"(",
"bufferType",
"==",
"SCAN_BUFFER",
")",
"{",
"if",
"(",
"!",
"explicitBuffer",
".",
"isEmpty",
"(",
")",
")",
"{",
"filter",
"(",
"idSet",
",",
"this",
".",
"explicitBuffer",
")",
";",
"}",
"this",
".",
"scanBuffer",
".",
"addAll",
"(",
"idSet",
")",
";",
"}",
"else",
"if",
"(",
"bufferType",
"==",
"GC_BUFFER",
")",
"{",
"this",
".",
"garbageCollectorBuffer",
".",
"addAll",
"(",
"idSet",
")",
";",
"}",
"// if (size > 50) {",
"traceDebug",
"(",
"methodName",
",",
"\"cacheName=\"",
"+",
"this",
".",
"cod",
".",
"cacheName",
"+",
"\" idSet=\"",
"+",
"size",
"+",
"\" idSetFilter=\"",
"+",
"idSet",
".",
"size",
"(",
")",
"+",
"\" bufferType=\"",
"+",
"bufferType",
"+",
"\" explicitBuffer=\"",
"+",
"this",
".",
"explicitBuffer",
".",
"size",
"(",
")",
"+",
"\" scanBuffer=\"",
"+",
"this",
".",
"scanBuffer",
".",
"size",
"(",
")",
"+",
"\" GCBuffer=\"",
"+",
"this",
".",
"garbageCollectorBuffer",
".",
"size",
"(",
")",
")",
";",
"// }",
"if",
"(",
"(",
"checkFull",
"&&",
"isFull",
"(",
")",
")",
"||",
"bufferType",
"==",
"GC_BUFFER",
")",
"{",
"// 3821 NK end",
"invokeBackgroundInvalidation",
"(",
"!",
"SCAN",
")",
";",
"}",
"}"
] | Call this method to store a collection of cache ids in the one of invalidation buffers. The entries are going to
remove from the disk using LPBT.
@param idSet
- ValueSet used to store a collection of Ids.
@param eventAlreadyFired
- boolean to select which invalidation buffer is used to store.
@param checkFull
- boolean to check the invalidation buffer full condition | [
"Call",
"this",
"method",
"to",
"store",
"a",
"collection",
"of",
"cache",
"ids",
"in",
"the",
"one",
"of",
"invalidation",
"buffers",
".",
"The",
"entries",
"are",
"going",
"to",
"remove",
"from",
"the",
"disk",
"using",
"LPBT",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODInvalidationBuffer.java#L145-L192 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODInvalidationBuffer.java | HTODInvalidationBuffer.get | protected synchronized Object get(int bufferType) {
// final String methodName = "get(boolean)";
Object id = null;
if (bufferType == this.EXPLICIT_BUFFER) {
if (!this.explicitBuffer.isEmpty()) {
Set s = this.explicitBuffer.keySet();
Iterator it = s.iterator();
ExplicitIdData idData = new ExplicitIdData();
while (it.hasNext()) {
idData.id = it.next();
idData.info = ((Byte) this.explicitBuffer.get(idData.id)).byteValue();
if ((idData.info & HTODInvalidationBuffer.STATUS_ALIAS) == 0) {
id = idData;
break;
}
}
}
} else if (bufferType == this.SCAN_BUFFER) {
if (!this.scanBuffer.isEmpty()) {
id = this.scanBuffer.getOne();
}
} else if (bufferType == this.GC_BUFFER) {
if (!this.garbageCollectorBuffer.isEmpty()) {
// Always get the first one from the list
id = this.garbageCollectorBuffer.get(0);
}
}
// if (id != null) {
// traceDebug(methodName, "cacheName=" + this.cod.cacheName + " id=" + id + " bufferType=" + bufferType);
// }
return id;
} | java | protected synchronized Object get(int bufferType) {
// final String methodName = "get(boolean)";
Object id = null;
if (bufferType == this.EXPLICIT_BUFFER) {
if (!this.explicitBuffer.isEmpty()) {
Set s = this.explicitBuffer.keySet();
Iterator it = s.iterator();
ExplicitIdData idData = new ExplicitIdData();
while (it.hasNext()) {
idData.id = it.next();
idData.info = ((Byte) this.explicitBuffer.get(idData.id)).byteValue();
if ((idData.info & HTODInvalidationBuffer.STATUS_ALIAS) == 0) {
id = idData;
break;
}
}
}
} else if (bufferType == this.SCAN_BUFFER) {
if (!this.scanBuffer.isEmpty()) {
id = this.scanBuffer.getOne();
}
} else if (bufferType == this.GC_BUFFER) {
if (!this.garbageCollectorBuffer.isEmpty()) {
// Always get the first one from the list
id = this.garbageCollectorBuffer.get(0);
}
}
// if (id != null) {
// traceDebug(methodName, "cacheName=" + this.cod.cacheName + " id=" + id + " bufferType=" + bufferType);
// }
return id;
} | [
"protected",
"synchronized",
"Object",
"get",
"(",
"int",
"bufferType",
")",
"{",
"// final String methodName = \"get(boolean)\";",
"Object",
"id",
"=",
"null",
";",
"if",
"(",
"bufferType",
"==",
"this",
".",
"EXPLICIT_BUFFER",
")",
"{",
"if",
"(",
"!",
"this",
".",
"explicitBuffer",
".",
"isEmpty",
"(",
")",
")",
"{",
"Set",
"s",
"=",
"this",
".",
"explicitBuffer",
".",
"keySet",
"(",
")",
";",
"Iterator",
"it",
"=",
"s",
".",
"iterator",
"(",
")",
";",
"ExplicitIdData",
"idData",
"=",
"new",
"ExplicitIdData",
"(",
")",
";",
"while",
"(",
"it",
".",
"hasNext",
"(",
")",
")",
"{",
"idData",
".",
"id",
"=",
"it",
".",
"next",
"(",
")",
";",
"idData",
".",
"info",
"=",
"(",
"(",
"Byte",
")",
"this",
".",
"explicitBuffer",
".",
"get",
"(",
"idData",
".",
"id",
")",
")",
".",
"byteValue",
"(",
")",
";",
"if",
"(",
"(",
"idData",
".",
"info",
"&",
"HTODInvalidationBuffer",
".",
"STATUS_ALIAS",
")",
"==",
"0",
")",
"{",
"id",
"=",
"idData",
";",
"break",
";",
"}",
"}",
"}",
"}",
"else",
"if",
"(",
"bufferType",
"==",
"this",
".",
"SCAN_BUFFER",
")",
"{",
"if",
"(",
"!",
"this",
".",
"scanBuffer",
".",
"isEmpty",
"(",
")",
")",
"{",
"id",
"=",
"this",
".",
"scanBuffer",
".",
"getOne",
"(",
")",
";",
"}",
"}",
"else",
"if",
"(",
"bufferType",
"==",
"this",
".",
"GC_BUFFER",
")",
"{",
"if",
"(",
"!",
"this",
".",
"garbageCollectorBuffer",
".",
"isEmpty",
"(",
")",
")",
"{",
"// Always get the first one from the list",
"id",
"=",
"this",
".",
"garbageCollectorBuffer",
".",
"get",
"(",
"0",
")",
";",
"}",
"}",
"// if (id != null) {",
"// traceDebug(methodName, \"cacheName=\" + this.cod.cacheName + \" id=\" + id + \" bufferType=\" + bufferType);",
"// }",
"return",
"id",
";",
"}"
] | Call this method when a cache id is retrieved from one of invalidation buffers. The entry is being used to remove
from the disk using LPBT.
@param bufferType
- specify the invalidation buffer.
@return Object cache id. | [
"Call",
"this",
"method",
"when",
"a",
"cache",
"id",
"is",
"retrieved",
"from",
"one",
"of",
"invalidation",
"buffers",
".",
"The",
"entry",
"is",
"being",
"used",
"to",
"remove",
"from",
"the",
"disk",
"using",
"LPBT",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODInvalidationBuffer.java#L215-L247 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODInvalidationBuffer.java | HTODInvalidationBuffer.remove | protected synchronized void remove(Object id, int bufferType, boolean returnToPool) {
// final String methodName = "remove(Object,bufferType)";
if (id == null) {
return;
}
if (bufferType == this.EXPLICIT_BUFFER) {
this.explicitBuffer.remove(id);
} else if (bufferType == this.SCAN_BUFFER) {
this.scanBuffer.remove(id);
} else if (bufferType == this.GC_BUFFER) {
if (id instanceof EvictionTableEntry) {
EvictionTableEntry evt1 = (EvictionTableEntry) id;
int i;
for (i = 0; i < garbageCollectorBuffer.size(); i++) {
EvictionTableEntry evt = (EvictionTableEntry) garbageCollectorBuffer.get(i);
if (evt == evt1)
break;
}
if (i < garbageCollectorBuffer.size())
this.garbageCollectorBuffer.remove(i);
if (returnToPool) {
cod.htod.evictionEntryPool.add(id);
}
}
}
// traceDebug(methodName, "cacheName=" + this.cod.cacheName + " id=" + id + " bufferType=" + bufferType);
} | java | protected synchronized void remove(Object id, int bufferType, boolean returnToPool) {
// final String methodName = "remove(Object,bufferType)";
if (id == null) {
return;
}
if (bufferType == this.EXPLICIT_BUFFER) {
this.explicitBuffer.remove(id);
} else if (bufferType == this.SCAN_BUFFER) {
this.scanBuffer.remove(id);
} else if (bufferType == this.GC_BUFFER) {
if (id instanceof EvictionTableEntry) {
EvictionTableEntry evt1 = (EvictionTableEntry) id;
int i;
for (i = 0; i < garbageCollectorBuffer.size(); i++) {
EvictionTableEntry evt = (EvictionTableEntry) garbageCollectorBuffer.get(i);
if (evt == evt1)
break;
}
if (i < garbageCollectorBuffer.size())
this.garbageCollectorBuffer.remove(i);
if (returnToPool) {
cod.htod.evictionEntryPool.add(id);
}
}
}
// traceDebug(methodName, "cacheName=" + this.cod.cacheName + " id=" + id + " bufferType=" + bufferType);
} | [
"protected",
"synchronized",
"void",
"remove",
"(",
"Object",
"id",
",",
"int",
"bufferType",
",",
"boolean",
"returnToPool",
")",
"{",
"// final String methodName = \"remove(Object,bufferType)\";",
"if",
"(",
"id",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"bufferType",
"==",
"this",
".",
"EXPLICIT_BUFFER",
")",
"{",
"this",
".",
"explicitBuffer",
".",
"remove",
"(",
"id",
")",
";",
"}",
"else",
"if",
"(",
"bufferType",
"==",
"this",
".",
"SCAN_BUFFER",
")",
"{",
"this",
".",
"scanBuffer",
".",
"remove",
"(",
"id",
")",
";",
"}",
"else",
"if",
"(",
"bufferType",
"==",
"this",
".",
"GC_BUFFER",
")",
"{",
"if",
"(",
"id",
"instanceof",
"EvictionTableEntry",
")",
"{",
"EvictionTableEntry",
"evt1",
"=",
"(",
"EvictionTableEntry",
")",
"id",
";",
"int",
"i",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"garbageCollectorBuffer",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"EvictionTableEntry",
"evt",
"=",
"(",
"EvictionTableEntry",
")",
"garbageCollectorBuffer",
".",
"get",
"(",
"i",
")",
";",
"if",
"(",
"evt",
"==",
"evt1",
")",
"break",
";",
"}",
"if",
"(",
"i",
"<",
"garbageCollectorBuffer",
".",
"size",
"(",
")",
")",
"this",
".",
"garbageCollectorBuffer",
".",
"remove",
"(",
"i",
")",
";",
"if",
"(",
"returnToPool",
")",
"{",
"cod",
".",
"htod",
".",
"evictionEntryPool",
".",
"add",
"(",
"id",
")",
";",
"}",
"}",
"}",
"// traceDebug(methodName, \"cacheName=\" + this.cod.cacheName + \" id=\" + id + \" bufferType=\" + bufferType);",
"}"
] | returnToPool boolean is used by GC buffer only | [
"returnToPool",
"boolean",
"is",
"used",
"by",
"GC",
"buffer",
"only"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODInvalidationBuffer.java#L310-L336 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODInvalidationBuffer.java | HTODInvalidationBuffer.remove | protected synchronized void remove(Object id) {
// final String methodName = "remove(Object)";
if (id == null) {
return;
}
this.explicitBuffer.remove(id);
this.scanBuffer.remove(id);
// this.garbageCollectorBuffer.remove(id);
// if (id instanceof HTODDynacache.EvictionTableEntry)
// cod.htod.evictionEntryPool.add(id);
// traceDebug(methodName, "id=" + id);
} | java | protected synchronized void remove(Object id) {
// final String methodName = "remove(Object)";
if (id == null) {
return;
}
this.explicitBuffer.remove(id);
this.scanBuffer.remove(id);
// this.garbageCollectorBuffer.remove(id);
// if (id instanceof HTODDynacache.EvictionTableEntry)
// cod.htod.evictionEntryPool.add(id);
// traceDebug(methodName, "id=" + id);
} | [
"protected",
"synchronized",
"void",
"remove",
"(",
"Object",
"id",
")",
"{",
"// final String methodName = \"remove(Object)\";",
"if",
"(",
"id",
"==",
"null",
")",
"{",
"return",
";",
"}",
"this",
".",
"explicitBuffer",
".",
"remove",
"(",
"id",
")",
";",
"this",
".",
"scanBuffer",
".",
"remove",
"(",
"id",
")",
";",
"// this.garbageCollectorBuffer.remove(id);",
"// if (id instanceof HTODDynacache.EvictionTableEntry)",
"// cod.htod.evictionEntryPool.add(id);",
"// traceDebug(methodName, \"id=\" + id);",
"}"
] | Call this method to remove a specified cache id from invalidation buffers excluding garbage collector buffers. | [
"Call",
"this",
"method",
"to",
"remove",
"a",
"specified",
"cache",
"id",
"from",
"invalidation",
"buffers",
"excluding",
"garbage",
"collector",
"buffers",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODInvalidationBuffer.java#L341-L353 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODInvalidationBuffer.java | HTODInvalidationBuffer.getAndRemoveFromExplicitBuffer | protected synchronized ValueSet getAndRemoveFromExplicitBuffer() {
final String methodName = "getAndRemoveFromExplicitBuffer()";
ValueSet valueSet = null;
if (this.explicitBuffer.size() == 0) {
valueSet = new ValueSet(1);
} else {
valueSet = new ValueSet(this.explicitBuffer.size());
Iterator it = this.explicitBuffer.keySet().iterator();
while (it.hasNext()) {
Object current = it.next();
byte info = ((Byte) this.explicitBuffer.get(current)).byteValue();
if ((info & HTODInvalidationBuffer.STATUS_ALIAS) == 0) {
valueSet.add(current);
}
}
this.explicitBuffer.clear();
}
traceDebug(methodName, "cacheName=" + this.cod.cacheName + " bufferSize=" + valueSet.size());
return valueSet;
} | java | protected synchronized ValueSet getAndRemoveFromExplicitBuffer() {
final String methodName = "getAndRemoveFromExplicitBuffer()";
ValueSet valueSet = null;
if (this.explicitBuffer.size() == 0) {
valueSet = new ValueSet(1);
} else {
valueSet = new ValueSet(this.explicitBuffer.size());
Iterator it = this.explicitBuffer.keySet().iterator();
while (it.hasNext()) {
Object current = it.next();
byte info = ((Byte) this.explicitBuffer.get(current)).byteValue();
if ((info & HTODInvalidationBuffer.STATUS_ALIAS) == 0) {
valueSet.add(current);
}
}
this.explicitBuffer.clear();
}
traceDebug(methodName, "cacheName=" + this.cod.cacheName + " bufferSize=" + valueSet.size());
return valueSet;
} | [
"protected",
"synchronized",
"ValueSet",
"getAndRemoveFromExplicitBuffer",
"(",
")",
"{",
"final",
"String",
"methodName",
"=",
"\"getAndRemoveFromExplicitBuffer()\"",
";",
"ValueSet",
"valueSet",
"=",
"null",
";",
"if",
"(",
"this",
".",
"explicitBuffer",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"valueSet",
"=",
"new",
"ValueSet",
"(",
"1",
")",
";",
"}",
"else",
"{",
"valueSet",
"=",
"new",
"ValueSet",
"(",
"this",
".",
"explicitBuffer",
".",
"size",
"(",
")",
")",
";",
"Iterator",
"it",
"=",
"this",
".",
"explicitBuffer",
".",
"keySet",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"it",
".",
"hasNext",
"(",
")",
")",
"{",
"Object",
"current",
"=",
"it",
".",
"next",
"(",
")",
";",
"byte",
"info",
"=",
"(",
"(",
"Byte",
")",
"this",
".",
"explicitBuffer",
".",
"get",
"(",
"current",
")",
")",
".",
"byteValue",
"(",
")",
";",
"if",
"(",
"(",
"info",
"&",
"HTODInvalidationBuffer",
".",
"STATUS_ALIAS",
")",
"==",
"0",
")",
"{",
"valueSet",
".",
"add",
"(",
"current",
")",
";",
"}",
"}",
"this",
".",
"explicitBuffer",
".",
"clear",
"(",
")",
";",
"}",
"traceDebug",
"(",
"methodName",
",",
"\"cacheName=\"",
"+",
"this",
".",
"cod",
".",
"cacheName",
"+",
"\" bufferSize=\"",
"+",
"valueSet",
".",
"size",
"(",
")",
")",
";",
"return",
"valueSet",
";",
"}"
] | Call this method to get and remove all the cache ids from explicit buffer.
@return ValueSet - a collection of cache ids NOT including alias ids. | [
"Call",
"this",
"method",
"to",
"get",
"and",
"remove",
"all",
"the",
"cache",
"ids",
"from",
"explicit",
"buffer",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODInvalidationBuffer.java#L360-L380 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODInvalidationBuffer.java | HTODInvalidationBuffer.findAndRemoveFromGCBuffer | protected synchronized boolean findAndRemoveFromGCBuffer(long expirationTime, int hashcode, int size) {
EvictionTableEntry evt = null;
int i;
for (i = 0; i < garbageCollectorBuffer.size(); i++) {
evt = (EvictionTableEntry) garbageCollectorBuffer.get(i);
if (evt.expirationTime == expirationTime && evt.hashcode == hashcode && evt.size == size) {
break;
}
}
if (i < garbageCollectorBuffer.size()) {
this.garbageCollectorBuffer.remove(i);
if (evt != null) {
cod.htod.evictionEntryPool.add(evt);
}
return true;
}
return false;
} | java | protected synchronized boolean findAndRemoveFromGCBuffer(long expirationTime, int hashcode, int size) {
EvictionTableEntry evt = null;
int i;
for (i = 0; i < garbageCollectorBuffer.size(); i++) {
evt = (EvictionTableEntry) garbageCollectorBuffer.get(i);
if (evt.expirationTime == expirationTime && evt.hashcode == hashcode && evt.size == size) {
break;
}
}
if (i < garbageCollectorBuffer.size()) {
this.garbageCollectorBuffer.remove(i);
if (evt != null) {
cod.htod.evictionEntryPool.add(evt);
}
return true;
}
return false;
} | [
"protected",
"synchronized",
"boolean",
"findAndRemoveFromGCBuffer",
"(",
"long",
"expirationTime",
",",
"int",
"hashcode",
",",
"int",
"size",
")",
"{",
"EvictionTableEntry",
"evt",
"=",
"null",
";",
"int",
"i",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"garbageCollectorBuffer",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"evt",
"=",
"(",
"EvictionTableEntry",
")",
"garbageCollectorBuffer",
".",
"get",
"(",
"i",
")",
";",
"if",
"(",
"evt",
".",
"expirationTime",
"==",
"expirationTime",
"&&",
"evt",
".",
"hashcode",
"==",
"hashcode",
"&&",
"evt",
".",
"size",
"==",
"size",
")",
"{",
"break",
";",
"}",
"}",
"if",
"(",
"i",
"<",
"garbageCollectorBuffer",
".",
"size",
"(",
")",
")",
"{",
"this",
".",
"garbageCollectorBuffer",
".",
"remove",
"(",
"i",
")",
";",
"if",
"(",
"evt",
"!=",
"null",
")",
"{",
"cod",
".",
"htod",
".",
"evictionEntryPool",
".",
"add",
"(",
"evt",
")",
";",
"}",
"return",
"true",
";",
"}",
"return",
"false",
";",
"}"
] | Call this method to get and remove the EVT from GC buffer.
@return boolean indicate whether it is found from GC buffer. | [
"Call",
"this",
"method",
"to",
"get",
"and",
"remove",
"the",
"EVT",
"from",
"GC",
"buffer",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODInvalidationBuffer.java#L387-L404 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODInvalidationBuffer.java | HTODInvalidationBuffer.clear | protected synchronized void clear(int bufferType) {
final String methodName = "clear()";
if (bufferType == HTODInvalidationBuffer.EXPLICIT_BUFFER) {
this.explicitBuffer.clear();
} else if (bufferType == HTODInvalidationBuffer.SCAN_BUFFER) {
this.scanBuffer.clear();
} else if (bufferType == HTODInvalidationBuffer.GC_BUFFER) {
// todo: return GC to pool?
for (int i = 0; i < garbageCollectorBuffer.size(); i++) {
EvictionTableEntry evt = (EvictionTableEntry) garbageCollectorBuffer.get(i);
cod.htod.evictionEntryPool.add(evt);
}
this.garbageCollectorBuffer.clear();
}
traceDebug(methodName, "cacheName=" + this.cod.cacheName + " bufferType=" + bufferType);
} | java | protected synchronized void clear(int bufferType) {
final String methodName = "clear()";
if (bufferType == HTODInvalidationBuffer.EXPLICIT_BUFFER) {
this.explicitBuffer.clear();
} else if (bufferType == HTODInvalidationBuffer.SCAN_BUFFER) {
this.scanBuffer.clear();
} else if (bufferType == HTODInvalidationBuffer.GC_BUFFER) {
// todo: return GC to pool?
for (int i = 0; i < garbageCollectorBuffer.size(); i++) {
EvictionTableEntry evt = (EvictionTableEntry) garbageCollectorBuffer.get(i);
cod.htod.evictionEntryPool.add(evt);
}
this.garbageCollectorBuffer.clear();
}
traceDebug(methodName, "cacheName=" + this.cod.cacheName + " bufferType=" + bufferType);
} | [
"protected",
"synchronized",
"void",
"clear",
"(",
"int",
"bufferType",
")",
"{",
"final",
"String",
"methodName",
"=",
"\"clear()\"",
";",
"if",
"(",
"bufferType",
"==",
"HTODInvalidationBuffer",
".",
"EXPLICIT_BUFFER",
")",
"{",
"this",
".",
"explicitBuffer",
".",
"clear",
"(",
")",
";",
"}",
"else",
"if",
"(",
"bufferType",
"==",
"HTODInvalidationBuffer",
".",
"SCAN_BUFFER",
")",
"{",
"this",
".",
"scanBuffer",
".",
"clear",
"(",
")",
";",
"}",
"else",
"if",
"(",
"bufferType",
"==",
"HTODInvalidationBuffer",
".",
"GC_BUFFER",
")",
"{",
"// todo: return GC to pool?",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"garbageCollectorBuffer",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"EvictionTableEntry",
"evt",
"=",
"(",
"EvictionTableEntry",
")",
"garbageCollectorBuffer",
".",
"get",
"(",
"i",
")",
";",
"cod",
".",
"htod",
".",
"evictionEntryPool",
".",
"add",
"(",
"evt",
")",
";",
"}",
"this",
".",
"garbageCollectorBuffer",
".",
"clear",
"(",
")",
";",
"}",
"traceDebug",
"(",
"methodName",
",",
"\"cacheName=\"",
"+",
"this",
".",
"cod",
".",
"cacheName",
"+",
"\" bufferType=\"",
"+",
"bufferType",
")",
";",
"}"
] | Call this method to clear the invalidation buffers.
@param forEventAlreadyFired
- true to clear invalidation buffer which is used for event already fired.
@param forEventNotFired
- true to clear invalidation buffer which is used for event not fired. | [
"Call",
"this",
"method",
"to",
"clear",
"the",
"invalidation",
"buffers",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODInvalidationBuffer.java#L414-L429 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODInvalidationBuffer.java | HTODInvalidationBuffer.invokeBackgroundInvalidation | protected synchronized void invokeBackgroundInvalidation(boolean scan) {
final String methodName = "invokeBackgroundInvalidation()";
if (!stopping) {
synchronized (cod.diskCleanupThread.dcMonitor) {
if (cod.diskCleanupThread.currentThread != null) {
this.cod.invokeDiskCleanup(scan);
} else {
if (scan == SCAN) {
traceDebug(methodName, "cacheName=" + this.cod.cacheName + " set cleanupDiskPending to true");
this.cleanupDiskPending = true;
}
}
}
}
} | java | protected synchronized void invokeBackgroundInvalidation(boolean scan) {
final String methodName = "invokeBackgroundInvalidation()";
if (!stopping) {
synchronized (cod.diskCleanupThread.dcMonitor) {
if (cod.diskCleanupThread.currentThread != null) {
this.cod.invokeDiskCleanup(scan);
} else {
if (scan == SCAN) {
traceDebug(methodName, "cacheName=" + this.cod.cacheName + " set cleanupDiskPending to true");
this.cleanupDiskPending = true;
}
}
}
}
} | [
"protected",
"synchronized",
"void",
"invokeBackgroundInvalidation",
"(",
"boolean",
"scan",
")",
"{",
"final",
"String",
"methodName",
"=",
"\"invokeBackgroundInvalidation()\"",
";",
"if",
"(",
"!",
"stopping",
")",
"{",
"synchronized",
"(",
"cod",
".",
"diskCleanupThread",
".",
"dcMonitor",
")",
"{",
"if",
"(",
"cod",
".",
"diskCleanupThread",
".",
"currentThread",
"!=",
"null",
")",
"{",
"this",
".",
"cod",
".",
"invokeDiskCleanup",
"(",
"scan",
")",
";",
"}",
"else",
"{",
"if",
"(",
"scan",
"==",
"SCAN",
")",
"{",
"traceDebug",
"(",
"methodName",
",",
"\"cacheName=\"",
"+",
"this",
".",
"cod",
".",
"cacheName",
"+",
"\" set cleanupDiskPending to true\"",
")",
";",
"this",
".",
"cleanupDiskPending",
"=",
"true",
";",
"}",
"}",
"}",
"}",
"}"
] | Call this method to invoke LPBT.
@param scan
- true to disk cache for expired entries. | [
"Call",
"this",
"method",
"to",
"invoke",
"LPBT",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODInvalidationBuffer.java#L437-L452 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODInvalidationBuffer.java | HTODInvalidationBuffer.contains | protected synchronized boolean contains(Object id) {
boolean found = false;
if (this.explicitBuffer.containsKey(id) || this.scanBuffer.contains(id)) {
found = true;
}
return found;
} | java | protected synchronized boolean contains(Object id) {
boolean found = false;
if (this.explicitBuffer.containsKey(id) || this.scanBuffer.contains(id)) {
found = true;
}
return found;
} | [
"protected",
"synchronized",
"boolean",
"contains",
"(",
"Object",
"id",
")",
"{",
"boolean",
"found",
"=",
"false",
";",
"if",
"(",
"this",
".",
"explicitBuffer",
".",
"containsKey",
"(",
"id",
")",
"||",
"this",
".",
"scanBuffer",
".",
"contains",
"(",
"id",
")",
")",
"{",
"found",
"=",
"true",
";",
"}",
"return",
"found",
";",
"}"
] | Call this method to check whether a specified id exists in the invalidation explicit or scan buffer.
@param id
- cache id.
@return boolean - true means a specified id is found. | [
"Call",
"this",
"method",
"to",
"check",
"whether",
"a",
"specified",
"id",
"exists",
"in",
"the",
"invalidation",
"explicit",
"or",
"scan",
"buffer",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODInvalidationBuffer.java#L461-L467 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODInvalidationBuffer.java | HTODInvalidationBuffer.isFull | @Trivial
public synchronized boolean isFull() {
// final String methodName = "isFull()";
boolean isFull = false;
int size = this.explicitBuffer.size() + this.scanBuffer.size() + this.garbageCollectorBuffer.size();
if (size > this.maxInvalidationBufferSize || (System.currentTimeMillis() - this.lastRemoveTime) >= this.maxInvalidationBufferLife) {
isFull = true;
setlastRemoveTime();
}
// if (isFull) {
// traceDebug(methodName, "cacheName=" + this.cod.cacheName + " isFull=" + isFull + " explicitBuffer=" +
// explicitBuffer.size() + " scanBuffer=" + this.scanBuffer.size());
// }
return isFull;
} | java | @Trivial
public synchronized boolean isFull() {
// final String methodName = "isFull()";
boolean isFull = false;
int size = this.explicitBuffer.size() + this.scanBuffer.size() + this.garbageCollectorBuffer.size();
if (size > this.maxInvalidationBufferSize || (System.currentTimeMillis() - this.lastRemoveTime) >= this.maxInvalidationBufferLife) {
isFull = true;
setlastRemoveTime();
}
// if (isFull) {
// traceDebug(methodName, "cacheName=" + this.cod.cacheName + " isFull=" + isFull + " explicitBuffer=" +
// explicitBuffer.size() + " scanBuffer=" + this.scanBuffer.size());
// }
return isFull;
} | [
"@",
"Trivial",
"public",
"synchronized",
"boolean",
"isFull",
"(",
")",
"{",
"// final String methodName = \"isFull()\";",
"boolean",
"isFull",
"=",
"false",
";",
"int",
"size",
"=",
"this",
".",
"explicitBuffer",
".",
"size",
"(",
")",
"+",
"this",
".",
"scanBuffer",
".",
"size",
"(",
")",
"+",
"this",
".",
"garbageCollectorBuffer",
".",
"size",
"(",
")",
";",
"if",
"(",
"size",
">",
"this",
".",
"maxInvalidationBufferSize",
"||",
"(",
"System",
".",
"currentTimeMillis",
"(",
")",
"-",
"this",
".",
"lastRemoveTime",
")",
">=",
"this",
".",
"maxInvalidationBufferLife",
")",
"{",
"isFull",
"=",
"true",
";",
"setlastRemoveTime",
"(",
")",
";",
"}",
"// if (isFull) {",
"// traceDebug(methodName, \"cacheName=\" + this.cod.cacheName + \" isFull=\" + isFull + \" explicitBuffer=\" +",
"// explicitBuffer.size() + \" scanBuffer=\" + this.scanBuffer.size());",
"// }",
"return",
"isFull",
";",
"}"
] | Call this method to check whether a "full" condition is met to start LPBT.
@return boolean - true means the condition "full". | [
"Call",
"this",
"method",
"to",
"check",
"whether",
"a",
"full",
"condition",
"is",
"met",
"to",
"start",
"LPBT",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODInvalidationBuffer.java#L474-L488 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODInvalidationBuffer.java | HTODInvalidationBuffer.filter | protected synchronized void filter(ValueSet filterValueSet) {
boolean explicitBufferEmpty = this.explicitBuffer.isEmpty();
boolean scanBufferEmpty = this.scanBuffer.isEmpty();
if (filterValueSet != null && !filterValueSet.isEmpty() && (!explicitBufferEmpty || !scanBufferEmpty)) {
Iterator it = filterValueSet.iterator();
while (it.hasNext()) {
Object o = it.next();
if (!explicitBufferEmpty && this.explicitBuffer.containsKey(o)) {
it.remove();
} else if (!scanBufferEmpty && this.scanBuffer.contains(o)) {
it.remove();
}
}
}
} | java | protected synchronized void filter(ValueSet filterValueSet) {
boolean explicitBufferEmpty = this.explicitBuffer.isEmpty();
boolean scanBufferEmpty = this.scanBuffer.isEmpty();
if (filterValueSet != null && !filterValueSet.isEmpty() && (!explicitBufferEmpty || !scanBufferEmpty)) {
Iterator it = filterValueSet.iterator();
while (it.hasNext()) {
Object o = it.next();
if (!explicitBufferEmpty && this.explicitBuffer.containsKey(o)) {
it.remove();
} else if (!scanBufferEmpty && this.scanBuffer.contains(o)) {
it.remove();
}
}
}
} | [
"protected",
"synchronized",
"void",
"filter",
"(",
"ValueSet",
"filterValueSet",
")",
"{",
"boolean",
"explicitBufferEmpty",
"=",
"this",
".",
"explicitBuffer",
".",
"isEmpty",
"(",
")",
";",
"boolean",
"scanBufferEmpty",
"=",
"this",
".",
"scanBuffer",
".",
"isEmpty",
"(",
")",
";",
"if",
"(",
"filterValueSet",
"!=",
"null",
"&&",
"!",
"filterValueSet",
".",
"isEmpty",
"(",
")",
"&&",
"(",
"!",
"explicitBufferEmpty",
"||",
"!",
"scanBufferEmpty",
")",
")",
"{",
"Iterator",
"it",
"=",
"filterValueSet",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"it",
".",
"hasNext",
"(",
")",
")",
"{",
"Object",
"o",
"=",
"it",
".",
"next",
"(",
")",
";",
"if",
"(",
"!",
"explicitBufferEmpty",
"&&",
"this",
".",
"explicitBuffer",
".",
"containsKey",
"(",
"o",
")",
")",
"{",
"it",
".",
"remove",
"(",
")",
";",
"}",
"else",
"if",
"(",
"!",
"scanBufferEmpty",
"&&",
"this",
".",
"scanBuffer",
".",
"contains",
"(",
"o",
")",
")",
"{",
"it",
".",
"remove",
"(",
")",
";",
"}",
"}",
"}",
"}"
] | Call this method to filter out the specified collection of cache ids based on invalidation buffers.
@param filterValueSet
- a collection of cache ids, | [
"Call",
"this",
"method",
"to",
"filter",
"out",
"the",
"specified",
"collection",
"of",
"cache",
"ids",
"based",
"on",
"invalidation",
"buffers",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODInvalidationBuffer.java#L496-L510 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODInvalidationBuffer.java | HTODInvalidationBuffer.size | @Trivial
protected synchronized int size(int bufferType) {
if (bufferType == EXPLICIT_BUFFER) {
return this.explicitBuffer.size();
} else if (bufferType == SCAN_BUFFER) {
return this.scanBuffer.size();
} else if (bufferType == GC_BUFFER) {
return this.garbageCollectorBuffer.size();
}
return 0;
} | java | @Trivial
protected synchronized int size(int bufferType) {
if (bufferType == EXPLICIT_BUFFER) {
return this.explicitBuffer.size();
} else if (bufferType == SCAN_BUFFER) {
return this.scanBuffer.size();
} else if (bufferType == GC_BUFFER) {
return this.garbageCollectorBuffer.size();
}
return 0;
} | [
"@",
"Trivial",
"protected",
"synchronized",
"int",
"size",
"(",
"int",
"bufferType",
")",
"{",
"if",
"(",
"bufferType",
"==",
"EXPLICIT_BUFFER",
")",
"{",
"return",
"this",
".",
"explicitBuffer",
".",
"size",
"(",
")",
";",
"}",
"else",
"if",
"(",
"bufferType",
"==",
"SCAN_BUFFER",
")",
"{",
"return",
"this",
".",
"scanBuffer",
".",
"size",
"(",
")",
";",
"}",
"else",
"if",
"(",
"bufferType",
"==",
"GC_BUFFER",
")",
"{",
"return",
"this",
".",
"garbageCollectorBuffer",
".",
"size",
"(",
")",
";",
"}",
"return",
"0",
";",
"}"
] | Call this method to get the size from one of invalidation buffers.
@param eventAlreadyFired
- boolean to select which invalidation buffer is used to get the size.
@return int - the size. | [
"Call",
"this",
"method",
"to",
"get",
"the",
"size",
"from",
"one",
"of",
"invalidation",
"buffers",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODInvalidationBuffer.java#L559-L569 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.