repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1 value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1 value |
|---|---|---|---|---|---|---|---|---|---|---|---|
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java | BNFHeadersImpl.allocateBuffer | public WsByteBuffer allocateBuffer(int size) {
WsByteBufferPoolManager mgr = HttpDispatcher.getBufferManager();
WsByteBuffer wsbb = (this.useDirectBuffer) ? mgr.allocateDirect(size) : mgr.allocate(size);
addToCreatedBuffer(wsbb);
return wsbb;
} | java | public WsByteBuffer allocateBuffer(int size) {
WsByteBufferPoolManager mgr = HttpDispatcher.getBufferManager();
WsByteBuffer wsbb = (this.useDirectBuffer) ? mgr.allocateDirect(size) : mgr.allocate(size);
addToCreatedBuffer(wsbb);
return wsbb;
} | [
"public",
"WsByteBuffer",
"allocateBuffer",
"(",
"int",
"size",
")",
"{",
"WsByteBufferPoolManager",
"mgr",
"=",
"HttpDispatcher",
".",
"getBufferManager",
"(",
")",
";",
"WsByteBuffer",
"wsbb",
"=",
"(",
"this",
".",
"useDirectBuffer",
")",
"?",
"mgr",
".",
"allocateDirect",
"(",
"size",
")",
":",
"mgr",
".",
"allocate",
"(",
"size",
")",
";",
"addToCreatedBuffer",
"(",
"wsbb",
")",
";",
"return",
"wsbb",
";",
"}"
] | Allocate a buffer according to the requested input size.
@param size
@return WsByteBuffer | [
"Allocate",
"a",
"buffer",
"according",
"to",
"the",
"requested",
"input",
"size",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java#L2495-L2500 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java | BNFHeadersImpl.setDebugContext | @Override
public void setDebugContext(Object o) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "debugContext set to " + o + " for " + this);
}
if (null != o) {
this.debugContext = o;
}
} | java | @Override
public void setDebugContext(Object o) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "debugContext set to " + o + " for " + this);
}
if (null != o) {
this.debugContext = o;
}
} | [
"@",
"Override",
"public",
"void",
"setDebugContext",
"(",
"Object",
"o",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"debugContext set to \"",
"+",
"o",
"+",
"\" for \"",
"+",
"this",
")",
";",
"}",
"if",
"(",
"null",
"!=",
"o",
")",
"{",
"this",
".",
"debugContext",
"=",
"o",
";",
"}",
"}"
] | Allow the debug context object to be set to the input Object for more
specialized debugging. A null input object will be ignored.
@param o | [
"Allow",
"the",
"debug",
"context",
"object",
"to",
"be",
"set",
"to",
"the",
"input",
"Object",
"for",
"more",
"specialized",
"debugging",
".",
"A",
"null",
"input",
"object",
"will",
"be",
"ignored",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java#L2530-L2538 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java | BNFHeadersImpl.incrementHeaderCounter | private void incrementHeaderCounter() {
this.numberOfHeaders++;
this.headerAddCount++;
if (this.limitNumHeaders < this.numberOfHeaders) {
String msg = "Too many headers in storage: " + this.numberOfHeaders;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, msg);
}
throw new IllegalArgumentException(msg);
}
} | java | private void incrementHeaderCounter() {
this.numberOfHeaders++;
this.headerAddCount++;
if (this.limitNumHeaders < this.numberOfHeaders) {
String msg = "Too many headers in storage: " + this.numberOfHeaders;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, msg);
}
throw new IllegalArgumentException(msg);
}
} | [
"private",
"void",
"incrementHeaderCounter",
"(",
")",
"{",
"this",
".",
"numberOfHeaders",
"++",
";",
"this",
".",
"headerAddCount",
"++",
";",
"if",
"(",
"this",
".",
"limitNumHeaders",
"<",
"this",
".",
"numberOfHeaders",
")",
"{",
"String",
"msg",
"=",
"\"Too many headers in storage: \"",
"+",
"this",
".",
"numberOfHeaders",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"msg",
")",
";",
"}",
"throw",
"new",
"IllegalArgumentException",
"(",
"msg",
")",
";",
"}",
"}"
] | Increment the number of headers in storage counter by one. If this puts
it over the limit for the message, then an exception is thrown.
@throws IllegalArgumentException if there are now too many headers | [
"Increment",
"the",
"number",
"of",
"headers",
"in",
"storage",
"counter",
"by",
"one",
".",
"If",
"this",
"puts",
"it",
"over",
"the",
"limit",
"for",
"the",
"message",
"then",
"an",
"exception",
"is",
"thrown",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java#L2665-L2675 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java | BNFHeadersImpl.checkHeaderValue | private void checkHeaderValue(byte[] data, int offset, int length) {
// if the last character is a CR or LF, then this fails
int index = (offset + length) - 1;
if (index < 0) {
// empty data, quit now with success
return;
}
String error = null;
if (BNFHeaders.LF == data[index] || BNFHeaders.CR == data[index]) {
error = "Illegal trailing EOL";
}
// scan through the data now for invalid CRLF presence. Note that CRLFs
// may be followed by whitespace for valid multiline headers.
for (int i = offset; null == error && i < index; i++) {
if (BNFHeaders.CR == data[i]) {
// next char must be an LF
if (BNFHeaders.LF != data[i + 1]) {
error = "Invalid CR not followed by LF";
} else if (getCharacterValidation()) {
data[i] = BNFHeaders.SPACE;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Found a CR replacing it with a SP");
}
}
} else if (BNFHeaders.LF == data[i]) {
// if it is not followed by whitespace then this value is bad
if (BNFHeaders.TAB != data[i + 1] && BNFHeaders.SPACE != data[i + 1]) {
error = "Invalid LF not followed by whitespace";
} else if (getCharacterValidation()) {
data[i] = BNFHeaders.SPACE;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Found a LF replacing it with a SP");
}
}
}
}
// if we found an error, throw the exception now
if (null != error) {
IllegalArgumentException iae = new IllegalArgumentException(error);
FFDCFilter.processException(iae, getClass().getName() + ".checkHeaderValue(byte[])", "1", this);
throw iae;
}
} | java | private void checkHeaderValue(byte[] data, int offset, int length) {
// if the last character is a CR or LF, then this fails
int index = (offset + length) - 1;
if (index < 0) {
// empty data, quit now with success
return;
}
String error = null;
if (BNFHeaders.LF == data[index] || BNFHeaders.CR == data[index]) {
error = "Illegal trailing EOL";
}
// scan through the data now for invalid CRLF presence. Note that CRLFs
// may be followed by whitespace for valid multiline headers.
for (int i = offset; null == error && i < index; i++) {
if (BNFHeaders.CR == data[i]) {
// next char must be an LF
if (BNFHeaders.LF != data[i + 1]) {
error = "Invalid CR not followed by LF";
} else if (getCharacterValidation()) {
data[i] = BNFHeaders.SPACE;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Found a CR replacing it with a SP");
}
}
} else if (BNFHeaders.LF == data[i]) {
// if it is not followed by whitespace then this value is bad
if (BNFHeaders.TAB != data[i + 1] && BNFHeaders.SPACE != data[i + 1]) {
error = "Invalid LF not followed by whitespace";
} else if (getCharacterValidation()) {
data[i] = BNFHeaders.SPACE;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Found a LF replacing it with a SP");
}
}
}
}
// if we found an error, throw the exception now
if (null != error) {
IllegalArgumentException iae = new IllegalArgumentException(error);
FFDCFilter.processException(iae, getClass().getName() + ".checkHeaderValue(byte[])", "1", this);
throw iae;
}
} | [
"private",
"void",
"checkHeaderValue",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"// if the last character is a CR or LF, then this fails",
"int",
"index",
"=",
"(",
"offset",
"+",
"length",
")",
"-",
"1",
";",
"if",
"(",
"index",
"<",
"0",
")",
"{",
"// empty data, quit now with success",
"return",
";",
"}",
"String",
"error",
"=",
"null",
";",
"if",
"(",
"BNFHeaders",
".",
"LF",
"==",
"data",
"[",
"index",
"]",
"||",
"BNFHeaders",
".",
"CR",
"==",
"data",
"[",
"index",
"]",
")",
"{",
"error",
"=",
"\"Illegal trailing EOL\"",
";",
"}",
"// scan through the data now for invalid CRLF presence. Note that CRLFs",
"// may be followed by whitespace for valid multiline headers.",
"for",
"(",
"int",
"i",
"=",
"offset",
";",
"null",
"==",
"error",
"&&",
"i",
"<",
"index",
";",
"i",
"++",
")",
"{",
"if",
"(",
"BNFHeaders",
".",
"CR",
"==",
"data",
"[",
"i",
"]",
")",
"{",
"// next char must be an LF",
"if",
"(",
"BNFHeaders",
".",
"LF",
"!=",
"data",
"[",
"i",
"+",
"1",
"]",
")",
"{",
"error",
"=",
"\"Invalid CR not followed by LF\"",
";",
"}",
"else",
"if",
"(",
"getCharacterValidation",
"(",
")",
")",
"{",
"data",
"[",
"i",
"]",
"=",
"BNFHeaders",
".",
"SPACE",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Found a CR replacing it with a SP\"",
")",
";",
"}",
"}",
"}",
"else",
"if",
"(",
"BNFHeaders",
".",
"LF",
"==",
"data",
"[",
"i",
"]",
")",
"{",
"// if it is not followed by whitespace then this value is bad",
"if",
"(",
"BNFHeaders",
".",
"TAB",
"!=",
"data",
"[",
"i",
"+",
"1",
"]",
"&&",
"BNFHeaders",
".",
"SPACE",
"!=",
"data",
"[",
"i",
"+",
"1",
"]",
")",
"{",
"error",
"=",
"\"Invalid LF not followed by whitespace\"",
";",
"}",
"else",
"if",
"(",
"getCharacterValidation",
"(",
")",
")",
"{",
"data",
"[",
"i",
"]",
"=",
"BNFHeaders",
".",
"SPACE",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Found a LF replacing it with a SP\"",
")",
";",
"}",
"}",
"}",
"}",
"// if we found an error, throw the exception now",
"if",
"(",
"null",
"!=",
"error",
")",
"{",
"IllegalArgumentException",
"iae",
"=",
"new",
"IllegalArgumentException",
"(",
"error",
")",
";",
"FFDCFilter",
".",
"processException",
"(",
"iae",
",",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
"+",
"\".checkHeaderValue(byte[])\"",
",",
"\"1\"",
",",
"this",
")",
";",
"throw",
"iae",
";",
"}",
"}"
] | Check the input header value for validity, starting at the offset and
continuing for the input length of characters.
@param data
@param offset
@param length | [
"Check",
"the",
"input",
"header",
"value",
"for",
"validity",
"starting",
"at",
"the",
"offset",
"and",
"continuing",
"for",
"the",
"input",
"length",
"of",
"characters",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java#L2725-L2769 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java | BNFHeadersImpl.checkHeaderValue | private void checkHeaderValue(String data) {
// if the last character is a CR or LF, then this fails
int index = data.length() - 1;
if (index < 0) {
// empty string, quit now with success
return;
}
String error = null;
char c = data.charAt(index);
if (BNFHeaders.LF == c || BNFHeaders.CR == c) {
error = "Illegal trailing EOL";
}
// scan through the data now for invalid CRLF presence. Note that CRLFs
// may be followed by whitespace for valid multiline headers.
for (int i = 0; null == error && i < index; i++) {
c = data.charAt(i);
if (BNFHeaders.CR == c) {
// next char must be an LF
if (BNFHeaders.LF != data.charAt(i + 1)) {
error = "Invalid CR not followed by LF";
}
} else if (BNFHeaders.LF == c) {
c = data.charAt(++i);
// if it is not followed by whitespace then this value is bad
if (BNFHeaders.TAB != c && BNFHeaders.SPACE != c) {
error = "Invalid LF not followed by whitespace";
}
}
}
// if we found an error, throw the exception now
if (null != error) {
IllegalArgumentException iae = new IllegalArgumentException(error);
FFDCFilter.processException(iae, getClass().getName() + ".checkHeaderValue(String)", "1", this);
throw iae;
}
} | java | private void checkHeaderValue(String data) {
// if the last character is a CR or LF, then this fails
int index = data.length() - 1;
if (index < 0) {
// empty string, quit now with success
return;
}
String error = null;
char c = data.charAt(index);
if (BNFHeaders.LF == c || BNFHeaders.CR == c) {
error = "Illegal trailing EOL";
}
// scan through the data now for invalid CRLF presence. Note that CRLFs
// may be followed by whitespace for valid multiline headers.
for (int i = 0; null == error && i < index; i++) {
c = data.charAt(i);
if (BNFHeaders.CR == c) {
// next char must be an LF
if (BNFHeaders.LF != data.charAt(i + 1)) {
error = "Invalid CR not followed by LF";
}
} else if (BNFHeaders.LF == c) {
c = data.charAt(++i);
// if it is not followed by whitespace then this value is bad
if (BNFHeaders.TAB != c && BNFHeaders.SPACE != c) {
error = "Invalid LF not followed by whitespace";
}
}
}
// if we found an error, throw the exception now
if (null != error) {
IllegalArgumentException iae = new IllegalArgumentException(error);
FFDCFilter.processException(iae, getClass().getName() + ".checkHeaderValue(String)", "1", this);
throw iae;
}
} | [
"private",
"void",
"checkHeaderValue",
"(",
"String",
"data",
")",
"{",
"// if the last character is a CR or LF, then this fails",
"int",
"index",
"=",
"data",
".",
"length",
"(",
")",
"-",
"1",
";",
"if",
"(",
"index",
"<",
"0",
")",
"{",
"// empty string, quit now with success",
"return",
";",
"}",
"String",
"error",
"=",
"null",
";",
"char",
"c",
"=",
"data",
".",
"charAt",
"(",
"index",
")",
";",
"if",
"(",
"BNFHeaders",
".",
"LF",
"==",
"c",
"||",
"BNFHeaders",
".",
"CR",
"==",
"c",
")",
"{",
"error",
"=",
"\"Illegal trailing EOL\"",
";",
"}",
"// scan through the data now for invalid CRLF presence. Note that CRLFs",
"// may be followed by whitespace for valid multiline headers.",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"null",
"==",
"error",
"&&",
"i",
"<",
"index",
";",
"i",
"++",
")",
"{",
"c",
"=",
"data",
".",
"charAt",
"(",
"i",
")",
";",
"if",
"(",
"BNFHeaders",
".",
"CR",
"==",
"c",
")",
"{",
"// next char must be an LF",
"if",
"(",
"BNFHeaders",
".",
"LF",
"!=",
"data",
".",
"charAt",
"(",
"i",
"+",
"1",
")",
")",
"{",
"error",
"=",
"\"Invalid CR not followed by LF\"",
";",
"}",
"}",
"else",
"if",
"(",
"BNFHeaders",
".",
"LF",
"==",
"c",
")",
"{",
"c",
"=",
"data",
".",
"charAt",
"(",
"++",
"i",
")",
";",
"// if it is not followed by whitespace then this value is bad",
"if",
"(",
"BNFHeaders",
".",
"TAB",
"!=",
"c",
"&&",
"BNFHeaders",
".",
"SPACE",
"!=",
"c",
")",
"{",
"error",
"=",
"\"Invalid LF not followed by whitespace\"",
";",
"}",
"}",
"}",
"// if we found an error, throw the exception now",
"if",
"(",
"null",
"!=",
"error",
")",
"{",
"IllegalArgumentException",
"iae",
"=",
"new",
"IllegalArgumentException",
"(",
"error",
")",
";",
"FFDCFilter",
".",
"processException",
"(",
"iae",
",",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
"+",
"\".checkHeaderValue(String)\"",
",",
"\"1\"",
",",
"this",
")",
";",
"throw",
"iae",
";",
"}",
"}"
] | Check the input header value for validity.
@param data
@exception IllegalArgumentException if invalid | [
"Check",
"the",
"input",
"header",
"value",
"for",
"validity",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java#L2946-L2983 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java | BNFHeadersImpl.countInstances | private int countInstances(HeaderElement root) {
int count = 0;
HeaderElement elem = root;
while (null != elem) {
if (!elem.wasRemoved()) {
count++;
}
elem = elem.nextInstance;
}
return count;
} | java | private int countInstances(HeaderElement root) {
int count = 0;
HeaderElement elem = root;
while (null != elem) {
if (!elem.wasRemoved()) {
count++;
}
elem = elem.nextInstance;
}
return count;
} | [
"private",
"int",
"countInstances",
"(",
"HeaderElement",
"root",
")",
"{",
"int",
"count",
"=",
"0",
";",
"HeaderElement",
"elem",
"=",
"root",
";",
"while",
"(",
"null",
"!=",
"elem",
")",
"{",
"if",
"(",
"!",
"elem",
".",
"wasRemoved",
"(",
")",
")",
"{",
"count",
"++",
";",
"}",
"elem",
"=",
"elem",
".",
"nextInstance",
";",
"}",
"return",
"count",
";",
"}"
] | Count the number of instances of this header starting at the given
element.
@param root
@return int | [
"Count",
"the",
"number",
"of",
"instances",
"of",
"this",
"header",
"starting",
"at",
"the",
"given",
"element",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java#L2992-L3002 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java | BNFHeadersImpl.skipWhiteSpace | private boolean skipWhiteSpace(WsByteBuffer buff) {
// keep reading until we hit the end of the buffer or a non-space char
byte b;
do {
if (this.bytePosition >= this.byteLimit) {
if (!fillByteCache(buff)) {
// not filled
return false;
}
}
b = this.byteCache[this.bytePosition++];
} while (BNFHeaders.SPACE == b || BNFHeaders.TAB == b);
// move byte position back one.
this.bytePosition--;
return true;
} | java | private boolean skipWhiteSpace(WsByteBuffer buff) {
// keep reading until we hit the end of the buffer or a non-space char
byte b;
do {
if (this.bytePosition >= this.byteLimit) {
if (!fillByteCache(buff)) {
// not filled
return false;
}
}
b = this.byteCache[this.bytePosition++];
} while (BNFHeaders.SPACE == b || BNFHeaders.TAB == b);
// move byte position back one.
this.bytePosition--;
return true;
} | [
"private",
"boolean",
"skipWhiteSpace",
"(",
"WsByteBuffer",
"buff",
")",
"{",
"// keep reading until we hit the end of the buffer or a non-space char",
"byte",
"b",
";",
"do",
"{",
"if",
"(",
"this",
".",
"bytePosition",
">=",
"this",
".",
"byteLimit",
")",
"{",
"if",
"(",
"!",
"fillByteCache",
"(",
"buff",
")",
")",
"{",
"// not filled",
"return",
"false",
";",
"}",
"}",
"b",
"=",
"this",
".",
"byteCache",
"[",
"this",
".",
"bytePosition",
"++",
"]",
";",
"}",
"while",
"(",
"BNFHeaders",
".",
"SPACE",
"==",
"b",
"||",
"BNFHeaders",
".",
"TAB",
"==",
"b",
")",
";",
"// move byte position back one.",
"this",
".",
"bytePosition",
"--",
";",
"return",
"true",
";",
"}"
] | Skip any whitespace that might be at the start of this buffer.
@param buff
@return boolean (true if found non whitespace, false if end
of buffer found) | [
"Skip",
"any",
"whitespace",
"that",
"might",
"be",
"at",
"the",
"start",
"of",
"this",
"buffer",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java#L3011-L3027 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java | BNFHeadersImpl.addInstanceOfElement | private boolean addInstanceOfElement(HeaderElement root, HeaderElement elem) {
// first add to the overall sequence list
if (null == this.hdrSequence) {
this.hdrSequence = elem;
this.lastHdrInSequence = elem;
} else {
// find the end of the list and append this new element
this.lastHdrInSequence.nextSequence = elem;
elem.prevSequence = this.lastHdrInSequence;
this.lastHdrInSequence = elem;
}
if (null == root) {
return true;
}
HeaderElement prev = root;
while (null != prev.nextInstance) {
prev = prev.nextInstance;
}
prev.nextInstance = elem;
return false;
} | java | private boolean addInstanceOfElement(HeaderElement root, HeaderElement elem) {
// first add to the overall sequence list
if (null == this.hdrSequence) {
this.hdrSequence = elem;
this.lastHdrInSequence = elem;
} else {
// find the end of the list and append this new element
this.lastHdrInSequence.nextSequence = elem;
elem.prevSequence = this.lastHdrInSequence;
this.lastHdrInSequence = elem;
}
if (null == root) {
return true;
}
HeaderElement prev = root;
while (null != prev.nextInstance) {
prev = prev.nextInstance;
}
prev.nextInstance = elem;
return false;
} | [
"private",
"boolean",
"addInstanceOfElement",
"(",
"HeaderElement",
"root",
",",
"HeaderElement",
"elem",
")",
"{",
"// first add to the overall sequence list",
"if",
"(",
"null",
"==",
"this",
".",
"hdrSequence",
")",
"{",
"this",
".",
"hdrSequence",
"=",
"elem",
";",
"this",
".",
"lastHdrInSequence",
"=",
"elem",
";",
"}",
"else",
"{",
"// find the end of the list and append this new element",
"this",
".",
"lastHdrInSequence",
".",
"nextSequence",
"=",
"elem",
";",
"elem",
".",
"prevSequence",
"=",
"this",
".",
"lastHdrInSequence",
";",
"this",
".",
"lastHdrInSequence",
"=",
"elem",
";",
"}",
"if",
"(",
"null",
"==",
"root",
")",
"{",
"return",
"true",
";",
"}",
"HeaderElement",
"prev",
"=",
"root",
";",
"while",
"(",
"null",
"!=",
"prev",
".",
"nextInstance",
")",
"{",
"prev",
"=",
"prev",
".",
"nextInstance",
";",
"}",
"prev",
".",
"nextInstance",
"=",
"elem",
";",
"return",
"false",
";",
"}"
] | Helper method to add a new instance of a HeaderElement to
root's internal list. This might be the first instance, or an
additional instance in which case it will be added at the end
of the list.
@param root
@param elem
@return boolean | [
"Helper",
"method",
"to",
"add",
"a",
"new",
"instance",
"of",
"a",
"HeaderElement",
"to",
"root",
"s",
"internal",
"list",
".",
"This",
"might",
"be",
"the",
"first",
"instance",
"or",
"an",
"additional",
"instance",
"in",
"which",
"case",
"it",
"will",
"be",
"added",
"at",
"the",
"end",
"of",
"the",
"list",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java#L3043-L3063 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java | BNFHeadersImpl.putInt | protected WsByteBuffer[] putInt(int data, WsByteBuffer[] buffers) {
return putBytes(GenericUtils.asBytes(data), buffers);
} | java | protected WsByteBuffer[] putInt(int data, WsByteBuffer[] buffers) {
return putBytes(GenericUtils.asBytes(data), buffers);
} | [
"protected",
"WsByteBuffer",
"[",
"]",
"putInt",
"(",
"int",
"data",
",",
"WsByteBuffer",
"[",
"]",
"buffers",
")",
"{",
"return",
"putBytes",
"(",
"GenericUtils",
".",
"asBytes",
"(",
"data",
")",
",",
"buffers",
")",
";",
"}"
] | Place the input int value into the outgoing cache. This will return
the buffer array as it may have changed if the cache need to be flushed.
@param data
@param buffers
@return WsByteBuffer[] | [
"Place",
"the",
"input",
"int",
"value",
"into",
"the",
"outgoing",
"cache",
".",
"This",
"will",
"return",
"the",
"buffer",
"array",
"as",
"it",
"may",
"have",
"changed",
"if",
"the",
"cache",
"need",
"to",
"be",
"flushed",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java#L3073-L3075 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java | BNFHeadersImpl.flushCache | protected WsByteBuffer[] flushCache(WsByteBuffer[] buffers) {
// PK13351 - use the offset/length version to write only what we need
// to and avoid the extra memory allocation
int pos = this.bytePosition;
if (0 == pos) {
// nothing to write
return buffers;
}
this.bytePosition = 0;
return GenericUtils.putByteArray(buffers, this.byteCache, 0, pos, this);
} | java | protected WsByteBuffer[] flushCache(WsByteBuffer[] buffers) {
// PK13351 - use the offset/length version to write only what we need
// to and avoid the extra memory allocation
int pos = this.bytePosition;
if (0 == pos) {
// nothing to write
return buffers;
}
this.bytePosition = 0;
return GenericUtils.putByteArray(buffers, this.byteCache, 0, pos, this);
} | [
"protected",
"WsByteBuffer",
"[",
"]",
"flushCache",
"(",
"WsByteBuffer",
"[",
"]",
"buffers",
")",
"{",
"// PK13351 - use the offset/length version to write only what we need",
"// to and avoid the extra memory allocation",
"int",
"pos",
"=",
"this",
".",
"bytePosition",
";",
"if",
"(",
"0",
"==",
"pos",
")",
"{",
"// nothing to write",
"return",
"buffers",
";",
"}",
"this",
".",
"bytePosition",
"=",
"0",
";",
"return",
"GenericUtils",
".",
"putByteArray",
"(",
"buffers",
",",
"this",
".",
"byteCache",
",",
"0",
",",
"pos",
",",
"this",
")",
";",
"}"
] | Method to flush whatever is in the cache into the input buffers. These
buffers are then returned to the caller as the flush may have needed to
expand the list.
@param buffers
@return WsByteBuffer[] | [
"Method",
"to",
"flush",
"whatever",
"is",
"in",
"the",
"cache",
"into",
"the",
"input",
"buffers",
".",
"These",
"buffers",
"are",
"then",
"returned",
"to",
"the",
"caller",
"as",
"the",
"flush",
"may",
"have",
"needed",
"to",
"expand",
"the",
"list",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java#L3183-L3193 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java | BNFHeadersImpl.decrementBytePositionIgnoringLFs | final protected void decrementBytePositionIgnoringLFs() {
// PK15898 - added for just LF after first line
this.bytePosition--;
if (BNFHeaders.LF == this.byteCache[this.bytePosition]) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "decrementILF found an LF character");
}
this.bytePosition++;
}
} | java | final protected void decrementBytePositionIgnoringLFs() {
// PK15898 - added for just LF after first line
this.bytePosition--;
if (BNFHeaders.LF == this.byteCache[this.bytePosition]) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "decrementILF found an LF character");
}
this.bytePosition++;
}
} | [
"final",
"protected",
"void",
"decrementBytePositionIgnoringLFs",
"(",
")",
"{",
"// PK15898 - added for just LF after first line",
"this",
".",
"bytePosition",
"--",
";",
"if",
"(",
"BNFHeaders",
".",
"LF",
"==",
"this",
".",
"byteCache",
"[",
"this",
".",
"bytePosition",
"]",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"decrementILF found an LF character\"",
")",
";",
"}",
"this",
".",
"bytePosition",
"++",
";",
"}",
"}"
] | Decrement the byte position unless it points to an LF character, in which
case just leave the byte position alone. | [
"Decrement",
"the",
"byte",
"position",
"unless",
"it",
"points",
"to",
"an",
"LF",
"character",
"in",
"which",
"case",
"just",
"leave",
"the",
"byte",
"position",
"alone",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java#L3212-L3221 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java | BNFHeadersImpl.resetCacheToken | final protected void resetCacheToken(int len) {
if (null == this.parsedToken || len != this.parsedToken.length) {
this.parsedToken = new byte[len];
}
this.parsedTokenLength = 0;
} | java | final protected void resetCacheToken(int len) {
if (null == this.parsedToken || len != this.parsedToken.length) {
this.parsedToken = new byte[len];
}
this.parsedTokenLength = 0;
} | [
"final",
"protected",
"void",
"resetCacheToken",
"(",
"int",
"len",
")",
"{",
"if",
"(",
"null",
"==",
"this",
".",
"parsedToken",
"||",
"len",
"!=",
"this",
".",
"parsedToken",
".",
"length",
")",
"{",
"this",
".",
"parsedToken",
"=",
"new",
"byte",
"[",
"len",
"]",
";",
"}",
"this",
".",
"parsedTokenLength",
"=",
"0",
";",
"}"
] | Reset the parse byte token based on the input length. If the existing
array is the same size, then this is a simple reset. This is intended
to only be used when the contents have already been extracted and can
be overwritten with new data.
@param len | [
"Reset",
"the",
"parse",
"byte",
"token",
"based",
"on",
"the",
"input",
"length",
".",
"If",
"the",
"existing",
"array",
"is",
"the",
"same",
"size",
"then",
"this",
"is",
"a",
"simple",
"reset",
".",
"This",
"is",
"intended",
"to",
"only",
"be",
"used",
"when",
"the",
"contents",
"have",
"already",
"been",
"extracted",
"and",
"can",
"be",
"overwritten",
"with",
"new",
"data",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java#L3251-L3256 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java | BNFHeadersImpl.fillCacheToken | final protected boolean fillCacheToken(WsByteBuffer buff) {
// figure out how much we have left to copy out, append to any existing
// parsed token (multiple passes through here).
int curr_len = this.parsedTokenLength;
int need_len = this.parsedToken.length - curr_len;
int copy_len = need_len;
// keep going until we have all we need or we run out of buffer data
while (0 < need_len) {
if (this.bytePosition >= this.byteLimit) {
if (!fillByteCache(buff)) {
// save a reference to how much we've pulled so far
this.parsedTokenLength = curr_len;
return false;
}
}
// byte cache is now prepped
int available = this.byteLimit - this.bytePosition;
if (available < need_len) {
// copy what we can from the current cache
copy_len = available;
} else {
copy_len = need_len;
}
// copy new data into the existing space
System.arraycopy(this.byteCache, this.bytePosition, this.parsedToken, curr_len, copy_len);
need_len -= copy_len;
curr_len += copy_len;
this.bytePosition += copy_len;
}
return true;
} | java | final protected boolean fillCacheToken(WsByteBuffer buff) {
// figure out how much we have left to copy out, append to any existing
// parsed token (multiple passes through here).
int curr_len = this.parsedTokenLength;
int need_len = this.parsedToken.length - curr_len;
int copy_len = need_len;
// keep going until we have all we need or we run out of buffer data
while (0 < need_len) {
if (this.bytePosition >= this.byteLimit) {
if (!fillByteCache(buff)) {
// save a reference to how much we've pulled so far
this.parsedTokenLength = curr_len;
return false;
}
}
// byte cache is now prepped
int available = this.byteLimit - this.bytePosition;
if (available < need_len) {
// copy what we can from the current cache
copy_len = available;
} else {
copy_len = need_len;
}
// copy new data into the existing space
System.arraycopy(this.byteCache, this.bytePosition, this.parsedToken, curr_len, copy_len);
need_len -= copy_len;
curr_len += copy_len;
this.bytePosition += copy_len;
}
return true;
} | [
"final",
"protected",
"boolean",
"fillCacheToken",
"(",
"WsByteBuffer",
"buff",
")",
"{",
"// figure out how much we have left to copy out, append to any existing",
"// parsed token (multiple passes through here).",
"int",
"curr_len",
"=",
"this",
".",
"parsedTokenLength",
";",
"int",
"need_len",
"=",
"this",
".",
"parsedToken",
".",
"length",
"-",
"curr_len",
";",
"int",
"copy_len",
"=",
"need_len",
";",
"// keep going until we have all we need or we run out of buffer data",
"while",
"(",
"0",
"<",
"need_len",
")",
"{",
"if",
"(",
"this",
".",
"bytePosition",
">=",
"this",
".",
"byteLimit",
")",
"{",
"if",
"(",
"!",
"fillByteCache",
"(",
"buff",
")",
")",
"{",
"// save a reference to how much we've pulled so far",
"this",
".",
"parsedTokenLength",
"=",
"curr_len",
";",
"return",
"false",
";",
"}",
"}",
"// byte cache is now prepped",
"int",
"available",
"=",
"this",
".",
"byteLimit",
"-",
"this",
".",
"bytePosition",
";",
"if",
"(",
"available",
"<",
"need_len",
")",
"{",
"// copy what we can from the current cache",
"copy_len",
"=",
"available",
";",
"}",
"else",
"{",
"copy_len",
"=",
"need_len",
";",
"}",
"// copy new data into the existing space",
"System",
".",
"arraycopy",
"(",
"this",
".",
"byteCache",
",",
"this",
".",
"bytePosition",
",",
"this",
".",
"parsedToken",
",",
"curr_len",
",",
"copy_len",
")",
";",
"need_len",
"-=",
"copy_len",
";",
"curr_len",
"+=",
"copy_len",
";",
"this",
".",
"bytePosition",
"+=",
"copy_len",
";",
"}",
"return",
"true",
";",
"}"
] | Method to fill the parse token from the given input buffer. The token
array must have been created prior to this attempt to fill it.
@param buff
@return boolean (true means success) | [
"Method",
"to",
"fill",
"the",
"parse",
"token",
"from",
"the",
"given",
"input",
"buffer",
".",
"The",
"token",
"array",
"must",
"have",
"been",
"created",
"prior",
"to",
"this",
"attempt",
"to",
"fill",
"it",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java#L3265-L3297 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java | BNFHeadersImpl.fillByteCache | protected boolean fillByteCache(WsByteBuffer buff) {
if (this.bytePosition < this.byteLimit) {
return false;
}
int size = buff.remaining();
if (size > this.byteCacheSize) {
// truncate to just fill up the cache
size = this.byteCacheSize;
}
this.bytePosition = 0;
this.byteLimit = size;
if (0 == this.byteLimit) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "fillByteCache: no data");
}
return false;
}
if (HeaderStorage.NOTSET != this.headerChangeLimit && -1 != this.parseIndex
&& -1 == this.parseBuffersStartPos[this.parseIndex]) {
// first occurrance of this buffer and we're keeping track of changes
this.parseBuffersStartPos[this.parseIndex] = buff.position();
}
buff.get(this.byteCache, this.bytePosition, this.byteLimit);
return true;
} | java | protected boolean fillByteCache(WsByteBuffer buff) {
if (this.bytePosition < this.byteLimit) {
return false;
}
int size = buff.remaining();
if (size > this.byteCacheSize) {
// truncate to just fill up the cache
size = this.byteCacheSize;
}
this.bytePosition = 0;
this.byteLimit = size;
if (0 == this.byteLimit) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "fillByteCache: no data");
}
return false;
}
if (HeaderStorage.NOTSET != this.headerChangeLimit && -1 != this.parseIndex
&& -1 == this.parseBuffersStartPos[this.parseIndex]) {
// first occurrance of this buffer and we're keeping track of changes
this.parseBuffersStartPos[this.parseIndex] = buff.position();
}
buff.get(this.byteCache, this.bytePosition, this.byteLimit);
return true;
} | [
"protected",
"boolean",
"fillByteCache",
"(",
"WsByteBuffer",
"buff",
")",
"{",
"if",
"(",
"this",
".",
"bytePosition",
"<",
"this",
".",
"byteLimit",
")",
"{",
"return",
"false",
";",
"}",
"int",
"size",
"=",
"buff",
".",
"remaining",
"(",
")",
";",
"if",
"(",
"size",
">",
"this",
".",
"byteCacheSize",
")",
"{",
"// truncate to just fill up the cache",
"size",
"=",
"this",
".",
"byteCacheSize",
";",
"}",
"this",
".",
"bytePosition",
"=",
"0",
";",
"this",
".",
"byteLimit",
"=",
"size",
";",
"if",
"(",
"0",
"==",
"this",
".",
"byteLimit",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"fillByteCache: no data\"",
")",
";",
"}",
"return",
"false",
";",
"}",
"if",
"(",
"HeaderStorage",
".",
"NOTSET",
"!=",
"this",
".",
"headerChangeLimit",
"&&",
"-",
"1",
"!=",
"this",
".",
"parseIndex",
"&&",
"-",
"1",
"==",
"this",
".",
"parseBuffersStartPos",
"[",
"this",
".",
"parseIndex",
"]",
")",
"{",
"// first occurrance of this buffer and we're keeping track of changes",
"this",
".",
"parseBuffersStartPos",
"[",
"this",
".",
"parseIndex",
"]",
"=",
"buff",
".",
"position",
"(",
")",
";",
"}",
"buff",
".",
"get",
"(",
"this",
".",
"byteCache",
",",
"this",
".",
"bytePosition",
",",
"this",
".",
"byteLimit",
")",
";",
"return",
"true",
";",
"}"
] | Fills the byte cache.
@param buff
@return true on success and false on failure. | [
"Fills",
"the",
"byte",
"cache",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java#L3305-L3331 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java | BNFHeadersImpl.findCRLFTokenLength | protected TokenCodes findCRLFTokenLength(WsByteBuffer buff) throws MalformedMessageException {
TokenCodes rc = TokenCodes.TOKEN_RC_MOREDATA;
if (null == buff) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Null buffer provided");
}
return rc;
}
// start with any pre-existing data
int length = this.parsedTokenLength;
byte b;
while (true) {
if (this.bytePosition >= this.byteLimit) {
if (!fillByteCache(buff)) {
// no more data
break;
}
}
b = this.byteCache[this.bytePosition++];
// check for a CRLF
if (BNFHeaders.CR == b) {
rc = TokenCodes.TOKEN_RC_DELIM;
if (HeaderStorage.NOTSET != this.headerChangeLimit) {
this.lastCRLFPosition = findCurrentBufferPosition(buff) - 1;
this.lastCRLFBufferIndex = this.parseIndex;
this.lastCRLFisCR = true;
}
break; // out of while
} else if (BNFHeaders.LF == b) {
// update counter if linefeed found
rc = TokenCodes.TOKEN_RC_DELIM;
this.numCRLFs = 1;
if (HeaderStorage.NOTSET != this.headerChangeLimit) {
this.lastCRLFPosition = findCurrentBufferPosition(buff) - 1;
this.lastCRLFBufferIndex = this.parseIndex;
this.lastCRLFisCR = false;
}
break; // out of while
}
length++;
// check the limit on a token size
if (length > this.limitTokenSize) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "findCRLFTokenLength: length is too big: " + length);
}
throw new MalformedMessageException("Token length: " + length);
}
} // end of the while
this.parsedTokenLength = length;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "findCRLFTokenLength returning " + rc.getName() + "; len=" + length);
}
return rc;
} | java | protected TokenCodes findCRLFTokenLength(WsByteBuffer buff) throws MalformedMessageException {
TokenCodes rc = TokenCodes.TOKEN_RC_MOREDATA;
if (null == buff) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Null buffer provided");
}
return rc;
}
// start with any pre-existing data
int length = this.parsedTokenLength;
byte b;
while (true) {
if (this.bytePosition >= this.byteLimit) {
if (!fillByteCache(buff)) {
// no more data
break;
}
}
b = this.byteCache[this.bytePosition++];
// check for a CRLF
if (BNFHeaders.CR == b) {
rc = TokenCodes.TOKEN_RC_DELIM;
if (HeaderStorage.NOTSET != this.headerChangeLimit) {
this.lastCRLFPosition = findCurrentBufferPosition(buff) - 1;
this.lastCRLFBufferIndex = this.parseIndex;
this.lastCRLFisCR = true;
}
break; // out of while
} else if (BNFHeaders.LF == b) {
// update counter if linefeed found
rc = TokenCodes.TOKEN_RC_DELIM;
this.numCRLFs = 1;
if (HeaderStorage.NOTSET != this.headerChangeLimit) {
this.lastCRLFPosition = findCurrentBufferPosition(buff) - 1;
this.lastCRLFBufferIndex = this.parseIndex;
this.lastCRLFisCR = false;
}
break; // out of while
}
length++;
// check the limit on a token size
if (length > this.limitTokenSize) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "findCRLFTokenLength: length is too big: " + length);
}
throw new MalformedMessageException("Token length: " + length);
}
} // end of the while
this.parsedTokenLength = length;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "findCRLFTokenLength returning " + rc.getName() + "; len=" + length);
}
return rc;
} | [
"protected",
"TokenCodes",
"findCRLFTokenLength",
"(",
"WsByteBuffer",
"buff",
")",
"throws",
"MalformedMessageException",
"{",
"TokenCodes",
"rc",
"=",
"TokenCodes",
".",
"TOKEN_RC_MOREDATA",
";",
"if",
"(",
"null",
"==",
"buff",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Null buffer provided\"",
")",
";",
"}",
"return",
"rc",
";",
"}",
"// start with any pre-existing data",
"int",
"length",
"=",
"this",
".",
"parsedTokenLength",
";",
"byte",
"b",
";",
"while",
"(",
"true",
")",
"{",
"if",
"(",
"this",
".",
"bytePosition",
">=",
"this",
".",
"byteLimit",
")",
"{",
"if",
"(",
"!",
"fillByteCache",
"(",
"buff",
")",
")",
"{",
"// no more data",
"break",
";",
"}",
"}",
"b",
"=",
"this",
".",
"byteCache",
"[",
"this",
".",
"bytePosition",
"++",
"]",
";",
"// check for a CRLF",
"if",
"(",
"BNFHeaders",
".",
"CR",
"==",
"b",
")",
"{",
"rc",
"=",
"TokenCodes",
".",
"TOKEN_RC_DELIM",
";",
"if",
"(",
"HeaderStorage",
".",
"NOTSET",
"!=",
"this",
".",
"headerChangeLimit",
")",
"{",
"this",
".",
"lastCRLFPosition",
"=",
"findCurrentBufferPosition",
"(",
"buff",
")",
"-",
"1",
";",
"this",
".",
"lastCRLFBufferIndex",
"=",
"this",
".",
"parseIndex",
";",
"this",
".",
"lastCRLFisCR",
"=",
"true",
";",
"}",
"break",
";",
"// out of while",
"}",
"else",
"if",
"(",
"BNFHeaders",
".",
"LF",
"==",
"b",
")",
"{",
"// update counter if linefeed found",
"rc",
"=",
"TokenCodes",
".",
"TOKEN_RC_DELIM",
";",
"this",
".",
"numCRLFs",
"=",
"1",
";",
"if",
"(",
"HeaderStorage",
".",
"NOTSET",
"!=",
"this",
".",
"headerChangeLimit",
")",
"{",
"this",
".",
"lastCRLFPosition",
"=",
"findCurrentBufferPosition",
"(",
"buff",
")",
"-",
"1",
";",
"this",
".",
"lastCRLFBufferIndex",
"=",
"this",
".",
"parseIndex",
";",
"this",
".",
"lastCRLFisCR",
"=",
"false",
";",
"}",
"break",
";",
"// out of while",
"}",
"length",
"++",
";",
"// check the limit on a token size",
"if",
"(",
"length",
">",
"this",
".",
"limitTokenSize",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"findCRLFTokenLength: length is too big: \"",
"+",
"length",
")",
";",
"}",
"throw",
"new",
"MalformedMessageException",
"(",
"\"Token length: \"",
"+",
"length",
")",
";",
"}",
"}",
"// end of the while",
"this",
".",
"parsedTokenLength",
"=",
"length",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"findCRLFTokenLength returning \"",
"+",
"rc",
".",
"getName",
"(",
")",
"+",
"\"; len=\"",
"+",
"length",
")",
";",
"}",
"return",
"rc",
";",
"}"
] | Parse a CRLF delimited token and return the length of the token.
@param buff
@return TokenCodes (global length variable is set to parsed length)
@throws MalformedMessageException | [
"Parse",
"a",
"CRLF",
"delimited",
"token",
"and",
"return",
"the",
"length",
"of",
"the",
"token",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java#L3351-L3410 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java | BNFHeadersImpl.skipCRLFs | protected TokenCodes skipCRLFs(WsByteBuffer buffer) {
int maxCRLFs = 33;
// limit is the max number of CRLFs to skip
if (this.bytePosition >= this.byteLimit) {
if (!fillByteCache(buffer)) {
// no more data
return TokenCodes.TOKEN_RC_MOREDATA;
}
}
byte b = this.byteCache[this.bytePosition++];
for (int i = 0; i < maxCRLFs; i++) {
if (-1 == b) {
// ran out of data
return TokenCodes.TOKEN_RC_MOREDATA;
}
if (BNFHeaders.CR != b && BNFHeaders.LF != b) {
// stopped on non-CRLF character, reset position
this.bytePosition--;
return TokenCodes.TOKEN_RC_DELIM;
}
// keep going otherwise
if (this.bytePosition >= this.byteLimit) {
return TokenCodes.TOKEN_RC_MOREDATA;
}
b = this.byteCache[this.bytePosition++];
}
// found too many CRLFs... invalid
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Too many leading CRLFs found");
}
return TokenCodes.TOKEN_RC_CRLF;
} | java | protected TokenCodes skipCRLFs(WsByteBuffer buffer) {
int maxCRLFs = 33;
// limit is the max number of CRLFs to skip
if (this.bytePosition >= this.byteLimit) {
if (!fillByteCache(buffer)) {
// no more data
return TokenCodes.TOKEN_RC_MOREDATA;
}
}
byte b = this.byteCache[this.bytePosition++];
for (int i = 0; i < maxCRLFs; i++) {
if (-1 == b) {
// ran out of data
return TokenCodes.TOKEN_RC_MOREDATA;
}
if (BNFHeaders.CR != b && BNFHeaders.LF != b) {
// stopped on non-CRLF character, reset position
this.bytePosition--;
return TokenCodes.TOKEN_RC_DELIM;
}
// keep going otherwise
if (this.bytePosition >= this.byteLimit) {
return TokenCodes.TOKEN_RC_MOREDATA;
}
b = this.byteCache[this.bytePosition++];
}
// found too many CRLFs... invalid
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Too many leading CRLFs found");
}
return TokenCodes.TOKEN_RC_CRLF;
} | [
"protected",
"TokenCodes",
"skipCRLFs",
"(",
"WsByteBuffer",
"buffer",
")",
"{",
"int",
"maxCRLFs",
"=",
"33",
";",
"// limit is the max number of CRLFs to skip",
"if",
"(",
"this",
".",
"bytePosition",
">=",
"this",
".",
"byteLimit",
")",
"{",
"if",
"(",
"!",
"fillByteCache",
"(",
"buffer",
")",
")",
"{",
"// no more data",
"return",
"TokenCodes",
".",
"TOKEN_RC_MOREDATA",
";",
"}",
"}",
"byte",
"b",
"=",
"this",
".",
"byteCache",
"[",
"this",
".",
"bytePosition",
"++",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"maxCRLFs",
";",
"i",
"++",
")",
"{",
"if",
"(",
"-",
"1",
"==",
"b",
")",
"{",
"// ran out of data",
"return",
"TokenCodes",
".",
"TOKEN_RC_MOREDATA",
";",
"}",
"if",
"(",
"BNFHeaders",
".",
"CR",
"!=",
"b",
"&&",
"BNFHeaders",
".",
"LF",
"!=",
"b",
")",
"{",
"// stopped on non-CRLF character, reset position",
"this",
".",
"bytePosition",
"--",
";",
"return",
"TokenCodes",
".",
"TOKEN_RC_DELIM",
";",
"}",
"// keep going otherwise",
"if",
"(",
"this",
".",
"bytePosition",
">=",
"this",
".",
"byteLimit",
")",
"{",
"return",
"TokenCodes",
".",
"TOKEN_RC_MOREDATA",
";",
"}",
"b",
"=",
"this",
".",
"byteCache",
"[",
"this",
".",
"bytePosition",
"++",
"]",
";",
"}",
"// found too many CRLFs... invalid",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Too many leading CRLFs found\"",
")",
";",
"}",
"return",
"TokenCodes",
".",
"TOKEN_RC_CRLF",
";",
"}"
] | This method is used to skip leading CRLF characters. It will stop when
it finds a non-CRLF character, runs out of data, or finds too many CRLFs
@param buffer
@return TokenCodes -- MOREDATA means it ran out of buffer information,
DELIM means it found a non-CRLF character, and CRLF means it found
too many CRLFs | [
"This",
"method",
"is",
"used",
"to",
"skip",
"leading",
"CRLF",
"characters",
".",
"It",
"will",
"stop",
"when",
"it",
"finds",
"a",
"non",
"-",
"CRLF",
"character",
"runs",
"out",
"of",
"data",
"or",
"finds",
"too",
"many",
"CRLFs"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java#L3506-L3539 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java | BNFHeadersImpl.findHeaderLength | protected TokenCodes findHeaderLength(WsByteBuffer buff) throws MalformedMessageException {
TokenCodes rc = TokenCodes.TOKEN_RC_MOREDATA;
if (null == buff) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "findHeaderLength: null buffer provided");
}
return rc;
}
byte b;
int numSpaces = 0;
// start with any pre-existing data
int length = this.parsedTokenLength;
while (true) {
if (this.bytePosition >= this.byteLimit) {
if (!fillByteCache(buff)) {
// no more data
break;
}
}
b = this.byteCache[this.bytePosition++];
// look for the colon marking the end
if (BNFHeaders.COLON == b) {
length -= numSpaces; // remove any "trailing" white space
if (numSpaces > 0) {
//PI13987
//found trailing whitespace
this.foundTrailingWhitespace = true;
}
rc = TokenCodes.TOKEN_RC_DELIM;
break;
}
// if we hit whitespace, then keep track of the number of spaces so
// that we can easily trim that off at the end. This will end up
// ignoring whitespace that is inside the header name if that does
// happen
if (BNFHeaders.SPACE == b || BNFHeaders.TAB == b) {
numSpaces++;
} else {
// reset the counter on any non-space or colon
numSpaces = 0;
}
// check for possible CRLF
if (BNFHeaders.CR == b || BNFHeaders.LF == b) {
// Note: would be nice to print the failing data but would need
// to keep track of where we started inside here, then what about
// data straddling bytecaches, etc?
throw new MalformedMessageException("Invalid CRLF found in header name");
}
length++;
// check the limit on a token size
if (length > this.limitTokenSize) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "findTokenLength: length is too big: " + length);
}
throw new MalformedMessageException("Token length: " + length);
}
} // end of the while
this.parsedTokenLength = length;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "findHeaderLength: " + rc.getName() + "; len=" + length);
}
return rc;
} | java | protected TokenCodes findHeaderLength(WsByteBuffer buff) throws MalformedMessageException {
TokenCodes rc = TokenCodes.TOKEN_RC_MOREDATA;
if (null == buff) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "findHeaderLength: null buffer provided");
}
return rc;
}
byte b;
int numSpaces = 0;
// start with any pre-existing data
int length = this.parsedTokenLength;
while (true) {
if (this.bytePosition >= this.byteLimit) {
if (!fillByteCache(buff)) {
// no more data
break;
}
}
b = this.byteCache[this.bytePosition++];
// look for the colon marking the end
if (BNFHeaders.COLON == b) {
length -= numSpaces; // remove any "trailing" white space
if (numSpaces > 0) {
//PI13987
//found trailing whitespace
this.foundTrailingWhitespace = true;
}
rc = TokenCodes.TOKEN_RC_DELIM;
break;
}
// if we hit whitespace, then keep track of the number of spaces so
// that we can easily trim that off at the end. This will end up
// ignoring whitespace that is inside the header name if that does
// happen
if (BNFHeaders.SPACE == b || BNFHeaders.TAB == b) {
numSpaces++;
} else {
// reset the counter on any non-space or colon
numSpaces = 0;
}
// check for possible CRLF
if (BNFHeaders.CR == b || BNFHeaders.LF == b) {
// Note: would be nice to print the failing data but would need
// to keep track of where we started inside here, then what about
// data straddling bytecaches, etc?
throw new MalformedMessageException("Invalid CRLF found in header name");
}
length++;
// check the limit on a token size
if (length > this.limitTokenSize) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "findTokenLength: length is too big: " + length);
}
throw new MalformedMessageException("Token length: " + length);
}
} // end of the while
this.parsedTokenLength = length;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "findHeaderLength: " + rc.getName() + "; len=" + length);
}
return rc;
} | [
"protected",
"TokenCodes",
"findHeaderLength",
"(",
"WsByteBuffer",
"buff",
")",
"throws",
"MalformedMessageException",
"{",
"TokenCodes",
"rc",
"=",
"TokenCodes",
".",
"TOKEN_RC_MOREDATA",
";",
"if",
"(",
"null",
"==",
"buff",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"findHeaderLength: null buffer provided\"",
")",
";",
"}",
"return",
"rc",
";",
"}",
"byte",
"b",
";",
"int",
"numSpaces",
"=",
"0",
";",
"// start with any pre-existing data",
"int",
"length",
"=",
"this",
".",
"parsedTokenLength",
";",
"while",
"(",
"true",
")",
"{",
"if",
"(",
"this",
".",
"bytePosition",
">=",
"this",
".",
"byteLimit",
")",
"{",
"if",
"(",
"!",
"fillByteCache",
"(",
"buff",
")",
")",
"{",
"// no more data",
"break",
";",
"}",
"}",
"b",
"=",
"this",
".",
"byteCache",
"[",
"this",
".",
"bytePosition",
"++",
"]",
";",
"// look for the colon marking the end",
"if",
"(",
"BNFHeaders",
".",
"COLON",
"==",
"b",
")",
"{",
"length",
"-=",
"numSpaces",
";",
"// remove any \"trailing\" white space",
"if",
"(",
"numSpaces",
">",
"0",
")",
"{",
"//PI13987",
"//found trailing whitespace",
"this",
".",
"foundTrailingWhitespace",
"=",
"true",
";",
"}",
"rc",
"=",
"TokenCodes",
".",
"TOKEN_RC_DELIM",
";",
"break",
";",
"}",
"// if we hit whitespace, then keep track of the number of spaces so",
"// that we can easily trim that off at the end. This will end up",
"// ignoring whitespace that is inside the header name if that does",
"// happen",
"if",
"(",
"BNFHeaders",
".",
"SPACE",
"==",
"b",
"||",
"BNFHeaders",
".",
"TAB",
"==",
"b",
")",
"{",
"numSpaces",
"++",
";",
"}",
"else",
"{",
"// reset the counter on any non-space or colon",
"numSpaces",
"=",
"0",
";",
"}",
"// check for possible CRLF",
"if",
"(",
"BNFHeaders",
".",
"CR",
"==",
"b",
"||",
"BNFHeaders",
".",
"LF",
"==",
"b",
")",
"{",
"// Note: would be nice to print the failing data but would need",
"// to keep track of where we started inside here, then what about",
"// data straddling bytecaches, etc?",
"throw",
"new",
"MalformedMessageException",
"(",
"\"Invalid CRLF found in header name\"",
")",
";",
"}",
"length",
"++",
";",
"// check the limit on a token size",
"if",
"(",
"length",
">",
"this",
".",
"limitTokenSize",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"findTokenLength: length is too big: \"",
"+",
"length",
")",
";",
"}",
"throw",
"new",
"MalformedMessageException",
"(",
"\"Token length: \"",
"+",
"length",
")",
";",
"}",
"}",
"// end of the while",
"this",
".",
"parsedTokenLength",
"=",
"length",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"findHeaderLength: \"",
"+",
"rc",
".",
"getName",
"(",
")",
"+",
"\"; len=\"",
"+",
"length",
")",
";",
"}",
"return",
"rc",
";",
"}"
] | Parse a byte delimited token and return the length of the token.
@param buff
@return TokenCodes (global length variable is set to parsed length)
@throws MalformedMessageException | [
"Parse",
"a",
"byte",
"delimited",
"token",
"and",
"return",
"the",
"length",
"of",
"the",
"token",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java#L3659-L3732 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java | BNFHeadersImpl.parseHeaderName | private boolean parseHeaderName(WsByteBuffer buff) throws MalformedMessageException {
// if we're just starting, then skip leading white space characters
// otherwise ignore them (i.e we might be in the middle of
// "Mozilla/5.0 (Win"
if (null == this.parsedToken) {
if (!skipWhiteSpace(buff)) {
return false;
}
}
int start = findCurrentBufferPosition(buff);
int cachestart = this.bytePosition;
TokenCodes rc = findHeaderLength(buff);
if (TokenCodes.TOKEN_RC_MOREDATA.equals(rc)) {
// ran out of data
saveParsedToken(buff, start, false, LOG_FULL);
return false;
}
// could be in one single bytecache, otherwise we have to extract from
// buffer
byte[] data;
int length = this.parsedTokenLength;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "length=" + length
+ " pos=" + this.bytePosition + ", cachestart=" + cachestart
+ ", start=" + start + ", trailingWhitespace=" + this.foundTrailingWhitespace);
}
//PI13987 - Added the first argument to the if statement
if (!this.foundTrailingWhitespace && null == this.parsedToken && length < this.bytePosition) {
// it's all in the bytecache
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
//PI13987 - Modified the message being printed as we now print the same thing above
Tr.debug(tc, "Using bytecache");
}
data = this.byteCache;
start = cachestart;
} else {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
//PI13987
Tr.debug(tc, "Using bytebuffer");
}
saveParsedToken(buff, start, true, LOG_FULL);
data = this.parsedToken;
start = 0;
length = data.length;
}
// otherwise we found the entire length of the name
this.currentElem = getElement(findKey(data, start, length));
// Reset all the global variables once HeaderElement has been instantiated
if (HeaderStorage.NOTSET != this.headerChangeLimit) {
this.currentElem.updateLastCRLFInfo(this.lastCRLFBufferIndex, this.lastCRLFPosition, this.lastCRLFisCR);
}
this.stateOfParsing = PARSING_VALUE;
this.parsedToken = null;
this.parsedTokenLength = 0;
this.foundTrailingWhitespace = false; //PI13987
return true;
} | java | private boolean parseHeaderName(WsByteBuffer buff) throws MalformedMessageException {
// if we're just starting, then skip leading white space characters
// otherwise ignore them (i.e we might be in the middle of
// "Mozilla/5.0 (Win"
if (null == this.parsedToken) {
if (!skipWhiteSpace(buff)) {
return false;
}
}
int start = findCurrentBufferPosition(buff);
int cachestart = this.bytePosition;
TokenCodes rc = findHeaderLength(buff);
if (TokenCodes.TOKEN_RC_MOREDATA.equals(rc)) {
// ran out of data
saveParsedToken(buff, start, false, LOG_FULL);
return false;
}
// could be in one single bytecache, otherwise we have to extract from
// buffer
byte[] data;
int length = this.parsedTokenLength;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "length=" + length
+ " pos=" + this.bytePosition + ", cachestart=" + cachestart
+ ", start=" + start + ", trailingWhitespace=" + this.foundTrailingWhitespace);
}
//PI13987 - Added the first argument to the if statement
if (!this.foundTrailingWhitespace && null == this.parsedToken && length < this.bytePosition) {
// it's all in the bytecache
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
//PI13987 - Modified the message being printed as we now print the same thing above
Tr.debug(tc, "Using bytecache");
}
data = this.byteCache;
start = cachestart;
} else {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
//PI13987
Tr.debug(tc, "Using bytebuffer");
}
saveParsedToken(buff, start, true, LOG_FULL);
data = this.parsedToken;
start = 0;
length = data.length;
}
// otherwise we found the entire length of the name
this.currentElem = getElement(findKey(data, start, length));
// Reset all the global variables once HeaderElement has been instantiated
if (HeaderStorage.NOTSET != this.headerChangeLimit) {
this.currentElem.updateLastCRLFInfo(this.lastCRLFBufferIndex, this.lastCRLFPosition, this.lastCRLFisCR);
}
this.stateOfParsing = PARSING_VALUE;
this.parsedToken = null;
this.parsedTokenLength = 0;
this.foundTrailingWhitespace = false; //PI13987
return true;
} | [
"private",
"boolean",
"parseHeaderName",
"(",
"WsByteBuffer",
"buff",
")",
"throws",
"MalformedMessageException",
"{",
"// if we're just starting, then skip leading white space characters",
"// otherwise ignore them (i.e we might be in the middle of",
"// \"Mozilla/5.0 (Win\"",
"if",
"(",
"null",
"==",
"this",
".",
"parsedToken",
")",
"{",
"if",
"(",
"!",
"skipWhiteSpace",
"(",
"buff",
")",
")",
"{",
"return",
"false",
";",
"}",
"}",
"int",
"start",
"=",
"findCurrentBufferPosition",
"(",
"buff",
")",
";",
"int",
"cachestart",
"=",
"this",
".",
"bytePosition",
";",
"TokenCodes",
"rc",
"=",
"findHeaderLength",
"(",
"buff",
")",
";",
"if",
"(",
"TokenCodes",
".",
"TOKEN_RC_MOREDATA",
".",
"equals",
"(",
"rc",
")",
")",
"{",
"// ran out of data",
"saveParsedToken",
"(",
"buff",
",",
"start",
",",
"false",
",",
"LOG_FULL",
")",
";",
"return",
"false",
";",
"}",
"// could be in one single bytecache, otherwise we have to extract from",
"// buffer",
"byte",
"[",
"]",
"data",
";",
"int",
"length",
"=",
"this",
".",
"parsedTokenLength",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"length=\"",
"+",
"length",
"+",
"\" pos=\"",
"+",
"this",
".",
"bytePosition",
"+",
"\", cachestart=\"",
"+",
"cachestart",
"+",
"\", start=\"",
"+",
"start",
"+",
"\", trailingWhitespace=\"",
"+",
"this",
".",
"foundTrailingWhitespace",
")",
";",
"}",
"//PI13987 - Added the first argument to the if statement",
"if",
"(",
"!",
"this",
".",
"foundTrailingWhitespace",
"&&",
"null",
"==",
"this",
".",
"parsedToken",
"&&",
"length",
"<",
"this",
".",
"bytePosition",
")",
"{",
"// it's all in the bytecache",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"//PI13987 - Modified the message being printed as we now print the same thing above",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Using bytecache\"",
")",
";",
"}",
"data",
"=",
"this",
".",
"byteCache",
";",
"start",
"=",
"cachestart",
";",
"}",
"else",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"//PI13987",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Using bytebuffer\"",
")",
";",
"}",
"saveParsedToken",
"(",
"buff",
",",
"start",
",",
"true",
",",
"LOG_FULL",
")",
";",
"data",
"=",
"this",
".",
"parsedToken",
";",
"start",
"=",
"0",
";",
"length",
"=",
"data",
".",
"length",
";",
"}",
"// otherwise we found the entire length of the name",
"this",
".",
"currentElem",
"=",
"getElement",
"(",
"findKey",
"(",
"data",
",",
"start",
",",
"length",
")",
")",
";",
"// Reset all the global variables once HeaderElement has been instantiated",
"if",
"(",
"HeaderStorage",
".",
"NOTSET",
"!=",
"this",
".",
"headerChangeLimit",
")",
"{",
"this",
".",
"currentElem",
".",
"updateLastCRLFInfo",
"(",
"this",
".",
"lastCRLFBufferIndex",
",",
"this",
".",
"lastCRLFPosition",
",",
"this",
".",
"lastCRLFisCR",
")",
";",
"}",
"this",
".",
"stateOfParsing",
"=",
"PARSING_VALUE",
";",
"this",
".",
"parsedToken",
"=",
"null",
";",
"this",
".",
"parsedTokenLength",
"=",
"0",
";",
"this",
".",
"foundTrailingWhitespace",
"=",
"false",
";",
"//PI13987",
"return",
"true",
";",
"}"
] | Utility method to parse the header name from the input buffer.
@param buff
@return boolean (false means it needs more data, true otherwise)
@throws MalformedMessageException | [
"Utility",
"method",
"to",
"parse",
"the",
"header",
"name",
"from",
"the",
"input",
"buffer",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java#L3741-L3802 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java | BNFHeadersImpl.parseHeaderValueExtract | private boolean parseHeaderValueExtract(WsByteBuffer buff) throws MalformedMessageException {
// 295178 - don't log sensitive information
// log value contents based on the header key (if known)
int log = LOG_FULL;
HeaderKeys key = this.currentElem.getKey();
if (null != key && !key.shouldLogValue()) {
// this header key wants to block the entire thing
log = LOG_NONE;
}
TokenCodes tcRC = parseCRLFTokenExtract(buff, log);
if (!tcRC.equals(TokenCodes.TOKEN_RC_MOREDATA)) {
setHeaderValue();
this.parsedToken = null;
this.currentElem = null;
this.stateOfParsing = PARSING_CRLF;
return true;
}
// otherwise we need more data in order to read the value
return false;
} | java | private boolean parseHeaderValueExtract(WsByteBuffer buff) throws MalformedMessageException {
// 295178 - don't log sensitive information
// log value contents based on the header key (if known)
int log = LOG_FULL;
HeaderKeys key = this.currentElem.getKey();
if (null != key && !key.shouldLogValue()) {
// this header key wants to block the entire thing
log = LOG_NONE;
}
TokenCodes tcRC = parseCRLFTokenExtract(buff, log);
if (!tcRC.equals(TokenCodes.TOKEN_RC_MOREDATA)) {
setHeaderValue();
this.parsedToken = null;
this.currentElem = null;
this.stateOfParsing = PARSING_CRLF;
return true;
}
// otherwise we need more data in order to read the value
return false;
} | [
"private",
"boolean",
"parseHeaderValueExtract",
"(",
"WsByteBuffer",
"buff",
")",
"throws",
"MalformedMessageException",
"{",
"// 295178 - don't log sensitive information",
"// log value contents based on the header key (if known)",
"int",
"log",
"=",
"LOG_FULL",
";",
"HeaderKeys",
"key",
"=",
"this",
".",
"currentElem",
".",
"getKey",
"(",
")",
";",
"if",
"(",
"null",
"!=",
"key",
"&&",
"!",
"key",
".",
"shouldLogValue",
"(",
")",
")",
"{",
"// this header key wants to block the entire thing",
"log",
"=",
"LOG_NONE",
";",
"}",
"TokenCodes",
"tcRC",
"=",
"parseCRLFTokenExtract",
"(",
"buff",
",",
"log",
")",
";",
"if",
"(",
"!",
"tcRC",
".",
"equals",
"(",
"TokenCodes",
".",
"TOKEN_RC_MOREDATA",
")",
")",
"{",
"setHeaderValue",
"(",
")",
";",
"this",
".",
"parsedToken",
"=",
"null",
";",
"this",
".",
"currentElem",
"=",
"null",
";",
"this",
".",
"stateOfParsing",
"=",
"PARSING_CRLF",
";",
"return",
"true",
";",
"}",
"// otherwise we need more data in order to read the value",
"return",
"false",
";",
"}"
] | Utility method for parsing a header value out of the input buffer.
@param buff
@return boolean (false if need more data, true otherwise)
@throws MalformedMessageException | [
"Utility",
"method",
"for",
"parsing",
"a",
"header",
"value",
"out",
"of",
"the",
"input",
"buffer",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java#L3811-L3832 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java | BNFHeadersImpl.parseTokenNonExtract | protected int parseTokenNonExtract(WsByteBuffer buff, byte bDelimiter, boolean bApproveCRLF) throws MalformedMessageException {
TokenCodes rc = findTokenLength(buff, bDelimiter, bApproveCRLF);
return (TokenCodes.TOKEN_RC_MOREDATA.equals(rc)) ? -1 : this.parsedTokenLength;
} | java | protected int parseTokenNonExtract(WsByteBuffer buff, byte bDelimiter, boolean bApproveCRLF) throws MalformedMessageException {
TokenCodes rc = findTokenLength(buff, bDelimiter, bApproveCRLF);
return (TokenCodes.TOKEN_RC_MOREDATA.equals(rc)) ? -1 : this.parsedTokenLength;
} | [
"protected",
"int",
"parseTokenNonExtract",
"(",
"WsByteBuffer",
"buff",
",",
"byte",
"bDelimiter",
",",
"boolean",
"bApproveCRLF",
")",
"throws",
"MalformedMessageException",
"{",
"TokenCodes",
"rc",
"=",
"findTokenLength",
"(",
"buff",
",",
"bDelimiter",
",",
"bApproveCRLF",
")",
";",
"return",
"(",
"TokenCodes",
".",
"TOKEN_RC_MOREDATA",
".",
"equals",
"(",
"rc",
")",
")",
"?",
"-",
"1",
":",
"this",
".",
"parsedTokenLength",
";",
"}"
] | Standard parsing of a token; however, instead of saving the data into
the global parsedToken variable, this merely returns the length of the
token. Used for occasions where we just need to find the length of
the token.
@param buff
@param bDelimiter
@param bApproveCRLF
@return int (-1 means we need more data)
@throws MalformedMessageException | [
"Standard",
"parsing",
"of",
"a",
"token",
";",
"however",
"instead",
"of",
"saving",
"the",
"data",
"into",
"the",
"global",
"parsedToken",
"variable",
"this",
"merely",
"returns",
"the",
"length",
"of",
"the",
"token",
".",
"Used",
"for",
"occasions",
"where",
"we",
"just",
"need",
"to",
"find",
"the",
"length",
"of",
"the",
"token",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java#L3917-L3921 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java | BNFHeadersImpl.saveParsedToken | private void saveParsedToken(WsByteBuffer buff, int start, boolean delim, int log) {
final boolean bTrace = TraceComponent.isAnyTracingEnabled();
// local copy of the length
int length = this.parsedTokenLength;
this.parsedTokenLength = 0;
if (0 > length) {
throw new IllegalArgumentException("Negative token length: " + length);
}
if (bTrace && tc.isDebugEnabled()) {
// 295178 - don't log sensitive information
String value = GenericUtils.getEnglishString(this.parsedToken);
if (null != value) {
if (LOG_PARTIAL == log) {
value = GenericUtils.nullOutPasswords(value, LF);
} else if (LOG_NONE == log) {
value = GenericUtils.blockContents(value);
}
}
Tr.debug(tc, "Saving token: "
+ value
+ " len:" + length
+ " start:" + start + " pos:" + this.bytePosition
+ " delim:" + delim);
}
byte[] temp;
int offset;
if (null != this.parsedToken) {
// concat to the existing value
offset = this.parsedToken.length;
temp = new byte[offset + length];
System.arraycopy(this.parsedToken, 0, temp, 0, offset);
} else {
offset = 0;
temp = new byte[length];
}
//PI13987 - Added the first argument
if (!this.foundTrailingWhitespace && this.bytePosition > length) {
// pull from the bytecache
if (bTrace && tc.isDebugEnabled()) {
//PI13987 - Print out this new trace message
Tr.debug(tc, "savedParsedToken - using bytecache");
}
int cacheStart = this.bytePosition - length;
if (delim) {
cacheStart--;
}
System.arraycopy(this.byteCache, cacheStart, temp, offset, length);
} else {
// must pull from the buffer
if (bTrace && tc.isDebugEnabled()) {
//PI13987 - Print this new trace message
Tr.debug(tc, "savedParsedToken - pulling from buffer");
}
int orig = buff.position();
buff.position(start);
buff.get(temp, offset, length);
buff.position(orig);
}
this.parsedToken = temp;
if (bTrace && tc.isDebugEnabled()) {
// 295178 - don't log sensitive information
String value = GenericUtils.getEnglishString(this.parsedToken);
if (LOG_PARTIAL == log) {
value = GenericUtils.nullOutPasswords(value, LF);
} else if (LOG_NONE == log) {
value = GenericUtils.blockContents(value);
}
Tr.debug(tc, "Saved token [" + value + "]");
}
} | java | private void saveParsedToken(WsByteBuffer buff, int start, boolean delim, int log) {
final boolean bTrace = TraceComponent.isAnyTracingEnabled();
// local copy of the length
int length = this.parsedTokenLength;
this.parsedTokenLength = 0;
if (0 > length) {
throw new IllegalArgumentException("Negative token length: " + length);
}
if (bTrace && tc.isDebugEnabled()) {
// 295178 - don't log sensitive information
String value = GenericUtils.getEnglishString(this.parsedToken);
if (null != value) {
if (LOG_PARTIAL == log) {
value = GenericUtils.nullOutPasswords(value, LF);
} else if (LOG_NONE == log) {
value = GenericUtils.blockContents(value);
}
}
Tr.debug(tc, "Saving token: "
+ value
+ " len:" + length
+ " start:" + start + " pos:" + this.bytePosition
+ " delim:" + delim);
}
byte[] temp;
int offset;
if (null != this.parsedToken) {
// concat to the existing value
offset = this.parsedToken.length;
temp = new byte[offset + length];
System.arraycopy(this.parsedToken, 0, temp, 0, offset);
} else {
offset = 0;
temp = new byte[length];
}
//PI13987 - Added the first argument
if (!this.foundTrailingWhitespace && this.bytePosition > length) {
// pull from the bytecache
if (bTrace && tc.isDebugEnabled()) {
//PI13987 - Print out this new trace message
Tr.debug(tc, "savedParsedToken - using bytecache");
}
int cacheStart = this.bytePosition - length;
if (delim) {
cacheStart--;
}
System.arraycopy(this.byteCache, cacheStart, temp, offset, length);
} else {
// must pull from the buffer
if (bTrace && tc.isDebugEnabled()) {
//PI13987 - Print this new trace message
Tr.debug(tc, "savedParsedToken - pulling from buffer");
}
int orig = buff.position();
buff.position(start);
buff.get(temp, offset, length);
buff.position(orig);
}
this.parsedToken = temp;
if (bTrace && tc.isDebugEnabled()) {
// 295178 - don't log sensitive information
String value = GenericUtils.getEnglishString(this.parsedToken);
if (LOG_PARTIAL == log) {
value = GenericUtils.nullOutPasswords(value, LF);
} else if (LOG_NONE == log) {
value = GenericUtils.blockContents(value);
}
Tr.debug(tc, "Saved token [" + value + "]");
}
} | [
"private",
"void",
"saveParsedToken",
"(",
"WsByteBuffer",
"buff",
",",
"int",
"start",
",",
"boolean",
"delim",
",",
"int",
"log",
")",
"{",
"final",
"boolean",
"bTrace",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"// local copy of the length",
"int",
"length",
"=",
"this",
".",
"parsedTokenLength",
";",
"this",
".",
"parsedTokenLength",
"=",
"0",
";",
"if",
"(",
"0",
">",
"length",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Negative token length: \"",
"+",
"length",
")",
";",
"}",
"if",
"(",
"bTrace",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"// 295178 - don't log sensitive information",
"String",
"value",
"=",
"GenericUtils",
".",
"getEnglishString",
"(",
"this",
".",
"parsedToken",
")",
";",
"if",
"(",
"null",
"!=",
"value",
")",
"{",
"if",
"(",
"LOG_PARTIAL",
"==",
"log",
")",
"{",
"value",
"=",
"GenericUtils",
".",
"nullOutPasswords",
"(",
"value",
",",
"LF",
")",
";",
"}",
"else",
"if",
"(",
"LOG_NONE",
"==",
"log",
")",
"{",
"value",
"=",
"GenericUtils",
".",
"blockContents",
"(",
"value",
")",
";",
"}",
"}",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Saving token: \"",
"+",
"value",
"+",
"\" len:\"",
"+",
"length",
"+",
"\" start:\"",
"+",
"start",
"+",
"\" pos:\"",
"+",
"this",
".",
"bytePosition",
"+",
"\" delim:\"",
"+",
"delim",
")",
";",
"}",
"byte",
"[",
"]",
"temp",
";",
"int",
"offset",
";",
"if",
"(",
"null",
"!=",
"this",
".",
"parsedToken",
")",
"{",
"// concat to the existing value",
"offset",
"=",
"this",
".",
"parsedToken",
".",
"length",
";",
"temp",
"=",
"new",
"byte",
"[",
"offset",
"+",
"length",
"]",
";",
"System",
".",
"arraycopy",
"(",
"this",
".",
"parsedToken",
",",
"0",
",",
"temp",
",",
"0",
",",
"offset",
")",
";",
"}",
"else",
"{",
"offset",
"=",
"0",
";",
"temp",
"=",
"new",
"byte",
"[",
"length",
"]",
";",
"}",
"//PI13987 - Added the first argument",
"if",
"(",
"!",
"this",
".",
"foundTrailingWhitespace",
"&&",
"this",
".",
"bytePosition",
">",
"length",
")",
"{",
"// pull from the bytecache",
"if",
"(",
"bTrace",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"//PI13987 - Print out this new trace message",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"savedParsedToken - using bytecache\"",
")",
";",
"}",
"int",
"cacheStart",
"=",
"this",
".",
"bytePosition",
"-",
"length",
";",
"if",
"(",
"delim",
")",
"{",
"cacheStart",
"--",
";",
"}",
"System",
".",
"arraycopy",
"(",
"this",
".",
"byteCache",
",",
"cacheStart",
",",
"temp",
",",
"offset",
",",
"length",
")",
";",
"}",
"else",
"{",
"// must pull from the buffer",
"if",
"(",
"bTrace",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"//PI13987 - Print this new trace message",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"savedParsedToken - pulling from buffer\"",
")",
";",
"}",
"int",
"orig",
"=",
"buff",
".",
"position",
"(",
")",
";",
"buff",
".",
"position",
"(",
"start",
")",
";",
"buff",
".",
"get",
"(",
"temp",
",",
"offset",
",",
"length",
")",
";",
"buff",
".",
"position",
"(",
"orig",
")",
";",
"}",
"this",
".",
"parsedToken",
"=",
"temp",
";",
"if",
"(",
"bTrace",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"// 295178 - don't log sensitive information",
"String",
"value",
"=",
"GenericUtils",
".",
"getEnglishString",
"(",
"this",
".",
"parsedToken",
")",
";",
"if",
"(",
"LOG_PARTIAL",
"==",
"log",
")",
"{",
"value",
"=",
"GenericUtils",
".",
"nullOutPasswords",
"(",
"value",
",",
"LF",
")",
";",
"}",
"else",
"if",
"(",
"LOG_NONE",
"==",
"log",
")",
"{",
"value",
"=",
"GenericUtils",
".",
"blockContents",
"(",
"value",
")",
";",
"}",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Saved token [\"",
"+",
"value",
"+",
"\"]\"",
")",
";",
"}",
"}"
] | Sets the temporary parse token from the input buffer.
@param buff The current WsByteBuffer being parsed
@param start The start position of the token
@param delim Did we stop on the delimiter or not?
@param log Whether to log the contents or not | [
"Sets",
"the",
"temporary",
"parse",
"token",
"from",
"the",
"input",
"buffer",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java#L3973-L4045 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java | BNFHeadersImpl.parsedCompactHeader | public void parsedCompactHeader(boolean flag) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "parsedCompactHeader: " + flag);
}
this.compactHeaderFlag = flag;
} | java | public void parsedCompactHeader(boolean flag) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "parsedCompactHeader: " + flag);
}
this.compactHeaderFlag = flag;
} | [
"public",
"void",
"parsedCompactHeader",
"(",
"boolean",
"flag",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"parsedCompactHeader: \"",
"+",
"flag",
")",
";",
"}",
"this",
".",
"compactHeaderFlag",
"=",
"flag",
";",
"}"
] | Sets the flag indicating that a SIP compact header has been parsed.
@param flag Whether or not a header is in compact for or not | [
"Sets",
"the",
"flag",
"indicating",
"that",
"a",
"SIP",
"compact",
"header",
"has",
"been",
"parsed",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/BNFHeadersImpl.java#L4052-L4058 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/am/MPAlarmThread.java | MPAlarmThread.finishAlarmThread | void finishAlarmThread()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "finishAlarmThread");
//wake up the thread so that it will exit it's main loop and end
synchronized(wakeupLock)
{
//flag this alarm thread as finished
finished = true;
wakeupLock.notify();
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "finishAlarmThread");
} | java | void finishAlarmThread()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "finishAlarmThread");
//wake up the thread so that it will exit it's main loop and end
synchronized(wakeupLock)
{
//flag this alarm thread as finished
finished = true;
wakeupLock.notify();
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "finishAlarmThread");
} | [
"void",
"finishAlarmThread",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"finishAlarmThread\"",
")",
";",
"//wake up the thread so that it will exit it's main loop and end",
"synchronized",
"(",
"wakeupLock",
")",
"{",
"//flag this alarm thread as finished",
"finished",
"=",
"true",
";",
"wakeupLock",
".",
"notify",
"(",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"finishAlarmThread\"",
")",
";",
"}"
] | Terminate this alarm thread. This is final, the thread should not
be restarted. | [
"Terminate",
"this",
"alarm",
"thread",
".",
"This",
"is",
"final",
"the",
"thread",
"should",
"not",
"be",
"restarted",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/am/MPAlarmThread.java#L135-L151 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/am/MPAlarmThread.java | MPAlarmThread.run | public void run()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "run");
try
{
//loop until finished
while(!finished)
{
//what time is it now
long now = System.currentTimeMillis();
boolean fire = false;
//synchronize on the wake up lock
synchronized(wakeupLock)
{
//if not suspended and we've reached or passed the target wakeup time
if(running)
{
fire = (now >= nextWakeup);
}
}
if(fire)
{
//call the internal alarm method which should return the
//time for the next wakeup ... or SUSPEND if the thread should be suspended
manager.fireInternalAlarm();
synchronized (wakeupLock)
{
setNextWakeup(manager.getNextWakeup());
}
}
synchronized(wakeupLock)
{
//if we are still not suspended (another thread could have got in before
// the re-lock and changed things)
if(running)
{
//if there is still time until the next wakeup
if(wakeupDelta > 0)
{
try
{
if (!finished)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(tc, "Thread wait : "+wakeupDelta);
//wait until the next target wakeup time
long start = System.currentTimeMillis();
wakeupLock.wait(wakeupDelta+10);
long end = System.currentTimeMillis();
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(tc, "Thread slept for " + (end-start));
if(end < nextWakeup)
setNextWakeup(nextWakeup);
}
}
catch (InterruptedException e)
{
// No FFDC code needed
// swallow InterruptedException ... we'll just loop round and try again
}
}
}
else
{
try
{
if (!finished)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(tc, "Thread wait : Inifinite");
wakeupLock.wait();
}
}
catch (InterruptedException e)
{
// No FFDC code needed
// swallow InterruptedException ... we'll just loop round and try again
}
}
} // synchronized
}
}
catch (RuntimeException e)
{
// FFDC
FFDCFilter.processException(e,
"com.ibm.ws.sib.processor.utils.am.MPAlarmThread.run",
"1:284:1.8.1.7",
this);
SibTr.error(tc,
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] { "com.ibm.ws.sib.processor.utils.am.MPAlarmThread", "1:290:1.8.1.7", e },
null));
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.exception(tc, e);
SibTr.exit(tc, "run", e);
}
throw e;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "run");
} | java | public void run()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "run");
try
{
//loop until finished
while(!finished)
{
//what time is it now
long now = System.currentTimeMillis();
boolean fire = false;
//synchronize on the wake up lock
synchronized(wakeupLock)
{
//if not suspended and we've reached or passed the target wakeup time
if(running)
{
fire = (now >= nextWakeup);
}
}
if(fire)
{
//call the internal alarm method which should return the
//time for the next wakeup ... or SUSPEND if the thread should be suspended
manager.fireInternalAlarm();
synchronized (wakeupLock)
{
setNextWakeup(manager.getNextWakeup());
}
}
synchronized(wakeupLock)
{
//if we are still not suspended (another thread could have got in before
// the re-lock and changed things)
if(running)
{
//if there is still time until the next wakeup
if(wakeupDelta > 0)
{
try
{
if (!finished)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(tc, "Thread wait : "+wakeupDelta);
//wait until the next target wakeup time
long start = System.currentTimeMillis();
wakeupLock.wait(wakeupDelta+10);
long end = System.currentTimeMillis();
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(tc, "Thread slept for " + (end-start));
if(end < nextWakeup)
setNextWakeup(nextWakeup);
}
}
catch (InterruptedException e)
{
// No FFDC code needed
// swallow InterruptedException ... we'll just loop round and try again
}
}
}
else
{
try
{
if (!finished)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(tc, "Thread wait : Inifinite");
wakeupLock.wait();
}
}
catch (InterruptedException e)
{
// No FFDC code needed
// swallow InterruptedException ... we'll just loop round and try again
}
}
} // synchronized
}
}
catch (RuntimeException e)
{
// FFDC
FFDCFilter.processException(e,
"com.ibm.ws.sib.processor.utils.am.MPAlarmThread.run",
"1:284:1.8.1.7",
this);
SibTr.error(tc,
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] { "com.ibm.ws.sib.processor.utils.am.MPAlarmThread", "1:290:1.8.1.7", e },
null));
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.exception(tc, e);
SibTr.exit(tc, "run", e);
}
throw e;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "run");
} | [
"public",
"void",
"run",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"run\"",
")",
";",
"try",
"{",
"//loop until finished",
"while",
"(",
"!",
"finished",
")",
"{",
"//what time is it now",
"long",
"now",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"boolean",
"fire",
"=",
"false",
";",
"//synchronize on the wake up lock",
"synchronized",
"(",
"wakeupLock",
")",
"{",
"//if not suspended and we've reached or passed the target wakeup time",
"if",
"(",
"running",
")",
"{",
"fire",
"=",
"(",
"now",
">=",
"nextWakeup",
")",
";",
"}",
"}",
"if",
"(",
"fire",
")",
"{",
"//call the internal alarm method which should return the",
"//time for the next wakeup ... or SUSPEND if the thread should be suspended",
"manager",
".",
"fireInternalAlarm",
"(",
")",
";",
"synchronized",
"(",
"wakeupLock",
")",
"{",
"setNextWakeup",
"(",
"manager",
".",
"getNextWakeup",
"(",
")",
")",
";",
"}",
"}",
"synchronized",
"(",
"wakeupLock",
")",
"{",
"//if we are still not suspended (another thread could have got in before",
"// the re-lock and changed things)",
"if",
"(",
"running",
")",
"{",
"//if there is still time until the next wakeup",
"if",
"(",
"wakeupDelta",
">",
"0",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"finished",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"Thread wait : \"",
"+",
"wakeupDelta",
")",
";",
"//wait until the next target wakeup time",
"long",
"start",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"wakeupLock",
".",
"wait",
"(",
"wakeupDelta",
"+",
"10",
")",
";",
"long",
"end",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"Thread slept for \"",
"+",
"(",
"end",
"-",
"start",
")",
")",
";",
"if",
"(",
"end",
"<",
"nextWakeup",
")",
"setNextWakeup",
"(",
"nextWakeup",
")",
";",
"}",
"}",
"catch",
"(",
"InterruptedException",
"e",
")",
"{",
"// No FFDC code needed",
"// swallow InterruptedException ... we'll just loop round and try again",
"}",
"}",
"}",
"else",
"{",
"try",
"{",
"if",
"(",
"!",
"finished",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"Thread wait : Inifinite\"",
")",
";",
"wakeupLock",
".",
"wait",
"(",
")",
";",
"}",
"}",
"catch",
"(",
"InterruptedException",
"e",
")",
"{",
"// No FFDC code needed",
"// swallow InterruptedException ... we'll just loop round and try again",
"}",
"}",
"}",
"// synchronized",
"}",
"}",
"catch",
"(",
"RuntimeException",
"e",
")",
"{",
"// FFDC",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.utils.am.MPAlarmThread.run\"",
",",
"\"1:284:1.8.1.7\"",
",",
"this",
")",
";",
"SibTr",
".",
"error",
"(",
"tc",
",",
"nls",
".",
"getFormattedMessage",
"(",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.utils.am.MPAlarmThread\"",
",",
"\"1:290:1.8.1.7\"",
",",
"e",
"}",
",",
"null",
")",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"run\"",
",",
"e",
")",
";",
"}",
"throw",
"e",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"run\"",
")",
";",
"}"
] | The main loop for the MPAlarmThread. Loops until the alarm thread
is marked as finished. If the alarm thread is suspended, it will
wait forever. Otherwise the it will wait inside the loop until a
specified time and then call the MPAlarmManager.fireInternalAlarm
method. | [
"The",
"main",
"loop",
"for",
"the",
"MPAlarmThread",
".",
"Loops",
"until",
"the",
"alarm",
"thread",
"is",
"marked",
"as",
"finished",
".",
"If",
"the",
"alarm",
"thread",
"is",
"suspended",
"it",
"will",
"wait",
"forever",
".",
"Otherwise",
"the",
"it",
"will",
"wait",
"inside",
"the",
"loop",
"until",
"a",
"specified",
"time",
"and",
"then",
"call",
"the",
"MPAlarmManager",
".",
"fireInternalAlarm",
"method",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/am/MPAlarmThread.java#L160-L275 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.tx.embeddable/src/com/ibm/tx/jta/embeddable/impl/EmbeddableTransactionImpl.java | EmbeddableTransactionImpl.startInactivityTimer | public boolean startInactivityTimer() {
final boolean traceOn = TraceComponent.isAnyTracingEnabled();
if (traceOn && tc.isEntryEnabled())
Tr.entry(tc, "startInactivityTimer");
if (_inactivityTimeout > 0
&& _status.getState() == TransactionState.STATE_ACTIVE
&& !_inactivityTimerActive) {
EmbeddableTimeoutManager.setTimeout(this,
EmbeddableTimeoutManager.INACTIVITY_TIMEOUT, _inactivityTimeout);
_inactivityTimerActive = true;
_mostRecentThread.pop();
}
if (traceOn && tc.isEntryEnabled())
Tr.exit(tc, "startInactivityTimer", _inactivityTimerActive);
return _inactivityTimerActive;
} | java | public boolean startInactivityTimer() {
final boolean traceOn = TraceComponent.isAnyTracingEnabled();
if (traceOn && tc.isEntryEnabled())
Tr.entry(tc, "startInactivityTimer");
if (_inactivityTimeout > 0
&& _status.getState() == TransactionState.STATE_ACTIVE
&& !_inactivityTimerActive) {
EmbeddableTimeoutManager.setTimeout(this,
EmbeddableTimeoutManager.INACTIVITY_TIMEOUT, _inactivityTimeout);
_inactivityTimerActive = true;
_mostRecentThread.pop();
}
if (traceOn && tc.isEntryEnabled())
Tr.exit(tc, "startInactivityTimer", _inactivityTimerActive);
return _inactivityTimerActive;
} | [
"public",
"boolean",
"startInactivityTimer",
"(",
")",
"{",
"final",
"boolean",
"traceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"traceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"startInactivityTimer\"",
")",
";",
"if",
"(",
"_inactivityTimeout",
">",
"0",
"&&",
"_status",
".",
"getState",
"(",
")",
"==",
"TransactionState",
".",
"STATE_ACTIVE",
"&&",
"!",
"_inactivityTimerActive",
")",
"{",
"EmbeddableTimeoutManager",
".",
"setTimeout",
"(",
"this",
",",
"EmbeddableTimeoutManager",
".",
"INACTIVITY_TIMEOUT",
",",
"_inactivityTimeout",
")",
";",
"_inactivityTimerActive",
"=",
"true",
";",
"_mostRecentThread",
".",
"pop",
"(",
")",
";",
"}",
"if",
"(",
"traceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"startInactivityTimer\"",
",",
"_inactivityTimerActive",
")",
";",
"return",
"_inactivityTimerActive",
";",
"}"
] | Start an inactivity timer and call alarm method of parameter when
timeout expires.
@param iat callback object to be notified when timer expires.
This may be null.
@exception SystemException thrown if transaction is not active | [
"Start",
"an",
"inactivity",
"timer",
"and",
"call",
"alarm",
"method",
"of",
"parameter",
"when",
"timeout",
"expires",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.tx.embeddable/src/com/ibm/tx/jta/embeddable/impl/EmbeddableTransactionImpl.java#L205-L224 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.tx.embeddable/src/com/ibm/tx/jta/embeddable/impl/EmbeddableTransactionImpl.java | EmbeddableTransactionImpl.rollbackResources | public void rollbackResources() {
final boolean traceOn = TraceComponent.isAnyTracingEnabled();
if (traceOn && tc.isEntryEnabled())
Tr.entry(tc, "rollbackResources");
try {
final Transaction t = ((EmbeddableTranManagerSet) TransactionManagerFactory.getTransactionManager()).suspend();
getResources().rollbackResources();
if (t != null)
((EmbeddableTranManagerSet) TransactionManagerFactory.getTransactionManager()).resume(t);
} catch (Exception ex) {
FFDCFilter.processException(ex, "com.ibm.tx.jta.impl.EmbeddableTransactionImpl.rollbackResources", "104", this);
if (traceOn && tc.isDebugEnabled())
Tr.debug(tc, "Exception caught from rollbackResources()", ex);
}
if (traceOn && tc.isEntryEnabled())
Tr.exit(tc, "rollbackResources");
} | java | public void rollbackResources() {
final boolean traceOn = TraceComponent.isAnyTracingEnabled();
if (traceOn && tc.isEntryEnabled())
Tr.entry(tc, "rollbackResources");
try {
final Transaction t = ((EmbeddableTranManagerSet) TransactionManagerFactory.getTransactionManager()).suspend();
getResources().rollbackResources();
if (t != null)
((EmbeddableTranManagerSet) TransactionManagerFactory.getTransactionManager()).resume(t);
} catch (Exception ex) {
FFDCFilter.processException(ex, "com.ibm.tx.jta.impl.EmbeddableTransactionImpl.rollbackResources", "104", this);
if (traceOn && tc.isDebugEnabled())
Tr.debug(tc, "Exception caught from rollbackResources()", ex);
}
if (traceOn && tc.isEntryEnabled())
Tr.exit(tc, "rollbackResources");
} | [
"public",
"void",
"rollbackResources",
"(",
")",
"{",
"final",
"boolean",
"traceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"traceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"rollbackResources\"",
")",
";",
"try",
"{",
"final",
"Transaction",
"t",
"=",
"(",
"(",
"EmbeddableTranManagerSet",
")",
"TransactionManagerFactory",
".",
"getTransactionManager",
"(",
")",
")",
".",
"suspend",
"(",
")",
";",
"getResources",
"(",
")",
".",
"rollbackResources",
"(",
")",
";",
"if",
"(",
"t",
"!=",
"null",
")",
"(",
"(",
"EmbeddableTranManagerSet",
")",
"TransactionManagerFactory",
".",
"getTransactionManager",
"(",
")",
")",
".",
"resume",
"(",
"t",
")",
";",
"}",
"catch",
"(",
"Exception",
"ex",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"ex",
",",
"\"com.ibm.tx.jta.impl.EmbeddableTransactionImpl.rollbackResources\"",
",",
"\"104\"",
",",
"this",
")",
";",
"if",
"(",
"traceOn",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Exception caught from rollbackResources()\"",
",",
"ex",
")",
";",
"}",
"if",
"(",
"traceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"rollbackResources\"",
")",
";",
"}"
] | Rollback all resources, but do not drive state changes.
Used when transaction HAS TIMED OUT. | [
"Rollback",
"all",
"resources",
"but",
"do",
"not",
"drive",
"state",
"changes",
".",
"Used",
"when",
"transaction",
"HAS",
"TIMED",
"OUT",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.tx.embeddable/src/com/ibm/tx/jta/embeddable/impl/EmbeddableTransactionImpl.java#L230-L249 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.tx.embeddable/src/com/ibm/tx/jta/embeddable/impl/EmbeddableTransactionImpl.java | EmbeddableTransactionImpl.stopInactivityTimer | public synchronized void stopInactivityTimer() {
final boolean traceOn = TraceComponent.isAnyTracingEnabled();
if (traceOn && tc.isEntryEnabled())
Tr.entry(tc, "stopInactivityTimer");
if (_inactivityTimerActive) {
_inactivityTimerActive = false;
EmbeddableTimeoutManager.setTimeout(this, EmbeddableTimeoutManager.INACTIVITY_TIMEOUT, 0);
}
// The inactivity timer's being stopped so the transaction is
// back on-server. Push the thread that it's running on onto
// the stack.
_mostRecentThread.push(Thread.currentThread());
if (traceOn && tc.isEntryEnabled())
Tr.exit(tc, "stopInactivityTimer");
} | java | public synchronized void stopInactivityTimer() {
final boolean traceOn = TraceComponent.isAnyTracingEnabled();
if (traceOn && tc.isEntryEnabled())
Tr.entry(tc, "stopInactivityTimer");
if (_inactivityTimerActive) {
_inactivityTimerActive = false;
EmbeddableTimeoutManager.setTimeout(this, EmbeddableTimeoutManager.INACTIVITY_TIMEOUT, 0);
}
// The inactivity timer's being stopped so the transaction is
// back on-server. Push the thread that it's running on onto
// the stack.
_mostRecentThread.push(Thread.currentThread());
if (traceOn && tc.isEntryEnabled())
Tr.exit(tc, "stopInactivityTimer");
} | [
"public",
"synchronized",
"void",
"stopInactivityTimer",
"(",
")",
"{",
"final",
"boolean",
"traceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"traceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"stopInactivityTimer\"",
")",
";",
"if",
"(",
"_inactivityTimerActive",
")",
"{",
"_inactivityTimerActive",
"=",
"false",
";",
"EmbeddableTimeoutManager",
".",
"setTimeout",
"(",
"this",
",",
"EmbeddableTimeoutManager",
".",
"INACTIVITY_TIMEOUT",
",",
"0",
")",
";",
"}",
"// The inactivity timer's being stopped so the transaction is",
"// back on-server. Push the thread that it's running on onto",
"// the stack.",
"_mostRecentThread",
".",
"push",
"(",
"Thread",
".",
"currentThread",
"(",
")",
")",
";",
"if",
"(",
"traceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"stopInactivityTimer\"",
")",
";",
"}"
] | Stop inactivity timer associated with transaction.
This method needs to be synchronized to serialize with inactivity
timeout. If the timeout runs after this method, then there will
be no _inactivityTimer to call and the context will be on_server.
If the timeout runs before, then a subsequent resume will fail
as the transaction will be rolled back. | [
"Stop",
"inactivity",
"timer",
"associated",
"with",
"transaction",
".",
"This",
"method",
"needs",
"to",
"be",
"synchronized",
"to",
"serialize",
"with",
"inactivity",
"timeout",
".",
"If",
"the",
"timeout",
"runs",
"after",
"this",
"method",
"then",
"there",
"will",
"be",
"no",
"_inactivityTimer",
"to",
"call",
"and",
"the",
"context",
"will",
"be",
"on_server",
".",
"If",
"the",
"timeout",
"runs",
"before",
"then",
"a",
"subsequent",
"resume",
"will",
"fail",
"as",
"the",
"transaction",
"will",
"be",
"rolled",
"back",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.tx.embeddable/src/com/ibm/tx/jta/embeddable/impl/EmbeddableTransactionImpl.java#L269-L287 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.tx.embeddable/src/com/ibm/tx/jta/embeddable/impl/EmbeddableTransactionImpl.java | EmbeddableTransactionImpl.resumeAssociation | @Override
public void resumeAssociation() {
final boolean traceOn = TraceComponent.isAnyTracingEnabled();
if (traceOn && tc.isEntryEnabled())
Tr.entry(tc, "resumeAssociation");
resumeAssociation(true);
if (traceOn && tc.isEntryEnabled())
Tr.exit(tc, "resumeAssociation");
} | java | @Override
public void resumeAssociation() {
final boolean traceOn = TraceComponent.isAnyTracingEnabled();
if (traceOn && tc.isEntryEnabled())
Tr.entry(tc, "resumeAssociation");
resumeAssociation(true);
if (traceOn && tc.isEntryEnabled())
Tr.exit(tc, "resumeAssociation");
} | [
"@",
"Override",
"public",
"void",
"resumeAssociation",
"(",
")",
"{",
"final",
"boolean",
"traceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"traceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"resumeAssociation\"",
")",
";",
"resumeAssociation",
"(",
"true",
")",
";",
"if",
"(",
"traceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"resumeAssociation\"",
")",
";",
"}"
] | Called by interceptor when incoming reply arrives.
This polices the single threaded operation of the transaction. | [
"Called",
"by",
"interceptor",
"when",
"incoming",
"reply",
"arrives",
".",
"This",
"polices",
"the",
"single",
"threaded",
"operation",
"of",
"the",
"transaction",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.tx.embeddable/src/com/ibm/tx/jta/embeddable/impl/EmbeddableTransactionImpl.java#L419-L430 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.tx.embeddable/src/com/ibm/tx/jta/embeddable/impl/EmbeddableTransactionImpl.java | EmbeddableTransactionImpl.resumeAssociation | public synchronized void resumeAssociation(boolean allowSetRollback) throws TRANSACTION_ROLLEDBACK {
final boolean traceOn = TraceComponent.isAnyTracingEnabled();
if (traceOn && tc.isEntryEnabled())
Tr.entry(tc, "resumeAssociation", allowSetRollback);
// if another thread is active we have to wait
// doSetRollback indicates if this method has marked the transaction for rollbackOnly
// and if so TRANSACTION_ROLLEDBACK exception is thrown.
boolean doSetRollback = false;
while (_activeAssociations > _suspendedAssociations) {
doSetRollback = allowSetRollback;
try {
if (doSetRollback && !_rollbackOnly)
setRollbackOnly();
} catch (Exception ex) {
FFDCFilter.processException(ex, "com.ibm.ws.Transaction.JTA.TransactionImpl.resumeAssociation", "1748", this);
if (traceOn && tc.isDebugEnabled())
Tr.debug(tc, "setRollbackOnly threw exception", ex);
// swallow this exception
}
try {
wait();
} // woken up by removeAssociation
catch (InterruptedException iex) { /* no ffdc */
}
} // end while
_suspendedAssociations--;
if (doSetRollback) {
if (traceOn && tc.isEntryEnabled())
Tr.exit(tc, "resumeAssociation throwing rolledback");
throw new TRANSACTION_ROLLEDBACK("Context already active");
}
if (traceOn && tc.isEntryEnabled())
Tr.exit(tc, "resumeAssociation");
} | java | public synchronized void resumeAssociation(boolean allowSetRollback) throws TRANSACTION_ROLLEDBACK {
final boolean traceOn = TraceComponent.isAnyTracingEnabled();
if (traceOn && tc.isEntryEnabled())
Tr.entry(tc, "resumeAssociation", allowSetRollback);
// if another thread is active we have to wait
// doSetRollback indicates if this method has marked the transaction for rollbackOnly
// and if so TRANSACTION_ROLLEDBACK exception is thrown.
boolean doSetRollback = false;
while (_activeAssociations > _suspendedAssociations) {
doSetRollback = allowSetRollback;
try {
if (doSetRollback && !_rollbackOnly)
setRollbackOnly();
} catch (Exception ex) {
FFDCFilter.processException(ex, "com.ibm.ws.Transaction.JTA.TransactionImpl.resumeAssociation", "1748", this);
if (traceOn && tc.isDebugEnabled())
Tr.debug(tc, "setRollbackOnly threw exception", ex);
// swallow this exception
}
try {
wait();
} // woken up by removeAssociation
catch (InterruptedException iex) { /* no ffdc */
}
} // end while
_suspendedAssociations--;
if (doSetRollback) {
if (traceOn && tc.isEntryEnabled())
Tr.exit(tc, "resumeAssociation throwing rolledback");
throw new TRANSACTION_ROLLEDBACK("Context already active");
}
if (traceOn && tc.isEntryEnabled())
Tr.exit(tc, "resumeAssociation");
} | [
"public",
"synchronized",
"void",
"resumeAssociation",
"(",
"boolean",
"allowSetRollback",
")",
"throws",
"TRANSACTION_ROLLEDBACK",
"{",
"final",
"boolean",
"traceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"traceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"resumeAssociation\"",
",",
"allowSetRollback",
")",
";",
"// if another thread is active we have to wait",
"// doSetRollback indicates if this method has marked the transaction for rollbackOnly",
"// and if so TRANSACTION_ROLLEDBACK exception is thrown.",
"boolean",
"doSetRollback",
"=",
"false",
";",
"while",
"(",
"_activeAssociations",
">",
"_suspendedAssociations",
")",
"{",
"doSetRollback",
"=",
"allowSetRollback",
";",
"try",
"{",
"if",
"(",
"doSetRollback",
"&&",
"!",
"_rollbackOnly",
")",
"setRollbackOnly",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"ex",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"ex",
",",
"\"com.ibm.ws.Transaction.JTA.TransactionImpl.resumeAssociation\"",
",",
"\"1748\"",
",",
"this",
")",
";",
"if",
"(",
"traceOn",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"setRollbackOnly threw exception\"",
",",
"ex",
")",
";",
"// swallow this exception",
"}",
"try",
"{",
"wait",
"(",
")",
";",
"}",
"// woken up by removeAssociation",
"catch",
"(",
"InterruptedException",
"iex",
")",
"{",
"/* no ffdc */",
"}",
"}",
"// end while",
"_suspendedAssociations",
"--",
";",
"if",
"(",
"doSetRollback",
")",
"{",
"if",
"(",
"traceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"resumeAssociation throwing rolledback\"",
")",
";",
"throw",
"new",
"TRANSACTION_ROLLEDBACK",
"(",
"\"Context already active\"",
")",
";",
"}",
"if",
"(",
"traceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"resumeAssociation\"",
")",
";",
"}"
] | This polices the single threaded operation of the transaction.
allowSetRollback indicates whether the condition where there is already an
active association should result in rolling back the transaction.
In the standard case of a client interceptor attempting to resume the association between
a transaction and the thread as part of response processing allowSetRollback is set to true
- this means that if the transaction already has an active association with another thread
the transaction is marked for rollback and an exception is thrown, even though we still wait
to give the thread exclusive access to the transaction. This was the pre-existing behaviour
before APAR PI13992
If another component is temporarily suspending+resuming while waiting for some other condition
we simply want to wait to allow the thread exclusive access to the transaction - in this case the
method should be called with allowSetRollback set to false - in this case the method waits to grant
the thread exclusive access to the transaction and does NOT set the transaction to rollback only
if the transaction is currently actively associated with another thread. | [
"This",
"polices",
"the",
"single",
"threaded",
"operation",
"of",
"the",
"transaction",
".",
"allowSetRollback",
"indicates",
"whether",
"the",
"condition",
"where",
"there",
"is",
"already",
"an",
"active",
"association",
"should",
"result",
"in",
"rolling",
"back",
"the",
"transaction",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.tx.embeddable/src/com/ibm/tx/jta/embeddable/impl/EmbeddableTransactionImpl.java#L450-L489 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.tx.embeddable/src/com/ibm/tx/jta/embeddable/impl/EmbeddableTransactionImpl.java | EmbeddableTransactionImpl.addAssociation | @Override
public synchronized void addAssociation() {
final boolean traceOn = TraceComponent.isAnyTracingEnabled();
if (traceOn && tc.isEntryEnabled())
Tr.entry(tc, "addAssociation");
if (_activeAssociations > _suspendedAssociations) {
if (traceOn && tc.isDebugEnabled())
Tr.debug(tc, "addAssociation received incoming request for active context");
try {
setRollbackOnly();
} catch (Exception ex) {
FFDCFilter.processException(ex, "com.ibm.ws.Transaction.JTA.TransactionImpl.addAssociation", "1701", this);
if (traceOn && tc.isDebugEnabled())
Tr.debug(tc, "setRollbackOnly threw exception", ex);
// swallow this exception
}
if (traceOn && tc.isEntryEnabled())
Tr.exit(tc, "addAssociation throwing rolledback");
throw new TRANSACTION_ROLLEDBACK("Context already active");
}
stopInactivityTimer();
_activeAssociations++;
if (traceOn && tc.isEntryEnabled())
Tr.exit(tc, "addAssociation");
} | java | @Override
public synchronized void addAssociation() {
final boolean traceOn = TraceComponent.isAnyTracingEnabled();
if (traceOn && tc.isEntryEnabled())
Tr.entry(tc, "addAssociation");
if (_activeAssociations > _suspendedAssociations) {
if (traceOn && tc.isDebugEnabled())
Tr.debug(tc, "addAssociation received incoming request for active context");
try {
setRollbackOnly();
} catch (Exception ex) {
FFDCFilter.processException(ex, "com.ibm.ws.Transaction.JTA.TransactionImpl.addAssociation", "1701", this);
if (traceOn && tc.isDebugEnabled())
Tr.debug(tc, "setRollbackOnly threw exception", ex);
// swallow this exception
}
if (traceOn && tc.isEntryEnabled())
Tr.exit(tc, "addAssociation throwing rolledback");
throw new TRANSACTION_ROLLEDBACK("Context already active");
}
stopInactivityTimer();
_activeAssociations++;
if (traceOn && tc.isEntryEnabled())
Tr.exit(tc, "addAssociation");
} | [
"@",
"Override",
"public",
"synchronized",
"void",
"addAssociation",
"(",
")",
"{",
"final",
"boolean",
"traceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"traceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"addAssociation\"",
")",
";",
"if",
"(",
"_activeAssociations",
">",
"_suspendedAssociations",
")",
"{",
"if",
"(",
"traceOn",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"addAssociation received incoming request for active context\"",
")",
";",
"try",
"{",
"setRollbackOnly",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"ex",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"ex",
",",
"\"com.ibm.ws.Transaction.JTA.TransactionImpl.addAssociation\"",
",",
"\"1701\"",
",",
"this",
")",
";",
"if",
"(",
"traceOn",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"setRollbackOnly threw exception\"",
",",
"ex",
")",
";",
"// swallow this exception",
"}",
"if",
"(",
"traceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"addAssociation throwing rolledback\"",
")",
";",
"throw",
"new",
"TRANSACTION_ROLLEDBACK",
"(",
"\"Context already active\"",
")",
";",
"}",
"stopInactivityTimer",
"(",
")",
";",
"_activeAssociations",
"++",
";",
"if",
"(",
"traceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"addAssociation\"",
")",
";",
"}"
] | Called by interceptor when incoming request arrives.
This polices the single threaded operation of the transaction. | [
"Called",
"by",
"interceptor",
"when",
"incoming",
"request",
"arrives",
".",
"This",
"polices",
"the",
"single",
"threaded",
"operation",
"of",
"the",
"transaction",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.tx.embeddable/src/com/ibm/tx/jta/embeddable/impl/EmbeddableTransactionImpl.java#L510-L539 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.tx.embeddable/src/com/ibm/tx/jta/embeddable/impl/EmbeddableTransactionImpl.java | EmbeddableTransactionImpl.removeAssociation | @Override
public synchronized void removeAssociation() {
final boolean traceOn = TraceComponent.isAnyTracingEnabled();
if (traceOn && tc.isEntryEnabled())
Tr.entry(tc, "removeAssociation");
_activeAssociations--;
if (_activeAssociations <= 0) {
startInactivityTimer();
} else {
_mostRecentThread.pop();
}
notifyAll(); //LIDB1673.23
if (traceOn && tc.isEntryEnabled())
Tr.exit(tc, "removeAssociation");
} | java | @Override
public synchronized void removeAssociation() {
final boolean traceOn = TraceComponent.isAnyTracingEnabled();
if (traceOn && tc.isEntryEnabled())
Tr.entry(tc, "removeAssociation");
_activeAssociations--;
if (_activeAssociations <= 0) {
startInactivityTimer();
} else {
_mostRecentThread.pop();
}
notifyAll(); //LIDB1673.23
if (traceOn && tc.isEntryEnabled())
Tr.exit(tc, "removeAssociation");
} | [
"@",
"Override",
"public",
"synchronized",
"void",
"removeAssociation",
"(",
")",
"{",
"final",
"boolean",
"traceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"traceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"removeAssociation\"",
")",
";",
"_activeAssociations",
"--",
";",
"if",
"(",
"_activeAssociations",
"<=",
"0",
")",
"{",
"startInactivityTimer",
"(",
")",
";",
"}",
"else",
"{",
"_mostRecentThread",
".",
"pop",
"(",
")",
";",
"}",
"notifyAll",
"(",
")",
";",
"//LIDB1673.23",
"if",
"(",
"traceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"removeAssociation\"",
")",
";",
"}"
] | Called by interceptor when reply is sent.
This updates the server association count for this context. | [
"Called",
"by",
"interceptor",
"when",
"reply",
"is",
"sent",
".",
"This",
"updates",
"the",
"server",
"association",
"count",
"for",
"this",
"context",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.tx.embeddable/src/com/ibm/tx/jta/embeddable/impl/EmbeddableTransactionImpl.java#L545-L564 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.tx.embeddable/src/com/ibm/tx/jta/embeddable/impl/EmbeddableTransactionImpl.java | EmbeddableTransactionImpl.enlistAsyncResource | @Override
public void enlistAsyncResource(String xaResFactoryFilter, Serializable xaResInfo, Xid xid) throws SystemException // @LIDB1922-5C
{
if (tc.isEntryEnabled())
Tr.entry(tc, "enlistAsyncResource (SPI): args: ", new Object[] { xaResFactoryFilter, xaResInfo, xid });
try {
final WSATAsyncResource res = new WSATAsyncResource(xaResFactoryFilter, xaResInfo, xid);
final WSATParticipantWrapper wrapper = new WSATParticipantWrapper(res);
getResources().addAsyncResource(wrapper);
} finally {
if (tc.isEntryEnabled())
Tr.exit(tc, "enlistAsyncResource (SPI)");
}
} | java | @Override
public void enlistAsyncResource(String xaResFactoryFilter, Serializable xaResInfo, Xid xid) throws SystemException // @LIDB1922-5C
{
if (tc.isEntryEnabled())
Tr.entry(tc, "enlistAsyncResource (SPI): args: ", new Object[] { xaResFactoryFilter, xaResInfo, xid });
try {
final WSATAsyncResource res = new WSATAsyncResource(xaResFactoryFilter, xaResInfo, xid);
final WSATParticipantWrapper wrapper = new WSATParticipantWrapper(res);
getResources().addAsyncResource(wrapper);
} finally {
if (tc.isEntryEnabled())
Tr.exit(tc, "enlistAsyncResource (SPI)");
}
} | [
"@",
"Override",
"public",
"void",
"enlistAsyncResource",
"(",
"String",
"xaResFactoryFilter",
",",
"Serializable",
"xaResInfo",
",",
"Xid",
"xid",
")",
"throws",
"SystemException",
"// @LIDB1922-5C",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"enlistAsyncResource (SPI): args: \"",
",",
"new",
"Object",
"[",
"]",
"{",
"xaResFactoryFilter",
",",
"xaResInfo",
",",
"xid",
"}",
")",
";",
"try",
"{",
"final",
"WSATAsyncResource",
"res",
"=",
"new",
"WSATAsyncResource",
"(",
"xaResFactoryFilter",
",",
"xaResInfo",
",",
"xid",
")",
";",
"final",
"WSATParticipantWrapper",
"wrapper",
"=",
"new",
"WSATParticipantWrapper",
"(",
"res",
")",
";",
"getResources",
"(",
")",
".",
"addAsyncResource",
"(",
"wrapper",
")",
";",
"}",
"finally",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"enlistAsyncResource (SPI)\"",
")",
";",
"}",
"}"
] | Enlist an asynchronous resource with the target TransactionImpl object.
A WSATParticipantWrapper is typically a representation of a downstream WSAT
subordinate server.
@param asyncResource the remote WSATParticipantWrapper | [
"Enlist",
"an",
"asynchronous",
"resource",
"with",
"the",
"target",
"TransactionImpl",
"object",
".",
"A",
"WSATParticipantWrapper",
"is",
"typically",
"a",
"representation",
"of",
"a",
"downstream",
"WSAT",
"subordinate",
"server",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.tx.embeddable/src/com/ibm/tx/jta/embeddable/impl/EmbeddableTransactionImpl.java#L573-L586 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.tx.embeddable/src/com/ibm/tx/jta/embeddable/impl/EmbeddableTransactionImpl.java | EmbeddableTransactionImpl.inactivityTimeout | public synchronized void inactivityTimeout() {
final boolean traceOn = TraceComponent.isAnyTracingEnabled();
if (traceOn && tc.isEntryEnabled())
Tr.entry(tc, "inactivityTimeout", this);
_inactivityTimerActive = false;
if (_inactivityTimer != null) {
try {
// important that this runs as part of synchronized block
// to prevent context being re-imported while processing.
_inactivityTimer.alarm();
} catch (Throwable exc) {
FFDCFilter.processException(exc, "com.ibm.ws.tx.jta.TransactionImpl.inactivityTimeout", "2796", this);
if (traceOn && tc.isEventEnabled())
Tr.event(tc, "exception caught in inactivityTimeout", exc);
// swallow
} finally {
_inactivityTimer = null;
}
} else {
if (_activeAssociations <= 0) // off server ... do the rollback
{
final EmbeddableTranManagerSet tranManager = (EmbeddableTranManagerSet) TransactionManagerFactory.getTransactionManager();
try {
// resume this onto the current thread and roll it back
tranManager.resume(this);
// PK15024
// If there is a superior server involved in this transaction, make sure it is told about this inactivity timeout.
try {
tranManager.setRollbackOnly();
} catch (Exception e) {
FFDCFilter.processException(e, "com.ibm.ws.Transaction.JTA.TransactionImpl.inactivityTimeout", "4353", this);
if (traceOn && tc.isDebugEnabled())
Tr.debug(tc, "inactivityTimeout setRollbackOnly threw exception", e);
}
// Mark it so that a bean on the superior server can test its status on return.
// PK15024
tranManager.rollback();
} catch (Exception ex) {
if (traceOn && tc.isDebugEnabled())
Tr.debug(tc, "inactivityTimeout resume/rollback threw exception", ex);
// swallow this exception
// main timeout may have already rolled back!
}
}
}
if (traceOn && tc.isEntryEnabled())
Tr.exit(tc, "inactivityTimeout");
} | java | public synchronized void inactivityTimeout() {
final boolean traceOn = TraceComponent.isAnyTracingEnabled();
if (traceOn && tc.isEntryEnabled())
Tr.entry(tc, "inactivityTimeout", this);
_inactivityTimerActive = false;
if (_inactivityTimer != null) {
try {
// important that this runs as part of synchronized block
// to prevent context being re-imported while processing.
_inactivityTimer.alarm();
} catch (Throwable exc) {
FFDCFilter.processException(exc, "com.ibm.ws.tx.jta.TransactionImpl.inactivityTimeout", "2796", this);
if (traceOn && tc.isEventEnabled())
Tr.event(tc, "exception caught in inactivityTimeout", exc);
// swallow
} finally {
_inactivityTimer = null;
}
} else {
if (_activeAssociations <= 0) // off server ... do the rollback
{
final EmbeddableTranManagerSet tranManager = (EmbeddableTranManagerSet) TransactionManagerFactory.getTransactionManager();
try {
// resume this onto the current thread and roll it back
tranManager.resume(this);
// PK15024
// If there is a superior server involved in this transaction, make sure it is told about this inactivity timeout.
try {
tranManager.setRollbackOnly();
} catch (Exception e) {
FFDCFilter.processException(e, "com.ibm.ws.Transaction.JTA.TransactionImpl.inactivityTimeout", "4353", this);
if (traceOn && tc.isDebugEnabled())
Tr.debug(tc, "inactivityTimeout setRollbackOnly threw exception", e);
}
// Mark it so that a bean on the superior server can test its status on return.
// PK15024
tranManager.rollback();
} catch (Exception ex) {
if (traceOn && tc.isDebugEnabled())
Tr.debug(tc, "inactivityTimeout resume/rollback threw exception", ex);
// swallow this exception
// main timeout may have already rolled back!
}
}
}
if (traceOn && tc.isEntryEnabled())
Tr.exit(tc, "inactivityTimeout");
} | [
"public",
"synchronized",
"void",
"inactivityTimeout",
"(",
")",
"{",
"final",
"boolean",
"traceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"traceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"inactivityTimeout\"",
",",
"this",
")",
";",
"_inactivityTimerActive",
"=",
"false",
";",
"if",
"(",
"_inactivityTimer",
"!=",
"null",
")",
"{",
"try",
"{",
"// important that this runs as part of synchronized block",
"// to prevent context being re-imported while processing.",
"_inactivityTimer",
".",
"alarm",
"(",
")",
";",
"}",
"catch",
"(",
"Throwable",
"exc",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"exc",
",",
"\"com.ibm.ws.tx.jta.TransactionImpl.inactivityTimeout\"",
",",
"\"2796\"",
",",
"this",
")",
";",
"if",
"(",
"traceOn",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"exception caught in inactivityTimeout\"",
",",
"exc",
")",
";",
"// swallow",
"}",
"finally",
"{",
"_inactivityTimer",
"=",
"null",
";",
"}",
"}",
"else",
"{",
"if",
"(",
"_activeAssociations",
"<=",
"0",
")",
"// off server ... do the rollback",
"{",
"final",
"EmbeddableTranManagerSet",
"tranManager",
"=",
"(",
"EmbeddableTranManagerSet",
")",
"TransactionManagerFactory",
".",
"getTransactionManager",
"(",
")",
";",
"try",
"{",
"// resume this onto the current thread and roll it back",
"tranManager",
".",
"resume",
"(",
"this",
")",
";",
"// PK15024",
"// If there is a superior server involved in this transaction, make sure it is told about this inactivity timeout.",
"try",
"{",
"tranManager",
".",
"setRollbackOnly",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.Transaction.JTA.TransactionImpl.inactivityTimeout\"",
",",
"\"4353\"",
",",
"this",
")",
";",
"if",
"(",
"traceOn",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"inactivityTimeout setRollbackOnly threw exception\"",
",",
"e",
")",
";",
"}",
"// Mark it so that a bean on the superior server can test its status on return.",
"// PK15024",
"tranManager",
".",
"rollback",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"ex",
")",
"{",
"if",
"(",
"traceOn",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"inactivityTimeout resume/rollback threw exception\"",
",",
"ex",
")",
";",
"// swallow this exception",
"// main timeout may have already rolled back!",
"}",
"}",
"}",
"if",
"(",
"traceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"inactivityTimeout\"",
")",
";",
"}"
] | Called by the timeout manager when inactivity timer expires.
Needs to be synchronized as it may interfere with normal timeout. | [
"Called",
"by",
"the",
"timeout",
"manager",
"when",
"inactivity",
"timer",
"expires",
".",
"Needs",
"to",
"be",
"synchronized",
"as",
"it",
"may",
"interfere",
"with",
"normal",
"timeout",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.tx.embeddable/src/com/ibm/tx/jta/embeddable/impl/EmbeddableTransactionImpl.java#L833-L886 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerList.java | ConsumerList.get | synchronized ConsumerSessionImpl get(long id)
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "get", new Long(id));
ConsumerSessionImpl consumer = null ;
if( _messageProcessor.isStarted() )
{
consumer = (ConsumerSessionImpl) _consumers.get(new Long(id));
}
if (tc.isEntryEnabled())
SibTr.exit(tc, "get", consumer);
return consumer;
} | java | synchronized ConsumerSessionImpl get(long id)
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "get", new Long(id));
ConsumerSessionImpl consumer = null ;
if( _messageProcessor.isStarted() )
{
consumer = (ConsumerSessionImpl) _consumers.get(new Long(id));
}
if (tc.isEntryEnabled())
SibTr.exit(tc, "get", consumer);
return consumer;
} | [
"synchronized",
"ConsumerSessionImpl",
"get",
"(",
"long",
"id",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"get\"",
",",
"new",
"Long",
"(",
"id",
")",
")",
";",
"ConsumerSessionImpl",
"consumer",
"=",
"null",
";",
"if",
"(",
"_messageProcessor",
".",
"isStarted",
"(",
")",
")",
"{",
"consumer",
"=",
"(",
"ConsumerSessionImpl",
")",
"_consumers",
".",
"get",
"(",
"new",
"Long",
"(",
"id",
")",
")",
";",
"}",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"get\"",
",",
"consumer",
")",
";",
"return",
"consumer",
";",
"}"
] | Gets a consumer using its' id.
@param id
@return | [
"Gets",
"a",
"consumer",
"using",
"its",
"id",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerList.java#L92-L108 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerList.java | ConsumerList.add | synchronized void add(ConsumerSessionImpl consumer)
{
consumer.setId(_consumerCount);
if (tc.isEntryEnabled())
SibTr.entry(tc, "add", new Long(consumer.getIdInternal()) );
_consumers.put(new Long(_consumerCount), consumer);
_consumerCount++;
if (tc.isEntryEnabled())
SibTr.exit(tc, "add");
} | java | synchronized void add(ConsumerSessionImpl consumer)
{
consumer.setId(_consumerCount);
if (tc.isEntryEnabled())
SibTr.entry(tc, "add", new Long(consumer.getIdInternal()) );
_consumers.put(new Long(_consumerCount), consumer);
_consumerCount++;
if (tc.isEntryEnabled())
SibTr.exit(tc, "add");
} | [
"synchronized",
"void",
"add",
"(",
"ConsumerSessionImpl",
"consumer",
")",
"{",
"consumer",
".",
"setId",
"(",
"_consumerCount",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"add\"",
",",
"new",
"Long",
"(",
"consumer",
".",
"getIdInternal",
"(",
")",
")",
")",
";",
"_consumers",
".",
"put",
"(",
"new",
"Long",
"(",
"_consumerCount",
")",
",",
"consumer",
")",
";",
"_consumerCount",
"++",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"add\"",
")",
";",
"}"
] | Adds a consumer to the list of Consumers that this messaging engine contains
@param consumer The consumer to add to the list. | [
"Adds",
"a",
"consumer",
"to",
"the",
"list",
"of",
"Consumers",
"that",
"this",
"messaging",
"engine",
"contains"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerList.java#L115-L128 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.repository/src/com/ibm/ws/repository/transport/client/AbstractRepositoryClient.java | AbstractRepositoryClient.getFromAppliesTo | private static Collection<String> getFromAppliesTo(final Asset asset, final AppliesToFilterGetter getter) {
Collection<AppliesToFilterInfo> atfis = asset.getWlpInformation().getAppliesToFilterInfo();
Collection<String> ret = new ArrayList<String>();
if (atfis != null) {
for (AppliesToFilterInfo at : atfis) {
if (at != null) {
String val = getter.getValue(at);
if (val != null) {
ret.add(val);
}
}
}
}
return ret;
} | java | private static Collection<String> getFromAppliesTo(final Asset asset, final AppliesToFilterGetter getter) {
Collection<AppliesToFilterInfo> atfis = asset.getWlpInformation().getAppliesToFilterInfo();
Collection<String> ret = new ArrayList<String>();
if (atfis != null) {
for (AppliesToFilterInfo at : atfis) {
if (at != null) {
String val = getter.getValue(at);
if (val != null) {
ret.add(val);
}
}
}
}
return ret;
} | [
"private",
"static",
"Collection",
"<",
"String",
">",
"getFromAppliesTo",
"(",
"final",
"Asset",
"asset",
",",
"final",
"AppliesToFilterGetter",
"getter",
")",
"{",
"Collection",
"<",
"AppliesToFilterInfo",
">",
"atfis",
"=",
"asset",
".",
"getWlpInformation",
"(",
")",
".",
"getAppliesToFilterInfo",
"(",
")",
";",
"Collection",
"<",
"String",
">",
"ret",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"if",
"(",
"atfis",
"!=",
"null",
")",
"{",
"for",
"(",
"AppliesToFilterInfo",
"at",
":",
"atfis",
")",
"{",
"if",
"(",
"at",
"!=",
"null",
")",
"{",
"String",
"val",
"=",
"getter",
".",
"getValue",
"(",
"at",
")",
";",
"if",
"(",
"val",
"!=",
"null",
")",
"{",
"ret",
".",
"add",
"(",
"val",
")",
";",
"}",
"}",
"}",
"}",
"return",
"ret",
";",
"}"
] | Utility method to cycle through the applies to filters info and collate the values found
@param asset
@param getter
@return | [
"Utility",
"method",
"to",
"cycle",
"through",
"the",
"applies",
"to",
"filters",
"info",
"and",
"collate",
"the",
"values",
"found"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository/src/com/ibm/ws/repository/transport/client/AbstractRepositoryClient.java#L256-L270 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.instrument.serialfilter.serverconfig/src/com/ibm/ws/kernel/instrument/serialfilter/serverconfig/FilterConfigFactory.java | FilterConfigFactory.activate | @Activate
protected void activate(ComponentContext ctx, Map<String, Object> properties) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(this, tc, "activate", properties);
}
if(isEnabled()) {
loadMaps(properties);
} else {
Tr.error(tc, "SF_ERROR_NOT_ENABLED");
}
} | java | @Activate
protected void activate(ComponentContext ctx, Map<String, Object> properties) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(this, tc, "activate", properties);
}
if(isEnabled()) {
loadMaps(properties);
} else {
Tr.error(tc, "SF_ERROR_NOT_ENABLED");
}
} | [
"@",
"Activate",
"protected",
"void",
"activate",
"(",
"ComponentContext",
"ctx",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"activate\"",
",",
"properties",
")",
";",
"}",
"if",
"(",
"isEnabled",
"(",
")",
")",
"{",
"loadMaps",
"(",
"properties",
")",
";",
"}",
"else",
"{",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"SF_ERROR_NOT_ENABLED\"",
")",
";",
"}",
"}"
] | to be deleted | [
"to",
"be",
"deleted"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.instrument.serialfilter.serverconfig/src/com/ibm/ws/kernel/instrument/serialfilter/serverconfig/FilterConfigFactory.java#L70-L80 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.authentication.builtin/src/com/ibm/ws/security/authentication/internal/AuthenticationServiceImpl.java | AuthenticationServiceImpl.updateCacheState | private void updateCacheState(Map<String, Object> props) {
getAuthenticationConfig(props);
if (cacheEnabled) {
authCacheServiceRef.activate(cc);
} else {
authCacheServiceRef.deactivate(cc);
}
} | java | private void updateCacheState(Map<String, Object> props) {
getAuthenticationConfig(props);
if (cacheEnabled) {
authCacheServiceRef.activate(cc);
} else {
authCacheServiceRef.deactivate(cc);
}
} | [
"private",
"void",
"updateCacheState",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"props",
")",
"{",
"getAuthenticationConfig",
"(",
"props",
")",
";",
"if",
"(",
"cacheEnabled",
")",
"{",
"authCacheServiceRef",
".",
"activate",
"(",
"cc",
")",
";",
"}",
"else",
"{",
"authCacheServiceRef",
".",
"deactivate",
"(",
"cc",
")",
";",
"}",
"}"
] | Based on the configuration properties, the auth cache should either
be active or not.
@param props | [
"Based",
"on",
"the",
"configuration",
"properties",
"the",
"auth",
"cache",
"should",
"either",
"be",
"active",
"or",
"not",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.authentication.builtin/src/com/ibm/ws/security/authentication/internal/AuthenticationServiceImpl.java#L141-L149 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.authentication.builtin/src/com/ibm/ws/security/authentication/internal/AuthenticationServiceImpl.java | AuthenticationServiceImpl.optionallyObtainLockedLock | private ReentrantLock optionallyObtainLockedLock(AuthenticationData authenticationData) {
ReentrantLock currentLock = null;
if (isAuthCacheServiceAvailable()) {
currentLock = authenticationGuard.requestAccess(authenticationData);
currentLock.lock();
}
return currentLock;
} | java | private ReentrantLock optionallyObtainLockedLock(AuthenticationData authenticationData) {
ReentrantLock currentLock = null;
if (isAuthCacheServiceAvailable()) {
currentLock = authenticationGuard.requestAccess(authenticationData);
currentLock.lock();
}
return currentLock;
} | [
"private",
"ReentrantLock",
"optionallyObtainLockedLock",
"(",
"AuthenticationData",
"authenticationData",
")",
"{",
"ReentrantLock",
"currentLock",
"=",
"null",
";",
"if",
"(",
"isAuthCacheServiceAvailable",
"(",
")",
")",
"{",
"currentLock",
"=",
"authenticationGuard",
".",
"requestAccess",
"(",
"authenticationData",
")",
";",
"currentLock",
".",
"lock",
"(",
")",
";",
"}",
"return",
"currentLock",
";",
"}"
] | This method will try to obtain a lock from the authentication guard based on the
given authentication data and lock it. If an equals authentication data on another thread
is received for which a lock already exists, this method will block that another thread
until the first thread relinquishes the lock. This allows having locking based on
authentication data instead of blindly locking all access. The intention is to NOT allow
multiple concurrent JAAS logins for the same authentication data in order to be able to
correctly represent the user with the same runtime subject for the same data, better
manage caching, and to prevent cycles doing logins for which potentially many of the
results will be discarded.
This method has no locking effect when there is no authentication cache. | [
"This",
"method",
"will",
"try",
"to",
"obtain",
"a",
"lock",
"from",
"the",
"authentication",
"guard",
"based",
"on",
"the",
"given",
"authentication",
"data",
"and",
"lock",
"it",
".",
"If",
"an",
"equals",
"authentication",
"data",
"on",
"another",
"thread",
"is",
"received",
"for",
"which",
"a",
"lock",
"already",
"exists",
"this",
"method",
"will",
"block",
"that",
"another",
"thread",
"until",
"the",
"first",
"thread",
"relinquishes",
"the",
"lock",
".",
"This",
"allows",
"having",
"locking",
"based",
"on",
"authentication",
"data",
"instead",
"of",
"blindly",
"locking",
"all",
"access",
".",
"The",
"intention",
"is",
"to",
"NOT",
"allow",
"multiple",
"concurrent",
"JAAS",
"logins",
"for",
"the",
"same",
"authentication",
"data",
"in",
"order",
"to",
"be",
"able",
"to",
"correctly",
"represent",
"the",
"user",
"with",
"the",
"same",
"runtime",
"subject",
"for",
"the",
"same",
"data",
"better",
"manage",
"caching",
"and",
"to",
"prevent",
"cycles",
"doing",
"logins",
"for",
"which",
"potentially",
"many",
"of",
"the",
"results",
"will",
"be",
"discarded",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.authentication.builtin/src/com/ibm/ws/security/authentication/internal/AuthenticationServiceImpl.java#L291-L298 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.authentication.builtin/src/com/ibm/ws/security/authentication/internal/AuthenticationServiceImpl.java | AuthenticationServiceImpl.delegate | @Override
public Subject delegate(String roleName, String appName) {
Subject runAsSubject = getRunAsSubjectFromProvider(roleName, appName);
return runAsSubject;
} | java | @Override
public Subject delegate(String roleName, String appName) {
Subject runAsSubject = getRunAsSubjectFromProvider(roleName, appName);
return runAsSubject;
} | [
"@",
"Override",
"public",
"Subject",
"delegate",
"(",
"String",
"roleName",
",",
"String",
"appName",
")",
"{",
"Subject",
"runAsSubject",
"=",
"getRunAsSubjectFromProvider",
"(",
"roleName",
",",
"appName",
")",
";",
"return",
"runAsSubject",
";",
"}"
] | Gets the delegation subject based on the currently configured delegation provider
or the MethodDelegationProvider if one is not configured.
@param roleName the name of the role, used to look up the corresponding user.
@param appName the name of the application, used to look up the corresponding user.
@return subject a subject representing the user that is mapped to the given run-as role.
@throws IllegalArgumentException | [
"Gets",
"the",
"delegation",
"subject",
"based",
"on",
"the",
"currently",
"configured",
"delegation",
"provider",
"or",
"the",
"MethodDelegationProvider",
"if",
"one",
"is",
"not",
"configured",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.authentication.builtin/src/com/ibm/ws/security/authentication/internal/AuthenticationServiceImpl.java#L539-L543 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/CFEndPointSerializer.java | CFEndPointSerializer.determineType | static private StringBuilder determineType(String name, Object o) {
String value = null;
if (o instanceof String || o instanceof StringBuffer || o instanceof java.nio.CharBuffer || o instanceof Integer || o instanceof Long || o instanceof Byte
|| o instanceof Double || o instanceof Float || o instanceof Short || o instanceof BigInteger || o instanceof java.math.BigDecimal) {
value = o.toString();
} else {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Skipping class: " + o.getClass());
}
return null;
}
// type="class" name="o"
StringBuilder buffer = new StringBuilder(48);
buffer.append(name);
buffer.append("type=\"");
// charbuffer is abstract so we might get HeapCharBuffer here, force it
// to the generic layer in the XML output
if (o instanceof java.nio.CharBuffer) {
buffer.append("java.nio.CharBuffer");
} else {
buffer.append(o.getClass().getName());
}
buffer.append("\" ");
buffer.append(name);
buffer.append("=\"");
buffer.append(value);
buffer.append("\"");
return buffer;
} | java | static private StringBuilder determineType(String name, Object o) {
String value = null;
if (o instanceof String || o instanceof StringBuffer || o instanceof java.nio.CharBuffer || o instanceof Integer || o instanceof Long || o instanceof Byte
|| o instanceof Double || o instanceof Float || o instanceof Short || o instanceof BigInteger || o instanceof java.math.BigDecimal) {
value = o.toString();
} else {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Skipping class: " + o.getClass());
}
return null;
}
// type="class" name="o"
StringBuilder buffer = new StringBuilder(48);
buffer.append(name);
buffer.append("type=\"");
// charbuffer is abstract so we might get HeapCharBuffer here, force it
// to the generic layer in the XML output
if (o instanceof java.nio.CharBuffer) {
buffer.append("java.nio.CharBuffer");
} else {
buffer.append(o.getClass().getName());
}
buffer.append("\" ");
buffer.append(name);
buffer.append("=\"");
buffer.append(value);
buffer.append("\"");
return buffer;
} | [
"static",
"private",
"StringBuilder",
"determineType",
"(",
"String",
"name",
",",
"Object",
"o",
")",
"{",
"String",
"value",
"=",
"null",
";",
"if",
"(",
"o",
"instanceof",
"String",
"||",
"o",
"instanceof",
"StringBuffer",
"||",
"o",
"instanceof",
"java",
".",
"nio",
".",
"CharBuffer",
"||",
"o",
"instanceof",
"Integer",
"||",
"o",
"instanceof",
"Long",
"||",
"o",
"instanceof",
"Byte",
"||",
"o",
"instanceof",
"Double",
"||",
"o",
"instanceof",
"Float",
"||",
"o",
"instanceof",
"Short",
"||",
"o",
"instanceof",
"BigInteger",
"||",
"o",
"instanceof",
"java",
".",
"math",
".",
"BigDecimal",
")",
"{",
"value",
"=",
"o",
".",
"toString",
"(",
")",
";",
"}",
"else",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Skipping class: \"",
"+",
"o",
".",
"getClass",
"(",
")",
")",
";",
"}",
"return",
"null",
";",
"}",
"// type=\"class\" name=\"o\"",
"StringBuilder",
"buffer",
"=",
"new",
"StringBuilder",
"(",
"48",
")",
";",
"buffer",
".",
"append",
"(",
"name",
")",
";",
"buffer",
".",
"append",
"(",
"\"type=\\\"\"",
")",
";",
"// charbuffer is abstract so we might get HeapCharBuffer here, force it",
"// to the generic layer in the XML output",
"if",
"(",
"o",
"instanceof",
"java",
".",
"nio",
".",
"CharBuffer",
")",
"{",
"buffer",
".",
"append",
"(",
"\"java.nio.CharBuffer\"",
")",
";",
"}",
"else",
"{",
"buffer",
".",
"append",
"(",
"o",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
")",
";",
"}",
"buffer",
".",
"append",
"(",
"\"\\\" \"",
")",
";",
"buffer",
".",
"append",
"(",
"name",
")",
";",
"buffer",
".",
"append",
"(",
"\"=\\\"\"",
")",
";",
"buffer",
".",
"append",
"(",
"value",
")",
";",
"buffer",
".",
"append",
"(",
"\"\\\"\"",
")",
";",
"return",
"buffer",
";",
"}"
] | Determine the type of the Object passed in and add the XML format
for the result.
@param type
@param name
@param o
@return StringBuilder | [
"Determine",
"the",
"type",
"of",
"the",
"Object",
"passed",
"in",
"and",
"add",
"the",
"XML",
"format",
"for",
"the",
"result",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/CFEndPointSerializer.java#L48-L77 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/CFEndPointSerializer.java | CFEndPointSerializer.serializeChannel | static private StringBuilder serializeChannel(StringBuilder buffer, OutboundChannelDefinition ocd, int order) throws NotSerializableException {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Serializing channel: " + order + " " + ocd.getOutboundFactory().getName());
}
buffer.append(" <channel order=\"");
buffer.append(order);
buffer.append("\" factory=\"");
buffer.append(ocd.getOutboundFactory().getName());
buffer.append("\">\n");
Map<Object, Object> props = ocd.getOutboundChannelProperties();
if (null != props) {
for (Entry<Object, Object> entry : props.entrySet()) {
if (null == entry.getValue()) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Property value [" + entry.getKey() + "] is null, " + ocd.toString());
}
throw new NotSerializableException("Property value for [" + entry.getKey() + "] is null");
}
// TODO should pass around the one big stringbuffer instead
// of creating all these intermediate ones
StringBuilder kBuff = determineType("key", entry.getKey());
if (null != kBuff) {
StringBuilder vBuff = determineType("value", entry.getValue());
if (null != vBuff) {
buffer.append(" <property ");
buffer.append(kBuff);
buffer.append(" ");
buffer.append(vBuff);
buffer.append("/>\n");
}
}
}
}
buffer.append(" </channel>\n");
return buffer;
} | java | static private StringBuilder serializeChannel(StringBuilder buffer, OutboundChannelDefinition ocd, int order) throws NotSerializableException {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Serializing channel: " + order + " " + ocd.getOutboundFactory().getName());
}
buffer.append(" <channel order=\"");
buffer.append(order);
buffer.append("\" factory=\"");
buffer.append(ocd.getOutboundFactory().getName());
buffer.append("\">\n");
Map<Object, Object> props = ocd.getOutboundChannelProperties();
if (null != props) {
for (Entry<Object, Object> entry : props.entrySet()) {
if (null == entry.getValue()) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Property value [" + entry.getKey() + "] is null, " + ocd.toString());
}
throw new NotSerializableException("Property value for [" + entry.getKey() + "] is null");
}
// TODO should pass around the one big stringbuffer instead
// of creating all these intermediate ones
StringBuilder kBuff = determineType("key", entry.getKey());
if (null != kBuff) {
StringBuilder vBuff = determineType("value", entry.getValue());
if (null != vBuff) {
buffer.append(" <property ");
buffer.append(kBuff);
buffer.append(" ");
buffer.append(vBuff);
buffer.append("/>\n");
}
}
}
}
buffer.append(" </channel>\n");
return buffer;
} | [
"static",
"private",
"StringBuilder",
"serializeChannel",
"(",
"StringBuilder",
"buffer",
",",
"OutboundChannelDefinition",
"ocd",
",",
"int",
"order",
")",
"throws",
"NotSerializableException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Serializing channel: \"",
"+",
"order",
"+",
"\" \"",
"+",
"ocd",
".",
"getOutboundFactory",
"(",
")",
".",
"getName",
"(",
")",
")",
";",
"}",
"buffer",
".",
"append",
"(",
"\" <channel order=\\\"\"",
")",
";",
"buffer",
".",
"append",
"(",
"order",
")",
";",
"buffer",
".",
"append",
"(",
"\"\\\" factory=\\\"\"",
")",
";",
"buffer",
".",
"append",
"(",
"ocd",
".",
"getOutboundFactory",
"(",
")",
".",
"getName",
"(",
")",
")",
";",
"buffer",
".",
"append",
"(",
"\"\\\">\\n\"",
")",
";",
"Map",
"<",
"Object",
",",
"Object",
">",
"props",
"=",
"ocd",
".",
"getOutboundChannelProperties",
"(",
")",
";",
"if",
"(",
"null",
"!=",
"props",
")",
"{",
"for",
"(",
"Entry",
"<",
"Object",
",",
"Object",
">",
"entry",
":",
"props",
".",
"entrySet",
"(",
")",
")",
"{",
"if",
"(",
"null",
"==",
"entry",
".",
"getValue",
"(",
")",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Property value [\"",
"+",
"entry",
".",
"getKey",
"(",
")",
"+",
"\"] is null, \"",
"+",
"ocd",
".",
"toString",
"(",
")",
")",
";",
"}",
"throw",
"new",
"NotSerializableException",
"(",
"\"Property value for [\"",
"+",
"entry",
".",
"getKey",
"(",
")",
"+",
"\"] is null\"",
")",
";",
"}",
"// TODO should pass around the one big stringbuffer instead",
"// of creating all these intermediate ones",
"StringBuilder",
"kBuff",
"=",
"determineType",
"(",
"\"key\"",
",",
"entry",
".",
"getKey",
"(",
")",
")",
";",
"if",
"(",
"null",
"!=",
"kBuff",
")",
"{",
"StringBuilder",
"vBuff",
"=",
"determineType",
"(",
"\"value\"",
",",
"entry",
".",
"getValue",
"(",
")",
")",
";",
"if",
"(",
"null",
"!=",
"vBuff",
")",
"{",
"buffer",
".",
"append",
"(",
"\" <property \"",
")",
";",
"buffer",
".",
"append",
"(",
"kBuff",
")",
";",
"buffer",
".",
"append",
"(",
"\" \"",
")",
";",
"buffer",
".",
"append",
"(",
"vBuff",
")",
";",
"buffer",
".",
"append",
"(",
"\"/>\\n\"",
")",
";",
"}",
"}",
"}",
"}",
"buffer",
".",
"append",
"(",
"\" </channel>\\n\"",
")",
";",
"return",
"buffer",
";",
"}"
] | Method to serialize a given channel object into the overall output
buffer.
@param buffer
@param ocd
@param order
@return StringBuilder (expanded with new data)
@throws NotSerializableException | [
"Method",
"to",
"serialize",
"a",
"given",
"channel",
"object",
"into",
"the",
"overall",
"output",
"buffer",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/CFEndPointSerializer.java#L89-L124 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/CFEndPointSerializer.java | CFEndPointSerializer.serialize | static public String serialize(CFEndPoint point) throws NotSerializableException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "serialize");
}
if (null == point) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Null CFEndPoint input for serialization");
}
throw new NotSerializableException("Null input");
}
// start the end point with name/host/port
StringBuilder buffer = new StringBuilder(512);
buffer.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Serializing endpoint: " + point.getName());
}
buffer.append("<cfendpoint name=\"");
buffer.append(point.getName());
buffer.append("\" host=\"");
buffer.append(point.getAddress().getCanonicalHostName());
buffer.append("\" port=\"");
buffer.append(point.getPort());
buffer.append("\" local=\"");
buffer.append(point.isLocal());
buffer.append("\" ssl=\"");
buffer.append(point.isSSLEnabled());
buffer.append("\">\n");
// loop through each channel in the list
int i = 0;
for (OutboundChannelDefinition def : point.getOutboundChannelDefs()) {
buffer = serializeChannel(buffer, def, i++);
}
buffer.append("</cfendpoint>");
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Serialized string: \n" + buffer.toString());
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.exit(tc, "serialize");
}
return buffer.toString();
} | java | static public String serialize(CFEndPoint point) throws NotSerializableException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "serialize");
}
if (null == point) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Null CFEndPoint input for serialization");
}
throw new NotSerializableException("Null input");
}
// start the end point with name/host/port
StringBuilder buffer = new StringBuilder(512);
buffer.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Serializing endpoint: " + point.getName());
}
buffer.append("<cfendpoint name=\"");
buffer.append(point.getName());
buffer.append("\" host=\"");
buffer.append(point.getAddress().getCanonicalHostName());
buffer.append("\" port=\"");
buffer.append(point.getPort());
buffer.append("\" local=\"");
buffer.append(point.isLocal());
buffer.append("\" ssl=\"");
buffer.append(point.isSSLEnabled());
buffer.append("\">\n");
// loop through each channel in the list
int i = 0;
for (OutboundChannelDefinition def : point.getOutboundChannelDefs()) {
buffer = serializeChannel(buffer, def, i++);
}
buffer.append("</cfendpoint>");
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Serialized string: \n" + buffer.toString());
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.exit(tc, "serialize");
}
return buffer.toString();
} | [
"static",
"public",
"String",
"serialize",
"(",
"CFEndPoint",
"point",
")",
"throws",
"NotSerializableException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"serialize\"",
")",
";",
"}",
"if",
"(",
"null",
"==",
"point",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Null CFEndPoint input for serialization\"",
")",
";",
"}",
"throw",
"new",
"NotSerializableException",
"(",
"\"Null input\"",
")",
";",
"}",
"// start the end point with name/host/port",
"StringBuilder",
"buffer",
"=",
"new",
"StringBuilder",
"(",
"512",
")",
";",
"buffer",
".",
"append",
"(",
"\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\"",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Serializing endpoint: \"",
"+",
"point",
".",
"getName",
"(",
")",
")",
";",
"}",
"buffer",
".",
"append",
"(",
"\"<cfendpoint name=\\\"\"",
")",
";",
"buffer",
".",
"append",
"(",
"point",
".",
"getName",
"(",
")",
")",
";",
"buffer",
".",
"append",
"(",
"\"\\\" host=\\\"\"",
")",
";",
"buffer",
".",
"append",
"(",
"point",
".",
"getAddress",
"(",
")",
".",
"getCanonicalHostName",
"(",
")",
")",
";",
"buffer",
".",
"append",
"(",
"\"\\\" port=\\\"\"",
")",
";",
"buffer",
".",
"append",
"(",
"point",
".",
"getPort",
"(",
")",
")",
";",
"buffer",
".",
"append",
"(",
"\"\\\" local=\\\"\"",
")",
";",
"buffer",
".",
"append",
"(",
"point",
".",
"isLocal",
"(",
")",
")",
";",
"buffer",
".",
"append",
"(",
"\"\\\" ssl=\\\"\"",
")",
";",
"buffer",
".",
"append",
"(",
"point",
".",
"isSSLEnabled",
"(",
")",
")",
";",
"buffer",
".",
"append",
"(",
"\"\\\">\\n\"",
")",
";",
"// loop through each channel in the list",
"int",
"i",
"=",
"0",
";",
"for",
"(",
"OutboundChannelDefinition",
"def",
":",
"point",
".",
"getOutboundChannelDefs",
"(",
")",
")",
"{",
"buffer",
"=",
"serializeChannel",
"(",
"buffer",
",",
"def",
",",
"i",
"++",
")",
";",
"}",
"buffer",
".",
"append",
"(",
"\"</cfendpoint>\"",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Serialized string: \\n\"",
"+",
"buffer",
".",
"toString",
"(",
")",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"serialize\"",
")",
";",
"}",
"return",
"buffer",
".",
"toString",
"(",
")",
";",
"}"
] | Method to serialize the given end point object into an XML string.
@param point
@return String
@throws NotSerializableException | [
"Method",
"to",
"serialize",
"the",
"given",
"end",
"point",
"object",
"into",
"an",
"XML",
"string",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/CFEndPointSerializer.java#L133-L174 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/transactions/impl/MSAutoCommitTransaction.java | MSAutoCommitTransaction.getOwningMessageStore | public MessageStore getOwningMessageStore()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(this, tc, "getOwningMessageStore");
SibTr.exit(this, tc, "getOwningMessageStore", "return="+_ms);
}
return _ms;
} | java | public MessageStore getOwningMessageStore()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(this, tc, "getOwningMessageStore");
SibTr.exit(this, tc, "getOwningMessageStore", "return="+_ms);
}
return _ms;
} | [
"public",
"MessageStore",
"getOwningMessageStore",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"getOwningMessageStore\"",
")",
";",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"getOwningMessageStore\"",
",",
"\"return=\"",
"+",
"_ms",
")",
";",
"}",
"return",
"_ms",
";",
"}"
] | This method is used to check the MessageStore instance that an implementing
transaction object originated from. This is used to check that a transaction
is being used to add Items to the same MessageStore as that it came from.
@return The MessageStore instance where this transaction originated from. | [
"This",
"method",
"is",
"used",
"to",
"check",
"the",
"MessageStore",
"instance",
"that",
"an",
"implementing",
"transaction",
"object",
"originated",
"from",
".",
"This",
"is",
"used",
"to",
"check",
"that",
"a",
"transaction",
"is",
"being",
"used",
"to",
"add",
"Items",
"to",
"the",
"same",
"MessageStore",
"as",
"that",
"it",
"came",
"from",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/transactions/impl/MSAutoCommitTransaction.java#L449-L457 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java | BaseDestinationHandler.createRealizationAndState | protected void createRealizationAndState(
MessageProcessor messageProcessor,
TransactionCommon transaction)
throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"createRealizationAndState",
new Object[] {
messageProcessor,
transaction });
/*
* Create associated protocol suppor of appropriate type
*/
if (isPubSub())
{
_pubSubRealization = new PubSubRealization(this,
messageProcessor,
getLocalisationManager(),
transaction);
_protoRealization = _pubSubRealization;
}
else
{
_ptoPRealization = new JSPtoPRealization(this,
messageProcessor,
getLocalisationManager());
_protoRealization = _ptoPRealization;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "createRealizationAndState");
} | java | protected void createRealizationAndState(
MessageProcessor messageProcessor,
TransactionCommon transaction)
throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"createRealizationAndState",
new Object[] {
messageProcessor,
transaction });
/*
* Create associated protocol suppor of appropriate type
*/
if (isPubSub())
{
_pubSubRealization = new PubSubRealization(this,
messageProcessor,
getLocalisationManager(),
transaction);
_protoRealization = _pubSubRealization;
}
else
{
_ptoPRealization = new JSPtoPRealization(this,
messageProcessor,
getLocalisationManager());
_protoRealization = _ptoPRealization;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "createRealizationAndState");
} | [
"protected",
"void",
"createRealizationAndState",
"(",
"MessageProcessor",
"messageProcessor",
",",
"TransactionCommon",
"transaction",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"createRealizationAndState\"",
",",
"new",
"Object",
"[",
"]",
"{",
"messageProcessor",
",",
"transaction",
"}",
")",
";",
"/*\n * Create associated protocol suppor of appropriate type\n */",
"if",
"(",
"isPubSub",
"(",
")",
")",
"{",
"_pubSubRealization",
"=",
"new",
"PubSubRealization",
"(",
"this",
",",
"messageProcessor",
",",
"getLocalisationManager",
"(",
")",
",",
"transaction",
")",
";",
"_protoRealization",
"=",
"_pubSubRealization",
";",
"}",
"else",
"{",
"_ptoPRealization",
"=",
"new",
"JSPtoPRealization",
"(",
"this",
",",
"messageProcessor",
",",
"getLocalisationManager",
"(",
")",
")",
";",
"_protoRealization",
"=",
"_ptoPRealization",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"createRealizationAndState\"",
")",
";",
"}"
] | Cold start version of method to create state associated with Destination.
@param messageProcessor
@param transaction
@throws SIResourceException | [
"Cold",
"start",
"version",
"of",
"method",
"to",
"create",
"state",
"associated",
"with",
"Destination",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java#L531-L567 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java | BaseDestinationHandler.reconstitute | protected void reconstitute(
MessageProcessor processor,
HashMap<String, Object> durableSubscriptionsTable,
int startMode) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"reconstitute",
new Object[] { processor, durableSubscriptionsTable, Integer.valueOf(startMode) });
super.reconstitute(processor);
// Links are 'BaseDestinationHandlers' but have no destination-like addressibility.
if (!isLink())
{
_name = getDefinition().getName();
_destinationAddr = SIMPUtils.createJsDestinationAddress(_name, null, getBus());
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(
tc,
"Reconstituting "
+ (isPubSub() ? "pubsub" : "ptp")
+ " BaseDestinationHandler "
+ getName());
String name = getName();
if ((name.startsWith(SIMPConstants.TEMPORARY_QUEUE_DESTINATION_PREFIX) || name.startsWith(SIMPConstants.TEMPORARY_PUBSUB_DESTINATION_PREFIX)))
{
_isTemporary = true;
_isSystem = false;
}
else
{
_isTemporary = false;
_isSystem = name.startsWith(SIMPConstants.SYSTEM_DESTINATION_PREFIX);
}
/*
* Any kind of failure while retrieving data from the message store (whether
* problems with the MS itself or with the data retrieved) means this
* destination should be marked as corrupt. The only time an exception
* should be thrown back up to the DM is when the corruption of the
* destination is fatal to starting the ME (such as a corrupt system
* destination, currently).
*/
try
{
// Create appropriate state objects
createRealizationAndState(messageProcessor);
// Restore GD ProtocolItemStream before creating InputHandler
_protoRealization.
getRemoteSupport().
reconstituteGD();
// Reconstitute message ItemStreams
if (isPubSub())
{
// Indicate that the destinationHandler has not yet been reconciled
_reconciled = false;
createControlAdapter();
//Check if we are running in an ND environment. If not we can skip
//some performance intensive WLM work
_singleServer = messageProcessor.isSingleServer();
_pubSubRealization.reconstitute(startMode,
durableSubscriptionsTable);
}
else
{
initializeNonPersistent(processor, durableSubscriptionsTable, null);
// Indicate that the destinationHandler has not yet been reconciled
_reconciled = false;
_ptoPRealization.reconstitute(startMode,
definition,
isToBeDeleted(),
isSystem());
}
// Reconstitute GD target streams
_protoRealization.
reconstituteGDTargetStreams();
} catch (Exception e)
{
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.BaseDestinationHandler.reconstitute",
"1:945:1.700.3.45",
this);
SibTr.exception(tc, e);
// At the moment, any exception we get while reconstituting means that we
// want to mark the destination as corrupt.
_isCorruptOrIndoubt = true;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "reconstitute", e);
throw new SIResourceException(e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(
tc,
"Reconstituted "
+ (isPubSub() ? "pubsub" : "ptp")
+ " BaseDestinationHandler "
+ getName());
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "reconstitute");
} | java | protected void reconstitute(
MessageProcessor processor,
HashMap<String, Object> durableSubscriptionsTable,
int startMode) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"reconstitute",
new Object[] { processor, durableSubscriptionsTable, Integer.valueOf(startMode) });
super.reconstitute(processor);
// Links are 'BaseDestinationHandlers' but have no destination-like addressibility.
if (!isLink())
{
_name = getDefinition().getName();
_destinationAddr = SIMPUtils.createJsDestinationAddress(_name, null, getBus());
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(
tc,
"Reconstituting "
+ (isPubSub() ? "pubsub" : "ptp")
+ " BaseDestinationHandler "
+ getName());
String name = getName();
if ((name.startsWith(SIMPConstants.TEMPORARY_QUEUE_DESTINATION_PREFIX) || name.startsWith(SIMPConstants.TEMPORARY_PUBSUB_DESTINATION_PREFIX)))
{
_isTemporary = true;
_isSystem = false;
}
else
{
_isTemporary = false;
_isSystem = name.startsWith(SIMPConstants.SYSTEM_DESTINATION_PREFIX);
}
/*
* Any kind of failure while retrieving data from the message store (whether
* problems with the MS itself or with the data retrieved) means this
* destination should be marked as corrupt. The only time an exception
* should be thrown back up to the DM is when the corruption of the
* destination is fatal to starting the ME (such as a corrupt system
* destination, currently).
*/
try
{
// Create appropriate state objects
createRealizationAndState(messageProcessor);
// Restore GD ProtocolItemStream before creating InputHandler
_protoRealization.
getRemoteSupport().
reconstituteGD();
// Reconstitute message ItemStreams
if (isPubSub())
{
// Indicate that the destinationHandler has not yet been reconciled
_reconciled = false;
createControlAdapter();
//Check if we are running in an ND environment. If not we can skip
//some performance intensive WLM work
_singleServer = messageProcessor.isSingleServer();
_pubSubRealization.reconstitute(startMode,
durableSubscriptionsTable);
}
else
{
initializeNonPersistent(processor, durableSubscriptionsTable, null);
// Indicate that the destinationHandler has not yet been reconciled
_reconciled = false;
_ptoPRealization.reconstitute(startMode,
definition,
isToBeDeleted(),
isSystem());
}
// Reconstitute GD target streams
_protoRealization.
reconstituteGDTargetStreams();
} catch (Exception e)
{
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.BaseDestinationHandler.reconstitute",
"1:945:1.700.3.45",
this);
SibTr.exception(tc, e);
// At the moment, any exception we get while reconstituting means that we
// want to mark the destination as corrupt.
_isCorruptOrIndoubt = true;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "reconstitute", e);
throw new SIResourceException(e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(
tc,
"Reconstituted "
+ (isPubSub() ? "pubsub" : "ptp")
+ " BaseDestinationHandler "
+ getName());
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "reconstitute");
} | [
"protected",
"void",
"reconstitute",
"(",
"MessageProcessor",
"processor",
",",
"HashMap",
"<",
"String",
",",
"Object",
">",
"durableSubscriptionsTable",
",",
"int",
"startMode",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"reconstitute\"",
",",
"new",
"Object",
"[",
"]",
"{",
"processor",
",",
"durableSubscriptionsTable",
",",
"Integer",
".",
"valueOf",
"(",
"startMode",
")",
"}",
")",
";",
"super",
".",
"reconstitute",
"(",
"processor",
")",
";",
"// Links are 'BaseDestinationHandlers' but have no destination-like addressibility.",
"if",
"(",
"!",
"isLink",
"(",
")",
")",
"{",
"_name",
"=",
"getDefinition",
"(",
")",
".",
"getName",
"(",
")",
";",
"_destinationAddr",
"=",
"SIMPUtils",
".",
"createJsDestinationAddress",
"(",
"_name",
",",
"null",
",",
"getBus",
"(",
")",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"Reconstituting \"",
"+",
"(",
"isPubSub",
"(",
")",
"?",
"\"pubsub\"",
":",
"\"ptp\"",
")",
"+",
"\" BaseDestinationHandler \"",
"+",
"getName",
"(",
")",
")",
";",
"String",
"name",
"=",
"getName",
"(",
")",
";",
"if",
"(",
"(",
"name",
".",
"startsWith",
"(",
"SIMPConstants",
".",
"TEMPORARY_QUEUE_DESTINATION_PREFIX",
")",
"||",
"name",
".",
"startsWith",
"(",
"SIMPConstants",
".",
"TEMPORARY_PUBSUB_DESTINATION_PREFIX",
")",
")",
")",
"{",
"_isTemporary",
"=",
"true",
";",
"_isSystem",
"=",
"false",
";",
"}",
"else",
"{",
"_isTemporary",
"=",
"false",
";",
"_isSystem",
"=",
"name",
".",
"startsWith",
"(",
"SIMPConstants",
".",
"SYSTEM_DESTINATION_PREFIX",
")",
";",
"}",
"/*\n * Any kind of failure while retrieving data from the message store (whether\n * problems with the MS itself or with the data retrieved) means this\n * destination should be marked as corrupt. The only time an exception\n * should be thrown back up to the DM is when the corruption of the\n * destination is fatal to starting the ME (such as a corrupt system\n * destination, currently).\n */",
"try",
"{",
"// Create appropriate state objects",
"createRealizationAndState",
"(",
"messageProcessor",
")",
";",
"// Restore GD ProtocolItemStream before creating InputHandler",
"_protoRealization",
".",
"getRemoteSupport",
"(",
")",
".",
"reconstituteGD",
"(",
")",
";",
"// Reconstitute message ItemStreams",
"if",
"(",
"isPubSub",
"(",
")",
")",
"{",
"// Indicate that the destinationHandler has not yet been reconciled",
"_reconciled",
"=",
"false",
";",
"createControlAdapter",
"(",
")",
";",
"//Check if we are running in an ND environment. If not we can skip",
"//some performance intensive WLM work",
"_singleServer",
"=",
"messageProcessor",
".",
"isSingleServer",
"(",
")",
";",
"_pubSubRealization",
".",
"reconstitute",
"(",
"startMode",
",",
"durableSubscriptionsTable",
")",
";",
"}",
"else",
"{",
"initializeNonPersistent",
"(",
"processor",
",",
"durableSubscriptionsTable",
",",
"null",
")",
";",
"// Indicate that the destinationHandler has not yet been reconciled",
"_reconciled",
"=",
"false",
";",
"_ptoPRealization",
".",
"reconstitute",
"(",
"startMode",
",",
"definition",
",",
"isToBeDeleted",
"(",
")",
",",
"isSystem",
"(",
")",
")",
";",
"}",
"// Reconstitute GD target streams",
"_protoRealization",
".",
"reconstituteGDTargetStreams",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.impl.BaseDestinationHandler.reconstitute\"",
",",
"\"1:945:1.700.3.45\"",
",",
"this",
")",
";",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"// At the moment, any exception we get while reconstituting means that we",
"// want to mark the destination as corrupt.",
"_isCorruptOrIndoubt",
"=",
"true",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"reconstitute\"",
",",
"e",
")",
";",
"throw",
"new",
"SIResourceException",
"(",
"e",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"Reconstituted \"",
"+",
"(",
"isPubSub",
"(",
")",
"?",
"\"pubsub\"",
":",
"\"ptp\"",
")",
"+",
"\" BaseDestinationHandler \"",
"+",
"getName",
"(",
")",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"reconstitute\"",
")",
";",
"}"
] | Recover a BaseDestinationHandler retrieved from the MessageStore.
@param processor
@param durableSubscriptionsTable
@throws Exception | [
"Recover",
"a",
"BaseDestinationHandler",
"retrieved",
"from",
"the",
"MessageStore",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java#L667-L786 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java | BaseDestinationHandler.deleteMsgsWithNoReferences | public void deleteMsgsWithNoReferences() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "deleteMsgsWithNoReferences");
if (null != _pubSubRealization) //doing a sanity check with checking for not null
_pubSubRealization.deleteMsgsWithNoReferences();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "deleteMsgsWithNoReferences");
} | java | public void deleteMsgsWithNoReferences() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "deleteMsgsWithNoReferences");
if (null != _pubSubRealization) //doing a sanity check with checking for not null
_pubSubRealization.deleteMsgsWithNoReferences();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "deleteMsgsWithNoReferences");
} | [
"public",
"void",
"deleteMsgsWithNoReferences",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"deleteMsgsWithNoReferences\"",
")",
";",
"if",
"(",
"null",
"!=",
"_pubSubRealization",
")",
"//doing a sanity check with checking for not null",
"_pubSubRealization",
".",
"deleteMsgsWithNoReferences",
"(",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"deleteMsgsWithNoReferences\"",
")",
";",
"}"
] | This method deletes the messages which are not having any references. Previously these messages
were deleted during ME startup in reconstitute method.This method is called from
DeletePubSubMsgsThread context | [
"This",
"method",
"deletes",
"the",
"messages",
"which",
"are",
"not",
"having",
"any",
"references",
".",
"Previously",
"these",
"messages",
"were",
"deleted",
"during",
"ME",
"startup",
"in",
"reconstitute",
"method",
".",
"This",
"method",
"is",
"called",
"from",
"DeletePubSubMsgsThread",
"context"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java#L793-L802 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java | BaseDestinationHandler.getAnycastOutputHandler | public final synchronized AnycastOutputHandler getAnycastOutputHandler()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getAnycastOutputHandler");
AnycastOutputHandler aoh = null;
if (_ptoPRealization != null)
aoh = _ptoPRealization.getAnycastOutputHandler(definition, false);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "getAnycastOutputHandler", aoh);
return aoh;
} | java | public final synchronized AnycastOutputHandler getAnycastOutputHandler()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getAnycastOutputHandler");
AnycastOutputHandler aoh = null;
if (_ptoPRealization != null)
aoh = _ptoPRealization.getAnycastOutputHandler(definition, false);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "getAnycastOutputHandler", aoh);
return aoh;
} | [
"public",
"final",
"synchronized",
"AnycastOutputHandler",
"getAnycastOutputHandler",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"getAnycastOutputHandler\"",
")",
";",
"AnycastOutputHandler",
"aoh",
"=",
"null",
";",
"if",
"(",
"_ptoPRealization",
"!=",
"null",
")",
"aoh",
"=",
"_ptoPRealization",
".",
"getAnycastOutputHandler",
"(",
"definition",
",",
"false",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"getAnycastOutputHandler\"",
",",
"aoh",
")",
";",
"return",
"aoh",
";",
"}"
] | Called to get the AnycastOutputHandler for this Destination
@return | [
"Called",
"to",
"get",
"the",
"AnycastOutputHandler",
"for",
"this",
"Destination"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java#L1409-L1422 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java | BaseDestinationHandler.getPostReconstitutePseudoIds | public Object[] getPostReconstitutePseudoIds()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getPostReconstitutePseudoIds");
Object[] result = _protoRealization.
getRemoteSupport().
getPostReconstitutePseudoIds();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "getPostReconstitutePseudoIds", result);
return result;
} | java | public Object[] getPostReconstitutePseudoIds()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getPostReconstitutePseudoIds");
Object[] result = _protoRealization.
getRemoteSupport().
getPostReconstitutePseudoIds();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "getPostReconstitutePseudoIds", result);
return result;
} | [
"public",
"Object",
"[",
"]",
"getPostReconstitutePseudoIds",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"getPostReconstitutePseudoIds\"",
")",
";",
"Object",
"[",
"]",
"result",
"=",
"_protoRealization",
".",
"getRemoteSupport",
"(",
")",
".",
"getPostReconstitutePseudoIds",
"(",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"getPostReconstitutePseudoIds\"",
",",
"result",
")",
";",
"return",
"result",
";",
"}"
] | Returns an array of all pseudoDestination UUIDs which should
be mapped to this BaseDestinationHandler. This method is
used by the DestinationManager to determine what pseudo
references need to be added after a destination is
reconstituted.
@return An array of all pseudoDestination UUIDs to be mapped
to this BaseDestinationHandler. | [
"Returns",
"an",
"array",
"of",
"all",
"pseudoDestination",
"UUIDs",
"which",
"should",
"be",
"mapped",
"to",
"this",
"BaseDestinationHandler",
".",
"This",
"method",
"is",
"used",
"by",
"the",
"DestinationManager",
"to",
"determine",
"what",
"pseudo",
"references",
"need",
"to",
"be",
"added",
"after",
"a",
"destination",
"is",
"reconstituted",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java#L1597-L1610 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java | BaseDestinationHandler.addPubSubLocalisation | protected void addPubSubLocalisation(
LocalizationDefinition destinationLocalizationDefinition)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "addPubSubLocalisation",
new Object[] {
destinationLocalizationDefinition });
_pubSubRealization.addPubSubLocalisation(destinationLocalizationDefinition);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "addPubSubLocalisation");
} | java | protected void addPubSubLocalisation(
LocalizationDefinition destinationLocalizationDefinition)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "addPubSubLocalisation",
new Object[] {
destinationLocalizationDefinition });
_pubSubRealization.addPubSubLocalisation(destinationLocalizationDefinition);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "addPubSubLocalisation");
} | [
"protected",
"void",
"addPubSubLocalisation",
"(",
"LocalizationDefinition",
"destinationLocalizationDefinition",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"addPubSubLocalisation\"",
",",
"new",
"Object",
"[",
"]",
"{",
"destinationLocalizationDefinition",
"}",
")",
";",
"_pubSubRealization",
".",
"addPubSubLocalisation",
"(",
"destinationLocalizationDefinition",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"addPubSubLocalisation\"",
")",
";",
"}"
] | Add PubSubLocalisation. | [
"Add",
"PubSubLocalisation",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java#L2012-L2025 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java | BaseDestinationHandler.setRemote | public void setRemote(boolean hasRemote)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "setRemote", Boolean.valueOf(hasRemote));
getLocalisationManager().setRemote(hasRemote);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "setRemote");
} | java | public void setRemote(boolean hasRemote)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "setRemote", Boolean.valueOf(hasRemote));
getLocalisationManager().setRemote(hasRemote);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "setRemote");
} | [
"public",
"void",
"setRemote",
"(",
"boolean",
"hasRemote",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"setRemote\"",
",",
"Boolean",
".",
"valueOf",
"(",
"hasRemote",
")",
")",
";",
"getLocalisationManager",
"(",
")",
".",
"setRemote",
"(",
"hasRemote",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"setRemote\"",
")",
";",
"}"
] | Do we have a remote localisation? | [
"Do",
"we",
"have",
"a",
"remote",
"localisation?"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java#L2144-L2153 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java | BaseDestinationHandler.setLocal | public void setLocal()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "setLocal");
getLocalisationManager().setLocal();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "setLocal");
} | java | public void setLocal()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "setLocal");
getLocalisationManager().setLocal();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "setLocal");
} | [
"public",
"void",
"setLocal",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"setLocal\"",
")",
";",
"getLocalisationManager",
"(",
")",
".",
"setLocal",
"(",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"setLocal\"",
")",
";",
"}"
] | Do we have a local localisation? | [
"Do",
"we",
"have",
"a",
"local",
"localisation?"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java#L2158-L2167 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java | BaseDestinationHandler.isToBeIgnored | public boolean isToBeIgnored()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(tc, "isToBeIgnored");
SibTr.exit(tc, "isToBeIgnored", Boolean.valueOf(_toBeIgnored));
}
return _toBeIgnored;
} | java | public boolean isToBeIgnored()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(tc, "isToBeIgnored");
SibTr.exit(tc, "isToBeIgnored", Boolean.valueOf(_toBeIgnored));
}
return _toBeIgnored;
} | [
"public",
"boolean",
"isToBeIgnored",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"isToBeIgnored\"",
")",
";",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"isToBeIgnored\"",
",",
"Boolean",
".",
"valueOf",
"(",
"_toBeIgnored",
")",
")",
";",
"}",
"return",
"_toBeIgnored",
";",
"}"
] | Are we ignoring this destination handler due to corruption?
@return | [
"Are",
"we",
"ignoring",
"this",
"destination",
"handler",
"due",
"to",
"corruption?"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java#L2211-L2220 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java | BaseDestinationHandler.getXmitQueuePoint | PtoPXmitMsgsItemStream getXmitQueuePoint(SIBUuid8 meUuid)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getXmitQueuePoint", meUuid);
PtoPXmitMsgsItemStream stream = getLocalisationManager().getXmitQueuePoint(meUuid);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "getXmitQueuePoint", stream);
return stream;
} | java | PtoPXmitMsgsItemStream getXmitQueuePoint(SIBUuid8 meUuid)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getXmitQueuePoint", meUuid);
PtoPXmitMsgsItemStream stream = getLocalisationManager().getXmitQueuePoint(meUuid);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "getXmitQueuePoint", stream);
return stream;
} | [
"PtoPXmitMsgsItemStream",
"getXmitQueuePoint",
"(",
"SIBUuid8",
"meUuid",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"getXmitQueuePoint\"",
",",
"meUuid",
")",
";",
"PtoPXmitMsgsItemStream",
"stream",
"=",
"getLocalisationManager",
"(",
")",
".",
"getXmitQueuePoint",
"(",
"meUuid",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"getXmitQueuePoint\"",
",",
"stream",
")",
";",
"return",
"stream",
";",
"}"
] | Return the itemstream representing a transmit queue to a remote ME
@param meUuid
@return | [
"Return",
"the",
"itemstream",
"representing",
"a",
"transmit",
"queue",
"to",
"a",
"remote",
"ME"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java#L3066-L3077 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java | BaseDestinationHandler.eventMessageExpiryNotification | private void eventMessageExpiryNotification(
SIMPMessage msg,
TransactionCommon tran) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"eventMessageExpiryNotification",
new Object[] { msg, tran });
// If a ReportHandler object has not been created yet, then do so.
if (_reportHandler == null)
_reportHandler = new ReportHandler(messageProcessor);
// Generate and send the report under the same transaction as the delete
try
{
_reportHandler.handleMessage(msg, tran, SIApiConstants.REPORT_EXPIRY);
} catch (SIException e)
{
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.BaseDestinationHandler.eventMessageExpiryNotification",
"1:3778:1.700.3.45",
this);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "eventMessageExpiryNotification", "SIResourceException");
throw new SIResourceException(
nls.getFormattedMessage(
"REPORT_MESSAGE_ERROR_CWSIP0422",
new Object[] { messageProcessor.getMessagingEngineName(), e },
null),
e);
}
/**
* 463584
* If this message has been restored from msgstore but this destination has been recreated
* in admin thus a different destination uuid and diferent BDH instance the stats object will be null.
* It only gets initialized during the create/updateLocalisations call. This call will never happen
* on this BDH.
* Therefore... If a destination has been recreated, the stats on expiry will no longer be valid.
*/
if (_protoRealization != null)
_protoRealization.onExpiryReport();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "eventMessageExpiryNotification");
} | java | private void eventMessageExpiryNotification(
SIMPMessage msg,
TransactionCommon tran) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"eventMessageExpiryNotification",
new Object[] { msg, tran });
// If a ReportHandler object has not been created yet, then do so.
if (_reportHandler == null)
_reportHandler = new ReportHandler(messageProcessor);
// Generate and send the report under the same transaction as the delete
try
{
_reportHandler.handleMessage(msg, tran, SIApiConstants.REPORT_EXPIRY);
} catch (SIException e)
{
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.BaseDestinationHandler.eventMessageExpiryNotification",
"1:3778:1.700.3.45",
this);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "eventMessageExpiryNotification", "SIResourceException");
throw new SIResourceException(
nls.getFormattedMessage(
"REPORT_MESSAGE_ERROR_CWSIP0422",
new Object[] { messageProcessor.getMessagingEngineName(), e },
null),
e);
}
/**
* 463584
* If this message has been restored from msgstore but this destination has been recreated
* in admin thus a different destination uuid and diferent BDH instance the stats object will be null.
* It only gets initialized during the create/updateLocalisations call. This call will never happen
* on this BDH.
* Therefore... If a destination has been recreated, the stats on expiry will no longer be valid.
*/
if (_protoRealization != null)
_protoRealization.onExpiryReport();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "eventMessageExpiryNotification");
} | [
"private",
"void",
"eventMessageExpiryNotification",
"(",
"SIMPMessage",
"msg",
",",
"TransactionCommon",
"tran",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"eventMessageExpiryNotification\"",
",",
"new",
"Object",
"[",
"]",
"{",
"msg",
",",
"tran",
"}",
")",
";",
"// If a ReportHandler object has not been created yet, then do so.",
"if",
"(",
"_reportHandler",
"==",
"null",
")",
"_reportHandler",
"=",
"new",
"ReportHandler",
"(",
"messageProcessor",
")",
";",
"// Generate and send the report under the same transaction as the delete",
"try",
"{",
"_reportHandler",
".",
"handleMessage",
"(",
"msg",
",",
"tran",
",",
"SIApiConstants",
".",
"REPORT_EXPIRY",
")",
";",
"}",
"catch",
"(",
"SIException",
"e",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.impl.BaseDestinationHandler.eventMessageExpiryNotification\"",
",",
"\"1:3778:1.700.3.45\"",
",",
"this",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"eventMessageExpiryNotification\"",
",",
"\"SIResourceException\"",
")",
";",
"throw",
"new",
"SIResourceException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"REPORT_MESSAGE_ERROR_CWSIP0422\"",
",",
"new",
"Object",
"[",
"]",
"{",
"messageProcessor",
".",
"getMessagingEngineName",
"(",
")",
",",
"e",
"}",
",",
"null",
")",
",",
"e",
")",
";",
"}",
"/**\n * 463584\n * If this message has been restored from msgstore but this destination has been recreated\n * in admin thus a different destination uuid and diferent BDH instance the stats object will be null.\n * It only gets initialized during the create/updateLocalisations call. This call will never happen\n * on this BDH.\n * Therefore... If a destination has been recreated, the stats on expiry will no longer be valid.\n */",
"if",
"(",
"_protoRealization",
"!=",
"null",
")",
"_protoRealization",
".",
"onExpiryReport",
"(",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"eventMessageExpiryNotification\"",
")",
";",
"}"
] | This is a callback required for expiry notification. For example,
we generate a report message here if expiry reports are requested.
@param msg The expired message
@param tran The transaction under which the message will be deleted
Feature 179365.6 | [
"This",
"is",
"a",
"callback",
"required",
"for",
"expiry",
"notification",
".",
"For",
"example",
"we",
"generate",
"a",
"report",
"message",
"here",
"if",
"expiry",
"reports",
"are",
"requested",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java#L3305-L3353 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java | BaseDestinationHandler.constructPseudoDurableDestName | public String constructPseudoDurableDestName(String subName)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "constructPseudoDurableDestName", subName);
String psuedoDestName = constructPseudoDurableDestName(
messageProcessor.getMessagingEngineUuid().toString(),
subName);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "constructPseudoDurableDestName", psuedoDestName);
return psuedoDestName;
} | java | public String constructPseudoDurableDestName(String subName)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "constructPseudoDurableDestName", subName);
String psuedoDestName = constructPseudoDurableDestName(
messageProcessor.getMessagingEngineUuid().toString(),
subName);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "constructPseudoDurableDestName", psuedoDestName);
return psuedoDestName;
} | [
"public",
"String",
"constructPseudoDurableDestName",
"(",
"String",
"subName",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"constructPseudoDurableDestName\"",
",",
"subName",
")",
";",
"String",
"psuedoDestName",
"=",
"constructPseudoDurableDestName",
"(",
"messageProcessor",
".",
"getMessagingEngineUuid",
"(",
")",
".",
"toString",
"(",
")",
",",
"subName",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"constructPseudoDurableDestName\"",
",",
"psuedoDestName",
")",
";",
"return",
"psuedoDestName",
";",
"}"
] | Creates the pseudo destination name string for remote durable
subscriptions.
The case when this local ME is the DME.
@param subName the durable sub name
@return a string of the form "localME##subName" | [
"Creates",
"the",
"pseudo",
"destination",
"name",
"string",
"for",
"remote",
"durable",
"subscriptions",
".",
"The",
"case",
"when",
"this",
"local",
"ME",
"is",
"the",
"DME",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java#L3363-L3373 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java | BaseDestinationHandler.constructPseudoDurableDestName | public String constructPseudoDurableDestName(String meUUID, String durableName)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "constructPseudoDurableDestName", new Object[] { meUUID, durableName });
String returnString = meUUID + "##" + durableName;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "constructPseudoDurableDestName", returnString);
return returnString;
} | java | public String constructPseudoDurableDestName(String meUUID, String durableName)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "constructPseudoDurableDestName", new Object[] { meUUID, durableName });
String returnString = meUUID + "##" + durableName;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "constructPseudoDurableDestName", returnString);
return returnString;
} | [
"public",
"String",
"constructPseudoDurableDestName",
"(",
"String",
"meUUID",
",",
"String",
"durableName",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"constructPseudoDurableDestName\"",
",",
"new",
"Object",
"[",
"]",
"{",
"meUUID",
",",
"durableName",
"}",
")",
";",
"String",
"returnString",
"=",
"meUUID",
"+",
"\"##\"",
"+",
"durableName",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"constructPseudoDurableDestName\"",
",",
"returnString",
")",
";",
"return",
"returnString",
";",
"}"
] | Creates the pseudo destination name string for remote durable
subscriptions.
The case when the the DME is remote to this ME.
@param meUUID the durable home ME uuid
@param subName the durable sub name
@return a string of the form "localME##subName" | [
"Creates",
"the",
"pseudo",
"destination",
"name",
"string",
"for",
"remote",
"durable",
"subscriptions",
".",
"The",
"case",
"when",
"the",
"the",
"DME",
"is",
"remote",
"to",
"this",
"ME",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java#L3384-L3392 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java | BaseDestinationHandler.getAnycastOHForPseudoDest | public AnycastOutputHandler getAnycastOHForPseudoDest(String destName)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getAnycastOHForPseudoDest", destName);
AnycastOutputHandler returnAOH =
_pubSubRealization.
getRemotePubSubSupport().
getAnycastOHForPseudoDest(destName);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "getAnycastOHForPseudoDest", returnAOH);
return returnAOH;
} | java | public AnycastOutputHandler getAnycastOHForPseudoDest(String destName)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getAnycastOHForPseudoDest", destName);
AnycastOutputHandler returnAOH =
_pubSubRealization.
getRemotePubSubSupport().
getAnycastOHForPseudoDest(destName);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "getAnycastOHForPseudoDest", returnAOH);
return returnAOH;
} | [
"public",
"AnycastOutputHandler",
"getAnycastOHForPseudoDest",
"(",
"String",
"destName",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"getAnycastOHForPseudoDest\"",
",",
"destName",
")",
";",
"AnycastOutputHandler",
"returnAOH",
"=",
"_pubSubRealization",
".",
"getRemotePubSubSupport",
"(",
")",
".",
"getAnycastOHForPseudoDest",
"(",
"destName",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"getAnycastOHForPseudoDest\"",
",",
"returnAOH",
")",
";",
"return",
"returnAOH",
";",
"}"
] | Durable subscriptions homed on this ME but attached to from remote MEs
have AnycastOutputHandlers mapped by their pseudo destination names.
@return The AnycastOutput for this pseudo destination | [
"Durable",
"subscriptions",
"homed",
"on",
"this",
"ME",
"but",
"attached",
"to",
"from",
"remote",
"MEs",
"have",
"AnycastOutputHandlers",
"mapped",
"by",
"their",
"pseudo",
"destination",
"names",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java#L3419-L3431 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java | BaseDestinationHandler.sendCODMessage | void sendCODMessage(SIMPMessage msg, TransactionCommon tran) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "sendCODMessage", new Object[] { msg, tran });
// If COD Report messages are required, this is when we need to create and
// send them.
if (msg.getReportCOD() != null)
{
// Create the ReportHandler object if not already created
if (_reportHandler == null)
_reportHandler = new ReportHandler(messageProcessor);
try
{
_reportHandler.handleMessage(msg, tran, SIApiConstants.REPORT_COD);
} catch (SIException e)
{
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.BaseDestinationHandler.sendCODMessage",
"1:3909:1.700.3.45",
this);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "sendCODMessage", "SIResourceException");
throw new SIResourceException(
nls.getFormattedMessage(
"REPORT_MESSAGE_ERROR_CWSIP0423",
new Object[] { messageProcessor.getMessagingEngineName(), e },
null),
e);
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "sendCODMessage");
} | java | void sendCODMessage(SIMPMessage msg, TransactionCommon tran) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "sendCODMessage", new Object[] { msg, tran });
// If COD Report messages are required, this is when we need to create and
// send them.
if (msg.getReportCOD() != null)
{
// Create the ReportHandler object if not already created
if (_reportHandler == null)
_reportHandler = new ReportHandler(messageProcessor);
try
{
_reportHandler.handleMessage(msg, tran, SIApiConstants.REPORT_COD);
} catch (SIException e)
{
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.BaseDestinationHandler.sendCODMessage",
"1:3909:1.700.3.45",
this);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "sendCODMessage", "SIResourceException");
throw new SIResourceException(
nls.getFormattedMessage(
"REPORT_MESSAGE_ERROR_CWSIP0423",
new Object[] { messageProcessor.getMessagingEngineName(), e },
null),
e);
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "sendCODMessage");
} | [
"void",
"sendCODMessage",
"(",
"SIMPMessage",
"msg",
",",
"TransactionCommon",
"tran",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"sendCODMessage\"",
",",
"new",
"Object",
"[",
"]",
"{",
"msg",
",",
"tran",
"}",
")",
";",
"// If COD Report messages are required, this is when we need to create and",
"// send them.",
"if",
"(",
"msg",
".",
"getReportCOD",
"(",
")",
"!=",
"null",
")",
"{",
"// Create the ReportHandler object if not already created",
"if",
"(",
"_reportHandler",
"==",
"null",
")",
"_reportHandler",
"=",
"new",
"ReportHandler",
"(",
"messageProcessor",
")",
";",
"try",
"{",
"_reportHandler",
".",
"handleMessage",
"(",
"msg",
",",
"tran",
",",
"SIApiConstants",
".",
"REPORT_COD",
")",
";",
"}",
"catch",
"(",
"SIException",
"e",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.impl.BaseDestinationHandler.sendCODMessage\"",
",",
"\"1:3909:1.700.3.45\"",
",",
"this",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"sendCODMessage\"",
",",
"\"SIResourceException\"",
")",
";",
"throw",
"new",
"SIResourceException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"REPORT_MESSAGE_ERROR_CWSIP0423\"",
",",
"new",
"Object",
"[",
"]",
"{",
"messageProcessor",
".",
"getMessagingEngineName",
"(",
")",
",",
"e",
"}",
",",
"null",
")",
",",
"e",
")",
";",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"sendCODMessage\"",
")",
";",
"}"
] | Method sendCODMessage.
Initializes the reportHandler and sends a COD message if appropriate
@param msg
@param transaction | [
"Method",
"sendCODMessage",
".",
"Initializes",
"the",
"reportHandler",
"and",
"sends",
"a",
"COD",
"message",
"if",
"appropriate"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java#L3440-L3477 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java | BaseDestinationHandler.announceMPStopping | @Override
public void announceMPStopping()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "announceMPStopping");
if (isPubSub()) {
if (null != _pubSubRealization) { //doing a sanity check with checking for not null
//signal to _pubSubRealization to gracefully exit from deleteMsgsWithNoReferences()
_pubSubRealization.stopDeletingMsgsWihoutReferencesTask(true);
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "announceMPStopping");
} | java | @Override
public void announceMPStopping()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "announceMPStopping");
if (isPubSub()) {
if (null != _pubSubRealization) { //doing a sanity check with checking for not null
//signal to _pubSubRealization to gracefully exit from deleteMsgsWithNoReferences()
_pubSubRealization.stopDeletingMsgsWihoutReferencesTask(true);
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "announceMPStopping");
} | [
"@",
"Override",
"public",
"void",
"announceMPStopping",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"announceMPStopping\"",
")",
";",
"if",
"(",
"isPubSub",
"(",
")",
")",
"{",
"if",
"(",
"null",
"!=",
"_pubSubRealization",
")",
"{",
"//doing a sanity check with checking for not null",
"//signal to _pubSubRealization to gracefully exit from deleteMsgsWithNoReferences()",
"_pubSubRealization",
".",
"stopDeletingMsgsWihoutReferencesTask",
"(",
"true",
")",
";",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"announceMPStopping\"",
")",
";",
"}"
] | MP is stopping. All mediation activity should stop also. | [
"MP",
"is",
"stopping",
".",
"All",
"mediation",
"activity",
"should",
"stop",
"also",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java#L3780-L3794 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java | BaseDestinationHandler.stop | @Override
public void stop(int mode)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "stop", Integer.valueOf(mode));
// Deregister the destination
deregisterDestination();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "stop");
} | java | @Override
public void stop(int mode)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "stop", Integer.valueOf(mode));
// Deregister the destination
deregisterDestination();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "stop");
} | [
"@",
"Override",
"public",
"void",
"stop",
"(",
"int",
"mode",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"stop\"",
",",
"Integer",
".",
"valueOf",
"(",
"mode",
")",
")",
";",
"// Deregister the destination",
"deregisterDestination",
"(",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"stop\"",
")",
";",
"}"
] | Stop anything that needs stopping, like mediations..etc. | [
"Stop",
"anything",
"that",
"needs",
"stopping",
"like",
"mediations",
"..",
"etc",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java#L3902-L3913 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java | BaseDestinationHandler.createDurableFromRemote | public int createDurableFromRemote(
String subName,
SelectionCriteria criteria,
String user,
boolean isCloned,
boolean isNoLocal,
boolean isSIBServerSubject)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"createDurableFromRemote",
new Object[] { subName, criteria, user, Boolean.valueOf(isSIBServerSubject) });
int status = DurableConstants.STATUS_OK;
// Create a ConsumerDispatcherState for the local call
ConsumerDispatcherState subState =
new ConsumerDispatcherState(
subName,
definition.getUUID(),
criteria,
isNoLocal,
messageProcessor.getMessagingEngineName(),
definition.getName(),
getBus());
// Set the security id into the CD state
subState.setUser(user, isSIBServerSubject);
//defect 259036 - we need to enable sharing of the durable subscription
subState.setIsCloned(isCloned);
try
{
_pubSubRealization.createLocalDurableSubscription(subState, null);
} catch (SIDurableSubscriptionAlreadyExistsException e)
{
// No FFDC code needed
status = DurableConstants.STATUS_SUB_ALREADY_EXISTS;
} catch (Throwable e)
{
// FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.BaseDestinationHandler.createDurableFromRemote",
"1:4436:1.700.3.45",
this);
// FFDC keeps the local broker happy, but we still need to return
// a status to keep the remote ME live.
status = DurableConstants.STATUS_SUB_GENERAL_ERROR;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "createDurableFromRemote", Integer.valueOf(status));
return status;
} | java | public int createDurableFromRemote(
String subName,
SelectionCriteria criteria,
String user,
boolean isCloned,
boolean isNoLocal,
boolean isSIBServerSubject)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"createDurableFromRemote",
new Object[] { subName, criteria, user, Boolean.valueOf(isSIBServerSubject) });
int status = DurableConstants.STATUS_OK;
// Create a ConsumerDispatcherState for the local call
ConsumerDispatcherState subState =
new ConsumerDispatcherState(
subName,
definition.getUUID(),
criteria,
isNoLocal,
messageProcessor.getMessagingEngineName(),
definition.getName(),
getBus());
// Set the security id into the CD state
subState.setUser(user, isSIBServerSubject);
//defect 259036 - we need to enable sharing of the durable subscription
subState.setIsCloned(isCloned);
try
{
_pubSubRealization.createLocalDurableSubscription(subState, null);
} catch (SIDurableSubscriptionAlreadyExistsException e)
{
// No FFDC code needed
status = DurableConstants.STATUS_SUB_ALREADY_EXISTS;
} catch (Throwable e)
{
// FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.BaseDestinationHandler.createDurableFromRemote",
"1:4436:1.700.3.45",
this);
// FFDC keeps the local broker happy, but we still need to return
// a status to keep the remote ME live.
status = DurableConstants.STATUS_SUB_GENERAL_ERROR;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "createDurableFromRemote", Integer.valueOf(status));
return status;
} | [
"public",
"int",
"createDurableFromRemote",
"(",
"String",
"subName",
",",
"SelectionCriteria",
"criteria",
",",
"String",
"user",
",",
"boolean",
"isCloned",
",",
"boolean",
"isNoLocal",
",",
"boolean",
"isSIBServerSubject",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"createDurableFromRemote\"",
",",
"new",
"Object",
"[",
"]",
"{",
"subName",
",",
"criteria",
",",
"user",
",",
"Boolean",
".",
"valueOf",
"(",
"isSIBServerSubject",
")",
"}",
")",
";",
"int",
"status",
"=",
"DurableConstants",
".",
"STATUS_OK",
";",
"// Create a ConsumerDispatcherState for the local call",
"ConsumerDispatcherState",
"subState",
"=",
"new",
"ConsumerDispatcherState",
"(",
"subName",
",",
"definition",
".",
"getUUID",
"(",
")",
",",
"criteria",
",",
"isNoLocal",
",",
"messageProcessor",
".",
"getMessagingEngineName",
"(",
")",
",",
"definition",
".",
"getName",
"(",
")",
",",
"getBus",
"(",
")",
")",
";",
"// Set the security id into the CD state",
"subState",
".",
"setUser",
"(",
"user",
",",
"isSIBServerSubject",
")",
";",
"//defect 259036 - we need to enable sharing of the durable subscription",
"subState",
".",
"setIsCloned",
"(",
"isCloned",
")",
";",
"try",
"{",
"_pubSubRealization",
".",
"createLocalDurableSubscription",
"(",
"subState",
",",
"null",
")",
";",
"}",
"catch",
"(",
"SIDurableSubscriptionAlreadyExistsException",
"e",
")",
"{",
"// No FFDC code needed",
"status",
"=",
"DurableConstants",
".",
"STATUS_SUB_ALREADY_EXISTS",
";",
"}",
"catch",
"(",
"Throwable",
"e",
")",
"{",
"// FFDC",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.impl.BaseDestinationHandler.createDurableFromRemote\"",
",",
"\"1:4436:1.700.3.45\"",
",",
"this",
")",
";",
"// FFDC keeps the local broker happy, but we still need to return",
"// a status to keep the remote ME live.",
"status",
"=",
"DurableConstants",
".",
"STATUS_SUB_GENERAL_ERROR",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"createDurableFromRemote\"",
",",
"Integer",
".",
"valueOf",
"(",
"status",
")",
")",
";",
"return",
"status",
";",
"}"
] | Handle a remote request to create a local durable subscription.
@param subName The name of the durable subscription to create.
@param criteria This wraps the topic (aka discriminator) for the durable
subscription and its selector.
@param user The name of the user associated with the durable subscription.
@param isSIBServerSubject Flag whether the user is the privileged SIBServerSubject
@return DurableConstants.STATUS_OK if the create works,
DurableConstants.STATUS_SUB_ALREADY_EXISTS if there is already a
subscription with the given name, or DurableConstants.STATUS_SUB_GENERAL_ERROR
if an exception occurs while creating the subscription. | [
"Handle",
"a",
"remote",
"request",
"to",
"create",
"a",
"local",
"durable",
"subscription",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java#L3956-L4013 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java | BaseDestinationHandler.getRoutingDestinationAddr | @Override
public JsDestinationAddress getRoutingDestinationAddr(JsDestinationAddress inAddress,
boolean fixedMessagePoint)
throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getRoutingDestinationAddr", new Object[] { this,
inAddress,
Boolean.valueOf(fixedMessagePoint) });
JsDestinationAddress routingAddress = null;
// Pull out any encoded ME from a system or temporary queue
SIBUuid8 encodedME = null;
if (_isSystem || _isTemporary)
encodedME = SIMPUtils.parseME(inAddress.getDestinationName());
// If this is a system or temporary queue that is located on a different ME to us
// we need to set the actual address as the routing destination.
if ((encodedME != null) && !(encodedME.equals(getMessageProcessor().getMessagingEngineUuid())))
{
routingAddress = inAddress;
}
// The only other reason for setting a routing destination is if the sender is bound
// (or will be bound) to a single message point. In which case we use the routing
// address to transmit the chosen ME (added later by the caller)
else if (fixedMessagePoint)
{
//TODO what if inAddres is isLocalOnly() or already has an ME?
routingAddress = _destinationAddr;
}
else if ((inAddress != null) && (inAddress.getME() != null))
{
routingAddress = _destinationAddr;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "getRoutingDestinationAddr", routingAddress);
return routingAddress;
} | java | @Override
public JsDestinationAddress getRoutingDestinationAddr(JsDestinationAddress inAddress,
boolean fixedMessagePoint)
throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getRoutingDestinationAddr", new Object[] { this,
inAddress,
Boolean.valueOf(fixedMessagePoint) });
JsDestinationAddress routingAddress = null;
// Pull out any encoded ME from a system or temporary queue
SIBUuid8 encodedME = null;
if (_isSystem || _isTemporary)
encodedME = SIMPUtils.parseME(inAddress.getDestinationName());
// If this is a system or temporary queue that is located on a different ME to us
// we need to set the actual address as the routing destination.
if ((encodedME != null) && !(encodedME.equals(getMessageProcessor().getMessagingEngineUuid())))
{
routingAddress = inAddress;
}
// The only other reason for setting a routing destination is if the sender is bound
// (or will be bound) to a single message point. In which case we use the routing
// address to transmit the chosen ME (added later by the caller)
else if (fixedMessagePoint)
{
//TODO what if inAddres is isLocalOnly() or already has an ME?
routingAddress = _destinationAddr;
}
else if ((inAddress != null) && (inAddress.getME() != null))
{
routingAddress = _destinationAddr;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "getRoutingDestinationAddr", routingAddress);
return routingAddress;
} | [
"@",
"Override",
"public",
"JsDestinationAddress",
"getRoutingDestinationAddr",
"(",
"JsDestinationAddress",
"inAddress",
",",
"boolean",
"fixedMessagePoint",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"getRoutingDestinationAddr\"",
",",
"new",
"Object",
"[",
"]",
"{",
"this",
",",
"inAddress",
",",
"Boolean",
".",
"valueOf",
"(",
"fixedMessagePoint",
")",
"}",
")",
";",
"JsDestinationAddress",
"routingAddress",
"=",
"null",
";",
"// Pull out any encoded ME from a system or temporary queue",
"SIBUuid8",
"encodedME",
"=",
"null",
";",
"if",
"(",
"_isSystem",
"||",
"_isTemporary",
")",
"encodedME",
"=",
"SIMPUtils",
".",
"parseME",
"(",
"inAddress",
".",
"getDestinationName",
"(",
")",
")",
";",
"// If this is a system or temporary queue that is located on a different ME to us",
"// we need to set the actual address as the routing destination.",
"if",
"(",
"(",
"encodedME",
"!=",
"null",
")",
"&&",
"!",
"(",
"encodedME",
".",
"equals",
"(",
"getMessageProcessor",
"(",
")",
".",
"getMessagingEngineUuid",
"(",
")",
")",
")",
")",
"{",
"routingAddress",
"=",
"inAddress",
";",
"}",
"// The only other reason for setting a routing destination is if the sender is bound",
"// (or will be bound) to a single message point. In which case we use the routing",
"// address to transmit the chosen ME (added later by the caller)",
"else",
"if",
"(",
"fixedMessagePoint",
")",
"{",
"//TODO what if inAddres is isLocalOnly() or already has an ME?",
"routingAddress",
"=",
"_destinationAddr",
";",
"}",
"else",
"if",
"(",
"(",
"inAddress",
"!=",
"null",
")",
"&&",
"(",
"inAddress",
".",
"getME",
"(",
")",
"!=",
"null",
")",
")",
"{",
"routingAddress",
"=",
"_destinationAddr",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"getRoutingDestinationAddr\"",
",",
"routingAddress",
")",
";",
"return",
"routingAddress",
";",
"}"
] | Being a 'real' destination, there is no implicit need to add a routing destination
address to any messages sent to this destination. However, if the sender is bound
to a single message point then we need to set a routing destination so that a particular
ME Uuid can be set into it.
Another reason for setting a routing address is if we're sending to a remote system or
temporary queue | [
"Being",
"a",
"real",
"destination",
"there",
"is",
"no",
"implicit",
"need",
"to",
"add",
"a",
"routing",
"destination",
"address",
"to",
"any",
"messages",
"sent",
"to",
"this",
"destination",
".",
"However",
"if",
"the",
"sender",
"is",
"bound",
"to",
"a",
"single",
"message",
"point",
"then",
"we",
"need",
"to",
"set",
"a",
"routing",
"destination",
"so",
"that",
"a",
"particular",
"ME",
"Uuid",
"can",
"be",
"set",
"into",
"it",
".",
"Another",
"reason",
"for",
"setting",
"a",
"routing",
"address",
"is",
"if",
"we",
"re",
"sending",
"to",
"a",
"remote",
"system",
"or",
"temporary",
"queue"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java#L4289-L4330 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java | BaseDestinationHandler.deleteRemoteDurableDME | public void deleteRemoteDurableDME(String subName)
throws SIRollbackException,
SIConnectionLostException,
SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"deleteRemoteDurableDME",
new Object[] { subName });
_pubSubRealization.
getRemotePubSubSupport().
deleteRemoteDurableDME(subName);
// All done, return
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "deleteRemoteDurableDME");
} | java | public void deleteRemoteDurableDME(String subName)
throws SIRollbackException,
SIConnectionLostException,
SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"deleteRemoteDurableDME",
new Object[] { subName });
_pubSubRealization.
getRemotePubSubSupport().
deleteRemoteDurableDME(subName);
// All done, return
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "deleteRemoteDurableDME");
} | [
"public",
"void",
"deleteRemoteDurableDME",
"(",
"String",
"subName",
")",
"throws",
"SIRollbackException",
",",
"SIConnectionLostException",
",",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"deleteRemoteDurableDME\"",
",",
"new",
"Object",
"[",
"]",
"{",
"subName",
"}",
")",
";",
"_pubSubRealization",
".",
"getRemotePubSubSupport",
"(",
")",
".",
"deleteRemoteDurableDME",
"(",
"subName",
")",
";",
"// All done, return",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"deleteRemoteDurableDME\"",
")",
";",
"}"
] | Clean up the local AnycastOutputHandler that was created to handle
access to a locally homed durable subscription. This method should
only be invoked as part of ConsumerDispatcher.deleteConsumerDispatcher.
@param subName Name of the local durable subscription being removed. | [
"Clean",
"up",
"the",
"local",
"AnycastOutputHandler",
"that",
"was",
"created",
"to",
"handle",
"access",
"to",
"a",
"locally",
"homed",
"durable",
"subscription",
".",
"This",
"method",
"should",
"only",
"be",
"invoked",
"as",
"part",
"of",
"ConsumerDispatcher",
".",
"deleteConsumerDispatcher",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java#L4435-L4453 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java | BaseDestinationHandler.requestReallocation | public void requestReallocation()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "requestReallocation");
if (!isCorruptOrIndoubt()) { //PK73754
// Reset reallocation flag under lock on the BDH.
synchronized (this)
{
_isToBeReallocated = true;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(tc, "requestReallocation", "Have set reallocation flag");
}
// Set cleanup_pending state
destinationManager.getDestinationIndex().cleanup(this);
destinationManager.startAsynchDeletion();
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "requestReallocation");
} | java | public void requestReallocation()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "requestReallocation");
if (!isCorruptOrIndoubt()) { //PK73754
// Reset reallocation flag under lock on the BDH.
synchronized (this)
{
_isToBeReallocated = true;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(tc, "requestReallocation", "Have set reallocation flag");
}
// Set cleanup_pending state
destinationManager.getDestinationIndex().cleanup(this);
destinationManager.startAsynchDeletion();
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "requestReallocation");
} | [
"public",
"void",
"requestReallocation",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"requestReallocation\"",
")",
";",
"if",
"(",
"!",
"isCorruptOrIndoubt",
"(",
")",
")",
"{",
"//PK73754",
"// Reset reallocation flag under lock on the BDH.",
"synchronized",
"(",
"this",
")",
"{",
"_isToBeReallocated",
"=",
"true",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"requestReallocation\"",
",",
"\"Have set reallocation flag\"",
")",
";",
"}",
"// Set cleanup_pending state",
"destinationManager",
".",
"getDestinationIndex",
"(",
")",
".",
"cleanup",
"(",
"this",
")",
";",
"destinationManager",
".",
"startAsynchDeletion",
"(",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"requestReallocation\"",
")",
";",
"}"
] | Request reallocation of transmitQs on the next
asynch deletion thread run | [
"Request",
"reallocation",
"of",
"transmitQs",
"on",
"the",
"next",
"asynch",
"deletion",
"thread",
"run"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java#L4459-L4482 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java | BaseDestinationHandler.isTopicAccessCheckRequired | @Override
public boolean isTopicAccessCheckRequired()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "isTopicAccessCheckRequired");
if (!isPubSub() || isTemporary())
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "isTopicAccessCheckRequired", Boolean.FALSE);
return false;
}
boolean check = super.isTopicAccessCheckRequired();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "isTopicAccessCheckRequired", Boolean.valueOf(check));
return check;
// Look to the underlying definition
} | java | @Override
public boolean isTopicAccessCheckRequired()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "isTopicAccessCheckRequired");
if (!isPubSub() || isTemporary())
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "isTopicAccessCheckRequired", Boolean.FALSE);
return false;
}
boolean check = super.isTopicAccessCheckRequired();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "isTopicAccessCheckRequired", Boolean.valueOf(check));
return check;
// Look to the underlying definition
} | [
"@",
"Override",
"public",
"boolean",
"isTopicAccessCheckRequired",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"isTopicAccessCheckRequired\"",
")",
";",
"if",
"(",
"!",
"isPubSub",
"(",
")",
"||",
"isTemporary",
"(",
")",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"isTopicAccessCheckRequired\"",
",",
"Boolean",
".",
"FALSE",
")",
";",
"return",
"false",
";",
"}",
"boolean",
"check",
"=",
"super",
".",
"isTopicAccessCheckRequired",
"(",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"isTopicAccessCheckRequired\"",
",",
"Boolean",
".",
"valueOf",
"(",
"check",
")",
")",
";",
"return",
"check",
";",
"// Look to the underlying definition",
"}"
] | Override Method in AbstractBaseDestinationHandler | [
"Override",
"Method",
"in",
"AbstractBaseDestinationHandler"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java#L4617-L4636 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java | BaseDestinationHandler.removeAnycastInputHandlerAndRCD | public boolean removeAnycastInputHandlerAndRCD(String key) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "removeAnycastInputHandlerAndRCD", key);
boolean removed = _protoRealization.
getRemoteSupport().
removeAnycastInputHandlerAndRCD(key);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "removeAnycastInputHandlerAndRCD", Boolean.valueOf(removed));
return removed;
} | java | public boolean removeAnycastInputHandlerAndRCD(String key) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "removeAnycastInputHandlerAndRCD", key);
boolean removed = _protoRealization.
getRemoteSupport().
removeAnycastInputHandlerAndRCD(key);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "removeAnycastInputHandlerAndRCD", Boolean.valueOf(removed));
return removed;
} | [
"public",
"boolean",
"removeAnycastInputHandlerAndRCD",
"(",
"String",
"key",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"removeAnycastInputHandlerAndRCD\"",
",",
"key",
")",
";",
"boolean",
"removed",
"=",
"_protoRealization",
".",
"getRemoteSupport",
"(",
")",
".",
"removeAnycastInputHandlerAndRCD",
"(",
"key",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"removeAnycastInputHandlerAndRCD\"",
",",
"Boolean",
".",
"valueOf",
"(",
"removed",
")",
")",
";",
"return",
"removed",
";",
"}"
] | Removes the AIH and the RCD instances for a given dme ID. Also removes the itemStreams
from the messageStore for the aiContainerItemStream and the rcdItemStream
@param dmeID the uuid of the dme which the instances of the aih and rcd
will be deleted.
@throws SIResourceException if there was a problem with removing the itemStreams
from the messageStore
@return boolean as to whether the itemstreams were removed or not | [
"Removes",
"the",
"AIH",
"and",
"the",
"RCD",
"instances",
"for",
"a",
"given",
"dme",
"ID",
".",
"Also",
"removes",
"the",
"itemStreams",
"from",
"the",
"messageStore",
"for",
"the",
"aiContainerItemStream",
"and",
"the",
"rcdItemStream"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java#L4665-L4678 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java | BaseDestinationHandler.closeRemoteConsumer | public void closeRemoteConsumer(SIBUuid8 dmeUuid)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "closeRemoteConsumer", dmeUuid);
_protoRealization.
getRemoteSupport().
closeRemoteConsumers(dmeUuid);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "closeRemoteConsumer");
return;
} | java | public void closeRemoteConsumer(SIBUuid8 dmeUuid)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "closeRemoteConsumer", dmeUuid);
_protoRealization.
getRemoteSupport().
closeRemoteConsumers(dmeUuid);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "closeRemoteConsumer");
return;
} | [
"public",
"void",
"closeRemoteConsumer",
"(",
"SIBUuid8",
"dmeUuid",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"closeRemoteConsumer\"",
",",
"dmeUuid",
")",
";",
"_protoRealization",
".",
"getRemoteSupport",
"(",
")",
".",
"closeRemoteConsumers",
"(",
"dmeUuid",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"closeRemoteConsumer\"",
")",
";",
"return",
";",
"}"
] | Close the remote consumers for a given remote ME
@param remoteMEUuid
@throws SIResourceException | [
"Close",
"the",
"remote",
"consumers",
"for",
"a",
"given",
"remote",
"ME"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java#L4718-L4731 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java | BaseDestinationHandler.getPubSubRealization | public PubSubRealization getPubSubRealization()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(tc, "getPubSubRealization");
SibTr.exit(tc, "getPubSubRealization", _pubSubRealization);
}
return _pubSubRealization;
} | java | public PubSubRealization getPubSubRealization()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(tc, "getPubSubRealization");
SibTr.exit(tc, "getPubSubRealization", _pubSubRealization);
}
return _pubSubRealization;
} | [
"public",
"PubSubRealization",
"getPubSubRealization",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"getPubSubRealization\"",
")",
";",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"getPubSubRealization\"",
",",
"_pubSubRealization",
")",
";",
"}",
"return",
"_pubSubRealization",
";",
"}"
] | Retrieve the PubSubRealization
@return | [
"Retrieve",
"the",
"PubSubRealization"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java#L4949-L4957 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java | BaseDestinationHandler.getPtoPRealization | public PtoPRealization getPtoPRealization()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(tc, "getPtoPRealization");
SibTr.exit(tc, "getPtoPRealization", _ptoPRealization);
}
return _ptoPRealization;
} | java | public PtoPRealization getPtoPRealization()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(tc, "getPtoPRealization");
SibTr.exit(tc, "getPtoPRealization", _ptoPRealization);
}
return _ptoPRealization;
} | [
"public",
"PtoPRealization",
"getPtoPRealization",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"getPtoPRealization\"",
")",
";",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"getPtoPRealization\"",
",",
"_ptoPRealization",
")",
";",
"}",
"return",
"_ptoPRealization",
";",
"}"
] | Retrieve the PtoPRealization
@return | [
"Retrieve",
"the",
"PtoPRealization"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java#L4964-L4972 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java | BaseDestinationHandler.getProtocolRealization | public AbstractProtoRealization getProtocolRealization()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(tc, "getProtocolRealization");
SibTr.exit(tc, "getProtocolRealization", _protoRealization);
}
return _protoRealization;
} | java | public AbstractProtoRealization getProtocolRealization()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(tc, "getProtocolRealization");
SibTr.exit(tc, "getProtocolRealization", _protoRealization);
}
return _protoRealization;
} | [
"public",
"AbstractProtoRealization",
"getProtocolRealization",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"getProtocolRealization\"",
")",
";",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"getProtocolRealization\"",
",",
"_protoRealization",
")",
";",
"}",
"return",
"_protoRealization",
";",
"}"
] | Retrieve the ProtocolRealization
@return | [
"Retrieve",
"the",
"ProtocolRealization"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java#L4979-L4987 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java | BaseDestinationHandler.getLocalisationManager | public LocalisationManager getLocalisationManager()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getLocalisationManager", this);
// Instantiate LocalisationManager to manage localisations and interface to WLM
if (_localisationManager == null)
{
_localisationManager =
new LocalisationManager(this);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "getLocalisationManager", _localisationManager);
return _localisationManager;
} | java | public LocalisationManager getLocalisationManager()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getLocalisationManager", this);
// Instantiate LocalisationManager to manage localisations and interface to WLM
if (_localisationManager == null)
{
_localisationManager =
new LocalisationManager(this);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "getLocalisationManager", _localisationManager);
return _localisationManager;
} | [
"public",
"LocalisationManager",
"getLocalisationManager",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"getLocalisationManager\"",
",",
"this",
")",
";",
"// Instantiate LocalisationManager to manage localisations and interface to WLM",
"if",
"(",
"_localisationManager",
"==",
"null",
")",
"{",
"_localisationManager",
"=",
"new",
"LocalisationManager",
"(",
"this",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"getLocalisationManager\"",
",",
"_localisationManager",
")",
";",
"return",
"_localisationManager",
";",
"}"
] | Retrieve the LocalisationManager
@return _localisationManager | [
"Retrieve",
"the",
"LocalisationManager"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/BaseDestinationHandler.java#L4994-L5010 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderElement.java | HeaderElement.setByteArrayValue | protected void setByteArrayValue(byte[] input) {
this.sValue = null;
this.bValue = input;
this.offset = 0;
this.valueLength = input.length;
if (ELEM_ADDED != this.status) {
this.status = ELEM_CHANGED;
}
} | java | protected void setByteArrayValue(byte[] input) {
this.sValue = null;
this.bValue = input;
this.offset = 0;
this.valueLength = input.length;
if (ELEM_ADDED != this.status) {
this.status = ELEM_CHANGED;
}
} | [
"protected",
"void",
"setByteArrayValue",
"(",
"byte",
"[",
"]",
"input",
")",
"{",
"this",
".",
"sValue",
"=",
"null",
";",
"this",
".",
"bValue",
"=",
"input",
";",
"this",
".",
"offset",
"=",
"0",
";",
"this",
".",
"valueLength",
"=",
"input",
".",
"length",
";",
"if",
"(",
"ELEM_ADDED",
"!=",
"this",
".",
"status",
")",
"{",
"this",
".",
"status",
"=",
"ELEM_CHANGED",
";",
"}",
"}"
] | Set the byte array value to the given input.
@param input | [
"Set",
"the",
"byte",
"array",
"value",
"to",
"the",
"given",
"input",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderElement.java#L384-L392 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderElement.java | HeaderElement.setByteArrayValue | protected void setByteArrayValue(byte[] input, int offset, int length) {
if ((offset + length) > input.length) {
throw new IllegalArgumentException(
"Invalid length: " + offset + "+" + length + " > " + input.length);
}
this.sValue = null;
this.bValue = input;
this.offset = offset;
this.valueLength = length;
if (ELEM_ADDED != this.status) {
this.status = ELEM_CHANGED;
}
} | java | protected void setByteArrayValue(byte[] input, int offset, int length) {
if ((offset + length) > input.length) {
throw new IllegalArgumentException(
"Invalid length: " + offset + "+" + length + " > " + input.length);
}
this.sValue = null;
this.bValue = input;
this.offset = offset;
this.valueLength = length;
if (ELEM_ADDED != this.status) {
this.status = ELEM_CHANGED;
}
} | [
"protected",
"void",
"setByteArrayValue",
"(",
"byte",
"[",
"]",
"input",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"if",
"(",
"(",
"offset",
"+",
"length",
")",
">",
"input",
".",
"length",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Invalid length: \"",
"+",
"offset",
"+",
"\"+\"",
"+",
"length",
"+",
"\" > \"",
"+",
"input",
".",
"length",
")",
";",
"}",
"this",
".",
"sValue",
"=",
"null",
";",
"this",
".",
"bValue",
"=",
"input",
";",
"this",
".",
"offset",
"=",
"offset",
";",
"this",
".",
"valueLength",
"=",
"length",
";",
"if",
"(",
"ELEM_ADDED",
"!=",
"this",
".",
"status",
")",
"{",
"this",
".",
"status",
"=",
"ELEM_CHANGED",
";",
"}",
"}"
] | Set the byte array value of this header based on the input array but
starting at the input offset into that array and with the given length.
@param input
@param offset
@param length
@throws IllegalArgumentException if offset and length are incorrect | [
"Set",
"the",
"byte",
"array",
"value",
"of",
"this",
"header",
"based",
"on",
"the",
"input",
"array",
"but",
"starting",
"at",
"the",
"input",
"offset",
"into",
"that",
"array",
"and",
"with",
"the",
"given",
"length",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderElement.java#L403-L415 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderElement.java | HeaderElement.setStringValue | protected void setStringValue(String input) {
this.bValue = null;
this.sValue = input;
this.offset = 0;
this.valueLength = (null == input) ? 0 : input.length();
if (ELEM_ADDED != this.status) {
this.status = ELEM_CHANGED;
}
} | java | protected void setStringValue(String input) {
this.bValue = null;
this.sValue = input;
this.offset = 0;
this.valueLength = (null == input) ? 0 : input.length();
if (ELEM_ADDED != this.status) {
this.status = ELEM_CHANGED;
}
} | [
"protected",
"void",
"setStringValue",
"(",
"String",
"input",
")",
"{",
"this",
".",
"bValue",
"=",
"null",
";",
"this",
".",
"sValue",
"=",
"input",
";",
"this",
".",
"offset",
"=",
"0",
";",
"this",
".",
"valueLength",
"=",
"(",
"null",
"==",
"input",
")",
"?",
"0",
":",
"input",
".",
"length",
"(",
")",
";",
"if",
"(",
"ELEM_ADDED",
"!=",
"this",
".",
"status",
")",
"{",
"this",
".",
"status",
"=",
"ELEM_CHANGED",
";",
"}",
"}"
] | Set the string value to the given input.
@param input | [
"Set",
"the",
"string",
"value",
"to",
"the",
"given",
"input",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderElement.java#L422-L430 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderElement.java | HeaderElement.updateLastCRLFInfo | protected void updateLastCRLFInfo(int index, int pos, boolean isCR) {
this.lastCRLFBufferIndex = index;
this.lastCRLFPosition = pos;
this.lastCRLFisCR = isCR;
} | java | protected void updateLastCRLFInfo(int index, int pos, boolean isCR) {
this.lastCRLFBufferIndex = index;
this.lastCRLFPosition = pos;
this.lastCRLFisCR = isCR;
} | [
"protected",
"void",
"updateLastCRLFInfo",
"(",
"int",
"index",
",",
"int",
"pos",
",",
"boolean",
"isCR",
")",
"{",
"this",
".",
"lastCRLFBufferIndex",
"=",
"index",
";",
"this",
".",
"lastCRLFPosition",
"=",
"pos",
";",
"this",
".",
"lastCRLFisCR",
"=",
"isCR",
";",
"}"
] | Set the relevant information for the CRLF position information from the
parsing code.
@param index
@param pos
@param isCR | [
"Set",
"the",
"relevant",
"information",
"for",
"the",
"CRLF",
"position",
"information",
"from",
"the",
"parsing",
"code",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderElement.java#L566-L570 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderElement.java | HeaderElement.destroy | protected void destroy() {
this.nextSequence = null;
this.prevSequence = null;
this.bValue = null;
this.sValue = null;
this.buffIndex = -1;
this.offset = 0;
this.valueLength = 0;
this.myHashCode = -1;
this.lastCRLFBufferIndex = -1;
this.lastCRLFisCR = false;
this.lastCRLFPosition = -1;
this.status = ELEM_ADDED;
this.myOwner.freeElement(this);
} | java | protected void destroy() {
this.nextSequence = null;
this.prevSequence = null;
this.bValue = null;
this.sValue = null;
this.buffIndex = -1;
this.offset = 0;
this.valueLength = 0;
this.myHashCode = -1;
this.lastCRLFBufferIndex = -1;
this.lastCRLFisCR = false;
this.lastCRLFPosition = -1;
this.status = ELEM_ADDED;
this.myOwner.freeElement(this);
} | [
"protected",
"void",
"destroy",
"(",
")",
"{",
"this",
".",
"nextSequence",
"=",
"null",
";",
"this",
".",
"prevSequence",
"=",
"null",
";",
"this",
".",
"bValue",
"=",
"null",
";",
"this",
".",
"sValue",
"=",
"null",
";",
"this",
".",
"buffIndex",
"=",
"-",
"1",
";",
"this",
".",
"offset",
"=",
"0",
";",
"this",
".",
"valueLength",
"=",
"0",
";",
"this",
".",
"myHashCode",
"=",
"-",
"1",
";",
"this",
".",
"lastCRLFBufferIndex",
"=",
"-",
"1",
";",
"this",
".",
"lastCRLFisCR",
"=",
"false",
";",
"this",
".",
"lastCRLFPosition",
"=",
"-",
"1",
";",
"this",
".",
"status",
"=",
"ELEM_ADDED",
";",
"this",
".",
"myOwner",
".",
"freeElement",
"(",
"this",
")",
";",
"}"
] | Perform cleanup when this object is no longer needed. | [
"Perform",
"cleanup",
"when",
"this",
"object",
"is",
"no",
"longer",
"needed",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderElement.java#L610-L624 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/reader/MergedRepository.java | MergedRepository.getHeader | public Properties getHeader(RepositoryLogRecord record) {
if (!headerMap.containsKey(record)) {
throw new IllegalArgumentException("Record was not return by an iterator over this instance");
}
return headerMap.get(record);
} | java | public Properties getHeader(RepositoryLogRecord record) {
if (!headerMap.containsKey(record)) {
throw new IllegalArgumentException("Record was not return by an iterator over this instance");
}
return headerMap.get(record);
} | [
"public",
"Properties",
"getHeader",
"(",
"RepositoryLogRecord",
"record",
")",
"{",
"if",
"(",
"!",
"headerMap",
".",
"containsKey",
"(",
"record",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Record was not return by an iterator over this instance\"",
")",
";",
"}",
"return",
"headerMap",
".",
"get",
"(",
"record",
")",
";",
"}"
] | Returns header information for the server this record was created on.
@param record instance previously return by an iterator over this merged list.
@return header corresponding to the <code>record</code>. | [
"Returns",
"header",
"information",
"for",
"the",
"server",
"this",
"record",
"was",
"created",
"on",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/reader/MergedRepository.java#L160-L165 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jpa.container/src/com/ibm/ws/jpa/container/osgi/internal/url/WSJPAUrlUtils.java | WSJPAUrlUtils.createWSJPAURL | @Trivial
public static URL createWSJPAURL(URL url) throws MalformedURLException {
if (url == null) {
return null;
}
// Encode the URL to be embedded into the wsjpa URL's path
final String encodedURLPathStr = encode(url.toExternalForm());
URL returnURL;
try {
returnURL = AccessController.doPrivileged(new PrivilegedExceptionAction<URL>() {
@Override
@Trivial
public URL run() throws MalformedURLException {
return new URL(WSJPA_PROTOCOL_NAME + ":" + encodedURLPathStr);
}
});
} catch (PrivilegedActionException e) {
throw (MalformedURLException) e.getException();
}
return returnURL;
} | java | @Trivial
public static URL createWSJPAURL(URL url) throws MalformedURLException {
if (url == null) {
return null;
}
// Encode the URL to be embedded into the wsjpa URL's path
final String encodedURLPathStr = encode(url.toExternalForm());
URL returnURL;
try {
returnURL = AccessController.doPrivileged(new PrivilegedExceptionAction<URL>() {
@Override
@Trivial
public URL run() throws MalformedURLException {
return new URL(WSJPA_PROTOCOL_NAME + ":" + encodedURLPathStr);
}
});
} catch (PrivilegedActionException e) {
throw (MalformedURLException) e.getException();
}
return returnURL;
} | [
"@",
"Trivial",
"public",
"static",
"URL",
"createWSJPAURL",
"(",
"URL",
"url",
")",
"throws",
"MalformedURLException",
"{",
"if",
"(",
"url",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"// Encode the URL to be embedded into the wsjpa URL's path",
"final",
"String",
"encodedURLPathStr",
"=",
"encode",
"(",
"url",
".",
"toExternalForm",
"(",
")",
")",
";",
"URL",
"returnURL",
";",
"try",
"{",
"returnURL",
"=",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedExceptionAction",
"<",
"URL",
">",
"(",
")",
"{",
"@",
"Override",
"@",
"Trivial",
"public",
"URL",
"run",
"(",
")",
"throws",
"MalformedURLException",
"{",
"return",
"new",
"URL",
"(",
"WSJPA_PROTOCOL_NAME",
"+",
"\":\"",
"+",
"encodedURLPathStr",
")",
";",
"}",
"}",
")",
";",
"}",
"catch",
"(",
"PrivilegedActionException",
"e",
")",
"{",
"throw",
"(",
"MalformedURLException",
")",
"e",
".",
"getException",
"(",
")",
";",
"}",
"return",
"returnURL",
";",
"}"
] | Encapsulates the specified URL within a wsjpa URL.
@param url - the URL to encapsulate
@return - a wsjpa URL encapsulating the argument URL
@throws MalformedURLException | [
"Encapsulates",
"the",
"specified",
"URL",
"within",
"a",
"wsjpa",
"URL",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jpa.container/src/com/ibm/ws/jpa/container/osgi/internal/url/WSJPAUrlUtils.java#L34-L57 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jpa.container/src/com/ibm/ws/jpa/container/osgi/internal/url/WSJPAUrlUtils.java | WSJPAUrlUtils.extractEmbeddedURL | @Trivial
public static URL extractEmbeddedURL(URL url) throws MalformedURLException {
if (url == null) {
return null;
}
if (!url.getProtocol().equalsIgnoreCase(WSJPA_PROTOCOL_NAME)) {
throw new IllegalArgumentException("The specified URL \"" + url +
"\" does not use the \"" + WSJPA_PROTOCOL_NAME + "\" protocol.");
}
String encodedPath = url.getPath();
if (encodedPath == null || encodedPath.trim().equals("")) {
throw new IllegalArgumentException("The specified URL \"" + url + "\" is missing path information.");
}
final String decodedPath = decode(encodedPath);
try {
return AccessController.doPrivileged(new PrivilegedExceptionAction<URL>() {
@Override
@Trivial
public URL run() throws MalformedURLException {
return new URL(decodedPath);
}
});
} catch (PrivilegedActionException e) {
throw (MalformedURLException) e.getException();
}
} | java | @Trivial
public static URL extractEmbeddedURL(URL url) throws MalformedURLException {
if (url == null) {
return null;
}
if (!url.getProtocol().equalsIgnoreCase(WSJPA_PROTOCOL_NAME)) {
throw new IllegalArgumentException("The specified URL \"" + url +
"\" does not use the \"" + WSJPA_PROTOCOL_NAME + "\" protocol.");
}
String encodedPath = url.getPath();
if (encodedPath == null || encodedPath.trim().equals("")) {
throw new IllegalArgumentException("The specified URL \"" + url + "\" is missing path information.");
}
final String decodedPath = decode(encodedPath);
try {
return AccessController.doPrivileged(new PrivilegedExceptionAction<URL>() {
@Override
@Trivial
public URL run() throws MalformedURLException {
return new URL(decodedPath);
}
});
} catch (PrivilegedActionException e) {
throw (MalformedURLException) e.getException();
}
} | [
"@",
"Trivial",
"public",
"static",
"URL",
"extractEmbeddedURL",
"(",
"URL",
"url",
")",
"throws",
"MalformedURLException",
"{",
"if",
"(",
"url",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"!",
"url",
".",
"getProtocol",
"(",
")",
".",
"equalsIgnoreCase",
"(",
"WSJPA_PROTOCOL_NAME",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The specified URL \\\"\"",
"+",
"url",
"+",
"\"\\\" does not use the \\\"\"",
"+",
"WSJPA_PROTOCOL_NAME",
"+",
"\"\\\" protocol.\"",
")",
";",
"}",
"String",
"encodedPath",
"=",
"url",
".",
"getPath",
"(",
")",
";",
"if",
"(",
"encodedPath",
"==",
"null",
"||",
"encodedPath",
".",
"trim",
"(",
")",
".",
"equals",
"(",
"\"\"",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The specified URL \\\"\"",
"+",
"url",
"+",
"\"\\\" is missing path information.\"",
")",
";",
"}",
"final",
"String",
"decodedPath",
"=",
"decode",
"(",
"encodedPath",
")",
";",
"try",
"{",
"return",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedExceptionAction",
"<",
"URL",
">",
"(",
")",
"{",
"@",
"Override",
"@",
"Trivial",
"public",
"URL",
"run",
"(",
")",
"throws",
"MalformedURLException",
"{",
"return",
"new",
"URL",
"(",
"decodedPath",
")",
";",
"}",
"}",
")",
";",
"}",
"catch",
"(",
"PrivilegedActionException",
"e",
")",
"{",
"throw",
"(",
"MalformedURLException",
")",
"e",
".",
"getException",
"(",
")",
";",
"}",
"}"
] | Extracts the embedded URL from the provided wsjpa protocoled URL.
@param url - the wsjpa URL from which to extract the embedded URL.
@return - the URL embedded in the wsjpa URL argument. Returns null if provided a null URL argument.
@throws MalformedURLException if the embedded URL is malformed, IllegalArgumentException
if the provided url is not a wsjpa URL or if the wsjpa URL is missing an embedded URL. | [
"Extracts",
"the",
"embedded",
"URL",
"from",
"the",
"provided",
"wsjpa",
"protocoled",
"URL",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jpa.container/src/com/ibm/ws/jpa/container/osgi/internal/url/WSJPAUrlUtils.java#L67-L96 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jpa.container/src/com/ibm/ws/jpa/container/osgi/internal/url/WSJPAUrlUtils.java | WSJPAUrlUtils.encode | @Trivial
private static String encode(String s) {
if (s == null) {
return null;
}
// Throw an IllegalArgumentException if "%21" is already present in the String
if (s.contains("%21")) {
throw new IllegalArgumentException("WSJPAURLUtils.encode() cannot encode Strings containing \"%21\".");
}
return s.replace("!", "%21");
} | java | @Trivial
private static String encode(String s) {
if (s == null) {
return null;
}
// Throw an IllegalArgumentException if "%21" is already present in the String
if (s.contains("%21")) {
throw new IllegalArgumentException("WSJPAURLUtils.encode() cannot encode Strings containing \"%21\".");
}
return s.replace("!", "%21");
} | [
"@",
"Trivial",
"private",
"static",
"String",
"encode",
"(",
"String",
"s",
")",
"{",
"if",
"(",
"s",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"// Throw an IllegalArgumentException if \"%21\" is already present in the String",
"if",
"(",
"s",
".",
"contains",
"(",
"\"%21\"",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"WSJPAURLUtils.encode() cannot encode Strings containing \\\"%21\\\".\"",
")",
";",
"}",
"return",
"s",
".",
"replace",
"(",
"\"!\"",
",",
"\"%21\"",
")",
";",
"}"
] | Private method that substitutes "!" characters with its escaped code, "%21".
@param s
@return | [
"Private",
"method",
"that",
"substitutes",
"!",
"characters",
"with",
"its",
"escaped",
"code",
"%21",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jpa.container/src/com/ibm/ws/jpa/container/osgi/internal/url/WSJPAUrlUtils.java#L104-L115 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jpa.container/src/com/ibm/ws/jpa/container/osgi/internal/url/WSJPAUrlUtils.java | WSJPAUrlUtils.decode | @Trivial
private static String decode(String s) {
if (s == null) {
return null;
}
return s.replace("%21", "!");
} | java | @Trivial
private static String decode(String s) {
if (s == null) {
return null;
}
return s.replace("%21", "!");
} | [
"@",
"Trivial",
"private",
"static",
"String",
"decode",
"(",
"String",
"s",
")",
"{",
"if",
"(",
"s",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"s",
".",
"replace",
"(",
"\"%21\"",
",",
"\"!\"",
")",
";",
"}"
] | Private method that substitutes the escape code "%21" with the "!" character.
@param s
@return | [
"Private",
"method",
"that",
"substitutes",
"the",
"escape",
"code",
"%21",
"with",
"the",
"!",
"character",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jpa.container/src/com/ibm/ws/jpa/container/osgi/internal/url/WSJPAUrlUtils.java#L123-L129 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/JaxbPUnit20.java | JaxbPUnit20.getValidationMode | @Override
public ValidationMode getValidationMode()
{
// Convert this ValidationMode from the class defined
// in JAXB (com.ibm.ws.jpa.pxml20.PersistenceUnitValidationModeType)
// to JPA (javax.persistence.ValidationMode).
ValidationMode rtnMode = null;
PersistenceUnitValidationModeType jaxbMode = null;
jaxbMode = ivPUnit.getValidationMode();
if (jaxbMode == PersistenceUnitValidationModeType.AUTO)
{
rtnMode = ValidationMode.AUTO;
}
else if (jaxbMode == PersistenceUnitValidationModeType.CALLBACK)
{
rtnMode = ValidationMode.CALLBACK;
}
else if (jaxbMode == PersistenceUnitValidationModeType.NONE)
{
rtnMode = ValidationMode.NONE;
}
return rtnMode;
} | java | @Override
public ValidationMode getValidationMode()
{
// Convert this ValidationMode from the class defined
// in JAXB (com.ibm.ws.jpa.pxml20.PersistenceUnitValidationModeType)
// to JPA (javax.persistence.ValidationMode).
ValidationMode rtnMode = null;
PersistenceUnitValidationModeType jaxbMode = null;
jaxbMode = ivPUnit.getValidationMode();
if (jaxbMode == PersistenceUnitValidationModeType.AUTO)
{
rtnMode = ValidationMode.AUTO;
}
else if (jaxbMode == PersistenceUnitValidationModeType.CALLBACK)
{
rtnMode = ValidationMode.CALLBACK;
}
else if (jaxbMode == PersistenceUnitValidationModeType.NONE)
{
rtnMode = ValidationMode.NONE;
}
return rtnMode;
} | [
"@",
"Override",
"public",
"ValidationMode",
"getValidationMode",
"(",
")",
"{",
"// Convert this ValidationMode from the class defined",
"// in JAXB (com.ibm.ws.jpa.pxml20.PersistenceUnitValidationModeType)",
"// to JPA (javax.persistence.ValidationMode).",
"ValidationMode",
"rtnMode",
"=",
"null",
";",
"PersistenceUnitValidationModeType",
"jaxbMode",
"=",
"null",
";",
"jaxbMode",
"=",
"ivPUnit",
".",
"getValidationMode",
"(",
")",
";",
"if",
"(",
"jaxbMode",
"==",
"PersistenceUnitValidationModeType",
".",
"AUTO",
")",
"{",
"rtnMode",
"=",
"ValidationMode",
".",
"AUTO",
";",
"}",
"else",
"if",
"(",
"jaxbMode",
"==",
"PersistenceUnitValidationModeType",
".",
"CALLBACK",
")",
"{",
"rtnMode",
"=",
"ValidationMode",
".",
"CALLBACK",
";",
"}",
"else",
"if",
"(",
"jaxbMode",
"==",
"PersistenceUnitValidationModeType",
".",
"NONE",
")",
"{",
"rtnMode",
"=",
"ValidationMode",
".",
"NONE",
";",
"}",
"return",
"rtnMode",
";",
"}"
] | Gets the value of the validationMode property.
@return value of the validationMode property. | [
"Gets",
"the",
"value",
"of",
"the",
"validationMode",
"property",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/JaxbPUnit20.java#L253-L278 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/spi/ServiceProviderFinderFactory.java | ServiceProviderFinderFactory.setServiceProviderFinder | public static void setServiceProviderFinder(ExternalContext ectx, ServiceProviderFinder slp)
{
ectx.getApplicationMap().put(SERVICE_PROVIDER_KEY, slp);
} | java | public static void setServiceProviderFinder(ExternalContext ectx, ServiceProviderFinder slp)
{
ectx.getApplicationMap().put(SERVICE_PROVIDER_KEY, slp);
} | [
"public",
"static",
"void",
"setServiceProviderFinder",
"(",
"ExternalContext",
"ectx",
",",
"ServiceProviderFinder",
"slp",
")",
"{",
"ectx",
".",
"getApplicationMap",
"(",
")",
".",
"put",
"(",
"SERVICE_PROVIDER_KEY",
",",
"slp",
")",
";",
"}"
] | Set a ServiceProviderFinder to the current application, to locate
SPI service providers used by MyFaces.
This method should be called before the web application is initialized,
specifically before AbstractFacesInitializer.initFaces(ServletContext)
otherwise it will have no effect.
@param ectx
@param slp | [
"Set",
"a",
"ServiceProviderFinder",
"to",
"the",
"current",
"application",
"to",
"locate",
"SPI",
"service",
"providers",
"used",
"by",
"MyFaces",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/spi/ServiceProviderFinderFactory.java#L88-L91 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/spi/ServiceProviderFinderFactory.java | ServiceProviderFinderFactory._getServiceProviderFinderFromInitParam | private static ServiceProviderFinder _getServiceProviderFinderFromInitParam(ExternalContext context)
{
String initializerClassName = context.getInitParameter(SERVICE_PROVIDER_FINDER_PARAM);
if (initializerClassName != null)
{
try
{
// get Class object
Class<?> clazz = ClassUtils.classForName(initializerClassName);
if (!ServiceProviderFinder.class.isAssignableFrom(clazz))
{
throw new FacesException("Class " + clazz
+ " does not implement ServiceProviderFinder");
}
// create instance and return it
return (ServiceProviderFinder) ClassUtils.newInstance(clazz);
}
catch (ClassNotFoundException cnfe)
{
throw new FacesException("Could not find class of specified ServiceProviderFinder", cnfe);
}
}
return null;
} | java | private static ServiceProviderFinder _getServiceProviderFinderFromInitParam(ExternalContext context)
{
String initializerClassName = context.getInitParameter(SERVICE_PROVIDER_FINDER_PARAM);
if (initializerClassName != null)
{
try
{
// get Class object
Class<?> clazz = ClassUtils.classForName(initializerClassName);
if (!ServiceProviderFinder.class.isAssignableFrom(clazz))
{
throw new FacesException("Class " + clazz
+ " does not implement ServiceProviderFinder");
}
// create instance and return it
return (ServiceProviderFinder) ClassUtils.newInstance(clazz);
}
catch (ClassNotFoundException cnfe)
{
throw new FacesException("Could not find class of specified ServiceProviderFinder", cnfe);
}
}
return null;
} | [
"private",
"static",
"ServiceProviderFinder",
"_getServiceProviderFinderFromInitParam",
"(",
"ExternalContext",
"context",
")",
"{",
"String",
"initializerClassName",
"=",
"context",
".",
"getInitParameter",
"(",
"SERVICE_PROVIDER_FINDER_PARAM",
")",
";",
"if",
"(",
"initializerClassName",
"!=",
"null",
")",
"{",
"try",
"{",
"// get Class object",
"Class",
"<",
"?",
">",
"clazz",
"=",
"ClassUtils",
".",
"classForName",
"(",
"initializerClassName",
")",
";",
"if",
"(",
"!",
"ServiceProviderFinder",
".",
"class",
".",
"isAssignableFrom",
"(",
"clazz",
")",
")",
"{",
"throw",
"new",
"FacesException",
"(",
"\"Class \"",
"+",
"clazz",
"+",
"\" does not implement ServiceProviderFinder\"",
")",
";",
"}",
"// create instance and return it",
"return",
"(",
"ServiceProviderFinder",
")",
"ClassUtils",
".",
"newInstance",
"(",
"clazz",
")",
";",
"}",
"catch",
"(",
"ClassNotFoundException",
"cnfe",
")",
"{",
"throw",
"new",
"FacesException",
"(",
"\"Could not find class of specified ServiceProviderFinder\"",
",",
"cnfe",
")",
";",
"}",
"}",
"return",
"null",
";",
"}"
] | Gets a ServiceProviderFinder from the web.xml config param.
@param context
@return | [
"Gets",
"a",
"ServiceProviderFinder",
"from",
"the",
"web",
".",
"xml",
"config",
"param",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/spi/ServiceProviderFinderFactory.java#L103-L127 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/DatabaseHelper.java | DatabaseHelper.psSetBytes | public void psSetBytes(PreparedStatement pstmtImpl, int i, byte[] x) throws SQLException {
pstmtImpl.setBytes(i, x);
} | java | public void psSetBytes(PreparedStatement pstmtImpl, int i, byte[] x) throws SQLException {
pstmtImpl.setBytes(i, x);
} | [
"public",
"void",
"psSetBytes",
"(",
"PreparedStatement",
"pstmtImpl",
",",
"int",
"i",
",",
"byte",
"[",
"]",
"x",
")",
"throws",
"SQLException",
"{",
"pstmtImpl",
".",
"setBytes",
"(",
"i",
",",
"x",
")",
";",
"}"
] | Allow for special handling of Oracle prepared statement setBytes
This method just does the normal setBytes call, Oracle helper overrides it | [
"Allow",
"for",
"special",
"handling",
"of",
"Oracle",
"prepared",
"statement",
"setBytes",
"This",
"method",
"just",
"does",
"the",
"normal",
"setBytes",
"call",
"Oracle",
"helper",
"overrides",
"it"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/DatabaseHelper.java#L615-L617 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/DatabaseHelper.java | DatabaseHelper.psSetString | public void psSetString(PreparedStatement pstmtImpl, int i, String x) throws SQLException {
pstmtImpl.setString(i, x);
} | java | public void psSetString(PreparedStatement pstmtImpl, int i, String x) throws SQLException {
pstmtImpl.setString(i, x);
} | [
"public",
"void",
"psSetString",
"(",
"PreparedStatement",
"pstmtImpl",
",",
"int",
"i",
",",
"String",
"x",
")",
"throws",
"SQLException",
"{",
"pstmtImpl",
".",
"setString",
"(",
"i",
",",
"x",
")",
";",
"}"
] | Allow for special handling of Oracle prepared statement setString
This method just does the normal setString call, Oracle helper overrides it | [
"Allow",
"for",
"special",
"handling",
"of",
"Oracle",
"prepared",
"statement",
"setString",
"This",
"method",
"just",
"does",
"the",
"normal",
"setString",
"call",
"Oracle",
"helper",
"overrides",
"it"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/DatabaseHelper.java#L623-L625 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/DatabaseHelper.java | DatabaseHelper.resetClientInformation | public void resetClientInformation(WSRdbManagedConnectionImpl mc) throws SQLException {
if (mc.mcf.jdbcDriverSpecVersion >= 40 && (mc.clientInfoExplicitlySet || mc.clientInfoImplicitlySet)) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.entry(this, tc, "resetClientInformation", mc);
try {
mc.sqlConn.setClientInfo(mc.mcf.defaultClientInfo);
mc.clientInfoExplicitlySet = false;
mc.clientInfoImplicitlySet = false;
} catch (SQLException ex) {
FFDCFilter.processException(
ex, getClass().getName() + "resetClientInformation", "780", this);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.exit(this, tc, "resetClientInformation", ex);
throw AdapterUtil.mapSQLException(ex, mc);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.exit(this, tc, "resetClientInformation");
}
} | java | public void resetClientInformation(WSRdbManagedConnectionImpl mc) throws SQLException {
if (mc.mcf.jdbcDriverSpecVersion >= 40 && (mc.clientInfoExplicitlySet || mc.clientInfoImplicitlySet)) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.entry(this, tc, "resetClientInformation", mc);
try {
mc.sqlConn.setClientInfo(mc.mcf.defaultClientInfo);
mc.clientInfoExplicitlySet = false;
mc.clientInfoImplicitlySet = false;
} catch (SQLException ex) {
FFDCFilter.processException(
ex, getClass().getName() + "resetClientInformation", "780", this);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.exit(this, tc, "resetClientInformation", ex);
throw AdapterUtil.mapSQLException(ex, mc);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.exit(this, tc, "resetClientInformation");
}
} | [
"public",
"void",
"resetClientInformation",
"(",
"WSRdbManagedConnectionImpl",
"mc",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"mc",
".",
"mcf",
".",
"jdbcDriverSpecVersion",
">=",
"40",
"&&",
"(",
"mc",
".",
"clientInfoExplicitlySet",
"||",
"mc",
".",
"clientInfoImplicitlySet",
")",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"resetClientInformation\"",
",",
"mc",
")",
";",
"try",
"{",
"mc",
".",
"sqlConn",
".",
"setClientInfo",
"(",
"mc",
".",
"mcf",
".",
"defaultClientInfo",
")",
";",
"mc",
".",
"clientInfoExplicitlySet",
"=",
"false",
";",
"mc",
".",
"clientInfoImplicitlySet",
"=",
"false",
";",
"}",
"catch",
"(",
"SQLException",
"ex",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"ex",
",",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
"+",
"\"resetClientInformation\"",
",",
"\"780\"",
",",
"this",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"resetClientInformation\"",
",",
"ex",
")",
";",
"throw",
"AdapterUtil",
".",
"mapSQLException",
"(",
"ex",
",",
"mc",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"resetClientInformation\"",
")",
";",
"}",
"}"
] | This method is used to reset the client information on the backend database
connection. Information will be reset only if it has been set.
@param mc WSRdbManagedConnectionImpl to reset the client information on
@exception SQLException
java.sql.SQLException if a problem happens during resetting the client information on the database connection | [
"This",
"method",
"is",
"used",
"to",
"reset",
"the",
"client",
"information",
"on",
"the",
"backend",
"database",
"connection",
".",
"Information",
"will",
"be",
"reset",
"only",
"if",
"it",
"has",
"been",
"set",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/DatabaseHelper.java#L706-L728 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/DatabaseHelper.java | DatabaseHelper.getPooledConnection | public ConnectionResults getPooledConnection(final CommonDataSource ds, String userName, String password, final boolean is2Phase,
final WSConnectionRequestInfoImpl cri, boolean useKerberos, Object gssCredential) throws ResourceException {
if (tc.isEntryEnabled())
Tr.entry(this, tc, "getPooledConnection",
AdapterUtil.toString(ds), userName, "******", is2Phase ? "two-phase" : "one-phase", cri, useKerberos, gssCredential);
// if kerberose is set then issue a warning that no special APIs are used instead,
// a getConnection() without username/password will be used.
// to get a connection.
if (useKerberos) {
Tr.warning(tc, "KERBEROS_NOT_SUPPORTED_WARNING");
}
try {
final String user = userName == null ? null : userName.trim();
final String pwd = password == null ? null : password.trim();
PooledConnection pConn = AccessController.doPrivileged(new PrivilegedExceptionAction<PooledConnection>() {
public PooledConnection run() throws SQLException {
boolean buildConnection = cri.ivShardingKey != null || cri.ivSuperShardingKey != null;
if (is2Phase)
if (buildConnection)
return mcf.jdbcRuntime.buildXAConnection((XADataSource) ds, user, pwd, cri);
else if (user == null)
return ((XADataSource) ds).getXAConnection();
else
return ((XADataSource) ds).getXAConnection(user, pwd);
else
if (buildConnection)
return mcf.jdbcRuntime.buildPooledConnection((ConnectionPoolDataSource) ds, user, pwd, cri);
else if (user == null)
return ((ConnectionPoolDataSource) ds).getPooledConnection();
else
return ((ConnectionPoolDataSource) ds).getPooledConnection(user, pwd);
}
});
if (tc.isEntryEnabled())
Tr.exit(this, tc, "getPooledConnection", AdapterUtil.toString(pConn));
return new ConnectionResults(pConn, null);
} catch (PrivilegedActionException pae) {
FFDCFilter.processException(pae.getException(), getClass().getName(), "1298");
ResourceException resX = new DataStoreAdapterException("JAVAX_CONN_ERR", pae.getException(), DatabaseHelper.class, is2Phase ? "XAConnection" : "PooledConnection");
if (tc.isEntryEnabled())
Tr.exit(this, tc, "getPooledConnection", "Exception");
throw resX;
} catch (ClassCastException castX) {
// There's a possibility this occurred because of an error in the JDBC driver
// itself. The trace should allow us to determine this.
FFDCFilter.processException(castX, getClass().getName(), "1312");
if (tc.isDebugEnabled())
Tr.debug(this, tc, "Caught ClassCastException", castX);
ResourceException resX = new DataStoreAdapterException(castX.getMessage(), null, DatabaseHelper.class, is2Phase ? "NOT_A_2_PHASE_DS" : "NOT_A_1_PHASE_DS");
if (tc.isEntryEnabled())
Tr.exit(this, tc, "getPooledConnection", "Exception");
throw resX;
}
} | java | public ConnectionResults getPooledConnection(final CommonDataSource ds, String userName, String password, final boolean is2Phase,
final WSConnectionRequestInfoImpl cri, boolean useKerberos, Object gssCredential) throws ResourceException {
if (tc.isEntryEnabled())
Tr.entry(this, tc, "getPooledConnection",
AdapterUtil.toString(ds), userName, "******", is2Phase ? "two-phase" : "one-phase", cri, useKerberos, gssCredential);
// if kerberose is set then issue a warning that no special APIs are used instead,
// a getConnection() without username/password will be used.
// to get a connection.
if (useKerberos) {
Tr.warning(tc, "KERBEROS_NOT_SUPPORTED_WARNING");
}
try {
final String user = userName == null ? null : userName.trim();
final String pwd = password == null ? null : password.trim();
PooledConnection pConn = AccessController.doPrivileged(new PrivilegedExceptionAction<PooledConnection>() {
public PooledConnection run() throws SQLException {
boolean buildConnection = cri.ivShardingKey != null || cri.ivSuperShardingKey != null;
if (is2Phase)
if (buildConnection)
return mcf.jdbcRuntime.buildXAConnection((XADataSource) ds, user, pwd, cri);
else if (user == null)
return ((XADataSource) ds).getXAConnection();
else
return ((XADataSource) ds).getXAConnection(user, pwd);
else
if (buildConnection)
return mcf.jdbcRuntime.buildPooledConnection((ConnectionPoolDataSource) ds, user, pwd, cri);
else if (user == null)
return ((ConnectionPoolDataSource) ds).getPooledConnection();
else
return ((ConnectionPoolDataSource) ds).getPooledConnection(user, pwd);
}
});
if (tc.isEntryEnabled())
Tr.exit(this, tc, "getPooledConnection", AdapterUtil.toString(pConn));
return new ConnectionResults(pConn, null);
} catch (PrivilegedActionException pae) {
FFDCFilter.processException(pae.getException(), getClass().getName(), "1298");
ResourceException resX = new DataStoreAdapterException("JAVAX_CONN_ERR", pae.getException(), DatabaseHelper.class, is2Phase ? "XAConnection" : "PooledConnection");
if (tc.isEntryEnabled())
Tr.exit(this, tc, "getPooledConnection", "Exception");
throw resX;
} catch (ClassCastException castX) {
// There's a possibility this occurred because of an error in the JDBC driver
// itself. The trace should allow us to determine this.
FFDCFilter.processException(castX, getClass().getName(), "1312");
if (tc.isDebugEnabled())
Tr.debug(this, tc, "Caught ClassCastException", castX);
ResourceException resX = new DataStoreAdapterException(castX.getMessage(), null, DatabaseHelper.class, is2Phase ? "NOT_A_2_PHASE_DS" : "NOT_A_1_PHASE_DS");
if (tc.isEntryEnabled())
Tr.exit(this, tc, "getPooledConnection", "Exception");
throw resX;
}
} | [
"public",
"ConnectionResults",
"getPooledConnection",
"(",
"final",
"CommonDataSource",
"ds",
",",
"String",
"userName",
",",
"String",
"password",
",",
"final",
"boolean",
"is2Phase",
",",
"final",
"WSConnectionRequestInfoImpl",
"cri",
",",
"boolean",
"useKerberos",
",",
"Object",
"gssCredential",
")",
"throws",
"ResourceException",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"getPooledConnection\"",
",",
"AdapterUtil",
".",
"toString",
"(",
"ds",
")",
",",
"userName",
",",
"\"******\"",
",",
"is2Phase",
"?",
"\"two-phase\"",
":",
"\"one-phase\"",
",",
"cri",
",",
"useKerberos",
",",
"gssCredential",
")",
";",
"// if kerberose is set then issue a warning that no special APIs are used instead, ",
"// a getConnection() without username/password will be used.",
"// to get a connection.",
"if",
"(",
"useKerberos",
")",
"{",
"Tr",
".",
"warning",
"(",
"tc",
",",
"\"KERBEROS_NOT_SUPPORTED_WARNING\"",
")",
";",
"}",
"try",
"{",
"final",
"String",
"user",
"=",
"userName",
"==",
"null",
"?",
"null",
":",
"userName",
".",
"trim",
"(",
")",
";",
"final",
"String",
"pwd",
"=",
"password",
"==",
"null",
"?",
"null",
":",
"password",
".",
"trim",
"(",
")",
";",
"PooledConnection",
"pConn",
"=",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedExceptionAction",
"<",
"PooledConnection",
">",
"(",
")",
"{",
"public",
"PooledConnection",
"run",
"(",
")",
"throws",
"SQLException",
"{",
"boolean",
"buildConnection",
"=",
"cri",
".",
"ivShardingKey",
"!=",
"null",
"||",
"cri",
".",
"ivSuperShardingKey",
"!=",
"null",
";",
"if",
"(",
"is2Phase",
")",
"if",
"(",
"buildConnection",
")",
"return",
"mcf",
".",
"jdbcRuntime",
".",
"buildXAConnection",
"(",
"(",
"XADataSource",
")",
"ds",
",",
"user",
",",
"pwd",
",",
"cri",
")",
";",
"else",
"if",
"(",
"user",
"==",
"null",
")",
"return",
"(",
"(",
"XADataSource",
")",
"ds",
")",
".",
"getXAConnection",
"(",
")",
";",
"else",
"return",
"(",
"(",
"XADataSource",
")",
"ds",
")",
".",
"getXAConnection",
"(",
"user",
",",
"pwd",
")",
";",
"else",
"if",
"(",
"buildConnection",
")",
"return",
"mcf",
".",
"jdbcRuntime",
".",
"buildPooledConnection",
"(",
"(",
"ConnectionPoolDataSource",
")",
"ds",
",",
"user",
",",
"pwd",
",",
"cri",
")",
";",
"else",
"if",
"(",
"user",
"==",
"null",
")",
"return",
"(",
"(",
"ConnectionPoolDataSource",
")",
"ds",
")",
".",
"getPooledConnection",
"(",
")",
";",
"else",
"return",
"(",
"(",
"ConnectionPoolDataSource",
")",
"ds",
")",
".",
"getPooledConnection",
"(",
"user",
",",
"pwd",
")",
";",
"}",
"}",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"getPooledConnection\"",
",",
"AdapterUtil",
".",
"toString",
"(",
"pConn",
")",
")",
";",
"return",
"new",
"ConnectionResults",
"(",
"pConn",
",",
"null",
")",
";",
"}",
"catch",
"(",
"PrivilegedActionException",
"pae",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"pae",
".",
"getException",
"(",
")",
",",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
",",
"\"1298\"",
")",
";",
"ResourceException",
"resX",
"=",
"new",
"DataStoreAdapterException",
"(",
"\"JAVAX_CONN_ERR\"",
",",
"pae",
".",
"getException",
"(",
")",
",",
"DatabaseHelper",
".",
"class",
",",
"is2Phase",
"?",
"\"XAConnection\"",
":",
"\"PooledConnection\"",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"getPooledConnection\"",
",",
"\"Exception\"",
")",
";",
"throw",
"resX",
";",
"}",
"catch",
"(",
"ClassCastException",
"castX",
")",
"{",
"// There's a possibility this occurred because of an error in the JDBC driver",
"// itself. The trace should allow us to determine this.",
"FFDCFilter",
".",
"processException",
"(",
"castX",
",",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
",",
"\"1312\"",
")",
";",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"Caught ClassCastException\"",
",",
"castX",
")",
";",
"ResourceException",
"resX",
"=",
"new",
"DataStoreAdapterException",
"(",
"castX",
".",
"getMessage",
"(",
")",
",",
"null",
",",
"DatabaseHelper",
".",
"class",
",",
"is2Phase",
"?",
"\"NOT_A_2_PHASE_DS\"",
":",
"\"NOT_A_1_PHASE_DS\"",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"getPooledConnection\"",
",",
"\"Exception\"",
")",
";",
"throw",
"resX",
";",
"}",
"}"
] | Get a Pooled or XA Connection from the specified DataSource.
A null userName indicates that no user name or password should be provided.
@param dataSource XADataSource or ConnectionPoolDataSource
@param String userName to get the pooled connection
@param String password to get the pooled connection
@param is2Phase indicates what type of Connection to retrieve (one-phase or two-phase).
@param WSConnectionRequestInfoImpl connection request information, possibly including sharding keys
@param useKerberos a boolean that specifies if kerberos should be used when getting a connection to the database.
@param gssCredential the kerberose Credential to be used if useKerberos is true.
@return Object[] that contains Pooled or XA Connection for its first element and cookie for its second
@throws ResourceException if an error occurs obtaining the is2PhaseEnabled value does
not match the DataSource type. | [
"Get",
"a",
"Pooled",
"or",
"XA",
"Connection",
"from",
"the",
"specified",
"DataSource",
".",
"A",
"null",
"userName",
"indicates",
"that",
"no",
"user",
"name",
"or",
"password",
"should",
"be",
"provided",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/DatabaseHelper.java#L924-L987 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/DatabaseHelper.java | DatabaseHelper.setClientRerouteData | public void setClientRerouteData(Object dataSource, String cRJNDIName, String cRAlternateServer, String cRAlternatePort,
String cRPrimeServer, String cRPrimePort, Context jndiContext, String driverType) throws Throwable // add driverType
{
if (tc.isDebugEnabled()) {
Tr.debug(this, tc, "Client reroute is not supported on non-DB2 JCC driver.");
}
} | java | public void setClientRerouteData(Object dataSource, String cRJNDIName, String cRAlternateServer, String cRAlternatePort,
String cRPrimeServer, String cRPrimePort, Context jndiContext, String driverType) throws Throwable // add driverType
{
if (tc.isDebugEnabled()) {
Tr.debug(this, tc, "Client reroute is not supported on non-DB2 JCC driver.");
}
} | [
"public",
"void",
"setClientRerouteData",
"(",
"Object",
"dataSource",
",",
"String",
"cRJNDIName",
",",
"String",
"cRAlternateServer",
",",
"String",
"cRAlternatePort",
",",
"String",
"cRPrimeServer",
",",
"String",
"cRPrimePort",
",",
"Context",
"jndiContext",
",",
"String",
"driverType",
")",
"throws",
"Throwable",
"// add driverType",
"{",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"Client reroute is not supported on non-DB2 JCC driver.\"",
")",
";",
"}",
"}"
] | This method is used to set the client reroute options on the datasoruce Object.
This method will be a no-op for all but the DB2 universal driver.
@param dataSource : Datasource Object
@param cRJNDIName : Client Reroute JNDI name to be set on the DataSource Object.
@param cRAlternateServer : Client Reroute Alternate Server list
@param cRAlternatePort : Client Reroute Alternate Port list
@param cRPrimeServer : Client Reroute Primary Server
@param cRPrimePort : Client Reroute Primary Port
@param jndiContext : JNDI Context to be used to do the lookup
@param driverType : type2 (2) or type4 (4)
@throws Throwable : exception is bind failed or setting of the CRJNDIName fails
precondition : all parameters wiht the exception of CRIJNDIName can not be null. | [
"This",
"method",
"is",
"used",
"to",
"set",
"the",
"client",
"reroute",
"options",
"on",
"the",
"datasoruce",
"Object",
".",
"This",
"method",
"will",
"be",
"a",
"no",
"-",
"op",
"for",
"all",
"but",
"the",
"DB2",
"universal",
"driver",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/DatabaseHelper.java#L1004-L1010 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/DatabaseHelper.java | DatabaseHelper.isAnAuthorizationException | public boolean isAnAuthorizationException(SQLException x) {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(this, tc, "isAnAuthorizationException", x);
boolean isAuthError = false;
LinkedList<SQLException> stack = new LinkedList<SQLException>();
if (x != null)
stack.push(x);
// Limit the chain depth so that poorly written exceptions don't cause an infinite loop.
for (int depth = 0; depth < 20 && !isAuthError && !stack.isEmpty(); depth++) {
x = stack.pop();
isAuthError |= isAuthException(x);
// Add the chained exceptions to the stack.
if (x.getNextException() != null)
stack.push(x.getNextException());
if (x.getCause() instanceof SQLException && x.getCause() != x.getNextException())
stack.push((SQLException) x.getCause());
}
if (isTraceOn && tc.isEntryEnabled())
Tr.exit(this, tc, "isAnAuthorizationException", isAuthError);
return isAuthError;
} | java | public boolean isAnAuthorizationException(SQLException x) {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(this, tc, "isAnAuthorizationException", x);
boolean isAuthError = false;
LinkedList<SQLException> stack = new LinkedList<SQLException>();
if (x != null)
stack.push(x);
// Limit the chain depth so that poorly written exceptions don't cause an infinite loop.
for (int depth = 0; depth < 20 && !isAuthError && !stack.isEmpty(); depth++) {
x = stack.pop();
isAuthError |= isAuthException(x);
// Add the chained exceptions to the stack.
if (x.getNextException() != null)
stack.push(x.getNextException());
if (x.getCause() instanceof SQLException && x.getCause() != x.getNextException())
stack.push((SQLException) x.getCause());
}
if (isTraceOn && tc.isEntryEnabled())
Tr.exit(this, tc, "isAnAuthorizationException", isAuthError);
return isAuthError;
} | [
"public",
"boolean",
"isAnAuthorizationException",
"(",
"SQLException",
"x",
")",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"isAnAuthorizationException\"",
",",
"x",
")",
";",
"boolean",
"isAuthError",
"=",
"false",
";",
"LinkedList",
"<",
"SQLException",
">",
"stack",
"=",
"new",
"LinkedList",
"<",
"SQLException",
">",
"(",
")",
";",
"if",
"(",
"x",
"!=",
"null",
")",
"stack",
".",
"push",
"(",
"x",
")",
";",
"// Limit the chain depth so that poorly written exceptions don't cause an infinite loop.",
"for",
"(",
"int",
"depth",
"=",
"0",
";",
"depth",
"<",
"20",
"&&",
"!",
"isAuthError",
"&&",
"!",
"stack",
".",
"isEmpty",
"(",
")",
";",
"depth",
"++",
")",
"{",
"x",
"=",
"stack",
".",
"pop",
"(",
")",
";",
"isAuthError",
"|=",
"isAuthException",
"(",
"x",
")",
";",
"// Add the chained exceptions to the stack.",
"if",
"(",
"x",
".",
"getNextException",
"(",
")",
"!=",
"null",
")",
"stack",
".",
"push",
"(",
"x",
".",
"getNextException",
"(",
")",
")",
";",
"if",
"(",
"x",
".",
"getCause",
"(",
")",
"instanceof",
"SQLException",
"&&",
"x",
".",
"getCause",
"(",
")",
"!=",
"x",
".",
"getNextException",
"(",
")",
")",
"stack",
".",
"push",
"(",
"(",
"SQLException",
")",
"x",
".",
"getCause",
"(",
")",
")",
";",
"}",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"isAnAuthorizationException\"",
",",
"isAuthError",
")",
";",
"return",
"isAuthError",
";",
"}"
] | Method is used to see if the exception passed is an authorization exception or not.
@param SQLException the exception to check.
@return boolean true if determined to be an authorization exception, otherwise false. | [
"Method",
"is",
"used",
"to",
"see",
"if",
"the",
"exception",
"passed",
"is",
"an",
"authorization",
"exception",
"or",
"not",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/DatabaseHelper.java#L1018-L1045 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/DatabaseHelper.java | DatabaseHelper.reuseKerbrosConnection | public void reuseKerbrosConnection(Connection sqlConn, GSSCredential gssCred, Properties props) throws SQLException {
// an exception would have been thrown earlier than this point, so adding the trace just in case.
if (tc.isDebugEnabled()) {
Tr.debug(this, tc, "Kerberos reuse is not supported when using generic helper. No-op operation.");
}
} | java | public void reuseKerbrosConnection(Connection sqlConn, GSSCredential gssCred, Properties props) throws SQLException {
// an exception would have been thrown earlier than this point, so adding the trace just in case.
if (tc.isDebugEnabled()) {
Tr.debug(this, tc, "Kerberos reuse is not supported when using generic helper. No-op operation.");
}
} | [
"public",
"void",
"reuseKerbrosConnection",
"(",
"Connection",
"sqlConn",
",",
"GSSCredential",
"gssCred",
",",
"Properties",
"props",
")",
"throws",
"SQLException",
"{",
"// an exception would have been thrown earlier than this point, so adding the trace just in case.",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"Kerberos reuse is not supported when using generic helper. No-op operation.\"",
")",
";",
"}",
"}"
] | Method used to reuse a connection using kerberos.
This method will reset all connection properties, thus, after a reuse
is called, connection should be treated as if it was a newly created connection
@param java.sql.Connection conn
@param GSSCredential gssCred
@param Properties props
@throws SQLException | [
"Method",
"used",
"to",
"reuse",
"a",
"connection",
"using",
"kerberos",
".",
"This",
"method",
"will",
"reset",
"all",
"connection",
"properties",
"thus",
"after",
"a",
"reuse",
"is",
"called",
"connection",
"should",
"be",
"treated",
"as",
"if",
"it",
"was",
"a",
"newly",
"created",
"connection"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/DatabaseHelper.java#L1073-L1078 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/DatabaseHelper.java | DatabaseHelper.branchCouplingSupported | public int branchCouplingSupported(int couplingType)
{
// Return -1 as we have no support for resref branch coupling
if (couplingType == ResourceRefInfo.BRANCH_COUPLING_LOOSE || couplingType == ResourceRefInfo.BRANCH_COUPLING_TIGHT)
{
if (tc.isDebugEnabled()) {
Tr.debug(this, tc, "Specified branch coupling type not supported");
}
return -1;
}
// If resref branch coupling unset then return default xa_start flags
return javax.transaction.xa.XAResource.TMNOFLAGS;
} | java | public int branchCouplingSupported(int couplingType)
{
// Return -1 as we have no support for resref branch coupling
if (couplingType == ResourceRefInfo.BRANCH_COUPLING_LOOSE || couplingType == ResourceRefInfo.BRANCH_COUPLING_TIGHT)
{
if (tc.isDebugEnabled()) {
Tr.debug(this, tc, "Specified branch coupling type not supported");
}
return -1;
}
// If resref branch coupling unset then return default xa_start flags
return javax.transaction.xa.XAResource.TMNOFLAGS;
} | [
"public",
"int",
"branchCouplingSupported",
"(",
"int",
"couplingType",
")",
"{",
"// Return -1 as we have no support for resref branch coupling",
"if",
"(",
"couplingType",
"==",
"ResourceRefInfo",
".",
"BRANCH_COUPLING_LOOSE",
"||",
"couplingType",
"==",
"ResourceRefInfo",
".",
"BRANCH_COUPLING_TIGHT",
")",
"{",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"Specified branch coupling type not supported\"",
")",
";",
"}",
"return",
"-",
"1",
";",
"}",
"// If resref branch coupling unset then return default xa_start flags",
"return",
"javax",
".",
"transaction",
".",
"xa",
".",
"XAResource",
".",
"TMNOFLAGS",
";",
"}"
] | This method checks if the connection supports loose or tight branch coupling
@param couplingType
@return xa_start flag value | [
"This",
"method",
"checks",
"if",
"the",
"connection",
"supports",
"loose",
"or",
"tight",
"branch",
"coupling"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/DatabaseHelper.java#L1086-L1099 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.authorization.jacc/src/com/ibm/ws/security/authorization/jacc/internal/JaccServiceImpl.java | JaccServiceImpl.loadClasses | public boolean loadClasses() {
Boolean result = AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
@Override
public Boolean run() {
Policy policy = jaccProviderService.getService().getPolicy();
if (tc.isDebugEnabled())
Tr.debug(tc, "policy object" + policy);
// in order to support the CTS provider, Policy object should be set prior to
// instanciate PolicyConfigFactory class.
if (policy == null) {
Exception e = new Exception("Policy object is null.");
Tr.error(tc, "JACC_POLICY_INSTANTIATION_FAILURE", new Object[] { policyName, e });
return Boolean.FALSE;
}
try {
Policy.setPolicy(policy);
policy.refresh();
} catch (ClassCastException cce) {
Tr.error(tc, "JACC_POLICY_INSTANTIATION_FAILURE", new Object[] { policyName, cce });
return Boolean.FALSE;
}
pcf = jaccProviderService.getService().getPolicyConfigFactory();
if (pcf != null) {
if (tc.isDebugEnabled())
Tr.debug(tc, "factory object : " + pcf);
PolicyConfigurationManager.initialize(policy, pcf);
} else {
Tr.error(tc, "JACC_FACTORY_INSTANTIATION_FAILURE", new Object[] { factoryName });
return Boolean.FALSE;
}
return Boolean.TRUE;
}
});
return result.booleanValue();
} | java | public boolean loadClasses() {
Boolean result = AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
@Override
public Boolean run() {
Policy policy = jaccProviderService.getService().getPolicy();
if (tc.isDebugEnabled())
Tr.debug(tc, "policy object" + policy);
// in order to support the CTS provider, Policy object should be set prior to
// instanciate PolicyConfigFactory class.
if (policy == null) {
Exception e = new Exception("Policy object is null.");
Tr.error(tc, "JACC_POLICY_INSTANTIATION_FAILURE", new Object[] { policyName, e });
return Boolean.FALSE;
}
try {
Policy.setPolicy(policy);
policy.refresh();
} catch (ClassCastException cce) {
Tr.error(tc, "JACC_POLICY_INSTANTIATION_FAILURE", new Object[] { policyName, cce });
return Boolean.FALSE;
}
pcf = jaccProviderService.getService().getPolicyConfigFactory();
if (pcf != null) {
if (tc.isDebugEnabled())
Tr.debug(tc, "factory object : " + pcf);
PolicyConfigurationManager.initialize(policy, pcf);
} else {
Tr.error(tc, "JACC_FACTORY_INSTANTIATION_FAILURE", new Object[] { factoryName });
return Boolean.FALSE;
}
return Boolean.TRUE;
}
});
return result.booleanValue();
} | [
"public",
"boolean",
"loadClasses",
"(",
")",
"{",
"Boolean",
"result",
"=",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedAction",
"<",
"Boolean",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Boolean",
"run",
"(",
")",
"{",
"Policy",
"policy",
"=",
"jaccProviderService",
".",
"getService",
"(",
")",
".",
"getPolicy",
"(",
")",
";",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"policy object\"",
"+",
"policy",
")",
";",
"// in order to support the CTS provider, Policy object should be set prior to",
"// instanciate PolicyConfigFactory class.",
"if",
"(",
"policy",
"==",
"null",
")",
"{",
"Exception",
"e",
"=",
"new",
"Exception",
"(",
"\"Policy object is null.\"",
")",
";",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"JACC_POLICY_INSTANTIATION_FAILURE\"",
",",
"new",
"Object",
"[",
"]",
"{",
"policyName",
",",
"e",
"}",
")",
";",
"return",
"Boolean",
".",
"FALSE",
";",
"}",
"try",
"{",
"Policy",
".",
"setPolicy",
"(",
"policy",
")",
";",
"policy",
".",
"refresh",
"(",
")",
";",
"}",
"catch",
"(",
"ClassCastException",
"cce",
")",
"{",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"JACC_POLICY_INSTANTIATION_FAILURE\"",
",",
"new",
"Object",
"[",
"]",
"{",
"policyName",
",",
"cce",
"}",
")",
";",
"return",
"Boolean",
".",
"FALSE",
";",
"}",
"pcf",
"=",
"jaccProviderService",
".",
"getService",
"(",
")",
".",
"getPolicyConfigFactory",
"(",
")",
";",
"if",
"(",
"pcf",
"!=",
"null",
")",
"{",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"factory object : \"",
"+",
"pcf",
")",
";",
"PolicyConfigurationManager",
".",
"initialize",
"(",
"policy",
",",
"pcf",
")",
";",
"}",
"else",
"{",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"JACC_FACTORY_INSTANTIATION_FAILURE\"",
",",
"new",
"Object",
"[",
"]",
"{",
"factoryName",
"}",
")",
";",
"return",
"Boolean",
".",
"FALSE",
";",
"}",
"return",
"Boolean",
".",
"TRUE",
";",
"}",
"}",
")",
";",
"return",
"result",
".",
"booleanValue",
"(",
")",
";",
"}"
] | Loads the JACC Policy and Factory classes.
@return true if the initialization was successful | [
"Loads",
"the",
"JACC",
"Policy",
"and",
"Factory",
"classes",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.authorization.jacc/src/com/ibm/ws/security/authorization/jacc/internal/JaccServiceImpl.java#L234-L270 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/processor/ResourceInjectionBinding.java | ResourceInjectionBinding.getResourceLookup | private static String getResourceLookup(Resource resource) // F743-16274.1
{
if (svResourceLookupMethod == null)
{
return "";
}
try
{
return (String) svResourceLookupMethod.invoke(resource, (Object[]) null);
} catch (Exception ex)
{
throw new IllegalStateException(ex);
}
} | java | private static String getResourceLookup(Resource resource) // F743-16274.1
{
if (svResourceLookupMethod == null)
{
return "";
}
try
{
return (String) svResourceLookupMethod.invoke(resource, (Object[]) null);
} catch (Exception ex)
{
throw new IllegalStateException(ex);
}
} | [
"private",
"static",
"String",
"getResourceLookup",
"(",
"Resource",
"resource",
")",
"// F743-16274.1",
"{",
"if",
"(",
"svResourceLookupMethod",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"try",
"{",
"return",
"(",
"String",
")",
"svResourceLookupMethod",
".",
"invoke",
"(",
"resource",
",",
"(",
"Object",
"[",
"]",
")",
"null",
")",
";",
"}",
"catch",
"(",
"Exception",
"ex",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"ex",
")",
";",
"}",
"}"
] | Returns the result of javax.annotation.Resource.lookup, or the empty
string if that method is unavailable in the current JVM.
@param resource the resource annotation
@return the lookup string or the empty string | [
"Returns",
"the",
"result",
"of",
"javax",
".",
"annotation",
".",
"Resource",
".",
"lookup",
"or",
"the",
"empty",
"string",
"if",
"that",
"method",
"is",
"unavailable",
"in",
"the",
"current",
"JVM",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/processor/ResourceInjectionBinding.java#L82-L96 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/processor/ResourceInjectionBinding.java | ResourceInjectionBinding.setXMLType | private void setXMLType(String typeName, String element, String nameElement, String typeElement) // F743-32443
throws InjectionConfigurationException
{
if (ivNameSpaceConfig.getClassLoader() == null)
{
setInjectionClassTypeName(typeName);
}
else
{
Class<?> type = loadClass(typeName);
//The type parameter is "optional"
if (type != null)
{
ResourceImpl curAnnotation = (ResourceImpl) getAnnotation();
if (curAnnotation.ivIsSetType)
{
Class<?> curType = getInjectionClassType();
// check that value from xml is a subclasss, if not throw an error
Class<?> mostSpecificClass = mostSpecificClass(type, curType);
if (mostSpecificClass == null)
{
Tr.error(tc, "CONFLICTING_XML_VALUES_CWNEN0052E",
ivComponent,
ivModule,
ivApplication,
typeElement,
element,
nameElement,
getJndiName(),
curType,
type); // d479669
String exMsg = "The " + ivComponent +
" bean in the " + ivModule +
" module of the " + ivApplication +
" application has conflicting configuration data in the XML" +
" deployment descriptor. Conflicting " + typeElement +
" element values exist for multiple " + element +
" elements with the same " + nameElement + " element value : " +
getJndiName() + ". The conflicting " + typeElement +
" element values are " + curType + " and " +
type + "."; // d479669
throw new InjectionConfigurationException(exMsg);
}
curAnnotation.ivType = mostSpecificClass;
}
else
{
curAnnotation.ivType = type;
curAnnotation.ivIsSetType = true;
}
}
}
} | java | private void setXMLType(String typeName, String element, String nameElement, String typeElement) // F743-32443
throws InjectionConfigurationException
{
if (ivNameSpaceConfig.getClassLoader() == null)
{
setInjectionClassTypeName(typeName);
}
else
{
Class<?> type = loadClass(typeName);
//The type parameter is "optional"
if (type != null)
{
ResourceImpl curAnnotation = (ResourceImpl) getAnnotation();
if (curAnnotation.ivIsSetType)
{
Class<?> curType = getInjectionClassType();
// check that value from xml is a subclasss, if not throw an error
Class<?> mostSpecificClass = mostSpecificClass(type, curType);
if (mostSpecificClass == null)
{
Tr.error(tc, "CONFLICTING_XML_VALUES_CWNEN0052E",
ivComponent,
ivModule,
ivApplication,
typeElement,
element,
nameElement,
getJndiName(),
curType,
type); // d479669
String exMsg = "The " + ivComponent +
" bean in the " + ivModule +
" module of the " + ivApplication +
" application has conflicting configuration data in the XML" +
" deployment descriptor. Conflicting " + typeElement +
" element values exist for multiple " + element +
" elements with the same " + nameElement + " element value : " +
getJndiName() + ". The conflicting " + typeElement +
" element values are " + curType + " and " +
type + "."; // d479669
throw new InjectionConfigurationException(exMsg);
}
curAnnotation.ivType = mostSpecificClass;
}
else
{
curAnnotation.ivType = type;
curAnnotation.ivIsSetType = true;
}
}
}
} | [
"private",
"void",
"setXMLType",
"(",
"String",
"typeName",
",",
"String",
"element",
",",
"String",
"nameElement",
",",
"String",
"typeElement",
")",
"// F743-32443",
"throws",
"InjectionConfigurationException",
"{",
"if",
"(",
"ivNameSpaceConfig",
".",
"getClassLoader",
"(",
")",
"==",
"null",
")",
"{",
"setInjectionClassTypeName",
"(",
"typeName",
")",
";",
"}",
"else",
"{",
"Class",
"<",
"?",
">",
"type",
"=",
"loadClass",
"(",
"typeName",
")",
";",
"//The type parameter is \"optional\"",
"if",
"(",
"type",
"!=",
"null",
")",
"{",
"ResourceImpl",
"curAnnotation",
"=",
"(",
"ResourceImpl",
")",
"getAnnotation",
"(",
")",
";",
"if",
"(",
"curAnnotation",
".",
"ivIsSetType",
")",
"{",
"Class",
"<",
"?",
">",
"curType",
"=",
"getInjectionClassType",
"(",
")",
";",
"// check that value from xml is a subclasss, if not throw an error",
"Class",
"<",
"?",
">",
"mostSpecificClass",
"=",
"mostSpecificClass",
"(",
"type",
",",
"curType",
")",
";",
"if",
"(",
"mostSpecificClass",
"==",
"null",
")",
"{",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"CONFLICTING_XML_VALUES_CWNEN0052E\"",
",",
"ivComponent",
",",
"ivModule",
",",
"ivApplication",
",",
"typeElement",
",",
"element",
",",
"nameElement",
",",
"getJndiName",
"(",
")",
",",
"curType",
",",
"type",
")",
";",
"// d479669",
"String",
"exMsg",
"=",
"\"The \"",
"+",
"ivComponent",
"+",
"\" bean in the \"",
"+",
"ivModule",
"+",
"\" module of the \"",
"+",
"ivApplication",
"+",
"\" application has conflicting configuration data in the XML\"",
"+",
"\" deployment descriptor. Conflicting \"",
"+",
"typeElement",
"+",
"\" element values exist for multiple \"",
"+",
"element",
"+",
"\" elements with the same \"",
"+",
"nameElement",
"+",
"\" element value : \"",
"+",
"getJndiName",
"(",
")",
"+",
"\". The conflicting \"",
"+",
"typeElement",
"+",
"\" element values are \"",
"+",
"curType",
"+",
"\" and \"",
"+",
"type",
"+",
"\".\"",
";",
"// d479669",
"throw",
"new",
"InjectionConfigurationException",
"(",
"exMsg",
")",
";",
"}",
"curAnnotation",
".",
"ivType",
"=",
"mostSpecificClass",
";",
"}",
"else",
"{",
"curAnnotation",
".",
"ivType",
"=",
"type",
";",
"curAnnotation",
".",
"ivIsSetType",
"=",
"true",
";",
"}",
"}",
"}",
"}"
] | Sets the injection type as specified in XML.
@param typeName the type name specified in XML
@param element the XML ref element
@param nameElement the XML name element in the ref element
@param typeElement the XML type element in the ref element
@throws InjectionConfigurationException | [
"Sets",
"the",
"injection",
"type",
"as",
"specified",
"in",
"XML",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/processor/ResourceInjectionBinding.java#L1641-L1693 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/processor/ResourceInjectionBinding.java | ResourceInjectionBinding.isEnvEntryTypeCompatible | private boolean isEnvEntryTypeCompatible(Object newType) // F743-32443
{
Class<?> curType = getInjectionClassType();
if (curType == null)
{
return true;
}
return isClassesCompatible((Class<?>) newType, getInjectionClassType());
} | java | private boolean isEnvEntryTypeCompatible(Object newType) // F743-32443
{
Class<?> curType = getInjectionClassType();
if (curType == null)
{
return true;
}
return isClassesCompatible((Class<?>) newType, getInjectionClassType());
} | [
"private",
"boolean",
"isEnvEntryTypeCompatible",
"(",
"Object",
"newType",
")",
"// F743-32443",
"{",
"Class",
"<",
"?",
">",
"curType",
"=",
"getInjectionClassType",
"(",
")",
";",
"if",
"(",
"curType",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"return",
"isClassesCompatible",
"(",
"(",
"Class",
"<",
"?",
">",
")",
"newType",
",",
"getInjectionClassType",
"(",
")",
")",
";",
"}"
] | Checks if the specified type is compatible for merging with the type
that has already specified for this binding.
@param type a type object returned from {@link #getEnvEntryType} | [
"Checks",
"if",
"the",
"specified",
"type",
"is",
"compatible",
"for",
"merging",
"with",
"the",
"type",
"that",
"has",
"already",
"specified",
"for",
"this",
"binding",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/processor/ResourceInjectionBinding.java#L1701-L1710 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/processor/ResourceInjectionBinding.java | ResourceInjectionBinding.setEnvEntryType | public void setEnvEntryType(ResourceImpl annotation, Object type) // F743-32443
throws InjectionException
{
if (type instanceof String)
{
setInjectionClassTypeName((String) type);
}
else
{
Class<?> classType = (Class<?>) type;
annotation.ivType = classType;
annotation.ivIsSetType = true;
setInjectionClassType(classType);
}
} | java | public void setEnvEntryType(ResourceImpl annotation, Object type) // F743-32443
throws InjectionException
{
if (type instanceof String)
{
setInjectionClassTypeName((String) type);
}
else
{
Class<?> classType = (Class<?>) type;
annotation.ivType = classType;
annotation.ivIsSetType = true;
setInjectionClassType(classType);
}
} | [
"public",
"void",
"setEnvEntryType",
"(",
"ResourceImpl",
"annotation",
",",
"Object",
"type",
")",
"// F743-32443",
"throws",
"InjectionException",
"{",
"if",
"(",
"type",
"instanceof",
"String",
")",
"{",
"setInjectionClassTypeName",
"(",
"(",
"String",
")",
"type",
")",
";",
"}",
"else",
"{",
"Class",
"<",
"?",
">",
"classType",
"=",
"(",
"Class",
"<",
"?",
">",
")",
"type",
";",
"annotation",
".",
"ivType",
"=",
"classType",
";",
"annotation",
".",
"ivIsSetType",
"=",
"true",
";",
"setInjectionClassType",
"(",
"classType",
")",
";",
"}",
"}"
] | Sets the type of this binding.
@param annotation the merged data
@param type a type object returned from {@link #getEnvEntryType} | [
"Sets",
"the",
"type",
"of",
"this",
"binding",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/processor/ResourceInjectionBinding.java#L1718-L1732 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/processor/ResourceInjectionBinding.java | ResourceInjectionBinding.isEnvEntryType | private boolean isEnvEntryType(Class<?> resolverType) // F743-32443
{
Class<?> injectType = getInjectionClassType();
return injectType == null ? resolverType.getName().equals(getInjectionClassTypeName())
: resolverType == injectType;
} | java | private boolean isEnvEntryType(Class<?> resolverType) // F743-32443
{
Class<?> injectType = getInjectionClassType();
return injectType == null ? resolverType.getName().equals(getInjectionClassTypeName())
: resolverType == injectType;
} | [
"private",
"boolean",
"isEnvEntryType",
"(",
"Class",
"<",
"?",
">",
"resolverType",
")",
"// F743-32443",
"{",
"Class",
"<",
"?",
">",
"injectType",
"=",
"getInjectionClassType",
"(",
")",
";",
"return",
"injectType",
"==",
"null",
"?",
"resolverType",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"getInjectionClassTypeName",
"(",
")",
")",
":",
"resolverType",
"==",
"injectType",
";",
"}"
] | Checks if the type of this binding is the same as the specified type.
@param resolverType the type used for resolving.
@return | [
"Checks",
"if",
"the",
"type",
"of",
"this",
"binding",
"is",
"the",
"same",
"as",
"the",
"specified",
"type",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection.core/src/com/ibm/ws/injectionengine/processor/ResourceInjectionBinding.java#L1823-L1828 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.repository/src/com/ibm/ws/repository/transport/client/RestClient.java | RestClient.getAllAssets | @Override
public List<Asset> getAllAssets() throws IOException, RequestFailureException {
HttpURLConnection connection = createHttpURLConnectionToMassive("/assets");
connection.setRequestMethod("GET");
testResponseCode(connection);
return JSONAssetConverter.readValues(connection.getInputStream());
} | java | @Override
public List<Asset> getAllAssets() throws IOException, RequestFailureException {
HttpURLConnection connection = createHttpURLConnectionToMassive("/assets");
connection.setRequestMethod("GET");
testResponseCode(connection);
return JSONAssetConverter.readValues(connection.getInputStream());
} | [
"@",
"Override",
"public",
"List",
"<",
"Asset",
">",
"getAllAssets",
"(",
")",
"throws",
"IOException",
",",
"RequestFailureException",
"{",
"HttpURLConnection",
"connection",
"=",
"createHttpURLConnectionToMassive",
"(",
"\"/assets\"",
")",
";",
"connection",
".",
"setRequestMethod",
"(",
"\"GET\"",
")",
";",
"testResponseCode",
"(",
"connection",
")",
";",
"return",
"JSONAssetConverter",
".",
"readValues",
"(",
"connection",
".",
"getInputStream",
"(",
")",
")",
";",
"}"
] | This method will issue a GET to all of the assets in massive
@return A list of all of the assets in Massive
@throws IOException
@throws RequestFailureException | [
"This",
"method",
"will",
"issue",
"a",
"GET",
"to",
"all",
"of",
"the",
"assets",
"in",
"massive"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository/src/com/ibm/ws/repository/transport/client/RestClient.java#L98-L104 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.