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.jaxrs.2.0.common/src/org/apache/cxf/common/logging/LogUtils.java | LogUtils.log | public static void log(Logger logger,
Level level,
String message,
Throwable throwable,
Object parameter) {
if (logger.isLoggable(level)) {
final String formattedMessage =
MessageFormat.format(localize(logger, message), parameter);
doLog(logger, level, formattedMessage, throwable);
}
} | java | public static void log(Logger logger,
Level level,
String message,
Throwable throwable,
Object parameter) {
if (logger.isLoggable(level)) {
final String formattedMessage =
MessageFormat.format(localize(logger, message), parameter);
doLog(logger, level, formattedMessage, throwable);
}
} | [
"public",
"static",
"void",
"log",
"(",
"Logger",
"logger",
",",
"Level",
"level",
",",
"String",
"message",
",",
"Throwable",
"throwable",
",",
"Object",
"parameter",
")",
"{",
"if",
"(",
"logger",
".",
"isLoggable",
"(",
"level",
")",
")",
"{",
"final",
"String",
"formattedMessage",
"=",
"MessageFormat",
".",
"format",
"(",
"localize",
"(",
"logger",
",",
"message",
")",
",",
"parameter",
")",
";",
"doLog",
"(",
"logger",
",",
"level",
",",
"formattedMessage",
",",
"throwable",
")",
";",
"}",
"}"
] | Allows both parameter substitution and a typed Throwable to be logged.
@param logger the Logger the log to
@param level the severity level
@param message the log message
@param throwable the Throwable to log
@param parameter the parameter to substitute into message | [
"Allows",
"both",
"parameter",
"substitution",
"and",
"a",
"typed",
"Throwable",
"to",
"be",
"logged",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxrs.2.0.common/src/org/apache/cxf/common/logging/LogUtils.java#L367-L377 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jaxrs.2.0.common/src/org/apache/cxf/common/logging/LogUtils.java | LogUtils.localize | private static String localize(Logger logger, String message) {
ResourceBundle bundle = logger.getResourceBundle();
try {
return bundle != null ? bundle.getString(message) : message;
} catch (MissingResourceException ex) {
//string not in the bundle
return message;
}
} | java | private static String localize(Logger logger, String message) {
ResourceBundle bundle = logger.getResourceBundle();
try {
return bundle != null ? bundle.getString(message) : message;
} catch (MissingResourceException ex) {
//string not in the bundle
return message;
}
} | [
"private",
"static",
"String",
"localize",
"(",
"Logger",
"logger",
",",
"String",
"message",
")",
"{",
"ResourceBundle",
"bundle",
"=",
"logger",
".",
"getResourceBundle",
"(",
")",
";",
"try",
"{",
"return",
"bundle",
"!=",
"null",
"?",
"bundle",
".",
"getString",
"(",
"message",
")",
":",
"message",
";",
"}",
"catch",
"(",
"MissingResourceException",
"ex",
")",
"{",
"//string not in the bundle",
"return",
"message",
";",
"}",
"}"
] | Retrieve localized message retrieved from a logger's resource
bundle.
@param logger the Logger
@param message the message to be localized | [
"Retrieve",
"localized",
"message",
"retrieved",
"from",
"a",
"logger",
"s",
"resource",
"bundle",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxrs.2.0.common/src/org/apache/cxf/common/logging/LogUtils.java#L499-L507 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/IdTable.java | IdTable.add | public synchronized int add(Object value)
throws IdTableFullException
{
if (tc.isEntryEnabled()) SibTr.entry(this, tc, "add", value);
if (value == null) throw new SIErrorException(nls.getFormattedMessage("IDTABLE_INTERNAL_SICJ0050", null, "IDTABLE_INTERNAL_SICJ0050")); // D226232
int id = 0;
if (highWaterMark < table.length)
{
// Can we store the object in any free space at the end of the table?
id = highWaterMark;
if (table[id] != null) throw new SIErrorException(nls.getFormattedMessage("IDTABLE_INTERNAL_SICJ0050", null, "IDTABLE_INTERNAL_SICJ0050")); // D226232
table[id] = value;
if (lowestPossibleFree == highWaterMark) ++lowestPossibleFree;
++highWaterMark;
}
else if (table.length < maxSize)
{
// Resize the table if we can
growTable();
id = highWaterMark;
if (table[id] != null) throw new SIErrorException(nls.getFormattedMessage("IDTABLE_INTERNAL_SICJ0050", null, "IDTABLE_INTERNAL_SICJ0050")); // D226232
table[id] = value;
if (lowestPossibleFree == highWaterMark) ++lowestPossibleFree;
++highWaterMark;
}
else
{
// Scan for free slot
id = findFreeSlot();
if (id == 0) throw new IdTableFullException();
}
if (tc.isEntryEnabled()) SibTr.exit(this, tc, "add", ""+id);
return id;
} | java | public synchronized int add(Object value)
throws IdTableFullException
{
if (tc.isEntryEnabled()) SibTr.entry(this, tc, "add", value);
if (value == null) throw new SIErrorException(nls.getFormattedMessage("IDTABLE_INTERNAL_SICJ0050", null, "IDTABLE_INTERNAL_SICJ0050")); // D226232
int id = 0;
if (highWaterMark < table.length)
{
// Can we store the object in any free space at the end of the table?
id = highWaterMark;
if (table[id] != null) throw new SIErrorException(nls.getFormattedMessage("IDTABLE_INTERNAL_SICJ0050", null, "IDTABLE_INTERNAL_SICJ0050")); // D226232
table[id] = value;
if (lowestPossibleFree == highWaterMark) ++lowestPossibleFree;
++highWaterMark;
}
else if (table.length < maxSize)
{
// Resize the table if we can
growTable();
id = highWaterMark;
if (table[id] != null) throw new SIErrorException(nls.getFormattedMessage("IDTABLE_INTERNAL_SICJ0050", null, "IDTABLE_INTERNAL_SICJ0050")); // D226232
table[id] = value;
if (lowestPossibleFree == highWaterMark) ++lowestPossibleFree;
++highWaterMark;
}
else
{
// Scan for free slot
id = findFreeSlot();
if (id == 0) throw new IdTableFullException();
}
if (tc.isEntryEnabled()) SibTr.exit(this, tc, "add", ""+id);
return id;
} | [
"public",
"synchronized",
"int",
"add",
"(",
"Object",
"value",
")",
"throws",
"IdTableFullException",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"add\"",
",",
"value",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"throw",
"new",
"SIErrorException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"IDTABLE_INTERNAL_SICJ0050\"",
",",
"null",
",",
"\"IDTABLE_INTERNAL_SICJ0050\"",
")",
")",
";",
"// D226232",
"int",
"id",
"=",
"0",
";",
"if",
"(",
"highWaterMark",
"<",
"table",
".",
"length",
")",
"{",
"// Can we store the object in any free space at the end of the table?",
"id",
"=",
"highWaterMark",
";",
"if",
"(",
"table",
"[",
"id",
"]",
"!=",
"null",
")",
"throw",
"new",
"SIErrorException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"IDTABLE_INTERNAL_SICJ0050\"",
",",
"null",
",",
"\"IDTABLE_INTERNAL_SICJ0050\"",
")",
")",
";",
"// D226232",
"table",
"[",
"id",
"]",
"=",
"value",
";",
"if",
"(",
"lowestPossibleFree",
"==",
"highWaterMark",
")",
"++",
"lowestPossibleFree",
";",
"++",
"highWaterMark",
";",
"}",
"else",
"if",
"(",
"table",
".",
"length",
"<",
"maxSize",
")",
"{",
"// Resize the table if we can",
"growTable",
"(",
")",
";",
"id",
"=",
"highWaterMark",
";",
"if",
"(",
"table",
"[",
"id",
"]",
"!=",
"null",
")",
"throw",
"new",
"SIErrorException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"IDTABLE_INTERNAL_SICJ0050\"",
",",
"null",
",",
"\"IDTABLE_INTERNAL_SICJ0050\"",
")",
")",
";",
"// D226232",
"table",
"[",
"id",
"]",
"=",
"value",
";",
"if",
"(",
"lowestPossibleFree",
"==",
"highWaterMark",
")",
"++",
"lowestPossibleFree",
";",
"++",
"highWaterMark",
";",
"}",
"else",
"{",
"// Scan for free slot",
"id",
"=",
"findFreeSlot",
"(",
")",
";",
"if",
"(",
"id",
"==",
"0",
")",
"throw",
"new",
"IdTableFullException",
"(",
")",
";",
"}",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"add\"",
",",
"\"\"",
"+",
"id",
")",
";",
"return",
"id",
";",
"}"
] | Adds an object to the table and returns the ID associated with the
object in the table. The object will never be assigned an ID which
clashes with another object.
@param value The object to store in the table
@return int The ID value that has been associated with the object.
@throws IdTableFullException Thrown if there is no space left in the
table. | [
"Adds",
"an",
"object",
"to",
"the",
"table",
"and",
"returns",
"the",
"ID",
"associated",
"with",
"the",
"object",
"in",
"the",
"table",
".",
"The",
"object",
"will",
"never",
"be",
"assigned",
"an",
"ID",
"which",
"clashes",
"with",
"another",
"object",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/IdTable.java#L100-L137 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/IdTable.java | IdTable.remove | public synchronized Object remove(int id)
throws IllegalArgumentException
{
if (tc.isEntryEnabled()) SibTr.entry(this, tc, "remove", ""+id);
Object returnValue = get(id);
if (returnValue != null) table[id] = null;
if (id < lowestPossibleFree) lowestPossibleFree = id;
// If the ID removed was at just below the high water mark, then
// move the high water mark down as far as we can.
if ((id+1) == highWaterMark)
{
int index = id;
while(index >= lowestPossibleFree)
{
if (table[index] == null) highWaterMark = index;
--index;
}
}
if (tc.isEntryEnabled()) SibTr.exit(this, tc, "remove", returnValue);
return returnValue;
} | java | public synchronized Object remove(int id)
throws IllegalArgumentException
{
if (tc.isEntryEnabled()) SibTr.entry(this, tc, "remove", ""+id);
Object returnValue = get(id);
if (returnValue != null) table[id] = null;
if (id < lowestPossibleFree) lowestPossibleFree = id;
// If the ID removed was at just below the high water mark, then
// move the high water mark down as far as we can.
if ((id+1) == highWaterMark)
{
int index = id;
while(index >= lowestPossibleFree)
{
if (table[index] == null) highWaterMark = index;
--index;
}
}
if (tc.isEntryEnabled()) SibTr.exit(this, tc, "remove", returnValue);
return returnValue;
} | [
"public",
"synchronized",
"Object",
"remove",
"(",
"int",
"id",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"remove\"",
",",
"\"\"",
"+",
"id",
")",
";",
"Object",
"returnValue",
"=",
"get",
"(",
"id",
")",
";",
"if",
"(",
"returnValue",
"!=",
"null",
")",
"table",
"[",
"id",
"]",
"=",
"null",
";",
"if",
"(",
"id",
"<",
"lowestPossibleFree",
")",
"lowestPossibleFree",
"=",
"id",
";",
"// If the ID removed was at just below the high water mark, then",
"// move the high water mark down as far as we can.",
"if",
"(",
"(",
"id",
"+",
"1",
")",
"==",
"highWaterMark",
")",
"{",
"int",
"index",
"=",
"id",
";",
"while",
"(",
"index",
">=",
"lowestPossibleFree",
")",
"{",
"if",
"(",
"table",
"[",
"index",
"]",
"==",
"null",
")",
"highWaterMark",
"=",
"index",
";",
"--",
"index",
";",
"}",
"}",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"remove\"",
",",
"returnValue",
")",
";",
"return",
"returnValue",
";",
"}"
] | Removes an object from the table.
@param id The ID of the object to remove. It is valid to specify
an ID which does not map to an object, this is effectivly a no-op.
@return Object The object which was removed or null if the ID did
not map to an object.
@throws IllegalArgumentException Thrown if the id specified is less than
one or larger than the maximum size specified when the table was
created. | [
"Removes",
"an",
"object",
"from",
"the",
"table",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/IdTable.java#L149-L173 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/IdTable.java | IdTable.get | public synchronized Object get(int id)
throws IllegalArgumentException
{
if (tc.isEntryEnabled()) SibTr.entry(this, tc, "get", ""+id);
if ((id < 1) || (id > maxSize)) throw new SIErrorException(nls.getFormattedMessage("IDTABLE_INTERNAL_SICJ0050", null, "IDTABLE_INTERNAL_SICJ0050")); // D226232
Object returnValue = null;
if (id < table.length) returnValue = table[id];
if (tc.isEntryEnabled()) SibTr.exit(this, tc, "get", ""+returnValue);
return returnValue;
} | java | public synchronized Object get(int id)
throws IllegalArgumentException
{
if (tc.isEntryEnabled()) SibTr.entry(this, tc, "get", ""+id);
if ((id < 1) || (id > maxSize)) throw new SIErrorException(nls.getFormattedMessage("IDTABLE_INTERNAL_SICJ0050", null, "IDTABLE_INTERNAL_SICJ0050")); // D226232
Object returnValue = null;
if (id < table.length) returnValue = table[id];
if (tc.isEntryEnabled()) SibTr.exit(this, tc, "get", ""+returnValue);
return returnValue;
} | [
"public",
"synchronized",
"Object",
"get",
"(",
"int",
"id",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"get\"",
",",
"\"\"",
"+",
"id",
")",
";",
"if",
"(",
"(",
"id",
"<",
"1",
")",
"||",
"(",
"id",
">",
"maxSize",
")",
")",
"throw",
"new",
"SIErrorException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"IDTABLE_INTERNAL_SICJ0050\"",
",",
"null",
",",
"\"IDTABLE_INTERNAL_SICJ0050\"",
")",
")",
";",
"// D226232",
"Object",
"returnValue",
"=",
"null",
";",
"if",
"(",
"id",
"<",
"table",
".",
"length",
")",
"returnValue",
"=",
"table",
"[",
"id",
"]",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"get\"",
",",
"\"\"",
"+",
"returnValue",
")",
";",
"return",
"returnValue",
";",
"}"
] | Gets an object from the table by ID. Returns the object associated
with the specified ID. It is valid to specify an ID which does not
have an object associated with it. In this case, a value of
null is returned.
@param id The ID to get the object associated with.
@return Object The object associated with the ID or null if no object is
associated with the ID.
@throws IllegalArgumentException Thrown if the ID is less than one or
greater than the maximum size for the table specified at the time the
table was created. | [
"Gets",
"an",
"object",
"from",
"the",
"table",
"by",
"ID",
".",
"Returns",
"the",
"object",
"associated",
"with",
"the",
"specified",
"ID",
".",
"It",
"is",
"valid",
"to",
"specify",
"an",
"ID",
"which",
"does",
"not",
"have",
"an",
"object",
"associated",
"with",
"it",
".",
"In",
"this",
"case",
"a",
"value",
"of",
"null",
"is",
"returned",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/IdTable.java#L206-L216 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/IdTable.java | IdTable.growTable | private void growTable()
{
if (tc.isEntryEnabled()) SibTr.entry(this, tc, "growTable");
int newSize = Math.min(table.length+TABLE_GROWTH_INCREMENT, maxSize);
if (tc.isDebugEnabled()) SibTr.debug(this, tc, "existing size="+table.length+" new size="+newSize);
Object[] newTable = new Object[newSize+1];
System.arraycopy(table, 0, newTable, 0, table.length);
table = newTable;
if (tc.isEntryEnabled()) SibTr.exit(this, tc, "growTable");
} | java | private void growTable()
{
if (tc.isEntryEnabled()) SibTr.entry(this, tc, "growTable");
int newSize = Math.min(table.length+TABLE_GROWTH_INCREMENT, maxSize);
if (tc.isDebugEnabled()) SibTr.debug(this, tc, "existing size="+table.length+" new size="+newSize);
Object[] newTable = new Object[newSize+1];
System.arraycopy(table, 0, newTable, 0, table.length);
table = newTable;
if (tc.isEntryEnabled()) SibTr.exit(this, tc, "growTable");
} | [
"private",
"void",
"growTable",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"growTable\"",
")",
";",
"int",
"newSize",
"=",
"Math",
".",
"min",
"(",
"table",
".",
"length",
"+",
"TABLE_GROWTH_INCREMENT",
",",
"maxSize",
")",
";",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"existing size=\"",
"+",
"table",
".",
"length",
"+",
"\" new size=\"",
"+",
"newSize",
")",
";",
"Object",
"[",
"]",
"newTable",
"=",
"new",
"Object",
"[",
"newSize",
"+",
"1",
"]",
";",
"System",
".",
"arraycopy",
"(",
"table",
",",
"0",
",",
"newTable",
",",
"0",
",",
"table",
".",
"length",
")",
";",
"table",
"=",
"newTable",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"growTable\"",
")",
";",
"}"
] | Helper method which increases the size of the table by a factor of
TABLE_GROWTH_INCREMENT until the maximum size for the table is
achieved. | [
"Helper",
"method",
"which",
"increases",
"the",
"size",
"of",
"the",
"table",
"by",
"a",
"factor",
"of",
"TABLE_GROWTH_INCREMENT",
"until",
"the",
"maximum",
"size",
"for",
"the",
"table",
"is",
"achieved",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/IdTable.java#L223-L232 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/IdTable.java | IdTable.findFreeSlot | private int findFreeSlot()
{
if (tc.isEntryEnabled()) SibTr.entry(this, tc, "findFreeSlot");
boolean foundFreeSlot = false;
int index = lowestPossibleFree;
int largestIndex = Math.min(highWaterMark, table.length-1);
while ((!foundFreeSlot) && (index <= largestIndex))
{
foundFreeSlot = (table[index] == null);
++index;
}
int freeSlot = 0;
if (foundFreeSlot)
{
freeSlot = index-1;
// If we have already scanned more than half the table then
// we might as well spend a little more time and see if we can
// move the high water mark any lower...
if ((index*2) > largestIndex)
{
boolean quit = false;
int lowest = index;
index = largestIndex;
while (!quit && (index >= lowest))
{
if (table[index] == null) highWaterMark = index;
else quit = true;
--index;
}
}
}
if (tc.isEntryEnabled()) SibTr.exit(this, tc, "findFreeSlot", ""+freeSlot);
return freeSlot;
} | java | private int findFreeSlot()
{
if (tc.isEntryEnabled()) SibTr.entry(this, tc, "findFreeSlot");
boolean foundFreeSlot = false;
int index = lowestPossibleFree;
int largestIndex = Math.min(highWaterMark, table.length-1);
while ((!foundFreeSlot) && (index <= largestIndex))
{
foundFreeSlot = (table[index] == null);
++index;
}
int freeSlot = 0;
if (foundFreeSlot)
{
freeSlot = index-1;
// If we have already scanned more than half the table then
// we might as well spend a little more time and see if we can
// move the high water mark any lower...
if ((index*2) > largestIndex)
{
boolean quit = false;
int lowest = index;
index = largestIndex;
while (!quit && (index >= lowest))
{
if (table[index] == null) highWaterMark = index;
else quit = true;
--index;
}
}
}
if (tc.isEntryEnabled()) SibTr.exit(this, tc, "findFreeSlot", ""+freeSlot);
return freeSlot;
} | [
"private",
"int",
"findFreeSlot",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"findFreeSlot\"",
")",
";",
"boolean",
"foundFreeSlot",
"=",
"false",
";",
"int",
"index",
"=",
"lowestPossibleFree",
";",
"int",
"largestIndex",
"=",
"Math",
".",
"min",
"(",
"highWaterMark",
",",
"table",
".",
"length",
"-",
"1",
")",
";",
"while",
"(",
"(",
"!",
"foundFreeSlot",
")",
"&&",
"(",
"index",
"<=",
"largestIndex",
")",
")",
"{",
"foundFreeSlot",
"=",
"(",
"table",
"[",
"index",
"]",
"==",
"null",
")",
";",
"++",
"index",
";",
"}",
"int",
"freeSlot",
"=",
"0",
";",
"if",
"(",
"foundFreeSlot",
")",
"{",
"freeSlot",
"=",
"index",
"-",
"1",
";",
"// If we have already scanned more than half the table then",
"// we might as well spend a little more time and see if we can",
"// move the high water mark any lower...",
"if",
"(",
"(",
"index",
"*",
"2",
")",
">",
"largestIndex",
")",
"{",
"boolean",
"quit",
"=",
"false",
";",
"int",
"lowest",
"=",
"index",
";",
"index",
"=",
"largestIndex",
";",
"while",
"(",
"!",
"quit",
"&&",
"(",
"index",
">=",
"lowest",
")",
")",
"{",
"if",
"(",
"table",
"[",
"index",
"]",
"==",
"null",
")",
"highWaterMark",
"=",
"index",
";",
"else",
"quit",
"=",
"true",
";",
"--",
"index",
";",
"}",
"}",
"}",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"findFreeSlot\"",
",",
"\"\"",
"+",
"freeSlot",
")",
";",
"return",
"freeSlot",
";",
"}"
] | Helper method which attempts to locate a free slot in the table.
The algorithm used is to scan from the lowest possible free value
looking for an entry with a null value. If more than half the
table is scanned before a free slot is found, then the code also
attempts to move the high watermark back towards the beginning of
the table by scanning backwards looking for the last empty slot.
@return int A free slot to use, or zero if the table does not
contain a free slot. | [
"Helper",
"method",
"which",
"attempts",
"to",
"locate",
"a",
"free",
"slot",
"in",
"the",
"table",
".",
"The",
"algorithm",
"used",
"is",
"to",
"scan",
"from",
"the",
"lowest",
"possible",
"free",
"value",
"looking",
"for",
"an",
"entry",
"with",
"a",
"null",
"value",
".",
"If",
"more",
"than",
"half",
"the",
"table",
"is",
"scanned",
"before",
"a",
"free",
"slot",
"is",
"found",
"then",
"the",
"code",
"also",
"attempts",
"to",
"move",
"the",
"high",
"watermark",
"back",
"towards",
"the",
"beginning",
"of",
"the",
"table",
"by",
"scanning",
"backwards",
"looking",
"for",
"the",
"last",
"empty",
"slot",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/IdTable.java#L244-L281 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.httpservice/src/com/ibm/ws/httpsvc/servlet/internal/RequestMessage.java | RequestMessage.init | public void init(HttpInboundConnection conn, SessionManager sessMgr) {
this.connection = conn;
this.request = conn.getRequest();
this.sessionData = new SessionInfo(this, sessMgr);
} | java | public void init(HttpInboundConnection conn, SessionManager sessMgr) {
this.connection = conn;
this.request = conn.getRequest();
this.sessionData = new SessionInfo(this, sessMgr);
} | [
"public",
"void",
"init",
"(",
"HttpInboundConnection",
"conn",
",",
"SessionManager",
"sessMgr",
")",
"{",
"this",
".",
"connection",
"=",
"conn",
";",
"this",
".",
"request",
"=",
"conn",
".",
"getRequest",
"(",
")",
";",
"this",
".",
"sessionData",
"=",
"new",
"SessionInfo",
"(",
"this",
",",
"sessMgr",
")",
";",
"}"
] | Initialize this request with the input link.
@param conn | [
"Initialize",
"this",
"request",
"with",
"the",
"input",
"link",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.httpservice/src/com/ibm/ws/httpsvc/servlet/internal/RequestMessage.java#L121-L125 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.httpservice/src/com/ibm/ws/httpsvc/servlet/internal/RequestMessage.java | RequestMessage.clear | public void clear() {
this.attributes.clear();
this.queryParameters = null;
this.inReader = null;
this.streamActive = false;
this.inStream = null;
this.encoding = null;
this.sessionData = null;
this.strippedURI = null;
this.srvContext = null;
this.srvPath = null;
this.pathInfo = null;
this.pathInfoComputed = false;
this.filters = null;
} | java | public void clear() {
this.attributes.clear();
this.queryParameters = null;
this.inReader = null;
this.streamActive = false;
this.inStream = null;
this.encoding = null;
this.sessionData = null;
this.strippedURI = null;
this.srvContext = null;
this.srvPath = null;
this.pathInfo = null;
this.pathInfoComputed = false;
this.filters = null;
} | [
"public",
"void",
"clear",
"(",
")",
"{",
"this",
".",
"attributes",
".",
"clear",
"(",
")",
";",
"this",
".",
"queryParameters",
"=",
"null",
";",
"this",
".",
"inReader",
"=",
"null",
";",
"this",
".",
"streamActive",
"=",
"false",
";",
"this",
".",
"inStream",
"=",
"null",
";",
"this",
".",
"encoding",
"=",
"null",
";",
"this",
".",
"sessionData",
"=",
"null",
";",
"this",
".",
"strippedURI",
"=",
"null",
";",
"this",
".",
"srvContext",
"=",
"null",
";",
"this",
".",
"srvPath",
"=",
"null",
";",
"this",
".",
"pathInfo",
"=",
"null",
";",
"this",
".",
"pathInfoComputed",
"=",
"false",
";",
"this",
".",
"filters",
"=",
"null",
";",
"}"
] | Clear all the temporary variables of this request. | [
"Clear",
"all",
"the",
"temporary",
"variables",
"of",
"this",
"request",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.httpservice/src/com/ibm/ws/httpsvc/servlet/internal/RequestMessage.java#L130-L144 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.httpservice/src/com/ibm/ws/httpsvc/servlet/internal/RequestMessage.java | RequestMessage.parseQueryFormData | private void parseQueryFormData() throws IOException {
int size = getContentLength();
if (0 == size) {
// no body present
this.queryParameters = new HashMap<String, String[]>();
return;
} else if (-1 == size) {
// chunked encoded perhaps
size = 1024;
}
StringBuilder sb = new StringBuilder(size);
char[] data = new char[size];
BufferedReader reader = getReader();
int len = reader.read(data);
while (-1 != len) {
sb.append(data, 0, len);
len = reader.read(data);
}
this.queryParameters = parseQueryString(sb.toString());
} | java | private void parseQueryFormData() throws IOException {
int size = getContentLength();
if (0 == size) {
// no body present
this.queryParameters = new HashMap<String, String[]>();
return;
} else if (-1 == size) {
// chunked encoded perhaps
size = 1024;
}
StringBuilder sb = new StringBuilder(size);
char[] data = new char[size];
BufferedReader reader = getReader();
int len = reader.read(data);
while (-1 != len) {
sb.append(data, 0, len);
len = reader.read(data);
}
this.queryParameters = parseQueryString(sb.toString());
} | [
"private",
"void",
"parseQueryFormData",
"(",
")",
"throws",
"IOException",
"{",
"int",
"size",
"=",
"getContentLength",
"(",
")",
";",
"if",
"(",
"0",
"==",
"size",
")",
"{",
"// no body present",
"this",
".",
"queryParameters",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
"[",
"]",
">",
"(",
")",
";",
"return",
";",
"}",
"else",
"if",
"(",
"-",
"1",
"==",
"size",
")",
"{",
"// chunked encoded perhaps",
"size",
"=",
"1024",
";",
"}",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"size",
")",
";",
"char",
"[",
"]",
"data",
"=",
"new",
"char",
"[",
"size",
"]",
";",
"BufferedReader",
"reader",
"=",
"getReader",
"(",
")",
";",
"int",
"len",
"=",
"reader",
".",
"read",
"(",
"data",
")",
";",
"while",
"(",
"-",
"1",
"!=",
"len",
")",
"{",
"sb",
".",
"append",
"(",
"data",
",",
"0",
",",
"len",
")",
";",
"len",
"=",
"reader",
".",
"read",
"(",
"data",
")",
";",
"}",
"this",
".",
"queryParameters",
"=",
"parseQueryString",
"(",
"sb",
".",
"toString",
"(",
")",
")",
";",
"}"
] | Read and parse the POST body data that represents query data.
@throws IOException | [
"Read",
"and",
"parse",
"the",
"POST",
"body",
"data",
"that",
"represents",
"query",
"data",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.httpservice/src/com/ibm/ws/httpsvc/servlet/internal/RequestMessage.java#L693-L712 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.httpservice/src/com/ibm/ws/httpsvc/servlet/internal/RequestMessage.java | RequestMessage.parseQueryString | private Map<String, String[]> parseQueryString(String data) {
Map<String, String[]> map = new Hashtable<String, String[]>();
if (null == data) {
return map;
}
String valArray[] = null;
char[] chars = data.toCharArray();
int key_start = 0;
for (int i = 0; i < chars.length; i++) {
// look for the key name delimiter
if ('=' == chars[i]) {
if (i == key_start) {
// missing the key name
throw new IllegalArgumentException("Missing key name: " + i);
}
String key = parseName(chars, key_start, i);
int value_start = ++i;
for (; i < chars.length && '&' != chars[i]; i++) {
// just keep looping looking for the end or &
}
if (i > value_start) {
// did find at least one char for the value
String value = parseName(chars, value_start, i);
if (map.containsKey(key)) {
String oldVals[] = map.get(key);
valArray = new String[oldVals.length + 1];
System.arraycopy(oldVals, 0, valArray, 0, oldVals.length);
valArray[oldVals.length] = value;
} else {
valArray = new String[] { value };
}
map.put(key, valArray);
}
key_start = i + 1;
}
}
return map;
} | java | private Map<String, String[]> parseQueryString(String data) {
Map<String, String[]> map = new Hashtable<String, String[]>();
if (null == data) {
return map;
}
String valArray[] = null;
char[] chars = data.toCharArray();
int key_start = 0;
for (int i = 0; i < chars.length; i++) {
// look for the key name delimiter
if ('=' == chars[i]) {
if (i == key_start) {
// missing the key name
throw new IllegalArgumentException("Missing key name: " + i);
}
String key = parseName(chars, key_start, i);
int value_start = ++i;
for (; i < chars.length && '&' != chars[i]; i++) {
// just keep looping looking for the end or &
}
if (i > value_start) {
// did find at least one char for the value
String value = parseName(chars, value_start, i);
if (map.containsKey(key)) {
String oldVals[] = map.get(key);
valArray = new String[oldVals.length + 1];
System.arraycopy(oldVals, 0, valArray, 0, oldVals.length);
valArray[oldVals.length] = value;
} else {
valArray = new String[] { value };
}
map.put(key, valArray);
}
key_start = i + 1;
}
}
return map;
} | [
"private",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"parseQueryString",
"(",
"String",
"data",
")",
"{",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"map",
"=",
"new",
"Hashtable",
"<",
"String",
",",
"String",
"[",
"]",
">",
"(",
")",
";",
"if",
"(",
"null",
"==",
"data",
")",
"{",
"return",
"map",
";",
"}",
"String",
"valArray",
"[",
"]",
"=",
"null",
";",
"char",
"[",
"]",
"chars",
"=",
"data",
".",
"toCharArray",
"(",
")",
";",
"int",
"key_start",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"chars",
".",
"length",
";",
"i",
"++",
")",
"{",
"// look for the key name delimiter",
"if",
"(",
"'",
"'",
"==",
"chars",
"[",
"i",
"]",
")",
"{",
"if",
"(",
"i",
"==",
"key_start",
")",
"{",
"// missing the key name",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Missing key name: \"",
"+",
"i",
")",
";",
"}",
"String",
"key",
"=",
"parseName",
"(",
"chars",
",",
"key_start",
",",
"i",
")",
";",
"int",
"value_start",
"=",
"++",
"i",
";",
"for",
"(",
";",
"i",
"<",
"chars",
".",
"length",
"&&",
"'",
"'",
"!=",
"chars",
"[",
"i",
"]",
";",
"i",
"++",
")",
"{",
"// just keep looping looking for the end or &",
"}",
"if",
"(",
"i",
">",
"value_start",
")",
"{",
"// did find at least one char for the value",
"String",
"value",
"=",
"parseName",
"(",
"chars",
",",
"value_start",
",",
"i",
")",
";",
"if",
"(",
"map",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"String",
"oldVals",
"[",
"]",
"=",
"map",
".",
"get",
"(",
"key",
")",
";",
"valArray",
"=",
"new",
"String",
"[",
"oldVals",
".",
"length",
"+",
"1",
"]",
";",
"System",
".",
"arraycopy",
"(",
"oldVals",
",",
"0",
",",
"valArray",
",",
"0",
",",
"oldVals",
".",
"length",
")",
";",
"valArray",
"[",
"oldVals",
".",
"length",
"]",
"=",
"value",
";",
"}",
"else",
"{",
"valArray",
"=",
"new",
"String",
"[",
"]",
"{",
"value",
"}",
";",
"}",
"map",
".",
"put",
"(",
"key",
",",
"valArray",
")",
";",
"}",
"key_start",
"=",
"i",
"+",
"1",
";",
"}",
"}",
"return",
"map",
";",
"}"
] | Parse a string of query parameters into a Map representing the values
stored using the name as the key.
@param data
@return Map
@throws IllegalArgumentException
if the string is formatted incorrectly | [
"Parse",
"a",
"string",
"of",
"query",
"parameters",
"into",
"a",
"Map",
"representing",
"the",
"values",
"stored",
"using",
"the",
"name",
"as",
"the",
"key",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.httpservice/src/com/ibm/ws/httpsvc/servlet/internal/RequestMessage.java#L774-L811 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.httpservice/src/com/ibm/ws/httpsvc/servlet/internal/RequestMessage.java | RequestMessage.mergeQueryParams | private void mergeQueryParams(Map<String, String[]> urlParams) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "mergeQueryParams: " + urlParams);
}
for (Entry<String, String[]> entry : urlParams.entrySet()) {
String key = entry.getKey();
// prepend to postdata values if necessary
String[] post = this.queryParameters.get(key);
String[] url = entry.getValue();
if (null != post) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "map already contains key " + key);
}
String[] newVals = new String[post.length + url.length];
System.arraycopy(url, 0, newVals, 0, url.length);
System.arraycopy(post, 0, newVals, url.length, post.length);
this.queryParameters.put(key, newVals);
} else {
this.queryParameters.put(key, url);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "put key " + key + " into map.");
}
}
} | java | private void mergeQueryParams(Map<String, String[]> urlParams) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "mergeQueryParams: " + urlParams);
}
for (Entry<String, String[]> entry : urlParams.entrySet()) {
String key = entry.getKey();
// prepend to postdata values if necessary
String[] post = this.queryParameters.get(key);
String[] url = entry.getValue();
if (null != post) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "map already contains key " + key);
}
String[] newVals = new String[post.length + url.length];
System.arraycopy(url, 0, newVals, 0, url.length);
System.arraycopy(post, 0, newVals, url.length, post.length);
this.queryParameters.put(key, newVals);
} else {
this.queryParameters.put(key, url);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "put key " + key + " into map.");
}
}
} | [
"private",
"void",
"mergeQueryParams",
"(",
"Map",
"<",
"String",
",",
"String",
"[",
"]",
">",
"urlParams",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"mergeQueryParams: \"",
"+",
"urlParams",
")",
";",
"}",
"for",
"(",
"Entry",
"<",
"String",
",",
"String",
"[",
"]",
">",
"entry",
":",
"urlParams",
".",
"entrySet",
"(",
")",
")",
"{",
"String",
"key",
"=",
"entry",
".",
"getKey",
"(",
")",
";",
"// prepend to postdata values if necessary",
"String",
"[",
"]",
"post",
"=",
"this",
".",
"queryParameters",
".",
"get",
"(",
"key",
")",
";",
"String",
"[",
"]",
"url",
"=",
"entry",
".",
"getValue",
"(",
")",
";",
"if",
"(",
"null",
"!=",
"post",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"map already contains key \"",
"+",
"key",
")",
";",
"}",
"String",
"[",
"]",
"newVals",
"=",
"new",
"String",
"[",
"post",
".",
"length",
"+",
"url",
".",
"length",
"]",
";",
"System",
".",
"arraycopy",
"(",
"url",
",",
"0",
",",
"newVals",
",",
"0",
",",
"url",
".",
"length",
")",
";",
"System",
".",
"arraycopy",
"(",
"post",
",",
"0",
",",
"newVals",
",",
"url",
".",
"length",
",",
"post",
".",
"length",
")",
";",
"this",
".",
"queryParameters",
".",
"put",
"(",
"key",
",",
"newVals",
")",
";",
"}",
"else",
"{",
"this",
".",
"queryParameters",
".",
"put",
"(",
"key",
",",
"url",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"put key \"",
"+",
"key",
"+",
"\" into map.\"",
")",
";",
"}",
"}",
"}"
] | In certain cases, the URL will contain query string information and the
POST body will as well. This method merges the two maps together.
@param urlParams | [
"In",
"certain",
"cases",
"the",
"URL",
"will",
"contain",
"query",
"string",
"information",
"and",
"the",
"POST",
"body",
"will",
"as",
"well",
".",
"This",
"method",
"merges",
"the",
"two",
"maps",
"together",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.httpservice/src/com/ibm/ws/httpsvc/servlet/internal/RequestMessage.java#L819-L843 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.httpservice/src/com/ibm/ws/httpsvc/servlet/internal/RequestMessage.java | RequestMessage.getCipherSuite | private String getCipherSuite() {
String suite = null;
SSLContext ssl = this.connection.getSSLContext();
if (null != ssl) {
suite = ssl.getSession().getCipherSuite();
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "getCipherSuite [" + suite + "]");
}
return suite;
} | java | private String getCipherSuite() {
String suite = null;
SSLContext ssl = this.connection.getSSLContext();
if (null != ssl) {
suite = ssl.getSession().getCipherSuite();
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "getCipherSuite [" + suite + "]");
}
return suite;
} | [
"private",
"String",
"getCipherSuite",
"(",
")",
"{",
"String",
"suite",
"=",
"null",
";",
"SSLContext",
"ssl",
"=",
"this",
".",
"connection",
".",
"getSSLContext",
"(",
")",
";",
"if",
"(",
"null",
"!=",
"ssl",
")",
"{",
"suite",
"=",
"ssl",
".",
"getSession",
"(",
")",
".",
"getCipherSuite",
"(",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"getCipherSuite [\"",
"+",
"suite",
"+",
"\"]\"",
")",
";",
"}",
"return",
"suite",
";",
"}"
] | Access the SSL cipher suite used in this connection.
@return String - null if this is not a secure connection | [
"Access",
"the",
"SSL",
"cipher",
"suite",
"used",
"in",
"this",
"connection",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.httpservice/src/com/ibm/ws/httpsvc/servlet/internal/RequestMessage.java#L1085-L1095 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.httpservice/src/com/ibm/ws/httpsvc/servlet/internal/RequestMessage.java | RequestMessage.getPeerCertificates | private X509Certificate[] getPeerCertificates() {
X509Certificate[] rc = null;
SSLContext ssl = this.connection.getSSLContext();
if (null != ssl && (ssl.getNeedClientAuth() || ssl.getWantClientAuth())) {
try {
Object[] objs = ssl.getSession().getPeerCertificates();
if (null != objs) {
rc = (X509Certificate[]) objs;
}
} catch (Throwable t) {
FFDCFilter.processException(t,
getClass().getName(), "peercerts",
new Object[] { this, ssl });
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "Error getting peer certs; " + t);
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
if (null == rc) {
Tr.debug(tc, "getPeerCertificates: none");
} else {
Tr.debug(tc, "getPeerCertificates: " + rc.length);
}
}
return rc;
} | java | private X509Certificate[] getPeerCertificates() {
X509Certificate[] rc = null;
SSLContext ssl = this.connection.getSSLContext();
if (null != ssl && (ssl.getNeedClientAuth() || ssl.getWantClientAuth())) {
try {
Object[] objs = ssl.getSession().getPeerCertificates();
if (null != objs) {
rc = (X509Certificate[]) objs;
}
} catch (Throwable t) {
FFDCFilter.processException(t,
getClass().getName(), "peercerts",
new Object[] { this, ssl });
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "Error getting peer certs; " + t);
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
if (null == rc) {
Tr.debug(tc, "getPeerCertificates: none");
} else {
Tr.debug(tc, "getPeerCertificates: " + rc.length);
}
}
return rc;
} | [
"private",
"X509Certificate",
"[",
"]",
"getPeerCertificates",
"(",
")",
"{",
"X509Certificate",
"[",
"]",
"rc",
"=",
"null",
";",
"SSLContext",
"ssl",
"=",
"this",
".",
"connection",
".",
"getSSLContext",
"(",
")",
";",
"if",
"(",
"null",
"!=",
"ssl",
"&&",
"(",
"ssl",
".",
"getNeedClientAuth",
"(",
")",
"||",
"ssl",
".",
"getWantClientAuth",
"(",
")",
")",
")",
"{",
"try",
"{",
"Object",
"[",
"]",
"objs",
"=",
"ssl",
".",
"getSession",
"(",
")",
".",
"getPeerCertificates",
"(",
")",
";",
"if",
"(",
"null",
"!=",
"objs",
")",
"{",
"rc",
"=",
"(",
"X509Certificate",
"[",
"]",
")",
"objs",
";",
"}",
"}",
"catch",
"(",
"Throwable",
"t",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"t",
",",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
",",
"\"peercerts\"",
",",
"new",
"Object",
"[",
"]",
"{",
"this",
",",
"ssl",
"}",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"Error getting peer certs; \"",
"+",
"t",
")",
";",
"}",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"if",
"(",
"null",
"==",
"rc",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"getPeerCertificates: none\"",
")",
";",
"}",
"else",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"getPeerCertificates: \"",
"+",
"rc",
".",
"length",
")",
";",
"}",
"}",
"return",
"rc",
";",
"}"
] | Access any client SSL certificates for this connection.
@return X509Certificate[] - null if non-ssl or none exist | [
"Access",
"any",
"client",
"SSL",
"certificates",
"for",
"this",
"connection",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.httpservice/src/com/ibm/ws/httpsvc/servlet/internal/RequestMessage.java#L1102-L1128 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/MessageProcessorMatching.java | MessageProcessorMatching.removeTarget | public void removeTarget(Object key) throws MatchingException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc,
"removeTarget",
new Object[]{key});
// Remove from the HashMap, with synch, there may be other accessors
synchronized(_targets)
{
Target targ = (Target) _targets.get(key);
if (targ == null)
throw new MatchingException();
for (int i = 0; i < targ.targets.length; i++)
_matchSpace.removeTarget(targ.expr[i], targ.targets[i]);
// Now remove the Target from the cache
_targets.remove(key);
// Remove from the Monitor state, with synch, there may be other accessors
if(targ.targets.length > 0) // Defect 417084, check targets is non-empty
{
if(targ.targets[0] instanceof MonitoredConsumer)
_consumerMonitoring.removeConsumer((MonitoredConsumer)targ.targets[0]);
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "removeTarget");
} | java | public void removeTarget(Object key) throws MatchingException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc,
"removeTarget",
new Object[]{key});
// Remove from the HashMap, with synch, there may be other accessors
synchronized(_targets)
{
Target targ = (Target) _targets.get(key);
if (targ == null)
throw new MatchingException();
for (int i = 0; i < targ.targets.length; i++)
_matchSpace.removeTarget(targ.expr[i], targ.targets[i]);
// Now remove the Target from the cache
_targets.remove(key);
// Remove from the Monitor state, with synch, there may be other accessors
if(targ.targets.length > 0) // Defect 417084, check targets is non-empty
{
if(targ.targets[0] instanceof MonitoredConsumer)
_consumerMonitoring.removeConsumer((MonitoredConsumer)targ.targets[0]);
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "removeTarget");
} | [
"public",
"void",
"removeTarget",
"(",
"Object",
"key",
")",
"throws",
"MatchingException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"removeTarget\"",
",",
"new",
"Object",
"[",
"]",
"{",
"key",
"}",
")",
";",
"// Remove from the HashMap, with synch, there may be other accessors",
"synchronized",
"(",
"_targets",
")",
"{",
"Target",
"targ",
"=",
"(",
"Target",
")",
"_targets",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"targ",
"==",
"null",
")",
"throw",
"new",
"MatchingException",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"targ",
".",
"targets",
".",
"length",
";",
"i",
"++",
")",
"_matchSpace",
".",
"removeTarget",
"(",
"targ",
".",
"expr",
"[",
"i",
"]",
",",
"targ",
".",
"targets",
"[",
"i",
"]",
")",
";",
"// Now remove the Target from the cache",
"_targets",
".",
"remove",
"(",
"key",
")",
";",
"// Remove from the Monitor state, with synch, there may be other accessors",
"if",
"(",
"targ",
".",
"targets",
".",
"length",
">",
"0",
")",
"// Defect 417084, check targets is non-empty",
"{",
"if",
"(",
"targ",
".",
"targets",
"[",
"0",
"]",
"instanceof",
"MonitoredConsumer",
")",
"_consumerMonitoring",
".",
"removeConsumer",
"(",
"(",
"MonitoredConsumer",
")",
"targ",
".",
"targets",
"[",
"0",
"]",
")",
";",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"removeTarget\"",
")",
";",
"}"
] | Remove a target from the MatchSpace
@param key the identity of the target to remove (established at addTarget time)
@exception MatchingException if key undefined or on serious error | [
"Remove",
"a",
"target",
"from",
"the",
"MatchSpace"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/MessageProcessorMatching.java#L452-L478 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/MessageProcessorMatching.java | MessageProcessorMatching.removeConsumerPointMatchTarget | public void removeConsumerPointMatchTarget(DispatchableKey consumerPointData)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "removeConsumerPointMatchTarget", consumerPointData);
// Remove the consumer point from the matchspace
try
{
removeTarget(consumerPointData);
}
catch (MatchingException e)
{
// FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching.removeConsumerPointMatchTarget",
"1:840:1.117.1.11",
this);
SibTr.exception(tc, e);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "removeConsumerPointMatchTarget", "SICoreException");
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
"1:851:1.117.1.11",
e });
throw new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
"1:859:1.117.1.11",
e },
null),
e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "removeConsumerPointMatchTarget");
} | java | public void removeConsumerPointMatchTarget(DispatchableKey consumerPointData)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "removeConsumerPointMatchTarget", consumerPointData);
// Remove the consumer point from the matchspace
try
{
removeTarget(consumerPointData);
}
catch (MatchingException e)
{
// FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching.removeConsumerPointMatchTarget",
"1:840:1.117.1.11",
this);
SibTr.exception(tc, e);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "removeConsumerPointMatchTarget", "SICoreException");
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
"1:851:1.117.1.11",
e });
throw new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
"1:859:1.117.1.11",
e },
null),
e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "removeConsumerPointMatchTarget");
} | [
"public",
"void",
"removeConsumerPointMatchTarget",
"(",
"DispatchableKey",
"consumerPointData",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"removeConsumerPointMatchTarget\"",
",",
"consumerPointData",
")",
";",
"// Remove the consumer point from the matchspace",
"try",
"{",
"removeTarget",
"(",
"consumerPointData",
")",
";",
"}",
"catch",
"(",
"MatchingException",
"e",
")",
"{",
"// FFDC",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.matching.MessageProcessorMatching.removeConsumerPointMatchTarget\"",
",",
"\"1:840:1.117.1.11\"",
",",
"this",
")",
";",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"removeConsumerPointMatchTarget\"",
",",
"\"SICoreException\"",
")",
";",
"SibTr",
".",
"error",
"(",
"tc",
",",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.matching.MessageProcessorMatching\"",
",",
"\"1:851:1.117.1.11\"",
",",
"e",
"}",
")",
";",
"throw",
"new",
"SIErrorException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.matching.MessageProcessorMatching\"",
",",
"\"1:859:1.117.1.11\"",
",",
"e",
"}",
",",
"null",
")",
",",
"e",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"removeConsumerPointMatchTarget\"",
")",
";",
"}"
] | Method removeConsumerPointMatchTarget
Used to remove a ConsumerPoint from the MatchSpace.
@param consumerPointData The consumer to remove | [
"Method",
"removeConsumerPointMatchTarget",
"Used",
"to",
"remove",
"a",
"ConsumerPoint",
"from",
"the",
"MatchSpace",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/MessageProcessorMatching.java#L784-L827 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/MessageProcessorMatching.java | MessageProcessorMatching.addPubSubOutputHandlerMatchTarget | public ControllableProxySubscription addPubSubOutputHandlerMatchTarget(
PubSubOutputHandler handler,
SIBUuid12 topicSpace,
String discriminator,
boolean foreignSecuredProxy,
String MESubUserId)
throws
SIDiscriminatorSyntaxException,
SISelectorSyntaxException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"addPubSubOutputHandlerMatchTarget",
new Object[] { handler, topicSpace, discriminator, Boolean.valueOf(foreignSecuredProxy), MESubUserId});
// Combine the topicSpace and topic
String topicSpaceStr = topicSpace.toString();
String theTopic = buildAddTopicExpression(topicSpaceStr, discriminator);
ControllableProxySubscription key = new ControllableProxySubscription(handler,
theTopic,
foreignSecuredProxy,
MESubUserId);
// Store the CPS in the MatchSpace
try
{
addTarget(key,
// Use the output handler as key
theTopic,
null, // selector string
null, // selector domain
null, // this'll pick up the default resolver
key, // defect 240115: Store the wrappered PSOH
null,
null); // selector properties
}
catch (QuerySyntaxException e)
{
// No FFDC code needed
SibTr.exception(tc, e);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "addPubSubOutputHandlerMatchTarget", e);
throw new SISelectorSyntaxException(
nls.getFormattedMessage(
"INVALID_SELECTOR_ERROR_CWSIP0371",
new Object[] { null },
null));
}
catch (InvalidTopicSyntaxException e)
{
// No FFDC code needed
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "addPubSubOutputHandlerMatchTarget", e);
throw new SIDiscriminatorSyntaxException(
nls.getFormattedMessage(
"INVALID_TOPIC_ERROR_CWSIP0372",
new Object[] { discriminator },
null));
}
catch (MatchingException e)
{
// FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching.addPubSubOutputHandlerMatchTarget",
"1:1111:1.117.1.11",
this);
SibTr.exception(tc, e);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "addPubSubOutputHandlerMatchTarget", e);
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
"1:1122:1.117.1.11",
e });
throw new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
"1:1130:1.117.1.11",
e },
null),
e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "addPubSubOutputHandlerMatchTarget", key);
return key;
} | java | public ControllableProxySubscription addPubSubOutputHandlerMatchTarget(
PubSubOutputHandler handler,
SIBUuid12 topicSpace,
String discriminator,
boolean foreignSecuredProxy,
String MESubUserId)
throws
SIDiscriminatorSyntaxException,
SISelectorSyntaxException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"addPubSubOutputHandlerMatchTarget",
new Object[] { handler, topicSpace, discriminator, Boolean.valueOf(foreignSecuredProxy), MESubUserId});
// Combine the topicSpace and topic
String topicSpaceStr = topicSpace.toString();
String theTopic = buildAddTopicExpression(topicSpaceStr, discriminator);
ControllableProxySubscription key = new ControllableProxySubscription(handler,
theTopic,
foreignSecuredProxy,
MESubUserId);
// Store the CPS in the MatchSpace
try
{
addTarget(key,
// Use the output handler as key
theTopic,
null, // selector string
null, // selector domain
null, // this'll pick up the default resolver
key, // defect 240115: Store the wrappered PSOH
null,
null); // selector properties
}
catch (QuerySyntaxException e)
{
// No FFDC code needed
SibTr.exception(tc, e);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "addPubSubOutputHandlerMatchTarget", e);
throw new SISelectorSyntaxException(
nls.getFormattedMessage(
"INVALID_SELECTOR_ERROR_CWSIP0371",
new Object[] { null },
null));
}
catch (InvalidTopicSyntaxException e)
{
// No FFDC code needed
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "addPubSubOutputHandlerMatchTarget", e);
throw new SIDiscriminatorSyntaxException(
nls.getFormattedMessage(
"INVALID_TOPIC_ERROR_CWSIP0372",
new Object[] { discriminator },
null));
}
catch (MatchingException e)
{
// FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching.addPubSubOutputHandlerMatchTarget",
"1:1111:1.117.1.11",
this);
SibTr.exception(tc, e);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "addPubSubOutputHandlerMatchTarget", e);
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
"1:1122:1.117.1.11",
e });
throw new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
"1:1130:1.117.1.11",
e },
null),
e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "addPubSubOutputHandlerMatchTarget", key);
return key;
} | [
"public",
"ControllableProxySubscription",
"addPubSubOutputHandlerMatchTarget",
"(",
"PubSubOutputHandler",
"handler",
",",
"SIBUuid12",
"topicSpace",
",",
"String",
"discriminator",
",",
"boolean",
"foreignSecuredProxy",
",",
"String",
"MESubUserId",
")",
"throws",
"SIDiscriminatorSyntaxException",
",",
"SISelectorSyntaxException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"addPubSubOutputHandlerMatchTarget\"",
",",
"new",
"Object",
"[",
"]",
"{",
"handler",
",",
"topicSpace",
",",
"discriminator",
",",
"Boolean",
".",
"valueOf",
"(",
"foreignSecuredProxy",
")",
",",
"MESubUserId",
"}",
")",
";",
"// Combine the topicSpace and topic",
"String",
"topicSpaceStr",
"=",
"topicSpace",
".",
"toString",
"(",
")",
";",
"String",
"theTopic",
"=",
"buildAddTopicExpression",
"(",
"topicSpaceStr",
",",
"discriminator",
")",
";",
"ControllableProxySubscription",
"key",
"=",
"new",
"ControllableProxySubscription",
"(",
"handler",
",",
"theTopic",
",",
"foreignSecuredProxy",
",",
"MESubUserId",
")",
";",
"// Store the CPS in the MatchSpace",
"try",
"{",
"addTarget",
"(",
"key",
",",
"// Use the output handler as key",
"theTopic",
",",
"null",
",",
"// selector string",
"null",
",",
"// selector domain",
"null",
",",
"// this'll pick up the default resolver",
"key",
",",
"// defect 240115: Store the wrappered PSOH",
"null",
",",
"null",
")",
";",
"// selector properties",
"}",
"catch",
"(",
"QuerySyntaxException",
"e",
")",
"{",
"// No FFDC code needed",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"addPubSubOutputHandlerMatchTarget\"",
",",
"e",
")",
";",
"throw",
"new",
"SISelectorSyntaxException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"INVALID_SELECTOR_ERROR_CWSIP0371\"",
",",
"new",
"Object",
"[",
"]",
"{",
"null",
"}",
",",
"null",
")",
")",
";",
"}",
"catch",
"(",
"InvalidTopicSyntaxException",
"e",
")",
"{",
"// No FFDC code needed",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"addPubSubOutputHandlerMatchTarget\"",
",",
"e",
")",
";",
"throw",
"new",
"SIDiscriminatorSyntaxException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"INVALID_TOPIC_ERROR_CWSIP0372\"",
",",
"new",
"Object",
"[",
"]",
"{",
"discriminator",
"}",
",",
"null",
")",
")",
";",
"}",
"catch",
"(",
"MatchingException",
"e",
")",
"{",
"// FFDC",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.matching.MessageProcessorMatching.addPubSubOutputHandlerMatchTarget\"",
",",
"\"1:1111:1.117.1.11\"",
",",
"this",
")",
";",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"addPubSubOutputHandlerMatchTarget\"",
",",
"e",
")",
";",
"SibTr",
".",
"error",
"(",
"tc",
",",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.matching.MessageProcessorMatching\"",
",",
"\"1:1122:1.117.1.11\"",
",",
"e",
"}",
")",
";",
"throw",
"new",
"SIErrorException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.matching.MessageProcessorMatching\"",
",",
"\"1:1130:1.117.1.11\"",
",",
"e",
"}",
",",
"null",
")",
",",
"e",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"addPubSubOutputHandlerMatchTarget\"",
",",
"key",
")",
";",
"return",
"key",
";",
"}"
] | Used to add a PubSubOutputHandler for ME-ME comms to the MatchSpace.
@param handler The PubSubOutputHandler
@param topicSpace The topicSpace to add the outputhandler against
@param discriminator The topic for the subscription
@param foreignSecuredProxy Flag to indicate whether a proxy sub
originated from a foreign bus where the home
bus is secured.
@param MESubUserId Userid to be stored when securing foreign proxy subs | [
"Used",
"to",
"add",
"a",
"PubSubOutputHandler",
"for",
"ME",
"-",
"ME",
"comms",
"to",
"the",
"MatchSpace",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/MessageProcessorMatching.java#L1001-L1100 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/MessageProcessorMatching.java | MessageProcessorMatching.removeConsumerDispatcherMatchTarget | public void removeConsumerDispatcherMatchTarget(ConsumerDispatcher consumerDispatcher, SelectionCriteria selectionCriteria)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"removeConsumerDispatcherMatchTarget",
new Object[] {consumerDispatcher, selectionCriteria});
// Remove the consumer point from the matchspace
// Set the CD and selection criteria into a wrapper that extends MatchTarget
MatchingConsumerDispatcherWithCriteira key = new MatchingConsumerDispatcherWithCriteira (consumerDispatcher,selectionCriteria);
// Reset the CD flag to indicate that this subscription is not in the MatchSpace.
consumerDispatcher.setIsInMatchSpace(false);
try
{
removeTarget(key);
}
catch (MatchingException e)
{
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching.removeConsumerDispatcherMatchTarget",
"1:1312:1.117.1.11",
this);
SibTr.exception(tc, e);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "removeConsumerDispatcherMatchTarget", "SICoreException");
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
"1:1323:1.117.1.11",
e });
throw new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
"1:1331:1.117.1.11",
e },
null),
e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "removeConsumerDispatcherMatchTarget");
} | java | public void removeConsumerDispatcherMatchTarget(ConsumerDispatcher consumerDispatcher, SelectionCriteria selectionCriteria)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"removeConsumerDispatcherMatchTarget",
new Object[] {consumerDispatcher, selectionCriteria});
// Remove the consumer point from the matchspace
// Set the CD and selection criteria into a wrapper that extends MatchTarget
MatchingConsumerDispatcherWithCriteira key = new MatchingConsumerDispatcherWithCriteira (consumerDispatcher,selectionCriteria);
// Reset the CD flag to indicate that this subscription is not in the MatchSpace.
consumerDispatcher.setIsInMatchSpace(false);
try
{
removeTarget(key);
}
catch (MatchingException e)
{
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching.removeConsumerDispatcherMatchTarget",
"1:1312:1.117.1.11",
this);
SibTr.exception(tc, e);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "removeConsumerDispatcherMatchTarget", "SICoreException");
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
"1:1323:1.117.1.11",
e });
throw new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
"1:1331:1.117.1.11",
e },
null),
e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "removeConsumerDispatcherMatchTarget");
} | [
"public",
"void",
"removeConsumerDispatcherMatchTarget",
"(",
"ConsumerDispatcher",
"consumerDispatcher",
",",
"SelectionCriteria",
"selectionCriteria",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"removeConsumerDispatcherMatchTarget\"",
",",
"new",
"Object",
"[",
"]",
"{",
"consumerDispatcher",
",",
"selectionCriteria",
"}",
")",
";",
"// Remove the consumer point from the matchspace",
"// Set the CD and selection criteria into a wrapper that extends MatchTarget",
"MatchingConsumerDispatcherWithCriteira",
"key",
"=",
"new",
"MatchingConsumerDispatcherWithCriteira",
"(",
"consumerDispatcher",
",",
"selectionCriteria",
")",
";",
"// Reset the CD flag to indicate that this subscription is not in the MatchSpace.",
"consumerDispatcher",
".",
"setIsInMatchSpace",
"(",
"false",
")",
";",
"try",
"{",
"removeTarget",
"(",
"key",
")",
";",
"}",
"catch",
"(",
"MatchingException",
"e",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.matching.MessageProcessorMatching.removeConsumerDispatcherMatchTarget\"",
",",
"\"1:1312:1.117.1.11\"",
",",
"this",
")",
";",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"removeConsumerDispatcherMatchTarget\"",
",",
"\"SICoreException\"",
")",
";",
"SibTr",
".",
"error",
"(",
"tc",
",",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.matching.MessageProcessorMatching\"",
",",
"\"1:1323:1.117.1.11\"",
",",
"e",
"}",
")",
";",
"throw",
"new",
"SIErrorException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.matching.MessageProcessorMatching\"",
",",
"\"1:1331:1.117.1.11\"",
",",
"e",
"}",
",",
"null",
")",
",",
"e",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"removeConsumerDispatcherMatchTarget\"",
")",
";",
"}"
] | Method removeConsumerDispatcherMatchTarget
Used to remove a ConsumerDispatcher from the MatchSpace.
@param consumerDispatcher The consumer dispatcher to remove | [
"Method",
"removeConsumerDispatcherMatchTarget",
"Used",
"to",
"remove",
"a",
"ConsumerDispatcher",
"from",
"the",
"MatchSpace",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/MessageProcessorMatching.java#L1247-L1299 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/MessageProcessorMatching.java | MessageProcessorMatching.removePubSubOutputHandlerMatchTarget | public void removePubSubOutputHandlerMatchTarget(
ControllableProxySubscription sub)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "removePubSubOutputHandlerMatchTarget", sub);
// Remove the PubSub OutputHandler from the matchspace
try
{
removeTarget(sub);
}
catch (MatchingException e)
{
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching.removePubSubOutputHandlerMatchTarget",
"1:1363:1.117.1.11",
this);
SibTr.exception(tc, e);
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
"1:1370:1.117.1.11",
e });
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "removePubSubOutputHandlerMatchTarget", "SICoreException");
throw new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
"1:1381:1.117.1.11",
e },
null),
e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "removePubSubOutputHandlerMatchTarget");
} | java | public void removePubSubOutputHandlerMatchTarget(
ControllableProxySubscription sub)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "removePubSubOutputHandlerMatchTarget", sub);
// Remove the PubSub OutputHandler from the matchspace
try
{
removeTarget(sub);
}
catch (MatchingException e)
{
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching.removePubSubOutputHandlerMatchTarget",
"1:1363:1.117.1.11",
this);
SibTr.exception(tc, e);
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
"1:1370:1.117.1.11",
e });
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "removePubSubOutputHandlerMatchTarget", "SICoreException");
throw new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
"1:1381:1.117.1.11",
e },
null),
e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "removePubSubOutputHandlerMatchTarget");
} | [
"public",
"void",
"removePubSubOutputHandlerMatchTarget",
"(",
"ControllableProxySubscription",
"sub",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"removePubSubOutputHandlerMatchTarget\"",
",",
"sub",
")",
";",
"// Remove the PubSub OutputHandler from the matchspace",
"try",
"{",
"removeTarget",
"(",
"sub",
")",
";",
"}",
"catch",
"(",
"MatchingException",
"e",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.matching.MessageProcessorMatching.removePubSubOutputHandlerMatchTarget\"",
",",
"\"1:1363:1.117.1.11\"",
",",
"this",
")",
";",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"SibTr",
".",
"error",
"(",
"tc",
",",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.matching.MessageProcessorMatching\"",
",",
"\"1:1370:1.117.1.11\"",
",",
"e",
"}",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"removePubSubOutputHandlerMatchTarget\"",
",",
"\"SICoreException\"",
")",
";",
"throw",
"new",
"SIErrorException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.matching.MessageProcessorMatching\"",
",",
"\"1:1381:1.117.1.11\"",
",",
"e",
"}",
",",
"null",
")",
",",
"e",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"removePubSubOutputHandlerMatchTarget\"",
")",
";",
"}"
] | Method removePubSubOutputHandlerMatchTarget
Used to remove a PubSubOutputHandler from the MatchSpace.
@param sub the subscription to remove | [
"Method",
"removePubSubOutputHandlerMatchTarget",
"Used",
"to",
"remove",
"a",
"PubSubOutputHandler",
"from",
"the",
"MatchSpace",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/MessageProcessorMatching.java#L1307-L1349 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/MessageProcessorMatching.java | MessageProcessorMatching.buildSendTopicExpression | private String buildSendTopicExpression(
String destName,
String discriminator)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"buildSendTopicExpression",
new Object[] { destName, discriminator });
String combo = null;
if (discriminator == null || discriminator.trim().length() == 0)
combo = destName;
else
combo =
destName
+ MatchSpace.SUBTOPIC_SEPARATOR_CHAR
+ discriminator;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "buildSendTopicExpression", combo);
return combo;
} | java | private String buildSendTopicExpression(
String destName,
String discriminator)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"buildSendTopicExpression",
new Object[] { destName, discriminator });
String combo = null;
if (discriminator == null || discriminator.trim().length() == 0)
combo = destName;
else
combo =
destName
+ MatchSpace.SUBTOPIC_SEPARATOR_CHAR
+ discriminator;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "buildSendTopicExpression", combo);
return combo;
} | [
"private",
"String",
"buildSendTopicExpression",
"(",
"String",
"destName",
",",
"String",
"discriminator",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"buildSendTopicExpression\"",
",",
"new",
"Object",
"[",
"]",
"{",
"destName",
",",
"discriminator",
"}",
")",
";",
"String",
"combo",
"=",
"null",
";",
"if",
"(",
"discriminator",
"==",
"null",
"||",
"discriminator",
".",
"trim",
"(",
")",
".",
"length",
"(",
")",
"==",
"0",
")",
"combo",
"=",
"destName",
";",
"else",
"combo",
"=",
"destName",
"+",
"MatchSpace",
".",
"SUBTOPIC_SEPARATOR_CHAR",
"+",
"discriminator",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"buildSendTopicExpression\"",
",",
"combo",
")",
";",
"return",
"combo",
";",
"}"
] | Concatenates topicspace and a topic expression with a level separator between
Null or empty topics are treated as topics at the root level so the
combination topic becomes topicSpace/
@param topicSpace The topicspace name
@param discriminator The topic | [
"Concatenates",
"topicspace",
"and",
"a",
"topic",
"expression",
"with",
"a",
"level",
"separator",
"between"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/MessageProcessorMatching.java#L1360-L1384 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/MessageProcessorMatching.java | MessageProcessorMatching.buildAddTopicExpression | public String buildAddTopicExpression(
String destName,
String discriminator) throws SIDiscriminatorSyntaxException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"buildAddTopicExpression",
new Object[] { destName, discriminator });
String combo = null;
if (discriminator == null)
combo =
destName
+ MatchSpace.SUBTOPIC_DOUBLE_SEPARATOR_STOP_STRING;
else if (discriminator.trim().length() == 0)
combo =
destName;
else if (discriminator.startsWith(MatchSpace.SUBTOPIC_DOUBLE_SEPARATOR_STRING))
combo =
destName
+ discriminator;
else if (discriminator.startsWith(""+MatchSpace.SUBTOPIC_SEPARATOR_CHAR))
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "buildAddTopicExpression", "SISelectorSyntaxException");
throw new SIDiscriminatorSyntaxException(
nls.getFormattedMessage(
"INVALID_TOPIC_ERROR_CWSIP0372",
new Object[] { discriminator },
null));
}
else
combo =
destName
+ MatchSpace.SUBTOPIC_SEPARATOR_CHAR
+ discriminator;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "buildAddTopicExpression", combo);
return combo;
} | java | public String buildAddTopicExpression(
String destName,
String discriminator) throws SIDiscriminatorSyntaxException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"buildAddTopicExpression",
new Object[] { destName, discriminator });
String combo = null;
if (discriminator == null)
combo =
destName
+ MatchSpace.SUBTOPIC_DOUBLE_SEPARATOR_STOP_STRING;
else if (discriminator.trim().length() == 0)
combo =
destName;
else if (discriminator.startsWith(MatchSpace.SUBTOPIC_DOUBLE_SEPARATOR_STRING))
combo =
destName
+ discriminator;
else if (discriminator.startsWith(""+MatchSpace.SUBTOPIC_SEPARATOR_CHAR))
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "buildAddTopicExpression", "SISelectorSyntaxException");
throw new SIDiscriminatorSyntaxException(
nls.getFormattedMessage(
"INVALID_TOPIC_ERROR_CWSIP0372",
new Object[] { discriminator },
null));
}
else
combo =
destName
+ MatchSpace.SUBTOPIC_SEPARATOR_CHAR
+ discriminator;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "buildAddTopicExpression", combo);
return combo;
} | [
"public",
"String",
"buildAddTopicExpression",
"(",
"String",
"destName",
",",
"String",
"discriminator",
")",
"throws",
"SIDiscriminatorSyntaxException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"buildAddTopicExpression\"",
",",
"new",
"Object",
"[",
"]",
"{",
"destName",
",",
"discriminator",
"}",
")",
";",
"String",
"combo",
"=",
"null",
";",
"if",
"(",
"discriminator",
"==",
"null",
")",
"combo",
"=",
"destName",
"+",
"MatchSpace",
".",
"SUBTOPIC_DOUBLE_SEPARATOR_STOP_STRING",
";",
"else",
"if",
"(",
"discriminator",
".",
"trim",
"(",
")",
".",
"length",
"(",
")",
"==",
"0",
")",
"combo",
"=",
"destName",
";",
"else",
"if",
"(",
"discriminator",
".",
"startsWith",
"(",
"MatchSpace",
".",
"SUBTOPIC_DOUBLE_SEPARATOR_STRING",
")",
")",
"combo",
"=",
"destName",
"+",
"discriminator",
";",
"else",
"if",
"(",
"discriminator",
".",
"startsWith",
"(",
"\"\"",
"+",
"MatchSpace",
".",
"SUBTOPIC_SEPARATOR_CHAR",
")",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"buildAddTopicExpression\"",
",",
"\"SISelectorSyntaxException\"",
")",
";",
"throw",
"new",
"SIDiscriminatorSyntaxException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"INVALID_TOPIC_ERROR_CWSIP0372\"",
",",
"new",
"Object",
"[",
"]",
"{",
"discriminator",
"}",
",",
"null",
")",
")",
";",
"}",
"else",
"combo",
"=",
"destName",
"+",
"MatchSpace",
".",
"SUBTOPIC_SEPARATOR_CHAR",
"+",
"discriminator",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"buildAddTopicExpression\"",
",",
"combo",
")",
";",
"return",
"combo",
";",
"}"
] | Concatenates topicspace and a topic expression with a level separator between.
Null topics are treated as wildcarded topics at the root level so the
combination topic becomes topicSpace//.
Empty topics are treated as a subscription to the root level so becomes
topicSpace/
Topics that begin // need to be treated as topicSpace//
Topics that begin / are rejected
@param topicSpace The topicspace name
@param discriminator The topic
@exception SIDiscriminatorSyntaxException If the topic starts with a leading / | [
"Concatenates",
"topicspace",
"and",
"a",
"topic",
"expression",
"with",
"a",
"level",
"separator",
"between",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/MessageProcessorMatching.java#L1401-L1445 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/MessageProcessorMatching.java | MessageProcessorMatching.getAllCDMatchTargets | public ArrayList getAllCDMatchTargets()
{
ArrayList consumerDispatcherList;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getAllCDMatchTargets");
// Get from the HashMap, with synch, there may be other accessors
synchronized(_targets)
{
consumerDispatcherList = new ArrayList(_targets.size());
Iterator itr = _targets.keySet().iterator();
while (itr.hasNext())
{
Object key = itr.next();
if (key instanceof MatchingConsumerDispatcherWithCriteira)
{
consumerDispatcherList.add(((MatchingConsumerDispatcherWithCriteira)key).getConsumerDispatcher());
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "getAllCDMatchTargets");
return consumerDispatcherList;
} | java | public ArrayList getAllCDMatchTargets()
{
ArrayList consumerDispatcherList;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getAllCDMatchTargets");
// Get from the HashMap, with synch, there may be other accessors
synchronized(_targets)
{
consumerDispatcherList = new ArrayList(_targets.size());
Iterator itr = _targets.keySet().iterator();
while (itr.hasNext())
{
Object key = itr.next();
if (key instanceof MatchingConsumerDispatcherWithCriteira)
{
consumerDispatcherList.add(((MatchingConsumerDispatcherWithCriteira)key).getConsumerDispatcher());
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "getAllCDMatchTargets");
return consumerDispatcherList;
} | [
"public",
"ArrayList",
"getAllCDMatchTargets",
"(",
")",
"{",
"ArrayList",
"consumerDispatcherList",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"getAllCDMatchTargets\"",
")",
";",
"// Get from the HashMap, with synch, there may be other accessors",
"synchronized",
"(",
"_targets",
")",
"{",
"consumerDispatcherList",
"=",
"new",
"ArrayList",
"(",
"_targets",
".",
"size",
"(",
")",
")",
";",
"Iterator",
"itr",
"=",
"_targets",
".",
"keySet",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"itr",
".",
"hasNext",
"(",
")",
")",
"{",
"Object",
"key",
"=",
"itr",
".",
"next",
"(",
")",
";",
"if",
"(",
"key",
"instanceof",
"MatchingConsumerDispatcherWithCriteira",
")",
"{",
"consumerDispatcherList",
".",
"add",
"(",
"(",
"(",
"MatchingConsumerDispatcherWithCriteira",
")",
"key",
")",
".",
"getConsumerDispatcher",
"(",
")",
")",
";",
"}",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"getAllCDMatchTargets\"",
")",
";",
"return",
"consumerDispatcherList",
";",
"}"
] | Method getAllCDMatchTargets
Used to return a list of all ConsumerDispatchers stored in the matchspace
@return List of matching consumers | [
"Method",
"getAllCDMatchTargets",
"Used",
"to",
"return",
"a",
"list",
"of",
"all",
"ConsumerDispatchers",
"stored",
"in",
"the",
"matchspace"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/MessageProcessorMatching.java#L1453-L1480 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/MessageProcessorMatching.java | MessageProcessorMatching.getAllCDMatchTargetsForTopicSpace | public ArrayList getAllCDMatchTargetsForTopicSpace(String tSpace)
{
ArrayList consumerDispatcherList;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getAllCDMatchTargetsForTopicSpace");
// Get from the HashMap, with synch, there may be other accessors
synchronized(_targets)
{
consumerDispatcherList = new ArrayList(_targets.size());
Iterator itr = _targets.keySet().iterator();
while (itr.hasNext())
{
Object key = itr.next();
if (key instanceof MatchingConsumerDispatcherWithCriteira)
{
ConsumerDispatcher cd =(((MatchingConsumerDispatcherWithCriteira)key).getConsumerDispatcher());
String storedDest = cd.getDestination().getName();
if (storedDest.equals(tSpace))
{
consumerDispatcherList.add(cd);
}
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "getAllCDMatchTargetsForTopicSpace");
return consumerDispatcherList;
} | java | public ArrayList getAllCDMatchTargetsForTopicSpace(String tSpace)
{
ArrayList consumerDispatcherList;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getAllCDMatchTargetsForTopicSpace");
// Get from the HashMap, with synch, there may be other accessors
synchronized(_targets)
{
consumerDispatcherList = new ArrayList(_targets.size());
Iterator itr = _targets.keySet().iterator();
while (itr.hasNext())
{
Object key = itr.next();
if (key instanceof MatchingConsumerDispatcherWithCriteira)
{
ConsumerDispatcher cd =(((MatchingConsumerDispatcherWithCriteira)key).getConsumerDispatcher());
String storedDest = cd.getDestination().getName();
if (storedDest.equals(tSpace))
{
consumerDispatcherList.add(cd);
}
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "getAllCDMatchTargetsForTopicSpace");
return consumerDispatcherList;
} | [
"public",
"ArrayList",
"getAllCDMatchTargetsForTopicSpace",
"(",
"String",
"tSpace",
")",
"{",
"ArrayList",
"consumerDispatcherList",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"getAllCDMatchTargetsForTopicSpace\"",
")",
";",
"// Get from the HashMap, with synch, there may be other accessors",
"synchronized",
"(",
"_targets",
")",
"{",
"consumerDispatcherList",
"=",
"new",
"ArrayList",
"(",
"_targets",
".",
"size",
"(",
")",
")",
";",
"Iterator",
"itr",
"=",
"_targets",
".",
"keySet",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"itr",
".",
"hasNext",
"(",
")",
")",
"{",
"Object",
"key",
"=",
"itr",
".",
"next",
"(",
")",
";",
"if",
"(",
"key",
"instanceof",
"MatchingConsumerDispatcherWithCriteira",
")",
"{",
"ConsumerDispatcher",
"cd",
"=",
"(",
"(",
"(",
"MatchingConsumerDispatcherWithCriteira",
")",
"key",
")",
".",
"getConsumerDispatcher",
"(",
")",
")",
";",
"String",
"storedDest",
"=",
"cd",
".",
"getDestination",
"(",
")",
".",
"getName",
"(",
")",
";",
"if",
"(",
"storedDest",
".",
"equals",
"(",
"tSpace",
")",
")",
"{",
"consumerDispatcherList",
".",
"add",
"(",
"cd",
")",
";",
"}",
"}",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"getAllCDMatchTargetsForTopicSpace\"",
")",
";",
"return",
"consumerDispatcherList",
";",
"}"
] | Method getAllCDMatchTargetsForTopicSpace
Used to return a list of all ConsumerDispatchers stored in the matchspace
for a specific topicspace.
@return List of matching consumers | [
"Method",
"getAllCDMatchTargetsForTopicSpace",
"Used",
"to",
"return",
"a",
"list",
"of",
"all",
"ConsumerDispatchers",
"stored",
"in",
"the",
"matchspace",
"for",
"a",
"specific",
"topicspace",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/MessageProcessorMatching.java#L1489-L1521 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/MessageProcessorMatching.java | MessageProcessorMatching.getAllPubSubOutputHandlerMatchTargets | public ArrayList getAllPubSubOutputHandlerMatchTargets()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getAllPubSubOutputHandlerMatchTargets");
ArrayList outputHandlerList;
// Get from the HashMap, with synch, there may be other accessors
synchronized(_targets)
{
outputHandlerList = new ArrayList(_targets.size());
Iterator itr = _targets.keySet().iterator();
while (itr.hasNext())
{
Object key = itr.next();
if (key instanceof ControllableProxySubscription)
outputHandlerList.add(
((ControllableProxySubscription) key).getOutputHandler());
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(
tc,
"getAllPubSubOutputHandlerMatchTargets",
outputHandlerList);
return outputHandlerList;
} | java | public ArrayList getAllPubSubOutputHandlerMatchTargets()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getAllPubSubOutputHandlerMatchTargets");
ArrayList outputHandlerList;
// Get from the HashMap, with synch, there may be other accessors
synchronized(_targets)
{
outputHandlerList = new ArrayList(_targets.size());
Iterator itr = _targets.keySet().iterator();
while (itr.hasNext())
{
Object key = itr.next();
if (key instanceof ControllableProxySubscription)
outputHandlerList.add(
((ControllableProxySubscription) key).getOutputHandler());
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(
tc,
"getAllPubSubOutputHandlerMatchTargets",
outputHandlerList);
return outputHandlerList;
} | [
"public",
"ArrayList",
"getAllPubSubOutputHandlerMatchTargets",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"getAllPubSubOutputHandlerMatchTargets\"",
")",
";",
"ArrayList",
"outputHandlerList",
";",
"// Get from the HashMap, with synch, there may be other accessors",
"synchronized",
"(",
"_targets",
")",
"{",
"outputHandlerList",
"=",
"new",
"ArrayList",
"(",
"_targets",
".",
"size",
"(",
")",
")",
";",
"Iterator",
"itr",
"=",
"_targets",
".",
"keySet",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"itr",
".",
"hasNext",
"(",
")",
")",
"{",
"Object",
"key",
"=",
"itr",
".",
"next",
"(",
")",
";",
"if",
"(",
"key",
"instanceof",
"ControllableProxySubscription",
")",
"outputHandlerList",
".",
"add",
"(",
"(",
"(",
"ControllableProxySubscription",
")",
"key",
")",
".",
"getOutputHandler",
"(",
")",
")",
";",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"getAllPubSubOutputHandlerMatchTargets\"",
",",
"outputHandlerList",
")",
";",
"return",
"outputHandlerList",
";",
"}"
] | Method getAllPubSubOutputHandlerMatchTargets
Used to return a list of all PubSubOutputHandlers stored in the matchspace
@return List of matching outputhandlers | [
"Method",
"getAllPubSubOutputHandlerMatchTargets",
"Used",
"to",
"return",
"a",
"list",
"of",
"all",
"PubSubOutputHandlers",
"stored",
"in",
"the",
"matchspace"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/MessageProcessorMatching.java#L1529-L1560 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/MessageProcessorMatching.java | MessageProcessorMatching.addTopicAcl | public void addTopicAcl(SIBUuid12 destName, TopicAcl acl)
throws
SIDiscriminatorSyntaxException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "addTopicAcl", new Object[] { destName, acl });
String discriminator = null;
// Postpend # wildcard to the fully qualified topic supplied
// TO DO check the topicsyntax
String theTopic = "";
if(destName != null)
{
String destNameStr = destName.toString();
theTopic = buildAddTopicExpression(destNameStr, acl.getTopic());
}
// Careful, only do this if the original topic is not null
if(acl.getTopic() != null)
{
discriminator = theTopic + "//.";
}
else
{
discriminator = theTopic;
}
// Put the acl into the matchspace
try
{
addTarget(acl, // N.B we use the raw CP as key
discriminator, // wildcarded topic expression
null, // selector string
null, // selector domain
null, // this'll pick up the default resolver
acl,
null,
null); // selector properties
}
catch (QuerySyntaxException e)
{
// No FFDC code needed
}
catch (InvalidTopicSyntaxException e)
{
// No FFDC code needed
SibTr.exception(tc, e);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "addTopicAcl", "SIDiscriminatorSyntaxException");
throw new SIDiscriminatorSyntaxException(
nls.getFormattedMessage(
"INVALID_TOPIC_ERROR_CWSIP0372",
new Object[] { theTopic },
null));
}
catch (MatchingException e)
{
// FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching.addTopicAcl",
"1:1954:1.117.1.11",
this);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "addTopicAcl", "SIErrorException");
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
"1:1962:1.117.1.11",
e });
throw new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
"1:1970:1.117.1.11",
e },
null),
e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "addTopicAcl");
} | java | public void addTopicAcl(SIBUuid12 destName, TopicAcl acl)
throws
SIDiscriminatorSyntaxException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "addTopicAcl", new Object[] { destName, acl });
String discriminator = null;
// Postpend # wildcard to the fully qualified topic supplied
// TO DO check the topicsyntax
String theTopic = "";
if(destName != null)
{
String destNameStr = destName.toString();
theTopic = buildAddTopicExpression(destNameStr, acl.getTopic());
}
// Careful, only do this if the original topic is not null
if(acl.getTopic() != null)
{
discriminator = theTopic + "//.";
}
else
{
discriminator = theTopic;
}
// Put the acl into the matchspace
try
{
addTarget(acl, // N.B we use the raw CP as key
discriminator, // wildcarded topic expression
null, // selector string
null, // selector domain
null, // this'll pick up the default resolver
acl,
null,
null); // selector properties
}
catch (QuerySyntaxException e)
{
// No FFDC code needed
}
catch (InvalidTopicSyntaxException e)
{
// No FFDC code needed
SibTr.exception(tc, e);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "addTopicAcl", "SIDiscriminatorSyntaxException");
throw new SIDiscriminatorSyntaxException(
nls.getFormattedMessage(
"INVALID_TOPIC_ERROR_CWSIP0372",
new Object[] { theTopic },
null));
}
catch (MatchingException e)
{
// FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching.addTopicAcl",
"1:1954:1.117.1.11",
this);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "addTopicAcl", "SIErrorException");
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
"1:1962:1.117.1.11",
e });
throw new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
"1:1970:1.117.1.11",
e },
null),
e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "addTopicAcl");
} | [
"public",
"void",
"addTopicAcl",
"(",
"SIBUuid12",
"destName",
",",
"TopicAcl",
"acl",
")",
"throws",
"SIDiscriminatorSyntaxException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"addTopicAcl\"",
",",
"new",
"Object",
"[",
"]",
"{",
"destName",
",",
"acl",
"}",
")",
";",
"String",
"discriminator",
"=",
"null",
";",
"// Postpend # wildcard to the fully qualified topic supplied",
"// TO DO check the topicsyntax",
"String",
"theTopic",
"=",
"\"\"",
";",
"if",
"(",
"destName",
"!=",
"null",
")",
"{",
"String",
"destNameStr",
"=",
"destName",
".",
"toString",
"(",
")",
";",
"theTopic",
"=",
"buildAddTopicExpression",
"(",
"destNameStr",
",",
"acl",
".",
"getTopic",
"(",
")",
")",
";",
"}",
"// Careful, only do this if the original topic is not null",
"if",
"(",
"acl",
".",
"getTopic",
"(",
")",
"!=",
"null",
")",
"{",
"discriminator",
"=",
"theTopic",
"+",
"\"//.\"",
";",
"}",
"else",
"{",
"discriminator",
"=",
"theTopic",
";",
"}",
"// Put the acl into the matchspace",
"try",
"{",
"addTarget",
"(",
"acl",
",",
"// N.B we use the raw CP as key",
"discriminator",
",",
"// wildcarded topic expression",
"null",
",",
"// selector string",
"null",
",",
"// selector domain",
"null",
",",
"// this'll pick up the default resolver",
"acl",
",",
"null",
",",
"null",
")",
";",
"// selector properties",
"}",
"catch",
"(",
"QuerySyntaxException",
"e",
")",
"{",
"// No FFDC code needed",
"}",
"catch",
"(",
"InvalidTopicSyntaxException",
"e",
")",
"{",
"// No FFDC code needed",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"addTopicAcl\"",
",",
"\"SIDiscriminatorSyntaxException\"",
")",
";",
"throw",
"new",
"SIDiscriminatorSyntaxException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"INVALID_TOPIC_ERROR_CWSIP0372\"",
",",
"new",
"Object",
"[",
"]",
"{",
"theTopic",
"}",
",",
"null",
")",
")",
";",
"}",
"catch",
"(",
"MatchingException",
"e",
")",
"{",
"// FFDC",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.matching.MessageProcessorMatching.addTopicAcl\"",
",",
"\"1:1954:1.117.1.11\"",
",",
"this",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"addTopicAcl\"",
",",
"\"SIErrorException\"",
")",
";",
"SibTr",
".",
"error",
"(",
"tc",
",",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.matching.MessageProcessorMatching\"",
",",
"\"1:1962:1.117.1.11\"",
",",
"e",
"}",
")",
";",
"throw",
"new",
"SIErrorException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.matching.MessageProcessorMatching\"",
",",
"\"1:1970:1.117.1.11\"",
",",
"e",
"}",
",",
"null",
")",
",",
"e",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"addTopicAcl\"",
")",
";",
"}"
] | Method addTopicAcl
Used to add a TopicAcl to the MatchSpace.
@param acl The TopicAcl | [
"Method",
"addTopicAcl",
"Used",
"to",
"add",
"a",
"TopicAcl",
"to",
"the",
"MatchSpace",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/MessageProcessorMatching.java#L1850-L1938 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/MessageProcessorMatching.java | MessageProcessorMatching.removeAllTopicAcls | public void removeAllTopicAcls()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "removeAllTopicAcls");
ArrayList topicAclList = null;
try
{
// Remove from the HashMap, with synch, there may be other accessors
synchronized(_targets)
{
// Build a list of the existing ACLs
topicAclList = new ArrayList(_targets.size());
Iterator itr = _targets.keySet().iterator();
while (itr.hasNext())
{
Object key = itr.next();
if (key instanceof TopicAcl)
{
topicAclList.add(key);
}
}
// Now remove the ACLs from the targets Map
Iterator aclIter = topicAclList.iterator();
while (aclIter.hasNext())
{
Object key = aclIter.next();
removeTarget(key);
}
}
}
catch (MatchingException e)
{
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching.removeAllTopicAcls",
"1:2188:1.117.1.11",
this);
SibTr.exception(tc, e);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "removeAllTopicAcls", "SICoreException");
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
"1:2199:1.117.1.11",
e });
throw new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
"1:2207:1.117.1.11",
e },
null),
e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "removeAllTopicAcls");
} | java | public void removeAllTopicAcls()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "removeAllTopicAcls");
ArrayList topicAclList = null;
try
{
// Remove from the HashMap, with synch, there may be other accessors
synchronized(_targets)
{
// Build a list of the existing ACLs
topicAclList = new ArrayList(_targets.size());
Iterator itr = _targets.keySet().iterator();
while (itr.hasNext())
{
Object key = itr.next();
if (key instanceof TopicAcl)
{
topicAclList.add(key);
}
}
// Now remove the ACLs from the targets Map
Iterator aclIter = topicAclList.iterator();
while (aclIter.hasNext())
{
Object key = aclIter.next();
removeTarget(key);
}
}
}
catch (MatchingException e)
{
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching.removeAllTopicAcls",
"1:2188:1.117.1.11",
this);
SibTr.exception(tc, e);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "removeAllTopicAcls", "SICoreException");
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
"1:2199:1.117.1.11",
e });
throw new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
"1:2207:1.117.1.11",
e },
null),
e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "removeAllTopicAcls");
} | [
"public",
"void",
"removeAllTopicAcls",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"removeAllTopicAcls\"",
")",
";",
"ArrayList",
"topicAclList",
"=",
"null",
";",
"try",
"{",
"// Remove from the HashMap, with synch, there may be other accessors",
"synchronized",
"(",
"_targets",
")",
"{",
"// Build a list of the existing ACLs",
"topicAclList",
"=",
"new",
"ArrayList",
"(",
"_targets",
".",
"size",
"(",
")",
")",
";",
"Iterator",
"itr",
"=",
"_targets",
".",
"keySet",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"itr",
".",
"hasNext",
"(",
")",
")",
"{",
"Object",
"key",
"=",
"itr",
".",
"next",
"(",
")",
";",
"if",
"(",
"key",
"instanceof",
"TopicAcl",
")",
"{",
"topicAclList",
".",
"add",
"(",
"key",
")",
";",
"}",
"}",
"// Now remove the ACLs from the targets Map",
"Iterator",
"aclIter",
"=",
"topicAclList",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"aclIter",
".",
"hasNext",
"(",
")",
")",
"{",
"Object",
"key",
"=",
"aclIter",
".",
"next",
"(",
")",
";",
"removeTarget",
"(",
"key",
")",
";",
"}",
"}",
"}",
"catch",
"(",
"MatchingException",
"e",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.matching.MessageProcessorMatching.removeAllTopicAcls\"",
",",
"\"1:2188:1.117.1.11\"",
",",
"this",
")",
";",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"removeAllTopicAcls\"",
",",
"\"SICoreException\"",
")",
";",
"SibTr",
".",
"error",
"(",
"tc",
",",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.matching.MessageProcessorMatching\"",
",",
"\"1:2199:1.117.1.11\"",
",",
"e",
"}",
")",
";",
"throw",
"new",
"SIErrorException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.matching.MessageProcessorMatching\"",
",",
"\"1:2207:1.117.1.11\"",
",",
"e",
"}",
",",
"null",
")",
",",
"e",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"removeAllTopicAcls\"",
")",
";",
"}"
] | Method removeAllTopicAcls
Used to remove all TopicAcls stored in the matchspace | [
"Method",
"removeAllTopicAcls",
"Used",
"to",
"remove",
"all",
"TopicAcls",
"stored",
"in",
"the",
"matchspace"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/MessageProcessorMatching.java#L2107-L2175 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/MessageProcessorMatching.java | MessageProcessorMatching.removeApplicationSignatureMatchTarget | public void removeApplicationSignatureMatchTarget(ApplicationSignature appSignature)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "removeApplicationSignatureMatchTarget", appSignature);
// Remove the consumer point from the matchspace
try
{
removeTarget(appSignature);
}
catch (MatchingException e)
{
// FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching.removeApplicationSignatureMatchTarget",
"1:3045:1.117.1.11",
this);
SibTr.exception(tc, e);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "removeApplicationSignatureMatchTarget", "SICoreException");
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
"1:3056:1.117.1.11",
e });
throw new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
"1:3064:1.117.1.11",
e },
null),
e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "removeApplicationSignatureMatchTarget");
} | java | public void removeApplicationSignatureMatchTarget(ApplicationSignature appSignature)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "removeApplicationSignatureMatchTarget", appSignature);
// Remove the consumer point from the matchspace
try
{
removeTarget(appSignature);
}
catch (MatchingException e)
{
// FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching.removeApplicationSignatureMatchTarget",
"1:3045:1.117.1.11",
this);
SibTr.exception(tc, e);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "removeApplicationSignatureMatchTarget", "SICoreException");
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
"1:3056:1.117.1.11",
e });
throw new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.matching.MessageProcessorMatching",
"1:3064:1.117.1.11",
e },
null),
e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "removeApplicationSignatureMatchTarget");
} | [
"public",
"void",
"removeApplicationSignatureMatchTarget",
"(",
"ApplicationSignature",
"appSignature",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"removeApplicationSignatureMatchTarget\"",
",",
"appSignature",
")",
";",
"// Remove the consumer point from the matchspace",
"try",
"{",
"removeTarget",
"(",
"appSignature",
")",
";",
"}",
"catch",
"(",
"MatchingException",
"e",
")",
"{",
"// FFDC",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.matching.MessageProcessorMatching.removeApplicationSignatureMatchTarget\"",
",",
"\"1:3045:1.117.1.11\"",
",",
"this",
")",
";",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"removeApplicationSignatureMatchTarget\"",
",",
"\"SICoreException\"",
")",
";",
"SibTr",
".",
"error",
"(",
"tc",
",",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.matching.MessageProcessorMatching\"",
",",
"\"1:3056:1.117.1.11\"",
",",
"e",
"}",
")",
";",
"throw",
"new",
"SIErrorException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.matching.MessageProcessorMatching\"",
",",
"\"1:3064:1.117.1.11\"",
",",
"e",
"}",
",",
"null",
")",
",",
"e",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"removeApplicationSignatureMatchTarget\"",
")",
";",
"}"
] | Method removeApplicationSignatureMatchTarget
Used to remove a ApplicationSignature from the MatchSpace.
@param consumerPointData The ApplicationSignature to remove | [
"Method",
"removeApplicationSignatureMatchTarget",
"Used",
"to",
"remove",
"a",
"ApplicationSignature",
"from",
"the",
"MatchSpace",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/MessageProcessorMatching.java#L2989-L3032 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.microprofile.faulttolerance.cdi/src/com/ibm/ws/microprofile/faulttolerance/cdi/FaultToleranceCDIComponent.java | FaultToleranceCDIComponent.setProvider | @Reference(policy = DYNAMIC, policyOption = GREEDY, cardinality = MANDATORY)
protected void setProvider(MetricRecorderProvider provider) {
metricProvider = provider;
} | java | @Reference(policy = DYNAMIC, policyOption = GREEDY, cardinality = MANDATORY)
protected void setProvider(MetricRecorderProvider provider) {
metricProvider = provider;
} | [
"@",
"Reference",
"(",
"policy",
"=",
"DYNAMIC",
",",
"policyOption",
"=",
"GREEDY",
",",
"cardinality",
"=",
"MANDATORY",
")",
"protected",
"void",
"setProvider",
"(",
"MetricRecorderProvider",
"provider",
")",
"{",
"metricProvider",
"=",
"provider",
";",
"}"
] | Require a provider, update dynamically if a new one becomes available | [
"Require",
"a",
"provider",
"update",
"dynamically",
"if",
"a",
"new",
"one",
"becomes",
"available"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.faulttolerance.cdi/src/com/ibm/ws/microprofile/faulttolerance/cdi/FaultToleranceCDIComponent.java#L43-L46 | train |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java | TransactionImpl.recover | synchronized public void recover() {
if (tc.isEntryEnabled())
Tr.entry(tc, "recover", this);
final int state = _status.getState();
if (_subordinate) {
// For a subordinate, first check whether the global outcome is known locally.
switch (state) {
// Due to the possibility of recovery being attempted asynchronously to
// an incoming superior request, we must cover the case where the
// transaction has now actually committed already.
case TransactionState.STATE_HEURISTIC_ON_COMMIT:
case TransactionState.STATE_COMMITTED:
case TransactionState.STATE_COMMITTING:
recoverCommit(true);
break;
// Due to the possibility of recovery being attempted asynchronously to
// an incoming superior request, we must cover the case where the
// transaction has now actually rolled back already.
case TransactionState.STATE_HEURISTIC_ON_ROLLBACK:
case TransactionState.STATE_ROLLED_BACK:
case TransactionState.STATE_ROLLING_BACK:
recoverRollback(true);
break;
// For a subordinate, the replay_completion method is invoked on the superior.
// If the number of times the replay_completion has been retried is greater
// than the value specified by COMMITRETRY, then HEURISTICDIRECTION is used
// to determine the transaction outcome.
default:
// If we were imported from a JCA provider, check whether it's still installed.
// If so, we need do nothing here since we expect the RA to complete the transaction.
// Otherwise, we will complete using the configured direction.
if (_JCARecoveryData != null) {
final String id = _JCARecoveryData.getWrapper().getProviderId();
if (TMHelper.isProviderInstalled(id)) {
if (tc.isDebugEnabled())
Tr.debug(tc, "recover", "Do nothing. Expect provider " + id + " will complete.");
// Do nothing. RA is responsible for completing.
} else {
switch (_configProvider.getHeuristicCompletionDirection()) {
case ConfigurationProvider.HEURISTIC_COMPLETION_DIRECTION_COMMIT:
Tr.error(tc, "WTRN0098_COMMIT_RA_UNINSTALLED", new Object[] { getTranName(), id });
recoverCommit(false);
break;
case ConfigurationProvider.HEURISTIC_COMPLETION_DIRECTION_MANUAL:
// do nothing, administrative completion is required
_needsManualCompletion = true;
Tr.info(tc, "WTRN0101_MANUAL_RA_UNINSTALLED", new Object[] { getTranName(), id });
break;
default:
Tr.error(tc, "WTRN0099_ROLLBACK_RA_UNINSTALLED", new Object[] { getTranName(), id });
recoverRollback(false);
}
}
} else {
retryCompletion();
}
break;
}
} else {
// For a top-level Transaction, we will only recover in the case
// where we have successfully prepared. If the state is not committing,
// then assume it is rollback.
if (state == TransactionState.STATE_LAST_PARTICIPANT) {
// LIDB1673-13 lps heuristic completion.
// The transaction was attempting to complete its
// 1PC resource when the server went down.
// Use the lpsHeuristicCompletion flag to determine
// how to complete the tx.
switch (ConfigurationProviderManager.getConfigurationProvider().getHeuristicCompletionDirection()) {
case ConfigurationProvider.HEURISTIC_COMPLETION_DIRECTION_COMMIT:
Tr.error(tc, "WTRN0096_HEURISTIC_MAY_HAVE_OCCURED", getTranName());
recoverCommit(false);
break;
case ConfigurationProvider.HEURISTIC_COMPLETION_DIRECTION_MANUAL:
// do nothing!?
_needsManualCompletion = true;
Tr.info(tc, "WTRN0097_HEURISTIC_MANUAL_COMPLETION", getTranName());
break;
default:
Tr.error(tc, "WTRN0102_HEURISTIC_MAY_HAVE_OCCURED", getTranName());
recoverRollback(false);
}
} else if (state == TransactionState.STATE_COMMITTING)
recoverCommit(false);
else
recoverRollback(false);
}
if (tc.isEntryEnabled())
Tr.exit(tc, "recover");
} | java | synchronized public void recover() {
if (tc.isEntryEnabled())
Tr.entry(tc, "recover", this);
final int state = _status.getState();
if (_subordinate) {
// For a subordinate, first check whether the global outcome is known locally.
switch (state) {
// Due to the possibility of recovery being attempted asynchronously to
// an incoming superior request, we must cover the case where the
// transaction has now actually committed already.
case TransactionState.STATE_HEURISTIC_ON_COMMIT:
case TransactionState.STATE_COMMITTED:
case TransactionState.STATE_COMMITTING:
recoverCommit(true);
break;
// Due to the possibility of recovery being attempted asynchronously to
// an incoming superior request, we must cover the case where the
// transaction has now actually rolled back already.
case TransactionState.STATE_HEURISTIC_ON_ROLLBACK:
case TransactionState.STATE_ROLLED_BACK:
case TransactionState.STATE_ROLLING_BACK:
recoverRollback(true);
break;
// For a subordinate, the replay_completion method is invoked on the superior.
// If the number of times the replay_completion has been retried is greater
// than the value specified by COMMITRETRY, then HEURISTICDIRECTION is used
// to determine the transaction outcome.
default:
// If we were imported from a JCA provider, check whether it's still installed.
// If so, we need do nothing here since we expect the RA to complete the transaction.
// Otherwise, we will complete using the configured direction.
if (_JCARecoveryData != null) {
final String id = _JCARecoveryData.getWrapper().getProviderId();
if (TMHelper.isProviderInstalled(id)) {
if (tc.isDebugEnabled())
Tr.debug(tc, "recover", "Do nothing. Expect provider " + id + " will complete.");
// Do nothing. RA is responsible for completing.
} else {
switch (_configProvider.getHeuristicCompletionDirection()) {
case ConfigurationProvider.HEURISTIC_COMPLETION_DIRECTION_COMMIT:
Tr.error(tc, "WTRN0098_COMMIT_RA_UNINSTALLED", new Object[] { getTranName(), id });
recoverCommit(false);
break;
case ConfigurationProvider.HEURISTIC_COMPLETION_DIRECTION_MANUAL:
// do nothing, administrative completion is required
_needsManualCompletion = true;
Tr.info(tc, "WTRN0101_MANUAL_RA_UNINSTALLED", new Object[] { getTranName(), id });
break;
default:
Tr.error(tc, "WTRN0099_ROLLBACK_RA_UNINSTALLED", new Object[] { getTranName(), id });
recoverRollback(false);
}
}
} else {
retryCompletion();
}
break;
}
} else {
// For a top-level Transaction, we will only recover in the case
// where we have successfully prepared. If the state is not committing,
// then assume it is rollback.
if (state == TransactionState.STATE_LAST_PARTICIPANT) {
// LIDB1673-13 lps heuristic completion.
// The transaction was attempting to complete its
// 1PC resource when the server went down.
// Use the lpsHeuristicCompletion flag to determine
// how to complete the tx.
switch (ConfigurationProviderManager.getConfigurationProvider().getHeuristicCompletionDirection()) {
case ConfigurationProvider.HEURISTIC_COMPLETION_DIRECTION_COMMIT:
Tr.error(tc, "WTRN0096_HEURISTIC_MAY_HAVE_OCCURED", getTranName());
recoverCommit(false);
break;
case ConfigurationProvider.HEURISTIC_COMPLETION_DIRECTION_MANUAL:
// do nothing!?
_needsManualCompletion = true;
Tr.info(tc, "WTRN0097_HEURISTIC_MANUAL_COMPLETION", getTranName());
break;
default:
Tr.error(tc, "WTRN0102_HEURISTIC_MAY_HAVE_OCCURED", getTranName());
recoverRollback(false);
}
} else if (state == TransactionState.STATE_COMMITTING)
recoverCommit(false);
else
recoverRollback(false);
}
if (tc.isEntryEnabled())
Tr.exit(tc, "recover");
} | [
"synchronized",
"public",
"void",
"recover",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"recover\"",
",",
"this",
")",
";",
"final",
"int",
"state",
"=",
"_status",
".",
"getState",
"(",
")",
";",
"if",
"(",
"_subordinate",
")",
"{",
"// For a subordinate, first check whether the global outcome is known locally.",
"switch",
"(",
"state",
")",
"{",
"// Due to the possibility of recovery being attempted asynchronously to",
"// an incoming superior request, we must cover the case where the",
"// transaction has now actually committed already.",
"case",
"TransactionState",
".",
"STATE_HEURISTIC_ON_COMMIT",
":",
"case",
"TransactionState",
".",
"STATE_COMMITTED",
":",
"case",
"TransactionState",
".",
"STATE_COMMITTING",
":",
"recoverCommit",
"(",
"true",
")",
";",
"break",
";",
"// Due to the possibility of recovery being attempted asynchronously to",
"// an incoming superior request, we must cover the case where the",
"// transaction has now actually rolled back already.",
"case",
"TransactionState",
".",
"STATE_HEURISTIC_ON_ROLLBACK",
":",
"case",
"TransactionState",
".",
"STATE_ROLLED_BACK",
":",
"case",
"TransactionState",
".",
"STATE_ROLLING_BACK",
":",
"recoverRollback",
"(",
"true",
")",
";",
"break",
";",
"// For a subordinate, the replay_completion method is invoked on the superior.",
"// If the number of times the replay_completion has been retried is greater",
"// than the value specified by COMMITRETRY, then HEURISTICDIRECTION is used",
"// to determine the transaction outcome.",
"default",
":",
"// If we were imported from a JCA provider, check whether it's still installed.",
"// If so, we need do nothing here since we expect the RA to complete the transaction.",
"// Otherwise, we will complete using the configured direction.",
"if",
"(",
"_JCARecoveryData",
"!=",
"null",
")",
"{",
"final",
"String",
"id",
"=",
"_JCARecoveryData",
".",
"getWrapper",
"(",
")",
".",
"getProviderId",
"(",
")",
";",
"if",
"(",
"TMHelper",
".",
"isProviderInstalled",
"(",
"id",
")",
")",
"{",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"recover\"",
",",
"\"Do nothing. Expect provider \"",
"+",
"id",
"+",
"\" will complete.\"",
")",
";",
"// Do nothing. RA is responsible for completing.",
"}",
"else",
"{",
"switch",
"(",
"_configProvider",
".",
"getHeuristicCompletionDirection",
"(",
")",
")",
"{",
"case",
"ConfigurationProvider",
".",
"HEURISTIC_COMPLETION_DIRECTION_COMMIT",
":",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"WTRN0098_COMMIT_RA_UNINSTALLED\"",
",",
"new",
"Object",
"[",
"]",
"{",
"getTranName",
"(",
")",
",",
"id",
"}",
")",
";",
"recoverCommit",
"(",
"false",
")",
";",
"break",
";",
"case",
"ConfigurationProvider",
".",
"HEURISTIC_COMPLETION_DIRECTION_MANUAL",
":",
"// do nothing, administrative completion is required",
"_needsManualCompletion",
"=",
"true",
";",
"Tr",
".",
"info",
"(",
"tc",
",",
"\"WTRN0101_MANUAL_RA_UNINSTALLED\"",
",",
"new",
"Object",
"[",
"]",
"{",
"getTranName",
"(",
")",
",",
"id",
"}",
")",
";",
"break",
";",
"default",
":",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"WTRN0099_ROLLBACK_RA_UNINSTALLED\"",
",",
"new",
"Object",
"[",
"]",
"{",
"getTranName",
"(",
")",
",",
"id",
"}",
")",
";",
"recoverRollback",
"(",
"false",
")",
";",
"}",
"}",
"}",
"else",
"{",
"retryCompletion",
"(",
")",
";",
"}",
"break",
";",
"}",
"}",
"else",
"{",
"// For a top-level Transaction, we will only recover in the case",
"// where we have successfully prepared. If the state is not committing,",
"// then assume it is rollback.",
"if",
"(",
"state",
"==",
"TransactionState",
".",
"STATE_LAST_PARTICIPANT",
")",
"{",
"// LIDB1673-13 lps heuristic completion.",
"// The transaction was attempting to complete its",
"// 1PC resource when the server went down.",
"// Use the lpsHeuristicCompletion flag to determine",
"// how to complete the tx.",
"switch",
"(",
"ConfigurationProviderManager",
".",
"getConfigurationProvider",
"(",
")",
".",
"getHeuristicCompletionDirection",
"(",
")",
")",
"{",
"case",
"ConfigurationProvider",
".",
"HEURISTIC_COMPLETION_DIRECTION_COMMIT",
":",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"WTRN0096_HEURISTIC_MAY_HAVE_OCCURED\"",
",",
"getTranName",
"(",
")",
")",
";",
"recoverCommit",
"(",
"false",
")",
";",
"break",
";",
"case",
"ConfigurationProvider",
".",
"HEURISTIC_COMPLETION_DIRECTION_MANUAL",
":",
"// do nothing!?",
"_needsManualCompletion",
"=",
"true",
";",
"Tr",
".",
"info",
"(",
"tc",
",",
"\"WTRN0097_HEURISTIC_MANUAL_COMPLETION\"",
",",
"getTranName",
"(",
")",
")",
";",
"break",
";",
"default",
":",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"WTRN0102_HEURISTIC_MAY_HAVE_OCCURED\"",
",",
"getTranName",
"(",
")",
")",
";",
"recoverRollback",
"(",
"false",
")",
";",
"}",
"}",
"else",
"if",
"(",
"state",
"==",
"TransactionState",
".",
"STATE_COMMITTING",
")",
"recoverCommit",
"(",
"false",
")",
";",
"else",
"recoverRollback",
"(",
"false",
")",
";",
"}",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"recover\"",
")",
";",
"}"
] | Directs the TransactionImpl to perform recovery actions based on its
reconstructed state after a failure, or after an in-doubt timeout has
occurred.
This method is called by the RecoveryManager during recovery, in which case
there is no terminator object, or during normal operation if the transaction
commit retry interval has been exceeded for the transaction.
If this method is called more times than the retry limit specified in
COMMITRETRY, then the global outcome of the transaction is taken from the
value of HEURISTICDIRECTION.
This method is synchronized together with the Associations methods as it
needs to support concurrency between inbound requests and in-doubt timer
activity. On recovery, there will be no associations for non-subordinates.
@return | [
"Directs",
"the",
"TransactionImpl",
"to",
"perform",
"recovery",
"actions",
"based",
"on",
"its",
"reconstructed",
"state",
"after",
"a",
"failure",
"or",
"after",
"an",
"in",
"-",
"doubt",
"timeout",
"has",
"occurred",
".",
"This",
"method",
"is",
"called",
"by",
"the",
"RecoveryManager",
"during",
"recovery",
"in",
"which",
"case",
"there",
"is",
"no",
"terminator",
"object",
"or",
"during",
"normal",
"operation",
"if",
"the",
"transaction",
"commit",
"retry",
"interval",
"has",
"been",
"exceeded",
"for",
"the",
"transaction",
".",
"If",
"this",
"method",
"is",
"called",
"more",
"times",
"than",
"the",
"retry",
"limit",
"specified",
"in",
"COMMITRETRY",
"then",
"the",
"global",
"outcome",
"of",
"the",
"transaction",
"is",
"taken",
"from",
"the",
"value",
"of",
"HEURISTICDIRECTION",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java#L567-L658 | train |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java | TransactionImpl.commit | @Override
public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException {
if (tc.isEntryEnabled())
Tr.entry(tc, "commit (SPI)");
try {
processCommit();
} catch (HeuristicHazardException hhe) {
// Only throw heuristic hazard in the one phase case
// modify the heuristic - note JTA 1.0.1 errata implies this may be reconsidered one day
final HeuristicMixedException hme = new HeuristicMixedException(hhe.getLocalizedMessage());
hme.initCause(hhe.getCause()); //Set the cause to be the cause of the HeuristicHazardException
if (tc.isEntryEnabled())
Tr.exit(tc, "commit", hme);
throw hme;
} finally {
if (tc.isEntryEnabled())
Tr.exit(tc, "commit (SPI)");
}
} | java | @Override
public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException {
if (tc.isEntryEnabled())
Tr.entry(tc, "commit (SPI)");
try {
processCommit();
} catch (HeuristicHazardException hhe) {
// Only throw heuristic hazard in the one phase case
// modify the heuristic - note JTA 1.0.1 errata implies this may be reconsidered one day
final HeuristicMixedException hme = new HeuristicMixedException(hhe.getLocalizedMessage());
hme.initCause(hhe.getCause()); //Set the cause to be the cause of the HeuristicHazardException
if (tc.isEntryEnabled())
Tr.exit(tc, "commit", hme);
throw hme;
} finally {
if (tc.isEntryEnabled())
Tr.exit(tc, "commit (SPI)");
}
} | [
"@",
"Override",
"public",
"void",
"commit",
"(",
")",
"throws",
"RollbackException",
",",
"HeuristicMixedException",
",",
"HeuristicRollbackException",
",",
"SecurityException",
",",
"IllegalStateException",
",",
"SystemException",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"commit (SPI)\"",
")",
";",
"try",
"{",
"processCommit",
"(",
")",
";",
"}",
"catch",
"(",
"HeuristicHazardException",
"hhe",
")",
"{",
"// Only throw heuristic hazard in the one phase case",
"// modify the heuristic - note JTA 1.0.1 errata implies this may be reconsidered one day",
"final",
"HeuristicMixedException",
"hme",
"=",
"new",
"HeuristicMixedException",
"(",
"hhe",
".",
"getLocalizedMessage",
"(",
")",
")",
";",
"hme",
".",
"initCause",
"(",
"hhe",
".",
"getCause",
"(",
")",
")",
";",
"//Set the cause to be the cause of the HeuristicHazardException",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"commit\"",
",",
"hme",
")",
";",
"throw",
"hme",
";",
"}",
"finally",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"commit (SPI)\"",
")",
";",
"}",
"}"
] | Commit the transation associated with the target Transaction object
This call should only be made from the root.
@exception RollbackException Thrown to indicate that
the transaction has been rolled back rather than committed.
@exception HeuristicMixedException Thrown to indicate that a heuristic
mix decision was made.
@exception HeuristicRollbackException Thrown to indicate that a
heuristic rollback decision was made.
@exception SecurityException Thrown to indicate that the thread is
not allowed to commit the transaction.
@exception IllegalStateException Thrown if the transaction in the
target object is inactive.
@exception SystemException Thrown if the transaction manager
encounters an unexpected error condition | [
"Commit",
"the",
"transation",
"associated",
"with",
"the",
"target",
"Transaction",
"object"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java#L705-L724 | train |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java | TransactionImpl.commit_one_phase | public void commit_one_phase() throws RollbackException, HeuristicMixedException, HeuristicHazardException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException {
if (tc.isEntryEnabled())
Tr.entry(tc, "commit_one_phase");
// This call is only valid for a single subordinate - treat as a "superior"
_subordinate = false;
try {
processCommit();
} finally {
if (tc.isEntryEnabled())
Tr.exit(tc, "commit_one_phase");
}
} | java | public void commit_one_phase() throws RollbackException, HeuristicMixedException, HeuristicHazardException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException {
if (tc.isEntryEnabled())
Tr.entry(tc, "commit_one_phase");
// This call is only valid for a single subordinate - treat as a "superior"
_subordinate = false;
try {
processCommit();
} finally {
if (tc.isEntryEnabled())
Tr.exit(tc, "commit_one_phase");
}
} | [
"public",
"void",
"commit_one_phase",
"(",
")",
"throws",
"RollbackException",
",",
"HeuristicMixedException",
",",
"HeuristicHazardException",
",",
"HeuristicRollbackException",
",",
"SecurityException",
",",
"IllegalStateException",
",",
"SystemException",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"commit_one_phase\"",
")",
";",
"// This call is only valid for a single subordinate - treat as a \"superior\"",
"_subordinate",
"=",
"false",
";",
"try",
"{",
"processCommit",
"(",
")",
";",
"}",
"finally",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"commit_one_phase\"",
")",
";",
"}",
"}"
] | Commit the transation associated with a subordinate which received
a commit_one_phase request from the superior. Any other
subordinate requests should call the internal methods directly.
@exception RollbackException Thrown to indicate that
the transaction has been rolled back rather than committed.
@exception HeuristicMixedException Thrown to indicate that a heuristic
mix decision was made.
@exception HeuristicHazardException Thrown to indicate that a heuristic
hazard decision was made.
@exception HeuristicRollbackException Thrown to indicate that a
heuristic rollback decision was made.
@exception SecurityException Thrown to indicate that the thread is
not allowed to commit the transaction.
@exception IllegalStateException Thrown if the transaction in the
target object is inactive.
@exception SystemException Thrown if the transaction manager
encounters an unexpected error condition | [
"Commit",
"the",
"transation",
"associated",
"with",
"a",
"subordinate",
"which",
"received",
"a",
"commit_one_phase",
"request",
"from",
"the",
"superior",
".",
"Any",
"other",
"subordinate",
"requests",
"should",
"call",
"the",
"internal",
"methods",
"directly",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java#L752-L765 | train |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java | TransactionImpl.rollback | @Override
public void rollback() throws IllegalStateException, SystemException {
if (tc.isEntryEnabled())
Tr.entry(tc, "rollback (SPI)");
final int state = _status.getState();
//
// We are only called in this method for superiors.
//
if (state == TransactionState.STATE_ACTIVE) {
//
// Cancel timeout prior to completion phase
//
cancelAlarms();
try {
_status.setState(TransactionState.STATE_ROLLING_BACK);
} catch (SystemException se) {
FFDCFilter.processException(se, "com.ibm.tx.jta.TransactionImpl.rollback", "1587", this);
if (tc.isDebugEnabled())
Tr.debug(tc, "Exception caught setting state to ROLLING_BACK!", se);
if (tc.isEntryEnabled())
Tr.exit(tc, "rollback (SPI)");
throw se;
}
try {
internalRollback();
} catch (HeuristicMixedException hme) {
if (tc.isDebugEnabled())
Tr.debug(tc, "HeuristicMixedException caught rollback processing", hme);
// state change handled by notifyCompletion
// Add to list of heuristically completed transactions
addHeuristic();
} catch (HeuristicHazardException hhe) {
if (tc.isDebugEnabled())
Tr.debug(tc, "HeuristicHazardException caught rollback processing", hhe);
// state change handled by notifyCompletion
// Add to list of heuristically completed transactions
addHeuristic();
} catch (HeuristicCommitException hce) {
if (tc.isDebugEnabled())
Tr.debug(tc, "HeuristicHazardException caught rollback processing", hce);
// state change handled by notifyCompletion
// Add to list of heuristically completed transactions
addHeuristic();
} catch (SystemException se) {
FFDCFilter.processException(se, "com.ibm.tx.jta.TransactionImpl.rollback", "1626", this);
if (tc.isEventEnabled())
Tr.event(tc, "SystemException caught during rollback", se);
if (tc.isEntryEnabled())
Tr.exit(tc, "rollback (SPI)");
throw se;
} catch (Throwable ex) {
FFDCFilter.processException(ex, "com.ibm.tx.jta.TransactionImpl.rollback", "1633", this);
if (tc.isEventEnabled())
Tr.event(tc, "Exception caught during rollback", ex);
if (tc.isEntryEnabled())
Tr.exit(tc, "rollback (SPI)");
throw new SystemException(ex.getLocalizedMessage());
} finally {
notifyCompletion();
}
}
//
// Defect 1440
//
// We are not in ACTIVE state so we need to
// throw the appropriate exception.
//
else if (state == TransactionState.STATE_NONE) {
if (tc.isEventEnabled())
Tr.event(tc, "No transaction available!");
if (tc.isEntryEnabled())
Tr.exit(tc, "rollback (SPI)");
throw new IllegalStateException();
} else {
if (tc.isEventEnabled())
Tr.event(tc, "Invalid transaction state:" + state);
if (tc.isEntryEnabled())
Tr.exit(tc, "rollback (SPI)");
throw new SystemException();
}
if (tc.isEntryEnabled())
Tr.exit(tc, "rollback (SPI)");
} | java | @Override
public void rollback() throws IllegalStateException, SystemException {
if (tc.isEntryEnabled())
Tr.entry(tc, "rollback (SPI)");
final int state = _status.getState();
//
// We are only called in this method for superiors.
//
if (state == TransactionState.STATE_ACTIVE) {
//
// Cancel timeout prior to completion phase
//
cancelAlarms();
try {
_status.setState(TransactionState.STATE_ROLLING_BACK);
} catch (SystemException se) {
FFDCFilter.processException(se, "com.ibm.tx.jta.TransactionImpl.rollback", "1587", this);
if (tc.isDebugEnabled())
Tr.debug(tc, "Exception caught setting state to ROLLING_BACK!", se);
if (tc.isEntryEnabled())
Tr.exit(tc, "rollback (SPI)");
throw se;
}
try {
internalRollback();
} catch (HeuristicMixedException hme) {
if (tc.isDebugEnabled())
Tr.debug(tc, "HeuristicMixedException caught rollback processing", hme);
// state change handled by notifyCompletion
// Add to list of heuristically completed transactions
addHeuristic();
} catch (HeuristicHazardException hhe) {
if (tc.isDebugEnabled())
Tr.debug(tc, "HeuristicHazardException caught rollback processing", hhe);
// state change handled by notifyCompletion
// Add to list of heuristically completed transactions
addHeuristic();
} catch (HeuristicCommitException hce) {
if (tc.isDebugEnabled())
Tr.debug(tc, "HeuristicHazardException caught rollback processing", hce);
// state change handled by notifyCompletion
// Add to list of heuristically completed transactions
addHeuristic();
} catch (SystemException se) {
FFDCFilter.processException(se, "com.ibm.tx.jta.TransactionImpl.rollback", "1626", this);
if (tc.isEventEnabled())
Tr.event(tc, "SystemException caught during rollback", se);
if (tc.isEntryEnabled())
Tr.exit(tc, "rollback (SPI)");
throw se;
} catch (Throwable ex) {
FFDCFilter.processException(ex, "com.ibm.tx.jta.TransactionImpl.rollback", "1633", this);
if (tc.isEventEnabled())
Tr.event(tc, "Exception caught during rollback", ex);
if (tc.isEntryEnabled())
Tr.exit(tc, "rollback (SPI)");
throw new SystemException(ex.getLocalizedMessage());
} finally {
notifyCompletion();
}
}
//
// Defect 1440
//
// We are not in ACTIVE state so we need to
// throw the appropriate exception.
//
else if (state == TransactionState.STATE_NONE) {
if (tc.isEventEnabled())
Tr.event(tc, "No transaction available!");
if (tc.isEntryEnabled())
Tr.exit(tc, "rollback (SPI)");
throw new IllegalStateException();
} else {
if (tc.isEventEnabled())
Tr.event(tc, "Invalid transaction state:" + state);
if (tc.isEntryEnabled())
Tr.exit(tc, "rollback (SPI)");
throw new SystemException();
}
if (tc.isEntryEnabled())
Tr.exit(tc, "rollback (SPI)");
} | [
"@",
"Override",
"public",
"void",
"rollback",
"(",
")",
"throws",
"IllegalStateException",
",",
"SystemException",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"rollback (SPI)\"",
")",
";",
"final",
"int",
"state",
"=",
"_status",
".",
"getState",
"(",
")",
";",
"//",
"// We are only called in this method for superiors.",
"//",
"if",
"(",
"state",
"==",
"TransactionState",
".",
"STATE_ACTIVE",
")",
"{",
"//",
"// Cancel timeout prior to completion phase",
"//",
"cancelAlarms",
"(",
")",
";",
"try",
"{",
"_status",
".",
"setState",
"(",
"TransactionState",
".",
"STATE_ROLLING_BACK",
")",
";",
"}",
"catch",
"(",
"SystemException",
"se",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"se",
",",
"\"com.ibm.tx.jta.TransactionImpl.rollback\"",
",",
"\"1587\"",
",",
"this",
")",
";",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Exception caught setting state to ROLLING_BACK!\"",
",",
"se",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"rollback (SPI)\"",
")",
";",
"throw",
"se",
";",
"}",
"try",
"{",
"internalRollback",
"(",
")",
";",
"}",
"catch",
"(",
"HeuristicMixedException",
"hme",
")",
"{",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"HeuristicMixedException caught rollback processing\"",
",",
"hme",
")",
";",
"// state change handled by notifyCompletion",
"// Add to list of heuristically completed transactions",
"addHeuristic",
"(",
")",
";",
"}",
"catch",
"(",
"HeuristicHazardException",
"hhe",
")",
"{",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"HeuristicHazardException caught rollback processing\"",
",",
"hhe",
")",
";",
"// state change handled by notifyCompletion",
"// Add to list of heuristically completed transactions",
"addHeuristic",
"(",
")",
";",
"}",
"catch",
"(",
"HeuristicCommitException",
"hce",
")",
"{",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"HeuristicHazardException caught rollback processing\"",
",",
"hce",
")",
";",
"// state change handled by notifyCompletion",
"// Add to list of heuristically completed transactions",
"addHeuristic",
"(",
")",
";",
"}",
"catch",
"(",
"SystemException",
"se",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"se",
",",
"\"com.ibm.tx.jta.TransactionImpl.rollback\"",
",",
"\"1626\"",
",",
"this",
")",
";",
"if",
"(",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"SystemException caught during rollback\"",
",",
"se",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"rollback (SPI)\"",
")",
";",
"throw",
"se",
";",
"}",
"catch",
"(",
"Throwable",
"ex",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"ex",
",",
"\"com.ibm.tx.jta.TransactionImpl.rollback\"",
",",
"\"1633\"",
",",
"this",
")",
";",
"if",
"(",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"Exception caught during rollback\"",
",",
"ex",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"rollback (SPI)\"",
")",
";",
"throw",
"new",
"SystemException",
"(",
"ex",
".",
"getLocalizedMessage",
"(",
")",
")",
";",
"}",
"finally",
"{",
"notifyCompletion",
"(",
")",
";",
"}",
"}",
"//",
"// Defect 1440",
"//",
"// We are not in ACTIVE state so we need to",
"// throw the appropriate exception.",
"//",
"else",
"if",
"(",
"state",
"==",
"TransactionState",
".",
"STATE_NONE",
")",
"{",
"if",
"(",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"No transaction available!\"",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"rollback (SPI)\"",
")",
";",
"throw",
"new",
"IllegalStateException",
"(",
")",
";",
"}",
"else",
"{",
"if",
"(",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"Invalid transaction state:\"",
"+",
"state",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"rollback (SPI)\"",
")",
";",
"throw",
"new",
"SystemException",
"(",
")",
";",
"}",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"rollback (SPI)\"",
")",
";",
"}"
] | Rollback the transaction associated with the target Transaction Object
@exception IllegalStateException
@exception SystemException | [
"Rollback",
"the",
"transaction",
"associated",
"with",
"the",
"target",
"Transaction",
"Object"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java#L1037-L1127 | train |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java | TransactionImpl.setPrepareXAFailed | protected void setPrepareXAFailed() // d266464A
{
if (tc.isEntryEnabled())
Tr.entry(tc, "setPrepareXAFailed");
setRBO(); // Ensure native context is informed
if (tc.isEntryEnabled())
Tr.exit(tc, "setPrepareXAFailed");
} | java | protected void setPrepareXAFailed() // d266464A
{
if (tc.isEntryEnabled())
Tr.entry(tc, "setPrepareXAFailed");
setRBO(); // Ensure native context is informed
if (tc.isEntryEnabled())
Tr.exit(tc, "setPrepareXAFailed");
} | [
"protected",
"void",
"setPrepareXAFailed",
"(",
")",
"// d266464A",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"setPrepareXAFailed\"",
")",
";",
"setRBO",
"(",
")",
";",
"// Ensure native context is informed",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"setPrepareXAFailed\"",
")",
";",
"}"
] | Indicate that the prepare XA phase failed. | [
"Indicate",
"that",
"the",
"prepare",
"XA",
"phase",
"failed",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java#L1370-L1379 | train |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java | TransactionImpl.prePrepare | protected boolean prePrepare() {
if (tc.isEntryEnabled())
Tr.entry(tc, "prePrepare");
//
// Cancel timeout prior to completion phase
//
cancelAlarms();
//
// Inform the Synchronisations we are about to complete
//
if (!_rollbackOnly) {
if (_syncs != null) {
_syncs.distributeBefore();
}
}
if (tc.isEntryEnabled())
Tr.exit(tc, "prePrepare", !_rollbackOnly);
return !_rollbackOnly;
} | java | protected boolean prePrepare() {
if (tc.isEntryEnabled())
Tr.entry(tc, "prePrepare");
//
// Cancel timeout prior to completion phase
//
cancelAlarms();
//
// Inform the Synchronisations we are about to complete
//
if (!_rollbackOnly) {
if (_syncs != null) {
_syncs.distributeBefore();
}
}
if (tc.isEntryEnabled())
Tr.exit(tc, "prePrepare", !_rollbackOnly);
return !_rollbackOnly;
} | [
"protected",
"boolean",
"prePrepare",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"prePrepare\"",
")",
";",
"//",
"// Cancel timeout prior to completion phase",
"//",
"cancelAlarms",
"(",
")",
";",
"//",
"// Inform the Synchronisations we are about to complete",
"//",
"if",
"(",
"!",
"_rollbackOnly",
")",
"{",
"if",
"(",
"_syncs",
"!=",
"null",
")",
"{",
"_syncs",
".",
"distributeBefore",
"(",
")",
";",
"}",
"}",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"prePrepare\"",
",",
"!",
"_rollbackOnly",
")",
";",
"return",
"!",
"_rollbackOnly",
";",
"}"
] | Drive beforeCompletion against sync objects registered with
this transaction. | [
"Drive",
"beforeCompletion",
"against",
"sync",
"objects",
"registered",
"with",
"this",
"transaction",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java#L1385-L1406 | train |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java | TransactionImpl.distributeEnd | protected boolean distributeEnd() throws SystemException {
if (tc.isEntryEnabled())
Tr.entry(tc, "distributeEnd");
if (!getResources().distributeEnd(XAResource.TMSUCCESS)) {
setRBO();
}
if (_rollbackOnly) {
try {
_status.setState(TransactionState.STATE_ROLLING_BACK);
} catch (SystemException se) {
FFDCFilter.processException(se, "com.ibm.tx.jta.TransactionImpl.distributeEnd", "1731", this);
if (tc.isEntryEnabled())
Tr.exit(tc, "distributeEnd", se);
throw se;
}
}
if (tc.isEntryEnabled())
Tr.exit(tc, "distributeEnd", !_rollbackOnly);
return !_rollbackOnly;
} | java | protected boolean distributeEnd() throws SystemException {
if (tc.isEntryEnabled())
Tr.entry(tc, "distributeEnd");
if (!getResources().distributeEnd(XAResource.TMSUCCESS)) {
setRBO();
}
if (_rollbackOnly) {
try {
_status.setState(TransactionState.STATE_ROLLING_BACK);
} catch (SystemException se) {
FFDCFilter.processException(se, "com.ibm.tx.jta.TransactionImpl.distributeEnd", "1731", this);
if (tc.isEntryEnabled())
Tr.exit(tc, "distributeEnd", se);
throw se;
}
}
if (tc.isEntryEnabled())
Tr.exit(tc, "distributeEnd", !_rollbackOnly);
return !_rollbackOnly;
} | [
"protected",
"boolean",
"distributeEnd",
"(",
")",
"throws",
"SystemException",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"distributeEnd\"",
")",
";",
"if",
"(",
"!",
"getResources",
"(",
")",
".",
"distributeEnd",
"(",
"XAResource",
".",
"TMSUCCESS",
")",
")",
"{",
"setRBO",
"(",
")",
";",
"}",
"if",
"(",
"_rollbackOnly",
")",
"{",
"try",
"{",
"_status",
".",
"setState",
"(",
"TransactionState",
".",
"STATE_ROLLING_BACK",
")",
";",
"}",
"catch",
"(",
"SystemException",
"se",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"se",
",",
"\"com.ibm.tx.jta.TransactionImpl.distributeEnd\"",
",",
"\"1731\"",
",",
"this",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"distributeEnd\"",
",",
"se",
")",
";",
"throw",
"se",
";",
"}",
"}",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"distributeEnd\"",
",",
"!",
"_rollbackOnly",
")",
";",
"return",
"!",
"_rollbackOnly",
";",
"}"
] | Distribute end to all XA resources | [
"Distribute",
"end",
"to",
"all",
"XA",
"resources"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java#L1427-L1449 | train |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java | TransactionImpl.getOriginalException | public Throwable getOriginalException() {
if (tc.isEntryEnabled())
Tr.entry(tc, "getOriginalException");
if (tc.isEntryEnabled())
Tr.exit(tc, "getOriginalException", _originalException);
return _originalException;
} | java | public Throwable getOriginalException() {
if (tc.isEntryEnabled())
Tr.entry(tc, "getOriginalException");
if (tc.isEntryEnabled())
Tr.exit(tc, "getOriginalException", _originalException);
return _originalException;
} | [
"public",
"Throwable",
"getOriginalException",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"getOriginalException\"",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"getOriginalException\"",
",",
"_originalException",
")",
";",
"return",
"_originalException",
";",
"}"
] | returns the exception stored by RegisteredSyncs
@return Throwable the original exceptions | [
"returns",
"the",
"exception",
"stored",
"by",
"RegisteredSyncs"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java#L1882-L1888 | train |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java | TransactionImpl.setRollbackOnly | @Override
public void setRollbackOnly() throws IllegalStateException {
if (tc.isEntryEnabled())
Tr.entry(tc, "setRollbackOnly (SPI)");
final int state = _status.getState();
if (state == TransactionState.STATE_NONE ||
state == TransactionState.STATE_COMMITTED ||
state == TransactionState.STATE_ROLLED_BACK) {
if (tc.isEntryEnabled())
Tr.exit(tc, "setRollbackOnly (SPI)");
throw new IllegalStateException("No transaction available");
}
setRBO();
if (tc.isEntryEnabled())
Tr.exit(tc, "setRollbackOnly (SPI)");
} | java | @Override
public void setRollbackOnly() throws IllegalStateException {
if (tc.isEntryEnabled())
Tr.entry(tc, "setRollbackOnly (SPI)");
final int state = _status.getState();
if (state == TransactionState.STATE_NONE ||
state == TransactionState.STATE_COMMITTED ||
state == TransactionState.STATE_ROLLED_BACK) {
if (tc.isEntryEnabled())
Tr.exit(tc, "setRollbackOnly (SPI)");
throw new IllegalStateException("No transaction available");
}
setRBO();
if (tc.isEntryEnabled())
Tr.exit(tc, "setRollbackOnly (SPI)");
} | [
"@",
"Override",
"public",
"void",
"setRollbackOnly",
"(",
")",
"throws",
"IllegalStateException",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"setRollbackOnly (SPI)\"",
")",
";",
"final",
"int",
"state",
"=",
"_status",
".",
"getState",
"(",
")",
";",
"if",
"(",
"state",
"==",
"TransactionState",
".",
"STATE_NONE",
"||",
"state",
"==",
"TransactionState",
".",
"STATE_COMMITTED",
"||",
"state",
"==",
"TransactionState",
".",
"STATE_ROLLED_BACK",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"setRollbackOnly (SPI)\"",
")",
";",
"throw",
"new",
"IllegalStateException",
"(",
"\"No transaction available\"",
")",
";",
"}",
"setRBO",
"(",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"setRollbackOnly (SPI)\"",
")",
";",
"}"
] | Modify the transaction such that the only possible outcome
of the transaction is to rollback.
@exception IllegalStateException | [
"Modify",
"the",
"transaction",
"such",
"that",
"the",
"only",
"possible",
"outcome",
"of",
"the",
"transaction",
"is",
"to",
"rollback",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java#L1898-L1916 | train |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java | TransactionImpl.enlistResource | public void enlistResource(JTAResource remoteRes) {
if (tc.isEntryEnabled())
Tr.entry(tc, "enlistResource (SPI): args: ", remoteRes);
getResources().addRes(remoteRes);
if (tc.isEntryEnabled())
Tr.exit(tc, "enlistResource (SPI)");
} | java | public void enlistResource(JTAResource remoteRes) {
if (tc.isEntryEnabled())
Tr.entry(tc, "enlistResource (SPI): args: ", remoteRes);
getResources().addRes(remoteRes);
if (tc.isEntryEnabled())
Tr.exit(tc, "enlistResource (SPI)");
} | [
"public",
"void",
"enlistResource",
"(",
"JTAResource",
"remoteRes",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"enlistResource (SPI): args: \"",
",",
"remoteRes",
")",
";",
"getResources",
"(",
")",
".",
"addRes",
"(",
"remoteRes",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"enlistResource (SPI)\"",
")",
";",
"}"
] | Enlist a remote resouce with the transaction associated with the target
TransactionImpl object. Typically, this remote resource represents a
downstream suborindate server.
@param remoteRes the remote resource wrapped as a JTAResource | [
"Enlist",
"a",
"remote",
"resouce",
"with",
"the",
"transaction",
"associated",
"with",
"the",
"target",
"TransactionImpl",
"object",
".",
"Typically",
"this",
"remote",
"resource",
"represents",
"a",
"downstream",
"suborindate",
"server",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java#L2140-L2148 | train |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java | TransactionImpl.logHeuristic | protected void logHeuristic(boolean commit) throws SystemException {
if (tc.isEntryEnabled())
Tr.entry(tc, "logHeuristic", commit);
if (_subordinate && _status.getState() != TransactionState.STATE_PREPARING) {
getResources().logHeuristic(commit);
}
if (tc.isEntryEnabled())
Tr.exit(tc, "logHeuristic");
} | java | protected void logHeuristic(boolean commit) throws SystemException {
if (tc.isEntryEnabled())
Tr.entry(tc, "logHeuristic", commit);
if (_subordinate && _status.getState() != TransactionState.STATE_PREPARING) {
getResources().logHeuristic(commit);
}
if (tc.isEntryEnabled())
Tr.exit(tc, "logHeuristic");
} | [
"protected",
"void",
"logHeuristic",
"(",
"boolean",
"commit",
")",
"throws",
"SystemException",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"logHeuristic\"",
",",
"commit",
")",
";",
"if",
"(",
"_subordinate",
"&&",
"_status",
".",
"getState",
"(",
")",
"!=",
"TransactionState",
".",
"STATE_PREPARING",
")",
"{",
"getResources",
"(",
")",
".",
"logHeuristic",
"(",
"commit",
")",
";",
"}",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"logHeuristic\"",
")",
";",
"}"
] | Log the fact that we have encountered a heuristic outcome.
@param commit boolean to indicate whether we were committing or rolling
back
@exception SystemException
Thrown if the state change is invalid. | [
"Log",
"the",
"fact",
"that",
"we",
"have",
"encountered",
"a",
"heuristic",
"outcome",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java#L2180-L2190 | train |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java | TransactionImpl.getStatus | @Override
public int getStatus() {
int state = Status.STATUS_UNKNOWN;
switch (_status.getState()) {
case TransactionState.STATE_NONE:
state = Status.STATUS_NO_TRANSACTION;
break;
case TransactionState.STATE_ACTIVE:
if (_rollbackOnly)
state = Status.STATUS_MARKED_ROLLBACK;
else
state = Status.STATUS_ACTIVE;
break;
case TransactionState.STATE_PREPARING:
case TransactionState.STATE_LAST_PARTICIPANT:
state = Status.STATUS_PREPARING;
break;
case TransactionState.STATE_PREPARED:
state = Status.STATUS_PREPARED;
break;
case TransactionState.STATE_COMMITTING:
case TransactionState.STATE_COMMITTING_ONE_PHASE:
state = Status.STATUS_COMMITTING;
break;
case TransactionState.STATE_HEURISTIC_ON_COMMIT:
case TransactionState.STATE_COMMITTED:
state = Status.STATUS_COMMITTED;
break;
case TransactionState.STATE_ROLLING_BACK:
state = Status.STATUS_ROLLING_BACK;
break;
case TransactionState.STATE_HEURISTIC_ON_ROLLBACK:
case TransactionState.STATE_ROLLED_BACK:
state = Status.STATUS_ROLLEDBACK;
break;
}
if (tc.isDebugEnabled())
Tr.debug(tc, "getStatus (SPI)", Util.printStatus(state));
return state;
} | java | @Override
public int getStatus() {
int state = Status.STATUS_UNKNOWN;
switch (_status.getState()) {
case TransactionState.STATE_NONE:
state = Status.STATUS_NO_TRANSACTION;
break;
case TransactionState.STATE_ACTIVE:
if (_rollbackOnly)
state = Status.STATUS_MARKED_ROLLBACK;
else
state = Status.STATUS_ACTIVE;
break;
case TransactionState.STATE_PREPARING:
case TransactionState.STATE_LAST_PARTICIPANT:
state = Status.STATUS_PREPARING;
break;
case TransactionState.STATE_PREPARED:
state = Status.STATUS_PREPARED;
break;
case TransactionState.STATE_COMMITTING:
case TransactionState.STATE_COMMITTING_ONE_PHASE:
state = Status.STATUS_COMMITTING;
break;
case TransactionState.STATE_HEURISTIC_ON_COMMIT:
case TransactionState.STATE_COMMITTED:
state = Status.STATUS_COMMITTED;
break;
case TransactionState.STATE_ROLLING_BACK:
state = Status.STATUS_ROLLING_BACK;
break;
case TransactionState.STATE_HEURISTIC_ON_ROLLBACK:
case TransactionState.STATE_ROLLED_BACK:
state = Status.STATUS_ROLLEDBACK;
break;
}
if (tc.isDebugEnabled())
Tr.debug(tc, "getStatus (SPI)", Util.printStatus(state));
return state;
} | [
"@",
"Override",
"public",
"int",
"getStatus",
"(",
")",
"{",
"int",
"state",
"=",
"Status",
".",
"STATUS_UNKNOWN",
";",
"switch",
"(",
"_status",
".",
"getState",
"(",
")",
")",
"{",
"case",
"TransactionState",
".",
"STATE_NONE",
":",
"state",
"=",
"Status",
".",
"STATUS_NO_TRANSACTION",
";",
"break",
";",
"case",
"TransactionState",
".",
"STATE_ACTIVE",
":",
"if",
"(",
"_rollbackOnly",
")",
"state",
"=",
"Status",
".",
"STATUS_MARKED_ROLLBACK",
";",
"else",
"state",
"=",
"Status",
".",
"STATUS_ACTIVE",
";",
"break",
";",
"case",
"TransactionState",
".",
"STATE_PREPARING",
":",
"case",
"TransactionState",
".",
"STATE_LAST_PARTICIPANT",
":",
"state",
"=",
"Status",
".",
"STATUS_PREPARING",
";",
"break",
";",
"case",
"TransactionState",
".",
"STATE_PREPARED",
":",
"state",
"=",
"Status",
".",
"STATUS_PREPARED",
";",
"break",
";",
"case",
"TransactionState",
".",
"STATE_COMMITTING",
":",
"case",
"TransactionState",
".",
"STATE_COMMITTING_ONE_PHASE",
":",
"state",
"=",
"Status",
".",
"STATUS_COMMITTING",
";",
"break",
";",
"case",
"TransactionState",
".",
"STATE_HEURISTIC_ON_COMMIT",
":",
"case",
"TransactionState",
".",
"STATE_COMMITTED",
":",
"state",
"=",
"Status",
".",
"STATUS_COMMITTED",
";",
"break",
";",
"case",
"TransactionState",
".",
"STATE_ROLLING_BACK",
":",
"state",
"=",
"Status",
".",
"STATUS_ROLLING_BACK",
";",
"break",
";",
"case",
"TransactionState",
".",
"STATE_HEURISTIC_ON_ROLLBACK",
":",
"case",
"TransactionState",
".",
"STATE_ROLLED_BACK",
":",
"state",
"=",
"Status",
".",
"STATUS_ROLLEDBACK",
";",
"break",
";",
"}",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"getStatus (SPI)\"",
",",
"Util",
".",
"printStatus",
"(",
"state",
")",
")",
";",
"return",
"state",
";",
"}"
] | Obtain the status of the transaction associated with the target object
@return the transaction status | [
"Obtain",
"the",
"status",
"of",
"the",
"transaction",
"associated",
"with",
"the",
"target",
"object"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java#L2309-L2350 | train |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java | TransactionImpl.getXidImpl | public XidImpl getXidImpl(boolean createIfAbsent) {
if (tc.isEntryEnabled())
Tr.entry(tc, "getXidImpl", new Object[] { this, createIfAbsent });
if (createIfAbsent && (_xid == null)) {
// Create an XID as this transaction identifier.
_xid = new XidImpl(new TxPrimaryKey(_localTID, Configuration.getCurrentEpoch()));
}
if (tc.isEntryEnabled())
Tr.exit(tc, "getXidImpl", _xid);
return (XidImpl) _xid;
} | java | public XidImpl getXidImpl(boolean createIfAbsent) {
if (tc.isEntryEnabled())
Tr.entry(tc, "getXidImpl", new Object[] { this, createIfAbsent });
if (createIfAbsent && (_xid == null)) {
// Create an XID as this transaction identifier.
_xid = new XidImpl(new TxPrimaryKey(_localTID, Configuration.getCurrentEpoch()));
}
if (tc.isEntryEnabled())
Tr.exit(tc, "getXidImpl", _xid);
return (XidImpl) _xid;
} | [
"public",
"XidImpl",
"getXidImpl",
"(",
"boolean",
"createIfAbsent",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"getXidImpl\"",
",",
"new",
"Object",
"[",
"]",
"{",
"this",
",",
"createIfAbsent",
"}",
")",
";",
"if",
"(",
"createIfAbsent",
"&&",
"(",
"_xid",
"==",
"null",
")",
")",
"{",
"// Create an XID as this transaction identifier.",
"_xid",
"=",
"new",
"XidImpl",
"(",
"new",
"TxPrimaryKey",
"(",
"_localTID",
",",
"Configuration",
".",
"getCurrentEpoch",
"(",
")",
")",
")",
";",
"}",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"getXidImpl\"",
",",
"_xid",
")",
";",
"return",
"(",
"XidImpl",
")",
"_xid",
";",
"}"
] | Returns a global identifier that represents the TransactionImpl's transaction.
@return The global transaction identifier. | [
"Returns",
"a",
"global",
"identifier",
"that",
"represents",
"the",
"TransactionImpl",
"s",
"transaction",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java#L2386-L2398 | train |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java | TransactionImpl.setXidImpl | public void setXidImpl(XidImpl xid) {
if (tc.isDebugEnabled())
Tr.debug(tc, "setXidImpl", new Object[] { xid, this });
_xid = xid;
} | java | public void setXidImpl(XidImpl xid) {
if (tc.isDebugEnabled())
Tr.debug(tc, "setXidImpl", new Object[] { xid, this });
_xid = xid;
} | [
"public",
"void",
"setXidImpl",
"(",
"XidImpl",
"xid",
")",
"{",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"setXidImpl\"",
",",
"new",
"Object",
"[",
"]",
"{",
"xid",
",",
"this",
"}",
")",
";",
"_xid",
"=",
"xid",
";",
"}"
] | For recovery only | [
"For",
"recovery",
"only"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java#L2401-L2405 | train |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java | TransactionImpl.isJCAImportedAndPrepared | public boolean isJCAImportedAndPrepared(String providerId) {
return _JCARecoveryData != null &&
_status.getState() == TransactionState.STATE_PREPARED &&
_JCARecoveryData.getWrapper().getProviderId().equals(providerId);
} | java | public boolean isJCAImportedAndPrepared(String providerId) {
return _JCARecoveryData != null &&
_status.getState() == TransactionState.STATE_PREPARED &&
_JCARecoveryData.getWrapper().getProviderId().equals(providerId);
} | [
"public",
"boolean",
"isJCAImportedAndPrepared",
"(",
"String",
"providerId",
")",
"{",
"return",
"_JCARecoveryData",
"!=",
"null",
"&&",
"_status",
".",
"getState",
"(",
")",
"==",
"TransactionState",
".",
"STATE_PREPARED",
"&&",
"_JCARecoveryData",
".",
"getWrapper",
"(",
")",
".",
"getProviderId",
"(",
")",
".",
"equals",
"(",
"providerId",
")",
";",
"}"
] | Returns true if this tx was imported by the given RA and is prepared
@param providerId
@return | [
"Returns",
"true",
"if",
"this",
"tx",
"was",
"imported",
"by",
"the",
"given",
"RA",
"and",
"is",
"prepared"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TransactionImpl.java#L3177-L3181 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/KeyStoreManager.java | KeyStoreManager.loadKeyStores | public void loadKeyStores(Map<String, WSKeyStore> config) {
// now process each keystore in the provided config
for (Entry<String, WSKeyStore> current : config.entrySet()) {
try {
String name = current.getKey();
WSKeyStore keystore = current.getValue();
addKeyStoreToMap(name, keystore);
} catch (Exception e) {
FFDCFilter.processException(e, getClass().getName(), "loadKeyStores", new Object[] { this, config });
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "Error loading keystore; " + current.getKey() + " " + e);
}
}
}
} | java | public void loadKeyStores(Map<String, WSKeyStore> config) {
// now process each keystore in the provided config
for (Entry<String, WSKeyStore> current : config.entrySet()) {
try {
String name = current.getKey();
WSKeyStore keystore = current.getValue();
addKeyStoreToMap(name, keystore);
} catch (Exception e) {
FFDCFilter.processException(e, getClass().getName(), "loadKeyStores", new Object[] { this, config });
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "Error loading keystore; " + current.getKey() + " " + e);
}
}
}
} | [
"public",
"void",
"loadKeyStores",
"(",
"Map",
"<",
"String",
",",
"WSKeyStore",
">",
"config",
")",
"{",
"// now process each keystore in the provided config",
"for",
"(",
"Entry",
"<",
"String",
",",
"WSKeyStore",
">",
"current",
":",
"config",
".",
"entrySet",
"(",
")",
")",
"{",
"try",
"{",
"String",
"name",
"=",
"current",
".",
"getKey",
"(",
")",
";",
"WSKeyStore",
"keystore",
"=",
"current",
".",
"getValue",
"(",
")",
";",
"addKeyStoreToMap",
"(",
"name",
",",
"keystore",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
",",
"\"loadKeyStores\"",
",",
"new",
"Object",
"[",
"]",
"{",
"this",
",",
"config",
"}",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"Error loading keystore; \"",
"+",
"current",
".",
"getKey",
"(",
")",
"+",
"\" \"",
"+",
"e",
")",
";",
"}",
"}",
"}",
"}"
] | Load the provided list of keystores from the configuration.
@param config | [
"Load",
"the",
"provided",
"list",
"of",
"keystores",
"from",
"the",
"configuration",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/KeyStoreManager.java#L91-L105 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/KeyStoreManager.java | KeyStoreManager.getInputStream | public InputStream getInputStream(String fileName, boolean create) throws MalformedURLException, IOException {
try {
GetKeyStoreInputStreamAction action = new GetKeyStoreInputStreamAction(fileName, create);
return AccessController.doPrivileged(action);
} catch (PrivilegedActionException e) {
Exception ex = e.getException();
FFDCFilter.processException(e, getClass().getName(), "getInputStream", new Object[] { fileName, Boolean.valueOf(create), this });
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "Exception opening keystore; " + ex);
if (ex instanceof MalformedURLException)
throw (MalformedURLException) ex;
else if (ex instanceof IOException)
throw (IOException) ex;
throw new IOException(ex.getMessage());
}
} | java | public InputStream getInputStream(String fileName, boolean create) throws MalformedURLException, IOException {
try {
GetKeyStoreInputStreamAction action = new GetKeyStoreInputStreamAction(fileName, create);
return AccessController.doPrivileged(action);
} catch (PrivilegedActionException e) {
Exception ex = e.getException();
FFDCFilter.processException(e, getClass().getName(), "getInputStream", new Object[] { fileName, Boolean.valueOf(create), this });
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "Exception opening keystore; " + ex);
if (ex instanceof MalformedURLException)
throw (MalformedURLException) ex;
else if (ex instanceof IOException)
throw (IOException) ex;
throw new IOException(ex.getMessage());
}
} | [
"public",
"InputStream",
"getInputStream",
"(",
"String",
"fileName",
",",
"boolean",
"create",
")",
"throws",
"MalformedURLException",
",",
"IOException",
"{",
"try",
"{",
"GetKeyStoreInputStreamAction",
"action",
"=",
"new",
"GetKeyStoreInputStreamAction",
"(",
"fileName",
",",
"create",
")",
";",
"return",
"AccessController",
".",
"doPrivileged",
"(",
"action",
")",
";",
"}",
"catch",
"(",
"PrivilegedActionException",
"e",
")",
"{",
"Exception",
"ex",
"=",
"e",
".",
"getException",
"(",
")",
";",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
",",
"\"getInputStream\"",
",",
"new",
"Object",
"[",
"]",
"{",
"fileName",
",",
"Boolean",
".",
"valueOf",
"(",
"create",
")",
",",
"this",
"}",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Exception opening keystore; \"",
"+",
"ex",
")",
";",
"if",
"(",
"ex",
"instanceof",
"MalformedURLException",
")",
"throw",
"(",
"MalformedURLException",
")",
"ex",
";",
"else",
"if",
"(",
"ex",
"instanceof",
"IOException",
")",
"throw",
"(",
"IOException",
")",
"ex",
";",
"throw",
"new",
"IOException",
"(",
"ex",
".",
"getMessage",
"(",
")",
")",
";",
"}",
"}"
] | Open the provided filename as a keystore, creating if it doesn't exist and
the input create flag is true.
@param fileName
@param create
@return InputStream
@throws MalformedURLException
@throws IOException | [
"Open",
"the",
"provided",
"filename",
"as",
"a",
"keystore",
"creating",
"if",
"it",
"doesn",
"t",
"exist",
"and",
"the",
"input",
"create",
"flag",
"is",
"true",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/KeyStoreManager.java#L347-L364 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/KeyStoreManager.java | KeyStoreManager.getOutputStream | public OutputStream getOutputStream(String fileName) throws MalformedURLException, IOException {
try {
GetKeyStoreOutputStreamAction action = new GetKeyStoreOutputStreamAction(fileName);
return AccessController.doPrivileged(action);
} catch (PrivilegedActionException e) {
Exception ex = e.getException();
FFDCFilter.processException(e, getClass().getName(), "getOutputStream", new Object[] { fileName, this });
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "Exception opening keystore; " + ex);
if (ex instanceof MalformedURLException)
throw (MalformedURLException) ex;
else if (ex instanceof IOException)
throw (IOException) ex;
throw new IOException(ex.getMessage());
}
} | java | public OutputStream getOutputStream(String fileName) throws MalformedURLException, IOException {
try {
GetKeyStoreOutputStreamAction action = new GetKeyStoreOutputStreamAction(fileName);
return AccessController.doPrivileged(action);
} catch (PrivilegedActionException e) {
Exception ex = e.getException();
FFDCFilter.processException(e, getClass().getName(), "getOutputStream", new Object[] { fileName, this });
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "Exception opening keystore; " + ex);
if (ex instanceof MalformedURLException)
throw (MalformedURLException) ex;
else if (ex instanceof IOException)
throw (IOException) ex;
throw new IOException(ex.getMessage());
}
} | [
"public",
"OutputStream",
"getOutputStream",
"(",
"String",
"fileName",
")",
"throws",
"MalformedURLException",
",",
"IOException",
"{",
"try",
"{",
"GetKeyStoreOutputStreamAction",
"action",
"=",
"new",
"GetKeyStoreOutputStreamAction",
"(",
"fileName",
")",
";",
"return",
"AccessController",
".",
"doPrivileged",
"(",
"action",
")",
";",
"}",
"catch",
"(",
"PrivilegedActionException",
"e",
")",
"{",
"Exception",
"ex",
"=",
"e",
".",
"getException",
"(",
")",
";",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
",",
"\"getOutputStream\"",
",",
"new",
"Object",
"[",
"]",
"{",
"fileName",
",",
"this",
"}",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Exception opening keystore; \"",
"+",
"ex",
")",
";",
"if",
"(",
"ex",
"instanceof",
"MalformedURLException",
")",
"throw",
"(",
"MalformedURLException",
")",
"ex",
";",
"else",
"if",
"(",
"ex",
"instanceof",
"IOException",
")",
"throw",
"(",
"IOException",
")",
"ex",
";",
"throw",
"new",
"IOException",
"(",
"ex",
".",
"getMessage",
"(",
")",
")",
";",
"}",
"}"
] | Open the provided filename as an outputstream.
@param fileName
@return OutputStream
@throws MalformedURLException
@throws IOException | [
"Open",
"the",
"provided",
"filename",
"as",
"an",
"outputstream",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/KeyStoreManager.java#L428-L445 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/KeyStoreManager.java | KeyStoreManager.stripLastSlash | public static String stripLastSlash(String inputString) {
if (null == inputString) {
return null;
}
String rc = inputString.trim();
int len = rc.length();
if (0 < len) {
char lastChar = rc.charAt(len - 1);
if ('/' == lastChar || '\\' == lastChar) {
rc = rc.substring(0, len - 1);
}
}
return rc;
} | java | public static String stripLastSlash(String inputString) {
if (null == inputString) {
return null;
}
String rc = inputString.trim();
int len = rc.length();
if (0 < len) {
char lastChar = rc.charAt(len - 1);
if ('/' == lastChar || '\\' == lastChar) {
rc = rc.substring(0, len - 1);
}
}
return rc;
} | [
"public",
"static",
"String",
"stripLastSlash",
"(",
"String",
"inputString",
")",
"{",
"if",
"(",
"null",
"==",
"inputString",
")",
"{",
"return",
"null",
";",
"}",
"String",
"rc",
"=",
"inputString",
".",
"trim",
"(",
")",
";",
"int",
"len",
"=",
"rc",
".",
"length",
"(",
")",
";",
"if",
"(",
"0",
"<",
"len",
")",
"{",
"char",
"lastChar",
"=",
"rc",
".",
"charAt",
"(",
"len",
"-",
"1",
")",
";",
"if",
"(",
"'",
"'",
"==",
"lastChar",
"||",
"'",
"'",
"==",
"lastChar",
")",
"{",
"rc",
"=",
"rc",
".",
"substring",
"(",
"0",
",",
"len",
"-",
"1",
")",
";",
"}",
"}",
"return",
"rc",
";",
"}"
] | Remove the last slash, if present, from the input string and return the
result.
@param inputString
@return String | [
"Remove",
"the",
"last",
"slash",
"if",
"present",
"from",
"the",
"input",
"string",
"and",
"return",
"the",
"result",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/KeyStoreManager.java#L700-L714 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/KeyStoreManager.java | KeyStoreManager.getJavaKeyStore | public KeyStore getJavaKeyStore(String keyStoreName) throws Exception {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.entry(tc, "getJavaKeyStore: " + keyStoreName);
if (keyStoreName == null || keyStoreName.trim().isEmpty()) {
throw new SSLException("No keystore name provided.");
}
KeyStore javaKeyStore = null;
WSKeyStore ks = keyStoreMap.get(keyStoreName);
if (ks != null) {
javaKeyStore = ks.getKeyStore(false, false);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.exit(tc, "getJavaKeyStore: " + javaKeyStore);
return javaKeyStore;
} | java | public KeyStore getJavaKeyStore(String keyStoreName) throws Exception {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.entry(tc, "getJavaKeyStore: " + keyStoreName);
if (keyStoreName == null || keyStoreName.trim().isEmpty()) {
throw new SSLException("No keystore name provided.");
}
KeyStore javaKeyStore = null;
WSKeyStore ks = keyStoreMap.get(keyStoreName);
if (ks != null) {
javaKeyStore = ks.getKeyStore(false, false);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.exit(tc, "getJavaKeyStore: " + javaKeyStore);
return javaKeyStore;
} | [
"public",
"KeyStore",
"getJavaKeyStore",
"(",
"String",
"keyStoreName",
")",
"throws",
"Exception",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"getJavaKeyStore: \"",
"+",
"keyStoreName",
")",
";",
"if",
"(",
"keyStoreName",
"==",
"null",
"||",
"keyStoreName",
".",
"trim",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"SSLException",
"(",
"\"No keystore name provided.\"",
")",
";",
"}",
"KeyStore",
"javaKeyStore",
"=",
"null",
";",
"WSKeyStore",
"ks",
"=",
"keyStoreMap",
".",
"get",
"(",
"keyStoreName",
")",
";",
"if",
"(",
"ks",
"!=",
"null",
")",
"{",
"javaKeyStore",
"=",
"ks",
".",
"getKeyStore",
"(",
"false",
",",
"false",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"getJavaKeyStore: \"",
"+",
"javaKeyStore",
")",
";",
"return",
"javaKeyStore",
";",
"}"
] | Returns the java keystore object based on the keystore name passed in.
@param keyStoreName
@return KeyStore
@throws Exception | [
"Returns",
"the",
"java",
"keystore",
"object",
"based",
"on",
"the",
"keystore",
"name",
"passed",
"in",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/KeyStoreManager.java#L723-L740 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/KeyStoreManager.java | KeyStoreManager.getWSKeyStore | public WSKeyStore getWSKeyStore(String keyStoreName) throws SSLException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.entry(tc, "getWSKeyStore: " + keyStoreName);
if (keyStoreName == null) {
throw new SSLException("No keystore name provided.");
}
WSKeyStore ks = keyStoreMap.get(keyStoreName);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.exit(tc, "getWSKeyStore: " + ks);
return ks;
} | java | public WSKeyStore getWSKeyStore(String keyStoreName) throws SSLException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.entry(tc, "getWSKeyStore: " + keyStoreName);
if (keyStoreName == null) {
throw new SSLException("No keystore name provided.");
}
WSKeyStore ks = keyStoreMap.get(keyStoreName);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.exit(tc, "getWSKeyStore: " + ks);
return ks;
} | [
"public",
"WSKeyStore",
"getWSKeyStore",
"(",
"String",
"keyStoreName",
")",
"throws",
"SSLException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"getWSKeyStore: \"",
"+",
"keyStoreName",
")",
";",
"if",
"(",
"keyStoreName",
"==",
"null",
")",
"{",
"throw",
"new",
"SSLException",
"(",
"\"No keystore name provided.\"",
")",
";",
"}",
"WSKeyStore",
"ks",
"=",
"keyStoreMap",
".",
"get",
"(",
"keyStoreName",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"getWSKeyStore: \"",
"+",
"ks",
")",
";",
"return",
"ks",
";",
"}"
] | Returns the java keystore object based on the keystore name passed in. A
null value is returned if no existing store matchs the provided name.
@param keyStoreName
@return WSKeyStore
@throws SSLException
- if the input name is null | [
"Returns",
"the",
"java",
"keystore",
"object",
"based",
"on",
"the",
"keystore",
"name",
"passed",
"in",
".",
"A",
"null",
"value",
"is",
"returned",
"if",
"no",
"existing",
"store",
"matchs",
"the",
"provided",
"name",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/KeyStoreManager.java#L751-L764 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.cloudant/src/com/ibm/ws/cloudant/internal/CloudantService.java | CloudantService.getDependentApplications | @Override
public Set<String> getDependentApplications() {
Set<String> appsToStop = new HashSet<String>(applications);
applications.clear();
return appsToStop;
} | java | @Override
public Set<String> getDependentApplications() {
Set<String> appsToStop = new HashSet<String>(applications);
applications.clear();
return appsToStop;
} | [
"@",
"Override",
"public",
"Set",
"<",
"String",
">",
"getDependentApplications",
"(",
")",
"{",
"Set",
"<",
"String",
">",
"appsToStop",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
"applications",
")",
";",
"applications",
".",
"clear",
"(",
")",
";",
"return",
"appsToStop",
";",
"}"
] | Returns the list of applications that have used this resource so that the applications can be
stopped by the application recycle code in response to a configuration change. | [
"Returns",
"the",
"list",
"of",
"applications",
"that",
"have",
"used",
"this",
"resource",
"so",
"that",
"the",
"applications",
"can",
"be",
"stopped",
"by",
"the",
"application",
"recycle",
"code",
"in",
"response",
"to",
"a",
"configuration",
"change",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.cloudant/src/com/ibm/ws/cloudant/internal/CloudantService.java#L464-L469 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.cloudant/src/com/ibm/ws/cloudant/internal/CloudantService.java | CloudantService.set | @Trivial // do our own trace in order to selectively include the value
private <T extends Object> void set(Class<?> clazz, Object clientBuilder, String name, Class<T> type, T value) throws Exception {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(this, tc, name + '(' + (name.endsWith("ssword") ? "***" : value) + ')');
Method m;
// timeout properties take an additional parm for time unit
if ((type == long.class) && ((READ_TIMEOUT.equals(name) || CONNECT_TIMEOUT.equals(name)))) {
m = clazz.getMethod(name, type, TimeUnit.class);
m.invoke(clientBuilder, value, TimeUnit.MILLISECONDS);
} else {
m = clazz.getMethod(name, type);
m.invoke(clientBuilder, value);
}
} | java | @Trivial // do our own trace in order to selectively include the value
private <T extends Object> void set(Class<?> clazz, Object clientBuilder, String name, Class<T> type, T value) throws Exception {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(this, tc, name + '(' + (name.endsWith("ssword") ? "***" : value) + ')');
Method m;
// timeout properties take an additional parm for time unit
if ((type == long.class) && ((READ_TIMEOUT.equals(name) || CONNECT_TIMEOUT.equals(name)))) {
m = clazz.getMethod(name, type, TimeUnit.class);
m.invoke(clientBuilder, value, TimeUnit.MILLISECONDS);
} else {
m = clazz.getMethod(name, type);
m.invoke(clientBuilder, value);
}
} | [
"@",
"Trivial",
"// do our own trace in order to selectively include the value",
"private",
"<",
"T",
"extends",
"Object",
">",
"void",
"set",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"Object",
"clientBuilder",
",",
"String",
"name",
",",
"Class",
"<",
"T",
">",
"type",
",",
"T",
"value",
")",
"throws",
"Exception",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"name",
"+",
"'",
"'",
"+",
"(",
"name",
".",
"endsWith",
"(",
"\"ssword\"",
")",
"?",
"\"***\"",
":",
"value",
")",
"+",
"'",
"'",
")",
";",
"Method",
"m",
";",
"// timeout properties take an additional parm for time unit",
"if",
"(",
"(",
"type",
"==",
"long",
".",
"class",
")",
"&&",
"(",
"(",
"READ_TIMEOUT",
".",
"equals",
"(",
"name",
")",
"||",
"CONNECT_TIMEOUT",
".",
"equals",
"(",
"name",
")",
")",
")",
")",
"{",
"m",
"=",
"clazz",
".",
"getMethod",
"(",
"name",
",",
"type",
",",
"TimeUnit",
".",
"class",
")",
";",
"m",
".",
"invoke",
"(",
"clientBuilder",
",",
"value",
",",
"TimeUnit",
".",
"MILLISECONDS",
")",
";",
"}",
"else",
"{",
"m",
"=",
"clazz",
".",
"getMethod",
"(",
"name",
",",
"type",
")",
";",
"m",
".",
"invoke",
"(",
"clientBuilder",
",",
"value",
")",
";",
"}",
"}"
] | Method to reflectively invoke setters on the cloudant client builder
@param clazz client builder class
@param clientBuilder builder instance
@param name method to invoke
@param type argument type with which to invoke method
@param value argument value with which to invoke method, sensitive as password will be passed
@throws Exception if reflection methods fail | [
"Method",
"to",
"reflectively",
"invoke",
"setters",
"on",
"the",
"cloudant",
"client",
"builder"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.cloudant/src/com/ibm/ws/cloudant/internal/CloudantService.java#L506-L519 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.cloudant/src/com/ibm/ws/cloudant/internal/CloudantService.java | CloudantService.libraryNotification | @Override
public void libraryNotification() {
// Notify the application recycle coordinator of an incompatible change that requires restarting the application
if (!applications.isEmpty()) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(this, tc, "recycle applications", applications);
ApplicationRecycleCoordinator appRecycleCoord = (ApplicationRecycleCoordinator) componentContext.locateService("appRecycleCoordinator");
Set<String> members = new HashSet<String>(applications);
applications.removeAll(members);
appRecycleCoord.recycleApplications(members);
}
} | java | @Override
public void libraryNotification() {
// Notify the application recycle coordinator of an incompatible change that requires restarting the application
if (!applications.isEmpty()) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(this, tc, "recycle applications", applications);
ApplicationRecycleCoordinator appRecycleCoord = (ApplicationRecycleCoordinator) componentContext.locateService("appRecycleCoordinator");
Set<String> members = new HashSet<String>(applications);
applications.removeAll(members);
appRecycleCoord.recycleApplications(members);
}
} | [
"@",
"Override",
"public",
"void",
"libraryNotification",
"(",
")",
"{",
"// Notify the application recycle coordinator of an incompatible change that requires restarting the application",
"if",
"(",
"!",
"applications",
".",
"isEmpty",
"(",
")",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"recycle applications\"",
",",
"applications",
")",
";",
"ApplicationRecycleCoordinator",
"appRecycleCoord",
"=",
"(",
"ApplicationRecycleCoordinator",
")",
"componentContext",
".",
"locateService",
"(",
"\"appRecycleCoordinator\"",
")",
";",
"Set",
"<",
"String",
">",
"members",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
"applications",
")",
";",
"applications",
".",
"removeAll",
"(",
"members",
")",
";",
"appRecycleCoord",
".",
"recycleApplications",
"(",
"members",
")",
";",
"}",
"}"
] | Received when library is changed, for example by altering the files in the library. | [
"Received",
"when",
"library",
"is",
"changed",
"for",
"example",
"by",
"altering",
"the",
"files",
"in",
"the",
"library",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.cloudant/src/com/ibm/ws/cloudant/internal/CloudantService.java#L524-L535 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.cloudant/src/com/ibm/ws/cloudant/internal/CloudantService.java | CloudantService.getCloudantClient | public Object getCloudantClient(int resAuth, List<? extends ResourceInfo.Property> loginPropertyList) throws Exception {
AuthData containerAuthData = null;
if (resAuth == ResourceInfo.AUTH_CONTAINER) {
containerAuthData = getContainerAuthData(loginPropertyList);
}
String userName = containerAuthData == null ? (String) props.get(USERNAME) : containerAuthData.getUserName();
String password = null;
if (containerAuthData == null) {
SerializableProtectedString protectedPwd = (SerializableProtectedString) props.get(PASSWORD);
if (protectedPwd != null) {
password = String.valueOf(protectedPwd.getChars());
password = PasswordUtil.getCryptoAlgorithm(password) == null ? password : PasswordUtil.decode(password);
}
} else
password = String.valueOf(containerAuthData.getPassword());
final ClientKey key = new ClientKey(null, userName, password);
return clients.get(key);
} | java | public Object getCloudantClient(int resAuth, List<? extends ResourceInfo.Property> loginPropertyList) throws Exception {
AuthData containerAuthData = null;
if (resAuth == ResourceInfo.AUTH_CONTAINER) {
containerAuthData = getContainerAuthData(loginPropertyList);
}
String userName = containerAuthData == null ? (String) props.get(USERNAME) : containerAuthData.getUserName();
String password = null;
if (containerAuthData == null) {
SerializableProtectedString protectedPwd = (SerializableProtectedString) props.get(PASSWORD);
if (protectedPwd != null) {
password = String.valueOf(protectedPwd.getChars());
password = PasswordUtil.getCryptoAlgorithm(password) == null ? password : PasswordUtil.decode(password);
}
} else
password = String.valueOf(containerAuthData.getPassword());
final ClientKey key = new ClientKey(null, userName, password);
return clients.get(key);
} | [
"public",
"Object",
"getCloudantClient",
"(",
"int",
"resAuth",
",",
"List",
"<",
"?",
"extends",
"ResourceInfo",
".",
"Property",
">",
"loginPropertyList",
")",
"throws",
"Exception",
"{",
"AuthData",
"containerAuthData",
"=",
"null",
";",
"if",
"(",
"resAuth",
"==",
"ResourceInfo",
".",
"AUTH_CONTAINER",
")",
"{",
"containerAuthData",
"=",
"getContainerAuthData",
"(",
"loginPropertyList",
")",
";",
"}",
"String",
"userName",
"=",
"containerAuthData",
"==",
"null",
"?",
"(",
"String",
")",
"props",
".",
"get",
"(",
"USERNAME",
")",
":",
"containerAuthData",
".",
"getUserName",
"(",
")",
";",
"String",
"password",
"=",
"null",
";",
"if",
"(",
"containerAuthData",
"==",
"null",
")",
"{",
"SerializableProtectedString",
"protectedPwd",
"=",
"(",
"SerializableProtectedString",
")",
"props",
".",
"get",
"(",
"PASSWORD",
")",
";",
"if",
"(",
"protectedPwd",
"!=",
"null",
")",
"{",
"password",
"=",
"String",
".",
"valueOf",
"(",
"protectedPwd",
".",
"getChars",
"(",
")",
")",
";",
"password",
"=",
"PasswordUtil",
".",
"getCryptoAlgorithm",
"(",
"password",
")",
"==",
"null",
"?",
"password",
":",
"PasswordUtil",
".",
"decode",
"(",
"password",
")",
";",
"}",
"}",
"else",
"password",
"=",
"String",
".",
"valueOf",
"(",
"containerAuthData",
".",
"getPassword",
"(",
")",
")",
";",
"final",
"ClientKey",
"key",
"=",
"new",
"ClientKey",
"(",
"null",
",",
"userName",
",",
"password",
")",
";",
"return",
"clients",
".",
"get",
"(",
"key",
")",
";",
"}"
] | Return the cloudant client object used for a particular username and password
@param resAuth
@param loginPropertyList
@return CloudantClient object
@throws Exception | [
"Return",
"the",
"cloudant",
"client",
"object",
"used",
"for",
"a",
"particular",
"username",
"and",
"password"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.cloudant/src/com/ibm/ws/cloudant/internal/CloudantService.java#L618-L637 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/Semaphore.java | Semaphore.waitOn | public synchronized void waitOn() throws InterruptedException
{
if (tc.isEntryEnabled()) SibTr.entry(tc, "waitOn", ""+count);
++count;
if (count > 0)
{
try
{
wait();
}
catch(InterruptedException e)
{
// No FFDC code needed
--count;
throw e;
}
}
if (tc.isEntryEnabled()) SibTr.exit(tc, "waitOn");
} | java | public synchronized void waitOn() throws InterruptedException
{
if (tc.isEntryEnabled()) SibTr.entry(tc, "waitOn", ""+count);
++count;
if (count > 0)
{
try
{
wait();
}
catch(InterruptedException e)
{
// No FFDC code needed
--count;
throw e;
}
}
if (tc.isEntryEnabled()) SibTr.exit(tc, "waitOn");
} | [
"public",
"synchronized",
"void",
"waitOn",
"(",
")",
"throws",
"InterruptedException",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"waitOn\"",
",",
"\"\"",
"+",
"count",
")",
";",
"++",
"count",
";",
"if",
"(",
"count",
">",
"0",
")",
"{",
"try",
"{",
"wait",
"(",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"e",
")",
"{",
"// No FFDC code needed",
"--",
"count",
";",
"throw",
"e",
";",
"}",
"}",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"waitOn\"",
")",
";",
"}"
] | Wait for the semaphore to be posted
@see Semaphore#post()
@throws InterruptedException if the wait is interrupted rather than posted | [
"Wait",
"for",
"the",
"semaphore",
"to",
"be",
"posted"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/Semaphore.java#L54-L74 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/Semaphore.java | Semaphore.post | public synchronized void post()
{
if (tc.isEntryEnabled()) SibTr.entry(tc, "post", ""+count);
--count;
if (count >= 0)
notify();
if (tc.isEntryEnabled()) SibTr.exit(tc, "post");
} | java | public synchronized void post()
{
if (tc.isEntryEnabled()) SibTr.entry(tc, "post", ""+count);
--count;
if (count >= 0)
notify();
if (tc.isEntryEnabled()) SibTr.exit(tc, "post");
} | [
"public",
"synchronized",
"void",
"post",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"post\"",
",",
"\"\"",
"+",
"count",
")",
";",
"--",
"count",
";",
"if",
"(",
"count",
">=",
"0",
")",
"notify",
"(",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"post\"",
")",
";",
"}"
] | Post the semaphore waking up at most one waiter. If there are no
waiters, then the next thread issuing a waitOn call will not be
suspended. In fact, if post is invoked 'n' times then the next
'n' waitOn calls will not block.
@see Semaphore#waitOn() | [
"Post",
"the",
"semaphore",
"waking",
"up",
"at",
"most",
"one",
"waiter",
".",
"If",
"there",
"are",
"no",
"waiters",
"then",
"the",
"next",
"thread",
"issuing",
"a",
"waitOn",
"call",
"will",
"not",
"be",
"suspended",
".",
"In",
"fact",
"if",
"post",
"is",
"invoked",
"n",
"times",
"then",
"the",
"next",
"n",
"waitOn",
"calls",
"will",
"not",
"block",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/Semaphore.java#L83-L90 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/Semaphore.java | Semaphore.waitOnIgnoringInterruptions | public synchronized void waitOnIgnoringInterruptions()
{
if (tc.isEntryEnabled()) SibTr.entry(tc, "waitOnIgnoringInterruptions");
boolean interrupted;
do
{
interrupted = false;
try
{
waitOn();
}
catch (InterruptedException e)
{
// No FFDC code needed
interrupted = true;
}
}
while(interrupted);
if (tc.isEntryEnabled()) SibTr.exit(tc, "waitOnIgnoringInterruptions");
} | java | public synchronized void waitOnIgnoringInterruptions()
{
if (tc.isEntryEnabled()) SibTr.entry(tc, "waitOnIgnoringInterruptions");
boolean interrupted;
do
{
interrupted = false;
try
{
waitOn();
}
catch (InterruptedException e)
{
// No FFDC code needed
interrupted = true;
}
}
while(interrupted);
if (tc.isEntryEnabled()) SibTr.exit(tc, "waitOnIgnoringInterruptions");
} | [
"public",
"synchronized",
"void",
"waitOnIgnoringInterruptions",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"waitOnIgnoringInterruptions\"",
")",
";",
"boolean",
"interrupted",
";",
"do",
"{",
"interrupted",
"=",
"false",
";",
"try",
"{",
"waitOn",
"(",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"e",
")",
"{",
"// No FFDC code needed",
"interrupted",
"=",
"true",
";",
"}",
"}",
"while",
"(",
"interrupted",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"waitOnIgnoringInterruptions\"",
")",
";",
"}"
] | Wait on the semaphore ignoring any attempt to interrupt the thread.
@see Semaphore#waitOn() | [
"Wait",
"on",
"the",
"semaphore",
"ignoring",
"any",
"attempt",
"to",
"interrupt",
"the",
"thread",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/Semaphore.java#L96-L117 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/AbstractFaceletCache.java | AbstractFaceletCache.setMemberFactories | protected void setMemberFactories(FaceletCache.MemberFactory<V> faceletFactory,
FaceletCache.MemberFactory<V> viewMetadataFaceletFactory,
FaceletCache.MemberFactory<V> compositeComponentMetadataFaceletFactory)
{
if (compositeComponentMetadataFaceletFactory == null)
{
throw new NullPointerException("viewMetadataFaceletFactory is null");
}
_compositeComponentMetadataFaceletFactory = compositeComponentMetadataFaceletFactory;
setMemberFactories(faceletFactory, viewMetadataFaceletFactory);
} | java | protected void setMemberFactories(FaceletCache.MemberFactory<V> faceletFactory,
FaceletCache.MemberFactory<V> viewMetadataFaceletFactory,
FaceletCache.MemberFactory<V> compositeComponentMetadataFaceletFactory)
{
if (compositeComponentMetadataFaceletFactory == null)
{
throw new NullPointerException("viewMetadataFaceletFactory is null");
}
_compositeComponentMetadataFaceletFactory = compositeComponentMetadataFaceletFactory;
setMemberFactories(faceletFactory, viewMetadataFaceletFactory);
} | [
"protected",
"void",
"setMemberFactories",
"(",
"FaceletCache",
".",
"MemberFactory",
"<",
"V",
">",
"faceletFactory",
",",
"FaceletCache",
".",
"MemberFactory",
"<",
"V",
">",
"viewMetadataFaceletFactory",
",",
"FaceletCache",
".",
"MemberFactory",
"<",
"V",
">",
"compositeComponentMetadataFaceletFactory",
")",
"{",
"if",
"(",
"compositeComponentMetadataFaceletFactory",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"viewMetadataFaceletFactory is null\"",
")",
";",
"}",
"_compositeComponentMetadataFaceletFactory",
"=",
"compositeComponentMetadataFaceletFactory",
";",
"setMemberFactories",
"(",
"faceletFactory",
",",
"viewMetadataFaceletFactory",
")",
";",
"}"
] | Set the factories used for create Facelet instances.
@param faceletFactory
@param viewMetadataFaceletFactory
@param compositeComponentMetadataFaceletFactory | [
"Set",
"the",
"factories",
"used",
"for",
"create",
"Facelet",
"instances",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/AbstractFaceletCache.java#L78-L88 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTInputStream.java | SRTInputStream.close | @Override
public void close() throws IOException
{
if(this.in != null && this.inStream != null){
if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {
logger.logp(Level.FINE, CLASS_NAME,"close", "close called->"+this);
}
this.in.close();
}
else{
super.close();
}
} | java | @Override
public void close() throws IOException
{
if(this.in != null && this.inStream != null){
if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {
logger.logp(Level.FINE, CLASS_NAME,"close", "close called->"+this);
}
this.in.close();
}
else{
super.close();
}
} | [
"@",
"Override",
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"in",
"!=",
"null",
"&&",
"this",
".",
"inStream",
"!=",
"null",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"logger",
".",
"logp",
"(",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"\"close\"",
",",
"\"close called->\"",
"+",
"this",
")",
";",
"}",
"this",
".",
"in",
".",
"close",
"(",
")",
";",
"}",
"else",
"{",
"super",
".",
"close",
"(",
")",
";",
"}",
"}"
] | Following needed to support MultiRead | [
"Following",
"needed",
"to",
"support",
"MultiRead"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTInputStream.java#L84-L96 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/internal/ZipFileContainerFactory.java | ZipFileContainerFactory.createContainer | @Override
public ArtifactContainer createContainer(File cacheDir, Object containerData) {
if ( !(containerData instanceof File) ) {
return null;
}
File fileContainerData = (File) containerData;
if ( !FileUtils.fileIsFile(fileContainerData) ) {
return null;
}
if ( !isZip(fileContainerData) ) {
return null;
}
return new ZipFileContainer(cacheDir, fileContainerData, this);
} | java | @Override
public ArtifactContainer createContainer(File cacheDir, Object containerData) {
if ( !(containerData instanceof File) ) {
return null;
}
File fileContainerData = (File) containerData;
if ( !FileUtils.fileIsFile(fileContainerData) ) {
return null;
}
if ( !isZip(fileContainerData) ) {
return null;
}
return new ZipFileContainer(cacheDir, fileContainerData, this);
} | [
"@",
"Override",
"public",
"ArtifactContainer",
"createContainer",
"(",
"File",
"cacheDir",
",",
"Object",
"containerData",
")",
"{",
"if",
"(",
"!",
"(",
"containerData",
"instanceof",
"File",
")",
")",
"{",
"return",
"null",
";",
"}",
"File",
"fileContainerData",
"=",
"(",
"File",
")",
"containerData",
";",
"if",
"(",
"!",
"FileUtils",
".",
"fileIsFile",
"(",
"fileContainerData",
")",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"!",
"isZip",
"(",
"fileContainerData",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"new",
"ZipFileContainer",
"(",
"cacheDir",
",",
"fileContainerData",
",",
"this",
")",
";",
"}"
] | Attempt to create a root-of-roots zip file type container.
Anser null if the container data is not a file or is not a valid
zip file.
@return A new root-of-roots zip file type container. | [
"Attempt",
"to",
"create",
"a",
"root",
"-",
"of",
"-",
"roots",
"zip",
"file",
"type",
"container",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/internal/ZipFileContainerFactory.java#L185-L201 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/internal/ZipFileContainerFactory.java | ZipFileContainerFactory.createContainer | @Override
public ArtifactContainer createContainer(
File cacheDir,
ArtifactContainer enclosingContainer,
ArtifactEntry entryInEnclosingContainer,
Object containerData) {
if ( (containerData instanceof File) && FileUtils.fileIsFile((File) containerData) ) {
File fileContainerData = (File) containerData;
if ( isZip(fileContainerData) ) {
return new ZipFileContainer(
cacheDir,
enclosingContainer, entryInEnclosingContainer,
fileContainerData,
this);
} else {
return null;
}
} else {
if ( isZip(entryInEnclosingContainer) ) {
return new ZipFileContainer(
cacheDir,
enclosingContainer, entryInEnclosingContainer,
null,
this);
} else {
return null;
}
}
} | java | @Override
public ArtifactContainer createContainer(
File cacheDir,
ArtifactContainer enclosingContainer,
ArtifactEntry entryInEnclosingContainer,
Object containerData) {
if ( (containerData instanceof File) && FileUtils.fileIsFile((File) containerData) ) {
File fileContainerData = (File) containerData;
if ( isZip(fileContainerData) ) {
return new ZipFileContainer(
cacheDir,
enclosingContainer, entryInEnclosingContainer,
fileContainerData,
this);
} else {
return null;
}
} else {
if ( isZip(entryInEnclosingContainer) ) {
return new ZipFileContainer(
cacheDir,
enclosingContainer, entryInEnclosingContainer,
null,
this);
} else {
return null;
}
}
} | [
"@",
"Override",
"public",
"ArtifactContainer",
"createContainer",
"(",
"File",
"cacheDir",
",",
"ArtifactContainer",
"enclosingContainer",
",",
"ArtifactEntry",
"entryInEnclosingContainer",
",",
"Object",
"containerData",
")",
"{",
"if",
"(",
"(",
"containerData",
"instanceof",
"File",
")",
"&&",
"FileUtils",
".",
"fileIsFile",
"(",
"(",
"File",
")",
"containerData",
")",
")",
"{",
"File",
"fileContainerData",
"=",
"(",
"File",
")",
"containerData",
";",
"if",
"(",
"isZip",
"(",
"fileContainerData",
")",
")",
"{",
"return",
"new",
"ZipFileContainer",
"(",
"cacheDir",
",",
"enclosingContainer",
",",
"entryInEnclosingContainer",
",",
"fileContainerData",
",",
"this",
")",
";",
"}",
"else",
"{",
"return",
"null",
";",
"}",
"}",
"else",
"{",
"if",
"(",
"isZip",
"(",
"entryInEnclosingContainer",
")",
")",
"{",
"return",
"new",
"ZipFileContainer",
"(",
"cacheDir",
",",
"enclosingContainer",
",",
"entryInEnclosingContainer",
",",
"null",
",",
"this",
")",
";",
"}",
"else",
"{",
"return",
"null",
";",
"}",
"}",
"}"
] | Attempt to create an enclosed root zip file type container.
The entry from which the container is to be created must container
data for a zip file.
The container data, if supplied and a file, will be tested. Otherwise,
the supplied entry will be tested.
Answer null if the container data is a file but is not a zip file, or
if the entry is not a zip entry.
@return The new enclosed root zip file container. Null if the attempt
fails. | [
"Attempt",
"to",
"create",
"an",
"enclosed",
"root",
"zip",
"file",
"type",
"container",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/internal/ZipFileContainerFactory.java#L218-L248 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/internal/ZipFileContainerFactory.java | ZipFileContainerFactory.hasZipExtension | private static boolean hasZipExtension(String name) {
int nameLen = name.length();
// Need '.' plus at least three characters.
if ( nameLen < 4 ) {
return false;
}
// Need '.' plus at least six characters for ".spring".
if ( nameLen >= 7 ) {
if ( (name.charAt(nameLen - 7) == '.') &&
name.regionMatches(IGNORE_CASE, nameLen - 6, ZIP_EXTENSION_SPRING, 0, 6) ) {
return true;
}
}
if ( name.charAt(nameLen - 4) != '.' ) {
return false;
} else {
for ( String ext : ZIP_EXTENSIONS ) {
if ( name.regionMatches(IGNORE_CASE, nameLen - 3, ext, 0, 3) ) { // ignore case
return true;
}
}
return false;
}
// return name.matches("(?i:(.*)\\.(ZIP|[SEJRW]AR|E[BS]A|SPRING))");
} | java | private static boolean hasZipExtension(String name) {
int nameLen = name.length();
// Need '.' plus at least three characters.
if ( nameLen < 4 ) {
return false;
}
// Need '.' plus at least six characters for ".spring".
if ( nameLen >= 7 ) {
if ( (name.charAt(nameLen - 7) == '.') &&
name.regionMatches(IGNORE_CASE, nameLen - 6, ZIP_EXTENSION_SPRING, 0, 6) ) {
return true;
}
}
if ( name.charAt(nameLen - 4) != '.' ) {
return false;
} else {
for ( String ext : ZIP_EXTENSIONS ) {
if ( name.regionMatches(IGNORE_CASE, nameLen - 3, ext, 0, 3) ) { // ignore case
return true;
}
}
return false;
}
// return name.matches("(?i:(.*)\\.(ZIP|[SEJRW]AR|E[BS]A|SPRING))");
} | [
"private",
"static",
"boolean",
"hasZipExtension",
"(",
"String",
"name",
")",
"{",
"int",
"nameLen",
"=",
"name",
".",
"length",
"(",
")",
";",
"// Need '.' plus at least three characters.",
"if",
"(",
"nameLen",
"<",
"4",
")",
"{",
"return",
"false",
";",
"}",
"// Need '.' plus at least six characters for \".spring\".",
"if",
"(",
"nameLen",
">=",
"7",
")",
"{",
"if",
"(",
"(",
"name",
".",
"charAt",
"(",
"nameLen",
"-",
"7",
")",
"==",
"'",
"'",
")",
"&&",
"name",
".",
"regionMatches",
"(",
"IGNORE_CASE",
",",
"nameLen",
"-",
"6",
",",
"ZIP_EXTENSION_SPRING",
",",
"0",
",",
"6",
")",
")",
"{",
"return",
"true",
";",
"}",
"}",
"if",
"(",
"name",
".",
"charAt",
"(",
"nameLen",
"-",
"4",
")",
"!=",
"'",
"'",
")",
"{",
"return",
"false",
";",
"}",
"else",
"{",
"for",
"(",
"String",
"ext",
":",
"ZIP_EXTENSIONS",
")",
"{",
"if",
"(",
"name",
".",
"regionMatches",
"(",
"IGNORE_CASE",
",",
"nameLen",
"-",
"3",
",",
"ext",
",",
"0",
",",
"3",
")",
")",
"{",
"// ignore case",
"return",
"true",
";",
"}",
"}",
"return",
"false",
";",
"}",
"// return name.matches(\"(?i:(.*)\\\\.(ZIP|[SEJRW]AR|E[BS]A|SPRING))\");",
"}"
] | Tell if a file name has a zip file type extension.
These are: "jar", "zip", "ear", "war", "rar", "eba", "esa",
"sar", and "spring".
See also the service property "handlesEntry".
@param name The file name to test.
@return True or false telling if the file has one of the
zip file type extensions. | [
"Tell",
"if",
"a",
"file",
"name",
"has",
"a",
"zip",
"file",
"type",
"extension",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/internal/ZipFileContainerFactory.java#L282-L312 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/internal/ZipFileContainerFactory.java | ZipFileContainerFactory.isZip | private static boolean isZip(ArtifactEntry artifactEntry) {
if ( !hasZipExtension( artifactEntry.getName() ) ) {
return false;
}
boolean validZip = false;
InputStream entryInputStream = null;
try {
entryInputStream = artifactEntry.getInputStream();
if ( entryInputStream == null ) {
return false;
}
ZipInputStream zipInputStream = new ZipInputStream(entryInputStream);
try {
ZipEntry entry = zipInputStream.getNextEntry();
if ( entry == null ) {
Tr.error(tc, "bad.zip.data", getPhysicalPath(artifactEntry));
} else {
validZip = true;
}
} catch ( IOException e ) {
String entryPath = getPhysicalPath(artifactEntry);
Tr.error(tc, "bad.zip.data", entryPath);
}
try {
// attempt to close the zip, ignoring any error because we can't recover.
zipInputStream.close();
} catch (IOException ioe) {
// FFDC
}
} catch ( IOException e1 ) {
// FFDC
return false;
}
return validZip;
} | java | private static boolean isZip(ArtifactEntry artifactEntry) {
if ( !hasZipExtension( artifactEntry.getName() ) ) {
return false;
}
boolean validZip = false;
InputStream entryInputStream = null;
try {
entryInputStream = artifactEntry.getInputStream();
if ( entryInputStream == null ) {
return false;
}
ZipInputStream zipInputStream = new ZipInputStream(entryInputStream);
try {
ZipEntry entry = zipInputStream.getNextEntry();
if ( entry == null ) {
Tr.error(tc, "bad.zip.data", getPhysicalPath(artifactEntry));
} else {
validZip = true;
}
} catch ( IOException e ) {
String entryPath = getPhysicalPath(artifactEntry);
Tr.error(tc, "bad.zip.data", entryPath);
}
try {
// attempt to close the zip, ignoring any error because we can't recover.
zipInputStream.close();
} catch (IOException ioe) {
// FFDC
}
} catch ( IOException e1 ) {
// FFDC
return false;
}
return validZip;
} | [
"private",
"static",
"boolean",
"isZip",
"(",
"ArtifactEntry",
"artifactEntry",
")",
"{",
"if",
"(",
"!",
"hasZipExtension",
"(",
"artifactEntry",
".",
"getName",
"(",
")",
")",
")",
"{",
"return",
"false",
";",
"}",
"boolean",
"validZip",
"=",
"false",
";",
"InputStream",
"entryInputStream",
"=",
"null",
";",
"try",
"{",
"entryInputStream",
"=",
"artifactEntry",
".",
"getInputStream",
"(",
")",
";",
"if",
"(",
"entryInputStream",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"ZipInputStream",
"zipInputStream",
"=",
"new",
"ZipInputStream",
"(",
"entryInputStream",
")",
";",
"try",
"{",
"ZipEntry",
"entry",
"=",
"zipInputStream",
".",
"getNextEntry",
"(",
")",
";",
"if",
"(",
"entry",
"==",
"null",
")",
"{",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"bad.zip.data\"",
",",
"getPhysicalPath",
"(",
"artifactEntry",
")",
")",
";",
"}",
"else",
"{",
"validZip",
"=",
"true",
";",
"}",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"String",
"entryPath",
"=",
"getPhysicalPath",
"(",
"artifactEntry",
")",
";",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"bad.zip.data\"",
",",
"entryPath",
")",
";",
"}",
"try",
"{",
"// attempt to close the zip, ignoring any error because we can't recover.",
"zipInputStream",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"ioe",
")",
"{",
"// FFDC",
"}",
"}",
"catch",
"(",
"IOException",
"e1",
")",
"{",
"// FFDC",
"return",
"false",
";",
"}",
"return",
"validZip",
";",
"}"
] | Tell if an artifact entry is valid to be interpreted as a zip file
container.
The entry must have a valid zip file extension (see {@link #hasZipExtension}.
The entry must open as a {@link ZipInputStream}, and at least one entry
must be readable from that stream.
A zip stream is used instead of a zip file: Opening a zip file on the
entry would force the entry to be extracted, and would cause the table
of entries of the zip file to be loaded.
@param artifactEntry The entry to test as a zip file container.
@return True or false telling if the entry can be interpreted as
a zip file container. | [
"Tell",
"if",
"an",
"artifact",
"entry",
"is",
"valid",
"to",
"be",
"interpreted",
"as",
"a",
"zip",
"file",
"container",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/internal/ZipFileContainerFactory.java#L336-L375 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/internal/ZipFileContainerFactory.java | ZipFileContainerFactory.getPhysicalPath | @SuppressWarnings("deprecation")
private static String getPhysicalPath(ArtifactEntry artifactEntry) {
String physicalPath = artifactEntry.getPhysicalPath();
if ( physicalPath != null ) {
return physicalPath;
}
String entryPath = artifactEntry.getPath();
String rootPath = artifactEntry.getRoot().getPhysicalPath();
if ( rootPath != null ) {
return rootPath + "!" + entryPath;
}
while ( (artifactEntry = artifactEntry.getRoot().getEntryInEnclosingContainer()) != null ) {
String nextPhysicalPath = artifactEntry.getPhysicalPath();
if ( nextPhysicalPath != null ) {
return nextPhysicalPath + "!" + entryPath;
}
entryPath = artifactEntry.getPath() + "!" + entryPath;
}
return entryPath;
} | java | @SuppressWarnings("deprecation")
private static String getPhysicalPath(ArtifactEntry artifactEntry) {
String physicalPath = artifactEntry.getPhysicalPath();
if ( physicalPath != null ) {
return physicalPath;
}
String entryPath = artifactEntry.getPath();
String rootPath = artifactEntry.getRoot().getPhysicalPath();
if ( rootPath != null ) {
return rootPath + "!" + entryPath;
}
while ( (artifactEntry = artifactEntry.getRoot().getEntryInEnclosingContainer()) != null ) {
String nextPhysicalPath = artifactEntry.getPhysicalPath();
if ( nextPhysicalPath != null ) {
return nextPhysicalPath + "!" + entryPath;
}
entryPath = artifactEntry.getPath() + "!" + entryPath;
}
return entryPath;
} | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"private",
"static",
"String",
"getPhysicalPath",
"(",
"ArtifactEntry",
"artifactEntry",
")",
"{",
"String",
"physicalPath",
"=",
"artifactEntry",
".",
"getPhysicalPath",
"(",
")",
";",
"if",
"(",
"physicalPath",
"!=",
"null",
")",
"{",
"return",
"physicalPath",
";",
"}",
"String",
"entryPath",
"=",
"artifactEntry",
".",
"getPath",
"(",
")",
";",
"String",
"rootPath",
"=",
"artifactEntry",
".",
"getRoot",
"(",
")",
".",
"getPhysicalPath",
"(",
")",
";",
"if",
"(",
"rootPath",
"!=",
"null",
")",
"{",
"return",
"rootPath",
"+",
"\"!\"",
"+",
"entryPath",
";",
"}",
"while",
"(",
"(",
"artifactEntry",
"=",
"artifactEntry",
".",
"getRoot",
"(",
")",
".",
"getEntryInEnclosingContainer",
"(",
")",
")",
"!=",
"null",
")",
"{",
"String",
"nextPhysicalPath",
"=",
"artifactEntry",
".",
"getPhysicalPath",
"(",
")",
";",
"if",
"(",
"nextPhysicalPath",
"!=",
"null",
")",
"{",
"return",
"nextPhysicalPath",
"+",
"\"!\"",
"+",
"entryPath",
";",
"}",
"entryPath",
"=",
"artifactEntry",
".",
"getPath",
"(",
")",
"+",
"\"!\"",
"+",
"entryPath",
";",
"}",
"return",
"entryPath",
";",
"}"
] | Answer they physical path of an artifact entry.
If the entry has a physical path (for example, because it was
extracted), directly answer that path. In that case, the path
of the entry may be in a cache directory, and may not have a
relationship to enclosing containers physical path.
If the entry does not have a physical path, walk upwards until
an enclosing container has a physical path, then append the
path of enclosing entry which reaches the entry, placing "!"
after each enclosing path.
@param artifactEntry The entry for which to obtain a physical path.
@return The physical path of the entry. | [
"Answer",
"they",
"physical",
"path",
"of",
"an",
"artifact",
"entry",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/internal/ZipFileContainerFactory.java#L394-L416 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/internal/ZipFileContainerFactory.java | ZipFileContainerFactory.isZip | @FFDCIgnore( { IOException.class, FileNotFoundException.class } )
private static boolean isZip(File file) {
if ( !hasZipExtension( file.getName() ) ) {
return false;
}
InputStream inputStream = null;
try {
inputStream = new FileInputStream(file); // throws FileNotFoundException
ZipInputStream zipInputStream = new ZipInputStream(inputStream);
try {
ZipEntry entry = zipInputStream.getNextEntry(); // throws IOException
if ( entry == null ) {
Tr.error(tc, "bad.zip.data", file.getAbsolutePath());
return false;
}
return true;
} catch ( IOException e ) {
Tr.error(tc, "bad.zip.data", file.getAbsolutePath());
return false;
}
} catch ( FileNotFoundException e ) {
Tr.error(tc, "Missing zip file " + file.getAbsolutePath());
return false;
} finally {
if ( inputStream != null ) {
try {
inputStream.close();
} catch ( IOException e ) {
// IGNORE
}
}
}
} | java | @FFDCIgnore( { IOException.class, FileNotFoundException.class } )
private static boolean isZip(File file) {
if ( !hasZipExtension( file.getName() ) ) {
return false;
}
InputStream inputStream = null;
try {
inputStream = new FileInputStream(file); // throws FileNotFoundException
ZipInputStream zipInputStream = new ZipInputStream(inputStream);
try {
ZipEntry entry = zipInputStream.getNextEntry(); // throws IOException
if ( entry == null ) {
Tr.error(tc, "bad.zip.data", file.getAbsolutePath());
return false;
}
return true;
} catch ( IOException e ) {
Tr.error(tc, "bad.zip.data", file.getAbsolutePath());
return false;
}
} catch ( FileNotFoundException e ) {
Tr.error(tc, "Missing zip file " + file.getAbsolutePath());
return false;
} finally {
if ( inputStream != null ) {
try {
inputStream.close();
} catch ( IOException e ) {
// IGNORE
}
}
}
} | [
"@",
"FFDCIgnore",
"(",
"{",
"IOException",
".",
"class",
",",
"FileNotFoundException",
".",
"class",
"}",
")",
"private",
"static",
"boolean",
"isZip",
"(",
"File",
"file",
")",
"{",
"if",
"(",
"!",
"hasZipExtension",
"(",
"file",
".",
"getName",
"(",
")",
")",
")",
"{",
"return",
"false",
";",
"}",
"InputStream",
"inputStream",
"=",
"null",
";",
"try",
"{",
"inputStream",
"=",
"new",
"FileInputStream",
"(",
"file",
")",
";",
"// throws FileNotFoundException",
"ZipInputStream",
"zipInputStream",
"=",
"new",
"ZipInputStream",
"(",
"inputStream",
")",
";",
"try",
"{",
"ZipEntry",
"entry",
"=",
"zipInputStream",
".",
"getNextEntry",
"(",
")",
";",
"// throws IOException",
"if",
"(",
"entry",
"==",
"null",
")",
"{",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"bad.zip.data\"",
",",
"file",
".",
"getAbsolutePath",
"(",
")",
")",
";",
"return",
"false",
";",
"}",
"return",
"true",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"bad.zip.data\"",
",",
"file",
".",
"getAbsolutePath",
"(",
")",
")",
";",
"return",
"false",
";",
"}",
"}",
"catch",
"(",
"FileNotFoundException",
"e",
")",
"{",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"Missing zip file \"",
"+",
"file",
".",
"getAbsolutePath",
"(",
")",
")",
";",
"return",
"false",
";",
"}",
"finally",
"{",
"if",
"(",
"inputStream",
"!=",
"null",
")",
"{",
"try",
"{",
"inputStream",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"// IGNORE",
"}",
"}",
"}",
"}"
] | Tell if a file is valid to used to create a zip file container.
The file must have a valid zip file extension (see {@link #hasZipExtension}.
The file must open as a {@link ZipInputStream}, and at least one entry
must be readable from that stream.
A zip stream is used instead of a zip file: Opening a zip file on the
file would cause the table of entries of the zip file to be loaded.
@param file The file to test as a zip file container.
@return True or false telling if the file can be interpreted as
a zip file container. | [
"Tell",
"if",
"a",
"file",
"is",
"valid",
"to",
"used",
"to",
"create",
"a",
"zip",
"file",
"container",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.artifact.zip/src/com/ibm/ws/artifact/zip/internal/ZipFileContainerFactory.java#L434-L472 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.product.utility/src/com/ibm/ws/product/utility/extension/ifix/xml/UpdatedFile.java | UpdatedFile.fromNode | public static UpdatedFile fromNode(Node n) {
String id = n.getAttributes().getNamedItem("id") == null ? null : n.getAttributes().getNamedItem("id").getNodeValue();
long size = n.getAttributes().getNamedItem("size") == null ? null : Long.parseLong(n.getAttributes().getNamedItem("size").getNodeValue());
String date = n.getAttributes().getNamedItem("date") == null ? null : n.getAttributes().getNamedItem("date").getNodeValue();
String hash = n.getAttributes().getNamedItem("hash") == null ? n.getAttributes().getNamedItem("MD5hash") == null ? null : n.getAttributes().getNamedItem("MD5hash").getNodeValue() : n.getAttributes().getNamedItem("hash").getNodeValue();
return new UpdatedFile(id, size, date, hash);
} | java | public static UpdatedFile fromNode(Node n) {
String id = n.getAttributes().getNamedItem("id") == null ? null : n.getAttributes().getNamedItem("id").getNodeValue();
long size = n.getAttributes().getNamedItem("size") == null ? null : Long.parseLong(n.getAttributes().getNamedItem("size").getNodeValue());
String date = n.getAttributes().getNamedItem("date") == null ? null : n.getAttributes().getNamedItem("date").getNodeValue();
String hash = n.getAttributes().getNamedItem("hash") == null ? n.getAttributes().getNamedItem("MD5hash") == null ? null : n.getAttributes().getNamedItem("MD5hash").getNodeValue() : n.getAttributes().getNamedItem("hash").getNodeValue();
return new UpdatedFile(id, size, date, hash);
} | [
"public",
"static",
"UpdatedFile",
"fromNode",
"(",
"Node",
"n",
")",
"{",
"String",
"id",
"=",
"n",
".",
"getAttributes",
"(",
")",
".",
"getNamedItem",
"(",
"\"id\"",
")",
"==",
"null",
"?",
"null",
":",
"n",
".",
"getAttributes",
"(",
")",
".",
"getNamedItem",
"(",
"\"id\"",
")",
".",
"getNodeValue",
"(",
")",
";",
"long",
"size",
"=",
"n",
".",
"getAttributes",
"(",
")",
".",
"getNamedItem",
"(",
"\"size\"",
")",
"==",
"null",
"?",
"null",
":",
"Long",
".",
"parseLong",
"(",
"n",
".",
"getAttributes",
"(",
")",
".",
"getNamedItem",
"(",
"\"size\"",
")",
".",
"getNodeValue",
"(",
")",
")",
";",
"String",
"date",
"=",
"n",
".",
"getAttributes",
"(",
")",
".",
"getNamedItem",
"(",
"\"date\"",
")",
"==",
"null",
"?",
"null",
":",
"n",
".",
"getAttributes",
"(",
")",
".",
"getNamedItem",
"(",
"\"date\"",
")",
".",
"getNodeValue",
"(",
")",
";",
"String",
"hash",
"=",
"n",
".",
"getAttributes",
"(",
")",
".",
"getNamedItem",
"(",
"\"hash\"",
")",
"==",
"null",
"?",
"n",
".",
"getAttributes",
"(",
")",
".",
"getNamedItem",
"(",
"\"MD5hash\"",
")",
"==",
"null",
"?",
"null",
":",
"n",
".",
"getAttributes",
"(",
")",
".",
"getNamedItem",
"(",
"\"MD5hash\"",
")",
".",
"getNodeValue",
"(",
")",
":",
"n",
".",
"getAttributes",
"(",
")",
".",
"getNamedItem",
"(",
"\"hash\"",
")",
".",
"getNodeValue",
"(",
")",
";",
"return",
"new",
"UpdatedFile",
"(",
"id",
",",
"size",
",",
"date",
",",
"hash",
")",
";",
"}"
] | needs to support both hash and MD5hash as attributes | [
"needs",
"to",
"support",
"both",
"hash",
"and",
"MD5hash",
"as",
"attributes"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.product.utility/src/com/ibm/ws/product/utility/extension/ifix/xml/UpdatedFile.java#L17-L25 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca/src/com/ibm/ws/jca/service/JCAQuiesceListener.java | JCAQuiesceListener.serverStopping | @Override
public void serverStopping() {
BundleContext bundleContext = componentContext.getBundleContext();
Collection<ServiceReference<EndpointActivationService>> refs;
try {
refs = bundleContext.getServiceReferences(EndpointActivationService.class, null);
} catch (InvalidSyntaxException x) {
FFDCFilter.processException(x, getClass().getName(), "61", this);
throw new RuntimeException(x);
}
for (ServiceReference<EndpointActivationService> ref : refs) {
EndpointActivationService eas = bundleContext.getService(ref);
try {
for (ActivationParams a; null != (a = eas.endpointActivationParams.poll());)
try {
eas.endpointDeactivation((ActivationSpec) a.activationSpec, a.messageEndpointFactory);
} catch (Throwable x) {
FFDCFilter.processException(x, getClass().getName(), "71", this);
}
} finally {
bundleContext.ungetService(ref);
}
}
} | java | @Override
public void serverStopping() {
BundleContext bundleContext = componentContext.getBundleContext();
Collection<ServiceReference<EndpointActivationService>> refs;
try {
refs = bundleContext.getServiceReferences(EndpointActivationService.class, null);
} catch (InvalidSyntaxException x) {
FFDCFilter.processException(x, getClass().getName(), "61", this);
throw new RuntimeException(x);
}
for (ServiceReference<EndpointActivationService> ref : refs) {
EndpointActivationService eas = bundleContext.getService(ref);
try {
for (ActivationParams a; null != (a = eas.endpointActivationParams.poll());)
try {
eas.endpointDeactivation((ActivationSpec) a.activationSpec, a.messageEndpointFactory);
} catch (Throwable x) {
FFDCFilter.processException(x, getClass().getName(), "71", this);
}
} finally {
bundleContext.ungetService(ref);
}
}
} | [
"@",
"Override",
"public",
"void",
"serverStopping",
"(",
")",
"{",
"BundleContext",
"bundleContext",
"=",
"componentContext",
".",
"getBundleContext",
"(",
")",
";",
"Collection",
"<",
"ServiceReference",
"<",
"EndpointActivationService",
">",
">",
"refs",
";",
"try",
"{",
"refs",
"=",
"bundleContext",
".",
"getServiceReferences",
"(",
"EndpointActivationService",
".",
"class",
",",
"null",
")",
";",
"}",
"catch",
"(",
"InvalidSyntaxException",
"x",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"x",
",",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
",",
"\"61\"",
",",
"this",
")",
";",
"throw",
"new",
"RuntimeException",
"(",
"x",
")",
";",
"}",
"for",
"(",
"ServiceReference",
"<",
"EndpointActivationService",
">",
"ref",
":",
"refs",
")",
"{",
"EndpointActivationService",
"eas",
"=",
"bundleContext",
".",
"getService",
"(",
"ref",
")",
";",
"try",
"{",
"for",
"(",
"ActivationParams",
"a",
";",
"null",
"!=",
"(",
"a",
"=",
"eas",
".",
"endpointActivationParams",
".",
"poll",
"(",
")",
")",
";",
")",
"try",
"{",
"eas",
".",
"endpointDeactivation",
"(",
"(",
"ActivationSpec",
")",
"a",
".",
"activationSpec",
",",
"a",
".",
"messageEndpointFactory",
")",
";",
"}",
"catch",
"(",
"Throwable",
"x",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"x",
",",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
",",
"\"71\"",
",",
"this",
")",
";",
"}",
"}",
"finally",
"{",
"bundleContext",
".",
"ungetService",
"(",
"ref",
")",
";",
"}",
"}",
"}"
] | Invoked when server is quiescing. Deactivate all endpoints. | [
"Invoked",
"when",
"server",
"is",
"quiescing",
".",
"Deactivate",
"all",
"endpoints",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca/src/com/ibm/ws/jca/service/JCAQuiesceListener.java#L54-L77 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/filters/SubscriptionFilter.java | SubscriptionFilter.filterMatches | public boolean filterMatches(AbstractItem item)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "filterMatches", item);
/* Cast the incoming item to a PersistentStoreReferenceStream object. if it is not, an
* exception will be thrown and the match will fail */
SIMPReferenceStream rstream;
if (item instanceof SIMPReferenceStream) {
rstream = (SIMPReferenceStream) item;
// Check for matching consumer dispatchers
if (rstream == consumerDispatcher.getReferenceStream())
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "filterMatches", Boolean.TRUE);
return true;
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "filterMatches", Boolean.FALSE);
return false;
} | java | public boolean filterMatches(AbstractItem item)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "filterMatches", item);
/* Cast the incoming item to a PersistentStoreReferenceStream object. if it is not, an
* exception will be thrown and the match will fail */
SIMPReferenceStream rstream;
if (item instanceof SIMPReferenceStream) {
rstream = (SIMPReferenceStream) item;
// Check for matching consumer dispatchers
if (rstream == consumerDispatcher.getReferenceStream())
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "filterMatches", Boolean.TRUE);
return true;
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "filterMatches", Boolean.FALSE);
return false;
} | [
"public",
"boolean",
"filterMatches",
"(",
"AbstractItem",
"item",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"filterMatches\"",
",",
"item",
")",
";",
"/* Cast the incoming item to a PersistentStoreReferenceStream object. if it is not, an\n * exception will be thrown and the match will fail */",
"SIMPReferenceStream",
"rstream",
";",
"if",
"(",
"item",
"instanceof",
"SIMPReferenceStream",
")",
"{",
"rstream",
"=",
"(",
"SIMPReferenceStream",
")",
"item",
";",
"// Check for matching consumer dispatchers",
"if",
"(",
"rstream",
"==",
"consumerDispatcher",
".",
"getReferenceStream",
"(",
")",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"filterMatches\"",
",",
"Boolean",
".",
"TRUE",
")",
";",
"return",
"true",
";",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"filterMatches\"",
",",
"Boolean",
".",
"FALSE",
")",
";",
"return",
"false",
";",
"}"
] | Filter method. Checks whether the given item is a consumerDispatcher and matches the
one associated with this filter
@param item - The item on the itemstream
@return boolean - True if a match, false otherwise. | [
"Filter",
"method",
".",
"Checks",
"whether",
"the",
"given",
"item",
"is",
"a",
"consumerDispatcher",
"and",
"matches",
"the",
"one",
"associated",
"with",
"this",
"filter"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/filters/SubscriptionFilter.java#L68-L95 | train |
OpenLiberty/open-liberty | dev/com.ibm.websphere.javaee.jsf.2.3/src/javax/faces/validator/BeanValidator.java | BeanValidator.createValidatorFactory | private ValidatorFactory createValidatorFactory(FacesContext context)
{
Map<String, Object> applicationMap = context.getExternalContext().getApplicationMap();
Object attr = applicationMap.get(VALIDATOR_FACTORY_KEY);
if (attr instanceof ValidatorFactory)
{
return (ValidatorFactory) attr;
}
else
{
synchronized (this)
{
if (_ExternalSpecifications.isBeanValidationAvailable())
{
ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
applicationMap.put(VALIDATOR_FACTORY_KEY, factory);
return factory;
}
else
{
throw new FacesException("Bean Validation is not present");
}
}
}
} | java | private ValidatorFactory createValidatorFactory(FacesContext context)
{
Map<String, Object> applicationMap = context.getExternalContext().getApplicationMap();
Object attr = applicationMap.get(VALIDATOR_FACTORY_KEY);
if (attr instanceof ValidatorFactory)
{
return (ValidatorFactory) attr;
}
else
{
synchronized (this)
{
if (_ExternalSpecifications.isBeanValidationAvailable())
{
ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
applicationMap.put(VALIDATOR_FACTORY_KEY, factory);
return factory;
}
else
{
throw new FacesException("Bean Validation is not present");
}
}
}
} | [
"private",
"ValidatorFactory",
"createValidatorFactory",
"(",
"FacesContext",
"context",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"applicationMap",
"=",
"context",
".",
"getExternalContext",
"(",
")",
".",
"getApplicationMap",
"(",
")",
";",
"Object",
"attr",
"=",
"applicationMap",
".",
"get",
"(",
"VALIDATOR_FACTORY_KEY",
")",
";",
"if",
"(",
"attr",
"instanceof",
"ValidatorFactory",
")",
"{",
"return",
"(",
"ValidatorFactory",
")",
"attr",
";",
"}",
"else",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"_ExternalSpecifications",
".",
"isBeanValidationAvailable",
"(",
")",
")",
"{",
"ValidatorFactory",
"factory",
"=",
"Validation",
".",
"buildDefaultValidatorFactory",
"(",
")",
";",
"applicationMap",
".",
"put",
"(",
"VALIDATOR_FACTORY_KEY",
",",
"factory",
")",
";",
"return",
"factory",
";",
"}",
"else",
"{",
"throw",
"new",
"FacesException",
"(",
"\"Bean Validation is not present\"",
")",
";",
"}",
"}",
"}",
"}"
] | This method creates ValidatorFactory instances or retrieves them from the container.
Once created, ValidatorFactory instances are stored in the container under the key
VALIDATOR_FACTORY_KEY for performance.
@param context The FacesContext.
@return The ValidatorFactory instance.
@throws FacesException if no ValidatorFactory can be obtained because: a) the
container is not a Servlet container or b) because Bean Validation is not available. | [
"This",
"method",
"creates",
"ValidatorFactory",
"instances",
"or",
"retrieves",
"them",
"from",
"the",
"container",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.javaee.jsf.2.3/src/javax/faces/validator/BeanValidator.java#L327-L351 | train |
OpenLiberty/open-liberty | dev/com.ibm.websphere.javaee.jsf.2.3/src/javax/faces/validator/BeanValidator.java | BeanValidator.postSetValidationGroups | private void postSetValidationGroups()
{
if (this.validationGroups == null || this.validationGroups.matches(EMPTY_VALIDATION_GROUPS_PATTERN))
{
this.validationGroupsArray = DEFAULT_VALIDATION_GROUPS_ARRAY;
}
else
{
String[] classes = this.validationGroups.split(VALIDATION_GROUPS_DELIMITER);
List<Class<?>> validationGroupsList = new ArrayList<Class<?>>(classes.length);
for (String clazz : classes)
{
clazz = clazz.trim();
if (!clazz.isEmpty())
{
Class<?> theClass = null;
ClassLoader cl = null;
if (System.getSecurityManager() != null)
{
try
{
cl = AccessController.doPrivileged(new PrivilegedExceptionAction<ClassLoader>()
{
public ClassLoader run() throws PrivilegedActionException
{
return Thread.currentThread().getContextClassLoader();
}
});
}
catch (PrivilegedActionException pae)
{
throw new FacesException(pae);
}
}
else
{
cl = Thread.currentThread().getContextClassLoader();
}
try
{
// Try WebApp ClassLoader first
theClass = Class.forName(clazz,false,cl);
}
catch (ClassNotFoundException ignore)
{
try
{
// fallback: Try ClassLoader for BeanValidator (i.e. the myfaces.jar lib)
theClass = Class.forName(clazz,false, BeanValidator.class.getClassLoader());
}
catch (ClassNotFoundException e)
{
throw new RuntimeException("Could not load validation group", e);
}
}
// the class was found
validationGroupsList.add(theClass);
}
}
this.validationGroupsArray = validationGroupsList.toArray(new Class[validationGroupsList.size()]);
}
} | java | private void postSetValidationGroups()
{
if (this.validationGroups == null || this.validationGroups.matches(EMPTY_VALIDATION_GROUPS_PATTERN))
{
this.validationGroupsArray = DEFAULT_VALIDATION_GROUPS_ARRAY;
}
else
{
String[] classes = this.validationGroups.split(VALIDATION_GROUPS_DELIMITER);
List<Class<?>> validationGroupsList = new ArrayList<Class<?>>(classes.length);
for (String clazz : classes)
{
clazz = clazz.trim();
if (!clazz.isEmpty())
{
Class<?> theClass = null;
ClassLoader cl = null;
if (System.getSecurityManager() != null)
{
try
{
cl = AccessController.doPrivileged(new PrivilegedExceptionAction<ClassLoader>()
{
public ClassLoader run() throws PrivilegedActionException
{
return Thread.currentThread().getContextClassLoader();
}
});
}
catch (PrivilegedActionException pae)
{
throw new FacesException(pae);
}
}
else
{
cl = Thread.currentThread().getContextClassLoader();
}
try
{
// Try WebApp ClassLoader first
theClass = Class.forName(clazz,false,cl);
}
catch (ClassNotFoundException ignore)
{
try
{
// fallback: Try ClassLoader for BeanValidator (i.e. the myfaces.jar lib)
theClass = Class.forName(clazz,false, BeanValidator.class.getClassLoader());
}
catch (ClassNotFoundException e)
{
throw new RuntimeException("Could not load validation group", e);
}
}
// the class was found
validationGroupsList.add(theClass);
}
}
this.validationGroupsArray = validationGroupsList.toArray(new Class[validationGroupsList.size()]);
}
} | [
"private",
"void",
"postSetValidationGroups",
"(",
")",
"{",
"if",
"(",
"this",
".",
"validationGroups",
"==",
"null",
"||",
"this",
".",
"validationGroups",
".",
"matches",
"(",
"EMPTY_VALIDATION_GROUPS_PATTERN",
")",
")",
"{",
"this",
".",
"validationGroupsArray",
"=",
"DEFAULT_VALIDATION_GROUPS_ARRAY",
";",
"}",
"else",
"{",
"String",
"[",
"]",
"classes",
"=",
"this",
".",
"validationGroups",
".",
"split",
"(",
"VALIDATION_GROUPS_DELIMITER",
")",
";",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"validationGroupsList",
"=",
"new",
"ArrayList",
"<",
"Class",
"<",
"?",
">",
">",
"(",
"classes",
".",
"length",
")",
";",
"for",
"(",
"String",
"clazz",
":",
"classes",
")",
"{",
"clazz",
"=",
"clazz",
".",
"trim",
"(",
")",
";",
"if",
"(",
"!",
"clazz",
".",
"isEmpty",
"(",
")",
")",
"{",
"Class",
"<",
"?",
">",
"theClass",
"=",
"null",
";",
"ClassLoader",
"cl",
"=",
"null",
";",
"if",
"(",
"System",
".",
"getSecurityManager",
"(",
")",
"!=",
"null",
")",
"{",
"try",
"{",
"cl",
"=",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedExceptionAction",
"<",
"ClassLoader",
">",
"(",
")",
"{",
"public",
"ClassLoader",
"run",
"(",
")",
"throws",
"PrivilegedActionException",
"{",
"return",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getContextClassLoader",
"(",
")",
";",
"}",
"}",
")",
";",
"}",
"catch",
"(",
"PrivilegedActionException",
"pae",
")",
"{",
"throw",
"new",
"FacesException",
"(",
"pae",
")",
";",
"}",
"}",
"else",
"{",
"cl",
"=",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getContextClassLoader",
"(",
")",
";",
"}",
"try",
"{",
"// Try WebApp ClassLoader first",
"theClass",
"=",
"Class",
".",
"forName",
"(",
"clazz",
",",
"false",
",",
"cl",
")",
";",
"}",
"catch",
"(",
"ClassNotFoundException",
"ignore",
")",
"{",
"try",
"{",
"// fallback: Try ClassLoader for BeanValidator (i.e. the myfaces.jar lib)",
"theClass",
"=",
"Class",
".",
"forName",
"(",
"clazz",
",",
"false",
",",
"BeanValidator",
".",
"class",
".",
"getClassLoader",
"(",
")",
")",
";",
"}",
"catch",
"(",
"ClassNotFoundException",
"e",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Could not load validation group\"",
",",
"e",
")",
";",
"}",
"}",
"// the class was found",
"validationGroupsList",
".",
"add",
"(",
"theClass",
")",
";",
"}",
"}",
"this",
".",
"validationGroupsArray",
"=",
"validationGroupsList",
".",
"toArray",
"(",
"new",
"Class",
"[",
"validationGroupsList",
".",
"size",
"(",
")",
"]",
")",
";",
"}",
"}"
] | Fully initialize the validation groups if needed.
If no validation groups are specified, the Default validation group is used. | [
"Fully",
"initialize",
"the",
"validation",
"groups",
"if",
"needed",
".",
"If",
"no",
"validation",
"groups",
"are",
"specified",
"the",
"Default",
"validation",
"group",
"is",
"used",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.javaee.jsf.2.3/src/javax/faces/validator/BeanValidator.java#L357-L421 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSEnum.java | JSEnum.setEnumerators | public void setEnumerators(String[] val) {
enumerators = val;
enumeratorCount = (enumerators != null) ? enumerators.length : 0;
} | java | public void setEnumerators(String[] val) {
enumerators = val;
enumeratorCount = (enumerators != null) ? enumerators.length : 0;
} | [
"public",
"void",
"setEnumerators",
"(",
"String",
"[",
"]",
"val",
")",
"{",
"enumerators",
"=",
"val",
";",
"enumeratorCount",
"=",
"(",
"enumerators",
"!=",
"null",
")",
"?",
"enumerators",
".",
"length",
":",
"0",
";",
"}"
] | Set the enumerators in the order of their assigned codes | [
"Set",
"the",
"enumerators",
"in",
"the",
"order",
"of",
"their",
"assigned",
"codes"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSEnum.java#L61-L64 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSEnum.java | JSEnum.encodeType | public void encodeType(byte[] frame, int[] limits) {
setByte(frame, limits, (byte)ENUM);
setCount(frame, limits, enumeratorCount);
} | java | public void encodeType(byte[] frame, int[] limits) {
setByte(frame, limits, (byte)ENUM);
setCount(frame, limits, enumeratorCount);
} | [
"public",
"void",
"encodeType",
"(",
"byte",
"[",
"]",
"frame",
",",
"int",
"[",
"]",
"limits",
")",
"{",
"setByte",
"(",
"frame",
",",
"limits",
",",
"(",
"byte",
")",
"ENUM",
")",
";",
"setCount",
"(",
"frame",
",",
"limits",
",",
"enumeratorCount",
")",
";",
"}"
] | propagate the enumeratorCount. | [
"propagate",
"the",
"enumeratorCount",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSEnum.java#L131-L134 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSEnum.java | JSEnum.format | public void format(StringBuffer fmt, Set done, Set todo, int indent) {
formatName(fmt, indent);
fmt.append("Enum");
if (enumerators != null) {
fmt.append("{{");
String delim = "";
for (int i = 0; i < enumerators.length; i++) {
fmt.append(delim).append(enumerators[i]);
delim = ",";
}
fmt.append("}}");
}
} | java | public void format(StringBuffer fmt, Set done, Set todo, int indent) {
formatName(fmt, indent);
fmt.append("Enum");
if (enumerators != null) {
fmt.append("{{");
String delim = "";
for (int i = 0; i < enumerators.length; i++) {
fmt.append(delim).append(enumerators[i]);
delim = ",";
}
fmt.append("}}");
}
} | [
"public",
"void",
"format",
"(",
"StringBuffer",
"fmt",
",",
"Set",
"done",
",",
"Set",
"todo",
",",
"int",
"indent",
")",
"{",
"formatName",
"(",
"fmt",
",",
"indent",
")",
";",
"fmt",
".",
"append",
"(",
"\"Enum\"",
")",
";",
"if",
"(",
"enumerators",
"!=",
"null",
")",
"{",
"fmt",
".",
"append",
"(",
"\"{{\"",
")",
";",
"String",
"delim",
"=",
"\"\"",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"enumerators",
".",
"length",
";",
"i",
"++",
")",
"{",
"fmt",
".",
"append",
"(",
"delim",
")",
".",
"append",
"(",
"enumerators",
"[",
"i",
"]",
")",
";",
"delim",
"=",
"\",\"",
";",
"}",
"fmt",
".",
"append",
"(",
"\"}}\"",
")",
";",
"}",
"}"
] | Format for printing. | [
"Format",
"for",
"printing",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSEnum.java#L137-L149 | train |
OpenLiberty/open-liberty | dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/validator/BeanValidator.java | _ValueReferenceResolver.resolve | public static _ValueReferenceWrapper resolve(ValueExpression valueExpression, final ELContext elCtx)
{
_ValueReferenceResolver resolver = new _ValueReferenceResolver(elCtx.getELResolver());
ELContext elCtxDecorator = new _ELContextDecorator(elCtx, resolver);
valueExpression.getValue(elCtxDecorator);
while (resolver.lastObject.getBase() instanceof CompositeComponentExpressionHolder)
{
valueExpression = ((CompositeComponentExpressionHolder) resolver.lastObject.getBase())
.getExpression((String) resolver.lastObject.getProperty());
valueExpression.getValue(elCtxDecorator);
}
return resolver.lastObject;
} | java | public static _ValueReferenceWrapper resolve(ValueExpression valueExpression, final ELContext elCtx)
{
_ValueReferenceResolver resolver = new _ValueReferenceResolver(elCtx.getELResolver());
ELContext elCtxDecorator = new _ELContextDecorator(elCtx, resolver);
valueExpression.getValue(elCtxDecorator);
while (resolver.lastObject.getBase() instanceof CompositeComponentExpressionHolder)
{
valueExpression = ((CompositeComponentExpressionHolder) resolver.lastObject.getBase())
.getExpression((String) resolver.lastObject.getProperty());
valueExpression.getValue(elCtxDecorator);
}
return resolver.lastObject;
} | [
"public",
"static",
"_ValueReferenceWrapper",
"resolve",
"(",
"ValueExpression",
"valueExpression",
",",
"final",
"ELContext",
"elCtx",
")",
"{",
"_ValueReferenceResolver",
"resolver",
"=",
"new",
"_ValueReferenceResolver",
"(",
"elCtx",
".",
"getELResolver",
"(",
")",
")",
";",
"ELContext",
"elCtxDecorator",
"=",
"new",
"_ELContextDecorator",
"(",
"elCtx",
",",
"resolver",
")",
";",
"valueExpression",
".",
"getValue",
"(",
"elCtxDecorator",
")",
";",
"while",
"(",
"resolver",
".",
"lastObject",
".",
"getBase",
"(",
")",
"instanceof",
"CompositeComponentExpressionHolder",
")",
"{",
"valueExpression",
"=",
"(",
"(",
"CompositeComponentExpressionHolder",
")",
"resolver",
".",
"lastObject",
".",
"getBase",
"(",
")",
")",
".",
"getExpression",
"(",
"(",
"String",
")",
"resolver",
".",
"lastObject",
".",
"getProperty",
"(",
")",
")",
";",
"valueExpression",
".",
"getValue",
"(",
"elCtxDecorator",
")",
";",
"}",
"return",
"resolver",
".",
"lastObject",
";",
"}"
] | This method can be used to extract the ValueReferenceWrapper from the given ValueExpression.
@param valueExpression The ValueExpression to resolve.
@param elCtx The ELContext, needed to parse and execute the expression.
@return The ValueReferenceWrapper. | [
"This",
"method",
"can",
"be",
"used",
"to",
"extract",
"the",
"ValueReferenceWrapper",
"from",
"the",
"given",
"ValueExpression",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/validator/BeanValidator.java#L592-L607 | train |
OpenLiberty/open-liberty | dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/validator/BeanValidator.java | _ValueReferenceResolver.getValue | @Override
public Object getValue(final ELContext context, final Object base, final Object property)
{
lastObject = new _ValueReferenceWrapper(base, property);
return resolver.getValue(context, base, property);
} | java | @Override
public Object getValue(final ELContext context, final Object base, final Object property)
{
lastObject = new _ValueReferenceWrapper(base, property);
return resolver.getValue(context, base, property);
} | [
"@",
"Override",
"public",
"Object",
"getValue",
"(",
"final",
"ELContext",
"context",
",",
"final",
"Object",
"base",
",",
"final",
"Object",
"property",
")",
"{",
"lastObject",
"=",
"new",
"_ValueReferenceWrapper",
"(",
"base",
",",
"property",
")",
";",
"return",
"resolver",
".",
"getValue",
"(",
"context",
",",
"base",
",",
"property",
")",
";",
"}"
] | This method is the only one that matters. It keeps track of the objects in the EL expression.
It creates a new ValueReferenceWrapper and assigns it to lastObject.
@param context The ELContext.
@param base The base object, may be null.
@param property The property, may be null.
@return The resolved value | [
"This",
"method",
"is",
"the",
"only",
"one",
"that",
"matters",
".",
"It",
"keeps",
"track",
"of",
"the",
"objects",
"in",
"the",
"EL",
"expression",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/validator/BeanValidator.java#L619-L624 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/AsyncMethodWrapper.java | AsyncMethodWrapper.isApplicationException | private boolean isApplicationException(Throwable ex, EJBMethodInfoImpl methodInfo) {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(tc, "isApplicationException : " + ex.getClass().getName() + ", " + methodInfo);
// d660332
if (ex instanceof Exception && (!ContainerProperties.DeclaredUncheckedAreSystemExceptions || !(ex instanceof RuntimeException))) {
Class<?>[] declaredExceptions = null;
// Checks if the method interface is business or component.
// If it's a component interface, there is only one interface to worry about // d734957
if (ivInterface == WrapperInterface.LOCAL || ivInterface == WrapperInterface.REMOTE) {
declaredExceptions = methodInfo.ivDeclaredExceptionsComp;
} else {
// Determine if there were any declared exceptions for the method
// interface being used. However, if the wrapper is an aggregate
// wrapper (all interfaces), then just find the first set of
// non-null declared exceptions. It is possible (thought not likely)
// this could result in odd behavior, but a warning was logged
// when the wrapper class was created. F743-34304
if (ivBusinessInterfaceIndex == AGGREGATE_LOCAL_INDEX) {
for (Class<?>[] declaredEx : methodInfo.ivDeclaredExceptions) {
if (declaredEx != null) {
declaredExceptions = declaredEx;
break;
}
}
} else {
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "ivBusinessInterfaceIndex=" + ivBusinessInterfaceIndex);
declaredExceptions = methodInfo.ivDeclaredExceptions[ivBusinessInterfaceIndex]; // F743-24429
}
}
if (declaredExceptions != null) {
for (Class<?> declaredException : declaredExceptions) {
if (declaredException.isAssignableFrom(ex.getClass())) {
if (isTraceOn && tc.isEntryEnabled())
Tr.exit(tc, "isApplicationException : true");
return true;
}
}
}
}
if (isTraceOn && tc.isEntryEnabled())
Tr.exit(tc, "isApplicationException : false");
return false;
} | java | private boolean isApplicationException(Throwable ex, EJBMethodInfoImpl methodInfo) {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(tc, "isApplicationException : " + ex.getClass().getName() + ", " + methodInfo);
// d660332
if (ex instanceof Exception && (!ContainerProperties.DeclaredUncheckedAreSystemExceptions || !(ex instanceof RuntimeException))) {
Class<?>[] declaredExceptions = null;
// Checks if the method interface is business or component.
// If it's a component interface, there is only one interface to worry about // d734957
if (ivInterface == WrapperInterface.LOCAL || ivInterface == WrapperInterface.REMOTE) {
declaredExceptions = methodInfo.ivDeclaredExceptionsComp;
} else {
// Determine if there were any declared exceptions for the method
// interface being used. However, if the wrapper is an aggregate
// wrapper (all interfaces), then just find the first set of
// non-null declared exceptions. It is possible (thought not likely)
// this could result in odd behavior, but a warning was logged
// when the wrapper class was created. F743-34304
if (ivBusinessInterfaceIndex == AGGREGATE_LOCAL_INDEX) {
for (Class<?>[] declaredEx : methodInfo.ivDeclaredExceptions) {
if (declaredEx != null) {
declaredExceptions = declaredEx;
break;
}
}
} else {
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "ivBusinessInterfaceIndex=" + ivBusinessInterfaceIndex);
declaredExceptions = methodInfo.ivDeclaredExceptions[ivBusinessInterfaceIndex]; // F743-24429
}
}
if (declaredExceptions != null) {
for (Class<?> declaredException : declaredExceptions) {
if (declaredException.isAssignableFrom(ex.getClass())) {
if (isTraceOn && tc.isEntryEnabled())
Tr.exit(tc, "isApplicationException : true");
return true;
}
}
}
}
if (isTraceOn && tc.isEntryEnabled())
Tr.exit(tc, "isApplicationException : false");
return false;
} | [
"private",
"boolean",
"isApplicationException",
"(",
"Throwable",
"ex",
",",
"EJBMethodInfoImpl",
"methodInfo",
")",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"isApplicationException : \"",
"+",
"ex",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
"+",
"\", \"",
"+",
"methodInfo",
")",
";",
"// d660332",
"if",
"(",
"ex",
"instanceof",
"Exception",
"&&",
"(",
"!",
"ContainerProperties",
".",
"DeclaredUncheckedAreSystemExceptions",
"||",
"!",
"(",
"ex",
"instanceof",
"RuntimeException",
")",
")",
")",
"{",
"Class",
"<",
"?",
">",
"[",
"]",
"declaredExceptions",
"=",
"null",
";",
"// Checks if the method interface is business or component.",
"// If it's a component interface, there is only one interface to worry about // d734957",
"if",
"(",
"ivInterface",
"==",
"WrapperInterface",
".",
"LOCAL",
"||",
"ivInterface",
"==",
"WrapperInterface",
".",
"REMOTE",
")",
"{",
"declaredExceptions",
"=",
"methodInfo",
".",
"ivDeclaredExceptionsComp",
";",
"}",
"else",
"{",
"// Determine if there were any declared exceptions for the method",
"// interface being used. However, if the wrapper is an aggregate",
"// wrapper (all interfaces), then just find the first set of",
"// non-null declared exceptions. It is possible (thought not likely)",
"// this could result in odd behavior, but a warning was logged",
"// when the wrapper class was created. F743-34304",
"if",
"(",
"ivBusinessInterfaceIndex",
"==",
"AGGREGATE_LOCAL_INDEX",
")",
"{",
"for",
"(",
"Class",
"<",
"?",
">",
"[",
"]",
"declaredEx",
":",
"methodInfo",
".",
"ivDeclaredExceptions",
")",
"{",
"if",
"(",
"declaredEx",
"!=",
"null",
")",
"{",
"declaredExceptions",
"=",
"declaredEx",
";",
"break",
";",
"}",
"}",
"}",
"else",
"{",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"ivBusinessInterfaceIndex=\"",
"+",
"ivBusinessInterfaceIndex",
")",
";",
"declaredExceptions",
"=",
"methodInfo",
".",
"ivDeclaredExceptions",
"[",
"ivBusinessInterfaceIndex",
"]",
";",
"// F743-24429",
"}",
"}",
"if",
"(",
"declaredExceptions",
"!=",
"null",
")",
"{",
"for",
"(",
"Class",
"<",
"?",
">",
"declaredException",
":",
"declaredExceptions",
")",
"{",
"if",
"(",
"declaredException",
".",
"isAssignableFrom",
"(",
"ex",
".",
"getClass",
"(",
")",
")",
")",
"{",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"isApplicationException : true\"",
")",
";",
"return",
"true",
";",
"}",
"}",
"}",
"}",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"isApplicationException : false\"",
")",
";",
"return",
"false",
";",
"}"
] | F743-761 | [
"F743",
"-",
"761"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/AsyncMethodWrapper.java#L283-L332 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/ra/inbound/impl/SibRaDynamicDestinationEndpointActivation.java | SibRaDynamicDestinationEndpointActivation.addMessagingEngine | synchronized protected void addMessagingEngine(
final JsMessagingEngine messagingEngine) {
final String methodName = "addMessagingEngine";
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.entry(this, TRACE, methodName, messagingEngine);
}
SibRaMessagingEngineConnection connection = null;
try {
/*
* Get a connection for the messaging engine
*/
connection = getConnection(messagingEngine);
final SICoreConnection coreConnection = connection.getConnection();
if (coreConnection instanceof SICoreConnection) {
/*
* Create destination listener
*/
final DestinationListener destinationListener = new SibRaDestinationListener(
connection, _messageEndpointFactory);
/*
* Determine destination type
*/
final DestinationType destinationType = _endpointConfiguration
.getDestinationType();
/*
* Register destination listener
*/
final SIDestinationAddress[] destinations = coreConnection
.addDestinationListener(null,
destinationListener,
destinationType,
DestinationAvailability.RECEIVE);
/*
* Create a listener for each destination ...
*/
for (int j = 0; j < destinations.length; j++) {
try {
connection.createListener(destinations[j], _messageEndpointFactory);
} catch (final ResourceException exception) {
FFDCFilter.processException(exception, CLASS_NAME + "."
+ methodName, FFDC_PROBE_1, this);
SibTr.error(TRACE, "CREATE_LISTENER_FAILED_CWSIV0803",
new Object[] { exception,
destinations[j].getDestinationName(),
messagingEngine.getName(),
messagingEngine.getBusName() });
}
}
}
} catch (final SIException exception) {
FFDCFilter.processException(exception, CLASS_NAME + "."
+ methodName, FFDC_PROBE_2, this);
SibTr.error(TRACE, "ADD_DESTINATION_LISTENER_FAILED_CWSIV0804",
new Object[] { exception, messagingEngine.getName(),
messagingEngine.getBusName() });
closeConnection(messagingEngine);
} catch (final ResourceException exception) {
FFDCFilter.processException(exception, CLASS_NAME + "."
+ methodName, FFDC_PROBE_3, this);
SibTr.error(TRACE, "CREATE_CONNECTION_FAILED_CWSIV0801",
new Object[] { exception, messagingEngine.getName(),
messagingEngine.getBusName() });
closeConnection(messagingEngine);
}
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.exit(this, TRACE, methodName);
}
} | java | synchronized protected void addMessagingEngine(
final JsMessagingEngine messagingEngine) {
final String methodName = "addMessagingEngine";
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.entry(this, TRACE, methodName, messagingEngine);
}
SibRaMessagingEngineConnection connection = null;
try {
/*
* Get a connection for the messaging engine
*/
connection = getConnection(messagingEngine);
final SICoreConnection coreConnection = connection.getConnection();
if (coreConnection instanceof SICoreConnection) {
/*
* Create destination listener
*/
final DestinationListener destinationListener = new SibRaDestinationListener(
connection, _messageEndpointFactory);
/*
* Determine destination type
*/
final DestinationType destinationType = _endpointConfiguration
.getDestinationType();
/*
* Register destination listener
*/
final SIDestinationAddress[] destinations = coreConnection
.addDestinationListener(null,
destinationListener,
destinationType,
DestinationAvailability.RECEIVE);
/*
* Create a listener for each destination ...
*/
for (int j = 0; j < destinations.length; j++) {
try {
connection.createListener(destinations[j], _messageEndpointFactory);
} catch (final ResourceException exception) {
FFDCFilter.processException(exception, CLASS_NAME + "."
+ methodName, FFDC_PROBE_1, this);
SibTr.error(TRACE, "CREATE_LISTENER_FAILED_CWSIV0803",
new Object[] { exception,
destinations[j].getDestinationName(),
messagingEngine.getName(),
messagingEngine.getBusName() });
}
}
}
} catch (final SIException exception) {
FFDCFilter.processException(exception, CLASS_NAME + "."
+ methodName, FFDC_PROBE_2, this);
SibTr.error(TRACE, "ADD_DESTINATION_LISTENER_FAILED_CWSIV0804",
new Object[] { exception, messagingEngine.getName(),
messagingEngine.getBusName() });
closeConnection(messagingEngine);
} catch (final ResourceException exception) {
FFDCFilter.processException(exception, CLASS_NAME + "."
+ methodName, FFDC_PROBE_3, this);
SibTr.error(TRACE, "CREATE_CONNECTION_FAILED_CWSIV0801",
new Object[] { exception, messagingEngine.getName(),
messagingEngine.getBusName() });
closeConnection(messagingEngine);
}
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.exit(this, TRACE, methodName);
}
} | [
"synchronized",
"protected",
"void",
"addMessagingEngine",
"(",
"final",
"JsMessagingEngine",
"messagingEngine",
")",
"{",
"final",
"String",
"methodName",
"=",
"\"addMessagingEngine\"",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"TRACE",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"this",
",",
"TRACE",
",",
"methodName",
",",
"messagingEngine",
")",
";",
"}",
"SibRaMessagingEngineConnection",
"connection",
"=",
"null",
";",
"try",
"{",
"/*\n * Get a connection for the messaging engine\n */",
"connection",
"=",
"getConnection",
"(",
"messagingEngine",
")",
";",
"final",
"SICoreConnection",
"coreConnection",
"=",
"connection",
".",
"getConnection",
"(",
")",
";",
"if",
"(",
"coreConnection",
"instanceof",
"SICoreConnection",
")",
"{",
"/*\n * Create destination listener\n */",
"final",
"DestinationListener",
"destinationListener",
"=",
"new",
"SibRaDestinationListener",
"(",
"connection",
",",
"_messageEndpointFactory",
")",
";",
"/*\n * Determine destination type\n */",
"final",
"DestinationType",
"destinationType",
"=",
"_endpointConfiguration",
".",
"getDestinationType",
"(",
")",
";",
"/*\n * Register destination listener\n */",
"final",
"SIDestinationAddress",
"[",
"]",
"destinations",
"=",
"coreConnection",
".",
"addDestinationListener",
"(",
"null",
",",
"destinationListener",
",",
"destinationType",
",",
"DestinationAvailability",
".",
"RECEIVE",
")",
";",
"/*\n * Create a listener for each destination ...\n */",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"destinations",
".",
"length",
";",
"j",
"++",
")",
"{",
"try",
"{",
"connection",
".",
"createListener",
"(",
"destinations",
"[",
"j",
"]",
",",
"_messageEndpointFactory",
")",
";",
"}",
"catch",
"(",
"final",
"ResourceException",
"exception",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"exception",
",",
"CLASS_NAME",
"+",
"\".\"",
"+",
"methodName",
",",
"FFDC_PROBE_1",
",",
"this",
")",
";",
"SibTr",
".",
"error",
"(",
"TRACE",
",",
"\"CREATE_LISTENER_FAILED_CWSIV0803\"",
",",
"new",
"Object",
"[",
"]",
"{",
"exception",
",",
"destinations",
"[",
"j",
"]",
".",
"getDestinationName",
"(",
")",
",",
"messagingEngine",
".",
"getName",
"(",
")",
",",
"messagingEngine",
".",
"getBusName",
"(",
")",
"}",
")",
";",
"}",
"}",
"}",
"}",
"catch",
"(",
"final",
"SIException",
"exception",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"exception",
",",
"CLASS_NAME",
"+",
"\".\"",
"+",
"methodName",
",",
"FFDC_PROBE_2",
",",
"this",
")",
";",
"SibTr",
".",
"error",
"(",
"TRACE",
",",
"\"ADD_DESTINATION_LISTENER_FAILED_CWSIV0804\"",
",",
"new",
"Object",
"[",
"]",
"{",
"exception",
",",
"messagingEngine",
".",
"getName",
"(",
")",
",",
"messagingEngine",
".",
"getBusName",
"(",
")",
"}",
")",
";",
"closeConnection",
"(",
"messagingEngine",
")",
";",
"}",
"catch",
"(",
"final",
"ResourceException",
"exception",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"exception",
",",
"CLASS_NAME",
"+",
"\".\"",
"+",
"methodName",
",",
"FFDC_PROBE_3",
",",
"this",
")",
";",
"SibTr",
".",
"error",
"(",
"TRACE",
",",
"\"CREATE_CONNECTION_FAILED_CWSIV0801\"",
",",
"new",
"Object",
"[",
"]",
"{",
"exception",
",",
"messagingEngine",
".",
"getName",
"(",
")",
",",
"messagingEngine",
".",
"getBusName",
"(",
")",
"}",
")",
";",
"closeConnection",
"(",
"messagingEngine",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"TRACE",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"exit",
"(",
"this",
",",
"TRACE",
",",
"methodName",
")",
";",
"}",
"}"
] | Connects to the given messaging engine. Registers a destination listener
and creates listeners for each of the current destinations.
@param messagingEngine
the messaging engine to connect to | [
"Connects",
"to",
"the",
"given",
"messaging",
"engine",
".",
"Registers",
"a",
"destination",
"listener",
"and",
"creates",
"listeners",
"for",
"each",
"of",
"the",
"current",
"destinations",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/ra/inbound/impl/SibRaDynamicDestinationEndpointActivation.java#L130-L224 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/notification/ClientNotificationArea.java | ClientNotificationArea.addNotfication | public void addNotfication(Notification notification) {
Object source = notification.getSource();
NotificationRecord nr;
if (source instanceof ObjectName) {
nr = new NotificationRecord(notification, (ObjectName) source);
} else {
nr = new NotificationRecord(notification, (source != null) ? source.toString() : null);
}
addNotficationRecord(nr);
} | java | public void addNotfication(Notification notification) {
Object source = notification.getSource();
NotificationRecord nr;
if (source instanceof ObjectName) {
nr = new NotificationRecord(notification, (ObjectName) source);
} else {
nr = new NotificationRecord(notification, (source != null) ? source.toString() : null);
}
addNotficationRecord(nr);
} | [
"public",
"void",
"addNotfication",
"(",
"Notification",
"notification",
")",
"{",
"Object",
"source",
"=",
"notification",
".",
"getSource",
"(",
")",
";",
"NotificationRecord",
"nr",
";",
"if",
"(",
"source",
"instanceof",
"ObjectName",
")",
"{",
"nr",
"=",
"new",
"NotificationRecord",
"(",
"notification",
",",
"(",
"ObjectName",
")",
"source",
")",
";",
"}",
"else",
"{",
"nr",
"=",
"new",
"NotificationRecord",
"(",
"notification",
",",
"(",
"source",
"!=",
"null",
")",
"?",
"source",
".",
"toString",
"(",
")",
":",
"null",
")",
";",
"}",
"addNotficationRecord",
"(",
"nr",
")",
";",
"}"
] | This method will be called by the NotificationListener once the MBeanServer pushes a notification. | [
"This",
"method",
"will",
"be",
"called",
"by",
"the",
"NotificationListener",
"once",
"the",
"MBeanServer",
"pushes",
"a",
"notification",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/notification/ClientNotificationArea.java#L146-L155 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/notification/ClientNotificationArea.java | ClientNotificationArea.addClientNotificationListener | public void addClientNotificationListener(RESTRequest request, NotificationRegistration notificationRegistration, JSONConverter converter) {
String objectNameStr = notificationRegistration.objectName.getCanonicalName();
NotificationTargetInformation nti = toNotificationTargetInformation(request, objectNameStr);
// Get the listener
ClientNotificationListener listener = listeners.get(nti);
if (listener == null) {
listener = new ClientNotificationListener(this);
ClientNotificationListener mapListener = listeners.putIfAbsent(nti, listener);
if (mapListener != null) {
listener = mapListener;
}
}
// Grab the wrapper filter which will be registered in the MBeanServer
NotificationFilter filter = listener.getClientWrapperFilter();
// Check whether the producer of the notification is local or remote.
if (nti.getRoutingInformation() == null) {
// Add the notification in the MBeanServer
MBeanServerHelper.addClientNotification(notificationRegistration.objectName,
listener,
filter,
null,
converter);
} else {
// Add the notification listener to the Target-Client Manager through EventAdmin
MBeanRoutedNotificationHelper helper = MBeanRoutedNotificationHelper.getMBeanRoutedNotificationHelper();
helper.addRoutedNotificationListener(nti, listener, converter);
}
// Add the filters to the listener
listener.addClientNotification(notificationRegistration.filters);
} | java | public void addClientNotificationListener(RESTRequest request, NotificationRegistration notificationRegistration, JSONConverter converter) {
String objectNameStr = notificationRegistration.objectName.getCanonicalName();
NotificationTargetInformation nti = toNotificationTargetInformation(request, objectNameStr);
// Get the listener
ClientNotificationListener listener = listeners.get(nti);
if (listener == null) {
listener = new ClientNotificationListener(this);
ClientNotificationListener mapListener = listeners.putIfAbsent(nti, listener);
if (mapListener != null) {
listener = mapListener;
}
}
// Grab the wrapper filter which will be registered in the MBeanServer
NotificationFilter filter = listener.getClientWrapperFilter();
// Check whether the producer of the notification is local or remote.
if (nti.getRoutingInformation() == null) {
// Add the notification in the MBeanServer
MBeanServerHelper.addClientNotification(notificationRegistration.objectName,
listener,
filter,
null,
converter);
} else {
// Add the notification listener to the Target-Client Manager through EventAdmin
MBeanRoutedNotificationHelper helper = MBeanRoutedNotificationHelper.getMBeanRoutedNotificationHelper();
helper.addRoutedNotificationListener(nti, listener, converter);
}
// Add the filters to the listener
listener.addClientNotification(notificationRegistration.filters);
} | [
"public",
"void",
"addClientNotificationListener",
"(",
"RESTRequest",
"request",
",",
"NotificationRegistration",
"notificationRegistration",
",",
"JSONConverter",
"converter",
")",
"{",
"String",
"objectNameStr",
"=",
"notificationRegistration",
".",
"objectName",
".",
"getCanonicalName",
"(",
")",
";",
"NotificationTargetInformation",
"nti",
"=",
"toNotificationTargetInformation",
"(",
"request",
",",
"objectNameStr",
")",
";",
"// Get the listener",
"ClientNotificationListener",
"listener",
"=",
"listeners",
".",
"get",
"(",
"nti",
")",
";",
"if",
"(",
"listener",
"==",
"null",
")",
"{",
"listener",
"=",
"new",
"ClientNotificationListener",
"(",
"this",
")",
";",
"ClientNotificationListener",
"mapListener",
"=",
"listeners",
".",
"putIfAbsent",
"(",
"nti",
",",
"listener",
")",
";",
"if",
"(",
"mapListener",
"!=",
"null",
")",
"{",
"listener",
"=",
"mapListener",
";",
"}",
"}",
"// Grab the wrapper filter which will be registered in the MBeanServer",
"NotificationFilter",
"filter",
"=",
"listener",
".",
"getClientWrapperFilter",
"(",
")",
";",
"// Check whether the producer of the notification is local or remote.",
"if",
"(",
"nti",
".",
"getRoutingInformation",
"(",
")",
"==",
"null",
")",
"{",
"// Add the notification in the MBeanServer ",
"MBeanServerHelper",
".",
"addClientNotification",
"(",
"notificationRegistration",
".",
"objectName",
",",
"listener",
",",
"filter",
",",
"null",
",",
"converter",
")",
";",
"}",
"else",
"{",
"// Add the notification listener to the Target-Client Manager through EventAdmin",
"MBeanRoutedNotificationHelper",
"helper",
"=",
"MBeanRoutedNotificationHelper",
".",
"getMBeanRoutedNotificationHelper",
"(",
")",
";",
"helper",
".",
"addRoutedNotificationListener",
"(",
"nti",
",",
"listener",
",",
"converter",
")",
";",
"}",
"// Add the filters to the listener",
"listener",
".",
"addClientNotification",
"(",
"notificationRegistration",
".",
"filters",
")",
";",
"}"
] | Fetch or create a new listener for the given object name | [
"Fetch",
"or",
"create",
"a",
"new",
"listener",
"for",
"the",
"given",
"object",
"name"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/notification/ClientNotificationArea.java#L225-L260 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/notification/ClientNotificationArea.java | ClientNotificationArea.updateClientNotificationListener | public void updateClientNotificationListener(RESTRequest request, String objectNameStr, NotificationFilter[] filters, JSONConverter converter) {
NotificationTargetInformation nti = toNotificationTargetInformation(request, objectNameStr);
ClientNotificationListener listener = listeners.get(nti);
if (listener == null) {
throw ErrorHelper.createRESTHandlerJsonException(new RuntimeException("There are no listeners registered for " + nti), converter, APIConstants.STATUS_BAD_REQUEST);
}
//Make the update
listener.addClientNotification(filters);
} | java | public void updateClientNotificationListener(RESTRequest request, String objectNameStr, NotificationFilter[] filters, JSONConverter converter) {
NotificationTargetInformation nti = toNotificationTargetInformation(request, objectNameStr);
ClientNotificationListener listener = listeners.get(nti);
if (listener == null) {
throw ErrorHelper.createRESTHandlerJsonException(new RuntimeException("There are no listeners registered for " + nti), converter, APIConstants.STATUS_BAD_REQUEST);
}
//Make the update
listener.addClientNotification(filters);
} | [
"public",
"void",
"updateClientNotificationListener",
"(",
"RESTRequest",
"request",
",",
"String",
"objectNameStr",
",",
"NotificationFilter",
"[",
"]",
"filters",
",",
"JSONConverter",
"converter",
")",
"{",
"NotificationTargetInformation",
"nti",
"=",
"toNotificationTargetInformation",
"(",
"request",
",",
"objectNameStr",
")",
";",
"ClientNotificationListener",
"listener",
"=",
"listeners",
".",
"get",
"(",
"nti",
")",
";",
"if",
"(",
"listener",
"==",
"null",
")",
"{",
"throw",
"ErrorHelper",
".",
"createRESTHandlerJsonException",
"(",
"new",
"RuntimeException",
"(",
"\"There are no listeners registered for \"",
"+",
"nti",
")",
",",
"converter",
",",
"APIConstants",
".",
"STATUS_BAD_REQUEST",
")",
";",
"}",
"//Make the update",
"listener",
".",
"addClientNotification",
"(",
"filters",
")",
";",
"}"
] | Update the listener for the given object name with the provided filters | [
"Update",
"the",
"listener",
"for",
"the",
"given",
"object",
"name",
"with",
"the",
"provided",
"filters"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/notification/ClientNotificationArea.java#L265-L276 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/notification/ClientNotificationArea.java | ClientNotificationArea.removeObject | private Object removeObject(Integer key) {
if (key == null) {
return null;
}
return objectLibrary.remove(key);
} | java | private Object removeObject(Integer key) {
if (key == null) {
return null;
}
return objectLibrary.remove(key);
} | [
"private",
"Object",
"removeObject",
"(",
"Integer",
"key",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"objectLibrary",
".",
"remove",
"(",
"key",
")",
";",
"}"
] | Only to be used by removal coming from direct-http calls, because calls from the jmx client
can still reference this key for other notifications. | [
"Only",
"to",
"be",
"used",
"by",
"removal",
"coming",
"from",
"direct",
"-",
"http",
"calls",
"because",
"calls",
"from",
"the",
"jmx",
"client",
"can",
"still",
"reference",
"this",
"key",
"for",
"other",
"notifications",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/notification/ClientNotificationArea.java#L309-L314 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/notification/ClientNotificationArea.java | ClientNotificationArea.removeClientNotificationListener | public void removeClientNotificationListener(RESTRequest request, ObjectName name) {
NotificationTargetInformation nti = toNotificationTargetInformation(request, name.getCanonicalName());
// Remove locally
ClientNotificationListener listener = listeners.remove(nti);
// Check whether the producer of the notification is local or remote.
if (nti.getRoutingInformation() == null) {
// Remove the notification from the MBeanServer
MBeanServerHelper.removeClientNotification(name, listener);
} else {
// Remove the notification listener from the Target-Client Manager through EventAdmin
MBeanRoutedNotificationHelper helper = MBeanRoutedNotificationHelper.getMBeanRoutedNotificationHelper();
helper.removeRoutedNotificationListener(nti, listener);
}
} | java | public void removeClientNotificationListener(RESTRequest request, ObjectName name) {
NotificationTargetInformation nti = toNotificationTargetInformation(request, name.getCanonicalName());
// Remove locally
ClientNotificationListener listener = listeners.remove(nti);
// Check whether the producer of the notification is local or remote.
if (nti.getRoutingInformation() == null) {
// Remove the notification from the MBeanServer
MBeanServerHelper.removeClientNotification(name, listener);
} else {
// Remove the notification listener from the Target-Client Manager through EventAdmin
MBeanRoutedNotificationHelper helper = MBeanRoutedNotificationHelper.getMBeanRoutedNotificationHelper();
helper.removeRoutedNotificationListener(nti, listener);
}
} | [
"public",
"void",
"removeClientNotificationListener",
"(",
"RESTRequest",
"request",
",",
"ObjectName",
"name",
")",
"{",
"NotificationTargetInformation",
"nti",
"=",
"toNotificationTargetInformation",
"(",
"request",
",",
"name",
".",
"getCanonicalName",
"(",
")",
")",
";",
"// Remove locally",
"ClientNotificationListener",
"listener",
"=",
"listeners",
".",
"remove",
"(",
"nti",
")",
";",
"// Check whether the producer of the notification is local or remote.",
"if",
"(",
"nti",
".",
"getRoutingInformation",
"(",
")",
"==",
"null",
")",
"{",
"// Remove the notification from the MBeanServer",
"MBeanServerHelper",
".",
"removeClientNotification",
"(",
"name",
",",
"listener",
")",
";",
"}",
"else",
"{",
"// Remove the notification listener from the Target-Client Manager through EventAdmin",
"MBeanRoutedNotificationHelper",
"helper",
"=",
"MBeanRoutedNotificationHelper",
".",
"getMBeanRoutedNotificationHelper",
"(",
")",
";",
"helper",
".",
"removeRoutedNotificationListener",
"(",
"nti",
",",
"listener",
")",
";",
"}",
"}"
] | Remove the given NotificationListener | [
"Remove",
"the",
"given",
"NotificationListener"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/notification/ClientNotificationArea.java#L354-L369 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/notification/ClientNotificationArea.java | ClientNotificationArea.addServerNotificationListener | public void addServerNotificationListener(RESTRequest request, ServerNotificationRegistration serverNotificationRegistration, JSONConverter converter) {
NotificationTargetInformation nti = toNotificationTargetInformation(request, serverNotificationRegistration.objectName.getCanonicalName());
//Fetch the filter/handback objects
NotificationFilter filter = (NotificationFilter) getObject(serverNotificationRegistration.filterID, serverNotificationRegistration.filter, converter);
Object handback = getObject(serverNotificationRegistration.handbackID, serverNotificationRegistration.handback, converter);
// Check whether the producer of the notification is local or remote.
if (nti.getRoutingInformation() == null) {
//Add to the MBeanServer
MBeanServerHelper.addServerNotification(serverNotificationRegistration.objectName,
serverNotificationRegistration.listener,
filter,
handback,
converter);
} else {
// Add the notification listener to the Target-Client Manager through EventAdmin
MBeanRoutedNotificationHelper helper = MBeanRoutedNotificationHelper.getMBeanRoutedNotificationHelper();
helper.addRoutedServerNotificationListener(nti,
serverNotificationRegistration.listener,
filter,
handback,
converter);
}
//Make the local ServerNotification
ServerNotification serverNotification = new ServerNotification();
serverNotification.listener = serverNotificationRegistration.listener;
serverNotification.filter = serverNotificationRegistration.filterID;
serverNotification.handback = serverNotificationRegistration.handbackID;
//See if there's a list already
List<ServerNotification> list = serverNotifications.get(nti);
if (list == null) {
list = Collections.synchronizedList(new ArrayList<ServerNotification>());
List<ServerNotification> mapList = serverNotifications.putIfAbsent(nti, list);
if (mapList != null) {
list = mapList;
}
}
//Add the new notification into the list
list.add(serverNotification);
} | java | public void addServerNotificationListener(RESTRequest request, ServerNotificationRegistration serverNotificationRegistration, JSONConverter converter) {
NotificationTargetInformation nti = toNotificationTargetInformation(request, serverNotificationRegistration.objectName.getCanonicalName());
//Fetch the filter/handback objects
NotificationFilter filter = (NotificationFilter) getObject(serverNotificationRegistration.filterID, serverNotificationRegistration.filter, converter);
Object handback = getObject(serverNotificationRegistration.handbackID, serverNotificationRegistration.handback, converter);
// Check whether the producer of the notification is local or remote.
if (nti.getRoutingInformation() == null) {
//Add to the MBeanServer
MBeanServerHelper.addServerNotification(serverNotificationRegistration.objectName,
serverNotificationRegistration.listener,
filter,
handback,
converter);
} else {
// Add the notification listener to the Target-Client Manager through EventAdmin
MBeanRoutedNotificationHelper helper = MBeanRoutedNotificationHelper.getMBeanRoutedNotificationHelper();
helper.addRoutedServerNotificationListener(nti,
serverNotificationRegistration.listener,
filter,
handback,
converter);
}
//Make the local ServerNotification
ServerNotification serverNotification = new ServerNotification();
serverNotification.listener = serverNotificationRegistration.listener;
serverNotification.filter = serverNotificationRegistration.filterID;
serverNotification.handback = serverNotificationRegistration.handbackID;
//See if there's a list already
List<ServerNotification> list = serverNotifications.get(nti);
if (list == null) {
list = Collections.synchronizedList(new ArrayList<ServerNotification>());
List<ServerNotification> mapList = serverNotifications.putIfAbsent(nti, list);
if (mapList != null) {
list = mapList;
}
}
//Add the new notification into the list
list.add(serverNotification);
} | [
"public",
"void",
"addServerNotificationListener",
"(",
"RESTRequest",
"request",
",",
"ServerNotificationRegistration",
"serverNotificationRegistration",
",",
"JSONConverter",
"converter",
")",
"{",
"NotificationTargetInformation",
"nti",
"=",
"toNotificationTargetInformation",
"(",
"request",
",",
"serverNotificationRegistration",
".",
"objectName",
".",
"getCanonicalName",
"(",
")",
")",
";",
"//Fetch the filter/handback objects",
"NotificationFilter",
"filter",
"=",
"(",
"NotificationFilter",
")",
"getObject",
"(",
"serverNotificationRegistration",
".",
"filterID",
",",
"serverNotificationRegistration",
".",
"filter",
",",
"converter",
")",
";",
"Object",
"handback",
"=",
"getObject",
"(",
"serverNotificationRegistration",
".",
"handbackID",
",",
"serverNotificationRegistration",
".",
"handback",
",",
"converter",
")",
";",
"// Check whether the producer of the notification is local or remote.",
"if",
"(",
"nti",
".",
"getRoutingInformation",
"(",
")",
"==",
"null",
")",
"{",
"//Add to the MBeanServer",
"MBeanServerHelper",
".",
"addServerNotification",
"(",
"serverNotificationRegistration",
".",
"objectName",
",",
"serverNotificationRegistration",
".",
"listener",
",",
"filter",
",",
"handback",
",",
"converter",
")",
";",
"}",
"else",
"{",
"// Add the notification listener to the Target-Client Manager through EventAdmin",
"MBeanRoutedNotificationHelper",
"helper",
"=",
"MBeanRoutedNotificationHelper",
".",
"getMBeanRoutedNotificationHelper",
"(",
")",
";",
"helper",
".",
"addRoutedServerNotificationListener",
"(",
"nti",
",",
"serverNotificationRegistration",
".",
"listener",
",",
"filter",
",",
"handback",
",",
"converter",
")",
";",
"}",
"//Make the local ServerNotification",
"ServerNotification",
"serverNotification",
"=",
"new",
"ServerNotification",
"(",
")",
";",
"serverNotification",
".",
"listener",
"=",
"serverNotificationRegistration",
".",
"listener",
";",
"serverNotification",
".",
"filter",
"=",
"serverNotificationRegistration",
".",
"filterID",
";",
"serverNotification",
".",
"handback",
"=",
"serverNotificationRegistration",
".",
"handbackID",
";",
"//See if there's a list already",
"List",
"<",
"ServerNotification",
">",
"list",
"=",
"serverNotifications",
".",
"get",
"(",
"nti",
")",
";",
"if",
"(",
"list",
"==",
"null",
")",
"{",
"list",
"=",
"Collections",
".",
"synchronizedList",
"(",
"new",
"ArrayList",
"<",
"ServerNotification",
">",
"(",
")",
")",
";",
"List",
"<",
"ServerNotification",
">",
"mapList",
"=",
"serverNotifications",
".",
"putIfAbsent",
"(",
"nti",
",",
"list",
")",
";",
"if",
"(",
"mapList",
"!=",
"null",
")",
"{",
"list",
"=",
"mapList",
";",
"}",
"}",
"//Add the new notification into the list",
"list",
".",
"add",
"(",
"serverNotification",
")",
";",
"}"
] | Add the server notification to our internal list so we can cleanup afterwards | [
"Add",
"the",
"server",
"notification",
"to",
"our",
"internal",
"list",
"so",
"we",
"can",
"cleanup",
"afterwards"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/notification/ClientNotificationArea.java#L497-L542 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/notification/ClientNotificationArea.java | ClientNotificationArea.remoteClientRegistrations | public synchronized void remoteClientRegistrations(RESTRequest request) {
Iterator<Entry<NotificationTargetInformation, ClientNotificationListener>> clientListeners = listeners.entrySet().iterator();
try {
while (clientListeners.hasNext()) {
Entry<NotificationTargetInformation, ClientNotificationListener> clientListener = clientListeners.next();
NotificationTargetInformation nti = clientListener.getKey();
ClientNotificationListener listener = clientListener.getValue();
// Check whether the producer of the notification is local or remote.
if (nti.getRoutingInformation() == null) {
// Remove the notification from the MBeanServer
ObjectName objName = RESTHelper.objectNameConverter(nti.getNameAsString(), false, null);
if (MBeanServerHelper.isRegistered(objName)) {
try {
MBeanServerHelper.removeClientNotification(objName, listener);
} catch (RESTHandlerJsonException exception) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Received exception while cleaning up: " + exception);
}
}
}
else {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "The MBean " + objName + " is not registered with the MBean server.");
}
}
} else {
// Remove the notification listener from the Target-Client Manager through EventAdmin
MBeanRoutedNotificationHelper helper = MBeanRoutedNotificationHelper.getMBeanRoutedNotificationHelper();
helper.removeRoutedNotificationListener(nti, listener);
}
}
} finally {
//Clear the map
listeners.clear();
}
} | java | public synchronized void remoteClientRegistrations(RESTRequest request) {
Iterator<Entry<NotificationTargetInformation, ClientNotificationListener>> clientListeners = listeners.entrySet().iterator();
try {
while (clientListeners.hasNext()) {
Entry<NotificationTargetInformation, ClientNotificationListener> clientListener = clientListeners.next();
NotificationTargetInformation nti = clientListener.getKey();
ClientNotificationListener listener = clientListener.getValue();
// Check whether the producer of the notification is local or remote.
if (nti.getRoutingInformation() == null) {
// Remove the notification from the MBeanServer
ObjectName objName = RESTHelper.objectNameConverter(nti.getNameAsString(), false, null);
if (MBeanServerHelper.isRegistered(objName)) {
try {
MBeanServerHelper.removeClientNotification(objName, listener);
} catch (RESTHandlerJsonException exception) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Received exception while cleaning up: " + exception);
}
}
}
else {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "The MBean " + objName + " is not registered with the MBean server.");
}
}
} else {
// Remove the notification listener from the Target-Client Manager through EventAdmin
MBeanRoutedNotificationHelper helper = MBeanRoutedNotificationHelper.getMBeanRoutedNotificationHelper();
helper.removeRoutedNotificationListener(nti, listener);
}
}
} finally {
//Clear the map
listeners.clear();
}
} | [
"public",
"synchronized",
"void",
"remoteClientRegistrations",
"(",
"RESTRequest",
"request",
")",
"{",
"Iterator",
"<",
"Entry",
"<",
"NotificationTargetInformation",
",",
"ClientNotificationListener",
">",
">",
"clientListeners",
"=",
"listeners",
".",
"entrySet",
"(",
")",
".",
"iterator",
"(",
")",
";",
"try",
"{",
"while",
"(",
"clientListeners",
".",
"hasNext",
"(",
")",
")",
"{",
"Entry",
"<",
"NotificationTargetInformation",
",",
"ClientNotificationListener",
">",
"clientListener",
"=",
"clientListeners",
".",
"next",
"(",
")",
";",
"NotificationTargetInformation",
"nti",
"=",
"clientListener",
".",
"getKey",
"(",
")",
";",
"ClientNotificationListener",
"listener",
"=",
"clientListener",
".",
"getValue",
"(",
")",
";",
"// Check whether the producer of the notification is local or remote.",
"if",
"(",
"nti",
".",
"getRoutingInformation",
"(",
")",
"==",
"null",
")",
"{",
"// Remove the notification from the MBeanServer",
"ObjectName",
"objName",
"=",
"RESTHelper",
".",
"objectNameConverter",
"(",
"nti",
".",
"getNameAsString",
"(",
")",
",",
"false",
",",
"null",
")",
";",
"if",
"(",
"MBeanServerHelper",
".",
"isRegistered",
"(",
"objName",
")",
")",
"{",
"try",
"{",
"MBeanServerHelper",
".",
"removeClientNotification",
"(",
"objName",
",",
"listener",
")",
";",
"}",
"catch",
"(",
"RESTHandlerJsonException",
"exception",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Received exception while cleaning up: \"",
"+",
"exception",
")",
";",
"}",
"}",
"}",
"else",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"The MBean \"",
"+",
"objName",
"+",
"\" is not registered with the MBean server.\"",
")",
";",
"}",
"}",
"}",
"else",
"{",
"// Remove the notification listener from the Target-Client Manager through EventAdmin",
"MBeanRoutedNotificationHelper",
"helper",
"=",
"MBeanRoutedNotificationHelper",
".",
"getMBeanRoutedNotificationHelper",
"(",
")",
";",
"helper",
".",
"removeRoutedNotificationListener",
"(",
"nti",
",",
"listener",
")",
";",
"}",
"}",
"}",
"finally",
"{",
"//Clear the map",
"listeners",
".",
"clear",
"(",
")",
";",
"}",
"}"
] | Remove all the client notifications | [
"Remove",
"all",
"the",
"client",
"notifications"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/notification/ClientNotificationArea.java#L547-L585 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/notification/ClientNotificationArea.java | ClientNotificationArea.remoteServerRegistrations | public synchronized void remoteServerRegistrations(RESTRequest request) {
Iterator<Entry<NotificationTargetInformation, List<ServerNotification>>> serverNotificationsIter = serverNotifications.entrySet().iterator();
while (serverNotificationsIter.hasNext()) {
Entry<NotificationTargetInformation, List<ServerNotification>> entry = serverNotificationsIter.next();
NotificationTargetInformation nti = entry.getKey();
// Check whether the producer of the notification is local or remote.
if (nti.getRoutingInformation() == null) {
//Traverse the list for that ObjectName
ObjectName objName = RESTHelper.objectNameConverter(nti.getNameAsString(), false, null);
if (MBeanServerHelper.isRegistered(objName)) {
for (ServerNotification notification : entry.getValue()) {
MBeanServerHelper.removeServerNotification(objName,
notification.listener,
(NotificationFilter) getObject(notification.filter, null, null),
getObject(notification.handback, null, null),
null);
}
}
else {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "The MBean is not registered with the MBean server.");
}
}
} else {
// Remove the notification listener from the Target-Client Manager through EventAdmin
MBeanRoutedNotificationHelper helper = MBeanRoutedNotificationHelper.getMBeanRoutedNotificationHelper();
for (ServerNotification notification : entry.getValue()) {
helper.removeRoutedServerNotificationListener(nti,
notification.listener,
(NotificationFilter) getObject(notification.filter, null, null),
getObject(notification.handback, null, null),
null);
}
}
}
//Clear the map
serverNotifications.clear();
//We don't have any more server notifications, so we can clear our library
clearObjectLibrary();
} | java | public synchronized void remoteServerRegistrations(RESTRequest request) {
Iterator<Entry<NotificationTargetInformation, List<ServerNotification>>> serverNotificationsIter = serverNotifications.entrySet().iterator();
while (serverNotificationsIter.hasNext()) {
Entry<NotificationTargetInformation, List<ServerNotification>> entry = serverNotificationsIter.next();
NotificationTargetInformation nti = entry.getKey();
// Check whether the producer of the notification is local or remote.
if (nti.getRoutingInformation() == null) {
//Traverse the list for that ObjectName
ObjectName objName = RESTHelper.objectNameConverter(nti.getNameAsString(), false, null);
if (MBeanServerHelper.isRegistered(objName)) {
for (ServerNotification notification : entry.getValue()) {
MBeanServerHelper.removeServerNotification(objName,
notification.listener,
(NotificationFilter) getObject(notification.filter, null, null),
getObject(notification.handback, null, null),
null);
}
}
else {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "The MBean is not registered with the MBean server.");
}
}
} else {
// Remove the notification listener from the Target-Client Manager through EventAdmin
MBeanRoutedNotificationHelper helper = MBeanRoutedNotificationHelper.getMBeanRoutedNotificationHelper();
for (ServerNotification notification : entry.getValue()) {
helper.removeRoutedServerNotificationListener(nti,
notification.listener,
(NotificationFilter) getObject(notification.filter, null, null),
getObject(notification.handback, null, null),
null);
}
}
}
//Clear the map
serverNotifications.clear();
//We don't have any more server notifications, so we can clear our library
clearObjectLibrary();
} | [
"public",
"synchronized",
"void",
"remoteServerRegistrations",
"(",
"RESTRequest",
"request",
")",
"{",
"Iterator",
"<",
"Entry",
"<",
"NotificationTargetInformation",
",",
"List",
"<",
"ServerNotification",
">",
">",
">",
"serverNotificationsIter",
"=",
"serverNotifications",
".",
"entrySet",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"serverNotificationsIter",
".",
"hasNext",
"(",
")",
")",
"{",
"Entry",
"<",
"NotificationTargetInformation",
",",
"List",
"<",
"ServerNotification",
">",
">",
"entry",
"=",
"serverNotificationsIter",
".",
"next",
"(",
")",
";",
"NotificationTargetInformation",
"nti",
"=",
"entry",
".",
"getKey",
"(",
")",
";",
"// Check whether the producer of the notification is local or remote.",
"if",
"(",
"nti",
".",
"getRoutingInformation",
"(",
")",
"==",
"null",
")",
"{",
"//Traverse the list for that ObjectName",
"ObjectName",
"objName",
"=",
"RESTHelper",
".",
"objectNameConverter",
"(",
"nti",
".",
"getNameAsString",
"(",
")",
",",
"false",
",",
"null",
")",
";",
"if",
"(",
"MBeanServerHelper",
".",
"isRegistered",
"(",
"objName",
")",
")",
"{",
"for",
"(",
"ServerNotification",
"notification",
":",
"entry",
".",
"getValue",
"(",
")",
")",
"{",
"MBeanServerHelper",
".",
"removeServerNotification",
"(",
"objName",
",",
"notification",
".",
"listener",
",",
"(",
"NotificationFilter",
")",
"getObject",
"(",
"notification",
".",
"filter",
",",
"null",
",",
"null",
")",
",",
"getObject",
"(",
"notification",
".",
"handback",
",",
"null",
",",
"null",
")",
",",
"null",
")",
";",
"}",
"}",
"else",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"The MBean is not registered with the MBean server.\"",
")",
";",
"}",
"}",
"}",
"else",
"{",
"// Remove the notification listener from the Target-Client Manager through EventAdmin",
"MBeanRoutedNotificationHelper",
"helper",
"=",
"MBeanRoutedNotificationHelper",
".",
"getMBeanRoutedNotificationHelper",
"(",
")",
";",
"for",
"(",
"ServerNotification",
"notification",
":",
"entry",
".",
"getValue",
"(",
")",
")",
"{",
"helper",
".",
"removeRoutedServerNotificationListener",
"(",
"nti",
",",
"notification",
".",
"listener",
",",
"(",
"NotificationFilter",
")",
"getObject",
"(",
"notification",
".",
"filter",
",",
"null",
",",
"null",
")",
",",
"getObject",
"(",
"notification",
".",
"handback",
",",
"null",
",",
"null",
")",
",",
"null",
")",
";",
"}",
"}",
"}",
"//Clear the map",
"serverNotifications",
".",
"clear",
"(",
")",
";",
"//We don't have any more server notifications, so we can clear our library",
"clearObjectLibrary",
"(",
")",
";",
"}"
] | Remove all the server notifications | [
"Remove",
"all",
"the",
"server",
"notifications"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/notification/ClientNotificationArea.java#L590-L632 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/handlers/LogRecordTextHandler.java | LogRecordTextHandler.copyHeader | public void copyHeader(LogRepositoryWriter writer) throws IllegalArgumentException {
if (writer == null) {
throw new IllegalArgumentException("Parameter writer can't be null");
}
writer.setHeader(headerBytes);
} | java | public void copyHeader(LogRepositoryWriter writer) throws IllegalArgumentException {
if (writer == null) {
throw new IllegalArgumentException("Parameter writer can't be null");
}
writer.setHeader(headerBytes);
} | [
"public",
"void",
"copyHeader",
"(",
"LogRepositoryWriter",
"writer",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"writer",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Parameter writer can't be null\"",
")",
";",
"}",
"writer",
".",
"setHeader",
"(",
"headerBytes",
")",
";",
"}"
] | Copy header into provided writer
@param writer repository writer to verify
@throws IllegalArgumentException if writer is 'null' | [
"Copy",
"header",
"into",
"provided",
"writer"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/handlers/LogRecordTextHandler.java#L110-L115 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsApiHdrsImpl.java | JsApiHdrsImpl.getCcsid | final Integer getCcsid() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getCcsid");
Integer value = (Integer) jmo.getPayloadPart().getField(JsPayloadAccess.CCSID_DATA);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getCcsid", value);
return value;
} | java | final Integer getCcsid() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getCcsid");
Integer value = (Integer) jmo.getPayloadPart().getField(JsPayloadAccess.CCSID_DATA);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getCcsid", value);
return value;
} | [
"final",
"Integer",
"getCcsid",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"getCcsid\"",
")",
";",
"Integer",
"value",
"=",
"(",
"Integer",
")",
"jmo",
".",
"getPayloadPart",
"(",
")",
".",
"getField",
"(",
"JsPayloadAccess",
".",
"CCSID_DATA",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"getCcsid\"",
",",
"value",
")",
";",
"return",
"value",
";",
"}"
] | Get the contents of the ccsid field from the payload part.
d395685
@return Integer The value of the CharacterSetID for the message payload. | [
"Get",
"the",
"contents",
"of",
"the",
"ccsid",
"field",
"from",
"the",
"payload",
"part",
".",
"d395685"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsApiHdrsImpl.java#L1441-L1450 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsApiHdrsImpl.java | JsApiHdrsImpl.getEncoding | final Integer getEncoding() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getEncoding");
Integer value = (Integer) jmo.getPayloadPart().getField(JsPayloadAccess.ENCODING_DATA);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getEncoding", value);
return value;
} | java | final Integer getEncoding() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getEncoding");
Integer value = (Integer) jmo.getPayloadPart().getField(JsPayloadAccess.ENCODING_DATA);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getEncoding", value);
return value;
} | [
"final",
"Integer",
"getEncoding",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"getEncoding\"",
")",
";",
"Integer",
"value",
"=",
"(",
"Integer",
")",
"jmo",
".",
"getPayloadPart",
"(",
")",
".",
"getField",
"(",
"JsPayloadAccess",
".",
"ENCODING_DATA",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"getEncoding\"",
",",
"value",
")",
";",
"return",
"value",
";",
"}"
] | Get the contents of the encoding field from the payload part.
d395685
@return Integer The value of the Encoding (for MQ) for the message payload. | [
"Get",
"the",
"contents",
"of",
"the",
"encoding",
"field",
"from",
"the",
"payload",
"part",
".",
"d395685"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsApiHdrsImpl.java#L1458-L1467 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsApiHdrsImpl.java | JsApiHdrsImpl.setCcsid | final void setCcsid(Object value) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setCcsid", value);
// If the value is null, then clear the field
if (value == null) {
jmo.getPayloadPart().setField(JsPayloadAccess.CCSID, JsPayloadAccess.IS_CCSID_EMPTY);
}
// If it is an Integer, then we just store it
else if (value instanceof Integer) {
jmo.getPayloadPart().setField(JsPayloadAccess.CCSID_DATA, value);
}
// If it is a String (most likely) we have to convert it into an int value first
/*
* else if (value instanceof String) {
* try {
* int ccsid = CCSID.getCCSID((String)value);
* jmo.getPayloadPart().setIntField(JsPayloadAccess.CCSID_DATA, ccsid);
* }
* catch (UnsupportedEncodingException e) {
* // FFDC it, then clear the field
* FFDCFilter.processException(e, "com.ibm.ws.sib.mfp.impl.JsApiHdrsImpl.setCcsid", "866");
* jmo.getPayloadPart().setField(JsPayloadAccess.CCSID, JsPayloadAccess.IS_CCSID_EMPTY);
* }
* }
*/
// If it isn't of a suitable type, clear the field
else {
jmo.getPayloadPart().setField(JsPayloadAccess.CCSID, JsPayloadAccess.IS_CCSID_EMPTY);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setCcsid");
} | java | final void setCcsid(Object value) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setCcsid", value);
// If the value is null, then clear the field
if (value == null) {
jmo.getPayloadPart().setField(JsPayloadAccess.CCSID, JsPayloadAccess.IS_CCSID_EMPTY);
}
// If it is an Integer, then we just store it
else if (value instanceof Integer) {
jmo.getPayloadPart().setField(JsPayloadAccess.CCSID_DATA, value);
}
// If it is a String (most likely) we have to convert it into an int value first
/*
* else if (value instanceof String) {
* try {
* int ccsid = CCSID.getCCSID((String)value);
* jmo.getPayloadPart().setIntField(JsPayloadAccess.CCSID_DATA, ccsid);
* }
* catch (UnsupportedEncodingException e) {
* // FFDC it, then clear the field
* FFDCFilter.processException(e, "com.ibm.ws.sib.mfp.impl.JsApiHdrsImpl.setCcsid", "866");
* jmo.getPayloadPart().setField(JsPayloadAccess.CCSID, JsPayloadAccess.IS_CCSID_EMPTY);
* }
* }
*/
// If it isn't of a suitable type, clear the field
else {
jmo.getPayloadPart().setField(JsPayloadAccess.CCSID, JsPayloadAccess.IS_CCSID_EMPTY);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setCcsid");
} | [
"final",
"void",
"setCcsid",
"(",
"Object",
"value",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"setCcsid\"",
",",
"value",
")",
";",
"// If the value is null, then clear the field",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"jmo",
".",
"getPayloadPart",
"(",
")",
".",
"setField",
"(",
"JsPayloadAccess",
".",
"CCSID",
",",
"JsPayloadAccess",
".",
"IS_CCSID_EMPTY",
")",
";",
"}",
"// If it is an Integer, then we just store it",
"else",
"if",
"(",
"value",
"instanceof",
"Integer",
")",
"{",
"jmo",
".",
"getPayloadPart",
"(",
")",
".",
"setField",
"(",
"JsPayloadAccess",
".",
"CCSID_DATA",
",",
"value",
")",
";",
"}",
"// If it is a String (most likely) we have to convert it into an int value first",
"/*\n * else if (value instanceof String) {\n * try {\n * int ccsid = CCSID.getCCSID((String)value);\n * jmo.getPayloadPart().setIntField(JsPayloadAccess.CCSID_DATA, ccsid);\n * }\n * catch (UnsupportedEncodingException e) {\n * // FFDC it, then clear the field\n * FFDCFilter.processException(e, \"com.ibm.ws.sib.mfp.impl.JsApiHdrsImpl.setCcsid\", \"866\");\n * jmo.getPayloadPart().setField(JsPayloadAccess.CCSID, JsPayloadAccess.IS_CCSID_EMPTY);\n * }\n * }\n */",
"// If it isn't of a suitable type, clear the field",
"else",
"{",
"jmo",
".",
"getPayloadPart",
"(",
")",
".",
"setField",
"(",
"JsPayloadAccess",
".",
"CCSID",
",",
"JsPayloadAccess",
".",
"IS_CCSID_EMPTY",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"setCcsid\"",
")",
";",
"}"
] | Set the contents of the ccsid field in the message payload part.
d395685
@param value the Object value of the CharacterSetID to be set into the ccsid field | [
"Set",
"the",
"contents",
"of",
"the",
"ccsid",
"field",
"in",
"the",
"message",
"payload",
"part",
".",
"d395685"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsApiHdrsImpl.java#L1475-L1508 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsApiHdrsImpl.java | JsApiHdrsImpl.setEncoding | final void setEncoding(Object value) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setEncoding", value);
// If the value is null or unsuitable, then clear the field
if ((value == null) || !(value instanceof Integer)) {
jmo.getPayloadPart().setField(JsPayloadAccess.ENCODING, JsPayloadAccess.IS_ENCODING_EMPTY);
}
// If it does exist and is an Integer, then we just store it
else {
jmo.getPayloadPart().setField(JsPayloadAccess.ENCODING_DATA, value);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setEncoding");
} | java | final void setEncoding(Object value) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setEncoding", value);
// If the value is null or unsuitable, then clear the field
if ((value == null) || !(value instanceof Integer)) {
jmo.getPayloadPart().setField(JsPayloadAccess.ENCODING, JsPayloadAccess.IS_ENCODING_EMPTY);
}
// If it does exist and is an Integer, then we just store it
else {
jmo.getPayloadPart().setField(JsPayloadAccess.ENCODING_DATA, value);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setEncoding");
} | [
"final",
"void",
"setEncoding",
"(",
"Object",
"value",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"setEncoding\"",
",",
"value",
")",
";",
"// If the value is null or unsuitable, then clear the field",
"if",
"(",
"(",
"value",
"==",
"null",
")",
"||",
"!",
"(",
"value",
"instanceof",
"Integer",
")",
")",
"{",
"jmo",
".",
"getPayloadPart",
"(",
")",
".",
"setField",
"(",
"JsPayloadAccess",
".",
"ENCODING",
",",
"JsPayloadAccess",
".",
"IS_ENCODING_EMPTY",
")",
";",
"}",
"// If it does exist and is an Integer, then we just store it",
"else",
"{",
"jmo",
".",
"getPayloadPart",
"(",
")",
".",
"setField",
"(",
"JsPayloadAccess",
".",
"ENCODING_DATA",
",",
"value",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"setEncoding\"",
")",
";",
"}"
] | Set the contents of the encoding field in the message payload part.
d395685
@param value the Object value of the Encoding (for MQ) be set into the encoding field | [
"Set",
"the",
"contents",
"of",
"the",
"encoding",
"field",
"in",
"the",
"message",
"payload",
"part",
".",
"d395685"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsApiHdrsImpl.java#L1516-L1531 | train |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/RecoveryManager.java | RecoveryManager.preShutdown | public void preShutdown(boolean transactionsLeft) throws Exception /* @PK31789C */
{
if (tc.isEntryEnabled())
Tr.entry(tc, "preShutdown", transactionsLeft);
try {
// Terminate partner log activity
getPartnerLogTable().terminate(); // 172471
// If the tranlog is null then we're using in memory logging and
// the work the shutdown the log is not required.
if (_tranLog != null) {
//
// Check if any transactions still active...
//
if (!transactionsLeft) {
if (tc.isDebugEnabled())
Tr.debug(tc, "There is no transaction data requiring future recovery");
if (_tranlogServiceData != null) {
if (tc.isDebugEnabled())
Tr.debug(tc, "Erasing service data from transaction log");
// transactions stopped running now
try {
_tranLog.removeRecoverableUnit(_tranlogServiceData.identity());
} catch (Exception e) {
FFDCFilter.processException(e, "com.ibm.tx.jta.impl.RecoveryManager.preShutdown", "359", this);
Tr.error(tc, "WTRN0029_ERROR_CLOSE_LOG_IN_SHUTDOWN");
throw e; /* @PK31789A */
}
} else {
if (tc.isDebugEnabled())
Tr.debug(tc, "No service data to erase from transaction log");
}
} else if (_tranlogServiceData != null) // Only update epoch if there is data in the log - d671043
{
// Force the tranlog by rewriting the epoch in the servicedata. This will ensure
// any previous completed transactions will have their end-records forced. Then
// it is safe to remove partner log records. Otherwise, we can get into the state
// of recovering completed txns that are still in-doubt in the txn log but have
// no partner log entries as we've cleaned them up. We can add code to cope with
// this but it gets very messy especially if recovery/shutdown keeps repeating
// itself - we need to check for NPE at every partner log check.
if (tc.isDebugEnabled())
Tr.debug(tc, "There is transaction data requiring future recovery. Updating epoch");
if (_failureScopeController.localFailureScope() || (_tranlogServiceData != null && _tranlogEpochSection != null)) {
try {
_tranlogEpochSection.addData(Util.intToBytes(_ourEpoch));
_tranlogServiceData.forceSections();
} catch (Exception e) {
// We were unable to force the tranlog, so just return as if we had crashed
// (or did an immediate shutdown) and we will recover everything at the next restart.
FFDCFilter.processException(e, "com.ibm.tx.jta.impl.RecoveryManager.preShutdown", "608", this);
if (tc.isDebugEnabled())
Tr.debug(tc, "Exception raised forcing tranlog at shutdown", e);
throw e; /* @PK31789C */
}
} else {
if (tc.isDebugEnabled())
Tr.debug(tc, "No service data to update in transaction log");
}
}
}
} finally {
// If this is a peer server, or a local server where there are no transactions left running
// then close the log. In the case of the local failure scope, we are unable to close the log if
// there are transactions running as this shutdown represents the real server shutdown and
// transactions may still attempt to write to the recovery log. If we close the log now in this
// situation, server shutdown will be peppered with LogClosedException errors. Needs refinement.
if (_tranLog != null && ((!_failureScopeController.localFailureScope()) || (!transactionsLeft))) {
try {
_tranLog.closeLog();
} catch (Exception e) {
FFDCFilter.processException(e, "com.ibm.tx.jta.impl.RecoveryManager.preShutdown", "360", this);
Tr.error(tc, "WTRN0029_ERROR_CLOSE_LOG_IN_SHUTDOWN");
if (tc.isEntryEnabled())
Tr.exit(tc, "preShutdown");
throw e; /* @PK31789A */
}
}
if (tc.isEntryEnabled())
Tr.exit(tc, "preShutdown");
}
} | java | public void preShutdown(boolean transactionsLeft) throws Exception /* @PK31789C */
{
if (tc.isEntryEnabled())
Tr.entry(tc, "preShutdown", transactionsLeft);
try {
// Terminate partner log activity
getPartnerLogTable().terminate(); // 172471
// If the tranlog is null then we're using in memory logging and
// the work the shutdown the log is not required.
if (_tranLog != null) {
//
// Check if any transactions still active...
//
if (!transactionsLeft) {
if (tc.isDebugEnabled())
Tr.debug(tc, "There is no transaction data requiring future recovery");
if (_tranlogServiceData != null) {
if (tc.isDebugEnabled())
Tr.debug(tc, "Erasing service data from transaction log");
// transactions stopped running now
try {
_tranLog.removeRecoverableUnit(_tranlogServiceData.identity());
} catch (Exception e) {
FFDCFilter.processException(e, "com.ibm.tx.jta.impl.RecoveryManager.preShutdown", "359", this);
Tr.error(tc, "WTRN0029_ERROR_CLOSE_LOG_IN_SHUTDOWN");
throw e; /* @PK31789A */
}
} else {
if (tc.isDebugEnabled())
Tr.debug(tc, "No service data to erase from transaction log");
}
} else if (_tranlogServiceData != null) // Only update epoch if there is data in the log - d671043
{
// Force the tranlog by rewriting the epoch in the servicedata. This will ensure
// any previous completed transactions will have their end-records forced. Then
// it is safe to remove partner log records. Otherwise, we can get into the state
// of recovering completed txns that are still in-doubt in the txn log but have
// no partner log entries as we've cleaned them up. We can add code to cope with
// this but it gets very messy especially if recovery/shutdown keeps repeating
// itself - we need to check for NPE at every partner log check.
if (tc.isDebugEnabled())
Tr.debug(tc, "There is transaction data requiring future recovery. Updating epoch");
if (_failureScopeController.localFailureScope() || (_tranlogServiceData != null && _tranlogEpochSection != null)) {
try {
_tranlogEpochSection.addData(Util.intToBytes(_ourEpoch));
_tranlogServiceData.forceSections();
} catch (Exception e) {
// We were unable to force the tranlog, so just return as if we had crashed
// (or did an immediate shutdown) and we will recover everything at the next restart.
FFDCFilter.processException(e, "com.ibm.tx.jta.impl.RecoveryManager.preShutdown", "608", this);
if (tc.isDebugEnabled())
Tr.debug(tc, "Exception raised forcing tranlog at shutdown", e);
throw e; /* @PK31789C */
}
} else {
if (tc.isDebugEnabled())
Tr.debug(tc, "No service data to update in transaction log");
}
}
}
} finally {
// If this is a peer server, or a local server where there are no transactions left running
// then close the log. In the case of the local failure scope, we are unable to close the log if
// there are transactions running as this shutdown represents the real server shutdown and
// transactions may still attempt to write to the recovery log. If we close the log now in this
// situation, server shutdown will be peppered with LogClosedException errors. Needs refinement.
if (_tranLog != null && ((!_failureScopeController.localFailureScope()) || (!transactionsLeft))) {
try {
_tranLog.closeLog();
} catch (Exception e) {
FFDCFilter.processException(e, "com.ibm.tx.jta.impl.RecoveryManager.preShutdown", "360", this);
Tr.error(tc, "WTRN0029_ERROR_CLOSE_LOG_IN_SHUTDOWN");
if (tc.isEntryEnabled())
Tr.exit(tc, "preShutdown");
throw e; /* @PK31789A */
}
}
if (tc.isEntryEnabled())
Tr.exit(tc, "preShutdown");
}
} | [
"public",
"void",
"preShutdown",
"(",
"boolean",
"transactionsLeft",
")",
"throws",
"Exception",
"/* @PK31789C */",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"preShutdown\"",
",",
"transactionsLeft",
")",
";",
"try",
"{",
"// Terminate partner log activity",
"getPartnerLogTable",
"(",
")",
".",
"terminate",
"(",
")",
";",
"// 172471",
"// If the tranlog is null then we're using in memory logging and",
"// the work the shutdown the log is not required.",
"if",
"(",
"_tranLog",
"!=",
"null",
")",
"{",
"//",
"// Check if any transactions still active...",
"//",
"if",
"(",
"!",
"transactionsLeft",
")",
"{",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"There is no transaction data requiring future recovery\"",
")",
";",
"if",
"(",
"_tranlogServiceData",
"!=",
"null",
")",
"{",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Erasing service data from transaction log\"",
")",
";",
"// transactions stopped running now",
"try",
"{",
"_tranLog",
".",
"removeRecoverableUnit",
"(",
"_tranlogServiceData",
".",
"identity",
"(",
")",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.tx.jta.impl.RecoveryManager.preShutdown\"",
",",
"\"359\"",
",",
"this",
")",
";",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"WTRN0029_ERROR_CLOSE_LOG_IN_SHUTDOWN\"",
")",
";",
"throw",
"e",
";",
"/* @PK31789A */",
"}",
"}",
"else",
"{",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"No service data to erase from transaction log\"",
")",
";",
"}",
"}",
"else",
"if",
"(",
"_tranlogServiceData",
"!=",
"null",
")",
"// Only update epoch if there is data in the log - d671043",
"{",
"// Force the tranlog by rewriting the epoch in the servicedata. This will ensure",
"// any previous completed transactions will have their end-records forced. Then",
"// it is safe to remove partner log records. Otherwise, we can get into the state",
"// of recovering completed txns that are still in-doubt in the txn log but have",
"// no partner log entries as we've cleaned them up. We can add code to cope with",
"// this but it gets very messy especially if recovery/shutdown keeps repeating",
"// itself - we need to check for NPE at every partner log check.",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"There is transaction data requiring future recovery. Updating epoch\"",
")",
";",
"if",
"(",
"_failureScopeController",
".",
"localFailureScope",
"(",
")",
"||",
"(",
"_tranlogServiceData",
"!=",
"null",
"&&",
"_tranlogEpochSection",
"!=",
"null",
")",
")",
"{",
"try",
"{",
"_tranlogEpochSection",
".",
"addData",
"(",
"Util",
".",
"intToBytes",
"(",
"_ourEpoch",
")",
")",
";",
"_tranlogServiceData",
".",
"forceSections",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"// We were unable to force the tranlog, so just return as if we had crashed",
"// (or did an immediate shutdown) and we will recover everything at the next restart.",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.tx.jta.impl.RecoveryManager.preShutdown\"",
",",
"\"608\"",
",",
"this",
")",
";",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Exception raised forcing tranlog at shutdown\"",
",",
"e",
")",
";",
"throw",
"e",
";",
"/* @PK31789C */",
"}",
"}",
"else",
"{",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"No service data to update in transaction log\"",
")",
";",
"}",
"}",
"}",
"}",
"finally",
"{",
"// If this is a peer server, or a local server where there are no transactions left running",
"// then close the log. In the case of the local failure scope, we are unable to close the log if",
"// there are transactions running as this shutdown represents the real server shutdown and",
"// transactions may still attempt to write to the recovery log. If we close the log now in this",
"// situation, server shutdown will be peppered with LogClosedException errors. Needs refinement.",
"if",
"(",
"_tranLog",
"!=",
"null",
"&&",
"(",
"(",
"!",
"_failureScopeController",
".",
"localFailureScope",
"(",
")",
")",
"||",
"(",
"!",
"transactionsLeft",
")",
")",
")",
"{",
"try",
"{",
"_tranLog",
".",
"closeLog",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.tx.jta.impl.RecoveryManager.preShutdown\"",
",",
"\"360\"",
",",
"this",
")",
";",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"WTRN0029_ERROR_CLOSE_LOG_IN_SHUTDOWN\"",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"preShutdown\"",
")",
";",
"throw",
"e",
";",
"/* @PK31789A */",
"}",
"}",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"preShutdown\"",
")",
";",
"}",
"}"
] | Informs the RecoveryManager that the transaction service is being shut
down.
The shutdown method can be driven in one of two ways:-
1. Real server shutdown. The TxServiceImpl.destroy method runs through
all its FailureScopeControllers and calls shutdown on them. This in
turn directs the associated RecoveryManagers to shutdown.
2. Peer recovery termination. The Recovery Log Service has directed the
transactions RecoveryAgent (TxServiceImpl again) to terminateRecovery
for the associated failure scope. TxServiceImpl directs the
corrisponding FailureScopeController to shutdown and again this directs
the associated RecoveryManager to shutdown (on its own this time others
stay running)
For immediate shutdown,
For quiesce,
YOU MUST HAVE CALLED "prepareToShutdown" BEFORE MAKING THIS CALL. THIS IS
REQUIRED IN ORDER THAT RECOVERY PROCESSING IS STOPPED BEFORE DRIVING
THE SHUTDOWN LOGIC.
@param immediate Indicates whether to stop immediately. | [
"Informs",
"the",
"RecoveryManager",
"that",
"the",
"transaction",
"service",
"is",
"being",
"shut",
"down",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/RecoveryManager.java#L481-L571 | train |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/RecoveryManager.java | RecoveryManager.updateTranLogServiceData | protected void updateTranLogServiceData() throws Exception {
if (tc.isEntryEnabled())
Tr.entry(tc, "updateTranLogServiceData");
try {
//
// Check we have a recoverableUnit and three sections to add the data.
// On recovery we check that all service data sections were recovered.
//
if (_tranlogServiceData == null) {
_tranlogServiceData = _tranLog.createRecoverableUnit();
_tranlogServerSection = _tranlogServiceData.createSection(TransactionImpl.SERVER_DATA_SECTION, true);
_tranlogApplIdSection = _tranlogServiceData.createSection(TransactionImpl.APPLID_DATA_SECTION, true);
_tranlogEpochSection = _tranlogServiceData.createSection(TransactionImpl.EPOCH_DATA_SECTION, true);
// Log this server name
_tranlogServerSection.addData(Utils.byteArray(_failureScopeController.serverName()));
// Log our ApplId
_tranlogApplIdSection.addData(_ourApplId);
}
// Always update this server's current epoch
_tranlogEpochSection.addData(Util.intToBytes(_ourEpoch));
_tranlogServiceData.forceSections();
} catch (Exception e) {
FFDCFilter.processException(e, "com.ibm.tx.jta.impl.RecoveryManager.updateTranLogSeviceData", "1130", this);
if (tc.isEntryEnabled())
Tr.exit(tc, "updateTranLogServiceData", e);
throw e;
}
if (tc.isEntryEnabled())
Tr.exit(tc, "updateTranLogServiceData");
} | java | protected void updateTranLogServiceData() throws Exception {
if (tc.isEntryEnabled())
Tr.entry(tc, "updateTranLogServiceData");
try {
//
// Check we have a recoverableUnit and three sections to add the data.
// On recovery we check that all service data sections were recovered.
//
if (_tranlogServiceData == null) {
_tranlogServiceData = _tranLog.createRecoverableUnit();
_tranlogServerSection = _tranlogServiceData.createSection(TransactionImpl.SERVER_DATA_SECTION, true);
_tranlogApplIdSection = _tranlogServiceData.createSection(TransactionImpl.APPLID_DATA_SECTION, true);
_tranlogEpochSection = _tranlogServiceData.createSection(TransactionImpl.EPOCH_DATA_SECTION, true);
// Log this server name
_tranlogServerSection.addData(Utils.byteArray(_failureScopeController.serverName()));
// Log our ApplId
_tranlogApplIdSection.addData(_ourApplId);
}
// Always update this server's current epoch
_tranlogEpochSection.addData(Util.intToBytes(_ourEpoch));
_tranlogServiceData.forceSections();
} catch (Exception e) {
FFDCFilter.processException(e, "com.ibm.tx.jta.impl.RecoveryManager.updateTranLogSeviceData", "1130", this);
if (tc.isEntryEnabled())
Tr.exit(tc, "updateTranLogServiceData", e);
throw e;
}
if (tc.isEntryEnabled())
Tr.exit(tc, "updateTranLogServiceData");
} | [
"protected",
"void",
"updateTranLogServiceData",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"updateTranLogServiceData\"",
")",
";",
"try",
"{",
"//",
"// Check we have a recoverableUnit and three sections to add the data.",
"// On recovery we check that all service data sections were recovered.",
"//",
"if",
"(",
"_tranlogServiceData",
"==",
"null",
")",
"{",
"_tranlogServiceData",
"=",
"_tranLog",
".",
"createRecoverableUnit",
"(",
")",
";",
"_tranlogServerSection",
"=",
"_tranlogServiceData",
".",
"createSection",
"(",
"TransactionImpl",
".",
"SERVER_DATA_SECTION",
",",
"true",
")",
";",
"_tranlogApplIdSection",
"=",
"_tranlogServiceData",
".",
"createSection",
"(",
"TransactionImpl",
".",
"APPLID_DATA_SECTION",
",",
"true",
")",
";",
"_tranlogEpochSection",
"=",
"_tranlogServiceData",
".",
"createSection",
"(",
"TransactionImpl",
".",
"EPOCH_DATA_SECTION",
",",
"true",
")",
";",
"// Log this server name",
"_tranlogServerSection",
".",
"addData",
"(",
"Utils",
".",
"byteArray",
"(",
"_failureScopeController",
".",
"serverName",
"(",
")",
")",
")",
";",
"// Log our ApplId",
"_tranlogApplIdSection",
".",
"addData",
"(",
"_ourApplId",
")",
";",
"}",
"// Always update this server's current epoch",
"_tranlogEpochSection",
".",
"addData",
"(",
"Util",
".",
"intToBytes",
"(",
"_ourEpoch",
")",
")",
";",
"_tranlogServiceData",
".",
"forceSections",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.tx.jta.impl.RecoveryManager.updateTranLogSeviceData\"",
",",
"\"1130\"",
",",
"this",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"updateTranLogServiceData\"",
",",
"e",
")",
";",
"throw",
"e",
";",
"}",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"updateTranLogServiceData\"",
")",
";",
"}"
] | Update service data in the tran log files | [
"Update",
"service",
"data",
"in",
"the",
"tran",
"log",
"files"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/RecoveryManager.java#L1012-L1044 | train |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/RecoveryManager.java | RecoveryManager.updatePartnerServiceData | protected void updatePartnerServiceData() throws Exception {
if (tc.isEntryEnabled())
Tr.entry(tc, "updatePartnerServiceData");
try {
//
// Check we have a recoverableUnit and three sections to add the data.
// On recovery we check that all service data sections were recovered.
//
if (_partnerServiceData == null) {
if (_recoverXaLog != null)
_partnerServiceData = _recoverXaLog.createRecoverableUnit();
else
_partnerServiceData = _xaLog.createRecoverableUnit();
_partnerServerSection = _partnerServiceData.createSection(TransactionImpl.SERVER_DATA_SECTION, true);
_partnerApplIdSection = _partnerServiceData.createSection(TransactionImpl.APPLID_DATA_SECTION, true);
_partnerEpochSection = _partnerServiceData.createSection(TransactionImpl.EPOCH_DATA_SECTION, true);
_partnerLowWatermarkSection = _partnerServiceData.createSection(TransactionImpl.LOW_WATERMARK_SECTION, true); /* @MD18134A */
_partnerNextIdSection = _partnerServiceData.createSection(TransactionImpl.NEXT_ID_SECTION, true); /* @MD18134A */
// Log this server name
_partnerServerSection.addData(Utils.byteArray(_failureScopeController.serverName()));
// Log our ApplId
_partnerApplIdSection.addData(_ourApplId);
// Low watermark will start at 1
_partnerEntryLowWatermark = 1; /* @MD18134A */
_partnerLowWatermarkSection.addData(Util.intToBytes(_partnerEntryLowWatermark)); /* @MD18134A */
// Next ID will start at 2.
_partnerEntryNextId = 2; /* @MD18134A */
_partnerNextIdSection.addData(Util.intToBytes(_partnerEntryNextId)); /* @MD18134A */
}
// Always update this server's current epoch
_partnerEpochSection.addData(Util.intToBytes(_ourEpoch));
// Update the server state in the log
updateServerState(STARTING);
_partnerServiceData.forceSections();
} catch (Exception e) {
FFDCFilter.processException(e, "com.ibm.tx.jta.impl.RecoveryManager.updatePartnerSeviceData", "1224", this);
if (tc.isEntryEnabled())
Tr.exit(tc, "updatePartnerServiceData", e);
throw e;
}
if (tc.isEntryEnabled())
Tr.exit(tc, "updatePartnerServiceData");
} | java | protected void updatePartnerServiceData() throws Exception {
if (tc.isEntryEnabled())
Tr.entry(tc, "updatePartnerServiceData");
try {
//
// Check we have a recoverableUnit and three sections to add the data.
// On recovery we check that all service data sections were recovered.
//
if (_partnerServiceData == null) {
if (_recoverXaLog != null)
_partnerServiceData = _recoverXaLog.createRecoverableUnit();
else
_partnerServiceData = _xaLog.createRecoverableUnit();
_partnerServerSection = _partnerServiceData.createSection(TransactionImpl.SERVER_DATA_SECTION, true);
_partnerApplIdSection = _partnerServiceData.createSection(TransactionImpl.APPLID_DATA_SECTION, true);
_partnerEpochSection = _partnerServiceData.createSection(TransactionImpl.EPOCH_DATA_SECTION, true);
_partnerLowWatermarkSection = _partnerServiceData.createSection(TransactionImpl.LOW_WATERMARK_SECTION, true); /* @MD18134A */
_partnerNextIdSection = _partnerServiceData.createSection(TransactionImpl.NEXT_ID_SECTION, true); /* @MD18134A */
// Log this server name
_partnerServerSection.addData(Utils.byteArray(_failureScopeController.serverName()));
// Log our ApplId
_partnerApplIdSection.addData(_ourApplId);
// Low watermark will start at 1
_partnerEntryLowWatermark = 1; /* @MD18134A */
_partnerLowWatermarkSection.addData(Util.intToBytes(_partnerEntryLowWatermark)); /* @MD18134A */
// Next ID will start at 2.
_partnerEntryNextId = 2; /* @MD18134A */
_partnerNextIdSection.addData(Util.intToBytes(_partnerEntryNextId)); /* @MD18134A */
}
// Always update this server's current epoch
_partnerEpochSection.addData(Util.intToBytes(_ourEpoch));
// Update the server state in the log
updateServerState(STARTING);
_partnerServiceData.forceSections();
} catch (Exception e) {
FFDCFilter.processException(e, "com.ibm.tx.jta.impl.RecoveryManager.updatePartnerSeviceData", "1224", this);
if (tc.isEntryEnabled())
Tr.exit(tc, "updatePartnerServiceData", e);
throw e;
}
if (tc.isEntryEnabled())
Tr.exit(tc, "updatePartnerServiceData");
} | [
"protected",
"void",
"updatePartnerServiceData",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"updatePartnerServiceData\"",
")",
";",
"try",
"{",
"//",
"// Check we have a recoverableUnit and three sections to add the data.",
"// On recovery we check that all service data sections were recovered.",
"//",
"if",
"(",
"_partnerServiceData",
"==",
"null",
")",
"{",
"if",
"(",
"_recoverXaLog",
"!=",
"null",
")",
"_partnerServiceData",
"=",
"_recoverXaLog",
".",
"createRecoverableUnit",
"(",
")",
";",
"else",
"_partnerServiceData",
"=",
"_xaLog",
".",
"createRecoverableUnit",
"(",
")",
";",
"_partnerServerSection",
"=",
"_partnerServiceData",
".",
"createSection",
"(",
"TransactionImpl",
".",
"SERVER_DATA_SECTION",
",",
"true",
")",
";",
"_partnerApplIdSection",
"=",
"_partnerServiceData",
".",
"createSection",
"(",
"TransactionImpl",
".",
"APPLID_DATA_SECTION",
",",
"true",
")",
";",
"_partnerEpochSection",
"=",
"_partnerServiceData",
".",
"createSection",
"(",
"TransactionImpl",
".",
"EPOCH_DATA_SECTION",
",",
"true",
")",
";",
"_partnerLowWatermarkSection",
"=",
"_partnerServiceData",
".",
"createSection",
"(",
"TransactionImpl",
".",
"LOW_WATERMARK_SECTION",
",",
"true",
")",
";",
"/* @MD18134A */",
"_partnerNextIdSection",
"=",
"_partnerServiceData",
".",
"createSection",
"(",
"TransactionImpl",
".",
"NEXT_ID_SECTION",
",",
"true",
")",
";",
"/* @MD18134A */",
"// Log this server name",
"_partnerServerSection",
".",
"addData",
"(",
"Utils",
".",
"byteArray",
"(",
"_failureScopeController",
".",
"serverName",
"(",
")",
")",
")",
";",
"// Log our ApplId",
"_partnerApplIdSection",
".",
"addData",
"(",
"_ourApplId",
")",
";",
"// Low watermark will start at 1",
"_partnerEntryLowWatermark",
"=",
"1",
";",
"/* @MD18134A */",
"_partnerLowWatermarkSection",
".",
"addData",
"(",
"Util",
".",
"intToBytes",
"(",
"_partnerEntryLowWatermark",
")",
")",
";",
"/* @MD18134A */",
"// Next ID will start at 2.",
"_partnerEntryNextId",
"=",
"2",
";",
"/* @MD18134A */",
"_partnerNextIdSection",
".",
"addData",
"(",
"Util",
".",
"intToBytes",
"(",
"_partnerEntryNextId",
")",
")",
";",
"/* @MD18134A */",
"}",
"// Always update this server's current epoch",
"_partnerEpochSection",
".",
"addData",
"(",
"Util",
".",
"intToBytes",
"(",
"_ourEpoch",
")",
")",
";",
"// Update the server state in the log",
"updateServerState",
"(",
"STARTING",
")",
";",
"_partnerServiceData",
".",
"forceSections",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.tx.jta.impl.RecoveryManager.updatePartnerSeviceData\"",
",",
"\"1224\"",
",",
"this",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"updatePartnerServiceData\"",
",",
"e",
")",
";",
"throw",
"e",
";",
"}",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"updatePartnerServiceData\"",
")",
";",
"}"
] | Update service data in the partner log files | [
"Update",
"service",
"data",
"in",
"the",
"partner",
"log",
"files"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/RecoveryManager.java#L1050-L1101 | train |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/RecoveryManager.java | RecoveryManager.waitForRecoveryCompletion | public void waitForRecoveryCompletion() {
if (tc.isEntryEnabled())
Tr.entry(tc, "waitForRecoveryCompletion");
if (!_recoveryCompleted) {
try {
if (tc.isEventEnabled())
Tr.event(tc, "starting to wait for recovery completion");
_recoveryInProgress.waitEvent();
if (tc.isEventEnabled())
Tr.event(tc, "completed wait for recovery completion");
} catch (InterruptedException exc) {
FFDCFilter.processException(exc, "com.ibm.tx.jta.impl.RecoveryManager.waitForRecoveryCompletion", "1242", this);
if (tc.isEventEnabled())
Tr.event(tc, "Wait for recovery complete interrupted.");
}
}
if (tc.isEntryEnabled())
Tr.exit(tc, "waitForRecoveryCompletion");
} | java | public void waitForRecoveryCompletion() {
if (tc.isEntryEnabled())
Tr.entry(tc, "waitForRecoveryCompletion");
if (!_recoveryCompleted) {
try {
if (tc.isEventEnabled())
Tr.event(tc, "starting to wait for recovery completion");
_recoveryInProgress.waitEvent();
if (tc.isEventEnabled())
Tr.event(tc, "completed wait for recovery completion");
} catch (InterruptedException exc) {
FFDCFilter.processException(exc, "com.ibm.tx.jta.impl.RecoveryManager.waitForRecoveryCompletion", "1242", this);
if (tc.isEventEnabled())
Tr.event(tc, "Wait for recovery complete interrupted.");
}
}
if (tc.isEntryEnabled())
Tr.exit(tc, "waitForRecoveryCompletion");
} | [
"public",
"void",
"waitForRecoveryCompletion",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"waitForRecoveryCompletion\"",
")",
";",
"if",
"(",
"!",
"_recoveryCompleted",
")",
"{",
"try",
"{",
"if",
"(",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"starting to wait for recovery completion\"",
")",
";",
"_recoveryInProgress",
".",
"waitEvent",
"(",
")",
";",
"if",
"(",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"completed wait for recovery completion\"",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"exc",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"exc",
",",
"\"com.ibm.tx.jta.impl.RecoveryManager.waitForRecoveryCompletion\"",
",",
"\"1242\"",
",",
"this",
")",
";",
"if",
"(",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"Wait for recovery complete interrupted.\"",
")",
";",
"}",
"}",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"waitForRecoveryCompletion\"",
")",
";",
"}"
] | Blocks the current thread until initial recovery has completed. | [
"Blocks",
"the",
"current",
"thread",
"until",
"initial",
"recovery",
"has",
"completed",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/RecoveryManager.java#L1175-L1197 | train |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/RecoveryManager.java | RecoveryManager.recoveryComplete | public void recoveryComplete() /* @LIDB3187C */
{
if (tc.isEntryEnabled())
Tr.entry(tc, "recoveryComplete");
if (!_recoveryCompleted) {
_recoveryCompleted = true;
_recoveryInProgress.post();
}
// Check for null currently required as z/OS creates this object with a null agent reference.
if (_agent != null) {
try {
RecoveryDirectorFactory.recoveryDirector().initialRecoveryComplete(_agent, _failureScopeController.failureScope());
} catch (Exception exc) {
FFDCFilter.processException(exc, "com.ibm.tx.jta.impl.RecoveryManager.recoveryComplete", "1546", this);
}
}
if (tc.isEntryEnabled())
Tr.exit(tc, "recoveryComplete");
} | java | public void recoveryComplete() /* @LIDB3187C */
{
if (tc.isEntryEnabled())
Tr.entry(tc, "recoveryComplete");
if (!_recoveryCompleted) {
_recoveryCompleted = true;
_recoveryInProgress.post();
}
// Check for null currently required as z/OS creates this object with a null agent reference.
if (_agent != null) {
try {
RecoveryDirectorFactory.recoveryDirector().initialRecoveryComplete(_agent, _failureScopeController.failureScope());
} catch (Exception exc) {
FFDCFilter.processException(exc, "com.ibm.tx.jta.impl.RecoveryManager.recoveryComplete", "1546", this);
}
}
if (tc.isEntryEnabled())
Tr.exit(tc, "recoveryComplete");
} | [
"public",
"void",
"recoveryComplete",
"(",
")",
"/* @LIDB3187C */",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"recoveryComplete\"",
")",
";",
"if",
"(",
"!",
"_recoveryCompleted",
")",
"{",
"_recoveryCompleted",
"=",
"true",
";",
"_recoveryInProgress",
".",
"post",
"(",
")",
";",
"}",
"// Check for null currently required as z/OS creates this object with a null agent reference.",
"if",
"(",
"_agent",
"!=",
"null",
")",
"{",
"try",
"{",
"RecoveryDirectorFactory",
".",
"recoveryDirector",
"(",
")",
".",
"initialRecoveryComplete",
"(",
"_agent",
",",
"_failureScopeController",
".",
"failureScope",
"(",
")",
")",
";",
"}",
"catch",
"(",
"Exception",
"exc",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"exc",
",",
"\"com.ibm.tx.jta.impl.RecoveryManager.recoveryComplete\"",
",",
"\"1546\"",
",",
"this",
")",
";",
"}",
"}",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"recoveryComplete\"",
")",
";",
"}"
] | Marks recovery as completed and signals the recovery director to this effect. | [
"Marks",
"recovery",
"as",
"completed",
"and",
"signals",
"the",
"recovery",
"director",
"to",
"this",
"effect",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/RecoveryManager.java#L1202-L1223 | train |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/RecoveryManager.java | RecoveryManager.shutdownInProgress | public boolean shutdownInProgress() /* @LIDB3187C */
{
synchronized (_recoveryMonitor) {
if (_shutdownInProgress) {
// Put out a message stating the we are stopping recovery processing. Since this method can
// be called a number of times in succession (to allow nested method calls to bail out by
// calling this method) we only put the message out the first time round.
if (!_recoveryCompleted) {
if (tc.isEventEnabled())
Tr.event(tc, "Shutdown is in progress, stopping recovery processing");
recoveryComplete();
if (_failureScopeController.localFailureScope()) {
TMHelper.asynchRecoveryProcessingComplete(null);
}
}
}
}
return _shutdownInProgress;
} | java | public boolean shutdownInProgress() /* @LIDB3187C */
{
synchronized (_recoveryMonitor) {
if (_shutdownInProgress) {
// Put out a message stating the we are stopping recovery processing. Since this method can
// be called a number of times in succession (to allow nested method calls to bail out by
// calling this method) we only put the message out the first time round.
if (!_recoveryCompleted) {
if (tc.isEventEnabled())
Tr.event(tc, "Shutdown is in progress, stopping recovery processing");
recoveryComplete();
if (_failureScopeController.localFailureScope()) {
TMHelper.asynchRecoveryProcessingComplete(null);
}
}
}
}
return _shutdownInProgress;
} | [
"public",
"boolean",
"shutdownInProgress",
"(",
")",
"/* @LIDB3187C */",
"{",
"synchronized",
"(",
"_recoveryMonitor",
")",
"{",
"if",
"(",
"_shutdownInProgress",
")",
"{",
"// Put out a message stating the we are stopping recovery processing. Since this method can",
"// be called a number of times in succession (to allow nested method calls to bail out by",
"// calling this method) we only put the message out the first time round.",
"if",
"(",
"!",
"_recoveryCompleted",
")",
"{",
"if",
"(",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"Shutdown is in progress, stopping recovery processing\"",
")",
";",
"recoveryComplete",
"(",
")",
";",
"if",
"(",
"_failureScopeController",
".",
"localFailureScope",
"(",
")",
")",
"{",
"TMHelper",
".",
"asynchRecoveryProcessingComplete",
"(",
"null",
")",
";",
"}",
"}",
"}",
"}",
"return",
"_shutdownInProgress",
";",
"}"
] | examine the boolean return value and not proceed with recovery if its true. | [
"examine",
"the",
"boolean",
"return",
"value",
"and",
"not",
"proceed",
"with",
"recovery",
"if",
"its",
"true",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/RecoveryManager.java#L1273-L1293 | train |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/RecoveryManager.java | RecoveryManager.getRecoveringTransactions | protected TransactionImpl[] getRecoveringTransactions() {
TransactionImpl[] recoveredTransactions = new TransactionImpl[_recoveringTransactions.size()];
_recoveringTransactions.toArray(recoveredTransactions);
return recoveredTransactions;
} | java | protected TransactionImpl[] getRecoveringTransactions() {
TransactionImpl[] recoveredTransactions = new TransactionImpl[_recoveringTransactions.size()];
_recoveringTransactions.toArray(recoveredTransactions);
return recoveredTransactions;
} | [
"protected",
"TransactionImpl",
"[",
"]",
"getRecoveringTransactions",
"(",
")",
"{",
"TransactionImpl",
"[",
"]",
"recoveredTransactions",
"=",
"new",
"TransactionImpl",
"[",
"_recoveringTransactions",
".",
"size",
"(",
")",
"]",
";",
"_recoveringTransactions",
".",
"toArray",
"(",
"recoveredTransactions",
")",
";",
"return",
"recoveredTransactions",
";",
"}"
] | This method should only be called from the "recover" thread else ConcurretModificationException may arise | [
"This",
"method",
"should",
"only",
"be",
"called",
"from",
"the",
"recover",
"thread",
"else",
"ConcurretModificationException",
"may",
"arise"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/RecoveryManager.java#L1559-L1563 | train |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/RecoveryManager.java | RecoveryManager.closeLogs | protected void closeLogs(boolean closeLeaseLog) {
if (tc.isEntryEnabled())
Tr.entry(tc, "closeLogs", new Object[] { this, closeLeaseLog });
if ((_tranLog != null) && (_tranLog instanceof DistributedRecoveryLog)) {
try {
((DistributedRecoveryLog) _tranLog).closeLogImmediate();
} catch (Exception e) {
// No FFDC Needed
}
_tranLog = null;
}
if ((_xaLog != null) && (_xaLog instanceof DistributedRecoveryLog)) {
try {
((DistributedRecoveryLog) _xaLog).closeLogImmediate();
} catch (Exception e) {
// No FFDC Needed
}
_xaLog = null;
}
try {
if (_leaseLog != null && closeLeaseLog) {
_leaseLog.deleteServerLease(_failureScopeController.serverName());
}
} catch (Exception e) {
// TODO Auto-generated catch block
// Do you need FFDC here? Remember FFDC instrumentation and @FFDCIgnore
e.printStackTrace();
}
if (tc.isEntryEnabled())
Tr.exit(tc, "closeLogs");
} | java | protected void closeLogs(boolean closeLeaseLog) {
if (tc.isEntryEnabled())
Tr.entry(tc, "closeLogs", new Object[] { this, closeLeaseLog });
if ((_tranLog != null) && (_tranLog instanceof DistributedRecoveryLog)) {
try {
((DistributedRecoveryLog) _tranLog).closeLogImmediate();
} catch (Exception e) {
// No FFDC Needed
}
_tranLog = null;
}
if ((_xaLog != null) && (_xaLog instanceof DistributedRecoveryLog)) {
try {
((DistributedRecoveryLog) _xaLog).closeLogImmediate();
} catch (Exception e) {
// No FFDC Needed
}
_xaLog = null;
}
try {
if (_leaseLog != null && closeLeaseLog) {
_leaseLog.deleteServerLease(_failureScopeController.serverName());
}
} catch (Exception e) {
// TODO Auto-generated catch block
// Do you need FFDC here? Remember FFDC instrumentation and @FFDCIgnore
e.printStackTrace();
}
if (tc.isEntryEnabled())
Tr.exit(tc, "closeLogs");
} | [
"protected",
"void",
"closeLogs",
"(",
"boolean",
"closeLeaseLog",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"closeLogs\"",
",",
"new",
"Object",
"[",
"]",
"{",
"this",
",",
"closeLeaseLog",
"}",
")",
";",
"if",
"(",
"(",
"_tranLog",
"!=",
"null",
")",
"&&",
"(",
"_tranLog",
"instanceof",
"DistributedRecoveryLog",
")",
")",
"{",
"try",
"{",
"(",
"(",
"DistributedRecoveryLog",
")",
"_tranLog",
")",
".",
"closeLogImmediate",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"// No FFDC Needed",
"}",
"_tranLog",
"=",
"null",
";",
"}",
"if",
"(",
"(",
"_xaLog",
"!=",
"null",
")",
"&&",
"(",
"_xaLog",
"instanceof",
"DistributedRecoveryLog",
")",
")",
"{",
"try",
"{",
"(",
"(",
"DistributedRecoveryLog",
")",
"_xaLog",
")",
".",
"closeLogImmediate",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"// No FFDC Needed",
"}",
"_xaLog",
"=",
"null",
";",
"}",
"try",
"{",
"if",
"(",
"_leaseLog",
"!=",
"null",
"&&",
"closeLeaseLog",
")",
"{",
"_leaseLog",
".",
"deleteServerLease",
"(",
"_failureScopeController",
".",
"serverName",
"(",
")",
")",
";",
"}",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"// TODO Auto-generated catch block",
"// Do you need FFDC here? Remember FFDC instrumentation and @FFDCIgnore",
"e",
".",
"printStackTrace",
"(",
")",
";",
"}",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"closeLogs\"",
")",
";",
"}"
] | Close the loggs without any keypoint - to be called on a failure to leave
the logs alone and ensure distributed shutdown code does not update them.
The closeLeaseLog parameter will be false in the case that we have determined that a peer is
recovering the server's logs.
@param closeLeaseLog is true if we should process a lease log | [
"Close",
"the",
"loggs",
"without",
"any",
"keypoint",
"-",
"to",
"be",
"called",
"on",
"a",
"failure",
"to",
"leave",
"the",
"logs",
"alone",
"and",
"ensure",
"distributed",
"shutdown",
"code",
"does",
"not",
"update",
"them",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/RecoveryManager.java#L1624-L1657 | train |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/RecoveryManager.java | RecoveryManager.registerTransaction | public void registerTransaction(TransactionImpl tran) {
if (tc.isEntryEnabled())
Tr.entry(tc, "registerTransaction", new Object[] { this, tran });
_recoveringTransactions.add(tran);
if (tc.isEntryEnabled())
Tr.exit(tc, "registerTransaction", _recoveringTransactions.size());
} | java | public void registerTransaction(TransactionImpl tran) {
if (tc.isEntryEnabled())
Tr.entry(tc, "registerTransaction", new Object[] { this, tran });
_recoveringTransactions.add(tran);
if (tc.isEntryEnabled())
Tr.exit(tc, "registerTransaction", _recoveringTransactions.size());
} | [
"public",
"void",
"registerTransaction",
"(",
"TransactionImpl",
"tran",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"registerTransaction\"",
",",
"new",
"Object",
"[",
"]",
"{",
"this",
",",
"tran",
"}",
")",
";",
"_recoveringTransactions",
".",
"add",
"(",
"tran",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"registerTransaction\"",
",",
"_recoveringTransactions",
".",
"size",
"(",
")",
")",
";",
"}"
] | Registers a recovered transactions existance. This method is triggered from
the FailureScopeController.registerTransaction for all transactions that
have been created during a recovery process.
@param tran The transaction reference object. | [
"Registers",
"a",
"recovered",
"transactions",
"existance",
".",
"This",
"method",
"is",
"triggered",
"from",
"the",
"FailureScopeController",
".",
"registerTransaction",
"for",
"all",
"transactions",
"that",
"have",
"been",
"created",
"during",
"a",
"recovery",
"process",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/RecoveryManager.java#L2093-L2101 | train |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/RecoveryManager.java | RecoveryManager.deregisterTransaction | public void deregisterTransaction(TransactionImpl tran) {
if (tc.isEntryEnabled())
Tr.entry(tc, "deregisterTransaction", new Object[] { this, tran });
_recoveringTransactions.remove(tran);
if (tc.isEntryEnabled())
Tr.exit(tc, "deregisterTransaction", _recoveringTransactions.size());
} | java | public void deregisterTransaction(TransactionImpl tran) {
if (tc.isEntryEnabled())
Tr.entry(tc, "deregisterTransaction", new Object[] { this, tran });
_recoveringTransactions.remove(tran);
if (tc.isEntryEnabled())
Tr.exit(tc, "deregisterTransaction", _recoveringTransactions.size());
} | [
"public",
"void",
"deregisterTransaction",
"(",
"TransactionImpl",
"tran",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"deregisterTransaction\"",
",",
"new",
"Object",
"[",
"]",
"{",
"this",
",",
"tran",
"}",
")",
";",
"_recoveringTransactions",
".",
"remove",
"(",
"tran",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"deregisterTransaction\"",
",",
"_recoveringTransactions",
".",
"size",
"(",
")",
")",
";",
"}"
] | Deregisters a recovered transactions existance. This method is triggered from
the FailureScopeController.deregisterTransaction for recovered transactions.
@param tran The transaction reference object. | [
"Deregisters",
"a",
"recovered",
"transactions",
"existance",
".",
"This",
"method",
"is",
"triggered",
"from",
"the",
"FailureScopeController",
".",
"deregisterTransaction",
"for",
"recovered",
"transactions",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/RecoveryManager.java#L2109-L2117 | train |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/RecoveryManager.java | RecoveryManager.recoveryModeTxnsComplete | protected boolean recoveryModeTxnsComplete() {
if (tc.isEntryEnabled())
Tr.entry(tc, "recoveryModeTxnsComplete");
if (_recoveringTransactions != null) {
for (TransactionImpl tx : _recoveringTransactions) {
if (tx != null && !tx.isRAImport()) {
if (tc.isEntryEnabled())
Tr.exit(tc, "recoveryModeTxnsComplete", Boolean.FALSE);
return false;
}
}
} // end if
if (tc.isEntryEnabled())
Tr.exit(tc, "recoveryModeTxnsComplete", Boolean.TRUE);
return true;
} | java | protected boolean recoveryModeTxnsComplete() {
if (tc.isEntryEnabled())
Tr.entry(tc, "recoveryModeTxnsComplete");
if (_recoveringTransactions != null) {
for (TransactionImpl tx : _recoveringTransactions) {
if (tx != null && !tx.isRAImport()) {
if (tc.isEntryEnabled())
Tr.exit(tc, "recoveryModeTxnsComplete", Boolean.FALSE);
return false;
}
}
} // end if
if (tc.isEntryEnabled())
Tr.exit(tc, "recoveryModeTxnsComplete", Boolean.TRUE);
return true;
} | [
"protected",
"boolean",
"recoveryModeTxnsComplete",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"recoveryModeTxnsComplete\"",
")",
";",
"if",
"(",
"_recoveringTransactions",
"!=",
"null",
")",
"{",
"for",
"(",
"TransactionImpl",
"tx",
":",
"_recoveringTransactions",
")",
"{",
"if",
"(",
"tx",
"!=",
"null",
"&&",
"!",
"tx",
".",
"isRAImport",
"(",
")",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"recoveryModeTxnsComplete\"",
",",
"Boolean",
".",
"FALSE",
")",
";",
"return",
"false",
";",
"}",
"}",
"}",
"// end if",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"recoveryModeTxnsComplete\"",
",",
"Boolean",
".",
"TRUE",
")",
";",
"return",
"true",
";",
"}"
] | This does not include JCA inbound txns | [
"This",
"does",
"not",
"include",
"JCA",
"inbound",
"txns"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/RecoveryManager.java#L2121-L2138 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.