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.messaging.comms.client/src/com/ibm/ws/sib/comms/client/proxyqueue/impl/LockedMessageEnumerationImpl.java | LockedMessageEnumerationImpl.getUnSeenMessageCount | private int getUnSeenMessageCount()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc,"getUnseenMessageCount");
int remain = 0;
for (int x = nextIndex; x < messages.length; x++)
{
if (messages[x] != null) remain++;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc,"getUnseenMessageCount", ""+remain);
return remain;
} | java | private int getUnSeenMessageCount()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc,"getUnseenMessageCount");
int remain = 0;
for (int x = nextIndex; x < messages.length; x++)
{
if (messages[x] != null) remain++;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc,"getUnseenMessageCount", ""+remain);
return remain;
} | [
"private",
"int",
"getUnSeenMessageCount",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"getUnseenMessageCount\"",
")",
";",
"int",
"remain",
"=",
"0",
";",
"for",
"(",
"int",
"x",
"=",
"nextIndex",
";",
"x",
"<",
"messages",
".",
"length",
";",
"x",
"++",
")",
"{",
"if",
"(",
"messages",
"[",
"x",
"]",
"!=",
"null",
")",
"remain",
"++",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"getUnseenMessageCount\"",
",",
"\"\"",
"+",
"remain",
")",
";",
"return",
"remain",
";",
"}"
] | Private method to determine how many messages have not been seen as yet. It does this by
looking at the number of non-null elements from the current item to the end of the array.
@return Returns the number of unseen items. | [
"Private",
"method",
"to",
"determine",
"how",
"many",
"messages",
"have",
"not",
"been",
"seen",
"as",
"yet",
".",
"It",
"does",
"this",
"by",
"looking",
"at",
"the",
"number",
"of",
"non",
"-",
"null",
"elements",
"from",
"the",
"current",
"item",
"to",
"the",
"end",
"of",
"the",
"array",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/proxyqueue/impl/LockedMessageEnumerationImpl.java#L479-L491 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/proxyqueue/impl/LockedMessageEnumerationImpl.java | LockedMessageEnumerationImpl.unlockUnseen | public void unlockUnseen()
throws SIResourceException, SIConnectionDroppedException, SIConnectionLostException, // F247845
SIIncorrectCallException, SIMessageNotLockedException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc,"unlockUnseen");
// The conversation helper needs a properly sized array of id's, so first create an array
// that is as large as we'll ever need it to be, populate it and then resize it.
SIMessageHandle[] idsToUnlock = new SIMessageHandle[getUnSeenMessageCount()];
int arrayPos = 0;
for (int startingIndex = nextIndex; startingIndex < messages.length; startingIndex++)
{
if (messages[startingIndex] != null)
{
// Start F247845
if (CommsUtils.isRecoverable(messages[startingIndex], consumerSession.getUnrecoverableReliability()))
{
idsToUnlock[arrayPos] = messages[startingIndex].getMessageHandle();
arrayPos++;
}
// End F247845
// Delete it from the main pile
messages[startingIndex] = null;
}
}
//Resize array to prevent NPEs.
if(idsToUnlock.length != arrayPos)
{
if(TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "compacting array");
final SIMessageHandle[] tempArray = new SIMessageHandle[arrayPos];
System.arraycopy(idsToUnlock, 0, tempArray, 0, arrayPos);
idsToUnlock = tempArray;
}
convHelper.unlockSet(idsToUnlock);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc,"unlockUnseen");
} | java | public void unlockUnseen()
throws SIResourceException, SIConnectionDroppedException, SIConnectionLostException, // F247845
SIIncorrectCallException, SIMessageNotLockedException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc,"unlockUnseen");
// The conversation helper needs a properly sized array of id's, so first create an array
// that is as large as we'll ever need it to be, populate it and then resize it.
SIMessageHandle[] idsToUnlock = new SIMessageHandle[getUnSeenMessageCount()];
int arrayPos = 0;
for (int startingIndex = nextIndex; startingIndex < messages.length; startingIndex++)
{
if (messages[startingIndex] != null)
{
// Start F247845
if (CommsUtils.isRecoverable(messages[startingIndex], consumerSession.getUnrecoverableReliability()))
{
idsToUnlock[arrayPos] = messages[startingIndex].getMessageHandle();
arrayPos++;
}
// End F247845
// Delete it from the main pile
messages[startingIndex] = null;
}
}
//Resize array to prevent NPEs.
if(idsToUnlock.length != arrayPos)
{
if(TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "compacting array");
final SIMessageHandle[] tempArray = new SIMessageHandle[arrayPos];
System.arraycopy(idsToUnlock, 0, tempArray, 0, arrayPos);
idsToUnlock = tempArray;
}
convHelper.unlockSet(idsToUnlock);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc,"unlockUnseen");
} | [
"public",
"void",
"unlockUnseen",
"(",
")",
"throws",
"SIResourceException",
",",
"SIConnectionDroppedException",
",",
"SIConnectionLostException",
",",
"// F247845",
"SIIncorrectCallException",
",",
"SIMessageNotLockedException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"unlockUnseen\"",
")",
";",
"// The conversation helper needs a properly sized array of id's, so first create an array",
"// that is as large as we'll ever need it to be, populate it and then resize it.",
"SIMessageHandle",
"[",
"]",
"idsToUnlock",
"=",
"new",
"SIMessageHandle",
"[",
"getUnSeenMessageCount",
"(",
")",
"]",
";",
"int",
"arrayPos",
"=",
"0",
";",
"for",
"(",
"int",
"startingIndex",
"=",
"nextIndex",
";",
"startingIndex",
"<",
"messages",
".",
"length",
";",
"startingIndex",
"++",
")",
"{",
"if",
"(",
"messages",
"[",
"startingIndex",
"]",
"!=",
"null",
")",
"{",
"// Start F247845",
"if",
"(",
"CommsUtils",
".",
"isRecoverable",
"(",
"messages",
"[",
"startingIndex",
"]",
",",
"consumerSession",
".",
"getUnrecoverableReliability",
"(",
")",
")",
")",
"{",
"idsToUnlock",
"[",
"arrayPos",
"]",
"=",
"messages",
"[",
"startingIndex",
"]",
".",
"getMessageHandle",
"(",
")",
";",
"arrayPos",
"++",
";",
"}",
"// End F247845",
"// Delete it from the main pile",
"messages",
"[",
"startingIndex",
"]",
"=",
"null",
";",
"}",
"}",
"//Resize array to prevent NPEs.",
"if",
"(",
"idsToUnlock",
".",
"length",
"!=",
"arrayPos",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"compacting array\"",
")",
";",
"final",
"SIMessageHandle",
"[",
"]",
"tempArray",
"=",
"new",
"SIMessageHandle",
"[",
"arrayPos",
"]",
";",
"System",
".",
"arraycopy",
"(",
"idsToUnlock",
",",
"0",
",",
"tempArray",
",",
"0",
",",
"arrayPos",
")",
";",
"idsToUnlock",
"=",
"tempArray",
";",
"}",
"convHelper",
".",
"unlockSet",
"(",
"idsToUnlock",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"unlockUnseen\"",
")",
";",
"}"
] | begin F219476.2 | [
"begin",
"F219476",
".",
"2"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/proxyqueue/impl/LockedMessageEnumerationImpl.java#L499-L540 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/proxyqueue/impl/LockedMessageEnumerationImpl.java | LockedMessageEnumerationImpl.getConsumerSession | public ConsumerSession getConsumerSession()
throws SISessionUnavailableException, SISessionDroppedException,
SIConnectionUnavailableException, SIConnectionDroppedException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc,"getConsumerSession"); // f173765.2
checkValid(); // f173765.2
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc,"getConsumerSession"); // f173765.2
return consumerSession;
} | java | public ConsumerSession getConsumerSession()
throws SISessionUnavailableException, SISessionDroppedException,
SIConnectionUnavailableException, SIConnectionDroppedException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc,"getConsumerSession"); // f173765.2
checkValid(); // f173765.2
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc,"getConsumerSession"); // f173765.2
return consumerSession;
} | [
"public",
"ConsumerSession",
"getConsumerSession",
"(",
")",
"throws",
"SISessionUnavailableException",
",",
"SISessionDroppedException",
",",
"SIConnectionUnavailableException",
",",
"SIConnectionDroppedException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"getConsumerSession\"",
")",
";",
"// f173765.2",
"checkValid",
"(",
")",
";",
"// f173765.2",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"getConsumerSession\"",
")",
";",
"// f173765.2",
"return",
"consumerSession",
";",
"}"
] | Returns the consumer session this enumeration contains messages
delivered to.
@see com.ibm.wsspi.sib.core.LockedMessageEnumeration#getConsumerSession() | [
"Returns",
"the",
"consumer",
"session",
"this",
"enumeration",
"contains",
"messages",
"delivered",
"to",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/proxyqueue/impl/LockedMessageEnumerationImpl.java#L550-L559 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/proxyqueue/impl/LockedMessageEnumerationImpl.java | LockedMessageEnumerationImpl.markInvalid | protected void markInvalid()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc,"markInvalid");
invalid = true;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc,"markInvalid");
} | java | protected void markInvalid()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc,"markInvalid");
invalid = true;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc,"markInvalid");
} | [
"protected",
"void",
"markInvalid",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"markInvalid\"",
")",
";",
"invalid",
"=",
"true",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"markInvalid\"",
")",
";",
"}"
] | Marks the enumeration as invalid. This is called once the asynchronous
consumer callback returns to ensure that this locked message enumeration
cannot be used from outside the callback. | [
"Marks",
"the",
"enumeration",
"as",
"invalid",
".",
"This",
"is",
"called",
"once",
"the",
"asynchronous",
"consumer",
"callback",
"returns",
"to",
"ensure",
"that",
"this",
"locked",
"message",
"enumeration",
"cannot",
"be",
"used",
"from",
"outside",
"the",
"callback",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/proxyqueue/impl/LockedMessageEnumerationImpl.java#L595-L600 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/internal/HTTPSRedirectHandler.java | HTTPSRedirectHandler.shouldRedirectToHttps | public boolean shouldRedirectToHttps(WebRequest webRequest) {
HttpServletRequest req = webRequest.getHttpServletRequest();
return !req.isSecure() && webRequest.isSSLRequired();
} | java | public boolean shouldRedirectToHttps(WebRequest webRequest) {
HttpServletRequest req = webRequest.getHttpServletRequest();
return !req.isSecure() && webRequest.isSSLRequired();
} | [
"public",
"boolean",
"shouldRedirectToHttps",
"(",
"WebRequest",
"webRequest",
")",
"{",
"HttpServletRequest",
"req",
"=",
"webRequest",
".",
"getHttpServletRequest",
"(",
")",
";",
"return",
"!",
"req",
".",
"isSecure",
"(",
")",
"&&",
"webRequest",
".",
"isSSLRequired",
"(",
")",
";",
"}"
] | Determines if HTTPS redirect is required for this request.
@param webRequest
@return {@code true} if the request requires SSL but the request is not secure, {@code false} otherwise. | [
"Determines",
"if",
"HTTPS",
"redirect",
"is",
"required",
"for",
"this",
"request",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/internal/HTTPSRedirectHandler.java#L34-L37 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/internal/HTTPSRedirectHandler.java | HTTPSRedirectHandler.getHTTPSRedirectWebReply | public WebReply getHTTPSRedirectWebReply(HttpServletRequest req) {
Integer httpsPort = (Integer) SRTServletRequestUtils.getPrivateAttribute(req, "SecurityRedirectPort");
if (httpsPort == null) {
Tr.error(tc, "SSL_PORT_IS_NULL");
// return a 403 if we don't know what the port is
return new DenyReply("Resource must be accessed with a secure connection try again using an HTTPS connection.");
}
URL originalURL = null;
String urlString = null;
try {
urlString = req.getRequestURL().toString();
originalURL = new URL(urlString);
} catch (MalformedURLException e) {
Tr.error(tc, "SSL_REQ_URL_MALFORMED_EXCEPTION", urlString);
// return a 403 if we can't construct the redirect URL
return new DenyReply("Resource must be accessed with a secure connection try again using an HTTPS connection.");
}
String queryString = req.getQueryString();
try {
URL redirectURL = new URL("https",
originalURL.getHost(),
httpsPort,
originalURL.getPath() + (queryString == null ? "" : "?" + queryString));
//don't add cookies during the redirect as this results in duplicated and incomplete
//cookies on the client side
return new RedirectReply(redirectURL.toString(), null);
} catch (MalformedURLException e) {
Tr.error(tc, "SSL_REQ_URL_MALFORMED_EXCEPTION", "https" + originalURL.getHost() + httpsPort + originalURL.getPath() + (queryString == null ? "" : "?" + queryString));
// return a 403 if we can't construct the redirect URL
return new DenyReply("Resource must be accessed with a secure connection try again using an HTTPS connection.");
}
} | java | public WebReply getHTTPSRedirectWebReply(HttpServletRequest req) {
Integer httpsPort = (Integer) SRTServletRequestUtils.getPrivateAttribute(req, "SecurityRedirectPort");
if (httpsPort == null) {
Tr.error(tc, "SSL_PORT_IS_NULL");
// return a 403 if we don't know what the port is
return new DenyReply("Resource must be accessed with a secure connection try again using an HTTPS connection.");
}
URL originalURL = null;
String urlString = null;
try {
urlString = req.getRequestURL().toString();
originalURL = new URL(urlString);
} catch (MalformedURLException e) {
Tr.error(tc, "SSL_REQ_URL_MALFORMED_EXCEPTION", urlString);
// return a 403 if we can't construct the redirect URL
return new DenyReply("Resource must be accessed with a secure connection try again using an HTTPS connection.");
}
String queryString = req.getQueryString();
try {
URL redirectURL = new URL("https",
originalURL.getHost(),
httpsPort,
originalURL.getPath() + (queryString == null ? "" : "?" + queryString));
//don't add cookies during the redirect as this results in duplicated and incomplete
//cookies on the client side
return new RedirectReply(redirectURL.toString(), null);
} catch (MalformedURLException e) {
Tr.error(tc, "SSL_REQ_URL_MALFORMED_EXCEPTION", "https" + originalURL.getHost() + httpsPort + originalURL.getPath() + (queryString == null ? "" : "?" + queryString));
// return a 403 if we can't construct the redirect URL
return new DenyReply("Resource must be accessed with a secure connection try again using an HTTPS connection.");
}
} | [
"public",
"WebReply",
"getHTTPSRedirectWebReply",
"(",
"HttpServletRequest",
"req",
")",
"{",
"Integer",
"httpsPort",
"=",
"(",
"Integer",
")",
"SRTServletRequestUtils",
".",
"getPrivateAttribute",
"(",
"req",
",",
"\"SecurityRedirectPort\"",
")",
";",
"if",
"(",
"httpsPort",
"==",
"null",
")",
"{",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"SSL_PORT_IS_NULL\"",
")",
";",
"// return a 403 if we don't know what the port is",
"return",
"new",
"DenyReply",
"(",
"\"Resource must be accessed with a secure connection try again using an HTTPS connection.\"",
")",
";",
"}",
"URL",
"originalURL",
"=",
"null",
";",
"String",
"urlString",
"=",
"null",
";",
"try",
"{",
"urlString",
"=",
"req",
".",
"getRequestURL",
"(",
")",
".",
"toString",
"(",
")",
";",
"originalURL",
"=",
"new",
"URL",
"(",
"urlString",
")",
";",
"}",
"catch",
"(",
"MalformedURLException",
"e",
")",
"{",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"SSL_REQ_URL_MALFORMED_EXCEPTION\"",
",",
"urlString",
")",
";",
"// return a 403 if we can't construct the redirect URL",
"return",
"new",
"DenyReply",
"(",
"\"Resource must be accessed with a secure connection try again using an HTTPS connection.\"",
")",
";",
"}",
"String",
"queryString",
"=",
"req",
".",
"getQueryString",
"(",
")",
";",
"try",
"{",
"URL",
"redirectURL",
"=",
"new",
"URL",
"(",
"\"https\"",
",",
"originalURL",
".",
"getHost",
"(",
")",
",",
"httpsPort",
",",
"originalURL",
".",
"getPath",
"(",
")",
"+",
"(",
"queryString",
"==",
"null",
"?",
"\"\"",
":",
"\"?\"",
"+",
"queryString",
")",
")",
";",
"//don't add cookies during the redirect as this results in duplicated and incomplete",
"//cookies on the client side",
"return",
"new",
"RedirectReply",
"(",
"redirectURL",
".",
"toString",
"(",
")",
",",
"null",
")",
";",
"}",
"catch",
"(",
"MalformedURLException",
"e",
")",
"{",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"SSL_REQ_URL_MALFORMED_EXCEPTION\"",
",",
"\"https\"",
"+",
"originalURL",
".",
"getHost",
"(",
")",
"+",
"httpsPort",
"+",
"originalURL",
".",
"getPath",
"(",
")",
"+",
"(",
"queryString",
"==",
"null",
"?",
"\"\"",
":",
"\"?\"",
"+",
"queryString",
")",
")",
";",
"// return a 403 if we can't construct the redirect URL",
"return",
"new",
"DenyReply",
"(",
"\"Resource must be accessed with a secure connection try again using an HTTPS connection.\"",
")",
";",
"}",
"}"
] | Get the new URL for the redirect which contains the https port.
@param req
@return WebReply to the redirect URL, or a 403 is any unexpected behaviour occurs | [
"Get",
"the",
"new",
"URL",
"for",
"the",
"redirect",
"which",
"contains",
"the",
"https",
"port",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/internal/HTTPSRedirectHandler.java#L45-L79 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATMainConsumer.java | CATMainConsumer.receive | public void receive(int requestNumber,
int tran,
long timeout)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "receive",
new Object[]
{
requestNumber,
tran,
timeout
});
if (subConsumer == null)
{
subConsumer = new CATSessSynchConsumer(this);
}
subConsumer.receive(requestNumber, tran, timeout); // f177889 // f187521.2.1
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "receive");
} | java | public void receive(int requestNumber,
int tran,
long timeout)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "receive",
new Object[]
{
requestNumber,
tran,
timeout
});
if (subConsumer == null)
{
subConsumer = new CATSessSynchConsumer(this);
}
subConsumer.receive(requestNumber, tran, timeout); // f177889 // f187521.2.1
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "receive");
} | [
"public",
"void",
"receive",
"(",
"int",
"requestNumber",
",",
"int",
"tran",
",",
"long",
"timeout",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"receive\"",
",",
"new",
"Object",
"[",
"]",
"{",
"requestNumber",
",",
"tran",
",",
"timeout",
"}",
")",
";",
"if",
"(",
"subConsumer",
"==",
"null",
")",
"{",
"subConsumer",
"=",
"new",
"CATSessSynchConsumer",
"(",
"this",
")",
";",
"}",
"subConsumer",
".",
"receive",
"(",
"requestNumber",
",",
"tran",
",",
"timeout",
")",
";",
"// f177889 // f187521.2.1",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"receive\"",
")",
";",
"}"
] | Performs a receive on this consumer. This is only a valid operation when the
consumer is in synchronous mode. If the sub consumer has not been set up
then this has to be created here.
@param requestNumber The JFAP request.
@param tran The transaction to use.
@param timeout The timeout for the receive. | [
"Performs",
"a",
"receive",
"on",
"this",
"consumer",
".",
"This",
"is",
"only",
"a",
"valid",
"operation",
"when",
"the",
"consumer",
"is",
"in",
"synchronous",
"mode",
".",
"If",
"the",
"sub",
"consumer",
"has",
"not",
"been",
"set",
"up",
"then",
"this",
"has",
"to",
"be",
"created",
"here",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATMainConsumer.java#L420-L440 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATMainConsumer.java | CATMainConsumer.unsetAsynchConsumerCallback | public void unsetAsynchConsumerCallback(int requestNumber, boolean stoppable) //SIB0115d.comms
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "unsetAsynchConsumerCallback", "requestNumber="+requestNumber+",stoppable="+stoppable);
checkNotBrowserSession(); // F171893
if (subConsumer != null)
{
subConsumer.unsetAsynchConsumerCallback(requestNumber, stoppable); //SIB0115d.comms
}
subConsumer = null;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "unsetAsynchConsumerCallback");
} | java | public void unsetAsynchConsumerCallback(int requestNumber, boolean stoppable) //SIB0115d.comms
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "unsetAsynchConsumerCallback", "requestNumber="+requestNumber+",stoppable="+stoppable);
checkNotBrowserSession(); // F171893
if (subConsumer != null)
{
subConsumer.unsetAsynchConsumerCallback(requestNumber, stoppable); //SIB0115d.comms
}
subConsumer = null;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "unsetAsynchConsumerCallback");
} | [
"public",
"void",
"unsetAsynchConsumerCallback",
"(",
"int",
"requestNumber",
",",
"boolean",
"stoppable",
")",
"//SIB0115d.comms",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"unsetAsynchConsumerCallback\"",
",",
"\"requestNumber=\"",
"+",
"requestNumber",
"+",
"\",stoppable=\"",
"+",
"stoppable",
")",
";",
"checkNotBrowserSession",
"(",
")",
";",
"// F171893",
"if",
"(",
"subConsumer",
"!=",
"null",
")",
"{",
"subConsumer",
".",
"unsetAsynchConsumerCallback",
"(",
"requestNumber",
",",
"stoppable",
")",
";",
"//SIB0115d.comms",
"}",
"subConsumer",
"=",
"null",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"unsetAsynchConsumerCallback\"",
")",
";",
"}"
] | This method will unset the asynch consumer callback. This means that the
client has requested that the session should be converted from asynchronous to
synchronous and so the sub consumer must be changed
@param requestNumber | [
"This",
"method",
"will",
"unset",
"the",
"asynch",
"consumer",
"callback",
".",
"This",
"means",
"that",
"the",
"client",
"has",
"requested",
"that",
"the",
"session",
"should",
"be",
"converted",
"from",
"asynchronous",
"to",
"synchronous",
"and",
"so",
"the",
"sub",
"consumer",
"must",
"be",
"changed"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATMainConsumer.java#L594-L608 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATMainConsumer.java | CATMainConsumer.start | public void start(int requestNumber, boolean deliverImmediately, boolean sendReply, SendListener sendListener) { //471642
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "start",
new Object[]{requestNumber, deliverImmediately,sendReply,sendListener});
start(requestNumber, deliverImmediately, sendReply, sendListener, false);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start");
} | java | public void start(int requestNumber, boolean deliverImmediately, boolean sendReply, SendListener sendListener) { //471642
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "start",
new Object[]{requestNumber, deliverImmediately,sendReply,sendListener});
start(requestNumber, deliverImmediately, sendReply, sendListener, false);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start");
} | [
"public",
"void",
"start",
"(",
"int",
"requestNumber",
",",
"boolean",
"deliverImmediately",
",",
"boolean",
"sendReply",
",",
"SendListener",
"sendListener",
")",
"{",
"//471642",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"start\"",
",",
"new",
"Object",
"[",
"]",
"{",
"requestNumber",
",",
"deliverImmediately",
",",
"sendReply",
",",
"sendListener",
"}",
")",
";",
"start",
"(",
"requestNumber",
",",
"deliverImmediately",
",",
"sendReply",
",",
"sendListener",
",",
"false",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"start\"",
")",
";",
"}"
] | Start the consumer
@param requestNumber The request number which replies should be sent to.
@param deliverImmediately Whether we should deliver on this thread if we can.
@param sendReply Whether a reply is needed for this flow
@param sendListener A send listener that will be notified when the start reply is sent | [
"Start",
"the",
"consumer"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATMainConsumer.java#L618-L625 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATMainConsumer.java | CATMainConsumer.setBifurcatedSession | public void setBifurcatedSession(BifurcatedConsumerSession sess)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setBifurcatedSession", sess);
subConsumer = new CATBifurcatedConsumer(this, sess);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setBifurcatedSession");
} | java | public void setBifurcatedSession(BifurcatedConsumerSession sess)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setBifurcatedSession", sess);
subConsumer = new CATBifurcatedConsumer(this, sess);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setBifurcatedSession");
} | [
"public",
"void",
"setBifurcatedSession",
"(",
"BifurcatedConsumerSession",
"sess",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"setBifurcatedSession\"",
",",
"sess",
")",
";",
"subConsumer",
"=",
"new",
"CATBifurcatedConsumer",
"(",
"this",
",",
"sess",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"setBifurcatedSession\"",
")",
";",
"}"
] | This method will put the main consumer into bifurcated mode.
@param sess The bifurcated session. | [
"This",
"method",
"will",
"put",
"the",
"main",
"consumer",
"into",
"bifurcated",
"mode",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATMainConsumer.java#L1124-L1131 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.microprofile.faulttolerance.2.0/src/com/ibm/ws/microprofile/faulttolerance20/state/impl/AsyncBulkheadStateImpl.java | AsyncBulkheadStateImpl.tryRunNext | private void tryRunNext() {
while (runningSemaphore.tryAcquire()) {
ExecutionTask execution = queue.poll();
if (execution != null) {
// Note: we've removed the execution from the queue so we're committed to running it
// if we fail to do so for any reason, we need to call the exception handler to fail the execution
try {
execution.submit();
} catch (Throwable e) {
// Any exception here is unexpected
runningSemaphore.release();
execution.exceptionHandler.handle(e);
}
} else {
runningSemaphore.release();
break;
}
}
} | java | private void tryRunNext() {
while (runningSemaphore.tryAcquire()) {
ExecutionTask execution = queue.poll();
if (execution != null) {
// Note: we've removed the execution from the queue so we're committed to running it
// if we fail to do so for any reason, we need to call the exception handler to fail the execution
try {
execution.submit();
} catch (Throwable e) {
// Any exception here is unexpected
runningSemaphore.release();
execution.exceptionHandler.handle(e);
}
} else {
runningSemaphore.release();
break;
}
}
} | [
"private",
"void",
"tryRunNext",
"(",
")",
"{",
"while",
"(",
"runningSemaphore",
".",
"tryAcquire",
"(",
")",
")",
"{",
"ExecutionTask",
"execution",
"=",
"queue",
".",
"poll",
"(",
")",
";",
"if",
"(",
"execution",
"!=",
"null",
")",
"{",
"// Note: we've removed the execution from the queue so we're committed to running it",
"// if we fail to do so for any reason, we need to call the exception handler to fail the execution",
"try",
"{",
"execution",
".",
"submit",
"(",
")",
";",
"}",
"catch",
"(",
"Throwable",
"e",
")",
"{",
"// Any exception here is unexpected",
"runningSemaphore",
".",
"release",
"(",
")",
";",
"execution",
".",
"exceptionHandler",
".",
"handle",
"(",
"e",
")",
";",
"}",
"}",
"else",
"{",
"runningSemaphore",
".",
"release",
"(",
")",
";",
"break",
";",
"}",
"}",
"}"
] | Attempt to run any queued executions | [
"Attempt",
"to",
"run",
"any",
"queued",
"executions"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.faulttolerance.2.0/src/com/ibm/ws/microprofile/faulttolerance20/state/impl/AsyncBulkheadStateImpl.java#L73-L91 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/expiry/Expirer.java | Expirer.removeExpirable | public final boolean removeExpirable(Expirable expirable) throws SevereMessageStoreException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(tc, "removeExpirable",
"objId="
+ (expirable == null ? "null" : String.valueOf(expirable.expirableGetID()))
+ " ET="
+ (expirable == null ? "null" : String.valueOf(expirable.expirableGetExpiryTime()))
+ " addEnabled="
+ addEnabled);
}
boolean reply = false;
boolean cancelled = false;
// Ignore this request if the expirer has ended or the given entry is null
synchronized (lockObject)
{
if (addEnabled && expirable != null)
{
long expiryTime = expirable.expirableGetExpiryTime();
ExpirableReference expirableRef = new ExpirableReference(expirable);
expirableRef.setExpiryTime(expiryTime);
// Remove the expirable from the expiry index
reply = expiryIndex.remove(expirableRef);
if (reply && expiryIndex.size() <= 0) // We just removed the last entry
{
if (expiryAlarm != null)
{
expiryAlarm.cancel();
alarmScheduled = false;
cancelled = true;
}
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "removeExpirable", "reply=" + reply + " cancelled=" + cancelled);
return reply;
} | java | public final boolean removeExpirable(Expirable expirable) throws SevereMessageStoreException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(tc, "removeExpirable",
"objId="
+ (expirable == null ? "null" : String.valueOf(expirable.expirableGetID()))
+ " ET="
+ (expirable == null ? "null" : String.valueOf(expirable.expirableGetExpiryTime()))
+ " addEnabled="
+ addEnabled);
}
boolean reply = false;
boolean cancelled = false;
// Ignore this request if the expirer has ended or the given entry is null
synchronized (lockObject)
{
if (addEnabled && expirable != null)
{
long expiryTime = expirable.expirableGetExpiryTime();
ExpirableReference expirableRef = new ExpirableReference(expirable);
expirableRef.setExpiryTime(expiryTime);
// Remove the expirable from the expiry index
reply = expiryIndex.remove(expirableRef);
if (reply && expiryIndex.size() <= 0) // We just removed the last entry
{
if (expiryAlarm != null)
{
expiryAlarm.cancel();
alarmScheduled = false;
cancelled = true;
}
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "removeExpirable", "reply=" + reply + " cancelled=" + cancelled);
return reply;
} | [
"public",
"final",
"boolean",
"removeExpirable",
"(",
"Expirable",
"expirable",
")",
"throws",
"SevereMessageStoreException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"removeExpirable\"",
",",
"\"objId=\"",
"+",
"(",
"expirable",
"==",
"null",
"?",
"\"null\"",
":",
"String",
".",
"valueOf",
"(",
"expirable",
".",
"expirableGetID",
"(",
")",
")",
")",
"+",
"\" ET=\"",
"+",
"(",
"expirable",
"==",
"null",
"?",
"\"null\"",
":",
"String",
".",
"valueOf",
"(",
"expirable",
".",
"expirableGetExpiryTime",
"(",
")",
")",
")",
"+",
"\" addEnabled=\"",
"+",
"addEnabled",
")",
";",
"}",
"boolean",
"reply",
"=",
"false",
";",
"boolean",
"cancelled",
"=",
"false",
";",
"// Ignore this request if the expirer has ended or the given entry is null",
"synchronized",
"(",
"lockObject",
")",
"{",
"if",
"(",
"addEnabled",
"&&",
"expirable",
"!=",
"null",
")",
"{",
"long",
"expiryTime",
"=",
"expirable",
".",
"expirableGetExpiryTime",
"(",
")",
";",
"ExpirableReference",
"expirableRef",
"=",
"new",
"ExpirableReference",
"(",
"expirable",
")",
";",
"expirableRef",
".",
"setExpiryTime",
"(",
"expiryTime",
")",
";",
"// Remove the expirable from the expiry index",
"reply",
"=",
"expiryIndex",
".",
"remove",
"(",
"expirableRef",
")",
";",
"if",
"(",
"reply",
"&&",
"expiryIndex",
".",
"size",
"(",
")",
"<=",
"0",
")",
"// We just removed the last entry",
"{",
"if",
"(",
"expiryAlarm",
"!=",
"null",
")",
"{",
"expiryAlarm",
".",
"cancel",
"(",
")",
";",
"alarmScheduled",
"=",
"false",
";",
"cancelled",
"=",
"true",
";",
"}",
"}",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"removeExpirable\"",
",",
"\"reply=\"",
"+",
"reply",
"+",
"\" cancelled=\"",
"+",
"cancelled",
")",
";",
"return",
"reply",
";",
"}"
] | Remove an Expirable reference for an item from the expiry index.
@param expirable the Expirable item for which a reference is to be removed from the expiry index.
@return true if the reference was removed from the index, false otherwise.
@throws SevereMessageStoreException | [
"Remove",
"an",
"Expirable",
"reference",
"for",
"an",
"item",
"from",
"the",
"expiry",
"index",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/expiry/Expirer.java#L198-L238 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/expiry/Expirer.java | Expirer.start | public final void start(long expiryInterval, JsMessagingEngine jsme) throws SevereMessageStoreException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "start", "interval=" + expiryInterval + " indexSize=" + expiryIndex.size());
messagingEngine = jsme;
if (expiryInterval >= 0) // If an expiry interval was given, use it
{
interval = expiryInterval;
}
else // Otherwise, get it from the system property
{
// Get property for expiry interval
String value =
messageStore.getProperty(
MessageStoreConstants.PROP_EXPIRY_INTERVAL,
MessageStoreConstants.PROP_EXPIRY_INTERVAL_DEFAULT);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "start", "Value from property=<" + value + ">");
try
{
this.interval = Long.parseLong(value.trim());
}
catch (NumberFormatException e)
{
// No FFDC Code Needed.
lastException = e;
lastExceptionTime = timeNow();
SibTr.debug(this, tc, "start", "Unable to parse property: " + e);
this.interval = 1000; // Use hard coded default as last resort
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "start", "expiryInterval=" + this.interval);
// about to tinker with various variables so take the lock now
synchronized (lockObject)
{
if (interval < 1)
{
runEnabled = false;
addEnabled = false;
}
else
{
if (expiryAlarm == null)
{
runEnabled = true;
addEnabled = true;
expirerStartTime = timeNow();
// Now we look at the size of the index and only schedule the first
// alarm if the index is not empty. Remember that expirables can be
// added BEFORE the expirer is started so it may not be empty.
if (expiryIndex.size() > 0) // If the index is not empty,
{
scheduleAlarm(interval); // ... schedule the first alarm.
}
}
else
{
// Expiry thread already running
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Expiry already started");
SevereMessageStoreException e = new SevereMessageStoreException("EXPIRY_THREAD_ALREADY_RUNNING_SIMS2004");
lastException = e;
lastExceptionTime = timeNow();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "start");
throw e;
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start", "runEnabled=" + runEnabled + " addEnabled=" + addEnabled + " interval=" + interval);
} | java | public final void start(long expiryInterval, JsMessagingEngine jsme) throws SevereMessageStoreException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "start", "interval=" + expiryInterval + " indexSize=" + expiryIndex.size());
messagingEngine = jsme;
if (expiryInterval >= 0) // If an expiry interval was given, use it
{
interval = expiryInterval;
}
else // Otherwise, get it from the system property
{
// Get property for expiry interval
String value =
messageStore.getProperty(
MessageStoreConstants.PROP_EXPIRY_INTERVAL,
MessageStoreConstants.PROP_EXPIRY_INTERVAL_DEFAULT);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "start", "Value from property=<" + value + ">");
try
{
this.interval = Long.parseLong(value.trim());
}
catch (NumberFormatException e)
{
// No FFDC Code Needed.
lastException = e;
lastExceptionTime = timeNow();
SibTr.debug(this, tc, "start", "Unable to parse property: " + e);
this.interval = 1000; // Use hard coded default as last resort
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "start", "expiryInterval=" + this.interval);
// about to tinker with various variables so take the lock now
synchronized (lockObject)
{
if (interval < 1)
{
runEnabled = false;
addEnabled = false;
}
else
{
if (expiryAlarm == null)
{
runEnabled = true;
addEnabled = true;
expirerStartTime = timeNow();
// Now we look at the size of the index and only schedule the first
// alarm if the index is not empty. Remember that expirables can be
// added BEFORE the expirer is started so it may not be empty.
if (expiryIndex.size() > 0) // If the index is not empty,
{
scheduleAlarm(interval); // ... schedule the first alarm.
}
}
else
{
// Expiry thread already running
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Expiry already started");
SevereMessageStoreException e = new SevereMessageStoreException("EXPIRY_THREAD_ALREADY_RUNNING_SIMS2004");
lastException = e;
lastExceptionTime = timeNow();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "start");
throw e;
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start", "runEnabled=" + runEnabled + " addEnabled=" + addEnabled + " interval=" + interval);
} | [
"public",
"final",
"void",
"start",
"(",
"long",
"expiryInterval",
",",
"JsMessagingEngine",
"jsme",
")",
"throws",
"SevereMessageStoreException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"start\"",
",",
"\"interval=\"",
"+",
"expiryInterval",
"+",
"\" indexSize=\"",
"+",
"expiryIndex",
".",
"size",
"(",
")",
")",
";",
"messagingEngine",
"=",
"jsme",
";",
"if",
"(",
"expiryInterval",
">=",
"0",
")",
"// If an expiry interval was given, use it",
"{",
"interval",
"=",
"expiryInterval",
";",
"}",
"else",
"// Otherwise, get it from the system property",
"{",
"// Get property for expiry interval",
"String",
"value",
"=",
"messageStore",
".",
"getProperty",
"(",
"MessageStoreConstants",
".",
"PROP_EXPIRY_INTERVAL",
",",
"MessageStoreConstants",
".",
"PROP_EXPIRY_INTERVAL_DEFAULT",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"start\"",
",",
"\"Value from property=<\"",
"+",
"value",
"+",
"\">\"",
")",
";",
"try",
"{",
"this",
".",
"interval",
"=",
"Long",
".",
"parseLong",
"(",
"value",
".",
"trim",
"(",
")",
")",
";",
"}",
"catch",
"(",
"NumberFormatException",
"e",
")",
"{",
"// No FFDC Code Needed.",
"lastException",
"=",
"e",
";",
"lastExceptionTime",
"=",
"timeNow",
"(",
")",
";",
"SibTr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"start\"",
",",
"\"Unable to parse property: \"",
"+",
"e",
")",
";",
"this",
".",
"interval",
"=",
"1000",
";",
"// Use hard coded default as last resort",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"start\"",
",",
"\"expiryInterval=\"",
"+",
"this",
".",
"interval",
")",
";",
"// about to tinker with various variables so take the lock now",
"synchronized",
"(",
"lockObject",
")",
"{",
"if",
"(",
"interval",
"<",
"1",
")",
"{",
"runEnabled",
"=",
"false",
";",
"addEnabled",
"=",
"false",
";",
"}",
"else",
"{",
"if",
"(",
"expiryAlarm",
"==",
"null",
")",
"{",
"runEnabled",
"=",
"true",
";",
"addEnabled",
"=",
"true",
";",
"expirerStartTime",
"=",
"timeNow",
"(",
")",
";",
"// Now we look at the size of the index and only schedule the first",
"// alarm if the index is not empty. Remember that expirables can be",
"// added BEFORE the expirer is started so it may not be empty.",
"if",
"(",
"expiryIndex",
".",
"size",
"(",
")",
">",
"0",
")",
"// If the index is not empty,",
"{",
"scheduleAlarm",
"(",
"interval",
")",
";",
"// ... schedule the first alarm. ",
"}",
"}",
"else",
"{",
"// Expiry thread already running",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"Expiry already started\"",
")",
";",
"SevereMessageStoreException",
"e",
"=",
"new",
"SevereMessageStoreException",
"(",
"\"EXPIRY_THREAD_ALREADY_RUNNING_SIMS2004\"",
")",
";",
"lastException",
"=",
"e",
";",
"lastExceptionTime",
"=",
"timeNow",
"(",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"start\"",
")",
";",
"throw",
"e",
";",
"}",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"start\"",
",",
"\"runEnabled=\"",
"+",
"runEnabled",
"+",
"\" addEnabled=\"",
"+",
"addEnabled",
"+",
"\" interval=\"",
"+",
"interval",
")",
";",
"}"
] | Start the expiry daemon.
@param expiryInterval An interval in milliseconds which may be set via
a custom property and if zero or more will be used to override the
default expiry interval which was set when the Expirer was created.
@throws SevereMessageStoreException | [
"Start",
"the",
"expiry",
"daemon",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/expiry/Expirer.java#L258-L332 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/expiry/Expirer.java | Expirer.stop | public final void stop()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "stop");
synchronized (lockObject)
{
addEnabled = false; // Prevent further expirables being added
if (runEnabled)
{
runEnabled = false; // This should terminate expiry
expirerStopTime = timeNow();
}
if (expiryAlarm != null) // Cancel any outstanding alarm
{
expiryAlarm.cancel();
expiryAlarm = null;
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "stop");
} | java | public final void stop()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "stop");
synchronized (lockObject)
{
addEnabled = false; // Prevent further expirables being added
if (runEnabled)
{
runEnabled = false; // This should terminate expiry
expirerStopTime = timeNow();
}
if (expiryAlarm != null) // Cancel any outstanding alarm
{
expiryAlarm.cancel();
expiryAlarm = null;
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "stop");
} | [
"public",
"final",
"void",
"stop",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"stop\"",
")",
";",
"synchronized",
"(",
"lockObject",
")",
"{",
"addEnabled",
"=",
"false",
";",
"// Prevent further expirables being added",
"if",
"(",
"runEnabled",
")",
"{",
"runEnabled",
"=",
"false",
";",
"// This should terminate expiry",
"expirerStopTime",
"=",
"timeNow",
"(",
")",
";",
"}",
"if",
"(",
"expiryAlarm",
"!=",
"null",
")",
"// Cancel any outstanding alarm",
"{",
"expiryAlarm",
".",
"cancel",
"(",
")",
";",
"expiryAlarm",
"=",
"null",
";",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"stop\"",
")",
";",
"}"
] | Stop the expiry daemon. | [
"Stop",
"the",
"expiry",
"daemon",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/expiry/Expirer.java#L337-L357 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/expiry/Expirer.java | Expirer.remove | private final boolean remove(ExpirableReference expirableRef, boolean expired)
{
boolean reply = expiryIndex.remove();
if (reply)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc,"Removed ("+ (expired ? "expired" : "gone")+ ")"+ " ET="+ expirableRef.getExpiryTime()+ " objId="+ expirableRef.getID());
}
else
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Unable to remove from index: " + " ET=" + expirableRef.getExpiryTime() + " objId=" + expirableRef.getID());
}
return reply;
} | java | private final boolean remove(ExpirableReference expirableRef, boolean expired)
{
boolean reply = expiryIndex.remove();
if (reply)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc,"Removed ("+ (expired ? "expired" : "gone")+ ")"+ " ET="+ expirableRef.getExpiryTime()+ " objId="+ expirableRef.getID());
}
else
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Unable to remove from index: " + " ET=" + expirableRef.getExpiryTime() + " objId=" + expirableRef.getID());
}
return reply;
} | [
"private",
"final",
"boolean",
"remove",
"(",
"ExpirableReference",
"expirableRef",
",",
"boolean",
"expired",
")",
"{",
"boolean",
"reply",
"=",
"expiryIndex",
".",
"remove",
"(",
")",
";",
"if",
"(",
"reply",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"Removed (\"",
"+",
"(",
"expired",
"?",
"\"expired\"",
":",
"\"gone\"",
")",
"+",
"\")\"",
"+",
"\" ET=\"",
"+",
"expirableRef",
".",
"getExpiryTime",
"(",
")",
"+",
"\" objId=\"",
"+",
"expirableRef",
".",
"getID",
"(",
")",
")",
";",
"}",
"else",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"Unable to remove from index: \"",
"+",
"\" ET=\"",
"+",
"expirableRef",
".",
"getExpiryTime",
"(",
")",
"+",
"\" objId=\"",
"+",
"expirableRef",
".",
"getID",
"(",
")",
")",
";",
"}",
"return",
"reply",
";",
"}"
] | Remove the expirable reference from the expiry index. This will remove the
current entry pointed-to by the iterator.
@param expirableRef our reference to the expirable
@param expired true if the item is being removed after expiry, false if being
removed because it is no longer in store. Used for diagnostics only.
@return true if the object was successfully removed from the index. | [
"Remove",
"the",
"expirable",
"reference",
"from",
"the",
"expiry",
"index",
".",
"This",
"will",
"remove",
"the",
"current",
"entry",
"pointed",
"-",
"to",
"by",
"the",
"iterator",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/expiry/Expirer.java#L600-L613 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/expiry/Expirer.java | Expirer.saveStartTime | private int saveStartTime(long time)
{
int indexUsed = diagIndex;
alarmTime[diagIndex++] = time;
if (diagIndex >= MAX_DIAG_LOG)
{
diagIndex = 0;
}
return indexUsed;
} | java | private int saveStartTime(long time)
{
int indexUsed = diagIndex;
alarmTime[diagIndex++] = time;
if (diagIndex >= MAX_DIAG_LOG)
{
diagIndex = 0;
}
return indexUsed;
} | [
"private",
"int",
"saveStartTime",
"(",
"long",
"time",
")",
"{",
"int",
"indexUsed",
"=",
"diagIndex",
";",
"alarmTime",
"[",
"diagIndex",
"++",
"]",
"=",
"time",
";",
"if",
"(",
"diagIndex",
">=",
"MAX_DIAG_LOG",
")",
"{",
"diagIndex",
"=",
"0",
";",
"}",
"return",
"indexUsed",
";",
"}"
] | Keep last n expiry cycle start times for diagnostic dump.
@param time the time this cycle started.
@return the log index used for this entry. | [
"Keep",
"last",
"n",
"expiry",
"cycle",
"start",
"times",
"for",
"diagnostic",
"dump",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/expiry/Expirer.java#L620-L629 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/expiry/Expirer.java | Expirer.scheduleAlarm | private void scheduleAlarm(long timeOut)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "scheduleAlarm timeOut=" + timeOut);
// NB PM27294 implementation now means you cannot decrease the the timeOut if an alarm is already scheduled.
// This is OK for the expirer as the timeout does not change once Expirer is started.
synchronized (lockObject)
{
// if there is not an alarm already scheduled and there exists no thread that will go on to call scheduleAlarm then
// create an alarm.
if (! alarmScheduled && ! alarming)
{
expiryAlarm = AlarmManager.createNonDeferrable(timeOut, this);
alarmScheduled = true;
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "scheduleAlarm", alarmScheduled);
} | java | private void scheduleAlarm(long timeOut)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "scheduleAlarm timeOut=" + timeOut);
// NB PM27294 implementation now means you cannot decrease the the timeOut if an alarm is already scheduled.
// This is OK for the expirer as the timeout does not change once Expirer is started.
synchronized (lockObject)
{
// if there is not an alarm already scheduled and there exists no thread that will go on to call scheduleAlarm then
// create an alarm.
if (! alarmScheduled && ! alarming)
{
expiryAlarm = AlarmManager.createNonDeferrable(timeOut, this);
alarmScheduled = true;
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "scheduleAlarm", alarmScheduled);
} | [
"private",
"void",
"scheduleAlarm",
"(",
"long",
"timeOut",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"scheduleAlarm timeOut=\"",
"+",
"timeOut",
")",
";",
"// NB PM27294 implementation now means you cannot decrease the the timeOut if an alarm is already scheduled.",
"// This is OK for the expirer as the timeout does not change once Expirer is started.",
"synchronized",
"(",
"lockObject",
")",
"{",
"// if there is not an alarm already scheduled and there exists no thread that will go on to call scheduleAlarm then",
"// create an alarm.",
"if",
"(",
"!",
"alarmScheduled",
"&&",
"!",
"alarming",
")",
"{",
"expiryAlarm",
"=",
"AlarmManager",
".",
"createNonDeferrable",
"(",
"timeOut",
",",
"this",
")",
";",
"alarmScheduled",
"=",
"true",
";",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"scheduleAlarm\"",
",",
"alarmScheduled",
")",
";",
"}"
] | Schedule the next alarm. Callers of this method would typically hold lockObject already.
@param timeOut the interval for the alarm. | [
"Schedule",
"the",
"next",
"alarm",
".",
"Callers",
"of",
"this",
"method",
"would",
"typically",
"hold",
"lockObject",
"already",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/expiry/Expirer.java#L635-L653 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/EntryInfo.java | EntryInfo.reset | public void reset() {
expirationTimeFlag = UNSET;
inactivityFlag = UNSET;
idFlag = UNSET;
priorityFlag = UNSET;
sharingPolicyFlag = UNSET;
lock = UNSET;
id = null;
timeLimit = -1;
inactivity = -1;
expirationTime = -1;
validatorExpirationTime = -1;
priority = -1;
sharingPolicy = NOT_SHARED;
persistToDisk = true;
templates.clear();
template = null;
dataIds.clear();
aliasList.clear();
userMetaData = null;
entryInfoPool = null;
cacheType = CacheEntry.CACHE_TYPE_DEFAULT;
externalCacheGroupId = null;
} | java | public void reset() {
expirationTimeFlag = UNSET;
inactivityFlag = UNSET;
idFlag = UNSET;
priorityFlag = UNSET;
sharingPolicyFlag = UNSET;
lock = UNSET;
id = null;
timeLimit = -1;
inactivity = -1;
expirationTime = -1;
validatorExpirationTime = -1;
priority = -1;
sharingPolicy = NOT_SHARED;
persistToDisk = true;
templates.clear();
template = null;
dataIds.clear();
aliasList.clear();
userMetaData = null;
entryInfoPool = null;
cacheType = CacheEntry.CACHE_TYPE_DEFAULT;
externalCacheGroupId = null;
} | [
"public",
"void",
"reset",
"(",
")",
"{",
"expirationTimeFlag",
"=",
"UNSET",
";",
"inactivityFlag",
"=",
"UNSET",
";",
"idFlag",
"=",
"UNSET",
";",
"priorityFlag",
"=",
"UNSET",
";",
"sharingPolicyFlag",
"=",
"UNSET",
";",
"lock",
"=",
"UNSET",
";",
"id",
"=",
"null",
";",
"timeLimit",
"=",
"-",
"1",
";",
"inactivity",
"=",
"-",
"1",
";",
"expirationTime",
"=",
"-",
"1",
";",
"validatorExpirationTime",
"=",
"-",
"1",
";",
"priority",
"=",
"-",
"1",
";",
"sharingPolicy",
"=",
"NOT_SHARED",
";",
"persistToDisk",
"=",
"true",
";",
"templates",
".",
"clear",
"(",
")",
";",
"template",
"=",
"null",
";",
"dataIds",
".",
"clear",
"(",
")",
";",
"aliasList",
".",
"clear",
"(",
")",
";",
"userMetaData",
"=",
"null",
";",
"entryInfoPool",
"=",
"null",
";",
"cacheType",
"=",
"CacheEntry",
".",
"CACHE_TYPE_DEFAULT",
";",
"externalCacheGroupId",
"=",
"null",
";",
"}"
] | resets this EntryInfo for reuse
@ibm-private-in-use | [
"resets",
"this",
"EntryInfo",
"for",
"reuse"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/EntryInfo.java#L222-L245 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/EntryInfo.java | EntryInfo.setId | public void setId(Object id) {
if (lock == SET) {
throw new IllegalStateException("EntryInfo is locked");
}
/*if (idFlag == SET) {
if (tc.isDebugEnabled()) Tr.debug(tc, "Illegal State: tried to set id to "+id+
", but id was already set to "+this.id );
throw new IllegalStateException("id was already set");
} */
idFlag = SET;
this.id = id;
if (tc.isDebugEnabled())
Tr.debug(tc, "set id=" + id);
} | java | public void setId(Object id) {
if (lock == SET) {
throw new IllegalStateException("EntryInfo is locked");
}
/*if (idFlag == SET) {
if (tc.isDebugEnabled()) Tr.debug(tc, "Illegal State: tried to set id to "+id+
", but id was already set to "+this.id );
throw new IllegalStateException("id was already set");
} */
idFlag = SET;
this.id = id;
if (tc.isDebugEnabled())
Tr.debug(tc, "set id=" + id);
} | [
"public",
"void",
"setId",
"(",
"Object",
"id",
")",
"{",
"if",
"(",
"lock",
"==",
"SET",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"EntryInfo is locked\"",
")",
";",
"}",
"/*if (idFlag == SET) {\n\t\t if (tc.isDebugEnabled()) Tr.debug(tc, \"Illegal State: tried to set id to \"+id+\n\t\t\t\t\t\t\t\t\t\t\t \", but id was already set to \"+this.id );\n\t\t throw new IllegalStateException(\"id was already set\");\n\t } */",
"idFlag",
"=",
"SET",
";",
"this",
".",
"id",
"=",
"id",
";",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"set id=\"",
"+",
"id",
")",
";",
"}"
] | This sets the id variable.
@param id The cache id.
@ibm-private-in-use | [
"This",
"sets",
"the",
"id",
"variable",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/EntryInfo.java#L276-L289 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/EntryInfo.java | EntryInfo.setSharingPolicy | public void setSharingPolicy(int sharingPolicy) {
if (lock == SET) {
throw new IllegalStateException("EntryInfo is locked");
}
sharingPolicyFlag = SET;
this.sharingPolicy = sharingPolicy;
if ((sharingPolicy != NOT_SHARED) && (sharingPolicy != SHARED_PUSH) && (sharingPolicy != SHARED_PULL) && (sharingPolicy != SHARED_PUSH_PULL)) {
throw new IllegalArgumentException("Illegal sharing policy: " + sharingPolicy);
}
} | java | public void setSharingPolicy(int sharingPolicy) {
if (lock == SET) {
throw new IllegalStateException("EntryInfo is locked");
}
sharingPolicyFlag = SET;
this.sharingPolicy = sharingPolicy;
if ((sharingPolicy != NOT_SHARED) && (sharingPolicy != SHARED_PUSH) && (sharingPolicy != SHARED_PULL) && (sharingPolicy != SHARED_PUSH_PULL)) {
throw new IllegalArgumentException("Illegal sharing policy: " + sharingPolicy);
}
} | [
"public",
"void",
"setSharingPolicy",
"(",
"int",
"sharingPolicy",
")",
"{",
"if",
"(",
"lock",
"==",
"SET",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"EntryInfo is locked\"",
")",
";",
"}",
"sharingPolicyFlag",
"=",
"SET",
";",
"this",
".",
"sharingPolicy",
"=",
"sharingPolicy",
";",
"if",
"(",
"(",
"sharingPolicy",
"!=",
"NOT_SHARED",
")",
"&&",
"(",
"sharingPolicy",
"!=",
"SHARED_PUSH",
")",
"&&",
"(",
"sharingPolicy",
"!=",
"SHARED_PULL",
")",
"&&",
"(",
"sharingPolicy",
"!=",
"SHARED_PUSH_PULL",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Illegal sharing policy: \"",
"+",
"sharingPolicy",
")",
";",
"}",
"}"
] | This sets the sharing policy in the sharingPolicy variable.
Included for forward compatibility with distributed caches.
@param The new sharing policy.
@ibm-private-in-use | [
"This",
"sets",
"the",
"sharing",
"policy",
"in",
"the",
"sharingPolicy",
"variable",
".",
"Included",
"for",
"forward",
"compatibility",
"with",
"distributed",
"caches",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/EntryInfo.java#L362-L371 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/EntryInfo.java | EntryInfo.setTimeLimit | public void setTimeLimit(int timeLimit) {
if (lock == SET) {
throw new IllegalStateException("EntryInfo is locked");
}
expirationTimeFlag = SET;
this.timeLimit = timeLimit;
if (timeLimit > 0) {
long ttlmsec = ((long)timeLimit) * 1000;
expirationTime = ttlmsec + System.currentTimeMillis();
}
} | java | public void setTimeLimit(int timeLimit) {
if (lock == SET) {
throw new IllegalStateException("EntryInfo is locked");
}
expirationTimeFlag = SET;
this.timeLimit = timeLimit;
if (timeLimit > 0) {
long ttlmsec = ((long)timeLimit) * 1000;
expirationTime = ttlmsec + System.currentTimeMillis();
}
} | [
"public",
"void",
"setTimeLimit",
"(",
"int",
"timeLimit",
")",
"{",
"if",
"(",
"lock",
"==",
"SET",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"EntryInfo is locked\"",
")",
";",
"}",
"expirationTimeFlag",
"=",
"SET",
";",
"this",
".",
"timeLimit",
"=",
"timeLimit",
";",
"if",
"(",
"timeLimit",
">",
"0",
")",
"{",
"long",
"ttlmsec",
"=",
"(",
"(",
"long",
")",
"timeLimit",
")",
"*",
"1000",
";",
"expirationTime",
"=",
"ttlmsec",
"+",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"}",
"}"
] | This sets the time limit in the timeLimit variable. Once an entry is cached,
it will remain in the cache for this many seconds
@param timeLimit This time limit.
@ibm-private-in-use | [
"This",
"sets",
"the",
"time",
"limit",
"in",
"the",
"timeLimit",
"variable",
".",
"Once",
"an",
"entry",
"is",
"cached",
"it",
"will",
"remain",
"in",
"the",
"cache",
"for",
"this",
"many",
"seconds"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/EntryInfo.java#L448-L458 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/EntryInfo.java | EntryInfo.getInactivity | public int getInactivity() { // CPF-Inactivity
if (com.ibm.ws.cache.TimeLimitDaemon.UNIT_TEST_INACTIVITY) {
System.out.println("EntryInfo.getInactivity() "+inactivity);
}
return inactivity;
} | java | public int getInactivity() { // CPF-Inactivity
if (com.ibm.ws.cache.TimeLimitDaemon.UNIT_TEST_INACTIVITY) {
System.out.println("EntryInfo.getInactivity() "+inactivity);
}
return inactivity;
} | [
"public",
"int",
"getInactivity",
"(",
")",
"{",
"// CPF-Inactivity",
"if",
"(",
"com",
".",
"ibm",
".",
"ws",
".",
"cache",
".",
"TimeLimitDaemon",
".",
"UNIT_TEST_INACTIVITY",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"EntryInfo.getInactivity() \"",
"+",
"inactivity",
")",
";",
"}",
"return",
"inactivity",
";",
"}"
] | This gets the inactivity timer for this cache entry.
@return the inactivity timer for this cache entry.
@ibm-private-in-use | [
"This",
"gets",
"the",
"inactivity",
"timer",
"for",
"this",
"cache",
"entry",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/EntryInfo.java#L465-L470 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/EntryInfo.java | EntryInfo.setInactivity | public void setInactivity(int inactivity) { // CPF-Inactivity
if (lock == SET) {
throw new IllegalStateException("EntryInfo is locked");
}
inactivityFlag = SET;
this.inactivity = inactivity; // Seconds
if (com.ibm.ws.cache.TimeLimitDaemon.UNIT_TEST_INACTIVITY) {
System.out.println("EntryInfo.setInactivity() "+inactivity);
}
} | java | public void setInactivity(int inactivity) { // CPF-Inactivity
if (lock == SET) {
throw new IllegalStateException("EntryInfo is locked");
}
inactivityFlag = SET;
this.inactivity = inactivity; // Seconds
if (com.ibm.ws.cache.TimeLimitDaemon.UNIT_TEST_INACTIVITY) {
System.out.println("EntryInfo.setInactivity() "+inactivity);
}
} | [
"public",
"void",
"setInactivity",
"(",
"int",
"inactivity",
")",
"{",
"// CPF-Inactivity",
"if",
"(",
"lock",
"==",
"SET",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"EntryInfo is locked\"",
")",
";",
"}",
"inactivityFlag",
"=",
"SET",
";",
"this",
".",
"inactivity",
"=",
"inactivity",
";",
"// Seconds",
"if",
"(",
"com",
".",
"ibm",
".",
"ws",
".",
"cache",
".",
"TimeLimitDaemon",
".",
"UNIT_TEST_INACTIVITY",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"EntryInfo.setInactivity() \"",
"+",
"inactivity",
")",
";",
"}",
"}"
] | This sets the inactivity timer variable. Once an entry is cached,
it will remain in the cache for this many seconds if not accessed.
@param inactivity This inactivity timer.
@ibm-private-in-use | [
"This",
"sets",
"the",
"inactivity",
"timer",
"variable",
".",
"Once",
"an",
"entry",
"is",
"cached",
"it",
"will",
"remain",
"in",
"the",
"cache",
"for",
"this",
"many",
"seconds",
"if",
"not",
"accessed",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/EntryInfo.java#L479-L488 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/EntryInfo.java | EntryInfo.setExpirationTime | public void setExpirationTime(long expirationTime) {
if (lock == SET) {
throw new IllegalStateException("EntryInfo is locked");
}
expirationTimeFlag = SET;
this.expirationTime = expirationTime;
this.timeLimit = (int) ((expirationTime - System.currentTimeMillis()) / 1000L);
} | java | public void setExpirationTime(long expirationTime) {
if (lock == SET) {
throw new IllegalStateException("EntryInfo is locked");
}
expirationTimeFlag = SET;
this.expirationTime = expirationTime;
this.timeLimit = (int) ((expirationTime - System.currentTimeMillis()) / 1000L);
} | [
"public",
"void",
"setExpirationTime",
"(",
"long",
"expirationTime",
")",
"{",
"if",
"(",
"lock",
"==",
"SET",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"EntryInfo is locked\"",
")",
";",
"}",
"expirationTimeFlag",
"=",
"SET",
";",
"this",
".",
"expirationTime",
"=",
"expirationTime",
";",
"this",
".",
"timeLimit",
"=",
"(",
"int",
")",
"(",
"(",
"expirationTime",
"-",
"System",
".",
"currentTimeMillis",
"(",
")",
")",
"/",
"1000L",
")",
";",
"}"
] | This sets the expirationTime variable.
@param The new expiration time.
@ibm-private-in-use | [
"This",
"sets",
"the",
"expirationTime",
"variable",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/EntryInfo.java#L506-L513 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/EntryInfo.java | EntryInfo.addTemplate | public void addTemplate(String template) {
if (lock == SET) {
throw new IllegalStateException("EntryInfo is locked");
}
if (template != null && !template.equals("")) {
templates.add(template);
}
} | java | public void addTemplate(String template) {
if (lock == SET) {
throw new IllegalStateException("EntryInfo is locked");
}
if (template != null && !template.equals("")) {
templates.add(template);
}
} | [
"public",
"void",
"addTemplate",
"(",
"String",
"template",
")",
"{",
"if",
"(",
"lock",
"==",
"SET",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"EntryInfo is locked\"",
")",
";",
"}",
"if",
"(",
"template",
"!=",
"null",
"&&",
"!",
"template",
".",
"equals",
"(",
"\"\"",
")",
")",
"{",
"templates",
".",
"add",
"(",
"template",
")",
";",
"}",
"}"
] | This adds a template name to the templates variable.
@param template The new template name.
@ibm-private-in-use | [
"This",
"adds",
"a",
"template",
"name",
"to",
"the",
"templates",
"variable",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/EntryInfo.java#L597-L604 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/EntryInfo.java | EntryInfo.addDataId | public void addDataId(Object dataId) {
if (lock == SET) {
throw new IllegalStateException("EntryInfo is locked");
}
if (dataId != null && !dataId.equals("")) {
dataIds.add(dataId);
}
} | java | public void addDataId(Object dataId) {
if (lock == SET) {
throw new IllegalStateException("EntryInfo is locked");
}
if (dataId != null && !dataId.equals("")) {
dataIds.add(dataId);
}
} | [
"public",
"void",
"addDataId",
"(",
"Object",
"dataId",
")",
"{",
"if",
"(",
"lock",
"==",
"SET",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"EntryInfo is locked\"",
")",
";",
"}",
"if",
"(",
"dataId",
"!=",
"null",
"&&",
"!",
"dataId",
".",
"equals",
"(",
"\"\"",
")",
")",
"{",
"dataIds",
".",
"add",
"(",
"dataId",
")",
";",
"}",
"}"
] | This unions a new data id into the dataIds variable.
@param dataId The new data id.
@ibm-private-in-use | [
"This",
"unions",
"a",
"new",
"data",
"id",
"into",
"the",
"dataIds",
"variable",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/EntryInfo.java#L632-L639 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/EntryInfo.java | EntryInfo.addAlias | public void addAlias(Object alias) {
if (lock == SET) {
throw new IllegalStateException("EntryInfo is locked");
}
if (alias != null && !alias.equals("")) {
aliasList.add(alias);
}
} | java | public void addAlias(Object alias) {
if (lock == SET) {
throw new IllegalStateException("EntryInfo is locked");
}
if (alias != null && !alias.equals("")) {
aliasList.add(alias);
}
} | [
"public",
"void",
"addAlias",
"(",
"Object",
"alias",
")",
"{",
"if",
"(",
"lock",
"==",
"SET",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"EntryInfo is locked\"",
")",
";",
"}",
"if",
"(",
"alias",
"!=",
"null",
"&&",
"!",
"alias",
".",
"equals",
"(",
"\"\"",
")",
")",
"{",
"aliasList",
".",
"add",
"(",
"alias",
")",
";",
"}",
"}"
] | This unions a new alias into the aliasList variable.
@param alias The new alias.
@ibm-private-in-use | [
"This",
"unions",
"a",
"new",
"alias",
"into",
"the",
"aliasList",
"variable",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/EntryInfo.java#L713-L720 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.service.location/src/com/ibm/ws/kernel/service/location/internal/Activator.java | Activator.shutdownFramework | @FFDCIgnore(Exception.class)
protected final void shutdownFramework() {
try {
Bundle bundle = context.getBundle(Constants.SYSTEM_BUNDLE_LOCATION);
if (bundle != null)
bundle.stop();
} catch (Exception e) {
// Exception could happen here if bundle context is bad, or system bundle
// is already stopping: not an exceptional condition, as we
// want to shutdown anyway.
}
} | java | @FFDCIgnore(Exception.class)
protected final void shutdownFramework() {
try {
Bundle bundle = context.getBundle(Constants.SYSTEM_BUNDLE_LOCATION);
if (bundle != null)
bundle.stop();
} catch (Exception e) {
// Exception could happen here if bundle context is bad, or system bundle
// is already stopping: not an exceptional condition, as we
// want to shutdown anyway.
}
} | [
"@",
"FFDCIgnore",
"(",
"Exception",
".",
"class",
")",
"protected",
"final",
"void",
"shutdownFramework",
"(",
")",
"{",
"try",
"{",
"Bundle",
"bundle",
"=",
"context",
".",
"getBundle",
"(",
"Constants",
".",
"SYSTEM_BUNDLE_LOCATION",
")",
";",
"if",
"(",
"bundle",
"!=",
"null",
")",
"bundle",
".",
"stop",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"// Exception could happen here if bundle context is bad, or system bundle",
"// is already stopping: not an exceptional condition, as we",
"// want to shutdown anyway.",
"}",
"}"
] | When an error occurs during startup,
then this method is used to stop the root bundle thus bringing down the
OSGi framework. | [
"When",
"an",
"error",
"occurs",
"during",
"startup",
"then",
"this",
"method",
"is",
"used",
"to",
"stop",
"the",
"root",
"bundle",
"thus",
"bringing",
"down",
"the",
"OSGi",
"framework",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.service.location/src/com/ibm/ws/kernel/service/location/internal/Activator.java#L107-L118 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/RoutingPathList.java | RoutingPathList.getNames | List<String> getNames() {
if (addrList == null)
return jmfNames;
// Create a readonly list that extracts the 'names' information from the main list
return new AbstractList<String>() {
public int size() {
return addrList.size();
}
public String get(int index) {
return ((JsDestinationAddress)addrList.get(index)).getDestinationName();
}
};
} | java | List<String> getNames() {
if (addrList == null)
return jmfNames;
// Create a readonly list that extracts the 'names' information from the main list
return new AbstractList<String>() {
public int size() {
return addrList.size();
}
public String get(int index) {
return ((JsDestinationAddress)addrList.get(index)).getDestinationName();
}
};
} | [
"List",
"<",
"String",
">",
"getNames",
"(",
")",
"{",
"if",
"(",
"addrList",
"==",
"null",
")",
"return",
"jmfNames",
";",
"// Create a readonly list that extracts the 'names' information from the main list",
"return",
"new",
"AbstractList",
"<",
"String",
">",
"(",
")",
"{",
"public",
"int",
"size",
"(",
")",
"{",
"return",
"addrList",
".",
"size",
"(",
")",
";",
"}",
"public",
"String",
"get",
"(",
"int",
"index",
")",
"{",
"return",
"(",
"(",
"JsDestinationAddress",
")",
"addrList",
".",
"get",
"(",
"index",
")",
")",
".",
"getDestinationName",
"(",
")",
";",
"}",
"}",
";",
"}"
] | measurements may show otherwise. | [
"measurements",
"may",
"show",
"otherwise",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/RoutingPathList.java#L128-L141 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.readInt | public int readInt(InputStream in) throws ConversionException, IOException {
JSONArray json = parseArray(in);
if (json.size() != 1) {
throwConversionException("readInt() expects one item in the array: [ Integer ].", json);
}
return readIntInternal(json.get(0));
} | java | public int readInt(InputStream in) throws ConversionException, IOException {
JSONArray json = parseArray(in);
if (json.size() != 1) {
throwConversionException("readInt() expects one item in the array: [ Integer ].", json);
}
return readIntInternal(json.get(0));
} | [
"public",
"int",
"readInt",
"(",
"InputStream",
"in",
")",
"throws",
"ConversionException",
",",
"IOException",
"{",
"JSONArray",
"json",
"=",
"parseArray",
"(",
"in",
")",
";",
"if",
"(",
"json",
".",
"size",
"(",
")",
"!=",
"1",
")",
"{",
"throwConversionException",
"(",
"\"readInt() expects one item in the array: [ Integer ].\"",
",",
"json",
")",
";",
"}",
"return",
"readIntInternal",
"(",
"json",
".",
"get",
"(",
"0",
")",
")",
";",
"}"
] | Decode a JSON document to retrieve an integer value.
@param in The stream to read JSON from
@return The decoded integer value
@throws ConversionException If JSON uses unexpected structure/format
@throws IOException If an I/O error occurs or if JSON is ill-formed.
@see #writeInt(OutputStream, int) | [
"Decode",
"a",
"JSON",
"document",
"to",
"retrieve",
"an",
"integer",
"value",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L697-L703 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.readBoolean | public boolean readBoolean(InputStream in) throws ConversionException, IOException {
JSONArray json = parseArray(in);
if (json.size() != 1) {
throwConversionException("readBoolean() expects one item in the array: [ true | false ].", json);
}
return readBooleanInternal(json.get(0));
} | java | public boolean readBoolean(InputStream in) throws ConversionException, IOException {
JSONArray json = parseArray(in);
if (json.size() != 1) {
throwConversionException("readBoolean() expects one item in the array: [ true | false ].", json);
}
return readBooleanInternal(json.get(0));
} | [
"public",
"boolean",
"readBoolean",
"(",
"InputStream",
"in",
")",
"throws",
"ConversionException",
",",
"IOException",
"{",
"JSONArray",
"json",
"=",
"parseArray",
"(",
"in",
")",
";",
"if",
"(",
"json",
".",
"size",
"(",
")",
"!=",
"1",
")",
"{",
"throwConversionException",
"(",
"\"readBoolean() expects one item in the array: [ true | false ].\"",
",",
"json",
")",
";",
"}",
"return",
"readBooleanInternal",
"(",
"json",
".",
"get",
"(",
"0",
")",
")",
";",
"}"
] | Decode a JSON document to retrieve an boolean value.
@param in The stream to read JSON from
@return The decoded boolean value
@throws ConversionException If JSON uses unexpected structure/format
@throws IOException If an I/O error occurs or if JSON is ill-formed.
@see #writeInt(OutputStream, int) | [
"Decode",
"a",
"JSON",
"document",
"to",
"retrieve",
"an",
"boolean",
"value",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L729-L735 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.readString | public String readString(InputStream in) throws ConversionException, IOException {
JSONArray json = parseArray(in);
if (json.size() != 1) {
throwConversionException("readString() expects one item in the array: [ String ].", json);
}
return readStringInternal(json.get(0));
} | java | public String readString(InputStream in) throws ConversionException, IOException {
JSONArray json = parseArray(in);
if (json.size() != 1) {
throwConversionException("readString() expects one item in the array: [ String ].", json);
}
return readStringInternal(json.get(0));
} | [
"public",
"String",
"readString",
"(",
"InputStream",
"in",
")",
"throws",
"ConversionException",
",",
"IOException",
"{",
"JSONArray",
"json",
"=",
"parseArray",
"(",
"in",
")",
";",
"if",
"(",
"json",
".",
"size",
"(",
")",
"!=",
"1",
")",
"{",
"throwConversionException",
"(",
"\"readString() expects one item in the array: [ String ].\"",
",",
"json",
")",
";",
"}",
"return",
"readStringInternal",
"(",
"json",
".",
"get",
"(",
"0",
")",
")",
";",
"}"
] | Decode a JSON document to retrieve a String value.
@param in The stream to read JSON from
@return The decoded String value
@throws ConversionException If JSON uses unexpected structure/format
@throws IOException If an I/O error occurs or if JSON is ill-formed.
@see #writeString(OutputStream, String) | [
"Decode",
"a",
"JSON",
"document",
"to",
"retrieve",
"a",
"String",
"value",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L761-L767 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.readPOJO | public Object readPOJO(InputStream in) throws ConversionException, IOException, ClassNotFoundException {
return readPOJOInternal(parse(in));
} | java | public Object readPOJO(InputStream in) throws ConversionException, IOException, ClassNotFoundException {
return readPOJOInternal(parse(in));
} | [
"public",
"Object",
"readPOJO",
"(",
"InputStream",
"in",
")",
"throws",
"ConversionException",
",",
"IOException",
",",
"ClassNotFoundException",
"{",
"return",
"readPOJOInternal",
"(",
"parse",
"(",
"in",
")",
")",
";",
"}"
] | Decode a JSON document to retrieve an Object.
@param in The stream to read JSON from
@return The decoded Object
@throws ConversionException If JSON uses unexpected structure/format
@throws IOException If an I/O error occurs or if JSON is ill-formed.
@throws ClassNotFoundException If needed class can't be found.
@see #writePOJO(OutputStream, Object) | [
"Decode",
"a",
"JSON",
"document",
"to",
"retrieve",
"an",
"Object",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L941-L943 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.readJMX | public JMXServerInfo readJMX(InputStream in) throws ConversionException, IOException {
JSONObject json = parseObject(in);
JMXServerInfo ret = new JMXServerInfo();
ret.version = readIntInternal(json.get(N_VERSION));
ret.mbeansURL = readStringInternal(json.get(N_MBEANS));
ret.createMBeanURL = readStringInternal(json.get(N_CREATEMBEAN));
ret.mbeanCountURL = readStringInternal(json.get(N_MBEANCOUNT));
ret.defaultDomainURL = readStringInternal(json.get(N_DEFAULTDOMAIN));
ret.domainsURL = readStringInternal(json.get(N_DOMAINS));
ret.notificationsURL = readStringInternal(json.get(N_NOTIFICATIONS));
ret.instanceOfURL = readStringInternal(json.get(N_INSTANCEOF));
ret.fileTransferURL = readStringInternal(json.get(N_FILE_TRANSFER));
ret.apiURL = readStringInternal(json.get(N_API));
ret.graphURL = readStringInternal(json.get(N_GRAPH));
return ret;
} | java | public JMXServerInfo readJMX(InputStream in) throws ConversionException, IOException {
JSONObject json = parseObject(in);
JMXServerInfo ret = new JMXServerInfo();
ret.version = readIntInternal(json.get(N_VERSION));
ret.mbeansURL = readStringInternal(json.get(N_MBEANS));
ret.createMBeanURL = readStringInternal(json.get(N_CREATEMBEAN));
ret.mbeanCountURL = readStringInternal(json.get(N_MBEANCOUNT));
ret.defaultDomainURL = readStringInternal(json.get(N_DEFAULTDOMAIN));
ret.domainsURL = readStringInternal(json.get(N_DOMAINS));
ret.notificationsURL = readStringInternal(json.get(N_NOTIFICATIONS));
ret.instanceOfURL = readStringInternal(json.get(N_INSTANCEOF));
ret.fileTransferURL = readStringInternal(json.get(N_FILE_TRANSFER));
ret.apiURL = readStringInternal(json.get(N_API));
ret.graphURL = readStringInternal(json.get(N_GRAPH));
return ret;
} | [
"public",
"JMXServerInfo",
"readJMX",
"(",
"InputStream",
"in",
")",
"throws",
"ConversionException",
",",
"IOException",
"{",
"JSONObject",
"json",
"=",
"parseObject",
"(",
"in",
")",
";",
"JMXServerInfo",
"ret",
"=",
"new",
"JMXServerInfo",
"(",
")",
";",
"ret",
".",
"version",
"=",
"readIntInternal",
"(",
"json",
".",
"get",
"(",
"N_VERSION",
")",
")",
";",
"ret",
".",
"mbeansURL",
"=",
"readStringInternal",
"(",
"json",
".",
"get",
"(",
"N_MBEANS",
")",
")",
";",
"ret",
".",
"createMBeanURL",
"=",
"readStringInternal",
"(",
"json",
".",
"get",
"(",
"N_CREATEMBEAN",
")",
")",
";",
"ret",
".",
"mbeanCountURL",
"=",
"readStringInternal",
"(",
"json",
".",
"get",
"(",
"N_MBEANCOUNT",
")",
")",
";",
"ret",
".",
"defaultDomainURL",
"=",
"readStringInternal",
"(",
"json",
".",
"get",
"(",
"N_DEFAULTDOMAIN",
")",
")",
";",
"ret",
".",
"domainsURL",
"=",
"readStringInternal",
"(",
"json",
".",
"get",
"(",
"N_DOMAINS",
")",
")",
";",
"ret",
".",
"notificationsURL",
"=",
"readStringInternal",
"(",
"json",
".",
"get",
"(",
"N_NOTIFICATIONS",
")",
")",
";",
"ret",
".",
"instanceOfURL",
"=",
"readStringInternal",
"(",
"json",
".",
"get",
"(",
"N_INSTANCEOF",
")",
")",
";",
"ret",
".",
"fileTransferURL",
"=",
"readStringInternal",
"(",
"json",
".",
"get",
"(",
"N_FILE_TRANSFER",
")",
")",
";",
"ret",
".",
"apiURL",
"=",
"readStringInternal",
"(",
"json",
".",
"get",
"(",
"N_API",
")",
")",
";",
"ret",
".",
"graphURL",
"=",
"readStringInternal",
"(",
"json",
".",
"get",
"(",
"N_GRAPH",
")",
")",
";",
"return",
"ret",
";",
"}"
] | Decode a JSON document to retrieve a JMX instance.
@param in The stream to read JSON from
@return The decoded JMX instance
@throws ConversionException If JSON uses unexpected structure/format
@throws IOException If an I/O error occurs or if JSON is ill-formed.
@see #writeJMX(OutputStream, JMXServerInfo) | [
"Decode",
"a",
"JSON",
"document",
"to",
"retrieve",
"a",
"JMX",
"instance",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L988-L1003 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.readObjectInstances | public ObjectInstanceWrapper[] readObjectInstances(InputStream in) throws ConversionException, IOException {
JSONArray json = parseArray(in);
ObjectInstanceWrapper[] ret = new ObjectInstanceWrapper[json.size()];
int pos = 0;
for (Object item : json) {
ret[pos++] = readObjectInstanceInternal(item);
}
return ret;
} | java | public ObjectInstanceWrapper[] readObjectInstances(InputStream in) throws ConversionException, IOException {
JSONArray json = parseArray(in);
ObjectInstanceWrapper[] ret = new ObjectInstanceWrapper[json.size()];
int pos = 0;
for (Object item : json) {
ret[pos++] = readObjectInstanceInternal(item);
}
return ret;
} | [
"public",
"ObjectInstanceWrapper",
"[",
"]",
"readObjectInstances",
"(",
"InputStream",
"in",
")",
"throws",
"ConversionException",
",",
"IOException",
"{",
"JSONArray",
"json",
"=",
"parseArray",
"(",
"in",
")",
";",
"ObjectInstanceWrapper",
"[",
"]",
"ret",
"=",
"new",
"ObjectInstanceWrapper",
"[",
"json",
".",
"size",
"(",
")",
"]",
";",
"int",
"pos",
"=",
"0",
";",
"for",
"(",
"Object",
"item",
":",
"json",
")",
"{",
"ret",
"[",
"pos",
"++",
"]",
"=",
"readObjectInstanceInternal",
"(",
"item",
")",
";",
"}",
"return",
"ret",
";",
"}"
] | Decode a JSON document to retrieve an ObjectInstanceWrapper array.
@param in The stream to read JSON from
@return The decoded ObjectInstanceWrapper array
@throws ConversionException If JSON uses unexpected structure/format
@throws IOException If an I/O error occurs or if JSON is ill-formed.
@see #writeObjectInstanceArray(OutputStream, ObjectInstanceWrapper[])
@see #readObjectInstance(InputStream) | [
"Decode",
"a",
"JSON",
"document",
"to",
"retrieve",
"an",
"ObjectInstanceWrapper",
"array",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L1071-L1079 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.readMBeanQuery | public MBeanQuery readMBeanQuery(InputStream in) throws ConversionException, IOException, ClassNotFoundException {
JSONObject json = parseObject(in);
MBeanQuery ret = new MBeanQuery();
ret.objectName = readObjectName(json.get(N_OBJECTNAME));
Object queryExp = readSerialized(json.get(N_QUERYEXP));
if (queryExp != null && !(queryExp instanceof QueryExp)) {
throwConversionException("readMBeanQuery() receives an instance that's not a QueryExp.", json.get(N_QUERYEXP));
}
ret.queryExp = (QueryExp) queryExp;
ret.className = readStringInternal(json.get(N_CLASSNAME));
return ret;
} | java | public MBeanQuery readMBeanQuery(InputStream in) throws ConversionException, IOException, ClassNotFoundException {
JSONObject json = parseObject(in);
MBeanQuery ret = new MBeanQuery();
ret.objectName = readObjectName(json.get(N_OBJECTNAME));
Object queryExp = readSerialized(json.get(N_QUERYEXP));
if (queryExp != null && !(queryExp instanceof QueryExp)) {
throwConversionException("readMBeanQuery() receives an instance that's not a QueryExp.", json.get(N_QUERYEXP));
}
ret.queryExp = (QueryExp) queryExp;
ret.className = readStringInternal(json.get(N_CLASSNAME));
return ret;
} | [
"public",
"MBeanQuery",
"readMBeanQuery",
"(",
"InputStream",
"in",
")",
"throws",
"ConversionException",
",",
"IOException",
",",
"ClassNotFoundException",
"{",
"JSONObject",
"json",
"=",
"parseObject",
"(",
"in",
")",
";",
"MBeanQuery",
"ret",
"=",
"new",
"MBeanQuery",
"(",
")",
";",
"ret",
".",
"objectName",
"=",
"readObjectName",
"(",
"json",
".",
"get",
"(",
"N_OBJECTNAME",
")",
")",
";",
"Object",
"queryExp",
"=",
"readSerialized",
"(",
"json",
".",
"get",
"(",
"N_QUERYEXP",
")",
")",
";",
"if",
"(",
"queryExp",
"!=",
"null",
"&&",
"!",
"(",
"queryExp",
"instanceof",
"QueryExp",
")",
")",
"{",
"throwConversionException",
"(",
"\"readMBeanQuery() receives an instance that's not a QueryExp.\"",
",",
"json",
".",
"get",
"(",
"N_QUERYEXP",
")",
")",
";",
"}",
"ret",
".",
"queryExp",
"=",
"(",
"QueryExp",
")",
"queryExp",
";",
"ret",
".",
"className",
"=",
"readStringInternal",
"(",
"json",
".",
"get",
"(",
"N_CLASSNAME",
")",
")",
";",
"return",
"ret",
";",
"}"
] | Decode a JSON document to retrieve an MBeanQuery instance.
@param in The stream to read JSON from
@return The decoded MBeanQuery instance
@throws ConversionException If JSON uses unexpected structure/format
@throws IOException If an I/O error occurs or if JSON is ill-formed.
@throws ClassNotFoundException If needed class can't be found.
@see #writeMBeanQuery(OutputStream, MBeanQuery) | [
"Decode",
"a",
"JSON",
"document",
"to",
"retrieve",
"an",
"MBeanQuery",
"instance",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L1113-L1124 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.readCreateMBean | public CreateMBean readCreateMBean(InputStream in) throws ConversionException, IOException, ClassNotFoundException {
JSONObject json = parseObject(in);
CreateMBean ret = new CreateMBean();
ret.objectName = readObjectName(json.get(N_OBJECTNAME));
ret.className = readStringInternal(json.get(N_CLASSNAME));
ret.loaderName = readObjectName(json.get(N_LOADERNAME));
ret.params = readPOJOArray(json.get(N_PARAMS));
ret.signature = readStringArrayInternal(json.get(N_SIGNATURE));
ret.useLoader = readBooleanInternal(json.get(N_USELOADER));
ret.useSignature = readBooleanInternal(json.get(N_USESIGNATURE));
return ret;
} | java | public CreateMBean readCreateMBean(InputStream in) throws ConversionException, IOException, ClassNotFoundException {
JSONObject json = parseObject(in);
CreateMBean ret = new CreateMBean();
ret.objectName = readObjectName(json.get(N_OBJECTNAME));
ret.className = readStringInternal(json.get(N_CLASSNAME));
ret.loaderName = readObjectName(json.get(N_LOADERNAME));
ret.params = readPOJOArray(json.get(N_PARAMS));
ret.signature = readStringArrayInternal(json.get(N_SIGNATURE));
ret.useLoader = readBooleanInternal(json.get(N_USELOADER));
ret.useSignature = readBooleanInternal(json.get(N_USESIGNATURE));
return ret;
} | [
"public",
"CreateMBean",
"readCreateMBean",
"(",
"InputStream",
"in",
")",
"throws",
"ConversionException",
",",
"IOException",
",",
"ClassNotFoundException",
"{",
"JSONObject",
"json",
"=",
"parseObject",
"(",
"in",
")",
";",
"CreateMBean",
"ret",
"=",
"new",
"CreateMBean",
"(",
")",
";",
"ret",
".",
"objectName",
"=",
"readObjectName",
"(",
"json",
".",
"get",
"(",
"N_OBJECTNAME",
")",
")",
";",
"ret",
".",
"className",
"=",
"readStringInternal",
"(",
"json",
".",
"get",
"(",
"N_CLASSNAME",
")",
")",
";",
"ret",
".",
"loaderName",
"=",
"readObjectName",
"(",
"json",
".",
"get",
"(",
"N_LOADERNAME",
")",
")",
";",
"ret",
".",
"params",
"=",
"readPOJOArray",
"(",
"json",
".",
"get",
"(",
"N_PARAMS",
")",
")",
";",
"ret",
".",
"signature",
"=",
"readStringArrayInternal",
"(",
"json",
".",
"get",
"(",
"N_SIGNATURE",
")",
")",
";",
"ret",
".",
"useLoader",
"=",
"readBooleanInternal",
"(",
"json",
".",
"get",
"(",
"N_USELOADER",
")",
")",
";",
"ret",
".",
"useSignature",
"=",
"readBooleanInternal",
"(",
"json",
".",
"get",
"(",
"N_USESIGNATURE",
")",
")",
";",
"return",
"ret",
";",
"}"
] | Decode a JSON document to retrieve a CreateMBean instance.
@param in The stream to read JSON from
@return The decoded CreateMBean instance
@throws ConversionException If JSON uses unexpected structure/format
@throws IOException If an I/O error occurs or if JSON is ill-formed.
@throws ClassNotFoundException If needed class can't be found.
@see #writeCreateMBean(OutputStream, CreateMBean) | [
"Decode",
"a",
"JSON",
"document",
"to",
"retrieve",
"a",
"CreateMBean",
"instance",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L1165-L1176 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.readMBeanInfo | @SuppressWarnings("unchecked")
public MBeanInfoWrapper readMBeanInfo(InputStream in) throws ConversionException, IOException, ClassNotFoundException {
JSONObject json = parseObject(in);
MBeanInfoWrapper ret = new MBeanInfoWrapper();
if (USE_BASE64_FOR_MBEANINFO) {
Object o = readSerialized(json.get(N_SERIALIZED));
if (!(o instanceof MBeanInfo)) {
throwConversionException("readMBeanInfo() receives an instance that's not a MBeanInfo.", json.get(N_SERIALIZED));
}
ret.mbeanInfo = (MBeanInfo) o;
ret.attributesURL = readStringInternal(json.get(N_ATTRIBUTES_URL));
o = readSerialized(json.get(OM_ATTRIBUTES));
if (!(o instanceof HashMap)) {
throwConversionException("readMBeanInfo() receives an instance that's not a HashMap.", json.get(OM_ATTRIBUTES));
}
ret.attributeURLs = (Map<String, String>) o;
o = readSerialized(json.get(OM_OPERATIONS));
if (!(o instanceof HashMap)) {
throwConversionException("readMBeanInfo() receives an instance that's not a HashMap.", json.get(OM_OPERATIONS));
}
ret.operationURLs = (Map<String, String>) o;
return ret;
}
ret.attributeURLs = new HashMap<String, String>();
ret.operationURLs = new HashMap<String, String>();
String className = readStringInternal(json.get(N_CLASSNAME));
String description = readStringInternal(json.get(N_DESCRIPTION));
Descriptor descriptor = readDescriptor(json.get(N_DESCRIPTOR));
MBeanAttributeInfo[] attributes = readAttributes(json.get(N_ATTRIBUTES), ret.attributeURLs);
String attributeURL = readStringInternal(json.get(N_ATTRIBUTES_URL));
MBeanConstructorInfo[] constructors = readConstructors(json.get(N_CONSTRUCTORS));
MBeanNotificationInfo[] notifications = readNotifications(json.get(N_NOTIFICATIONS));
MBeanOperationInfo[] operations = readOperations(json.get(N_OPERATIONS), ret.operationURLs);
ret.attributesURL = attributeURL;
Object o = json.get(N_SERIALIZED);
if (o != null) {
o = readSerialized(o);
if (!(o instanceof MBeanInfo)) {
throwConversionException("readMBeanInfo() receives an instance that's not a MBeanInfo.", json.get(N_SERIALIZED));
}
ret.mbeanInfo = (MBeanInfo) o;
} else {
ret.mbeanInfo = new MBeanInfo(className, description, attributes, constructors, operations, notifications, descriptor);
}
return ret;
} | java | @SuppressWarnings("unchecked")
public MBeanInfoWrapper readMBeanInfo(InputStream in) throws ConversionException, IOException, ClassNotFoundException {
JSONObject json = parseObject(in);
MBeanInfoWrapper ret = new MBeanInfoWrapper();
if (USE_BASE64_FOR_MBEANINFO) {
Object o = readSerialized(json.get(N_SERIALIZED));
if (!(o instanceof MBeanInfo)) {
throwConversionException("readMBeanInfo() receives an instance that's not a MBeanInfo.", json.get(N_SERIALIZED));
}
ret.mbeanInfo = (MBeanInfo) o;
ret.attributesURL = readStringInternal(json.get(N_ATTRIBUTES_URL));
o = readSerialized(json.get(OM_ATTRIBUTES));
if (!(o instanceof HashMap)) {
throwConversionException("readMBeanInfo() receives an instance that's not a HashMap.", json.get(OM_ATTRIBUTES));
}
ret.attributeURLs = (Map<String, String>) o;
o = readSerialized(json.get(OM_OPERATIONS));
if (!(o instanceof HashMap)) {
throwConversionException("readMBeanInfo() receives an instance that's not a HashMap.", json.get(OM_OPERATIONS));
}
ret.operationURLs = (Map<String, String>) o;
return ret;
}
ret.attributeURLs = new HashMap<String, String>();
ret.operationURLs = new HashMap<String, String>();
String className = readStringInternal(json.get(N_CLASSNAME));
String description = readStringInternal(json.get(N_DESCRIPTION));
Descriptor descriptor = readDescriptor(json.get(N_DESCRIPTOR));
MBeanAttributeInfo[] attributes = readAttributes(json.get(N_ATTRIBUTES), ret.attributeURLs);
String attributeURL = readStringInternal(json.get(N_ATTRIBUTES_URL));
MBeanConstructorInfo[] constructors = readConstructors(json.get(N_CONSTRUCTORS));
MBeanNotificationInfo[] notifications = readNotifications(json.get(N_NOTIFICATIONS));
MBeanOperationInfo[] operations = readOperations(json.get(N_OPERATIONS), ret.operationURLs);
ret.attributesURL = attributeURL;
Object o = json.get(N_SERIALIZED);
if (o != null) {
o = readSerialized(o);
if (!(o instanceof MBeanInfo)) {
throwConversionException("readMBeanInfo() receives an instance that's not a MBeanInfo.", json.get(N_SERIALIZED));
}
ret.mbeanInfo = (MBeanInfo) o;
} else {
ret.mbeanInfo = new MBeanInfo(className, description, attributes, constructors, operations, notifications, descriptor);
}
return ret;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"MBeanInfoWrapper",
"readMBeanInfo",
"(",
"InputStream",
"in",
")",
"throws",
"ConversionException",
",",
"IOException",
",",
"ClassNotFoundException",
"{",
"JSONObject",
"json",
"=",
"parseObject",
"(",
"in",
")",
";",
"MBeanInfoWrapper",
"ret",
"=",
"new",
"MBeanInfoWrapper",
"(",
")",
";",
"if",
"(",
"USE_BASE64_FOR_MBEANINFO",
")",
"{",
"Object",
"o",
"=",
"readSerialized",
"(",
"json",
".",
"get",
"(",
"N_SERIALIZED",
")",
")",
";",
"if",
"(",
"!",
"(",
"o",
"instanceof",
"MBeanInfo",
")",
")",
"{",
"throwConversionException",
"(",
"\"readMBeanInfo() receives an instance that's not a MBeanInfo.\"",
",",
"json",
".",
"get",
"(",
"N_SERIALIZED",
")",
")",
";",
"}",
"ret",
".",
"mbeanInfo",
"=",
"(",
"MBeanInfo",
")",
"o",
";",
"ret",
".",
"attributesURL",
"=",
"readStringInternal",
"(",
"json",
".",
"get",
"(",
"N_ATTRIBUTES_URL",
")",
")",
";",
"o",
"=",
"readSerialized",
"(",
"json",
".",
"get",
"(",
"OM_ATTRIBUTES",
")",
")",
";",
"if",
"(",
"!",
"(",
"o",
"instanceof",
"HashMap",
")",
")",
"{",
"throwConversionException",
"(",
"\"readMBeanInfo() receives an instance that's not a HashMap.\"",
",",
"json",
".",
"get",
"(",
"OM_ATTRIBUTES",
")",
")",
";",
"}",
"ret",
".",
"attributeURLs",
"=",
"(",
"Map",
"<",
"String",
",",
"String",
">",
")",
"o",
";",
"o",
"=",
"readSerialized",
"(",
"json",
".",
"get",
"(",
"OM_OPERATIONS",
")",
")",
";",
"if",
"(",
"!",
"(",
"o",
"instanceof",
"HashMap",
")",
")",
"{",
"throwConversionException",
"(",
"\"readMBeanInfo() receives an instance that's not a HashMap.\"",
",",
"json",
".",
"get",
"(",
"OM_OPERATIONS",
")",
")",
";",
"}",
"ret",
".",
"operationURLs",
"=",
"(",
"Map",
"<",
"String",
",",
"String",
">",
")",
"o",
";",
"return",
"ret",
";",
"}",
"ret",
".",
"attributeURLs",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"ret",
".",
"operationURLs",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"String",
"className",
"=",
"readStringInternal",
"(",
"json",
".",
"get",
"(",
"N_CLASSNAME",
")",
")",
";",
"String",
"description",
"=",
"readStringInternal",
"(",
"json",
".",
"get",
"(",
"N_DESCRIPTION",
")",
")",
";",
"Descriptor",
"descriptor",
"=",
"readDescriptor",
"(",
"json",
".",
"get",
"(",
"N_DESCRIPTOR",
")",
")",
";",
"MBeanAttributeInfo",
"[",
"]",
"attributes",
"=",
"readAttributes",
"(",
"json",
".",
"get",
"(",
"N_ATTRIBUTES",
")",
",",
"ret",
".",
"attributeURLs",
")",
";",
"String",
"attributeURL",
"=",
"readStringInternal",
"(",
"json",
".",
"get",
"(",
"N_ATTRIBUTES_URL",
")",
")",
";",
"MBeanConstructorInfo",
"[",
"]",
"constructors",
"=",
"readConstructors",
"(",
"json",
".",
"get",
"(",
"N_CONSTRUCTORS",
")",
")",
";",
"MBeanNotificationInfo",
"[",
"]",
"notifications",
"=",
"readNotifications",
"(",
"json",
".",
"get",
"(",
"N_NOTIFICATIONS",
")",
")",
";",
"MBeanOperationInfo",
"[",
"]",
"operations",
"=",
"readOperations",
"(",
"json",
".",
"get",
"(",
"N_OPERATIONS",
")",
",",
"ret",
".",
"operationURLs",
")",
";",
"ret",
".",
"attributesURL",
"=",
"attributeURL",
";",
"Object",
"o",
"=",
"json",
".",
"get",
"(",
"N_SERIALIZED",
")",
";",
"if",
"(",
"o",
"!=",
"null",
")",
"{",
"o",
"=",
"readSerialized",
"(",
"o",
")",
";",
"if",
"(",
"!",
"(",
"o",
"instanceof",
"MBeanInfo",
")",
")",
"{",
"throwConversionException",
"(",
"\"readMBeanInfo() receives an instance that's not a MBeanInfo.\"",
",",
"json",
".",
"get",
"(",
"N_SERIALIZED",
")",
")",
";",
"}",
"ret",
".",
"mbeanInfo",
"=",
"(",
"MBeanInfo",
")",
"o",
";",
"}",
"else",
"{",
"ret",
".",
"mbeanInfo",
"=",
"new",
"MBeanInfo",
"(",
"className",
",",
"description",
",",
"attributes",
",",
"constructors",
",",
"operations",
",",
"notifications",
",",
"descriptor",
")",
";",
"}",
"return",
"ret",
";",
"}"
] | Decode a JSON document to retrieve an MBeanInfoWrapper instance.
Note that all descriptors are of class ImmutableDescriptor.
@param in The stream to read JSON from
@return The decoded MBeanInfoWrapper instance
@throws ConversionException If JSON uses unexpected structure/format
@throws IOException If an I/O error occurs or if JSON is ill-formed.
@throws ClassNotFoundException If needed class can't be found.
@see #writeMBeanInfo(OutputStream, MBeanInfoWrapper) | [
"Decode",
"a",
"JSON",
"document",
"to",
"retrieve",
"an",
"MBeanInfoWrapper",
"instance",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L1290-L1335 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.readAttributeList | public AttributeList readAttributeList(InputStream in) throws ConversionException, IOException, ClassNotFoundException {
JSONArray json = parseArray(in);
AttributeList ret = new AttributeList();
for (Object item : json) {
if (!(item instanceof JSONObject)) {
throwConversionException("readAttributeList() receives an items that's not a JSONObject.", item);
}
JSONObject jo = (JSONObject) item;
String name = readStringInternal(jo.get(N_NAME));
Object value = readPOJOInternal(jo.get(N_VALUE));
ret.add(new Attribute(name, value));
}
return ret;
} | java | public AttributeList readAttributeList(InputStream in) throws ConversionException, IOException, ClassNotFoundException {
JSONArray json = parseArray(in);
AttributeList ret = new AttributeList();
for (Object item : json) {
if (!(item instanceof JSONObject)) {
throwConversionException("readAttributeList() receives an items that's not a JSONObject.", item);
}
JSONObject jo = (JSONObject) item;
String name = readStringInternal(jo.get(N_NAME));
Object value = readPOJOInternal(jo.get(N_VALUE));
ret.add(new Attribute(name, value));
}
return ret;
} | [
"public",
"AttributeList",
"readAttributeList",
"(",
"InputStream",
"in",
")",
"throws",
"ConversionException",
",",
"IOException",
",",
"ClassNotFoundException",
"{",
"JSONArray",
"json",
"=",
"parseArray",
"(",
"in",
")",
";",
"AttributeList",
"ret",
"=",
"new",
"AttributeList",
"(",
")",
";",
"for",
"(",
"Object",
"item",
":",
"json",
")",
"{",
"if",
"(",
"!",
"(",
"item",
"instanceof",
"JSONObject",
")",
")",
"{",
"throwConversionException",
"(",
"\"readAttributeList() receives an items that's not a JSONObject.\"",
",",
"item",
")",
";",
"}",
"JSONObject",
"jo",
"=",
"(",
"JSONObject",
")",
"item",
";",
"String",
"name",
"=",
"readStringInternal",
"(",
"jo",
".",
"get",
"(",
"N_NAME",
")",
")",
";",
"Object",
"value",
"=",
"readPOJOInternal",
"(",
"jo",
".",
"get",
"(",
"N_VALUE",
")",
")",
";",
"ret",
".",
"add",
"(",
"new",
"Attribute",
"(",
"name",
",",
"value",
")",
")",
";",
"}",
"return",
"ret",
";",
"}"
] | Decode a JSON document to retrieve an AttributeList instance.
@param in The stream to read JSON from
@return The decoded AttributeList instance
@throws ConversionException If JSON uses unexpected structure/format
@throws IOException If an I/O error occurs or if JSON is ill-formed.
@throws ClassNotFoundException If needed class can't be found.
@see #writeAttributeList(OutputStream, AttributeList) | [
"Decode",
"a",
"JSON",
"document",
"to",
"retrieve",
"an",
"AttributeList",
"instance",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L1375-L1388 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.readInvocation | public Invocation readInvocation(InputStream in) throws ConversionException, IOException, ClassNotFoundException {
JSONObject json = parseObject(in);
Invocation ret = new Invocation();
ret.params = readPOJOArray(json.get(N_PARAMS));
ret.signature = readStringArrayInternal(json.get(N_SIGNATURE));
return ret;
} | java | public Invocation readInvocation(InputStream in) throws ConversionException, IOException, ClassNotFoundException {
JSONObject json = parseObject(in);
Invocation ret = new Invocation();
ret.params = readPOJOArray(json.get(N_PARAMS));
ret.signature = readStringArrayInternal(json.get(N_SIGNATURE));
return ret;
} | [
"public",
"Invocation",
"readInvocation",
"(",
"InputStream",
"in",
")",
"throws",
"ConversionException",
",",
"IOException",
",",
"ClassNotFoundException",
"{",
"JSONObject",
"json",
"=",
"parseObject",
"(",
"in",
")",
";",
"Invocation",
"ret",
"=",
"new",
"Invocation",
"(",
")",
";",
"ret",
".",
"params",
"=",
"readPOJOArray",
"(",
"json",
".",
"get",
"(",
"N_PARAMS",
")",
")",
";",
"ret",
".",
"signature",
"=",
"readStringArrayInternal",
"(",
"json",
".",
"get",
"(",
"N_SIGNATURE",
")",
")",
";",
"return",
"ret",
";",
"}"
] | Decode a JSON document to retrieve an Invocation instance.
@param in The stream to read JSON from
@return The decoded Invocation instance
@throws ConversionException If JSON uses unexpected structure/format
@throws IOException If an I/O error occurs or if JSON is ill-formed.
@throws ClassNotFoundException If needed class can't be found.
@see #writeInvocation(OutputStream, Invocation) | [
"Decode",
"a",
"JSON",
"document",
"to",
"retrieve",
"an",
"Invocation",
"instance",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L1419-L1425 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.readNotificationArea | public NotificationArea readNotificationArea(InputStream in) throws ConversionException, IOException {
JSONObject json = parseObject(in);
NotificationArea ret = new NotificationArea();
ret.registrationsURL = readStringInternal(json.get(N_REGISTRATIONS));
ret.serverRegistrationsURL = readStringInternal(json.get(N_SERVERREGISTRATIONS));
ret.inboxURL = readStringInternal(json.get(N_INBOX));
ret.clientURL = readStringInternal(json.get(N_CLIENT));
return ret;
} | java | public NotificationArea readNotificationArea(InputStream in) throws ConversionException, IOException {
JSONObject json = parseObject(in);
NotificationArea ret = new NotificationArea();
ret.registrationsURL = readStringInternal(json.get(N_REGISTRATIONS));
ret.serverRegistrationsURL = readStringInternal(json.get(N_SERVERREGISTRATIONS));
ret.inboxURL = readStringInternal(json.get(N_INBOX));
ret.clientURL = readStringInternal(json.get(N_CLIENT));
return ret;
} | [
"public",
"NotificationArea",
"readNotificationArea",
"(",
"InputStream",
"in",
")",
"throws",
"ConversionException",
",",
"IOException",
"{",
"JSONObject",
"json",
"=",
"parseObject",
"(",
"in",
")",
";",
"NotificationArea",
"ret",
"=",
"new",
"NotificationArea",
"(",
")",
";",
"ret",
".",
"registrationsURL",
"=",
"readStringInternal",
"(",
"json",
".",
"get",
"(",
"N_REGISTRATIONS",
")",
")",
";",
"ret",
".",
"serverRegistrationsURL",
"=",
"readStringInternal",
"(",
"json",
".",
"get",
"(",
"N_SERVERREGISTRATIONS",
")",
")",
";",
"ret",
".",
"inboxURL",
"=",
"readStringInternal",
"(",
"json",
".",
"get",
"(",
"N_INBOX",
")",
")",
";",
"ret",
".",
"clientURL",
"=",
"readStringInternal",
"(",
"json",
".",
"get",
"(",
"N_CLIENT",
")",
")",
";",
"return",
"ret",
";",
"}"
] | Decode a JSON document to retrieve a NotificationArea instance.
@param in The stream to read JSON from
@return The decoded NotificationArea instance
@throws ConversionException If JSON uses unexpected structure/format
@throws IOException If an I/O error occurs or if JSON is ill-formed.
@see #writeNotificationArea(OutputStream, NotificationArea) | [
"Decode",
"a",
"JSON",
"document",
"to",
"retrieve",
"a",
"NotificationArea",
"instance",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L1458-L1466 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.readNotificationRegistration | public NotificationRegistration readNotificationRegistration(InputStream in) throws ConversionException, IOException, ClassNotFoundException {
JSONObject json = parseObject(in);
NotificationRegistration ret = new NotificationRegistration();
ret.objectName = readObjectName(json.get(N_OBJECTNAME));
ret.filters = readNotificationFiltersInternal(json.get(N_FILTERS));
return ret;
} | java | public NotificationRegistration readNotificationRegistration(InputStream in) throws ConversionException, IOException, ClassNotFoundException {
JSONObject json = parseObject(in);
NotificationRegistration ret = new NotificationRegistration();
ret.objectName = readObjectName(json.get(N_OBJECTNAME));
ret.filters = readNotificationFiltersInternal(json.get(N_FILTERS));
return ret;
} | [
"public",
"NotificationRegistration",
"readNotificationRegistration",
"(",
"InputStream",
"in",
")",
"throws",
"ConversionException",
",",
"IOException",
",",
"ClassNotFoundException",
"{",
"JSONObject",
"json",
"=",
"parseObject",
"(",
"in",
")",
";",
"NotificationRegistration",
"ret",
"=",
"new",
"NotificationRegistration",
"(",
")",
";",
"ret",
".",
"objectName",
"=",
"readObjectName",
"(",
"json",
".",
"get",
"(",
"N_OBJECTNAME",
")",
")",
";",
"ret",
".",
"filters",
"=",
"readNotificationFiltersInternal",
"(",
"json",
".",
"get",
"(",
"N_FILTERS",
")",
")",
";",
"return",
"ret",
";",
"}"
] | Decode a JSON document to retrieve a NotificationRegistration instance.
@param in The stream to read JSON from
@return The decoded NotificationRegistration instance
@throws ConversionException If JSON uses unexpected structure/format
@throws IOException If an I/O error occurs or if JSON is ill-formed.
@throws ClassNotFoundException If needed class can't be found.
@see #writeNotificationRegistration(OutputStream, NotificationRegistration) | [
"Decode",
"a",
"JSON",
"document",
"to",
"retrieve",
"a",
"NotificationRegistration",
"instance",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L1500-L1506 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.readServerNotificationRegistration | public ServerNotificationRegistration readServerNotificationRegistration(InputStream in) throws ConversionException, IOException, ClassNotFoundException {
JSONObject json = parseObject(in);
ServerNotificationRegistration ret = new ServerNotificationRegistration();
String name = readStringInternal(json.get(N_OPERATION));
ret.operation = name != null ? Operation.valueOf(name) : null;
ret.objectName = readObjectName(json.get(N_OBJECTNAME));
ret.listener = readObjectName(json.get(N_LISTENER));
ret.filter = readNotificationFilterInternal(json.get(N_FILTER), true);
ret.handback = readPOJOInternal(json.get(N_HANDBACK));
ret.filterID = readIntInternal(json.get(N_FILTERID));
ret.handbackID = readIntInternal(json.get(N_HANDBACKID));
return ret;
} | java | public ServerNotificationRegistration readServerNotificationRegistration(InputStream in) throws ConversionException, IOException, ClassNotFoundException {
JSONObject json = parseObject(in);
ServerNotificationRegistration ret = new ServerNotificationRegistration();
String name = readStringInternal(json.get(N_OPERATION));
ret.operation = name != null ? Operation.valueOf(name) : null;
ret.objectName = readObjectName(json.get(N_OBJECTNAME));
ret.listener = readObjectName(json.get(N_LISTENER));
ret.filter = readNotificationFilterInternal(json.get(N_FILTER), true);
ret.handback = readPOJOInternal(json.get(N_HANDBACK));
ret.filterID = readIntInternal(json.get(N_FILTERID));
ret.handbackID = readIntInternal(json.get(N_HANDBACKID));
return ret;
} | [
"public",
"ServerNotificationRegistration",
"readServerNotificationRegistration",
"(",
"InputStream",
"in",
")",
"throws",
"ConversionException",
",",
"IOException",
",",
"ClassNotFoundException",
"{",
"JSONObject",
"json",
"=",
"parseObject",
"(",
"in",
")",
";",
"ServerNotificationRegistration",
"ret",
"=",
"new",
"ServerNotificationRegistration",
"(",
")",
";",
"String",
"name",
"=",
"readStringInternal",
"(",
"json",
".",
"get",
"(",
"N_OPERATION",
")",
")",
";",
"ret",
".",
"operation",
"=",
"name",
"!=",
"null",
"?",
"Operation",
".",
"valueOf",
"(",
"name",
")",
":",
"null",
";",
"ret",
".",
"objectName",
"=",
"readObjectName",
"(",
"json",
".",
"get",
"(",
"N_OBJECTNAME",
")",
")",
";",
"ret",
".",
"listener",
"=",
"readObjectName",
"(",
"json",
".",
"get",
"(",
"N_LISTENER",
")",
")",
";",
"ret",
".",
"filter",
"=",
"readNotificationFilterInternal",
"(",
"json",
".",
"get",
"(",
"N_FILTER",
")",
",",
"true",
")",
";",
"ret",
".",
"handback",
"=",
"readPOJOInternal",
"(",
"json",
".",
"get",
"(",
"N_HANDBACK",
")",
")",
";",
"ret",
".",
"filterID",
"=",
"readIntInternal",
"(",
"json",
".",
"get",
"(",
"N_FILTERID",
")",
")",
";",
"ret",
".",
"handbackID",
"=",
"readIntInternal",
"(",
"json",
".",
"get",
"(",
"N_HANDBACKID",
")",
")",
";",
"return",
"ret",
";",
"}"
] | Decode a JSON document to retrieve a ServerNotificationRegistration instance.
@param in The stream to read JSON from
@return The decoded ServerNotificationRegistration instance
@throws ConversionException If JSON uses unexpected structure/format
@throws IOException If an I/O error occurs or if JSON is ill-formed.
@throws ClassNotFoundException If needed class can't be found.
@see #writeServerNotificationRegistration(OutputStream, ServerNotificationRegistration) | [
"Decode",
"a",
"JSON",
"document",
"to",
"retrieve",
"a",
"ServerNotificationRegistration",
"instance",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L1553-L1565 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.isSupportedNotificationFilter | public boolean isSupportedNotificationFilter(NotificationFilter filter) {
Class<?> clazz = filter.getClass();
return clazz == AttributeChangeNotificationFilter.class ||
clazz == MBeanServerNotificationFilter.class ||
clazz == NotificationFilterSupport.class;
} | java | public boolean isSupportedNotificationFilter(NotificationFilter filter) {
Class<?> clazz = filter.getClass();
return clazz == AttributeChangeNotificationFilter.class ||
clazz == MBeanServerNotificationFilter.class ||
clazz == NotificationFilterSupport.class;
} | [
"public",
"boolean",
"isSupportedNotificationFilter",
"(",
"NotificationFilter",
"filter",
")",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"filter",
".",
"getClass",
"(",
")",
";",
"return",
"clazz",
"==",
"AttributeChangeNotificationFilter",
".",
"class",
"||",
"clazz",
"==",
"MBeanServerNotificationFilter",
".",
"class",
"||",
"clazz",
"==",
"NotificationFilterSupport",
".",
"class",
";",
"}"
] | Check if a NotificationFilter is a standard filter that can be
send to a JMX server.
@param filter The filter to check. Can't be null.
@return Whether the filter is a standard one | [
"Check",
"if",
"a",
"NotificationFilter",
"is",
"a",
"standard",
"filter",
"that",
"can",
"be",
"send",
"to",
"a",
"JMX",
"server",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L1574-L1579 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.readNotificationFilters | public NotificationFilter[] readNotificationFilters(InputStream in) throws ConversionException, IOException, ClassNotFoundException {
return readNotificationFiltersInternal(parseArray(in));
} | java | public NotificationFilter[] readNotificationFilters(InputStream in) throws ConversionException, IOException, ClassNotFoundException {
return readNotificationFiltersInternal(parseArray(in));
} | [
"public",
"NotificationFilter",
"[",
"]",
"readNotificationFilters",
"(",
"InputStream",
"in",
")",
"throws",
"ConversionException",
",",
"IOException",
",",
"ClassNotFoundException",
"{",
"return",
"readNotificationFiltersInternal",
"(",
"parseArray",
"(",
"in",
")",
")",
";",
"}"
] | Decode a JSON document to retrieve a NotificationFilter array.
@param in The stream to read JSON from
@return The decoded NotificationFilter array
@throws ConversionException If JSON uses unexpected structure/format
@throws IOException If an I/O error occurs or if JSON is ill-formed.
@throws ClassNotFoundException If needed class can't be found.
@see #writeNotificationFilters(OutputStream, NotificationFilter[]) | [
"Decode",
"a",
"JSON",
"document",
"to",
"retrieve",
"a",
"NotificationFilter",
"array",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L1614-L1616 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.readNotifications | public Notification[] readNotifications(InputStream in) throws ConversionException, IOException, ClassNotFoundException {
final NotificationRecord[] records = readNotificationRecords(in);
final Notification[] ret = new Notification[records.length];
for (int i = 0; i < records.length; ++i) {
ret[i] = records[i].getNotification();
}
return ret;
} | java | public Notification[] readNotifications(InputStream in) throws ConversionException, IOException, ClassNotFoundException {
final NotificationRecord[] records = readNotificationRecords(in);
final Notification[] ret = new Notification[records.length];
for (int i = 0; i < records.length; ++i) {
ret[i] = records[i].getNotification();
}
return ret;
} | [
"public",
"Notification",
"[",
"]",
"readNotifications",
"(",
"InputStream",
"in",
")",
"throws",
"ConversionException",
",",
"IOException",
",",
"ClassNotFoundException",
"{",
"final",
"NotificationRecord",
"[",
"]",
"records",
"=",
"readNotificationRecords",
"(",
"in",
")",
";",
"final",
"Notification",
"[",
"]",
"ret",
"=",
"new",
"Notification",
"[",
"records",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"records",
".",
"length",
";",
"++",
"i",
")",
"{",
"ret",
"[",
"i",
"]",
"=",
"records",
"[",
"i",
"]",
".",
"getNotification",
"(",
")",
";",
"}",
"return",
"ret",
";",
"}"
] | Decode a JSON document to retrieve an array of Notification instances.
@param in The stream to read JSON from
@return The decoded Notification array
@throws ConversionException If JSON uses unexpected structure/format
@throws IOException If an I/O error occurs or if JSON is ill-formed.
@throws ClassNotFoundException If needed class can't be found.
@see #writeNotifications(OutputStream, Notification[]) | [
"Decode",
"a",
"JSON",
"document",
"to",
"retrieve",
"an",
"array",
"of",
"Notification",
"instances",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L1791-L1798 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.readNotificationSettings | public NotificationSettings readNotificationSettings(InputStream in) throws ConversionException, IOException {
JSONObject json = parseObject(in);
NotificationSettings ret = new NotificationSettings();
ret.deliveryInterval = readIntInternal(json.get(N_DELIVERYINTERVAL));
ret.inboxExpiry = readIntInternal(json.get(N_INBOXEXPIRY));
return ret;
} | java | public NotificationSettings readNotificationSettings(InputStream in) throws ConversionException, IOException {
JSONObject json = parseObject(in);
NotificationSettings ret = new NotificationSettings();
ret.deliveryInterval = readIntInternal(json.get(N_DELIVERYINTERVAL));
ret.inboxExpiry = readIntInternal(json.get(N_INBOXEXPIRY));
return ret;
} | [
"public",
"NotificationSettings",
"readNotificationSettings",
"(",
"InputStream",
"in",
")",
"throws",
"ConversionException",
",",
"IOException",
"{",
"JSONObject",
"json",
"=",
"parseObject",
"(",
"in",
")",
";",
"NotificationSettings",
"ret",
"=",
"new",
"NotificationSettings",
"(",
")",
";",
"ret",
".",
"deliveryInterval",
"=",
"readIntInternal",
"(",
"json",
".",
"get",
"(",
"N_DELIVERYINTERVAL",
")",
")",
";",
"ret",
".",
"inboxExpiry",
"=",
"readIntInternal",
"(",
"json",
".",
"get",
"(",
"N_INBOXEXPIRY",
")",
")",
";",
"return",
"ret",
";",
"}"
] | Decode a JSON document to retrieve a NotificationSettings instance.
@param in The stream to read JSON from
@return The decoded NotificationSettings instance
@throws ConversionException If JSON uses unexpected structure/format
@throws IOException If an I/O error occurs or if JSON is ill-formed.
@see #writeNotificationSettings(OutputStream, NotificationSettings) | [
"Decode",
"a",
"JSON",
"document",
"to",
"retrieve",
"a",
"NotificationSettings",
"instance",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L1928-L1934 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.readThrowable | public Throwable readThrowable(InputStream in) throws ConversionException, IOException, ClassNotFoundException {
byte[] byteInputStream = convertInputStreamToBytes(in);
ByteArrayInputStream bais = new ByteArrayInputStream(byteInputStream);
JSONObject json = null;
try {
json = parseObject(bais);
} catch (IOException ex) {
bais.reset();
throw new RuntimeException(convertStreamToString(bais));
}
Object t = readSerialized(json.get(N_THROWABLE));
if (!(t instanceof Throwable)) {
throwConversionException("readThrowable() receives an instance that's not a Throwable.", json.get(N_THROWABLE));
}
return (Throwable) t;
} | java | public Throwable readThrowable(InputStream in) throws ConversionException, IOException, ClassNotFoundException {
byte[] byteInputStream = convertInputStreamToBytes(in);
ByteArrayInputStream bais = new ByteArrayInputStream(byteInputStream);
JSONObject json = null;
try {
json = parseObject(bais);
} catch (IOException ex) {
bais.reset();
throw new RuntimeException(convertStreamToString(bais));
}
Object t = readSerialized(json.get(N_THROWABLE));
if (!(t instanceof Throwable)) {
throwConversionException("readThrowable() receives an instance that's not a Throwable.", json.get(N_THROWABLE));
}
return (Throwable) t;
} | [
"public",
"Throwable",
"readThrowable",
"(",
"InputStream",
"in",
")",
"throws",
"ConversionException",
",",
"IOException",
",",
"ClassNotFoundException",
"{",
"byte",
"[",
"]",
"byteInputStream",
"=",
"convertInputStreamToBytes",
"(",
"in",
")",
";",
"ByteArrayInputStream",
"bais",
"=",
"new",
"ByteArrayInputStream",
"(",
"byteInputStream",
")",
";",
"JSONObject",
"json",
"=",
"null",
";",
"try",
"{",
"json",
"=",
"parseObject",
"(",
"bais",
")",
";",
"}",
"catch",
"(",
"IOException",
"ex",
")",
"{",
"bais",
".",
"reset",
"(",
")",
";",
"throw",
"new",
"RuntimeException",
"(",
"convertStreamToString",
"(",
"bais",
")",
")",
";",
"}",
"Object",
"t",
"=",
"readSerialized",
"(",
"json",
".",
"get",
"(",
"N_THROWABLE",
")",
")",
";",
"if",
"(",
"!",
"(",
"t",
"instanceof",
"Throwable",
")",
")",
"{",
"throwConversionException",
"(",
"\"readThrowable() receives an instance that's not a Throwable.\"",
",",
"json",
".",
"get",
"(",
"N_THROWABLE",
")",
")",
";",
"}",
"return",
"(",
"Throwable",
")",
"t",
";",
"}"
] | Decode a JSON document to retrieve a Throwable instance.
@param in The stream to read JSON from
@return The decoded Throwable instance
@throws ConversionException If JSON uses unexpected structure/format
@throws IOException If an I/O error occurs or if JSON is ill-formed.
@throws ClassNotFoundException If needed class can't be found.
@see #writeThrowable(OutputStream, Throwable) | [
"Decode",
"a",
"JSON",
"document",
"to",
"retrieve",
"a",
"Throwable",
"instance",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L1967-L1982 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.convertInputStreamToBytes | private byte[] convertInputStreamToBytes(InputStream in) throws IOException {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
int len;
byte[] data = new byte[16384];
while ((len = in.read(data, 0, data.length)) != -1) {
buffer.write(data, 0, len);
}
buffer.flush();
return buffer.toByteArray();
} | java | private byte[] convertInputStreamToBytes(InputStream in) throws IOException {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
int len;
byte[] data = new byte[16384];
while ((len = in.read(data, 0, data.length)) != -1) {
buffer.write(data, 0, len);
}
buffer.flush();
return buffer.toByteArray();
} | [
"private",
"byte",
"[",
"]",
"convertInputStreamToBytes",
"(",
"InputStream",
"in",
")",
"throws",
"IOException",
"{",
"ByteArrayOutputStream",
"buffer",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"int",
"len",
";",
"byte",
"[",
"]",
"data",
"=",
"new",
"byte",
"[",
"16384",
"]",
";",
"while",
"(",
"(",
"len",
"=",
"in",
".",
"read",
"(",
"data",
",",
"0",
",",
"data",
".",
"length",
")",
")",
"!=",
"-",
"1",
")",
"{",
"buffer",
".",
"write",
"(",
"data",
",",
"0",
",",
"len",
")",
";",
"}",
"buffer",
".",
"flush",
"(",
")",
";",
"return",
"buffer",
".",
"toByteArray",
"(",
")",
";",
"}"
] | Converts inputstream to bytearray
@param in
@return
@throws IOException | [
"Converts",
"inputstream",
"to",
"bytearray"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L1991-L2003 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.encodeStringAsBase64 | public String encodeStringAsBase64(String value) throws ConversionException {
try {
return encodeStringAsBase64Internal(value);
} catch (IOException e) {
// Will never happen
return null;
}
} | java | public String encodeStringAsBase64(String value) throws ConversionException {
try {
return encodeStringAsBase64Internal(value);
} catch (IOException e) {
// Will never happen
return null;
}
} | [
"public",
"String",
"encodeStringAsBase64",
"(",
"String",
"value",
")",
"throws",
"ConversionException",
"{",
"try",
"{",
"return",
"encodeStringAsBase64Internal",
"(",
"value",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"// Will never happen",
"return",
"null",
";",
"}",
"}"
] | Encode a String in base64. The content of the string is first encoded
as UTF-8 bytes, the bytes are then base64 encoded. The resulting base64
value is returned as a String.
@param value The String to encode
@return The encoded base64 String
@throws ConversionException If the String content can not be UTF-8 encoded. | [
"Encode",
"a",
"String",
"in",
"base64",
".",
"The",
"content",
"of",
"the",
"string",
"is",
"first",
"encoded",
"as",
"UTF",
"-",
"8",
"bytes",
"the",
"bytes",
"are",
"then",
"base64",
"encoded",
".",
"The",
"resulting",
"base64",
"value",
"is",
"returned",
"as",
"a",
"String",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L2035-L2042 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.writeSimpleString | private void writeSimpleString(OutputStream out, CharSequence value) throws IOException {
out.write('"');
for (int i = 0; i < value.length(); i++) {
out.write(value.charAt(i));
}
out.write('"');
} | java | private void writeSimpleString(OutputStream out, CharSequence value) throws IOException {
out.write('"');
for (int i = 0; i < value.length(); i++) {
out.write(value.charAt(i));
}
out.write('"');
} | [
"private",
"void",
"writeSimpleString",
"(",
"OutputStream",
"out",
",",
"CharSequence",
"value",
")",
"throws",
"IOException",
"{",
"out",
".",
"write",
"(",
"'",
"'",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"value",
".",
"length",
"(",
")",
";",
"i",
"++",
")",
"{",
"out",
".",
"write",
"(",
"value",
".",
"charAt",
"(",
"i",
")",
")",
";",
"}",
"out",
".",
"write",
"(",
"'",
"'",
")",
";",
"}"
] | The value can't be null. | [
"The",
"value",
"can",
"t",
"be",
"null",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L2391-L2397 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsManagedConnectionFactoryImpl.java | JmsManagedConnectionFactoryImpl.getTemporaryQueueNamePrefix | @Override
public String getTemporaryQueueNamePrefix() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getTemporaryQueueNamePrefix");
String prefix = jcaConnectionFactory.getTemporaryQueueNamePrefix();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getTemporaryQueueNamePrefix", prefix);
return prefix;
} | java | @Override
public String getTemporaryQueueNamePrefix() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getTemporaryQueueNamePrefix");
String prefix = jcaConnectionFactory.getTemporaryQueueNamePrefix();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getTemporaryQueueNamePrefix", prefix);
return prefix;
} | [
"@",
"Override",
"public",
"String",
"getTemporaryQueueNamePrefix",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"getTemporaryQueueNamePrefix\"",
")",
";",
"String",
"prefix",
"=",
"jcaConnectionFactory",
".",
"getTemporaryQueueNamePrefix",
"(",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"getTemporaryQueueNamePrefix\"",
",",
"prefix",
")",
";",
"return",
"prefix",
";",
"}"
] | Get the temp queue name prefix
@return prefix The String prefix set
@see com.ibm.websphere.sib.api.jms.JmsConnectionFactory#getTemporaryQueueNamePrefix | [
"Get",
"the",
"temp",
"queue",
"name",
"prefix"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsManagedConnectionFactoryImpl.java#L311-L319 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsManagedConnectionFactoryImpl.java | JmsManagedConnectionFactoryImpl.getPassword | public String getPassword() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getPassword");
String password = jcaConnectionFactory.getPassword();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getPassword");
return password;
} | java | public String getPassword() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getPassword");
String password = jcaConnectionFactory.getPassword();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getPassword");
return password;
} | [
"public",
"String",
"getPassword",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"getPassword\"",
")",
";",
"String",
"password",
"=",
"jcaConnectionFactory",
".",
"getPassword",
"(",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"getPassword\"",
")",
";",
"return",
"password",
";",
"}"
] | This method is not added in the interface JmsManagedConnectionFactory since it's for internal use only.
@return | [
"This",
"method",
"is",
"not",
"added",
"in",
"the",
"interface",
"JmsManagedConnectionFactory",
"since",
"it",
"s",
"for",
"internal",
"use",
"only",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsManagedConnectionFactoryImpl.java#L405-L412 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsManagedConnectionFactoryImpl.java | JmsManagedConnectionFactoryImpl.getConnectionProximity | @Override
public String getConnectionProximity() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getConnectionProximity");
String connectionProximity = jcaConnectionFactory.getConnectionProximity();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getConnectionProximity", connectionProximity);
return connectionProximity;
} | java | @Override
public String getConnectionProximity() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getConnectionProximity");
String connectionProximity = jcaConnectionFactory.getConnectionProximity();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getConnectionProximity", connectionProximity);
return connectionProximity;
} | [
"@",
"Override",
"public",
"String",
"getConnectionProximity",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"getConnectionProximity\"",
")",
";",
"String",
"connectionProximity",
"=",
"jcaConnectionFactory",
".",
"getConnectionProximity",
"(",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"getConnectionProximity\"",
",",
"connectionProximity",
")",
";",
"return",
"connectionProximity",
";",
"}"
] | Gets the connection proximity
@return The connection proximity
@see com.ibm.websphere.sib.api.jms.JmsConnectionFactory#getConnectionProximity | [
"Gets",
"the",
"connection",
"proximity"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsManagedConnectionFactoryImpl.java#L422-L430 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsManagedConnectionFactoryImpl.java | JmsManagedConnectionFactoryImpl.getProviderEndpoints | @Override
public String getProviderEndpoints() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getProviderEndpoints");
String providerEndpoints = jcaConnectionFactory.getProviderEndpoints();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getProviderEndpoints", providerEndpoints);
return providerEndpoints;
} | java | @Override
public String getProviderEndpoints() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getProviderEndpoints");
String providerEndpoints = jcaConnectionFactory.getProviderEndpoints();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getProviderEndpoints", providerEndpoints);
return providerEndpoints;
} | [
"@",
"Override",
"public",
"String",
"getProviderEndpoints",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"getProviderEndpoints\"",
")",
";",
"String",
"providerEndpoints",
"=",
"jcaConnectionFactory",
".",
"getProviderEndpoints",
"(",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"getProviderEndpoints\"",
",",
"providerEndpoints",
")",
";",
"return",
"providerEndpoints",
";",
"}"
] | Gets the provider endpoints
181802.2
@return The provider endpoints
@see com.ibm.websphere.sib.api.jms.JmsConnectionFactory#getProviderEndpoints | [
"Gets",
"the",
"provider",
"endpoints",
"181802",
".",
"2"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsManagedConnectionFactoryImpl.java#L441-L449 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsManagedConnectionFactoryImpl.java | JmsManagedConnectionFactoryImpl.getTargetTransportChain | @Override
public String getTargetTransportChain() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getTargetTransportChain");
String targetTransportChain = jcaConnectionFactory.getTargetTransportChain();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getTargetTransportChain", targetTransportChain);
return targetTransportChain;
} | java | @Override
public String getTargetTransportChain() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getTargetTransportChain");
String targetTransportChain = jcaConnectionFactory.getTargetTransportChain();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getTargetTransportChain", targetTransportChain);
return targetTransportChain;
} | [
"@",
"Override",
"public",
"String",
"getTargetTransportChain",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"getTargetTransportChain\"",
")",
";",
"String",
"targetTransportChain",
"=",
"jcaConnectionFactory",
".",
"getTargetTransportChain",
"(",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"getTargetTransportChain\"",
",",
"targetTransportChain",
")",
";",
"return",
"targetTransportChain",
";",
"}"
] | Gets the remote protocol
@return The remote protocol
@see com.ibm.websphere.sib.api.jms.JmsConnectionFactory#getRemoteProtocol | [
"Gets",
"the",
"remote",
"protocol"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsManagedConnectionFactoryImpl.java#L459-L467 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsManagedConnectionFactoryImpl.java | JmsManagedConnectionFactoryImpl.getTarget | @Override
public String getTarget() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getTarget");
String remoteTargetGroup = jcaConnectionFactory.getTarget();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getTarget", remoteTargetGroup);
return remoteTargetGroup;
} | java | @Override
public String getTarget() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getTarget");
String remoteTargetGroup = jcaConnectionFactory.getTarget();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getTarget", remoteTargetGroup);
return remoteTargetGroup;
} | [
"@",
"Override",
"public",
"String",
"getTarget",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"getTarget\"",
")",
";",
"String",
"remoteTargetGroup",
"=",
"jcaConnectionFactory",
".",
"getTarget",
"(",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"getTarget\"",
",",
"remoteTargetGroup",
")",
";",
"return",
"remoteTargetGroup",
";",
"}"
] | Gets the target
@return The target
@see com.ibm.websphere.sib.api.jms.JmsConnectionFactory#getTarget | [
"Gets",
"the",
"target"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsManagedConnectionFactoryImpl.java#L477-L485 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsManagedConnectionFactoryImpl.java | JmsManagedConnectionFactoryImpl.getTargetType | @Override
public String getTargetType() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getTargetType");
String remoteTargetType = jcaConnectionFactory.getTargetType();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getTargetType", remoteTargetType);
return remoteTargetType;
} | java | @Override
public String getTargetType() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getTargetType");
String remoteTargetType = jcaConnectionFactory.getTargetType();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getTargetType", remoteTargetType);
return remoteTargetType;
} | [
"@",
"Override",
"public",
"String",
"getTargetType",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"getTargetType\"",
")",
";",
"String",
"remoteTargetType",
"=",
"jcaConnectionFactory",
".",
"getTargetType",
"(",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"getTargetType\"",
",",
"remoteTargetType",
")",
";",
"return",
"remoteTargetType",
";",
"}"
] | Gets the target type
@return The target type
@see com.ibm.websphere.sib.api.jms.JmsConnectionFactory#getTargetType | [
"Gets",
"the",
"target",
"type"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsManagedConnectionFactoryImpl.java#L495-L503 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/container/ErrorPage.java | ErrorPage.getException | @SuppressWarnings("rawtypes")
public Class getException() {
try {
return Class.forName(errorParam, true, Thread.currentThread().getContextClassLoader()).newInstance().getClass();
} catch (Exception e) {
return null;
}
} | java | @SuppressWarnings("rawtypes")
public Class getException() {
try {
return Class.forName(errorParam, true, Thread.currentThread().getContextClassLoader()).newInstance().getClass();
} catch (Exception e) {
return null;
}
} | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"Class",
"getException",
"(",
")",
"{",
"try",
"{",
"return",
"Class",
".",
"forName",
"(",
"errorParam",
",",
"true",
",",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getContextClassLoader",
"(",
")",
")",
".",
"newInstance",
"(",
")",
".",
"getClass",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"return",
"null",
";",
"}",
"}"
] | Use of the WAR class loader is correct. | [
"Use",
"of",
"the",
"WAR",
"class",
"loader",
"is",
"correct",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/container/ErrorPage.java#L81-L88 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/container/ErrorPage.java | ErrorPage.getException | @SuppressWarnings("rawtypes")
public Class getException(ClassLoader warClassLoader) {
try {
return Class.forName(errorParam, true, warClassLoader);
} catch (Exception e) {
return null;
}
} | java | @SuppressWarnings("rawtypes")
public Class getException(ClassLoader warClassLoader) {
try {
return Class.forName(errorParam, true, warClassLoader);
} catch (Exception e) {
return null;
}
} | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"Class",
"getException",
"(",
"ClassLoader",
"warClassLoader",
")",
"{",
"try",
"{",
"return",
"Class",
".",
"forName",
"(",
"errorParam",
",",
"true",
",",
"warClassLoader",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"return",
"null",
";",
"}",
"}"
] | PK52168 - STARTS | [
"PK52168",
"-",
"STARTS"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/container/ErrorPage.java#L91-L98 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/asn1/BERInputStream.java | BERInputStream.readIndefiniteLengthFully | private byte[] readIndefiniteLengthFully()
throws IOException
{
ByteArrayOutputStream bOut = new ByteArrayOutputStream();
int b, b1;
b1 = read();
while ((b = read()) >= 0)
{
if (b1 == 0 && b == 0)
{
break;
}
bOut.write(b1);
b1 = b;
}
return bOut.toByteArray();
} | java | private byte[] readIndefiniteLengthFully()
throws IOException
{
ByteArrayOutputStream bOut = new ByteArrayOutputStream();
int b, b1;
b1 = read();
while ((b = read()) >= 0)
{
if (b1 == 0 && b == 0)
{
break;
}
bOut.write(b1);
b1 = b;
}
return bOut.toByteArray();
} | [
"private",
"byte",
"[",
"]",
"readIndefiniteLengthFully",
"(",
")",
"throws",
"IOException",
"{",
"ByteArrayOutputStream",
"bOut",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"int",
"b",
",",
"b1",
";",
"b1",
"=",
"read",
"(",
")",
";",
"while",
"(",
"(",
"b",
"=",
"read",
"(",
")",
")",
">=",
"0",
")",
"{",
"if",
"(",
"b1",
"==",
"0",
"&&",
"b",
"==",
"0",
")",
"{",
"break",
";",
"}",
"bOut",
".",
"write",
"(",
"b1",
")",
";",
"b1",
"=",
"b",
";",
"}",
"return",
"bOut",
".",
"toByteArray",
"(",
")",
";",
"}"
] | read a string of bytes representing an indefinite length object. | [
"read",
"a",
"string",
"of",
"bytes",
"representing",
"an",
"indefinite",
"length",
"object",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/asn1/BERInputStream.java#L55-L75 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/impl/SectionUniqueIdCounter.java | SectionUniqueIdCounter.generateUniqueIdCache | public static String[] generateUniqueIdCache(String prefix, int count)
{
String[] cache = new String[count];
SectionUniqueIdCounter counter = new SectionUniqueIdCounter(prefix);
for (int i = 0; i < count ; i++)
{
cache[i] = counter.generateUniqueId();
}
return cache;
} | java | public static String[] generateUniqueIdCache(String prefix, int count)
{
String[] cache = new String[count];
SectionUniqueIdCounter counter = new SectionUniqueIdCounter(prefix);
for (int i = 0; i < count ; i++)
{
cache[i] = counter.generateUniqueId();
}
return cache;
} | [
"public",
"static",
"String",
"[",
"]",
"generateUniqueIdCache",
"(",
"String",
"prefix",
",",
"int",
"count",
")",
"{",
"String",
"[",
"]",
"cache",
"=",
"new",
"String",
"[",
"count",
"]",
";",
"SectionUniqueIdCounter",
"counter",
"=",
"new",
"SectionUniqueIdCounter",
"(",
"prefix",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"count",
";",
"i",
"++",
")",
"{",
"cache",
"[",
"i",
"]",
"=",
"counter",
".",
"generateUniqueId",
"(",
")",
";",
"}",
"return",
"cache",
";",
"}"
] | Creates an array of the generated unique ids for an specified prefix,
than can be used later to prevent calculate the same String over and over.
@param prefix
@param count
@return | [
"Creates",
"an",
"array",
"of",
"the",
"generated",
"unique",
"ids",
"for",
"an",
"specified",
"prefix",
"than",
"can",
"be",
"used",
"later",
"to",
"prevent",
"calculate",
"the",
"same",
"String",
"over",
"and",
"over",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/impl/SectionUniqueIdCounter.java#L102-L111 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.servlet.4.0/src/com/ibm/ws/webcontainer40/srt/http/HttpPushBuilder.java | HttpPushBuilder.getHeaders | @Override
public Set<HeaderField> getHeaders() {
HashSet<HeaderField> headerFields = new HashSet<HeaderField>();
if (_headers.size() > 0) {
Iterator<String> headerNames = _headers.keySet().iterator();
while (headerNames.hasNext()) {
Iterator<HttpHeaderField> headers = _headers.get(headerNames.next()).iterator();
while (headers.hasNext()) {
HttpHeaderField field = headers.next();
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "getHeaders()", "add header name = " + field.getName() + ", value = " + field.asString());
}
headerFields.add(field);
}
}
}
return headerFields;
} | java | @Override
public Set<HeaderField> getHeaders() {
HashSet<HeaderField> headerFields = new HashSet<HeaderField>();
if (_headers.size() > 0) {
Iterator<String> headerNames = _headers.keySet().iterator();
while (headerNames.hasNext()) {
Iterator<HttpHeaderField> headers = _headers.get(headerNames.next()).iterator();
while (headers.hasNext()) {
HttpHeaderField field = headers.next();
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "getHeaders()", "add header name = " + field.getName() + ", value = " + field.asString());
}
headerFields.add(field);
}
}
}
return headerFields;
} | [
"@",
"Override",
"public",
"Set",
"<",
"HeaderField",
">",
"getHeaders",
"(",
")",
"{",
"HashSet",
"<",
"HeaderField",
">",
"headerFields",
"=",
"new",
"HashSet",
"<",
"HeaderField",
">",
"(",
")",
";",
"if",
"(",
"_headers",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"Iterator",
"<",
"String",
">",
"headerNames",
"=",
"_headers",
".",
"keySet",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"headerNames",
".",
"hasNext",
"(",
")",
")",
"{",
"Iterator",
"<",
"HttpHeaderField",
">",
"headers",
"=",
"_headers",
".",
"get",
"(",
"headerNames",
".",
"next",
"(",
")",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"headers",
".",
"hasNext",
"(",
")",
")",
"{",
"HttpHeaderField",
"field",
"=",
"headers",
".",
"next",
"(",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"getHeaders()\"",
",",
"\"add header name = \"",
"+",
"field",
".",
"getName",
"(",
")",
"+",
"\", value = \"",
"+",
"field",
".",
"asString",
"(",
")",
")",
";",
"}",
"headerFields",
".",
"add",
"(",
"field",
")",
";",
"}",
"}",
"}",
"return",
"headerFields",
";",
"}"
] | Methods required by com.ibm.wsspi.http.ee8.HttpPushBuilder | [
"Methods",
"required",
"by",
"com",
".",
"ibm",
".",
"wsspi",
".",
"http",
".",
"ee8",
".",
"HttpPushBuilder"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.servlet.4.0/src/com/ibm/ws/webcontainer40/srt/http/HttpPushBuilder.java#L349-L368 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.servlet.4.0/src/com/ibm/ws/webcontainer40/srt/http/HttpPushBuilder.java | HttpPushBuilder.reset | private void reset() {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "reset()", "Clearing the path and removing conditional headers");
}
//clear the path
_path = null;
_pathURI = null;
_queryString = null;
_pathQueryString = null;
//remove conditional headers
removeHeader(HDR_IF_MATCH);
removeHeader(HDR_IF_MODIFIED_SINCE);
removeHeader(HDR_IF_NONE_MATCH);
removeHeader(HDR_IF_RANGE);
removeHeader(HDR_IF_UNMODIFIED_SINCE);
} | java | private void reset() {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "reset()", "Clearing the path and removing conditional headers");
}
//clear the path
_path = null;
_pathURI = null;
_queryString = null;
_pathQueryString = null;
//remove conditional headers
removeHeader(HDR_IF_MATCH);
removeHeader(HDR_IF_MODIFIED_SINCE);
removeHeader(HDR_IF_NONE_MATCH);
removeHeader(HDR_IF_RANGE);
removeHeader(HDR_IF_UNMODIFIED_SINCE);
} | [
"private",
"void",
"reset",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"reset()\"",
",",
"\"Clearing the path and removing conditional headers\"",
")",
";",
"}",
"//clear the path",
"_path",
"=",
"null",
";",
"_pathURI",
"=",
"null",
";",
"_queryString",
"=",
"null",
";",
"_pathQueryString",
"=",
"null",
";",
"//remove conditional headers",
"removeHeader",
"(",
"HDR_IF_MATCH",
")",
";",
"removeHeader",
"(",
"HDR_IF_MODIFIED_SINCE",
")",
";",
"removeHeader",
"(",
"HDR_IF_NONE_MATCH",
")",
";",
"removeHeader",
"(",
"HDR_IF_RANGE",
")",
";",
"removeHeader",
"(",
"HDR_IF_UNMODIFIED_SINCE",
")",
";",
"}"
] | Reset the "state" of this PushBuilder before next push | [
"Reset",
"the",
"state",
"of",
"this",
"PushBuilder",
"before",
"next",
"push"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.servlet.4.0/src/com/ibm/ws/webcontainer40/srt/http/HttpPushBuilder.java#L381-L398 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.jaas.common/src/com/ibm/ws/security/jaas/common/JAASConfigurationFactory.java | JAASConfigurationFactory.installJAASConfigurationFromJAASConfigFile | protected synchronized void installJAASConfigurationFromJAASConfigFile() {
JAASLoginConfig jaasLoginConfig = jaasLoginConfigRef.getService();
if (jaasLoginConfig != null) {
jaasConfigurationEntriesFromJaasConfig = jaasLoginConfig.getEntries();
if (jaasConfigurationEntriesFromJaasConfig != null) {
if (jaasSecurityConfiguration == null) {
jaasSecurityConfiguration = new JAASSecurityConfiguration();
Configuration.setConfiguration(jaasSecurityConfiguration);
}
jaasSecurityConfiguration.setAppConfigurationEntries(jaasConfigurationEntriesFromJaasConfig);
}
}
} | java | protected synchronized void installJAASConfigurationFromJAASConfigFile() {
JAASLoginConfig jaasLoginConfig = jaasLoginConfigRef.getService();
if (jaasLoginConfig != null) {
jaasConfigurationEntriesFromJaasConfig = jaasLoginConfig.getEntries();
if (jaasConfigurationEntriesFromJaasConfig != null) {
if (jaasSecurityConfiguration == null) {
jaasSecurityConfiguration = new JAASSecurityConfiguration();
Configuration.setConfiguration(jaasSecurityConfiguration);
}
jaasSecurityConfiguration.setAppConfigurationEntries(jaasConfigurationEntriesFromJaasConfig);
}
}
} | [
"protected",
"synchronized",
"void",
"installJAASConfigurationFromJAASConfigFile",
"(",
")",
"{",
"JAASLoginConfig",
"jaasLoginConfig",
"=",
"jaasLoginConfigRef",
".",
"getService",
"(",
")",
";",
"if",
"(",
"jaasLoginConfig",
"!=",
"null",
")",
"{",
"jaasConfigurationEntriesFromJaasConfig",
"=",
"jaasLoginConfig",
".",
"getEntries",
"(",
")",
";",
"if",
"(",
"jaasConfigurationEntriesFromJaasConfig",
"!=",
"null",
")",
"{",
"if",
"(",
"jaasSecurityConfiguration",
"==",
"null",
")",
"{",
"jaasSecurityConfiguration",
"=",
"new",
"JAASSecurityConfiguration",
"(",
")",
";",
"Configuration",
".",
"setConfiguration",
"(",
"jaasSecurityConfiguration",
")",
";",
"}",
"jaasSecurityConfiguration",
".",
"setAppConfigurationEntries",
"(",
"jaasConfigurationEntriesFromJaasConfig",
")",
";",
"}",
"}",
"}"
] | This method optional install the JAAS configuration that specified in the jaas.conf file | [
"This",
"method",
"optional",
"install",
"the",
"JAAS",
"configuration",
"that",
"specified",
"in",
"the",
"jaas",
".",
"conf",
"file"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.jaas.common/src/com/ibm/ws/security/jaas/common/JAASConfigurationFactory.java#L116-L128 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/ProductRequirementInformation.java | ProductRequirementInformation.createFromAppliesTo | @SuppressWarnings("unchecked") // SelfExtractor has no generics
public static List<ProductRequirementInformation> createFromAppliesTo(String appliesTo) {
if (appliesTo == null || appliesTo.isEmpty()) {
throw new InvalidParameterException("Applies to must be set to a valid value but is " + appliesTo);
}
List<ProductRequirementInformation> products = new ArrayList<ProductRequirementInformation>();
List<ProductMatch> matchers = SelfExtractor.parseAppliesTo(appliesTo);
for (ProductMatch match : matchers) {
// All product must have their ID set so this should always produce a valid filter string
String productId = match.getProductId();
String version = match.getVersion();
final String versionRange;
if (version != null && version.endsWith("+")) {
versionRange = version.substring(0, version.length() - 1);
} else {
if (version != null) {
versionRange = Character.toString(VersionRange.LEFT_CLOSED) + version + ", " + version + Character.toString(VersionRange.RIGHT_CLOSED);
} else {
versionRange = null;
}
}
String installType = match.getInstallType();
String licenseType = match.getLicenseType();
// The editions is a list of strings
List<String> editions = match.getEditions();
products.add(new ProductRequirementInformation(versionRange, productId, installType, licenseType, editions));
}
return products;
} | java | @SuppressWarnings("unchecked") // SelfExtractor has no generics
public static List<ProductRequirementInformation> createFromAppliesTo(String appliesTo) {
if (appliesTo == null || appliesTo.isEmpty()) {
throw new InvalidParameterException("Applies to must be set to a valid value but is " + appliesTo);
}
List<ProductRequirementInformation> products = new ArrayList<ProductRequirementInformation>();
List<ProductMatch> matchers = SelfExtractor.parseAppliesTo(appliesTo);
for (ProductMatch match : matchers) {
// All product must have their ID set so this should always produce a valid filter string
String productId = match.getProductId();
String version = match.getVersion();
final String versionRange;
if (version != null && version.endsWith("+")) {
versionRange = version.substring(0, version.length() - 1);
} else {
if (version != null) {
versionRange = Character.toString(VersionRange.LEFT_CLOSED) + version + ", " + version + Character.toString(VersionRange.RIGHT_CLOSED);
} else {
versionRange = null;
}
}
String installType = match.getInstallType();
String licenseType = match.getLicenseType();
// The editions is a list of strings
List<String> editions = match.getEditions();
products.add(new ProductRequirementInformation(versionRange, productId, installType, licenseType, editions));
}
return products;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"// SelfExtractor has no generics",
"public",
"static",
"List",
"<",
"ProductRequirementInformation",
">",
"createFromAppliesTo",
"(",
"String",
"appliesTo",
")",
"{",
"if",
"(",
"appliesTo",
"==",
"null",
"||",
"appliesTo",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"InvalidParameterException",
"(",
"\"Applies to must be set to a valid value but is \"",
"+",
"appliesTo",
")",
";",
"}",
"List",
"<",
"ProductRequirementInformation",
">",
"products",
"=",
"new",
"ArrayList",
"<",
"ProductRequirementInformation",
">",
"(",
")",
";",
"List",
"<",
"ProductMatch",
">",
"matchers",
"=",
"SelfExtractor",
".",
"parseAppliesTo",
"(",
"appliesTo",
")",
";",
"for",
"(",
"ProductMatch",
"match",
":",
"matchers",
")",
"{",
"// All product must have their ID set so this should always produce a valid filter string",
"String",
"productId",
"=",
"match",
".",
"getProductId",
"(",
")",
";",
"String",
"version",
"=",
"match",
".",
"getVersion",
"(",
")",
";",
"final",
"String",
"versionRange",
";",
"if",
"(",
"version",
"!=",
"null",
"&&",
"version",
".",
"endsWith",
"(",
"\"+\"",
")",
")",
"{",
"versionRange",
"=",
"version",
".",
"substring",
"(",
"0",
",",
"version",
".",
"length",
"(",
")",
"-",
"1",
")",
";",
"}",
"else",
"{",
"if",
"(",
"version",
"!=",
"null",
")",
"{",
"versionRange",
"=",
"Character",
".",
"toString",
"(",
"VersionRange",
".",
"LEFT_CLOSED",
")",
"+",
"version",
"+",
"\", \"",
"+",
"version",
"+",
"Character",
".",
"toString",
"(",
"VersionRange",
".",
"RIGHT_CLOSED",
")",
";",
"}",
"else",
"{",
"versionRange",
"=",
"null",
";",
"}",
"}",
"String",
"installType",
"=",
"match",
".",
"getInstallType",
"(",
")",
";",
"String",
"licenseType",
"=",
"match",
".",
"getLicenseType",
"(",
")",
";",
"// The editions is a list of strings",
"List",
"<",
"String",
">",
"editions",
"=",
"match",
".",
"getEditions",
"(",
")",
";",
"products",
".",
"add",
"(",
"new",
"ProductRequirementInformation",
"(",
"versionRange",
",",
"productId",
",",
"installType",
",",
"licenseType",
",",
"editions",
")",
")",
";",
"}",
"return",
"products",
";",
"}"
] | Parse an appliesTo string to produce a list of product requirements
@param appliesTo the appliesTo string
@return the product requirements information | [
"Parse",
"an",
"appliesTo",
"string",
"to",
"produce",
"a",
"list",
"of",
"product",
"requirements"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/ProductRequirementInformation.java#L118-L149 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java | BusGroup.getMembers | Neighbour[] getMembers()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(tc, "getMembers");
SibTr.exit(tc, "getMembers");
}
return iNeighbours;
} | java | Neighbour[] getMembers()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(tc, "getMembers");
SibTr.exit(tc, "getMembers");
}
return iNeighbours;
} | [
"Neighbour",
"[",
"]",
"getMembers",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"getMembers\"",
")",
";",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"getMembers\"",
")",
";",
"}",
"return",
"iNeighbours",
";",
"}"
] | Method that returns all the Neighbours for this Bus
@return Neighbour[] An array of all the active Neighbours | [
"Method",
"that",
"returns",
"all",
"the",
"Neighbours",
"for",
"this",
"Bus"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java#L113-L122 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java | BusGroup.getLocalSubscriptions | Hashtable getLocalSubscriptions()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(tc, "getLocalSubscriptions");
SibTr.exit(tc, "getLocalSubscriptions", iLocalSubscriptions);
}
return (Hashtable) iLocalSubscriptions.clone();
} | java | Hashtable getLocalSubscriptions()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(tc, "getLocalSubscriptions");
SibTr.exit(tc, "getLocalSubscriptions", iLocalSubscriptions);
}
return (Hashtable) iLocalSubscriptions.clone();
} | [
"Hashtable",
"getLocalSubscriptions",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"getLocalSubscriptions\"",
")",
";",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"getLocalSubscriptions\"",
",",
"iLocalSubscriptions",
")",
";",
"}",
"return",
"(",
"Hashtable",
")",
"iLocalSubscriptions",
".",
"clone",
"(",
")",
";",
"}"
] | Gets all the local subscriptions that have been sent to this Bus.
Returns a cloned list of subscriptions to the requester.
@return Hashtable The cloned subscription hashtable. | [
"Gets",
"all",
"the",
"local",
"subscriptions",
"that",
"have",
"been",
"sent",
"to",
"this",
"Bus",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java#L131-L140 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java | BusGroup.getRemoteSubscriptions | Hashtable getRemoteSubscriptions()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(tc, "getRemoteSubscriptions");
SibTr.exit(tc, "getRemoteSubscriptions", iRemoteSubscriptions);
}
return (Hashtable) iRemoteSubscriptions.clone();
} | java | Hashtable getRemoteSubscriptions()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(tc, "getRemoteSubscriptions");
SibTr.exit(tc, "getRemoteSubscriptions", iRemoteSubscriptions);
}
return (Hashtable) iRemoteSubscriptions.clone();
} | [
"Hashtable",
"getRemoteSubscriptions",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"getRemoteSubscriptions\"",
")",
";",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"getRemoteSubscriptions\"",
",",
"iRemoteSubscriptions",
")",
";",
"}",
"return",
"(",
"Hashtable",
")",
"iRemoteSubscriptions",
".",
"clone",
"(",
")",
";",
"}"
] | Gets all the remote subscriptions that have been sent to this Bus.
Returns a cloned list of subscriptions to the requester.
@return Hashtable The cloned subscription hashtable. | [
"Gets",
"all",
"the",
"remote",
"subscriptions",
"that",
"have",
"been",
"sent",
"to",
"this",
"Bus",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java#L149-L158 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java | BusGroup.addRemoteSubscription | SubscriptionMessageHandler addRemoteSubscription(SIBUuid12 topicSpace,
String topic,
SubscriptionMessageHandler messageHandler,
boolean sendProxy)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "addRemoteSubscription",
new Object[] {
topicSpace,
topic,
messageHandler});
messageHandler =
addSubscription(null,
topicSpace,
topic,
messageHandler,
iRemoteSubscriptions,
sendProxy);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "addRemoteSubscription",messageHandler);
return messageHandler;
} | java | SubscriptionMessageHandler addRemoteSubscription(SIBUuid12 topicSpace,
String topic,
SubscriptionMessageHandler messageHandler,
boolean sendProxy)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "addRemoteSubscription",
new Object[] {
topicSpace,
topic,
messageHandler});
messageHandler =
addSubscription(null,
topicSpace,
topic,
messageHandler,
iRemoteSubscriptions,
sendProxy);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "addRemoteSubscription",messageHandler);
return messageHandler;
} | [
"SubscriptionMessageHandler",
"addRemoteSubscription",
"(",
"SIBUuid12",
"topicSpace",
",",
"String",
"topic",
",",
"SubscriptionMessageHandler",
"messageHandler",
",",
"boolean",
"sendProxy",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"addRemoteSubscription\"",
",",
"new",
"Object",
"[",
"]",
"{",
"topicSpace",
",",
"topic",
",",
"messageHandler",
"}",
")",
";",
"messageHandler",
"=",
"addSubscription",
"(",
"null",
",",
"topicSpace",
",",
"topic",
",",
"messageHandler",
",",
"iRemoteSubscriptions",
",",
"sendProxy",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"addRemoteSubscription\"",
",",
"messageHandler",
")",
";",
"return",
"messageHandler",
";",
"}"
] | Adds a remote subscription to this ME.
This subscription would have originated from another Bus/bus
@param topicSpace The subscriptions topicSpace.
@param topic The subscriptions topic.
@param messageHandler The subscriptionMessage that will be used for
sending to Neighbouring ME's
@param sendProxy If the proxy request should be sent | [
"Adds",
"a",
"remote",
"subscription",
"to",
"this",
"ME",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java#L222-L246 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java | BusGroup.removeRemoteSubscription | SubscriptionMessageHandler removeRemoteSubscription(
SIBUuid12 topicSpace,
String topic,
SubscriptionMessageHandler messageHandler,
boolean sendProxy)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "removeRemoteSubscription",
new Object[] {
topicSpace,
topic,
messageHandler});
messageHandler =
removeSubscription(topicSpace,
topic,
messageHandler,
iRemoteSubscriptions,
sendProxy);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "removeRemoteSubscription", messageHandler);
return messageHandler;
} | java | SubscriptionMessageHandler removeRemoteSubscription(
SIBUuid12 topicSpace,
String topic,
SubscriptionMessageHandler messageHandler,
boolean sendProxy)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "removeRemoteSubscription",
new Object[] {
topicSpace,
topic,
messageHandler});
messageHandler =
removeSubscription(topicSpace,
topic,
messageHandler,
iRemoteSubscriptions,
sendProxy);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "removeRemoteSubscription", messageHandler);
return messageHandler;
} | [
"SubscriptionMessageHandler",
"removeRemoteSubscription",
"(",
"SIBUuid12",
"topicSpace",
",",
"String",
"topic",
",",
"SubscriptionMessageHandler",
"messageHandler",
",",
"boolean",
"sendProxy",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"removeRemoteSubscription\"",
",",
"new",
"Object",
"[",
"]",
"{",
"topicSpace",
",",
"topic",
",",
"messageHandler",
"}",
")",
";",
"messageHandler",
"=",
"removeSubscription",
"(",
"topicSpace",
",",
"topic",
",",
"messageHandler",
",",
"iRemoteSubscriptions",
",",
"sendProxy",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"removeRemoteSubscription\"",
",",
"messageHandler",
")",
";",
"return",
"messageHandler",
";",
"}"
] | Called when an unsubscribe needs to be propagated to the group.
Decrements the reference count on the subscription for any
subscriptions registered remotely.
@param topicSpace The topicSpace for the subscription
@param topic The topic of the subscription
@param messageHandler The message that is used to forward onto Neighbours
@return SubscriptionMessageHandler The new subscription message handler
if one was created. | [
"Called",
"when",
"an",
"unsubscribe",
"needs",
"to",
"be",
"propagated",
"to",
"the",
"group",
".",
"Decrements",
"the",
"reference",
"count",
"on",
"the",
"subscription",
"for",
"any",
"subscriptions",
"registered",
"remotely",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java#L426-L450 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java | BusGroup.removeSubscription | private SubscriptionMessageHandler removeSubscription(
SIBUuid12 topicSpace,
String topic,
SubscriptionMessageHandler messageHandler,
Hashtable subscriptionsTable,
boolean sendProxy)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"removeSubscription",
new Object[] {
topicSpace,
topic,
messageHandler,
subscriptionsTable,
new Boolean(sendProxy)});
// Get a key to find the Subscription with
final String key = subscriptionKey(topicSpace, topic);
synchronized( subscriptionLock )
{
// Find the subscription from this Buss list of subscriptions.
final MESubscription subscription = (MESubscription) subscriptionsTable.get(key);
// If the subscription doesn't exist then simply return
// as this is a Foreign Bus subscription.
if (subscription == null)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(
tc,
"removeSubscription",
"Non Existent Subscription " + topicSpace + ":" + topic);
return messageHandler;
}
// Perform the proxy subscription operation.
messageHandler = doProxySubscribeOp(subscription.removeRef(),
subscription,
messageHandler,
subscriptionsTable,
sendProxy);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "removeSubscription", messageHandler);
return messageHandler;
} | java | private SubscriptionMessageHandler removeSubscription(
SIBUuid12 topicSpace,
String topic,
SubscriptionMessageHandler messageHandler,
Hashtable subscriptionsTable,
boolean sendProxy)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"removeSubscription",
new Object[] {
topicSpace,
topic,
messageHandler,
subscriptionsTable,
new Boolean(sendProxy)});
// Get a key to find the Subscription with
final String key = subscriptionKey(topicSpace, topic);
synchronized( subscriptionLock )
{
// Find the subscription from this Buss list of subscriptions.
final MESubscription subscription = (MESubscription) subscriptionsTable.get(key);
// If the subscription doesn't exist then simply return
// as this is a Foreign Bus subscription.
if (subscription == null)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(
tc,
"removeSubscription",
"Non Existent Subscription " + topicSpace + ":" + topic);
return messageHandler;
}
// Perform the proxy subscription operation.
messageHandler = doProxySubscribeOp(subscription.removeRef(),
subscription,
messageHandler,
subscriptionsTable,
sendProxy);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "removeSubscription", messageHandler);
return messageHandler;
} | [
"private",
"SubscriptionMessageHandler",
"removeSubscription",
"(",
"SIBUuid12",
"topicSpace",
",",
"String",
"topic",
",",
"SubscriptionMessageHandler",
"messageHandler",
",",
"Hashtable",
"subscriptionsTable",
",",
"boolean",
"sendProxy",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"removeSubscription\"",
",",
"new",
"Object",
"[",
"]",
"{",
"topicSpace",
",",
"topic",
",",
"messageHandler",
",",
"subscriptionsTable",
",",
"new",
"Boolean",
"(",
"sendProxy",
")",
"}",
")",
";",
"// Get a key to find the Subscription with",
"final",
"String",
"key",
"=",
"subscriptionKey",
"(",
"topicSpace",
",",
"topic",
")",
";",
"synchronized",
"(",
"subscriptionLock",
")",
"{",
"// Find the subscription from this Buss list of subscriptions.",
"final",
"MESubscription",
"subscription",
"=",
"(",
"MESubscription",
")",
"subscriptionsTable",
".",
"get",
"(",
"key",
")",
";",
"// If the subscription doesn't exist then simply return",
"// as this is a Foreign Bus subscription.",
"if",
"(",
"subscription",
"==",
"null",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"removeSubscription\"",
",",
"\"Non Existent Subscription \"",
"+",
"topicSpace",
"+",
"\":\"",
"+",
"topic",
")",
";",
"return",
"messageHandler",
";",
"}",
"// Perform the proxy subscription operation.",
"messageHandler",
"=",
"doProxySubscribeOp",
"(",
"subscription",
".",
"removeRef",
"(",
")",
",",
"subscription",
",",
"messageHandler",
",",
"subscriptionsTable",
",",
"sendProxy",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"removeSubscription\"",
",",
"messageHandler",
")",
";",
"return",
"messageHandler",
";",
"}"
] | Called when an unsubscribe needs to be propagated to the group.
Decrements the reference count on the subscription.
@param topicSpace The topicSpace for the subscription
@param topic The topic of the subscription
@param sendProxy Indicates whether to send proxy .
@param messageHandler The message that is used to forward onto Neighbours
@return SubscriptionMessageHandler The new subscription message handler
if one was created. | [
"Called",
"when",
"an",
"unsubscribe",
"needs",
"to",
"be",
"propagated",
"to",
"the",
"group",
".",
"Decrements",
"the",
"reference",
"count",
"on",
"the",
"subscription",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java#L464-L515 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java | BusGroup.sendToNeighbours | protected void sendToNeighbours(SubscriptionMessage msg, Transaction transaction, boolean startup)
throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "sendToNeighbours", new Object[] { msg, transaction, new Boolean(startup)});
for (int i = 0; i < iNeighbours.length; i++)
{
// Only want to set the subscription message type if we are at startup.
if (startup)
{
msg.setSubscriptionMessageType(SubscriptionMessageType.REQUEST);
iNeighbours[i].setRequestedProxySubscriptions();
}
iNeighbours[i].sendToNeighbour(msg, transaction);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "sendToNeighbours");
} | java | protected void sendToNeighbours(SubscriptionMessage msg, Transaction transaction, boolean startup)
throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "sendToNeighbours", new Object[] { msg, transaction, new Boolean(startup)});
for (int i = 0; i < iNeighbours.length; i++)
{
// Only want to set the subscription message type if we are at startup.
if (startup)
{
msg.setSubscriptionMessageType(SubscriptionMessageType.REQUEST);
iNeighbours[i].setRequestedProxySubscriptions();
}
iNeighbours[i].sendToNeighbour(msg, transaction);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "sendToNeighbours");
} | [
"protected",
"void",
"sendToNeighbours",
"(",
"SubscriptionMessage",
"msg",
",",
"Transaction",
"transaction",
",",
"boolean",
"startup",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"sendToNeighbours\"",
",",
"new",
"Object",
"[",
"]",
"{",
"msg",
",",
"transaction",
",",
"new",
"Boolean",
"(",
"startup",
")",
"}",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"iNeighbours",
".",
"length",
";",
"i",
"++",
")",
"{",
"// Only want to set the subscription message type if we are at startup.",
"if",
"(",
"startup",
")",
"{",
"msg",
".",
"setSubscriptionMessageType",
"(",
"SubscriptionMessageType",
".",
"REQUEST",
")",
";",
"iNeighbours",
"[",
"i",
"]",
".",
"setRequestedProxySubscriptions",
"(",
")",
";",
"}",
"iNeighbours",
"[",
"i",
"]",
".",
"sendToNeighbour",
"(",
"msg",
",",
"transaction",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"sendToNeighbours\"",
")",
";",
"}"
] | Sends the messages to all the Neighbours in this Bus.
@param transaction The transaction to send the message under
@param msg The message to be sent. | [
"Sends",
"the",
"messages",
"to",
"all",
"the",
"Neighbours",
"in",
"this",
"Bus",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java#L522-L542 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java | BusGroup.addNeighbour | void addNeighbour(Neighbour neighbour)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "addNeighbour", neighbour);
final Neighbour[] tmp = new Neighbour[iNeighbours.length + 1];
System.arraycopy(iNeighbours, 0, tmp, 0, iNeighbours.length);
tmp[iNeighbours.length] = neighbour;
iNeighbours = tmp;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "addNeighbour");
} | java | void addNeighbour(Neighbour neighbour)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "addNeighbour", neighbour);
final Neighbour[] tmp = new Neighbour[iNeighbours.length + 1];
System.arraycopy(iNeighbours, 0, tmp, 0, iNeighbours.length);
tmp[iNeighbours.length] = neighbour;
iNeighbours = tmp;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "addNeighbour");
} | [
"void",
"addNeighbour",
"(",
"Neighbour",
"neighbour",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"addNeighbour\"",
",",
"neighbour",
")",
";",
"final",
"Neighbour",
"[",
"]",
"tmp",
"=",
"new",
"Neighbour",
"[",
"iNeighbours",
".",
"length",
"+",
"1",
"]",
";",
"System",
".",
"arraycopy",
"(",
"iNeighbours",
",",
"0",
",",
"tmp",
",",
"0",
",",
"iNeighbours",
".",
"length",
")",
";",
"tmp",
"[",
"iNeighbours",
".",
"length",
"]",
"=",
"neighbour",
";",
"iNeighbours",
"=",
"tmp",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"addNeighbour\"",
")",
";",
"}"
] | Adds a reference of Neighbour to this Bus group
@param neighbour The neighbour to be added to the group | [
"Adds",
"a",
"reference",
"of",
"Neighbour",
"to",
"this",
"Bus",
"group"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java#L550-L563 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java | BusGroup.removeNeighbour | void removeNeighbour(Neighbour neighbour)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "removeNeighbour", neighbour);
Neighbour[] tmp = iNeighbours;
// Loop through the Neighbours in this Bus
for (int i = 0; i < iNeighbours.length; ++i)
if (iNeighbours[i].equals(neighbour))
{
// If the Neighbours match, then resize the array without this
// Neighbour in it.
tmp = new Neighbour[iNeighbours.length - 1];
System.arraycopy(iNeighbours, 0, tmp, 0, i);
System.arraycopy(
iNeighbours,
i + 1,
tmp,
i,
iNeighbours.length - i - 1);
iNeighbours = tmp;
break;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "removeNeighbour");
} | java | void removeNeighbour(Neighbour neighbour)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "removeNeighbour", neighbour);
Neighbour[] tmp = iNeighbours;
// Loop through the Neighbours in this Bus
for (int i = 0; i < iNeighbours.length; ++i)
if (iNeighbours[i].equals(neighbour))
{
// If the Neighbours match, then resize the array without this
// Neighbour in it.
tmp = new Neighbour[iNeighbours.length - 1];
System.arraycopy(iNeighbours, 0, tmp, 0, i);
System.arraycopy(
iNeighbours,
i + 1,
tmp,
i,
iNeighbours.length - i - 1);
iNeighbours = tmp;
break;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "removeNeighbour");
} | [
"void",
"removeNeighbour",
"(",
"Neighbour",
"neighbour",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"removeNeighbour\"",
",",
"neighbour",
")",
";",
"Neighbour",
"[",
"]",
"tmp",
"=",
"iNeighbours",
";",
"// Loop through the Neighbours in this Bus",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"iNeighbours",
".",
"length",
";",
"++",
"i",
")",
"if",
"(",
"iNeighbours",
"[",
"i",
"]",
".",
"equals",
"(",
"neighbour",
")",
")",
"{",
"// If the Neighbours match, then resize the array without this",
"// Neighbour in it.",
"tmp",
"=",
"new",
"Neighbour",
"[",
"iNeighbours",
".",
"length",
"-",
"1",
"]",
";",
"System",
".",
"arraycopy",
"(",
"iNeighbours",
",",
"0",
",",
"tmp",
",",
"0",
",",
"i",
")",
";",
"System",
".",
"arraycopy",
"(",
"iNeighbours",
",",
"i",
"+",
"1",
",",
"tmp",
",",
"i",
",",
"iNeighbours",
".",
"length",
"-",
"i",
"-",
"1",
")",
";",
"iNeighbours",
"=",
"tmp",
";",
"break",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"removeNeighbour\"",
")",
";",
"}"
] | Removes a Neighbour reference from this Bus group
@param neighbour The Neighbour to be removed | [
"Removes",
"a",
"Neighbour",
"reference",
"from",
"this",
"Bus",
"group"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java#L571-L600 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java | BusGroup.doProxySubscribeOp | private SubscriptionMessageHandler doProxySubscribeOp(
int op,
MESubscription subscription,
SubscriptionMessageHandler messageHandler,
Hashtable subscriptionsTable,
boolean sendProxy)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"doProxySubscribeOp",
new Object[] {
new Integer(op),
subscription,
messageHandler,
new Boolean(sendProxy)});
// If we don't want to send proxy messages, set the operation to be
// no operation.
if (!sendProxy)
{
// If we aren't to send the proxy and we have an unsubscribe, then we need
// to remove the subscription from the list.
if (op == MESubscription.UNSUBSCRIBE)
subscriptionsTable.remove(
subscriptionKey(
subscription.getTopicSpaceUuid(),
subscription.getTopic()));
op = MESubscription.NOP;
}
// Perform an action depending on the required operation.
switch (op)
{
// For new subscriptions or modified subscriptions, send a proxy subscription
// message to all active neighbours.
case MESubscription.SUBSCRIBE :
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(
tc,
"Publishing new Subscription "
+ subscription + "," + sendProxy);
// Create the Proxy Message to be sent to all the Neighbours in this
// Bus
if (messageHandler == null)
{
messageHandler = iProxyHandler.getMessageHandler();
// Reset the message.
messageHandler.resetCreateSubscriptionMessage(subscription, isLocalBus);
}
else
{
// Add the subscription to the message
messageHandler.addSubscriptionToMessage(subscription, isLocalBus);
}
break;
case MESubscription.UNSUBSCRIBE :
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(
tc,
"Publishing Delete subscription "
+ subscription + "," + sendProxy);
// Create the Proxy Message to be sent to all the Neighbours in this
// Bus.
messageHandler = iProxyHandler.getMessageHandler();
// Reset the message.
messageHandler.resetDeleteSubscriptionMessage(subscription, isLocalBus);
// Remove the subscription from the table.
subscriptionsTable.remove(
subscriptionKey(
subscription.getTopicSpaceUuid(),
subscription.getTopic()));
// Send the message to the Neighbours
break;
// For other operations, do nothing.
default :
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(
tc,
"Doing nothing for subscription "
+ subscription + "," + sendProxy);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "doProxySubscribeOp", messageHandler);
return messageHandler;
} | java | private SubscriptionMessageHandler doProxySubscribeOp(
int op,
MESubscription subscription,
SubscriptionMessageHandler messageHandler,
Hashtable subscriptionsTable,
boolean sendProxy)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"doProxySubscribeOp",
new Object[] {
new Integer(op),
subscription,
messageHandler,
new Boolean(sendProxy)});
// If we don't want to send proxy messages, set the operation to be
// no operation.
if (!sendProxy)
{
// If we aren't to send the proxy and we have an unsubscribe, then we need
// to remove the subscription from the list.
if (op == MESubscription.UNSUBSCRIBE)
subscriptionsTable.remove(
subscriptionKey(
subscription.getTopicSpaceUuid(),
subscription.getTopic()));
op = MESubscription.NOP;
}
// Perform an action depending on the required operation.
switch (op)
{
// For new subscriptions or modified subscriptions, send a proxy subscription
// message to all active neighbours.
case MESubscription.SUBSCRIBE :
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(
tc,
"Publishing new Subscription "
+ subscription + "," + sendProxy);
// Create the Proxy Message to be sent to all the Neighbours in this
// Bus
if (messageHandler == null)
{
messageHandler = iProxyHandler.getMessageHandler();
// Reset the message.
messageHandler.resetCreateSubscriptionMessage(subscription, isLocalBus);
}
else
{
// Add the subscription to the message
messageHandler.addSubscriptionToMessage(subscription, isLocalBus);
}
break;
case MESubscription.UNSUBSCRIBE :
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(
tc,
"Publishing Delete subscription "
+ subscription + "," + sendProxy);
// Create the Proxy Message to be sent to all the Neighbours in this
// Bus.
messageHandler = iProxyHandler.getMessageHandler();
// Reset the message.
messageHandler.resetDeleteSubscriptionMessage(subscription, isLocalBus);
// Remove the subscription from the table.
subscriptionsTable.remove(
subscriptionKey(
subscription.getTopicSpaceUuid(),
subscription.getTopic()));
// Send the message to the Neighbours
break;
// For other operations, do nothing.
default :
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(
tc,
"Doing nothing for subscription "
+ subscription + "," + sendProxy);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "doProxySubscribeOp", messageHandler);
return messageHandler;
} | [
"private",
"SubscriptionMessageHandler",
"doProxySubscribeOp",
"(",
"int",
"op",
",",
"MESubscription",
"subscription",
",",
"SubscriptionMessageHandler",
"messageHandler",
",",
"Hashtable",
"subscriptionsTable",
",",
"boolean",
"sendProxy",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"doProxySubscribeOp\"",
",",
"new",
"Object",
"[",
"]",
"{",
"new",
"Integer",
"(",
"op",
")",
",",
"subscription",
",",
"messageHandler",
",",
"new",
"Boolean",
"(",
"sendProxy",
")",
"}",
")",
";",
"// If we don't want to send proxy messages, set the operation to be",
"// no operation.",
"if",
"(",
"!",
"sendProxy",
")",
"{",
"// If we aren't to send the proxy and we have an unsubscribe, then we need",
"// to remove the subscription from the list.",
"if",
"(",
"op",
"==",
"MESubscription",
".",
"UNSUBSCRIBE",
")",
"subscriptionsTable",
".",
"remove",
"(",
"subscriptionKey",
"(",
"subscription",
".",
"getTopicSpaceUuid",
"(",
")",
",",
"subscription",
".",
"getTopic",
"(",
")",
")",
")",
";",
"op",
"=",
"MESubscription",
".",
"NOP",
";",
"}",
"// Perform an action depending on the required operation.",
"switch",
"(",
"op",
")",
"{",
"// For new subscriptions or modified subscriptions, send a proxy subscription",
"// message to all active neighbours.",
"case",
"MESubscription",
".",
"SUBSCRIBE",
":",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"Publishing new Subscription \"",
"+",
"subscription",
"+",
"\",\"",
"+",
"sendProxy",
")",
";",
"// Create the Proxy Message to be sent to all the Neighbours in this",
"// Bus ",
"if",
"(",
"messageHandler",
"==",
"null",
")",
"{",
"messageHandler",
"=",
"iProxyHandler",
".",
"getMessageHandler",
"(",
")",
";",
"// Reset the message.",
"messageHandler",
".",
"resetCreateSubscriptionMessage",
"(",
"subscription",
",",
"isLocalBus",
")",
";",
"}",
"else",
"{",
"// Add the subscription to the message",
"messageHandler",
".",
"addSubscriptionToMessage",
"(",
"subscription",
",",
"isLocalBus",
")",
";",
"}",
"break",
";",
"case",
"MESubscription",
".",
"UNSUBSCRIBE",
":",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"Publishing Delete subscription \"",
"+",
"subscription",
"+",
"\",\"",
"+",
"sendProxy",
")",
";",
"// Create the Proxy Message to be sent to all the Neighbours in this",
"// Bus.",
"messageHandler",
"=",
"iProxyHandler",
".",
"getMessageHandler",
"(",
")",
";",
"// Reset the message.",
"messageHandler",
".",
"resetDeleteSubscriptionMessage",
"(",
"subscription",
",",
"isLocalBus",
")",
";",
"// Remove the subscription from the table.",
"subscriptionsTable",
".",
"remove",
"(",
"subscriptionKey",
"(",
"subscription",
".",
"getTopicSpaceUuid",
"(",
")",
",",
"subscription",
".",
"getTopic",
"(",
")",
")",
")",
";",
"// Send the message to the Neighbours",
"break",
";",
"// For other operations, do nothing.",
"default",
":",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"Doing nothing for subscription \"",
"+",
"subscription",
"+",
"\",\"",
"+",
"sendProxy",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"doProxySubscribeOp\"",
",",
"messageHandler",
")",
";",
"return",
"messageHandler",
";",
"}"
] | Performs a proxy subscription operation for the given subscription.
@param op The operation to be performed.
@param subscription The subscription.
@param sendProxy Indicates whether to send the proxy message.
@param messageHandler The handler used for creating the message
@return SubscriptionMessageHandler The subscription message that was used
to send to the Neighbour | [
"Performs",
"a",
"proxy",
"subscription",
"operation",
"for",
"the",
"given",
"subscription",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java#L614-L717 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java | BusGroup.generateResetSubscriptionMessage | protected SubscriptionMessage generateResetSubscriptionMessage()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "generateResetSubscriptionMessage");
// Get the Message Handler for doing this operation.
final SubscriptionMessageHandler messageHandler =
iProxyHandler.getMessageHandler();
// Reset the message.
messageHandler.resetResetSubscriptionMessage();
// Add the local subscriptions
addToMessage(messageHandler, iLocalSubscriptions);
// Add the remote Subscriptions
addToMessage(messageHandler, iRemoteSubscriptions);
SubscriptionMessage message = messageHandler.getSubscriptionMessage();
// Add the message back into the pool
iProxyHandler.addMessageHandler(messageHandler);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "generateResetSubscriptionMessage", message);
return message;
} | java | protected SubscriptionMessage generateResetSubscriptionMessage()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "generateResetSubscriptionMessage");
// Get the Message Handler for doing this operation.
final SubscriptionMessageHandler messageHandler =
iProxyHandler.getMessageHandler();
// Reset the message.
messageHandler.resetResetSubscriptionMessage();
// Add the local subscriptions
addToMessage(messageHandler, iLocalSubscriptions);
// Add the remote Subscriptions
addToMessage(messageHandler, iRemoteSubscriptions);
SubscriptionMessage message = messageHandler.getSubscriptionMessage();
// Add the message back into the pool
iProxyHandler.addMessageHandler(messageHandler);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "generateResetSubscriptionMessage", message);
return message;
} | [
"protected",
"SubscriptionMessage",
"generateResetSubscriptionMessage",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"generateResetSubscriptionMessage\"",
")",
";",
"// Get the Message Handler for doing this operation.",
"final",
"SubscriptionMessageHandler",
"messageHandler",
"=",
"iProxyHandler",
".",
"getMessageHandler",
"(",
")",
";",
"// Reset the message.",
"messageHandler",
".",
"resetResetSubscriptionMessage",
"(",
")",
";",
"// Add the local subscriptions",
"addToMessage",
"(",
"messageHandler",
",",
"iLocalSubscriptions",
")",
";",
"// Add the remote Subscriptions",
"addToMessage",
"(",
"messageHandler",
",",
"iRemoteSubscriptions",
")",
";",
"SubscriptionMessage",
"message",
"=",
"messageHandler",
".",
"getSubscriptionMessage",
"(",
")",
";",
"// Add the message back into the pool",
"iProxyHandler",
".",
"addMessageHandler",
"(",
"messageHandler",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"generateResetSubscriptionMessage\"",
",",
"message",
")",
";",
"return",
"message",
";",
"}"
] | Generates the reset subscription message that should be sent to a
member, or members of this Bus.
@return a new ResetSubscriptionMessage | [
"Generates",
"the",
"reset",
"subscription",
"message",
"that",
"should",
"be",
"sent",
"to",
"a",
"member",
"or",
"members",
"of",
"this",
"Bus",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java#L770-L797 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java | BusGroup.generateReplySubscriptionMessage | protected SubscriptionMessage generateReplySubscriptionMessage()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "generateReplySubscriptionMessage");
// Get the Message Handler for doing this operation.
final SubscriptionMessageHandler messageHandler =
iProxyHandler.getMessageHandler();
// Reset the message.
messageHandler.resetReplySubscriptionMessage();
if (iLocalSubscriptions.size() > 0)
// Add the local subscriptions
addToMessage(messageHandler, iLocalSubscriptions);
if (iRemoteSubscriptions.size() > 0)
// Add the remote Subscriptions
addToMessage(messageHandler, iRemoteSubscriptions);
SubscriptionMessage message = messageHandler.getSubscriptionMessage();
// Add the message back into the pool
iProxyHandler.addMessageHandler(messageHandler);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "generateReplySubscriptionMessage", message);
return message;
} | java | protected SubscriptionMessage generateReplySubscriptionMessage()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "generateReplySubscriptionMessage");
// Get the Message Handler for doing this operation.
final SubscriptionMessageHandler messageHandler =
iProxyHandler.getMessageHandler();
// Reset the message.
messageHandler.resetReplySubscriptionMessage();
if (iLocalSubscriptions.size() > 0)
// Add the local subscriptions
addToMessage(messageHandler, iLocalSubscriptions);
if (iRemoteSubscriptions.size() > 0)
// Add the remote Subscriptions
addToMessage(messageHandler, iRemoteSubscriptions);
SubscriptionMessage message = messageHandler.getSubscriptionMessage();
// Add the message back into the pool
iProxyHandler.addMessageHandler(messageHandler);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "generateReplySubscriptionMessage", message);
return message;
} | [
"protected",
"SubscriptionMessage",
"generateReplySubscriptionMessage",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"generateReplySubscriptionMessage\"",
")",
";",
"// Get the Message Handler for doing this operation.",
"final",
"SubscriptionMessageHandler",
"messageHandler",
"=",
"iProxyHandler",
".",
"getMessageHandler",
"(",
")",
";",
"// Reset the message.",
"messageHandler",
".",
"resetReplySubscriptionMessage",
"(",
")",
";",
"if",
"(",
"iLocalSubscriptions",
".",
"size",
"(",
")",
">",
"0",
")",
"// Add the local subscriptions",
"addToMessage",
"(",
"messageHandler",
",",
"iLocalSubscriptions",
")",
";",
"if",
"(",
"iRemoteSubscriptions",
".",
"size",
"(",
")",
">",
"0",
")",
"// Add the remote Subscriptions",
"addToMessage",
"(",
"messageHandler",
",",
"iRemoteSubscriptions",
")",
";",
"SubscriptionMessage",
"message",
"=",
"messageHandler",
".",
"getSubscriptionMessage",
"(",
")",
";",
"// Add the message back into the pool",
"iProxyHandler",
".",
"addMessageHandler",
"(",
"messageHandler",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"generateReplySubscriptionMessage\"",
",",
"message",
")",
";",
"return",
"message",
";",
"}"
] | Generates the reply subscription message that should be sent to a
the neighbor on the Bus who sent the request.
@return a new ReplySubscriptionMessage | [
"Generates",
"the",
"reply",
"subscription",
"message",
"that",
"should",
"be",
"sent",
"to",
"a",
"the",
"neighbor",
"on",
"the",
"Bus",
"who",
"sent",
"the",
"request",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java#L805-L834 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java | BusGroup.addToMessage | private final void addToMessage(SubscriptionMessageHandler messageHandler,
Hashtable subscriptions)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "addToMessage",
new Object[]{messageHandler, subscriptions});
// Get the enumeration of the subscriptions.
Enumeration enu = subscriptions.elements();
while (enu.hasMoreElements())
{
final MESubscription subscription = (MESubscription) enu.nextElement();
// Add this subscription into the message.
messageHandler.addSubscriptionToMessage(subscription, isLocalBus);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "addToMessage");
} | java | private final void addToMessage(SubscriptionMessageHandler messageHandler,
Hashtable subscriptions)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "addToMessage",
new Object[]{messageHandler, subscriptions});
// Get the enumeration of the subscriptions.
Enumeration enu = subscriptions.elements();
while (enu.hasMoreElements())
{
final MESubscription subscription = (MESubscription) enu.nextElement();
// Add this subscription into the message.
messageHandler.addSubscriptionToMessage(subscription, isLocalBus);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "addToMessage");
} | [
"private",
"final",
"void",
"addToMessage",
"(",
"SubscriptionMessageHandler",
"messageHandler",
",",
"Hashtable",
"subscriptions",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"addToMessage\"",
",",
"new",
"Object",
"[",
"]",
"{",
"messageHandler",
",",
"subscriptions",
"}",
")",
";",
"// Get the enumeration of the subscriptions.",
"Enumeration",
"enu",
"=",
"subscriptions",
".",
"elements",
"(",
")",
";",
"while",
"(",
"enu",
".",
"hasMoreElements",
"(",
")",
")",
"{",
"final",
"MESubscription",
"subscription",
"=",
"(",
"MESubscription",
")",
"enu",
".",
"nextElement",
"(",
")",
";",
"// Add this subscription into the message.",
"messageHandler",
".",
"addSubscriptionToMessage",
"(",
"subscription",
",",
"isLocalBus",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"addToMessage\"",
")",
";",
"}"
] | Adds the subscriptions to the subscription message
@param messageHandler The message to add to
@param subscriptions The subscriptions to be added. | [
"Adds",
"the",
"subscriptions",
"to",
"the",
"subscription",
"message"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java#L842-L861 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java | BusGroup.resetListFailed | void resetListFailed()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "resetListFailed");
for (int i = 0; i < iNeighbours.length; i++)
{
iNeighbours[i].resetListFailed();
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "resetListFailed");
} | java | void resetListFailed()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "resetListFailed");
for (int i = 0; i < iNeighbours.length; i++)
{
iNeighbours[i].resetListFailed();
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "resetListFailed");
} | [
"void",
"resetListFailed",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"resetListFailed\"",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"iNeighbours",
".",
"length",
";",
"i",
"++",
")",
"{",
"iNeighbours",
"[",
"i",
"]",
".",
"resetListFailed",
"(",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"resetListFailed\"",
")",
";",
"}"
] | If at startup the reset list failed, then we need to try and send it again.
Each Neighbour needs to be told that the send failed so that it can retry. | [
"If",
"at",
"startup",
"the",
"reset",
"list",
"failed",
"then",
"we",
"need",
"to",
"try",
"and",
"send",
"it",
"again",
".",
"Each",
"Neighbour",
"needs",
"to",
"be",
"told",
"that",
"the",
"send",
"failed",
"so",
"that",
"it",
"can",
"retry",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/BusGroup.java#L867-L880 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/udpchannel/internal/WorkQueueManager.java | WorkQueueManager.getMultiThreadedWorker | protected MultiThreadedWorker getMultiThreadedWorker(SelectionKey key, long threadIdfWQM) {
MultiThreadedWorker worker = null;
synchronized (multiThreadedObjectPool) {
worker = (MultiThreadedWorker) multiThreadedObjectPool.get();
}
if (worker == null) {
worker = new MultiThreadedWorker(this);
}
worker.set(key);
return worker;
} | java | protected MultiThreadedWorker getMultiThreadedWorker(SelectionKey key, long threadIdfWQM) {
MultiThreadedWorker worker = null;
synchronized (multiThreadedObjectPool) {
worker = (MultiThreadedWorker) multiThreadedObjectPool.get();
}
if (worker == null) {
worker = new MultiThreadedWorker(this);
}
worker.set(key);
return worker;
} | [
"protected",
"MultiThreadedWorker",
"getMultiThreadedWorker",
"(",
"SelectionKey",
"key",
",",
"long",
"threadIdfWQM",
")",
"{",
"MultiThreadedWorker",
"worker",
"=",
"null",
";",
"synchronized",
"(",
"multiThreadedObjectPool",
")",
"{",
"worker",
"=",
"(",
"MultiThreadedWorker",
")",
"multiThreadedObjectPool",
".",
"get",
"(",
")",
";",
"}",
"if",
"(",
"worker",
"==",
"null",
")",
"{",
"worker",
"=",
"new",
"MultiThreadedWorker",
"(",
"this",
")",
";",
"}",
"worker",
".",
"set",
"(",
"key",
")",
";",
"return",
"worker",
";",
"}"
] | Retrieve a MultiThreadedWorker object from the object pool.
@param key
@param threadIdfWQM
@return MultiThreadedWorker | [
"Retrieve",
"a",
"MultiThreadedWorker",
"object",
"from",
"the",
"object",
"pool",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/udpchannel/internal/WorkQueueManager.java#L1062-L1075 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.service.location/src/com/ibm/ws/kernel/service/location/internal/SymbolRegistry.java | SymbolRegistry.resolveSymbolicString | String resolveSymbolicString(String symbolicPath) {
if (symbolicPath == null)
throw new NullPointerException("Path must be non-null");
return resolveStringSymbols(symbolicPath, symbolicPath, true, 0, true);
} | java | String resolveSymbolicString(String symbolicPath) {
if (symbolicPath == null)
throw new NullPointerException("Path must be non-null");
return resolveStringSymbols(symbolicPath, symbolicPath, true, 0, true);
} | [
"String",
"resolveSymbolicString",
"(",
"String",
"symbolicPath",
")",
"{",
"if",
"(",
"symbolicPath",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"Path must be non-null\"",
")",
";",
"return",
"resolveStringSymbols",
"(",
"symbolicPath",
",",
"symbolicPath",
",",
"true",
",",
"0",
",",
"true",
")",
";",
"}"
] | Resolves the given string, evaluating all symbols, and path-normalizes
the value.
@param symbolicPath
@return The resolved value, path-normalized. | [
"Resolves",
"the",
"given",
"string",
"evaluating",
"all",
"symbols",
"and",
"path",
"-",
"normalizes",
"the",
"value",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.service.location/src/com/ibm/ws/kernel/service/location/internal/SymbolRegistry.java#L200-L205 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.service.location/src/com/ibm/ws/kernel/service/location/internal/SymbolRegistry.java | SymbolRegistry.resolveRawSymbolicString | String resolveRawSymbolicString(String string) {
if (string == null)
throw new NullPointerException("String must be non-null");
return resolveStringSymbols(string, string, true, 0, false);
} | java | String resolveRawSymbolicString(String string) {
if (string == null)
throw new NullPointerException("String must be non-null");
return resolveStringSymbols(string, string, true, 0, false);
} | [
"String",
"resolveRawSymbolicString",
"(",
"String",
"string",
")",
"{",
"if",
"(",
"string",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"String must be non-null\"",
")",
";",
"return",
"resolveStringSymbols",
"(",
"string",
",",
"string",
",",
"true",
",",
"0",
",",
"false",
")",
";",
"}"
] | Resolves the given string, evaluating all symbols, but does NOT path-normalize
the value.
@param string
@return The resolved value, not path-normalized. | [
"Resolves",
"the",
"given",
"string",
"evaluating",
"all",
"symbols",
"but",
"does",
"NOT",
"path",
"-",
"normalize",
"the",
"value",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.service.location/src/com/ibm/ws/kernel/service/location/internal/SymbolRegistry.java#L215-L220 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/SSOCookieHelperImpl.java | SSOCookieHelperImpl.addJwtCookies | protected boolean addJwtCookies(String cookieByteString, HttpServletRequest req, HttpServletResponse resp) {
String baseName = getJwtCookieName();
if (baseName == null) {
return false;
}
if ((!req.isSecure()) && getJwtCookieSecure()) {
Tr.warning(tc, "JWT_COOKIE_SECURITY_MISMATCH", new Object[] {}); // CWWKS9127W
}
String[] chunks = splitString(cookieByteString, 3900);
String cookieName = baseName;
for (int i = 0; i < chunks.length; i++) {
if (i > 98) {
String eMsg = "Too many jwt cookies created";
com.ibm.ws.ffdc.FFDCFilter.processException(new Exception(eMsg), this.getClass().getName(), "132");
break;
}
Cookie ssoCookie = createCookie(req, cookieName, chunks[i], getJwtCookieSecure()); //name
resp.addCookie(ssoCookie);
cookieName = baseName + (i + 2 < 10 ? "0" : "") + (i + 2); //name02... name99
}
return true;
} | java | protected boolean addJwtCookies(String cookieByteString, HttpServletRequest req, HttpServletResponse resp) {
String baseName = getJwtCookieName();
if (baseName == null) {
return false;
}
if ((!req.isSecure()) && getJwtCookieSecure()) {
Tr.warning(tc, "JWT_COOKIE_SECURITY_MISMATCH", new Object[] {}); // CWWKS9127W
}
String[] chunks = splitString(cookieByteString, 3900);
String cookieName = baseName;
for (int i = 0; i < chunks.length; i++) {
if (i > 98) {
String eMsg = "Too many jwt cookies created";
com.ibm.ws.ffdc.FFDCFilter.processException(new Exception(eMsg), this.getClass().getName(), "132");
break;
}
Cookie ssoCookie = createCookie(req, cookieName, chunks[i], getJwtCookieSecure()); //name
resp.addCookie(ssoCookie);
cookieName = baseName + (i + 2 < 10 ? "0" : "") + (i + 2); //name02... name99
}
return true;
} | [
"protected",
"boolean",
"addJwtCookies",
"(",
"String",
"cookieByteString",
",",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"resp",
")",
"{",
"String",
"baseName",
"=",
"getJwtCookieName",
"(",
")",
";",
"if",
"(",
"baseName",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"(",
"!",
"req",
".",
"isSecure",
"(",
")",
")",
"&&",
"getJwtCookieSecure",
"(",
")",
")",
"{",
"Tr",
".",
"warning",
"(",
"tc",
",",
"\"JWT_COOKIE_SECURITY_MISMATCH\"",
",",
"new",
"Object",
"[",
"]",
"{",
"}",
")",
";",
"// CWWKS9127W",
"}",
"String",
"[",
"]",
"chunks",
"=",
"splitString",
"(",
"cookieByteString",
",",
"3900",
")",
";",
"String",
"cookieName",
"=",
"baseName",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"chunks",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"i",
">",
"98",
")",
"{",
"String",
"eMsg",
"=",
"\"Too many jwt cookies created\"",
";",
"com",
".",
"ibm",
".",
"ws",
".",
"ffdc",
".",
"FFDCFilter",
".",
"processException",
"(",
"new",
"Exception",
"(",
"eMsg",
")",
",",
"this",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
",",
"\"132\"",
")",
";",
"break",
";",
"}",
"Cookie",
"ssoCookie",
"=",
"createCookie",
"(",
"req",
",",
"cookieName",
",",
"chunks",
"[",
"i",
"]",
",",
"getJwtCookieSecure",
"(",
")",
")",
";",
"//name",
"resp",
".",
"addCookie",
"(",
"ssoCookie",
")",
";",
"cookieName",
"=",
"baseName",
"+",
"(",
"i",
"+",
"2",
"<",
"10",
"?",
"\"0\"",
":",
"\"\"",
")",
"+",
"(",
"i",
"+",
"2",
")",
";",
"//name02... name99",
"}",
"return",
"true",
";",
"}"
] | Add the cookie or cookies as needed, depending on size of token.
Return true if any cookies were added | [
"Add",
"the",
"cookie",
"or",
"cookies",
"as",
"needed",
"depending",
"on",
"size",
"of",
"token",
".",
"Return",
"true",
"if",
"any",
"cookies",
"were",
"added"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/SSOCookieHelperImpl.java#L129-L151 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/SSOCookieHelperImpl.java | SSOCookieHelperImpl.removeSSOCookieFromResponse | @Override
public void removeSSOCookieFromResponse(HttpServletResponse resp) {
if (resp instanceof com.ibm.wsspi.webcontainer.servlet.IExtendedResponse) {
((com.ibm.wsspi.webcontainer.servlet.IExtendedResponse) resp).removeCookie(getSSOCookiename());
removeJwtSSOCookies((com.ibm.wsspi.webcontainer.servlet.IExtendedResponse) resp);
}
} | java | @Override
public void removeSSOCookieFromResponse(HttpServletResponse resp) {
if (resp instanceof com.ibm.wsspi.webcontainer.servlet.IExtendedResponse) {
((com.ibm.wsspi.webcontainer.servlet.IExtendedResponse) resp).removeCookie(getSSOCookiename());
removeJwtSSOCookies((com.ibm.wsspi.webcontainer.servlet.IExtendedResponse) resp);
}
} | [
"@",
"Override",
"public",
"void",
"removeSSOCookieFromResponse",
"(",
"HttpServletResponse",
"resp",
")",
"{",
"if",
"(",
"resp",
"instanceof",
"com",
".",
"ibm",
".",
"wsspi",
".",
"webcontainer",
".",
"servlet",
".",
"IExtendedResponse",
")",
"{",
"(",
"(",
"com",
".",
"ibm",
".",
"wsspi",
".",
"webcontainer",
".",
"servlet",
".",
"IExtendedResponse",
")",
"resp",
")",
".",
"removeCookie",
"(",
"getSSOCookiename",
"(",
")",
")",
";",
"removeJwtSSOCookies",
"(",
"(",
"com",
".",
"ibm",
".",
"wsspi",
".",
"webcontainer",
".",
"servlet",
".",
"IExtendedResponse",
")",
"resp",
")",
";",
"}",
"}"
] | Remove a cookie from the response
@param subject
@param resp | [
"Remove",
"a",
"cookie",
"from",
"the",
"response"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/SSOCookieHelperImpl.java#L224-L230 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/SSOCookieHelperImpl.java | SSOCookieHelperImpl.updateCookieCache | protected synchronized void updateCookieCache(ByteArray cookieBytes, String cookieByteString) {
if (cookieByteStringCache.size() > MAX_COOKIE_STRING_ENTRIES)
cookieByteStringCache.clear();
if (cookieByteString != null)
cookieByteStringCache.put(cookieBytes, cookieByteString);
} | java | protected synchronized void updateCookieCache(ByteArray cookieBytes, String cookieByteString) {
if (cookieByteStringCache.size() > MAX_COOKIE_STRING_ENTRIES)
cookieByteStringCache.clear();
if (cookieByteString != null)
cookieByteStringCache.put(cookieBytes, cookieByteString);
} | [
"protected",
"synchronized",
"void",
"updateCookieCache",
"(",
"ByteArray",
"cookieBytes",
",",
"String",
"cookieByteString",
")",
"{",
"if",
"(",
"cookieByteStringCache",
".",
"size",
"(",
")",
">",
"MAX_COOKIE_STRING_ENTRIES",
")",
"cookieByteStringCache",
".",
"clear",
"(",
")",
";",
"if",
"(",
"cookieByteString",
"!=",
"null",
")",
"cookieByteStringCache",
".",
"put",
"(",
"cookieBytes",
",",
"cookieByteString",
")",
";",
"}"
] | Perform some cookie cache maintenance. If the cookie cache has grown too
large, clear it. Otherwise, store the cookieByteString into the cache
based on the cookieBytes.
@param cookieBytes
@param cookieByteString | [
"Perform",
"some",
"cookie",
"cache",
"maintenance",
".",
"If",
"the",
"cookie",
"cache",
"has",
"grown",
"too",
"large",
"clear",
"it",
".",
"Otherwise",
"store",
"the",
"cookieByteString",
"into",
"the",
"cache",
"based",
"on",
"the",
"cookieBytes",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/SSOCookieHelperImpl.java#L252-L257 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/SSOCookieHelperImpl.java | SSOCookieHelperImpl.isJwtCookie | protected boolean isJwtCookie(String baseName, String cookieName) {
if (baseName.equalsIgnoreCase(cookieName))
return true;
if (!(cookieName.startsWith(baseName))) {
return false;
}
if (cookieName.length() != baseName.length() + 2) {
return false;
}
String lastTwoChars = cookieName.substring(baseName.length());
return lastTwoChars.matches("\\d\\d");
} | java | protected boolean isJwtCookie(String baseName, String cookieName) {
if (baseName.equalsIgnoreCase(cookieName))
return true;
if (!(cookieName.startsWith(baseName))) {
return false;
}
if (cookieName.length() != baseName.length() + 2) {
return false;
}
String lastTwoChars = cookieName.substring(baseName.length());
return lastTwoChars.matches("\\d\\d");
} | [
"protected",
"boolean",
"isJwtCookie",
"(",
"String",
"baseName",
",",
"String",
"cookieName",
")",
"{",
"if",
"(",
"baseName",
".",
"equalsIgnoreCase",
"(",
"cookieName",
")",
")",
"return",
"true",
";",
"if",
"(",
"!",
"(",
"cookieName",
".",
"startsWith",
"(",
"baseName",
")",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"cookieName",
".",
"length",
"(",
")",
"!=",
"baseName",
".",
"length",
"(",
")",
"+",
"2",
")",
"{",
"return",
"false",
";",
"}",
"String",
"lastTwoChars",
"=",
"cookieName",
".",
"substring",
"(",
"baseName",
".",
"length",
"(",
")",
")",
";",
"return",
"lastTwoChars",
".",
"matches",
"(",
"\"\\\\d\\\\d\"",
")",
";",
"}"
] | see if cookiename is a jwtsso cookie based on the name. | [
"see",
"if",
"cookiename",
"is",
"a",
"jwtsso",
"cookie",
"based",
"on",
"the",
"name",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/SSOCookieHelperImpl.java#L322-L333 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/SSOCookieHelperImpl.java | SSOCookieHelperImpl.resolveCookieName | protected String resolveCookieName(Cookie[] cookies) {
boolean foundCookie = false;
String ssoCookieName = this.getSSOCookiename();
if (cookies != null) {
for (int i = 0; i < cookies.length; i++) {
if (cookies[i].getName().equalsIgnoreCase(ssoCookieName)) {
foundCookie = true;
break;
}
}
}
if (!foundCookie && !config.isUseOnlyCustomCookieName())
return SSOAuthenticator.DEFAULT_SSO_COOKIE_NAME;
else
return ssoCookieName;
} | java | protected String resolveCookieName(Cookie[] cookies) {
boolean foundCookie = false;
String ssoCookieName = this.getSSOCookiename();
if (cookies != null) {
for (int i = 0; i < cookies.length; i++) {
if (cookies[i].getName().equalsIgnoreCase(ssoCookieName)) {
foundCookie = true;
break;
}
}
}
if (!foundCookie && !config.isUseOnlyCustomCookieName())
return SSOAuthenticator.DEFAULT_SSO_COOKIE_NAME;
else
return ssoCookieName;
} | [
"protected",
"String",
"resolveCookieName",
"(",
"Cookie",
"[",
"]",
"cookies",
")",
"{",
"boolean",
"foundCookie",
"=",
"false",
";",
"String",
"ssoCookieName",
"=",
"this",
".",
"getSSOCookiename",
"(",
")",
";",
"if",
"(",
"cookies",
"!=",
"null",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"cookies",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"cookies",
"[",
"i",
"]",
".",
"getName",
"(",
")",
".",
"equalsIgnoreCase",
"(",
"ssoCookieName",
")",
")",
"{",
"foundCookie",
"=",
"true",
";",
"break",
";",
"}",
"}",
"}",
"if",
"(",
"!",
"foundCookie",
"&&",
"!",
"config",
".",
"isUseOnlyCustomCookieName",
"(",
")",
")",
"return",
"SSOAuthenticator",
".",
"DEFAULT_SSO_COOKIE_NAME",
";",
"else",
"return",
"ssoCookieName",
";",
"}"
] | 1) If we found the cookie associate with the cookie name, we will use the cookie name
2) If we can not find the cookie associate with the cookie name, we will use the default cookie name LTPAToken2 if isUseOnlyCustomCookieName is false | [
"1",
")",
"If",
"we",
"found",
"the",
"cookie",
"associate",
"with",
"the",
"cookie",
"name",
"we",
"will",
"use",
"the",
"cookie",
"name",
"2",
")",
"If",
"we",
"can",
"not",
"find",
"the",
"cookie",
"associate",
"with",
"the",
"cookie",
"name",
"we",
"will",
"use",
"the",
"default",
"cookie",
"name",
"LTPAToken2",
"if",
"isUseOnlyCustomCookieName",
"is",
"false"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/SSOCookieHelperImpl.java#L339-L354 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/SSOCookieHelperImpl.java | SSOCookieHelperImpl.getJwtSsoTokenFromCookies | @Override
public String getJwtSsoTokenFromCookies(HttpServletRequest req, String baseName) {
StringBuffer tokenStr = new StringBuffer();
String cookieName = baseName;
for (int i = 1; i <= 99; i++) {
if (i > 1) {
cookieName = baseName + (i < 10 ? "0" : "") + i; //name02... name99
}
String cookieValue = getCookieValue(req, cookieName);
if (cookieValue == null) {
break;
}
if (cookieValue.length() > 0) {
tokenStr.append(cookieValue);
}
}
return tokenStr.length() > 0 ? tokenStr.toString() : null;
} | java | @Override
public String getJwtSsoTokenFromCookies(HttpServletRequest req, String baseName) {
StringBuffer tokenStr = new StringBuffer();
String cookieName = baseName;
for (int i = 1; i <= 99; i++) {
if (i > 1) {
cookieName = baseName + (i < 10 ? "0" : "") + i; //name02... name99
}
String cookieValue = getCookieValue(req, cookieName);
if (cookieValue == null) {
break;
}
if (cookieValue.length() > 0) {
tokenStr.append(cookieValue);
}
}
return tokenStr.length() > 0 ? tokenStr.toString() : null;
} | [
"@",
"Override",
"public",
"String",
"getJwtSsoTokenFromCookies",
"(",
"HttpServletRequest",
"req",
",",
"String",
"baseName",
")",
"{",
"StringBuffer",
"tokenStr",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"String",
"cookieName",
"=",
"baseName",
";",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<=",
"99",
";",
"i",
"++",
")",
"{",
"if",
"(",
"i",
">",
"1",
")",
"{",
"cookieName",
"=",
"baseName",
"+",
"(",
"i",
"<",
"10",
"?",
"\"0\"",
":",
"\"\"",
")",
"+",
"i",
";",
"//name02... name99",
"}",
"String",
"cookieValue",
"=",
"getCookieValue",
"(",
"req",
",",
"cookieName",
")",
";",
"if",
"(",
"cookieValue",
"==",
"null",
")",
"{",
"break",
";",
"}",
"if",
"(",
"cookieValue",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"tokenStr",
".",
"append",
"(",
"cookieValue",
")",
";",
"}",
"}",
"return",
"tokenStr",
".",
"length",
"(",
")",
">",
"0",
"?",
"tokenStr",
".",
"toString",
"(",
")",
":",
"null",
";",
"}"
] | The token can be split across multiple cookies if it is over 3900 chars.
Look for subsequent cookies and concatenate them in that case.
The counterpart for this method is SSOCookieHelperImpl.addJwtSsoCookiesToResponse.
@param req
@return the token String or null if nothing found. | [
"The",
"token",
"can",
"be",
"split",
"across",
"multiple",
"cookies",
"if",
"it",
"is",
"over",
"3900",
"chars",
".",
"Look",
"for",
"subsequent",
"cookies",
"and",
"concatenate",
"them",
"in",
"that",
"case",
".",
"The",
"counterpart",
"for",
"this",
"method",
"is",
"SSOCookieHelperImpl",
".",
"addJwtSsoCookiesToResponse",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/SSOCookieHelperImpl.java#L519-L537 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/asn1/DERGeneralizedTime.java | DERGeneralizedTime.getInstance | public static DERGeneralizedTime getInstance(
Object obj)
{
if (obj == null || obj instanceof DERGeneralizedTime)
{
return (DERGeneralizedTime)obj;
}
if (obj instanceof ASN1OctetString)
{
return new DERGeneralizedTime(((ASN1OctetString)obj).getOctets());
}
throw new IllegalArgumentException("illegal object in getInstance: " + obj.getClass().getName());
} | java | public static DERGeneralizedTime getInstance(
Object obj)
{
if (obj == null || obj instanceof DERGeneralizedTime)
{
return (DERGeneralizedTime)obj;
}
if (obj instanceof ASN1OctetString)
{
return new DERGeneralizedTime(((ASN1OctetString)obj).getOctets());
}
throw new IllegalArgumentException("illegal object in getInstance: " + obj.getClass().getName());
} | [
"public",
"static",
"DERGeneralizedTime",
"getInstance",
"(",
"Object",
"obj",
")",
"{",
"if",
"(",
"obj",
"==",
"null",
"||",
"obj",
"instanceof",
"DERGeneralizedTime",
")",
"{",
"return",
"(",
"DERGeneralizedTime",
")",
"obj",
";",
"}",
"if",
"(",
"obj",
"instanceof",
"ASN1OctetString",
")",
"{",
"return",
"new",
"DERGeneralizedTime",
"(",
"(",
"(",
"ASN1OctetString",
")",
"obj",
")",
".",
"getOctets",
"(",
")",
")",
";",
"}",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"illegal object in getInstance: \"",
"+",
"obj",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
")",
";",
"}"
] | return a generalized time from the passed in object
@exception IllegalArgumentException if the object cannot be converted. | [
"return",
"a",
"generalized",
"time",
"from",
"the",
"passed",
"in",
"object"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/asn1/DERGeneralizedTime.java#L36-L50 | train |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/ws/Transaction/JTA/JTAResourceBase.java | JTAResourceBase.start | public final void start() throws XAException
{
if (tc.isEntryEnabled()) Tr.entry(tc, "start", new Object[]{_resource, printState(_state)});
if (tcSummary.isDebugEnabled()) Tr.debug(tcSummary, "xa_start", this);
int rc = -1; // not an XA RC
try
{
int flags;
// Check the current state of the XAResource.
switch (_state)
{
case NOT_ASSOCIATED:
flags = _startFlag;
break;
case NOT_ASSOCIATED_AND_TMJOIN:
flags = XAResource.TMJOIN;
break;
case ACTIVE:
if (tc.isEntryEnabled()) Tr.exit(tc, "startAssociation");
return;
case SUSPENDED:
if (!_supportResume)
{
Tr.warning(tc, "WTRN0021_TMRESUME_NOT_SUPPORTED");
throw new XAException(XAException.XAER_INVAL);
}
flags = XAResource.TMRESUME;
break;
case ROLLBACK_ONLY:
throw new XAException(XAException.XA_RBROLLBACK);
default:
//
// should never happen.
//
Tr.warning(tc, "WTRN0022_UNKNOWN_XARESOURCE_STATE");
case FAILED:
case IDLE:
throw new XAException(XAException.XAER_PROTO);
}
if (tc.isEventEnabled()) Tr.event(tc, "xa_start with flag: " + Util.printFlag(flags));
_resource.start(_xid, flags);
rc = XAResource.XA_OK;
_state = ACTIVE;
}
catch (XAException xae)
{
processXAException("start", xae);
rc = xae.errorCode;
if (xae.errorCode >= XAException.XA_RBBASE && xae.errorCode <= XAException.XA_RBEND)
_state = ROLLBACK_ONLY;
else if (xae.errorCode != XAException.XAER_OUTSIDE)
_state = FAILED;
throw xae;
}
catch (Throwable t)
{
_state = FAILED;
processThrowable("start", t);
}
finally
{
if (tc.isEntryEnabled()) Tr.exit(tc, "start");
if (tcSummary.isDebugEnabled()) Tr.debug(tcSummary, "xa_start result:", XAReturnCodeHelper.convertXACode(rc));
}
} | java | public final void start() throws XAException
{
if (tc.isEntryEnabled()) Tr.entry(tc, "start", new Object[]{_resource, printState(_state)});
if (tcSummary.isDebugEnabled()) Tr.debug(tcSummary, "xa_start", this);
int rc = -1; // not an XA RC
try
{
int flags;
// Check the current state of the XAResource.
switch (_state)
{
case NOT_ASSOCIATED:
flags = _startFlag;
break;
case NOT_ASSOCIATED_AND_TMJOIN:
flags = XAResource.TMJOIN;
break;
case ACTIVE:
if (tc.isEntryEnabled()) Tr.exit(tc, "startAssociation");
return;
case SUSPENDED:
if (!_supportResume)
{
Tr.warning(tc, "WTRN0021_TMRESUME_NOT_SUPPORTED");
throw new XAException(XAException.XAER_INVAL);
}
flags = XAResource.TMRESUME;
break;
case ROLLBACK_ONLY:
throw new XAException(XAException.XA_RBROLLBACK);
default:
//
// should never happen.
//
Tr.warning(tc, "WTRN0022_UNKNOWN_XARESOURCE_STATE");
case FAILED:
case IDLE:
throw new XAException(XAException.XAER_PROTO);
}
if (tc.isEventEnabled()) Tr.event(tc, "xa_start with flag: " + Util.printFlag(flags));
_resource.start(_xid, flags);
rc = XAResource.XA_OK;
_state = ACTIVE;
}
catch (XAException xae)
{
processXAException("start", xae);
rc = xae.errorCode;
if (xae.errorCode >= XAException.XA_RBBASE && xae.errorCode <= XAException.XA_RBEND)
_state = ROLLBACK_ONLY;
else if (xae.errorCode != XAException.XAER_OUTSIDE)
_state = FAILED;
throw xae;
}
catch (Throwable t)
{
_state = FAILED;
processThrowable("start", t);
}
finally
{
if (tc.isEntryEnabled()) Tr.exit(tc, "start");
if (tcSummary.isDebugEnabled()) Tr.debug(tcSummary, "xa_start result:", XAReturnCodeHelper.convertXACode(rc));
}
} | [
"public",
"final",
"void",
"start",
"(",
")",
"throws",
"XAException",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"start\"",
",",
"new",
"Object",
"[",
"]",
"{",
"_resource",
",",
"printState",
"(",
"_state",
")",
"}",
")",
";",
"if",
"(",
"tcSummary",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tcSummary",
",",
"\"xa_start\"",
",",
"this",
")",
";",
"int",
"rc",
"=",
"-",
"1",
";",
"// not an XA RC",
"try",
"{",
"int",
"flags",
";",
"// Check the current state of the XAResource.",
"switch",
"(",
"_state",
")",
"{",
"case",
"NOT_ASSOCIATED",
":",
"flags",
"=",
"_startFlag",
";",
"break",
";",
"case",
"NOT_ASSOCIATED_AND_TMJOIN",
":",
"flags",
"=",
"XAResource",
".",
"TMJOIN",
";",
"break",
";",
"case",
"ACTIVE",
":",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"startAssociation\"",
")",
";",
"return",
";",
"case",
"SUSPENDED",
":",
"if",
"(",
"!",
"_supportResume",
")",
"{",
"Tr",
".",
"warning",
"(",
"tc",
",",
"\"WTRN0021_TMRESUME_NOT_SUPPORTED\"",
")",
";",
"throw",
"new",
"XAException",
"(",
"XAException",
".",
"XAER_INVAL",
")",
";",
"}",
"flags",
"=",
"XAResource",
".",
"TMRESUME",
";",
"break",
";",
"case",
"ROLLBACK_ONLY",
":",
"throw",
"new",
"XAException",
"(",
"XAException",
".",
"XA_RBROLLBACK",
")",
";",
"default",
":",
"//",
"// should never happen.",
"//",
"Tr",
".",
"warning",
"(",
"tc",
",",
"\"WTRN0022_UNKNOWN_XARESOURCE_STATE\"",
")",
";",
"case",
"FAILED",
":",
"case",
"IDLE",
":",
"throw",
"new",
"XAException",
"(",
"XAException",
".",
"XAER_PROTO",
")",
";",
"}",
"if",
"(",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"xa_start with flag: \"",
"+",
"Util",
".",
"printFlag",
"(",
"flags",
")",
")",
";",
"_resource",
".",
"start",
"(",
"_xid",
",",
"flags",
")",
";",
"rc",
"=",
"XAResource",
".",
"XA_OK",
";",
"_state",
"=",
"ACTIVE",
";",
"}",
"catch",
"(",
"XAException",
"xae",
")",
"{",
"processXAException",
"(",
"\"start\"",
",",
"xae",
")",
";",
"rc",
"=",
"xae",
".",
"errorCode",
";",
"if",
"(",
"xae",
".",
"errorCode",
">=",
"XAException",
".",
"XA_RBBASE",
"&&",
"xae",
".",
"errorCode",
"<=",
"XAException",
".",
"XA_RBEND",
")",
"_state",
"=",
"ROLLBACK_ONLY",
";",
"else",
"if",
"(",
"xae",
".",
"errorCode",
"!=",
"XAException",
".",
"XAER_OUTSIDE",
")",
"_state",
"=",
"FAILED",
";",
"throw",
"xae",
";",
"}",
"catch",
"(",
"Throwable",
"t",
")",
"{",
"_state",
"=",
"FAILED",
";",
"processThrowable",
"(",
"\"start\"",
",",
"t",
")",
";",
"}",
"finally",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"start\"",
")",
";",
"if",
"(",
"tcSummary",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tcSummary",
",",
"\"xa_start result:\"",
",",
"XAReturnCodeHelper",
".",
"convertXACode",
"(",
"rc",
")",
")",
";",
"}",
"}"
] | Associate the underlying XAResource with a transaction.
@exception XAException thrown if raised by the xa_start request
or the resource is in the wrong state to receive
a start flow. | [
"Associate",
"the",
"underlying",
"XAResource",
"with",
"a",
"transaction",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/ws/Transaction/JTA/JTAResourceBase.java#L77-L147 | train |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/ws/Transaction/JTA/JTAResourceBase.java | JTAResourceBase.end | public final void end(int flag) throws XAException
{
if (tc.isEntryEnabled()) Tr.entry(tc, "end", new Object[]{_resource, Util.printFlag(flag), printState(_state)});
if (tcSummary.isDebugEnabled()) Tr.debug(tcSummary, "xa_end", new Object[]{this, "flags = " + Util.printFlag(flag)});
int newstate;
int rc = -1; // not an XA RC
switch (flag)
{
case XAResource.TMSUCCESS:
// xa_end(SUCCESS) on a suspended branch can be ended without a resumed start
if (_state == ACTIVE || _state == SUSPENDED)
{
newstate = IDLE;
}
else // NOT_ASSOCIATED || ROLLBACK_ONLY || IDLE || FAILED
{
if (tc.isEntryEnabled()) Tr.exit(tc, "end");
return;
}
break;
case XAResource.TMFAIL:
// If the branch has already been marked rollback only then we do not need to
// re-issue xa_end as we will get another round of xa_rb* flows.
// If its idle, we dont need to issue xa_end
if (_state == ROLLBACK_ONLY || _state == IDLE || _state == FAILED)
{
if (tc.isEntryEnabled()) Tr.exit(tc, "end");
return;
}
newstate = ROLLBACK_ONLY;
break;
case XAResource.TMSUSPEND:
if (!_supportSuspend)
{
if (tc.isEventEnabled()) Tr.event(tc, "TMSUSPEND is not supported.");
throw new XAException(XAException.XAER_INVAL);
}
else if (_state == FAILED || _state == IDLE)
{
if (tc.isEventEnabled()) Tr.event(tc, "TMSUSPEND in invalid state.");
throw new XAException(XAException.XAER_PROTO);
}
else if (_state != ACTIVE)
{
if (tc.isEntryEnabled()) Tr.exit(tc, "end");
return;
}
newstate = SUSPENDED;
break;
default:
Tr.warning(tc, "WTRN0023_INVALID_XAEND_FLAG", Util.printFlag(flag));
throw new XAException(XAException.XAER_INVAL);
}
try
{
_resource.end(_xid, flag);
rc = XAResource.XA_OK;
//
// update XAResource's state
//
_state = newstate;
}
catch (XAException xae)
{
processXAException("end", xae);
rc = xae.errorCode;
if (xae.errorCode >= XAException.XA_RBBASE && xae.errorCode <= XAException.XA_RBEND)
_state = ROLLBACK_ONLY;
else
_state = FAILED;
throw xae;
}
catch (Throwable t)
{
_state = FAILED;
processThrowable("end", t);
}
finally
{
if (tc.isEntryEnabled()) Tr.exit(tc, "end");
if (tcSummary.isDebugEnabled()) Tr.debug(tcSummary, "xa_end result:", XAReturnCodeHelper.convertXACode(rc));
}
} | java | public final void end(int flag) throws XAException
{
if (tc.isEntryEnabled()) Tr.entry(tc, "end", new Object[]{_resource, Util.printFlag(flag), printState(_state)});
if (tcSummary.isDebugEnabled()) Tr.debug(tcSummary, "xa_end", new Object[]{this, "flags = " + Util.printFlag(flag)});
int newstate;
int rc = -1; // not an XA RC
switch (flag)
{
case XAResource.TMSUCCESS:
// xa_end(SUCCESS) on a suspended branch can be ended without a resumed start
if (_state == ACTIVE || _state == SUSPENDED)
{
newstate = IDLE;
}
else // NOT_ASSOCIATED || ROLLBACK_ONLY || IDLE || FAILED
{
if (tc.isEntryEnabled()) Tr.exit(tc, "end");
return;
}
break;
case XAResource.TMFAIL:
// If the branch has already been marked rollback only then we do not need to
// re-issue xa_end as we will get another round of xa_rb* flows.
// If its idle, we dont need to issue xa_end
if (_state == ROLLBACK_ONLY || _state == IDLE || _state == FAILED)
{
if (tc.isEntryEnabled()) Tr.exit(tc, "end");
return;
}
newstate = ROLLBACK_ONLY;
break;
case XAResource.TMSUSPEND:
if (!_supportSuspend)
{
if (tc.isEventEnabled()) Tr.event(tc, "TMSUSPEND is not supported.");
throw new XAException(XAException.XAER_INVAL);
}
else if (_state == FAILED || _state == IDLE)
{
if (tc.isEventEnabled()) Tr.event(tc, "TMSUSPEND in invalid state.");
throw new XAException(XAException.XAER_PROTO);
}
else if (_state != ACTIVE)
{
if (tc.isEntryEnabled()) Tr.exit(tc, "end");
return;
}
newstate = SUSPENDED;
break;
default:
Tr.warning(tc, "WTRN0023_INVALID_XAEND_FLAG", Util.printFlag(flag));
throw new XAException(XAException.XAER_INVAL);
}
try
{
_resource.end(_xid, flag);
rc = XAResource.XA_OK;
//
// update XAResource's state
//
_state = newstate;
}
catch (XAException xae)
{
processXAException("end", xae);
rc = xae.errorCode;
if (xae.errorCode >= XAException.XA_RBBASE && xae.errorCode <= XAException.XA_RBEND)
_state = ROLLBACK_ONLY;
else
_state = FAILED;
throw xae;
}
catch (Throwable t)
{
_state = FAILED;
processThrowable("end", t);
}
finally
{
if (tc.isEntryEnabled()) Tr.exit(tc, "end");
if (tcSummary.isDebugEnabled()) Tr.debug(tcSummary, "xa_end result:", XAReturnCodeHelper.convertXACode(rc));
}
} | [
"public",
"final",
"void",
"end",
"(",
"int",
"flag",
")",
"throws",
"XAException",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"end\"",
",",
"new",
"Object",
"[",
"]",
"{",
"_resource",
",",
"Util",
".",
"printFlag",
"(",
"flag",
")",
",",
"printState",
"(",
"_state",
")",
"}",
")",
";",
"if",
"(",
"tcSummary",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tcSummary",
",",
"\"xa_end\"",
",",
"new",
"Object",
"[",
"]",
"{",
"this",
",",
"\"flags = \"",
"+",
"Util",
".",
"printFlag",
"(",
"flag",
")",
"}",
")",
";",
"int",
"newstate",
";",
"int",
"rc",
"=",
"-",
"1",
";",
"// not an XA RC",
"switch",
"(",
"flag",
")",
"{",
"case",
"XAResource",
".",
"TMSUCCESS",
":",
"// xa_end(SUCCESS) on a suspended branch can be ended without a resumed start",
"if",
"(",
"_state",
"==",
"ACTIVE",
"||",
"_state",
"==",
"SUSPENDED",
")",
"{",
"newstate",
"=",
"IDLE",
";",
"}",
"else",
"// NOT_ASSOCIATED || ROLLBACK_ONLY || IDLE || FAILED",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"end\"",
")",
";",
"return",
";",
"}",
"break",
";",
"case",
"XAResource",
".",
"TMFAIL",
":",
"// If the branch has already been marked rollback only then we do not need to",
"// re-issue xa_end as we will get another round of xa_rb* flows.",
"// If its idle, we dont need to issue xa_end",
"if",
"(",
"_state",
"==",
"ROLLBACK_ONLY",
"||",
"_state",
"==",
"IDLE",
"||",
"_state",
"==",
"FAILED",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"end\"",
")",
";",
"return",
";",
"}",
"newstate",
"=",
"ROLLBACK_ONLY",
";",
"break",
";",
"case",
"XAResource",
".",
"TMSUSPEND",
":",
"if",
"(",
"!",
"_supportSuspend",
")",
"{",
"if",
"(",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"TMSUSPEND is not supported.\"",
")",
";",
"throw",
"new",
"XAException",
"(",
"XAException",
".",
"XAER_INVAL",
")",
";",
"}",
"else",
"if",
"(",
"_state",
"==",
"FAILED",
"||",
"_state",
"==",
"IDLE",
")",
"{",
"if",
"(",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"TMSUSPEND in invalid state.\"",
")",
";",
"throw",
"new",
"XAException",
"(",
"XAException",
".",
"XAER_PROTO",
")",
";",
"}",
"else",
"if",
"(",
"_state",
"!=",
"ACTIVE",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"end\"",
")",
";",
"return",
";",
"}",
"newstate",
"=",
"SUSPENDED",
";",
"break",
";",
"default",
":",
"Tr",
".",
"warning",
"(",
"tc",
",",
"\"WTRN0023_INVALID_XAEND_FLAG\"",
",",
"Util",
".",
"printFlag",
"(",
"flag",
")",
")",
";",
"throw",
"new",
"XAException",
"(",
"XAException",
".",
"XAER_INVAL",
")",
";",
"}",
"try",
"{",
"_resource",
".",
"end",
"(",
"_xid",
",",
"flag",
")",
";",
"rc",
"=",
"XAResource",
".",
"XA_OK",
";",
"//",
"// update XAResource's state ",
"//",
"_state",
"=",
"newstate",
";",
"}",
"catch",
"(",
"XAException",
"xae",
")",
"{",
"processXAException",
"(",
"\"end\"",
",",
"xae",
")",
";",
"rc",
"=",
"xae",
".",
"errorCode",
";",
"if",
"(",
"xae",
".",
"errorCode",
">=",
"XAException",
".",
"XA_RBBASE",
"&&",
"xae",
".",
"errorCode",
"<=",
"XAException",
".",
"XA_RBEND",
")",
"_state",
"=",
"ROLLBACK_ONLY",
";",
"else",
"_state",
"=",
"FAILED",
";",
"throw",
"xae",
";",
"}",
"catch",
"(",
"Throwable",
"t",
")",
"{",
"_state",
"=",
"FAILED",
";",
"processThrowable",
"(",
"\"end\"",
",",
"t",
")",
";",
"}",
"finally",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"end\"",
")",
";",
"if",
"(",
"tcSummary",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tcSummary",
",",
"\"xa_end result:\"",
",",
"XAReturnCodeHelper",
".",
"convertXACode",
"(",
"rc",
")",
")",
";",
"}",
"}"
] | Terminate the association of the XAResource
with this transaction.
@param flag The flag to pass to the end flow
TMSUSPEND, TMFAIL, or TMSUCCESS
@exception XAException thrown if raised by the xa_end request
or the resource is in the wrong state to receive
an end flow. | [
"Terminate",
"the",
"association",
"of",
"the",
"XAResource",
"with",
"this",
"transaction",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/ws/Transaction/JTA/JTAResourceBase.java#L160-L248 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/JsMainAdminComponentImpl.java | JsMainAdminComponentImpl.activate | @Activate
protected void activate(ComponentContext context,
Map<String, Object> properties) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
SibTr.entry(tc, CLASS_NAME + "activate", new Object[] { context,
properties });
}
try {
service = new JsMainAdminServiceImpl();
configAdminRef.activate(context);
messageStoreRef.activate(context);
destinationAddressFactoryRef.activate(context);
jsAdminServiceref.activate(context);
service.activate(context, properties, configAdminRef.getService());
} catch (Exception e) {
SibTr.exception(tc, e);
FFDCFilter.processException(e, this.getClass().getName(), "133", this);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
SibTr.exit(tc, CLASS_NAME + "activate");
}
} | java | @Activate
protected void activate(ComponentContext context,
Map<String, Object> properties) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
SibTr.entry(tc, CLASS_NAME + "activate", new Object[] { context,
properties });
}
try {
service = new JsMainAdminServiceImpl();
configAdminRef.activate(context);
messageStoreRef.activate(context);
destinationAddressFactoryRef.activate(context);
jsAdminServiceref.activate(context);
service.activate(context, properties, configAdminRef.getService());
} catch (Exception e) {
SibTr.exception(tc, e);
FFDCFilter.processException(e, this.getClass().getName(), "133", this);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
SibTr.exit(tc, CLASS_NAME + "activate");
}
} | [
"@",
"Activate",
"protected",
"void",
"activate",
"(",
"ComponentContext",
"context",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\"activate\"",
",",
"new",
"Object",
"[",
"]",
"{",
"context",
",",
"properties",
"}",
")",
";",
"}",
"try",
"{",
"service",
"=",
"new",
"JsMainAdminServiceImpl",
"(",
")",
";",
"configAdminRef",
".",
"activate",
"(",
"context",
")",
";",
"messageStoreRef",
".",
"activate",
"(",
"context",
")",
";",
"destinationAddressFactoryRef",
".",
"activate",
"(",
"context",
")",
";",
"jsAdminServiceref",
".",
"activate",
"(",
"context",
")",
";",
"service",
".",
"activate",
"(",
"context",
",",
"properties",
",",
"configAdminRef",
".",
"getService",
"(",
")",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"this",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
",",
"\"133\"",
",",
"this",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\"activate\"",
")",
";",
"}",
"}"
] | This method is call by the declarative service when the feature is
activated | [
"This",
"method",
"is",
"call",
"by",
"the",
"declarative",
"service",
"when",
"the",
"feature",
"is",
"activated"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/JsMainAdminComponentImpl.java#L93-L118 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/JsMainAdminComponentImpl.java | JsMainAdminComponentImpl.modified | @Modified
protected void modified(ComponentContext context,
Map<String, Object> properties) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
SibTr.entry(tc, CLASS_NAME + "modified", new Object[] { context,
properties });
}
try {
// If ME is stopped we start it again.This happens when ME might have
// not started during activate() and user changes the server.xml, we
// attempt to start it again(thinking user have reactified any
// server.xml issue if any )
if (service.getMeState().equals(ME_STATE.STOPPED.toString())) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.debug(tc, "Starting ME", service.getMeState());
SibTr.info(tc, "RESTART_ME_SIAS0106");
service.activate(context, properties, configAdminRef.getService());
} else {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.debug(tc, "Modifying the configuration", service
.getMeState());
service.modified(context, properties, configAdminRef.getService());
}
} catch (Exception e) {
SibTr.exception(tc, e);
FFDCFilter.processException(e, this.getClass().getName(), "187", this);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
SibTr.exit(tc, CLASS_NAME + "modified");
}
} | java | @Modified
protected void modified(ComponentContext context,
Map<String, Object> properties) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
SibTr.entry(tc, CLASS_NAME + "modified", new Object[] { context,
properties });
}
try {
// If ME is stopped we start it again.This happens when ME might have
// not started during activate() and user changes the server.xml, we
// attempt to start it again(thinking user have reactified any
// server.xml issue if any )
if (service.getMeState().equals(ME_STATE.STOPPED.toString())) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.debug(tc, "Starting ME", service.getMeState());
SibTr.info(tc, "RESTART_ME_SIAS0106");
service.activate(context, properties, configAdminRef.getService());
} else {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.debug(tc, "Modifying the configuration", service
.getMeState());
service.modified(context, properties, configAdminRef.getService());
}
} catch (Exception e) {
SibTr.exception(tc, e);
FFDCFilter.processException(e, this.getClass().getName(), "187", this);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
SibTr.exit(tc, CLASS_NAME + "modified");
}
} | [
"@",
"Modified",
"protected",
"void",
"modified",
"(",
"ComponentContext",
"context",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\"modified\"",
",",
"new",
"Object",
"[",
"]",
"{",
"context",
",",
"properties",
"}",
")",
";",
"}",
"try",
"{",
"// If ME is stopped we start it again.This happens when ME might have",
"// not started during activate() and user changes the server.xml, we",
"// attempt to start it again(thinking user have reactified any",
"// server.xml issue if any )",
"if",
"(",
"service",
".",
"getMeState",
"(",
")",
".",
"equals",
"(",
"ME_STATE",
".",
"STOPPED",
".",
"toString",
"(",
")",
")",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"Starting ME\"",
",",
"service",
".",
"getMeState",
"(",
")",
")",
";",
"SibTr",
".",
"info",
"(",
"tc",
",",
"\"RESTART_ME_SIAS0106\"",
")",
";",
"service",
".",
"activate",
"(",
"context",
",",
"properties",
",",
"configAdminRef",
".",
"getService",
"(",
")",
")",
";",
"}",
"else",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"Modifying the configuration\"",
",",
"service",
".",
"getMeState",
"(",
")",
")",
";",
"service",
".",
"modified",
"(",
"context",
",",
"properties",
",",
"configAdminRef",
".",
"getService",
"(",
")",
")",
";",
"}",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"this",
".",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
",",
"\"187\"",
",",
"this",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"CLASS_NAME",
"+",
"\"modified\"",
")",
";",
"}",
"}"
] | This method is call by the declarative service when there is
configuration change | [
"This",
"method",
"is",
"call",
"by",
"the",
"declarative",
"service",
"when",
"there",
"is",
"configuration",
"change"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/JsMainAdminComponentImpl.java#L124-L159 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/JsMainAdminComponentImpl.java | JsMainAdminComponentImpl.setMessageStore | @Reference(name = KEY_MESSAGE_STORE, service = MessageStore.class)
protected void setMessageStore(ServiceReference<MessageStore> ref) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.entry(tc, "setMessageStore", ref);
messageStoreRef.setReference(ref);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.exit(tc, "setMessageStore");
} | java | @Reference(name = KEY_MESSAGE_STORE, service = MessageStore.class)
protected void setMessageStore(ServiceReference<MessageStore> ref) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.entry(tc, "setMessageStore", ref);
messageStoreRef.setReference(ref);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.exit(tc, "setMessageStore");
} | [
"@",
"Reference",
"(",
"name",
"=",
"KEY_MESSAGE_STORE",
",",
"service",
"=",
"MessageStore",
".",
"class",
")",
"protected",
"void",
"setMessageStore",
"(",
"ServiceReference",
"<",
"MessageStore",
">",
"ref",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"setMessageStore\"",
",",
"ref",
")",
";",
"messageStoreRef",
".",
"setReference",
"(",
"ref",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"setMessageStore\"",
")",
";",
"}"
] | Declarative Services method for setting the MessageStore service
reference.
@param ref
reference to the service | [
"Declarative",
"Services",
"method",
"for",
"setting",
"the",
"MessageStore",
"service",
"reference",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/JsMainAdminComponentImpl.java#L233-L241 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/JsMainAdminComponentImpl.java | JsMainAdminComponentImpl.unsetMessageStore | protected void unsetMessageStore(ServiceReference<MessageStore> ref) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.entry(tc, "unsetMessageStore", ref);
messageStoreRef.unsetReference(ref);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.exit(tc, "unsetMessageStore");
} | java | protected void unsetMessageStore(ServiceReference<MessageStore> ref) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.entry(tc, "unsetMessageStore", ref);
messageStoreRef.unsetReference(ref);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.exit(tc, "unsetMessageStore");
} | [
"protected",
"void",
"unsetMessageStore",
"(",
"ServiceReference",
"<",
"MessageStore",
">",
"ref",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"unsetMessageStore\"",
",",
"ref",
")",
";",
"messageStoreRef",
".",
"unsetReference",
"(",
"ref",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"unsetMessageStore\"",
")",
";",
"}"
] | Declarative Services method for unsetting the MessageStore service
reference.
@param ref
reference to the service | [
"Declarative",
"Services",
"method",
"for",
"unsetting",
"the",
"MessageStore",
"service",
"reference",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/JsMainAdminComponentImpl.java#L250-L257 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/JsMainAdminComponentImpl.java | JsMainAdminComponentImpl.setDestinationAddressFactory | @Reference(name = KEY_DESTINATION_ADDRESS_FACTORY, service = SIDestinationAddressFactory.class)
protected void setDestinationAddressFactory(ServiceReference<SIDestinationAddressFactory> ref) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.entry(tc, "setDestinationAddressFactory", ref);
destinationAddressFactoryRef.setReference(ref);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.exit(tc, "setDestinationAddressFactory");
} | java | @Reference(name = KEY_DESTINATION_ADDRESS_FACTORY, service = SIDestinationAddressFactory.class)
protected void setDestinationAddressFactory(ServiceReference<SIDestinationAddressFactory> ref) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.entry(tc, "setDestinationAddressFactory", ref);
destinationAddressFactoryRef.setReference(ref);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.exit(tc, "setDestinationAddressFactory");
} | [
"@",
"Reference",
"(",
"name",
"=",
"KEY_DESTINATION_ADDRESS_FACTORY",
",",
"service",
"=",
"SIDestinationAddressFactory",
".",
"class",
")",
"protected",
"void",
"setDestinationAddressFactory",
"(",
"ServiceReference",
"<",
"SIDestinationAddressFactory",
">",
"ref",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"setDestinationAddressFactory\"",
",",
"ref",
")",
";",
"destinationAddressFactoryRef",
".",
"setReference",
"(",
"ref",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"setDestinationAddressFactory\"",
")",
";",
"}"
] | Declarative Services method for setting the DestinationAddressFactory service
reference.
@param ref
reference to the service | [
"Declarative",
"Services",
"method",
"for",
"setting",
"the",
"DestinationAddressFactory",
"service",
"reference",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/JsMainAdminComponentImpl.java#L266-L274 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/JsMainAdminComponentImpl.java | JsMainAdminComponentImpl.unsetDestinationAddressFactory | protected void unsetDestinationAddressFactory(ServiceReference<SIDestinationAddressFactory> ref) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.entry(tc, "unsetDestinationAddressFactory", ref);
destinationAddressFactoryRef.setReference(ref);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.exit(tc, "unsetDestinationAddressFactory");
} | java | protected void unsetDestinationAddressFactory(ServiceReference<SIDestinationAddressFactory> ref) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.entry(tc, "unsetDestinationAddressFactory", ref);
destinationAddressFactoryRef.setReference(ref);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.exit(tc, "unsetDestinationAddressFactory");
} | [
"protected",
"void",
"unsetDestinationAddressFactory",
"(",
"ServiceReference",
"<",
"SIDestinationAddressFactory",
">",
"ref",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"unsetDestinationAddressFactory\"",
",",
"ref",
")",
";",
"destinationAddressFactoryRef",
".",
"setReference",
"(",
"ref",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"unsetDestinationAddressFactory\"",
")",
";",
"}"
] | Declarative Services method for unsetting the DestinationAddressFactory service
reference.
@param ref
reference to the service | [
"Declarative",
"Services",
"method",
"for",
"unsetting",
"the",
"DestinationAddressFactory",
"service",
"reference",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/JsMainAdminComponentImpl.java#L283-L290 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/JsMainAdminComponentImpl.java | JsMainAdminComponentImpl.setJsAdminService | @Reference(name = KEY_JS_ADMIN_SERVICE, service = JsAdminService.class)
protected void setJsAdminService(ServiceReference<JsAdminService> ref) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.entry(tc, "setJsAdminService", ref);
jsAdminServiceref.setReference(ref);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.exit(tc, "setJsAdminService");
} | java | @Reference(name = KEY_JS_ADMIN_SERVICE, service = JsAdminService.class)
protected void setJsAdminService(ServiceReference<JsAdminService> ref) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.entry(tc, "setJsAdminService", ref);
jsAdminServiceref.setReference(ref);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.exit(tc, "setJsAdminService");
} | [
"@",
"Reference",
"(",
"name",
"=",
"KEY_JS_ADMIN_SERVICE",
",",
"service",
"=",
"JsAdminService",
".",
"class",
")",
"protected",
"void",
"setJsAdminService",
"(",
"ServiceReference",
"<",
"JsAdminService",
">",
"ref",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"setJsAdminService\"",
",",
"ref",
")",
";",
"jsAdminServiceref",
".",
"setReference",
"(",
"ref",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"setJsAdminService\"",
")",
";",
"}"
] | Declarative Services method for setting the JsAdminService service
reference.
@param ref
reference to the service | [
"Declarative",
"Services",
"method",
"for",
"setting",
"the",
"JsAdminService",
"service",
"reference",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/JsMainAdminComponentImpl.java#L299-L307 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/JsMainAdminComponentImpl.java | JsMainAdminComponentImpl.unsetJsAdminService | protected void unsetJsAdminService(ServiceReference<JsAdminService> ref) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.entry(tc, "unsetJsAdminService", ref);
jsAdminServiceref.setReference(ref);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.exit(tc, "unsetJsAdminService");
} | java | protected void unsetJsAdminService(ServiceReference<JsAdminService> ref) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.entry(tc, "unsetJsAdminService", ref);
jsAdminServiceref.setReference(ref);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.exit(tc, "unsetJsAdminService");
} | [
"protected",
"void",
"unsetJsAdminService",
"(",
"ServiceReference",
"<",
"JsAdminService",
">",
"ref",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"unsetJsAdminService\"",
",",
"ref",
")",
";",
"jsAdminServiceref",
".",
"setReference",
"(",
"ref",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"unsetJsAdminService\"",
")",
";",
"}"
] | Declarative Services method for unsetting the JsAdminService service
reference.
@param ref
reference to the service | [
"Declarative",
"Services",
"method",
"for",
"unsetting",
"the",
"JsAdminService",
"service",
"reference",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/JsMainAdminComponentImpl.java#L316-L323 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.