repo
stringlengths 7
58
| path
stringlengths 12
218
| func_name
stringlengths 3
140
| original_string
stringlengths 73
34.1k
| language
stringclasses 1
value | code
stringlengths 73
34.1k
| code_tokens
sequence | docstring
stringlengths 3
16k
| docstring_tokens
sequence | sha
stringlengths 40
40
| url
stringlengths 105
339
| partition
stringclasses 1
value |
---|---|---|---|---|---|---|---|---|---|---|---|
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/context/RequestViewMetadata.java | RequestViewMetadata.cloneInstance | public RequestViewMetadata cloneInstance()
{
RequestViewMetadata rvm = new RequestViewMetadata();
rvm.initialProcessedClasses = new HashMap<Class<?>, Boolean>(
this.initialProcessedClasses != null ?
this.initialProcessedClasses : this.processedClasses);
if (this.initialAddedResources != null)
{
rvm.initialAddedResources = new HashMap<ResourceDependency, Boolean>(
this.initialAddedResources);
}
else if (this.addedResources != null)
{
rvm.initialAddedResources = new HashMap<ResourceDependency, Boolean>(
this.addedResources);
}
return rvm;
} | java | public RequestViewMetadata cloneInstance()
{
RequestViewMetadata rvm = new RequestViewMetadata();
rvm.initialProcessedClasses = new HashMap<Class<?>, Boolean>(
this.initialProcessedClasses != null ?
this.initialProcessedClasses : this.processedClasses);
if (this.initialAddedResources != null)
{
rvm.initialAddedResources = new HashMap<ResourceDependency, Boolean>(
this.initialAddedResources);
}
else if (this.addedResources != null)
{
rvm.initialAddedResources = new HashMap<ResourceDependency, Boolean>(
this.addedResources);
}
return rvm;
} | [
"public",
"RequestViewMetadata",
"cloneInstance",
"(",
")",
"{",
"RequestViewMetadata",
"rvm",
"=",
"new",
"RequestViewMetadata",
"(",
")",
";",
"rvm",
".",
"initialProcessedClasses",
"=",
"new",
"HashMap",
"<",
"Class",
"<",
"?",
">",
",",
"Boolean",
">",
"(",
"this",
".",
"initialProcessedClasses",
"!=",
"null",
"?",
"this",
".",
"initialProcessedClasses",
":",
"this",
".",
"processedClasses",
")",
";",
"if",
"(",
"this",
".",
"initialAddedResources",
"!=",
"null",
")",
"{",
"rvm",
".",
"initialAddedResources",
"=",
"new",
"HashMap",
"<",
"ResourceDependency",
",",
"Boolean",
">",
"(",
"this",
".",
"initialAddedResources",
")",
";",
"}",
"else",
"if",
"(",
"this",
".",
"addedResources",
"!=",
"null",
")",
"{",
"rvm",
".",
"initialAddedResources",
"=",
"new",
"HashMap",
"<",
"ResourceDependency",
",",
"Boolean",
">",
"(",
"this",
".",
"addedResources",
")",
";",
"}",
"return",
"rvm",
";",
"}"
] | Clone the current request view metadata into another instance, so
it can be used in a view.
@return | [
"Clone",
"the",
"current",
"request",
"view",
"metadata",
"into",
"another",
"instance",
"so",
"it",
"can",
"be",
"used",
"in",
"a",
"view",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/context/RequestViewMetadata.java#L59-L76 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSIndirectBoxedListImpl.java | JSIndirectBoxedListImpl.get | public Object get(int accessor) {
try {
return getValue(accessor);
} catch (JMFException ex) {
FFDCFilter.processException(ex, "get", "134", this);
return null;
}
} | java | public Object get(int accessor) {
try {
return getValue(accessor);
} catch (JMFException ex) {
FFDCFilter.processException(ex, "get", "134", this);
return null;
}
} | [
"public",
"Object",
"get",
"(",
"int",
"accessor",
")",
"{",
"try",
"{",
"return",
"getValue",
"(",
"accessor",
")",
";",
"}",
"catch",
"(",
"JMFException",
"ex",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"ex",
",",
"\"get\"",
",",
"\"134\"",
",",
"this",
")",
";",
"return",
"null",
";",
"}",
"}"
] | Other overridden methods. | [
"Other",
"overridden",
"methods",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSIndirectBoxedListImpl.java#L106-L113 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.context/src/com/ibm/ws/context/service/serializable/ThreadContextDescriptorImpl.java | ThreadContextDescriptorImpl.containsAll | @Trivial
private static final boolean containsAll(LinkedHashMap<ThreadContextProvider, ThreadContext> contextProviders, List<ThreadContextProvider> prereqs) {
for (ThreadContextProvider prereq : prereqs)
if (!contextProviders.containsKey(prereq))
return false;
return true;
} | java | @Trivial
private static final boolean containsAll(LinkedHashMap<ThreadContextProvider, ThreadContext> contextProviders, List<ThreadContextProvider> prereqs) {
for (ThreadContextProvider prereq : prereqs)
if (!contextProviders.containsKey(prereq))
return false;
return true;
} | [
"@",
"Trivial",
"private",
"static",
"final",
"boolean",
"containsAll",
"(",
"LinkedHashMap",
"<",
"ThreadContextProvider",
",",
"ThreadContext",
">",
"contextProviders",
",",
"List",
"<",
"ThreadContextProvider",
">",
"prereqs",
")",
"{",
"for",
"(",
"ThreadContextProvider",
"prereq",
":",
"prereqs",
")",
"if",
"(",
"!",
"contextProviders",
".",
"containsKey",
"(",
"prereq",
")",
")",
"return",
"false",
";",
"return",
"true",
";",
"}"
] | Utility method that indicates whether or not a list of thread context providers contains all of the specified prerequisites.
@param contextProviders list of thread context providers (actually a map, but the keys are used as a list)
@param prereqs prerequisite thread context providers
@return true if all prerequisites are met. Otherwise false. | [
"Utility",
"method",
"that",
"indicates",
"whether",
"or",
"not",
"a",
"list",
"of",
"thread",
"context",
"providers",
"contains",
"all",
"of",
"the",
"specified",
"prerequisites",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.context/src/com/ibm/ws/context/service/serializable/ThreadContextDescriptorImpl.java#L229-L235 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.context/src/com/ibm/ws/context/service/serializable/ThreadContextDescriptorImpl.java | ThreadContextDescriptorImpl.notAvailable | public static void notAvailable(String jeeName, String taskName) {
String message;
int modSepIndex = jeeName.indexOf('#');
if (modSepIndex == -1) {
message = Tr.formatMessage(tc, "CWWKC1011.app.unavailable", taskName, jeeName);
} else {
String application = jeeName.substring(0, modSepIndex);
int compSepIndex = jeeName.indexOf('#', modSepIndex + 1);
if (compSepIndex == -1) {
message = Tr.formatMessage(tc, "CWWKC1012.module.unavailable", taskName, jeeName.substring(modSepIndex + 1), application);
} else {
String module = jeeName.substring(modSepIndex + 1, compSepIndex);
message = Tr.formatMessage(tc, "CWWKC1013.component.unavailable", taskName, jeeName.substring(compSepIndex + 1), module, application);
}
}
throw new IllegalStateException(message);
} | java | public static void notAvailable(String jeeName, String taskName) {
String message;
int modSepIndex = jeeName.indexOf('#');
if (modSepIndex == -1) {
message = Tr.formatMessage(tc, "CWWKC1011.app.unavailable", taskName, jeeName);
} else {
String application = jeeName.substring(0, modSepIndex);
int compSepIndex = jeeName.indexOf('#', modSepIndex + 1);
if (compSepIndex == -1) {
message = Tr.formatMessage(tc, "CWWKC1012.module.unavailable", taskName, jeeName.substring(modSepIndex + 1), application);
} else {
String module = jeeName.substring(modSepIndex + 1, compSepIndex);
message = Tr.formatMessage(tc, "CWWKC1013.component.unavailable", taskName, jeeName.substring(compSepIndex + 1), module, application);
}
}
throw new IllegalStateException(message);
} | [
"public",
"static",
"void",
"notAvailable",
"(",
"String",
"jeeName",
",",
"String",
"taskName",
")",
"{",
"String",
"message",
";",
"int",
"modSepIndex",
"=",
"jeeName",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"modSepIndex",
"==",
"-",
"1",
")",
"{",
"message",
"=",
"Tr",
".",
"formatMessage",
"(",
"tc",
",",
"\"CWWKC1011.app.unavailable\"",
",",
"taskName",
",",
"jeeName",
")",
";",
"}",
"else",
"{",
"String",
"application",
"=",
"jeeName",
".",
"substring",
"(",
"0",
",",
"modSepIndex",
")",
";",
"int",
"compSepIndex",
"=",
"jeeName",
".",
"indexOf",
"(",
"'",
"'",
",",
"modSepIndex",
"+",
"1",
")",
";",
"if",
"(",
"compSepIndex",
"==",
"-",
"1",
")",
"{",
"message",
"=",
"Tr",
".",
"formatMessage",
"(",
"tc",
",",
"\"CWWKC1012.module.unavailable\"",
",",
"taskName",
",",
"jeeName",
".",
"substring",
"(",
"modSepIndex",
"+",
"1",
")",
",",
"application",
")",
";",
"}",
"else",
"{",
"String",
"module",
"=",
"jeeName",
".",
"substring",
"(",
"modSepIndex",
"+",
"1",
",",
"compSepIndex",
")",
";",
"message",
"=",
"Tr",
".",
"formatMessage",
"(",
"tc",
",",
"\"CWWKC1013.component.unavailable\"",
",",
"taskName",
",",
"jeeName",
".",
"substring",
"(",
"compSepIndex",
"+",
"1",
")",
",",
"module",
",",
"application",
")",
";",
"}",
"}",
"throw",
"new",
"IllegalStateException",
"(",
"message",
")",
";",
"}"
] | Raises IllegalStateException because the application or application component is unavailable.
@param jeeName The metadata identifier, which is the JEE name (Application/Module/Component name with parts separated by hash signs).
For now, we'll parse the string and issue the appropriate message. This may not be appropriate in the future.
@param taskName identifier for the task or contextual operation that cannot be performed
@throws IllegalStateException indicating that the task cannot run because the application or application component is not available. | [
"Raises",
"IllegalStateException",
"because",
"the",
"application",
"or",
"application",
"component",
"is",
"unavailable",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.context/src/com/ibm/ws/context/service/serializable/ThreadContextDescriptorImpl.java#L251-L267 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.context/src/com/ibm/ws/context/service/serializable/ThreadContextDescriptorImpl.java | ThreadContextDescriptorImpl.serialize | @Override
public @Sensitive byte[] serialize() throws IOException {
// Captured thread context
ByteArrayOutputStream bout = new ByteArrayOutputStream();
int size = threadContext.size();
byte[][] contextBytes = new byte[size][];
for (int i = 0; i < size; i++) {
bout.reset();
ObjectOutputStream oout = new ObjectOutputStream(bout);
oout.writeObject(threadContext.get(i));
oout.flush();
contextBytes[i] = bout.toByteArray();
oout.close();
}
bout.reset();
ObjectOutputStream oout = new ObjectOutputStream(bout);
// Number of serialized fields (list of thread context counts as one)
oout.writeShort(3);
// 1) Bytes for captured thread context
oout.writeObject(contextBytes);
// 2) Metadata identifier
oout.writeObject(metaDataIdentifier);
// 3) Thread context provider names
oout.writeShort(providerNames.size());
for (String providerName : providerNames)
if (providerName.startsWith("com.ibm.ws.") && providerName.endsWith(".context.provider"))
oout.writeObject(providerName.substring(10, providerName.length() - 16));
else
oout.writeObject(providerName);
// Only add primitive or compatible Java types in the future. If necessary, pre-serialize to byte[]
oout.flush();
oout.close();
return bout.toByteArray();
} | java | @Override
public @Sensitive byte[] serialize() throws IOException {
// Captured thread context
ByteArrayOutputStream bout = new ByteArrayOutputStream();
int size = threadContext.size();
byte[][] contextBytes = new byte[size][];
for (int i = 0; i < size; i++) {
bout.reset();
ObjectOutputStream oout = new ObjectOutputStream(bout);
oout.writeObject(threadContext.get(i));
oout.flush();
contextBytes[i] = bout.toByteArray();
oout.close();
}
bout.reset();
ObjectOutputStream oout = new ObjectOutputStream(bout);
// Number of serialized fields (list of thread context counts as one)
oout.writeShort(3);
// 1) Bytes for captured thread context
oout.writeObject(contextBytes);
// 2) Metadata identifier
oout.writeObject(metaDataIdentifier);
// 3) Thread context provider names
oout.writeShort(providerNames.size());
for (String providerName : providerNames)
if (providerName.startsWith("com.ibm.ws.") && providerName.endsWith(".context.provider"))
oout.writeObject(providerName.substring(10, providerName.length() - 16));
else
oout.writeObject(providerName);
// Only add primitive or compatible Java types in the future. If necessary, pre-serialize to byte[]
oout.flush();
oout.close();
return bout.toByteArray();
} | [
"@",
"Override",
"public",
"@",
"Sensitive",
"byte",
"[",
"]",
"serialize",
"(",
")",
"throws",
"IOException",
"{",
"// Captured thread context",
"ByteArrayOutputStream",
"bout",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"int",
"size",
"=",
"threadContext",
".",
"size",
"(",
")",
";",
"byte",
"[",
"]",
"[",
"]",
"contextBytes",
"=",
"new",
"byte",
"[",
"size",
"]",
"[",
"",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"size",
";",
"i",
"++",
")",
"{",
"bout",
".",
"reset",
"(",
")",
";",
"ObjectOutputStream",
"oout",
"=",
"new",
"ObjectOutputStream",
"(",
"bout",
")",
";",
"oout",
".",
"writeObject",
"(",
"threadContext",
".",
"get",
"(",
"i",
")",
")",
";",
"oout",
".",
"flush",
"(",
")",
";",
"contextBytes",
"[",
"i",
"]",
"=",
"bout",
".",
"toByteArray",
"(",
")",
";",
"oout",
".",
"close",
"(",
")",
";",
"}",
"bout",
".",
"reset",
"(",
")",
";",
"ObjectOutputStream",
"oout",
"=",
"new",
"ObjectOutputStream",
"(",
"bout",
")",
";",
"// Number of serialized fields (list of thread context counts as one)",
"oout",
".",
"writeShort",
"(",
"3",
")",
";",
"// 1) Bytes for captured thread context",
"oout",
".",
"writeObject",
"(",
"contextBytes",
")",
";",
"// 2) Metadata identifier",
"oout",
".",
"writeObject",
"(",
"metaDataIdentifier",
")",
";",
"// 3) Thread context provider names",
"oout",
".",
"writeShort",
"(",
"providerNames",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
"String",
"providerName",
":",
"providerNames",
")",
"if",
"(",
"providerName",
".",
"startsWith",
"(",
"\"com.ibm.ws.\"",
")",
"&&",
"providerName",
".",
"endsWith",
"(",
"\".context.provider\"",
")",
")",
"oout",
".",
"writeObject",
"(",
"providerName",
".",
"substring",
"(",
"10",
",",
"providerName",
".",
"length",
"(",
")",
"-",
"16",
")",
")",
";",
"else",
"oout",
".",
"writeObject",
"(",
"providerName",
")",
";",
"// Only add primitive or compatible Java types in the future. If necessary, pre-serialize to byte[]",
"oout",
".",
"flush",
"(",
")",
";",
"oout",
".",
"close",
"(",
")",
";",
"return",
"bout",
".",
"toByteArray",
"(",
")",
";",
"}"
] | Serializes this thread context descriptor to bytes.
@return serialized bytes representing the thread context descriptor.
@throws IOException if a serialization error occurs. | [
"Serializes",
"this",
"thread",
"context",
"descriptor",
"to",
"bytes",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.context/src/com/ibm/ws/context/service/serializable/ThreadContextDescriptorImpl.java#L275-L316 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.org.apache.myfaces.2.3/src/org/apache/myfaces/cdi/view/ViewScopeContextImpl.java | ViewScopeContextImpl.isActive | public boolean isActive()
{
FacesContext facesContext = FacesContext.getCurrentInstance();
if (facesContext != null)
{
return facesContext.getViewRoot() != null;
}
else
{
// No FacesContext means no view scope active.
return false;
}
} | java | public boolean isActive()
{
FacesContext facesContext = FacesContext.getCurrentInstance();
if (facesContext != null)
{
return facesContext.getViewRoot() != null;
}
else
{
// No FacesContext means no view scope active.
return false;
}
} | [
"public",
"boolean",
"isActive",
"(",
")",
"{",
"FacesContext",
"facesContext",
"=",
"FacesContext",
".",
"getCurrentInstance",
"(",
")",
";",
"if",
"(",
"facesContext",
"!=",
"null",
")",
"{",
"return",
"facesContext",
".",
"getViewRoot",
"(",
")",
"!=",
"null",
";",
"}",
"else",
"{",
"// No FacesContext means no view scope active.",
"return",
"false",
";",
"}",
"}"
] | The WindowContext is active once a current windowId is set for the current Thread.
@return | [
"The",
"WindowContext",
"is",
"active",
"once",
"a",
"current",
"windowId",
"is",
"set",
"for",
"the",
"current",
"Thread",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.org.apache.myfaces.2.3/src/org/apache/myfaces/cdi/view/ViewScopeContextImpl.java#L125-L137 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java | ConsumerDispatcherState.getSubscriberID | public String getSubscriberID()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(this, tc, "getSubscriberID");
SibTr.exit(this, tc, "getSubscriberID", subscriptionID);
}
return subscriptionID;
} | java | public String getSubscriberID()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(this, tc, "getSubscriberID");
SibTr.exit(this, tc, "getSubscriberID", subscriptionID);
}
return subscriptionID;
} | [
"public",
"String",
"getSubscriberID",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"getSubscriberID\"",
")",
";",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"getSubscriberID\"",
",",
"subscriptionID",
")",
";",
"}",
"return",
"subscriptionID",
";",
"}"
] | Returns the subscriberID.
@return String | [
"Returns",
"the",
"subscriberID",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java#L277-L286 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java | ConsumerDispatcherState.getTopics | public String[] getTopics()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(this, tc, "getTopics");
SibTr.exit(this, tc, "getTopics", topics);
}
return topics;
} | java | public String[] getTopics()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(this, tc, "getTopics");
SibTr.exit(this, tc, "getTopics", topics);
}
return topics;
} | [
"public",
"String",
"[",
"]",
"getTopics",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"getTopics\"",
")",
";",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"getTopics\"",
",",
"topics",
")",
";",
"}",
"return",
"topics",
";",
"}"
] | Returns the array of topics.
@return String[] The array of topics | [
"Returns",
"the",
"array",
"of",
"topics",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java#L293-L301 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java | ConsumerDispatcherState.removeTopic | public void removeTopic(String topic)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "removeTopic", topic);
SelectionCriteria[] tmp = selectionCriteriaList;
// Loop through the selectionCriteriaList
for (int i = 0; i < selectionCriteriaList.length; ++i)
{
if ((selectionCriteriaList[i].getDiscriminator() == null && topic == null) ||
(topic != null && selectionCriteriaList[i].getDiscriminator().equals(topic)))
{
// If there was only one criteria and we have removed it then
// nullify lists
if (selectionCriteriaList.length == 1)
{
selectionCriteriaList = null;
topics = null;
}
else
{
// The criteria match, so resize the array without this
// criteria in it.
tmp = new SelectionCriteria[selectionCriteriaList.length - 1];
System.arraycopy(selectionCriteriaList, 0, tmp, 0, i);
System.arraycopy(selectionCriteriaList, i + 1, tmp, i, selectionCriteriaList.length - i - 1);
selectionCriteriaList = tmp;
// And copy into the topics array so that they always match
this.topics = new String[selectionCriteriaList.length];
for (int t = 0; t < selectionCriteriaList.length; t++)
{
topics[t] = (selectionCriteriaList[t] == null) ? null : selectionCriteriaList[t].getDiscriminator();
}
}
break;
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "removeTopic");
} | java | public void removeTopic(String topic)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "removeTopic", topic);
SelectionCriteria[] tmp = selectionCriteriaList;
// Loop through the selectionCriteriaList
for (int i = 0; i < selectionCriteriaList.length; ++i)
{
if ((selectionCriteriaList[i].getDiscriminator() == null && topic == null) ||
(topic != null && selectionCriteriaList[i].getDiscriminator().equals(topic)))
{
// If there was only one criteria and we have removed it then
// nullify lists
if (selectionCriteriaList.length == 1)
{
selectionCriteriaList = null;
topics = null;
}
else
{
// The criteria match, so resize the array without this
// criteria in it.
tmp = new SelectionCriteria[selectionCriteriaList.length - 1];
System.arraycopy(selectionCriteriaList, 0, tmp, 0, i);
System.arraycopy(selectionCriteriaList, i + 1, tmp, i, selectionCriteriaList.length - i - 1);
selectionCriteriaList = tmp;
// And copy into the topics array so that they always match
this.topics = new String[selectionCriteriaList.length];
for (int t = 0; t < selectionCriteriaList.length; t++)
{
topics[t] = (selectionCriteriaList[t] == null) ? null : selectionCriteriaList[t].getDiscriminator();
}
}
break;
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "removeTopic");
} | [
"public",
"void",
"removeTopic",
"(",
"String",
"topic",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"removeTopic\"",
",",
"topic",
")",
";",
"SelectionCriteria",
"[",
"]",
"tmp",
"=",
"selectionCriteriaList",
";",
"// Loop through the selectionCriteriaList",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"selectionCriteriaList",
".",
"length",
";",
"++",
"i",
")",
"{",
"if",
"(",
"(",
"selectionCriteriaList",
"[",
"i",
"]",
".",
"getDiscriminator",
"(",
")",
"==",
"null",
"&&",
"topic",
"==",
"null",
")",
"||",
"(",
"topic",
"!=",
"null",
"&&",
"selectionCriteriaList",
"[",
"i",
"]",
".",
"getDiscriminator",
"(",
")",
".",
"equals",
"(",
"topic",
")",
")",
")",
"{",
"// If there was only one criteria and we have removed it then",
"// nullify lists",
"if",
"(",
"selectionCriteriaList",
".",
"length",
"==",
"1",
")",
"{",
"selectionCriteriaList",
"=",
"null",
";",
"topics",
"=",
"null",
";",
"}",
"else",
"{",
"// The criteria match, so resize the array without this",
"// criteria in it.",
"tmp",
"=",
"new",
"SelectionCriteria",
"[",
"selectionCriteriaList",
".",
"length",
"-",
"1",
"]",
";",
"System",
".",
"arraycopy",
"(",
"selectionCriteriaList",
",",
"0",
",",
"tmp",
",",
"0",
",",
"i",
")",
";",
"System",
".",
"arraycopy",
"(",
"selectionCriteriaList",
",",
"i",
"+",
"1",
",",
"tmp",
",",
"i",
",",
"selectionCriteriaList",
".",
"length",
"-",
"i",
"-",
"1",
")",
";",
"selectionCriteriaList",
"=",
"tmp",
";",
"// And copy into the topics array so that they always match",
"this",
".",
"topics",
"=",
"new",
"String",
"[",
"selectionCriteriaList",
".",
"length",
"]",
";",
"for",
"(",
"int",
"t",
"=",
"0",
";",
"t",
"<",
"selectionCriteriaList",
".",
"length",
";",
"t",
"++",
")",
"{",
"topics",
"[",
"t",
"]",
"=",
"(",
"selectionCriteriaList",
"[",
"t",
"]",
"==",
"null",
")",
"?",
"null",
":",
"selectionCriteriaList",
"[",
"t",
"]",
".",
"getDiscriminator",
"(",
")",
";",
"}",
"}",
"break",
";",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"removeTopic\"",
")",
";",
"}"
] | Remove a topic from the array of topics
@param topic The topic to remove | [
"Remove",
"a",
"topic",
"from",
"the",
"array",
"of",
"topics"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java#L308-L351 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java | ConsumerDispatcherState.setTopicSpaceUuid | public void setTopicSpaceUuid(SIBUuid12 topicSpace)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setTopicSpaceUuid", topicSpace);
this.topicSpaceUuid = topicSpace;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setTopicSpaceUuid");
} | java | public void setTopicSpaceUuid(SIBUuid12 topicSpace)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setTopicSpaceUuid", topicSpace);
this.topicSpaceUuid = topicSpace;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setTopicSpaceUuid");
} | [
"public",
"void",
"setTopicSpaceUuid",
"(",
"SIBUuid12",
"topicSpace",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"setTopicSpaceUuid\"",
",",
"topicSpace",
")",
";",
"this",
".",
"topicSpaceUuid",
"=",
"topicSpace",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"setTopicSpaceUuid\"",
")",
";",
"}"
] | Sets the topic space.
@param topicSpace The topicSpaceUuid to set | [
"Sets",
"the",
"topic",
"space",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java#L394-L403 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java | ConsumerDispatcherState.setSubscriberID | public void setSubscriberID(String subscriptionID)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setSubscriberID", subscriptionID);
this.subscriptionID = subscriptionID;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setSubscriberID");
} | java | public void setSubscriberID(String subscriptionID)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setSubscriberID", subscriptionID);
this.subscriptionID = subscriptionID;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setSubscriberID");
} | [
"public",
"void",
"setSubscriberID",
"(",
"String",
"subscriptionID",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"setSubscriberID\"",
",",
"subscriptionID",
")",
";",
"this",
".",
"subscriptionID",
"=",
"subscriptionID",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"setSubscriberID\"",
")",
";",
"}"
] | Sets the subscriberID.
@param subscriptionID The subscriberID to set | [
"Sets",
"the",
"subscriberID",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java#L410-L419 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java | ConsumerDispatcherState.isSIBServerSubject | public boolean isSIBServerSubject()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(this, tc, "isSIBServerSubject");
SibTr.exit(this, tc, "isSIBServerSubject", Boolean.valueOf(isSIBServerSubject));
}
return isSIBServerSubject;
} | java | public boolean isSIBServerSubject()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(this, tc, "isSIBServerSubject");
SibTr.exit(this, tc, "isSIBServerSubject", Boolean.valueOf(isSIBServerSubject));
}
return isSIBServerSubject;
} | [
"public",
"boolean",
"isSIBServerSubject",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"isSIBServerSubject\"",
")",
";",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"isSIBServerSubject\"",
",",
"Boolean",
".",
"valueOf",
"(",
"isSIBServerSubject",
")",
")",
";",
"}",
"return",
"isSIBServerSubject",
";",
"}"
] | Returns the isSIBServerSubject.
@return boolean | [
"Returns",
"the",
"isSIBServerSubject",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java#L443-L451 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java | ConsumerDispatcherState.isDurable | protected boolean isDurable()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(this, tc, "isDurable");
SibTr.exit(this, tc, "isDurable", Boolean.valueOf(durable));
}
return durable; // F001333-14610
} | java | protected boolean isDurable()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(this, tc, "isDurable");
SibTr.exit(this, tc, "isDurable", Boolean.valueOf(durable));
}
return durable; // F001333-14610
} | [
"protected",
"boolean",
"isDurable",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"isDurable\"",
")",
";",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"isDurable\"",
",",
"Boolean",
".",
"valueOf",
"(",
"durable",
")",
")",
";",
"}",
"return",
"durable",
";",
"// F001333-14610",
"}"
] | Is this a durable subscription state
@return isDurable | [
"Is",
"this",
"a",
"durable",
"subscription",
"state"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java#L458-L466 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java | ConsumerDispatcherState.setDurable | public void setDurable(boolean isDurable)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setDurable", Boolean.valueOf(isDurable));
durable = isDurable;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setDurable");
} | java | public void setDurable(boolean isDurable)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setDurable", Boolean.valueOf(isDurable));
durable = isDurable;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setDurable");
} | [
"public",
"void",
"setDurable",
"(",
"boolean",
"isDurable",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"setDurable\"",
",",
"Boolean",
".",
"valueOf",
"(",
"isDurable",
")",
")",
";",
"durable",
"=",
"isDurable",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"setDurable\"",
")",
";",
"}"
] | time for a durable subscription. | [
"time",
"for",
"a",
"durable",
"subscription",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java#L471-L480 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java | ConsumerDispatcherState.equalUser | public boolean equalUser(ConsumerDispatcherState subState)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "equalUser");
/* Check user */
boolean equal = equalUser(subState.getUser(), subState.isSIBServerSubject());
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "equalUser", Boolean.valueOf(equal));
return equal;
} | java | public boolean equalUser(ConsumerDispatcherState subState)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "equalUser");
/* Check user */
boolean equal = equalUser(subState.getUser(), subState.isSIBServerSubject());
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "equalUser", Boolean.valueOf(equal));
return equal;
} | [
"public",
"boolean",
"equalUser",
"(",
"ConsumerDispatcherState",
"subState",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"equalUser\"",
")",
";",
"/* Check user */",
"boolean",
"equal",
"=",
"equalUser",
"(",
"subState",
".",
"getUser",
"(",
")",
",",
"subState",
".",
"isSIBServerSubject",
"(",
")",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"equalUser\"",
",",
"Boolean",
".",
"valueOf",
"(",
"equal",
")",
")",
";",
"return",
"equal",
";",
"}"
] | Returns whether this object has the same values as the given object
@param subState The subscription state to check equal to.
@returns boolean true if the objects match. | [
"Returns",
"whether",
"this",
"object",
"has",
"the",
"same",
"values",
"as",
"the",
"given",
"object"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java#L614-L627 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java | ConsumerDispatcherState.setReady | public void setReady(boolean ready)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setReady", Boolean.valueOf(ready));
this.ready = ready;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setReady");
} | java | public void setReady(boolean ready)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setReady", Boolean.valueOf(ready));
this.ready = ready;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setReady");
} | [
"public",
"void",
"setReady",
"(",
"boolean",
"ready",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"setReady\"",
",",
"Boolean",
".",
"valueOf",
"(",
"ready",
")",
")",
";",
"this",
".",
"ready",
"=",
"ready",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"setReady\"",
")",
";",
"}"
] | Sets the ready flag.
@param ready The ready to set | [
"Sets",
"the",
"ready",
"flag",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java#L698-L707 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java | ConsumerDispatcherState.isNoLocal | public boolean isNoLocal()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(this, tc, "isNoLocal");
SibTr.exit(this, tc, "isNoLocal", Boolean.valueOf(noLocal));
}
return noLocal;
} | java | public boolean isNoLocal()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(this, tc, "isNoLocal");
SibTr.exit(this, tc, "isNoLocal", Boolean.valueOf(noLocal));
}
return noLocal;
} | [
"public",
"boolean",
"isNoLocal",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"isNoLocal\"",
")",
";",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"isNoLocal\"",
",",
"Boolean",
".",
"valueOf",
"(",
"noLocal",
")",
")",
";",
"}",
"return",
"noLocal",
";",
"}"
] | Returns the noLocal flag.
@return boolean | [
"Returns",
"the",
"noLocal",
"flag",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java#L714-L723 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java | ConsumerDispatcherState.setNoLocal | public void setNoLocal(boolean noLocal)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setNoLocal", Boolean.valueOf(noLocal));
this.noLocal = noLocal;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setNoLocal");
} | java | public void setNoLocal(boolean noLocal)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setNoLocal", Boolean.valueOf(noLocal));
this.noLocal = noLocal;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setNoLocal");
} | [
"public",
"void",
"setNoLocal",
"(",
"boolean",
"noLocal",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"setNoLocal\"",
",",
"Boolean",
".",
"valueOf",
"(",
"noLocal",
")",
")",
";",
"this",
".",
"noLocal",
"=",
"noLocal",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"setNoLocal\"",
")",
";",
"}"
] | Sets the noLocal flag.
@param noLocal The noLocal to set | [
"Sets",
"the",
"noLocal",
"flag",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java#L730-L739 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java | ConsumerDispatcherState.setDurableHome | public void setDurableHome(String val)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setDurableHome", val);
durableHome = val;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setDurableHome");
} | java | public void setDurableHome(String val)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setDurableHome", val);
durableHome = val;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setDurableHome");
} | [
"public",
"void",
"setDurableHome",
"(",
"String",
"val",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"setDurableHome\"",
",",
"val",
")",
";",
"durableHome",
"=",
"val",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"setDurableHome\"",
")",
";",
"}"
] | Set durableHome.
@param String | [
"Set",
"durableHome",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java#L803-L810 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java | ConsumerDispatcherState.setIsCloned | public void setIsCloned(boolean isCloned)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setIsCloned", Boolean.valueOf(isCloned));
this.isCloned = isCloned;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setIsCloned");
} | java | public void setIsCloned(boolean isCloned)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setIsCloned", Boolean.valueOf(isCloned));
this.isCloned = isCloned;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setIsCloned");
} | [
"public",
"void",
"setIsCloned",
"(",
"boolean",
"isCloned",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"setIsCloned\"",
",",
"Boolean",
".",
"valueOf",
"(",
"isCloned",
")",
")",
";",
"this",
".",
"isCloned",
"=",
"isCloned",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"setIsCloned\"",
")",
";",
"}"
] | Sets the isCloned.
@param isCloned The isCloned to set | [
"Sets",
"the",
"isCloned",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java#L832-L839 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java | ConsumerDispatcherState.setTopicSpaceName | public void setTopicSpaceName(String name)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setTopicSpaceName", name);
topicSpaceName = name;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setTopicSpaceName");
} | java | public void setTopicSpaceName(String name)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setTopicSpaceName", name);
topicSpaceName = name;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setTopicSpaceName");
} | [
"public",
"void",
"setTopicSpaceName",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"setTopicSpaceName\"",
",",
"name",
")",
";",
"topicSpaceName",
"=",
"name",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"setTopicSpaceName\"",
")",
";",
"}"
] | Sets the name of the topicspace that the subscription was made through
@param string | [
"Sets",
"the",
"name",
"of",
"the",
"topicspace",
"that",
"the",
"subscription",
"was",
"made",
"through"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java#L876-L885 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java | ConsumerDispatcherState.getTopicSpaceBusName | public String getTopicSpaceBusName()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(this, tc, "getTopicSpaceBusName");
SibTr.exit(this, tc, "getTopicSpaceBusName", topicSpaceBusName);
}
return topicSpaceBusName;
} | java | public String getTopicSpaceBusName()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(this, tc, "getTopicSpaceBusName");
SibTr.exit(this, tc, "getTopicSpaceBusName", topicSpaceBusName);
}
return topicSpaceBusName;
} | [
"public",
"String",
"getTopicSpaceBusName",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"getTopicSpaceBusName\"",
")",
";",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"getTopicSpaceBusName\"",
",",
"topicSpaceBusName",
")",
";",
"}",
"return",
"topicSpaceBusName",
";",
"}"
] | Gets the busname of the topicspace that the subscription was made through
@return | [
"Gets",
"the",
"busname",
"of",
"the",
"topicspace",
"that",
"the",
"subscription",
"was",
"made",
"through"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java#L892-L900 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java | ConsumerDispatcherState.setTopicSpaceBusName | public void setTopicSpaceBusName(String busname)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setTopicSpaceBusName", busname);
topicSpaceBusName = busname;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setTopicSpaceBusName");
} | java | public void setTopicSpaceBusName(String busname)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setTopicSpaceBusName", busname);
topicSpaceBusName = busname;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setTopicSpaceBusName");
} | [
"public",
"void",
"setTopicSpaceBusName",
"(",
"String",
"busname",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"setTopicSpaceBusName\"",
",",
"busname",
")",
";",
"topicSpaceBusName",
"=",
"busname",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"setTopicSpaceBusName\"",
")",
";",
"}"
] | Sets the busname of the topicspace that the subscription was made through
@param string | [
"Sets",
"the",
"busname",
"of",
"the",
"topicspace",
"that",
"the",
"subscription",
"was",
"made",
"through"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java#L907-L916 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java | ConsumerDispatcherState.getRemoteMEUuid | public SIBUuid8 getRemoteMEUuid()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(this, tc, "getRemoteMEUuid");
SibTr.exit(this, tc, "getRemoteMEUuid", remoteMEUuid);
}
return remoteMEUuid;
} | java | public SIBUuid8 getRemoteMEUuid()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(this, tc, "getRemoteMEUuid");
SibTr.exit(this, tc, "getRemoteMEUuid", remoteMEUuid);
}
return remoteMEUuid;
} | [
"public",
"SIBUuid8",
"getRemoteMEUuid",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"getRemoteMEUuid\"",
")",
";",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"getRemoteMEUuid\"",
",",
"remoteMEUuid",
")",
";",
"}",
"return",
"remoteMEUuid",
";",
"}"
] | Retrieve the UUID of the ME that homes a remote durable subscription
@return | [
"Retrieve",
"the",
"UUID",
"of",
"the",
"ME",
"that",
"homes",
"a",
"remote",
"durable",
"subscription"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java#L1129-L1137 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java | ConsumerDispatcherState.setRemoteMEUuid | public void setRemoteMEUuid(SIBUuid8 remoteMEUuid)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setRemoteMEUuid", remoteMEUuid);
this.remoteMEUuid = remoteMEUuid;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setRemoteMEUuid");
} | java | public void setRemoteMEUuid(SIBUuid8 remoteMEUuid)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setRemoteMEUuid", remoteMEUuid);
this.remoteMEUuid = remoteMEUuid;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setRemoteMEUuid");
} | [
"public",
"void",
"setRemoteMEUuid",
"(",
"SIBUuid8",
"remoteMEUuid",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"setRemoteMEUuid\"",
",",
"remoteMEUuid",
")",
";",
"this",
".",
"remoteMEUuid",
"=",
"remoteMEUuid",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"setRemoteMEUuid\"",
")",
";",
"}"
] | Set the UUID of the ME that homes a remote durable subscription
@param remoteMEUuid | [
"Set",
"the",
"UUID",
"of",
"the",
"ME",
"that",
"homes",
"a",
"remote",
"durable",
"subscription"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/ConsumerDispatcherState.java#L1144-L1151 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/util/MethodAttribUtils.java | MethodAttribUtils.getXMLAsynchronousMethods | public static boolean getXMLAsynchronousMethods(boolean[] asynchMethodFlags,
MethodInterface methodInterface,
String[] methodNames,
Class<?>[][] methodParamTypes,
EnterpriseBean wccmEnterpriseBean)
throws EJBConfigurationException {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
boolean asynchMethodFound = false; //d621123
if (isTraceOn && tc.isEntryEnabled()) {
Tr.entry(tc, "getXMLAsynchronousMethods", new Object[] {
asynchMethodFlags, wccmEnterpriseBean, methodInterface });
}
//iterate through the asynch-methodTypes in the deployment descriptor
// and match them with the methods defined in the ejbMethods array.
// then for each match, set the asynchMethodsFlags array at the same
// index to true. all others should be false (or left as they were...)
//first verify if all methods are set to asynch (i.e. if the asynch applies
// to the entire bean)
if (wccmEnterpriseBean.getKindValue() == EnterpriseBean.KIND_SESSION &&
//d599046 - check SERVICE_ENDPOINT
methodInterface != MethodInterface.SERVICE_ENDPOINT)
{
Session sb = (Session) wccmEnterpriseBean;
//F00743.9717
List<AsyncMethod> asynchMethods = sb.getAsyncMethods();
for (AsyncMethod am : asynchMethods) {
String methodName = am.getMethodName(); //d603858
if (methodName == null || "".equals(methodName.trim())) {
//error in ejb-jar.xml! method-name element is required
Tr.error(tc, "INVALID_ASYNC_METHOD_ELEMENT_MISSING_METHOD_NAME_CNTR0203E", sb.getName());
throw new EJBConfigurationException("Async method declared without a required method-name");
}
List<String> parms = am.getMethodParamList();
if ("*".equals(methodName) && parms != null) {
//error in ejb-jar.xml! cannot specify parms with wildcard method
Tr.error(tc, "INVALID_ASYNC_METHOD_ELEMENT_SPECIFIED_PARMS_WITH_WILDCARD_METHOD_CNTR0204E", sb.getName());
throw new EJBConfigurationException("Cannot specify parameters when specifying a wildcard method-name for async methods");
}
//style type 1 - unqualified wildcard:
if ("*".equals(methodName))
{
//in this case, all methods are asynchronous:
for (int i = 0; i < asynchMethodFlags.length; i++) {
asynchMethodFlags[i] = true;
}
asynchMethodFound = true; //d621123
//if this is the case, there is no need for further processing
if (isTraceOn && tc.isEntryEnabled()) {
Tr.exit(tc, "getXMLAsynchronousMethods - all methods are marked async");
}
return asynchMethodFound; //d621123
}
// if we are here, then methodName is not a wildcard - style type 2 (no parms) & 3 (parms)
//iterate over method array and check method name and parms (if specified):
for (int i = 0; i < methodNames.length; i++) {
if (methodNames[i] != null && methodNames[i].equals(methodName)) { //d599046 - null check
if (parms == null || DDUtil.methodParamsMatch(parms, methodParamTypes[i])) { // RTC100828
asynchMethodFlags[i] = true;
asynchMethodFound = true; //d621123
}
}
} // end for (int i=0; i<ejbMethods.length; i++)
} // end for (AsyncMethod am : asynchMethods)
if (isTraceOn && tc.isDebugEnabled()) {
for (int i = 0; i < methodNames.length; i++) {
Tr.debug(tc, methodNames[i] + Arrays.toString(methodParamTypes[i]) + " == " + //d599046 - null check
(asynchMethodFlags[i] ? "Asynchronous" : "Synchronous"));
}
}
} // end if (wccmEnterpriseBean.isSession())
else {
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "Not a session bean");
}
if (isTraceOn && tc.isEntryEnabled()) {
Tr.exit(tc, "getXMLAsynchronousMethods");
}
return (asynchMethodFound); //d621123
} | java | public static boolean getXMLAsynchronousMethods(boolean[] asynchMethodFlags,
MethodInterface methodInterface,
String[] methodNames,
Class<?>[][] methodParamTypes,
EnterpriseBean wccmEnterpriseBean)
throws EJBConfigurationException {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
boolean asynchMethodFound = false; //d621123
if (isTraceOn && tc.isEntryEnabled()) {
Tr.entry(tc, "getXMLAsynchronousMethods", new Object[] {
asynchMethodFlags, wccmEnterpriseBean, methodInterface });
}
//iterate through the asynch-methodTypes in the deployment descriptor
// and match them with the methods defined in the ejbMethods array.
// then for each match, set the asynchMethodsFlags array at the same
// index to true. all others should be false (or left as they were...)
//first verify if all methods are set to asynch (i.e. if the asynch applies
// to the entire bean)
if (wccmEnterpriseBean.getKindValue() == EnterpriseBean.KIND_SESSION &&
//d599046 - check SERVICE_ENDPOINT
methodInterface != MethodInterface.SERVICE_ENDPOINT)
{
Session sb = (Session) wccmEnterpriseBean;
//F00743.9717
List<AsyncMethod> asynchMethods = sb.getAsyncMethods();
for (AsyncMethod am : asynchMethods) {
String methodName = am.getMethodName(); //d603858
if (methodName == null || "".equals(methodName.trim())) {
//error in ejb-jar.xml! method-name element is required
Tr.error(tc, "INVALID_ASYNC_METHOD_ELEMENT_MISSING_METHOD_NAME_CNTR0203E", sb.getName());
throw new EJBConfigurationException("Async method declared without a required method-name");
}
List<String> parms = am.getMethodParamList();
if ("*".equals(methodName) && parms != null) {
//error in ejb-jar.xml! cannot specify parms with wildcard method
Tr.error(tc, "INVALID_ASYNC_METHOD_ELEMENT_SPECIFIED_PARMS_WITH_WILDCARD_METHOD_CNTR0204E", sb.getName());
throw new EJBConfigurationException("Cannot specify parameters when specifying a wildcard method-name for async methods");
}
//style type 1 - unqualified wildcard:
if ("*".equals(methodName))
{
//in this case, all methods are asynchronous:
for (int i = 0; i < asynchMethodFlags.length; i++) {
asynchMethodFlags[i] = true;
}
asynchMethodFound = true; //d621123
//if this is the case, there is no need for further processing
if (isTraceOn && tc.isEntryEnabled()) {
Tr.exit(tc, "getXMLAsynchronousMethods - all methods are marked async");
}
return asynchMethodFound; //d621123
}
// if we are here, then methodName is not a wildcard - style type 2 (no parms) & 3 (parms)
//iterate over method array and check method name and parms (if specified):
for (int i = 0; i < methodNames.length; i++) {
if (methodNames[i] != null && methodNames[i].equals(methodName)) { //d599046 - null check
if (parms == null || DDUtil.methodParamsMatch(parms, methodParamTypes[i])) { // RTC100828
asynchMethodFlags[i] = true;
asynchMethodFound = true; //d621123
}
}
} // end for (int i=0; i<ejbMethods.length; i++)
} // end for (AsyncMethod am : asynchMethods)
if (isTraceOn && tc.isDebugEnabled()) {
for (int i = 0; i < methodNames.length; i++) {
Tr.debug(tc, methodNames[i] + Arrays.toString(methodParamTypes[i]) + " == " + //d599046 - null check
(asynchMethodFlags[i] ? "Asynchronous" : "Synchronous"));
}
}
} // end if (wccmEnterpriseBean.isSession())
else {
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "Not a session bean");
}
if (isTraceOn && tc.isEntryEnabled()) {
Tr.exit(tc, "getXMLAsynchronousMethods");
}
return (asynchMethodFound); //d621123
} | [
"public",
"static",
"boolean",
"getXMLAsynchronousMethods",
"(",
"boolean",
"[",
"]",
"asynchMethodFlags",
",",
"MethodInterface",
"methodInterface",
",",
"String",
"[",
"]",
"methodNames",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"[",
"]",
"methodParamTypes",
",",
"EnterpriseBean",
"wccmEnterpriseBean",
")",
"throws",
"EJBConfigurationException",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"boolean",
"asynchMethodFound",
"=",
"false",
";",
"//d621123",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"getXMLAsynchronousMethods\"",
",",
"new",
"Object",
"[",
"]",
"{",
"asynchMethodFlags",
",",
"wccmEnterpriseBean",
",",
"methodInterface",
"}",
")",
";",
"}",
"//iterate through the asynch-methodTypes in the deployment descriptor",
"// and match them with the methods defined in the ejbMethods array.",
"// then for each match, set the asynchMethodsFlags array at the same",
"// index to true. all others should be false (or left as they were...)",
"//first verify if all methods are set to asynch (i.e. if the asynch applies",
"// to the entire bean)",
"if",
"(",
"wccmEnterpriseBean",
".",
"getKindValue",
"(",
")",
"==",
"EnterpriseBean",
".",
"KIND_SESSION",
"&&",
"//d599046 - check SERVICE_ENDPOINT",
"methodInterface",
"!=",
"MethodInterface",
".",
"SERVICE_ENDPOINT",
")",
"{",
"Session",
"sb",
"=",
"(",
"Session",
")",
"wccmEnterpriseBean",
";",
"//F00743.9717",
"List",
"<",
"AsyncMethod",
">",
"asynchMethods",
"=",
"sb",
".",
"getAsyncMethods",
"(",
")",
";",
"for",
"(",
"AsyncMethod",
"am",
":",
"asynchMethods",
")",
"{",
"String",
"methodName",
"=",
"am",
".",
"getMethodName",
"(",
")",
";",
"//d603858",
"if",
"(",
"methodName",
"==",
"null",
"||",
"\"\"",
".",
"equals",
"(",
"methodName",
".",
"trim",
"(",
")",
")",
")",
"{",
"//error in ejb-jar.xml! method-name element is required",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"INVALID_ASYNC_METHOD_ELEMENT_MISSING_METHOD_NAME_CNTR0203E\"",
",",
"sb",
".",
"getName",
"(",
")",
")",
";",
"throw",
"new",
"EJBConfigurationException",
"(",
"\"Async method declared without a required method-name\"",
")",
";",
"}",
"List",
"<",
"String",
">",
"parms",
"=",
"am",
".",
"getMethodParamList",
"(",
")",
";",
"if",
"(",
"\"*\"",
".",
"equals",
"(",
"methodName",
")",
"&&",
"parms",
"!=",
"null",
")",
"{",
"//error in ejb-jar.xml! cannot specify parms with wildcard method",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"INVALID_ASYNC_METHOD_ELEMENT_SPECIFIED_PARMS_WITH_WILDCARD_METHOD_CNTR0204E\"",
",",
"sb",
".",
"getName",
"(",
")",
")",
";",
"throw",
"new",
"EJBConfigurationException",
"(",
"\"Cannot specify parameters when specifying a wildcard method-name for async methods\"",
")",
";",
"}",
"//style type 1 - unqualified wildcard:",
"if",
"(",
"\"*\"",
".",
"equals",
"(",
"methodName",
")",
")",
"{",
"//in this case, all methods are asynchronous:",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"asynchMethodFlags",
".",
"length",
";",
"i",
"++",
")",
"{",
"asynchMethodFlags",
"[",
"i",
"]",
"=",
"true",
";",
"}",
"asynchMethodFound",
"=",
"true",
";",
"//d621123",
"//if this is the case, there is no need for further processing",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"getXMLAsynchronousMethods - all methods are marked async\"",
")",
";",
"}",
"return",
"asynchMethodFound",
";",
"//d621123",
"}",
"// if we are here, then methodName is not a wildcard - style type 2 (no parms) & 3 (parms)",
"//iterate over method array and check method name and parms (if specified):",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"methodNames",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"methodNames",
"[",
"i",
"]",
"!=",
"null",
"&&",
"methodNames",
"[",
"i",
"]",
".",
"equals",
"(",
"methodName",
")",
")",
"{",
"//d599046 - null check",
"if",
"(",
"parms",
"==",
"null",
"||",
"DDUtil",
".",
"methodParamsMatch",
"(",
"parms",
",",
"methodParamTypes",
"[",
"i",
"]",
")",
")",
"{",
"// RTC100828",
"asynchMethodFlags",
"[",
"i",
"]",
"=",
"true",
";",
"asynchMethodFound",
"=",
"true",
";",
"//d621123",
"}",
"}",
"}",
"// end for (int i=0; i<ejbMethods.length; i++)",
"}",
"// end for (AsyncMethod am : asynchMethods)",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"methodNames",
".",
"length",
";",
"i",
"++",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"methodNames",
"[",
"i",
"]",
"+",
"Arrays",
".",
"toString",
"(",
"methodParamTypes",
"[",
"i",
"]",
")",
"+",
"\" == \"",
"+",
"//d599046 - null check",
"(",
"asynchMethodFlags",
"[",
"i",
"]",
"?",
"\"Asynchronous\"",
":",
"\"Synchronous\"",
")",
")",
";",
"}",
"}",
"}",
"// end if (wccmEnterpriseBean.isSession())",
"else",
"{",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Not a session bean\"",
")",
";",
"}",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"getXMLAsynchronousMethods\"",
")",
";",
"}",
"return",
"(",
"asynchMethodFound",
")",
";",
"//d621123",
"}"
] | F743-4582
Determines which methods on the specified Enterprise Bean should be
marked asynchronous by updating the passed-in boolean array.
Pre-conditions:
<ol>
<li>asynchMethodFlags, ejbMethods, wccmEnterpriseBean, and bmd must be non-null</li>
<li>asynchMethodFlags.length MUST equal ejbMethods.length</li>
<li>bmd.classLoader must be set to the bean's classloader (not null)</li>
<li>bmd.ivBusiness[Local|Remote]InterfaceClasses must be non-null</li>
</ol>
@param asynchMethodFlags - array indicating which ejb methods are asynchronous
- corresponds to the methods in <code>ejbMethods</code>
@param ejbMethods - array of methods on the bean class, limited by the interface
currently being processed
@param wccmEnterpriseBean - Enterprise bean object read in from ejb-jar.xml via WCCM
@param methodInterface - MethodInterface type (Local, Remote, etc.) currently being
processed
@return True if at least one asynchronous method was found on this bean.
@throws EJBConfigurationException if the XML DD contains invalid meta-data | [
"F743",
"-",
"4582",
"Determines",
"which",
"methods",
"on",
"the",
"specified",
"Enterprise",
"Bean",
"should",
"be",
"marked",
"asynchronous",
"by",
"updating",
"the",
"passed",
"-",
"in",
"boolean",
"array",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/util/MethodAttribUtils.java#L177-L270 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/util/MethodAttribUtils.java | MethodAttribUtils.getBusinessMethodsByName | static Map<String, List<Method>> getBusinessMethodsByName(BeanMetaData bmd) {
Map<String, List<Method>> methodsByName = new HashMap<String, List<Method>>();
collectBusinessMethodsByName(methodsByName, bmd.methodInfos);
collectBusinessMethodsByName(methodsByName, bmd.localMethodInfos);
return methodsByName;
} | java | static Map<String, List<Method>> getBusinessMethodsByName(BeanMetaData bmd) {
Map<String, List<Method>> methodsByName = new HashMap<String, List<Method>>();
collectBusinessMethodsByName(methodsByName, bmd.methodInfos);
collectBusinessMethodsByName(methodsByName, bmd.localMethodInfos);
return methodsByName;
} | [
"static",
"Map",
"<",
"String",
",",
"List",
"<",
"Method",
">",
">",
"getBusinessMethodsByName",
"(",
"BeanMetaData",
"bmd",
")",
"{",
"Map",
"<",
"String",
",",
"List",
"<",
"Method",
">",
">",
"methodsByName",
"=",
"new",
"HashMap",
"<",
"String",
",",
"List",
"<",
"Method",
">",
">",
"(",
")",
";",
"collectBusinessMethodsByName",
"(",
"methodsByName",
",",
"bmd",
".",
"methodInfos",
")",
";",
"collectBusinessMethodsByName",
"(",
"methodsByName",
",",
"bmd",
".",
"localMethodInfos",
")",
";",
"return",
"methodsByName",
";",
"}"
] | Returns a map of method name to list of business methods. | [
"Returns",
"a",
"map",
"of",
"method",
"name",
"to",
"list",
"of",
"business",
"methods",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/util/MethodAttribUtils.java#L615-L620 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/util/MethodAttribUtils.java | MethodAttribUtils.findMatchingMethod | static Method findMatchingMethod(Map<String, List<Method>> methodsByName, com.ibm.ws.javaee.dd.ejb.Method me) {
List<Method> methods = methodsByName.get(me.getMethodName());
if (methods == null) {
return null;
}
List<String> meParms = me.getMethodParamList();
if (meParms == null) {
return methods.get(0);
}
for (Method method : methods) {
if (DDUtil.methodParamsMatch(meParms, method.getParameterTypes())) {
return method;
}
}
return null;
} | java | static Method findMatchingMethod(Map<String, List<Method>> methodsByName, com.ibm.ws.javaee.dd.ejb.Method me) {
List<Method> methods = methodsByName.get(me.getMethodName());
if (methods == null) {
return null;
}
List<String> meParms = me.getMethodParamList();
if (meParms == null) {
return methods.get(0);
}
for (Method method : methods) {
if (DDUtil.methodParamsMatch(meParms, method.getParameterTypes())) {
return method;
}
}
return null;
} | [
"static",
"Method",
"findMatchingMethod",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"Method",
">",
">",
"methodsByName",
",",
"com",
".",
"ibm",
".",
"ws",
".",
"javaee",
".",
"dd",
".",
"ejb",
".",
"Method",
"me",
")",
"{",
"List",
"<",
"Method",
">",
"methods",
"=",
"methodsByName",
".",
"get",
"(",
"me",
".",
"getMethodName",
"(",
")",
")",
";",
"if",
"(",
"methods",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"List",
"<",
"String",
">",
"meParms",
"=",
"me",
".",
"getMethodParamList",
"(",
")",
";",
"if",
"(",
"meParms",
"==",
"null",
")",
"{",
"return",
"methods",
".",
"get",
"(",
"0",
")",
";",
"}",
"for",
"(",
"Method",
"method",
":",
"methods",
")",
"{",
"if",
"(",
"DDUtil",
".",
"methodParamsMatch",
"(",
"meParms",
",",
"method",
".",
"getParameterTypes",
"(",
")",
")",
")",
"{",
"return",
"method",
";",
"}",
"}",
"return",
"null",
";",
"}"
] | Finds the first matching method in a map of method name to list of methods. | [
"Finds",
"the",
"first",
"matching",
"method",
"in",
"a",
"map",
"of",
"method",
"name",
"to",
"list",
"of",
"methods",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/util/MethodAttribUtils.java#L641-L659 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/util/MethodAttribUtils.java | MethodAttribUtils.methodsEqual | public static final boolean methodsEqual(Method remoteMethod, Method beanMethod)
{
if ((remoteMethod == null) || (beanMethod == null)) {
return false;
}
//----------------------
// Compare method names
//----------------------
if (!remoteMethod.getName().equals(beanMethod.getName())) {
return false;
}
//-------------------------
// Compare parameter types
//-------------------------
Class<?> remoteMethodParamTypes[] = remoteMethod.getParameterTypes();
Class<?> beanMethodParamTypes[] = beanMethod.getParameterTypes();
if (remoteMethodParamTypes.length != beanMethodParamTypes.length) {
return false;
}
for (int i = 0; i < remoteMethodParamTypes.length; i++) {
if (!remoteMethodParamTypes[i].equals(beanMethodParamTypes[i])) {
return false;
}
}
//-----------------------------------------------------------------
// If method names are equal and parameter types match then the
// methods are equal for our purposes. Java does not allow methods
// with the same name and parameter types that differ only in
// return type and/or exception signature.
//-----------------------------------------------------------------
return true;
} | java | public static final boolean methodsEqual(Method remoteMethod, Method beanMethod)
{
if ((remoteMethod == null) || (beanMethod == null)) {
return false;
}
//----------------------
// Compare method names
//----------------------
if (!remoteMethod.getName().equals(beanMethod.getName())) {
return false;
}
//-------------------------
// Compare parameter types
//-------------------------
Class<?> remoteMethodParamTypes[] = remoteMethod.getParameterTypes();
Class<?> beanMethodParamTypes[] = beanMethod.getParameterTypes();
if (remoteMethodParamTypes.length != beanMethodParamTypes.length) {
return false;
}
for (int i = 0; i < remoteMethodParamTypes.length; i++) {
if (!remoteMethodParamTypes[i].equals(beanMethodParamTypes[i])) {
return false;
}
}
//-----------------------------------------------------------------
// If method names are equal and parameter types match then the
// methods are equal for our purposes. Java does not allow methods
// with the same name and parameter types that differ only in
// return type and/or exception signature.
//-----------------------------------------------------------------
return true;
} | [
"public",
"static",
"final",
"boolean",
"methodsEqual",
"(",
"Method",
"remoteMethod",
",",
"Method",
"beanMethod",
")",
"{",
"if",
"(",
"(",
"remoteMethod",
"==",
"null",
")",
"||",
"(",
"beanMethod",
"==",
"null",
")",
")",
"{",
"return",
"false",
";",
"}",
"//----------------------",
"// Compare method names",
"//----------------------",
"if",
"(",
"!",
"remoteMethod",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"beanMethod",
".",
"getName",
"(",
")",
")",
")",
"{",
"return",
"false",
";",
"}",
"//-------------------------",
"// Compare parameter types",
"//-------------------------",
"Class",
"<",
"?",
">",
"remoteMethodParamTypes",
"[",
"]",
"=",
"remoteMethod",
".",
"getParameterTypes",
"(",
")",
";",
"Class",
"<",
"?",
">",
"beanMethodParamTypes",
"[",
"]",
"=",
"beanMethod",
".",
"getParameterTypes",
"(",
")",
";",
"if",
"(",
"remoteMethodParamTypes",
".",
"length",
"!=",
"beanMethodParamTypes",
".",
"length",
")",
"{",
"return",
"false",
";",
"}",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"remoteMethodParamTypes",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"!",
"remoteMethodParamTypes",
"[",
"i",
"]",
".",
"equals",
"(",
"beanMethodParamTypes",
"[",
"i",
"]",
")",
")",
"{",
"return",
"false",
";",
"}",
"}",
"//-----------------------------------------------------------------",
"// If method names are equal and parameter types match then the",
"// methods are equal for our purposes. Java does not allow methods",
"// with the same name and parameter types that differ only in",
"// return type and/or exception signature.",
"//-----------------------------------------------------------------",
"return",
"true",
";",
"}"
] | This utility method compares a method on the bean's remote
interface with a method on the bean and returns true iff they
are equal for the purpose of determining if the control
descriptor associated with the bean method applies to the
remote interface method. Equality in this case means the methods
are identical except for the abstract modifier on the remote
interface method. | [
"This",
"utility",
"method",
"compares",
"a",
"method",
"on",
"the",
"bean",
"s",
"remote",
"interface",
"with",
"a",
"method",
"on",
"the",
"bean",
"and",
"returns",
"true",
"iff",
"they",
"are",
"equal",
"for",
"the",
"purpose",
"of",
"determining",
"if",
"the",
"control",
"descriptor",
"associated",
"with",
"the",
"bean",
"method",
"applies",
"to",
"the",
"remote",
"interface",
"method",
".",
"Equality",
"in",
"this",
"case",
"means",
"the",
"methods",
"are",
"identical",
"except",
"for",
"the",
"abstract",
"modifier",
"on",
"the",
"remote",
"interface",
"method",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/util/MethodAttribUtils.java#L1691-L1730 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/util/MethodAttribUtils.java | MethodAttribUtils.homeMethodEquals | public static final boolean homeMethodEquals(Method homeMethod,
Properties beanMethodProps)
{
if ((homeMethod == null) || (beanMethodProps == null)) {
return false;
}
//----------------------
// Compare method names
//----------------------
String homeMethodName = homeMethod.getName();
String beanMethodName = (String) beanMethodProps.get("Name");
if (!homeMethodName.equals(beanMethodName)) {
return false;
}
//-------------------------
// Compare parameter types
//-------------------------
Class<?> homeMethodParamTypes[] = homeMethod.getParameterTypes();
String beanMethodParamTypes[] =
(String[]) beanMethodProps.get("ArgumentTypes");
if (homeMethodParamTypes.length != beanMethodParamTypes.length) {
return false;
}
for (int i = 0; i < homeMethodParamTypes.length; i++) {
if (!homeMethodParamTypes[i].getName().equals(beanMethodParamTypes[i])) {
return false;
}
}
//-----------------------------------------------------------------
// If method names are equal and parameter types match then the
// methods are equal for our purposes. Java does not allow methods
// with the same name and parameter types that differ only in
// return type and/or exception signature.
//-----------------------------------------------------------------
return true;
} | java | public static final boolean homeMethodEquals(Method homeMethod,
Properties beanMethodProps)
{
if ((homeMethod == null) || (beanMethodProps == null)) {
return false;
}
//----------------------
// Compare method names
//----------------------
String homeMethodName = homeMethod.getName();
String beanMethodName = (String) beanMethodProps.get("Name");
if (!homeMethodName.equals(beanMethodName)) {
return false;
}
//-------------------------
// Compare parameter types
//-------------------------
Class<?> homeMethodParamTypes[] = homeMethod.getParameterTypes();
String beanMethodParamTypes[] =
(String[]) beanMethodProps.get("ArgumentTypes");
if (homeMethodParamTypes.length != beanMethodParamTypes.length) {
return false;
}
for (int i = 0; i < homeMethodParamTypes.length; i++) {
if (!homeMethodParamTypes[i].getName().equals(beanMethodParamTypes[i])) {
return false;
}
}
//-----------------------------------------------------------------
// If method names are equal and parameter types match then the
// methods are equal for our purposes. Java does not allow methods
// with the same name and parameter types that differ only in
// return type and/or exception signature.
//-----------------------------------------------------------------
return true;
} | [
"public",
"static",
"final",
"boolean",
"homeMethodEquals",
"(",
"Method",
"homeMethod",
",",
"Properties",
"beanMethodProps",
")",
"{",
"if",
"(",
"(",
"homeMethod",
"==",
"null",
")",
"||",
"(",
"beanMethodProps",
"==",
"null",
")",
")",
"{",
"return",
"false",
";",
"}",
"//----------------------",
"// Compare method names",
"//----------------------",
"String",
"homeMethodName",
"=",
"homeMethod",
".",
"getName",
"(",
")",
";",
"String",
"beanMethodName",
"=",
"(",
"String",
")",
"beanMethodProps",
".",
"get",
"(",
"\"Name\"",
")",
";",
"if",
"(",
"!",
"homeMethodName",
".",
"equals",
"(",
"beanMethodName",
")",
")",
"{",
"return",
"false",
";",
"}",
"//-------------------------",
"// Compare parameter types",
"//-------------------------",
"Class",
"<",
"?",
">",
"homeMethodParamTypes",
"[",
"]",
"=",
"homeMethod",
".",
"getParameterTypes",
"(",
")",
";",
"String",
"beanMethodParamTypes",
"[",
"]",
"=",
"(",
"String",
"[",
"]",
")",
"beanMethodProps",
".",
"get",
"(",
"\"ArgumentTypes\"",
")",
";",
"if",
"(",
"homeMethodParamTypes",
".",
"length",
"!=",
"beanMethodParamTypes",
".",
"length",
")",
"{",
"return",
"false",
";",
"}",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"homeMethodParamTypes",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"!",
"homeMethodParamTypes",
"[",
"i",
"]",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"beanMethodParamTypes",
"[",
"i",
"]",
")",
")",
"{",
"return",
"false",
";",
"}",
"}",
"//-----------------------------------------------------------------",
"// If method names are equal and parameter types match then the",
"// methods are equal for our purposes. Java does not allow methods",
"// with the same name and parameter types that differ only in",
"// return type and/or exception signature.",
"//-----------------------------------------------------------------",
"return",
"true",
";",
"}"
] | This utility method compares a method on the bean's home
interface with a method on the bean and returns true iff they
are equal for the purpose of determining if the control
descriptor associated with the bean method applies to the
remote interface method. Equality in this case means that the
bean method has the same name as the home method and they have
the same parameters. | [
"This",
"utility",
"method",
"compares",
"a",
"method",
"on",
"the",
"bean",
"s",
"home",
"interface",
"with",
"a",
"method",
"on",
"the",
"bean",
"and",
"returns",
"true",
"iff",
"they",
"are",
"equal",
"for",
"the",
"purpose",
"of",
"determining",
"if",
"the",
"control",
"descriptor",
"associated",
"with",
"the",
"bean",
"method",
"applies",
"to",
"the",
"remote",
"interface",
"method",
".",
"Equality",
"in",
"this",
"case",
"means",
"that",
"the",
"bean",
"method",
"has",
"the",
"same",
"name",
"as",
"the",
"home",
"method",
"and",
"they",
"have",
"the",
"same",
"parameters",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/util/MethodAttribUtils.java#L1741-L1786 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/util/MethodAttribUtils.java | MethodAttribUtils.timeUnitToMillis | public static long timeUnitToMillis(long value,
TimeUnit unit,
boolean annotation,
BeanMetaData bmd) throws EJBConfigurationException {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled()) {
Tr.entry(tc, "timeUnitToMillis: " + value + unit);
}
// Initialize to input value in case current unit is already in
// javax.util.concurrent.TimeUnit.MILLISECONDS
long timeout = value;
if (timeout > 0) {
timeout = TimeUnit.MILLISECONDS.convert(value, unit);
if (timeout == Long.MAX_VALUE || timeout == Long.MIN_VALUE) {
Tr.error(tc, "STATEFUL_TIMEOUT_OVERFLOW_CNTR0309E",
new Object[] { bmd.getName(), bmd.getModuleMetaData().getName(),
bmd.getModuleMetaData().getApplicationMetaData().getName(),
value, unit });
throw new EJBConfigurationException("Conversion of stateful session timeout value of " +
value + " " + unit + " to milliseconds resulted in overflow.");
}
}
else {
if (timeout == 0) {
// 0 means no wait, represented internally as the nominal 1 millisecond
timeout = 1;
}
else if (timeout == -1) {
// -1 indicates wait forever, represented internally as 0
timeout = 0L;
}
else {
// invalid (negative) timeout value
Object[] parms = new Object[] { bmd.getName(), bmd.getModuleMetaData().getName(), bmd.getModuleMetaData().getApplicationMetaData().getName(), timeout };
if (annotation) {
Tr.error(tc, "NEGATIVE_STATEFUL_TIMEOUT_ANN_CNTR0311E", parms);
}
else {
Tr.error(tc, "NEGATIVE_STATEFUL_TIMEOUT_XML_CNTR0312E", parms);
}
throw new EJBConfigurationException("Stateful session timeout value of " +
value + " " + unit + " is negative.");
}
}
if (isTraceOn && tc.isEntryEnabled()) {
Tr.exit(tc, "timeUnitToMillis: " + timeout);
}
return timeout;
} | java | public static long timeUnitToMillis(long value,
TimeUnit unit,
boolean annotation,
BeanMetaData bmd) throws EJBConfigurationException {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled()) {
Tr.entry(tc, "timeUnitToMillis: " + value + unit);
}
// Initialize to input value in case current unit is already in
// javax.util.concurrent.TimeUnit.MILLISECONDS
long timeout = value;
if (timeout > 0) {
timeout = TimeUnit.MILLISECONDS.convert(value, unit);
if (timeout == Long.MAX_VALUE || timeout == Long.MIN_VALUE) {
Tr.error(tc, "STATEFUL_TIMEOUT_OVERFLOW_CNTR0309E",
new Object[] { bmd.getName(), bmd.getModuleMetaData().getName(),
bmd.getModuleMetaData().getApplicationMetaData().getName(),
value, unit });
throw new EJBConfigurationException("Conversion of stateful session timeout value of " +
value + " " + unit + " to milliseconds resulted in overflow.");
}
}
else {
if (timeout == 0) {
// 0 means no wait, represented internally as the nominal 1 millisecond
timeout = 1;
}
else if (timeout == -1) {
// -1 indicates wait forever, represented internally as 0
timeout = 0L;
}
else {
// invalid (negative) timeout value
Object[] parms = new Object[] { bmd.getName(), bmd.getModuleMetaData().getName(), bmd.getModuleMetaData().getApplicationMetaData().getName(), timeout };
if (annotation) {
Tr.error(tc, "NEGATIVE_STATEFUL_TIMEOUT_ANN_CNTR0311E", parms);
}
else {
Tr.error(tc, "NEGATIVE_STATEFUL_TIMEOUT_XML_CNTR0312E", parms);
}
throw new EJBConfigurationException("Stateful session timeout value of " +
value + " " + unit + " is negative.");
}
}
if (isTraceOn && tc.isEntryEnabled()) {
Tr.exit(tc, "timeUnitToMillis: " + timeout);
}
return timeout;
} | [
"public",
"static",
"long",
"timeUnitToMillis",
"(",
"long",
"value",
",",
"TimeUnit",
"unit",
",",
"boolean",
"annotation",
",",
"BeanMetaData",
"bmd",
")",
"throws",
"EJBConfigurationException",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"timeUnitToMillis: \"",
"+",
"value",
"+",
"unit",
")",
";",
"}",
"// Initialize to input value in case current unit is already in",
"// javax.util.concurrent.TimeUnit.MILLISECONDS",
"long",
"timeout",
"=",
"value",
";",
"if",
"(",
"timeout",
">",
"0",
")",
"{",
"timeout",
"=",
"TimeUnit",
".",
"MILLISECONDS",
".",
"convert",
"(",
"value",
",",
"unit",
")",
";",
"if",
"(",
"timeout",
"==",
"Long",
".",
"MAX_VALUE",
"||",
"timeout",
"==",
"Long",
".",
"MIN_VALUE",
")",
"{",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"STATEFUL_TIMEOUT_OVERFLOW_CNTR0309E\"",
",",
"new",
"Object",
"[",
"]",
"{",
"bmd",
".",
"getName",
"(",
")",
",",
"bmd",
".",
"getModuleMetaData",
"(",
")",
".",
"getName",
"(",
")",
",",
"bmd",
".",
"getModuleMetaData",
"(",
")",
".",
"getApplicationMetaData",
"(",
")",
".",
"getName",
"(",
")",
",",
"value",
",",
"unit",
"}",
")",
";",
"throw",
"new",
"EJBConfigurationException",
"(",
"\"Conversion of stateful session timeout value of \"",
"+",
"value",
"+",
"\" \"",
"+",
"unit",
"+",
"\" to milliseconds resulted in overflow.\"",
")",
";",
"}",
"}",
"else",
"{",
"if",
"(",
"timeout",
"==",
"0",
")",
"{",
"// 0 means no wait, represented internally as the nominal 1 millisecond",
"timeout",
"=",
"1",
";",
"}",
"else",
"if",
"(",
"timeout",
"==",
"-",
"1",
")",
"{",
"// -1 indicates wait forever, represented internally as 0",
"timeout",
"=",
"0L",
";",
"}",
"else",
"{",
"// invalid (negative) timeout value",
"Object",
"[",
"]",
"parms",
"=",
"new",
"Object",
"[",
"]",
"{",
"bmd",
".",
"getName",
"(",
")",
",",
"bmd",
".",
"getModuleMetaData",
"(",
")",
".",
"getName",
"(",
")",
",",
"bmd",
".",
"getModuleMetaData",
"(",
")",
".",
"getApplicationMetaData",
"(",
")",
".",
"getName",
"(",
")",
",",
"timeout",
"}",
";",
"if",
"(",
"annotation",
")",
"{",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"NEGATIVE_STATEFUL_TIMEOUT_ANN_CNTR0311E\"",
",",
"parms",
")",
";",
"}",
"else",
"{",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"NEGATIVE_STATEFUL_TIMEOUT_XML_CNTR0312E\"",
",",
"parms",
")",
";",
"}",
"throw",
"new",
"EJBConfigurationException",
"(",
"\"Stateful session timeout value of \"",
"+",
"value",
"+",
"\" \"",
"+",
"unit",
"+",
"\" is negative.\"",
")",
";",
"}",
"}",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"timeUnitToMillis: \"",
"+",
"timeout",
")",
";",
"}",
"return",
"timeout",
";",
"}"
] | F743-6605.1 streamlined method. | [
"F743",
"-",
"6605",
".",
"1",
"streamlined",
"method",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/util/MethodAttribUtils.java#L2624-L2682 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transaction/src/com/ibm/ws/transaction/services/TransactionJavaColonHelper.java | TransactionJavaColonHelper.getUserTransaction | protected UserTransaction getUserTransaction(boolean injection, Object injectionContext) throws NamingException
{
final UserTransaction ut = AccessController.doPrivileged(new PrivilegedAction<UserTransaction>() {
@Override
public UserTransaction run() {
return userTranSvcRef.getBundle().getBundleContext().getService(userTranSvcRef);
}
});
final UserTransactionDecorator utd = getUserTransactionDecorator();
if (utd == null) {
return ut;
} else {
return utd.decorateUserTransaction(ut, injection, injectionContext);
}
} | java | protected UserTransaction getUserTransaction(boolean injection, Object injectionContext) throws NamingException
{
final UserTransaction ut = AccessController.doPrivileged(new PrivilegedAction<UserTransaction>() {
@Override
public UserTransaction run() {
return userTranSvcRef.getBundle().getBundleContext().getService(userTranSvcRef);
}
});
final UserTransactionDecorator utd = getUserTransactionDecorator();
if (utd == null) {
return ut;
} else {
return utd.decorateUserTransaction(ut, injection, injectionContext);
}
} | [
"protected",
"UserTransaction",
"getUserTransaction",
"(",
"boolean",
"injection",
",",
"Object",
"injectionContext",
")",
"throws",
"NamingException",
"{",
"final",
"UserTransaction",
"ut",
"=",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedAction",
"<",
"UserTransaction",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"UserTransaction",
"run",
"(",
")",
"{",
"return",
"userTranSvcRef",
".",
"getBundle",
"(",
")",
".",
"getBundleContext",
"(",
")",
".",
"getService",
"(",
"userTranSvcRef",
")",
";",
"}",
"}",
")",
";",
"final",
"UserTransactionDecorator",
"utd",
"=",
"getUserTransactionDecorator",
"(",
")",
";",
"if",
"(",
"utd",
"==",
"null",
")",
"{",
"return",
"ut",
";",
"}",
"else",
"{",
"return",
"utd",
".",
"decorateUserTransaction",
"(",
"ut",
",",
"injection",
",",
"injectionContext",
")",
";",
"}",
"}"
] | Helper method for use with injection TransactionObjectFactoruy.
@param injection if the UserTransaction is being obtained for injection
@param injectionContext the injection target context if injection is true, or null if unspecified
@return UserTransaction object with decorator applied if present
@throws NamingException if the decorator determines the UserTransaction is not available | [
"Helper",
"method",
"for",
"use",
"with",
"injection",
"TransactionObjectFactoruy",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transaction/src/com/ibm/ws/transaction/services/TransactionJavaColonHelper.java#L152-L166 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jaxrs.2.0.common/src/org/apache/cxf/jaxrs/model/AbstractResourceInfo.java | AbstractResourceInfo.addToMap | private <T, V> boolean addToMap(Map<Class<?>, Map<T, V>> proxyMap,
T f,
V proxy) {
Map<T, V> proxies = proxyMap.get(serviceClass);
if (proxies == null) {
proxies = new HashMap<T, V>();
proxyMap.put(serviceClass, proxies);
}
if (!proxies.containsKey(f)) {
proxies.put(f, proxy);
return true;
}
return false;
} | java | private <T, V> boolean addToMap(Map<Class<?>, Map<T, V>> proxyMap,
T f,
V proxy) {
Map<T, V> proxies = proxyMap.get(serviceClass);
if (proxies == null) {
proxies = new HashMap<T, V>();
proxyMap.put(serviceClass, proxies);
}
if (!proxies.containsKey(f)) {
proxies.put(f, proxy);
return true;
}
return false;
} | [
"private",
"<",
"T",
",",
"V",
">",
"boolean",
"addToMap",
"(",
"Map",
"<",
"Class",
"<",
"?",
">",
",",
"Map",
"<",
"T",
",",
"V",
">",
">",
"proxyMap",
",",
"T",
"f",
",",
"V",
"proxy",
")",
"{",
"Map",
"<",
"T",
",",
"V",
">",
"proxies",
"=",
"proxyMap",
".",
"get",
"(",
"serviceClass",
")",
";",
"if",
"(",
"proxies",
"==",
"null",
")",
"{",
"proxies",
"=",
"new",
"HashMap",
"<",
"T",
",",
"V",
">",
"(",
")",
";",
"proxyMap",
".",
"put",
"(",
"serviceClass",
",",
"proxies",
")",
";",
"}",
"if",
"(",
"!",
"proxies",
".",
"containsKey",
"(",
"f",
")",
")",
"{",
"proxies",
".",
"put",
"(",
"f",
",",
"proxy",
")",
";",
"return",
"true",
";",
"}",
"return",
"false",
";",
"}"
] | Liberty code change start defect 182967 | [
"Liberty",
"code",
"change",
"start",
"defect",
"182967"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxrs.2.0.common/src/org/apache/cxf/jaxrs/model/AbstractResourceInfo.java#L432-L445 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/provider/AbstractJSSEProvider.java | AbstractJSSEProvider.getTrustManagerFactoryInstance | public TrustManagerFactory getTrustManagerFactoryInstance(String trustMgr, String ctxtProvider) throws NoSuchAlgorithmException, NoSuchProviderException {
String mgr = trustMgr;
String provider = ctxtProvider;
if (mgr.indexOf('|') != -1) {
String[] trustManagerArray = mgr.split("\\|");
if (trustManagerArray != null && trustManagerArray.length == 2) {
mgr = trustManagerArray[0];
provider = trustManagerArray[1];
}
}
TrustManagerFactory rc = TrustManagerFactory.getInstance(mgr, provider);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "getTrustManagerFactory.getInstance(" + mgr + ", " + provider + ")" + rc);
return rc;
} | java | public TrustManagerFactory getTrustManagerFactoryInstance(String trustMgr, String ctxtProvider) throws NoSuchAlgorithmException, NoSuchProviderException {
String mgr = trustMgr;
String provider = ctxtProvider;
if (mgr.indexOf('|') != -1) {
String[] trustManagerArray = mgr.split("\\|");
if (trustManagerArray != null && trustManagerArray.length == 2) {
mgr = trustManagerArray[0];
provider = trustManagerArray[1];
}
}
TrustManagerFactory rc = TrustManagerFactory.getInstance(mgr, provider);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "getTrustManagerFactory.getInstance(" + mgr + ", " + provider + ")" + rc);
return rc;
} | [
"public",
"TrustManagerFactory",
"getTrustManagerFactoryInstance",
"(",
"String",
"trustMgr",
",",
"String",
"ctxtProvider",
")",
"throws",
"NoSuchAlgorithmException",
",",
"NoSuchProviderException",
"{",
"String",
"mgr",
"=",
"trustMgr",
";",
"String",
"provider",
"=",
"ctxtProvider",
";",
"if",
"(",
"mgr",
".",
"indexOf",
"(",
"'",
"'",
")",
"!=",
"-",
"1",
")",
"{",
"String",
"[",
"]",
"trustManagerArray",
"=",
"mgr",
".",
"split",
"(",
"\"\\\\|\"",
")",
";",
"if",
"(",
"trustManagerArray",
"!=",
"null",
"&&",
"trustManagerArray",
".",
"length",
"==",
"2",
")",
"{",
"mgr",
"=",
"trustManagerArray",
"[",
"0",
"]",
";",
"provider",
"=",
"trustManagerArray",
"[",
"1",
"]",
";",
"}",
"}",
"TrustManagerFactory",
"rc",
"=",
"TrustManagerFactory",
".",
"getInstance",
"(",
"mgr",
",",
"provider",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"getTrustManagerFactory.getInstance(\"",
"+",
"mgr",
"+",
"\", \"",
"+",
"provider",
"+",
"\")\"",
"+",
"rc",
")",
";",
"return",
"rc",
";",
"}"
] | Get the trust manager factory instance using the provided information.
@see com.ibm.websphere.ssl.JSSEProvider#getTrustManagerFactoryInstance()
@param trustMgr
@param ctxtProvider
@return TrustManagerFactory
@throws NoSuchAlgorithmException
@throws NoSuchProviderException | [
"Get",
"the",
"trust",
"manager",
"factory",
"instance",
"using",
"the",
"provided",
"information",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/provider/AbstractJSSEProvider.java#L682-L697 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/provider/AbstractJSSEProvider.java | AbstractJSSEProvider.getKeyManagerFactoryInstance | public KeyManagerFactory getKeyManagerFactoryInstance(String keyMgr, String ctxtProvider) throws NoSuchAlgorithmException, NoSuchProviderException {
String mgr = keyMgr;
String provider = ctxtProvider;
if (mgr.indexOf('|') != -1) {
String[] keyManagerArray = mgr.split("\\|");
if (keyManagerArray != null && keyManagerArray.length == 2) {
mgr = keyManagerArray[0];
provider = keyManagerArray[1];
}
}
KeyManagerFactory rc = KeyManagerFactory.getInstance(mgr, provider);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "getKeyManagerFactory.getInstance(" + mgr + ", " + provider + ") " + rc);
return rc;
} | java | public KeyManagerFactory getKeyManagerFactoryInstance(String keyMgr, String ctxtProvider) throws NoSuchAlgorithmException, NoSuchProviderException {
String mgr = keyMgr;
String provider = ctxtProvider;
if (mgr.indexOf('|') != -1) {
String[] keyManagerArray = mgr.split("\\|");
if (keyManagerArray != null && keyManagerArray.length == 2) {
mgr = keyManagerArray[0];
provider = keyManagerArray[1];
}
}
KeyManagerFactory rc = KeyManagerFactory.getInstance(mgr, provider);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "getKeyManagerFactory.getInstance(" + mgr + ", " + provider + ") " + rc);
return rc;
} | [
"public",
"KeyManagerFactory",
"getKeyManagerFactoryInstance",
"(",
"String",
"keyMgr",
",",
"String",
"ctxtProvider",
")",
"throws",
"NoSuchAlgorithmException",
",",
"NoSuchProviderException",
"{",
"String",
"mgr",
"=",
"keyMgr",
";",
"String",
"provider",
"=",
"ctxtProvider",
";",
"if",
"(",
"mgr",
".",
"indexOf",
"(",
"'",
"'",
")",
"!=",
"-",
"1",
")",
"{",
"String",
"[",
"]",
"keyManagerArray",
"=",
"mgr",
".",
"split",
"(",
"\"\\\\|\"",
")",
";",
"if",
"(",
"keyManagerArray",
"!=",
"null",
"&&",
"keyManagerArray",
".",
"length",
"==",
"2",
")",
"{",
"mgr",
"=",
"keyManagerArray",
"[",
"0",
"]",
";",
"provider",
"=",
"keyManagerArray",
"[",
"1",
"]",
";",
"}",
"}",
"KeyManagerFactory",
"rc",
"=",
"KeyManagerFactory",
".",
"getInstance",
"(",
"mgr",
",",
"provider",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"getKeyManagerFactory.getInstance(\"",
"+",
"mgr",
"+",
"\", \"",
"+",
"provider",
"+",
"\") \"",
"+",
"rc",
")",
";",
"return",
"rc",
";",
"}"
] | Get the key manager factory instance using the provided information.
@see com.ibm.websphere.ssl.JSSEProvider#getKeyManagerFactoryInstance()
@param keyMgr
@param ctxtProvider
@return KeyManagerFactory
@throws NoSuchAlgorithmException
@throws NoSuchProviderException | [
"Get",
"the",
"key",
"manager",
"factory",
"instance",
"using",
"the",
"provided",
"information",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/provider/AbstractJSSEProvider.java#L717-L732 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/provider/AbstractJSSEProvider.java | AbstractJSSEProvider.getHandler | public URLStreamHandler getHandler() throws Exception {
String handlerString = getSSLProtocolPackageHandler() + ".https.Handler";
URLStreamHandler streamHandler = null;
try {
ClassLoader cl = AccessController.doPrivileged(getCtxClassLoader);
if (cl != null) {
streamHandler = (URLStreamHandler) cl.loadClass(handlerString).newInstance();
} else {
streamHandler = (URLStreamHandler) Class.forName(handlerString).newInstance();
}
return streamHandler;
} catch (Exception e) {
FFDCFilter.processException(e, getClass().getName(), "getHandler", this);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "Exception loading https stream handler.", new Object[] { e });
Tr.error(tc, "ssl.load.https.stream.handler.CWPKI0025E", new Object[] { handlerString, e.getMessage() });
throw e;
}
} | java | public URLStreamHandler getHandler() throws Exception {
String handlerString = getSSLProtocolPackageHandler() + ".https.Handler";
URLStreamHandler streamHandler = null;
try {
ClassLoader cl = AccessController.doPrivileged(getCtxClassLoader);
if (cl != null) {
streamHandler = (URLStreamHandler) cl.loadClass(handlerString).newInstance();
} else {
streamHandler = (URLStreamHandler) Class.forName(handlerString).newInstance();
}
return streamHandler;
} catch (Exception e) {
FFDCFilter.processException(e, getClass().getName(), "getHandler", this);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "Exception loading https stream handler.", new Object[] { e });
Tr.error(tc, "ssl.load.https.stream.handler.CWPKI0025E", new Object[] { handlerString, e.getMessage() });
throw e;
}
} | [
"public",
"URLStreamHandler",
"getHandler",
"(",
")",
"throws",
"Exception",
"{",
"String",
"handlerString",
"=",
"getSSLProtocolPackageHandler",
"(",
")",
"+",
"\".https.Handler\"",
";",
"URLStreamHandler",
"streamHandler",
"=",
"null",
";",
"try",
"{",
"ClassLoader",
"cl",
"=",
"AccessController",
".",
"doPrivileged",
"(",
"getCtxClassLoader",
")",
";",
"if",
"(",
"cl",
"!=",
"null",
")",
"{",
"streamHandler",
"=",
"(",
"URLStreamHandler",
")",
"cl",
".",
"loadClass",
"(",
"handlerString",
")",
".",
"newInstance",
"(",
")",
";",
"}",
"else",
"{",
"streamHandler",
"=",
"(",
"URLStreamHandler",
")",
"Class",
".",
"forName",
"(",
"handlerString",
")",
".",
"newInstance",
"(",
")",
";",
"}",
"return",
"streamHandler",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
",",
"\"getHandler\"",
",",
"this",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Exception loading https stream handler.\"",
",",
"new",
"Object",
"[",
"]",
"{",
"e",
"}",
")",
";",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"ssl.load.https.stream.handler.CWPKI0025E\"",
",",
"new",
"Object",
"[",
"]",
"{",
"handlerString",
",",
"e",
".",
"getMessage",
"(",
")",
"}",
")",
";",
"throw",
"e",
";",
"}",
"}"
] | Query the default handler for this provider using HTTPS.
@return URLStreamHandler
@throws Exception | [
"Query",
"the",
"default",
"handler",
"for",
"this",
"provider",
"using",
"HTTPS",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/provider/AbstractJSSEProvider.java#L784-L803 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/provider/AbstractJSSEProvider.java | AbstractJSSEProvider.loadCustomKeyManager | private X509KeyManager loadCustomKeyManager(String kmClass) throws Exception {
X509KeyManager km = null;
try {
ClassLoader cl = AccessController.doPrivileged(getCtxClassLoader);
if (cl != null) {
try {
km = (X509KeyManager) cl.loadClass(kmClass).newInstance();
} catch (Exception e) {
// no ffdc needed
}
}
if (km == null) {
km = (X509KeyManager) Class.forName(kmClass).newInstance();
}
return km;
} catch (Exception e) {
FFDCFilter.processException(e, getClass().getName(), "loadCustomKeyManager", this);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "Exception loading custom KeyManager.", new Object[] { e });
Tr.error(tc, "ssl.load.keymanager.error.CWPKI0021E", new Object[] { kmClass, e.getMessage() });
throw e;
}
} | java | private X509KeyManager loadCustomKeyManager(String kmClass) throws Exception {
X509KeyManager km = null;
try {
ClassLoader cl = AccessController.doPrivileged(getCtxClassLoader);
if (cl != null) {
try {
km = (X509KeyManager) cl.loadClass(kmClass).newInstance();
} catch (Exception e) {
// no ffdc needed
}
}
if (km == null) {
km = (X509KeyManager) Class.forName(kmClass).newInstance();
}
return km;
} catch (Exception e) {
FFDCFilter.processException(e, getClass().getName(), "loadCustomKeyManager", this);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "Exception loading custom KeyManager.", new Object[] { e });
Tr.error(tc, "ssl.load.keymanager.error.CWPKI0021E", new Object[] { kmClass, e.getMessage() });
throw e;
}
} | [
"private",
"X509KeyManager",
"loadCustomKeyManager",
"(",
"String",
"kmClass",
")",
"throws",
"Exception",
"{",
"X509KeyManager",
"km",
"=",
"null",
";",
"try",
"{",
"ClassLoader",
"cl",
"=",
"AccessController",
".",
"doPrivileged",
"(",
"getCtxClassLoader",
")",
";",
"if",
"(",
"cl",
"!=",
"null",
")",
"{",
"try",
"{",
"km",
"=",
"(",
"X509KeyManager",
")",
"cl",
".",
"loadClass",
"(",
"kmClass",
")",
".",
"newInstance",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"// no ffdc needed",
"}",
"}",
"if",
"(",
"km",
"==",
"null",
")",
"{",
"km",
"=",
"(",
"X509KeyManager",
")",
"Class",
".",
"forName",
"(",
"kmClass",
")",
".",
"newInstance",
"(",
")",
";",
"}",
"return",
"km",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
",",
"\"loadCustomKeyManager\"",
",",
"this",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Exception loading custom KeyManager.\"",
",",
"new",
"Object",
"[",
"]",
"{",
"e",
"}",
")",
";",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"ssl.load.keymanager.error.CWPKI0021E\"",
",",
"new",
"Object",
"[",
"]",
"{",
"kmClass",
",",
"e",
".",
"getMessage",
"(",
")",
"}",
")",
";",
"throw",
"e",
";",
"}",
"}"
] | this loads the KeyManager class, if present | [
"this",
"loads",
"the",
"KeyManager",
"class",
"if",
"present"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/provider/AbstractJSSEProvider.java#L845-L871 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/provider/AbstractJSSEProvider.java | AbstractJSSEProvider.clearSSLContextCache | public static void clearSSLContextCache() {
if (sslContextCacheJAVAX != null && sslContextCacheJAVAX.size() > 0) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "Clearing standard javax.net.ssl.SSLContext cache.");
sslContextCacheJAVAX.clear();
}
} | java | public static void clearSSLContextCache() {
if (sslContextCacheJAVAX != null && sslContextCacheJAVAX.size() > 0) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "Clearing standard javax.net.ssl.SSLContext cache.");
sslContextCacheJAVAX.clear();
}
} | [
"public",
"static",
"void",
"clearSSLContextCache",
"(",
")",
"{",
"if",
"(",
"sslContextCacheJAVAX",
"!=",
"null",
"&&",
"sslContextCacheJAVAX",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Clearing standard javax.net.ssl.SSLContext cache.\"",
")",
";",
"sslContextCacheJAVAX",
".",
"clear",
"(",
")",
";",
"}",
"}"
] | Clear the contents of the SSLContext cache. | [
"Clear",
"the",
"contents",
"of",
"the",
"SSLContext",
"cache",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/provider/AbstractJSSEProvider.java#L926-L932 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/provider/AbstractJSSEProvider.java | AbstractJSSEProvider.clearSSLContextCache | public static void clearSSLContextCache(Collection<File> modifiedFiles) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "Clearing standard javax.net.ssl.SSLContext cached object containing keystores: " + new Object[] { modifiedFiles });
for (File modifiedKeystoreFile : modifiedFiles) {
String filePath = null;
try {
filePath = modifiedKeystoreFile.getCanonicalPath();
} catch (IOException e) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "Exception comparing file path.");
continue;
}
removeEntryFromSSLContextMap(filePath);
}
} | java | public static void clearSSLContextCache(Collection<File> modifiedFiles) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "Clearing standard javax.net.ssl.SSLContext cached object containing keystores: " + new Object[] { modifiedFiles });
for (File modifiedKeystoreFile : modifiedFiles) {
String filePath = null;
try {
filePath = modifiedKeystoreFile.getCanonicalPath();
} catch (IOException e) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "Exception comparing file path.");
continue;
}
removeEntryFromSSLContextMap(filePath);
}
} | [
"public",
"static",
"void",
"clearSSLContextCache",
"(",
"Collection",
"<",
"File",
">",
"modifiedFiles",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Clearing standard javax.net.ssl.SSLContext cached object containing keystores: \"",
"+",
"new",
"Object",
"[",
"]",
"{",
"modifiedFiles",
"}",
")",
";",
"for",
"(",
"File",
"modifiedKeystoreFile",
":",
"modifiedFiles",
")",
"{",
"String",
"filePath",
"=",
"null",
";",
"try",
"{",
"filePath",
"=",
"modifiedKeystoreFile",
".",
"getCanonicalPath",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Exception comparing file path.\"",
")",
";",
"continue",
";",
"}",
"removeEntryFromSSLContextMap",
"(",
"filePath",
")",
";",
"}",
"}"
] | Clear the contents of the SSLContext cache if it uses the files passed in | [
"Clear",
"the",
"contents",
"of",
"the",
"SSLContext",
"cache",
"if",
"it",
"uses",
"the",
"files",
"passed",
"in"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/provider/AbstractJSSEProvider.java#L937-L951 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/provider/AbstractJSSEProvider.java | AbstractJSSEProvider.removeEntryFromSSLContextMap | public static void removeEntryFromSSLContextMap(String keyStorePath) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "removeEntryFromSSLContextMap: " + new Object[] { keyStorePath });
List<SSLConfig> removeList = new ArrayList<SSLConfig>();
for (Entry<SSLConfig, SSLContext> entry : sslContextCacheJAVAX.entrySet()) {
SSLConfig cachedConfig = entry.getKey();
if (cachedConfig != null) {
String ksPropValue = cachedConfig.getProperty(Constants.SSLPROP_KEY_STORE, null);
boolean ksFileBased = Boolean.parseBoolean(cachedConfig.getProperty(Constants.SSLPROP_KEY_STORE_FILE_BASED));
String tsPropValue = cachedConfig.getProperty(Constants.SSLPROP_TRUST_STORE, null);
boolean tsFileBased = Boolean.parseBoolean(cachedConfig.getProperty(Constants.SSLPROP_TRUST_STORE_FILE_BASED));
if ((ksPropValue != null && keyStorePath.equals(WSKeyStore.getCannonicalPath(ksPropValue, ksFileBased))) ||
(tsPropValue != null && keyStorePath.equals(WSKeyStore.getCannonicalPath(tsPropValue, tsFileBased)))) {
removeList.add(cachedConfig);
}
}
}
if (!removeList.isEmpty()) {
for (SSLConfig removeEntry : removeList) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "removing from sslContext cache: " + removeEntry.toString());
sslContextCacheJAVAX.remove(removeEntry);
}
}
} | java | public static void removeEntryFromSSLContextMap(String keyStorePath) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "removeEntryFromSSLContextMap: " + new Object[] { keyStorePath });
List<SSLConfig> removeList = new ArrayList<SSLConfig>();
for (Entry<SSLConfig, SSLContext> entry : sslContextCacheJAVAX.entrySet()) {
SSLConfig cachedConfig = entry.getKey();
if (cachedConfig != null) {
String ksPropValue = cachedConfig.getProperty(Constants.SSLPROP_KEY_STORE, null);
boolean ksFileBased = Boolean.parseBoolean(cachedConfig.getProperty(Constants.SSLPROP_KEY_STORE_FILE_BASED));
String tsPropValue = cachedConfig.getProperty(Constants.SSLPROP_TRUST_STORE, null);
boolean tsFileBased = Boolean.parseBoolean(cachedConfig.getProperty(Constants.SSLPROP_TRUST_STORE_FILE_BASED));
if ((ksPropValue != null && keyStorePath.equals(WSKeyStore.getCannonicalPath(ksPropValue, ksFileBased))) ||
(tsPropValue != null && keyStorePath.equals(WSKeyStore.getCannonicalPath(tsPropValue, tsFileBased)))) {
removeList.add(cachedConfig);
}
}
}
if (!removeList.isEmpty()) {
for (SSLConfig removeEntry : removeList) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "removing from sslContext cache: " + removeEntry.toString());
sslContextCacheJAVAX.remove(removeEntry);
}
}
} | [
"public",
"static",
"void",
"removeEntryFromSSLContextMap",
"(",
"String",
"keyStorePath",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"removeEntryFromSSLContextMap: \"",
"+",
"new",
"Object",
"[",
"]",
"{",
"keyStorePath",
"}",
")",
";",
"List",
"<",
"SSLConfig",
">",
"removeList",
"=",
"new",
"ArrayList",
"<",
"SSLConfig",
">",
"(",
")",
";",
"for",
"(",
"Entry",
"<",
"SSLConfig",
",",
"SSLContext",
">",
"entry",
":",
"sslContextCacheJAVAX",
".",
"entrySet",
"(",
")",
")",
"{",
"SSLConfig",
"cachedConfig",
"=",
"entry",
".",
"getKey",
"(",
")",
";",
"if",
"(",
"cachedConfig",
"!=",
"null",
")",
"{",
"String",
"ksPropValue",
"=",
"cachedConfig",
".",
"getProperty",
"(",
"Constants",
".",
"SSLPROP_KEY_STORE",
",",
"null",
")",
";",
"boolean",
"ksFileBased",
"=",
"Boolean",
".",
"parseBoolean",
"(",
"cachedConfig",
".",
"getProperty",
"(",
"Constants",
".",
"SSLPROP_KEY_STORE_FILE_BASED",
")",
")",
";",
"String",
"tsPropValue",
"=",
"cachedConfig",
".",
"getProperty",
"(",
"Constants",
".",
"SSLPROP_TRUST_STORE",
",",
"null",
")",
";",
"boolean",
"tsFileBased",
"=",
"Boolean",
".",
"parseBoolean",
"(",
"cachedConfig",
".",
"getProperty",
"(",
"Constants",
".",
"SSLPROP_TRUST_STORE_FILE_BASED",
")",
")",
";",
"if",
"(",
"(",
"ksPropValue",
"!=",
"null",
"&&",
"keyStorePath",
".",
"equals",
"(",
"WSKeyStore",
".",
"getCannonicalPath",
"(",
"ksPropValue",
",",
"ksFileBased",
")",
")",
")",
"||",
"(",
"tsPropValue",
"!=",
"null",
"&&",
"keyStorePath",
".",
"equals",
"(",
"WSKeyStore",
".",
"getCannonicalPath",
"(",
"tsPropValue",
",",
"tsFileBased",
")",
")",
")",
")",
"{",
"removeList",
".",
"add",
"(",
"cachedConfig",
")",
";",
"}",
"}",
"}",
"if",
"(",
"!",
"removeList",
".",
"isEmpty",
"(",
")",
")",
"{",
"for",
"(",
"SSLConfig",
"removeEntry",
":",
"removeList",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"removing from sslContext cache: \"",
"+",
"removeEntry",
".",
"toString",
"(",
")",
")",
";",
"sslContextCacheJAVAX",
".",
"remove",
"(",
"removeEntry",
")",
";",
"}",
"}",
"}"
] | Give a keyStoreFile location look for the SSLContexts that reference it as either a keystore or
truststore then remove those SSLContexts from the cache. | [
"Give",
"a",
"keyStoreFile",
"location",
"look",
"for",
"the",
"SSLContexts",
"that",
"reference",
"it",
"as",
"either",
"a",
"keystore",
"or",
"truststore",
"then",
"remove",
"those",
"SSLContexts",
"from",
"the",
"cache",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/provider/AbstractJSSEProvider.java#L957-L986 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/linkedlist/Cursor.java | Cursor.next | public synchronized Entry next()
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "next");
// can only do anything if the cursor is still pointing in to a list
checkEntryParent();
Entry nextEntry = null;
synchronized(parentList)
{
//get the next entry in the list
nextEntry = getNextEntry();
//if the next entry is null
if(nextEntry == null)
{
//then hopefully we're at the end of the list
if(current == parentList.last)
{
//so move the cursor to the bottom of the list,
//not pointing to any actual entry
moveToBottom();
}
else if(!atBottom)
{
//it should not be possible for the next entry to be null but the current
//not be the last one in the list or already at the bottom
SIErrorException e = new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0001",
new Object[] { "Cursor", "1:160:1.15" },
null));
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.utils.linkedlist.Cursor.next",
"1:166:1.15",
this);
SibTr.exception(tc, e);
if (tc.isEntryEnabled())
SibTr.exit(tc, "next", e);
throw e;
}
}
else
{
//move the cursor to the next entry
moveCursor(nextEntry);
}
}
if (tc.isEntryEnabled())
SibTr.exit(tc, "next", nextEntry);
return nextEntry;
} | java | public synchronized Entry next()
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "next");
// can only do anything if the cursor is still pointing in to a list
checkEntryParent();
Entry nextEntry = null;
synchronized(parentList)
{
//get the next entry in the list
nextEntry = getNextEntry();
//if the next entry is null
if(nextEntry == null)
{
//then hopefully we're at the end of the list
if(current == parentList.last)
{
//so move the cursor to the bottom of the list,
//not pointing to any actual entry
moveToBottom();
}
else if(!atBottom)
{
//it should not be possible for the next entry to be null but the current
//not be the last one in the list or already at the bottom
SIErrorException e = new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0001",
new Object[] { "Cursor", "1:160:1.15" },
null));
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.utils.linkedlist.Cursor.next",
"1:166:1.15",
this);
SibTr.exception(tc, e);
if (tc.isEntryEnabled())
SibTr.exit(tc, "next", e);
throw e;
}
}
else
{
//move the cursor to the next entry
moveCursor(nextEntry);
}
}
if (tc.isEntryEnabled())
SibTr.exit(tc, "next", nextEntry);
return nextEntry;
} | [
"public",
"synchronized",
"Entry",
"next",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"next\"",
")",
";",
"// can only do anything if the cursor is still pointing in to a list",
"checkEntryParent",
"(",
")",
";",
"Entry",
"nextEntry",
"=",
"null",
";",
"synchronized",
"(",
"parentList",
")",
"{",
"//get the next entry in the list",
"nextEntry",
"=",
"getNextEntry",
"(",
")",
";",
"//if the next entry is null",
"if",
"(",
"nextEntry",
"==",
"null",
")",
"{",
"//then hopefully we're at the end of the list",
"if",
"(",
"current",
"==",
"parentList",
".",
"last",
")",
"{",
"//so move the cursor to the bottom of the list,",
"//not pointing to any actual entry",
"moveToBottom",
"(",
")",
";",
"}",
"else",
"if",
"(",
"!",
"atBottom",
")",
"{",
"//it should not be possible for the next entry to be null but the current",
"//not be the last one in the list or already at the bottom",
"SIErrorException",
"e",
"=",
"new",
"SIErrorException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0001\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"Cursor\"",
",",
"\"1:160:1.15\"",
"}",
",",
"null",
")",
")",
";",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.utils.linkedlist.Cursor.next\"",
",",
"\"1:166:1.15\"",
",",
"this",
")",
";",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"next\"",
",",
"e",
")",
";",
"throw",
"e",
";",
"}",
"}",
"else",
"{",
"//move the cursor to the next entry",
"moveCursor",
"(",
"nextEntry",
")",
";",
"}",
"}",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"next\"",
",",
"nextEntry",
")",
";",
"return",
"nextEntry",
";",
"}"
] | Synchronized. Move the cursor down to the next entry
in the list and return it.
@return The next entry in the list, or null if there is no next entry. | [
"Synchronized",
".",
"Move",
"the",
"cursor",
"down",
"to",
"the",
"next",
"entry",
"in",
"the",
"list",
"and",
"return",
"it",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/linkedlist/Cursor.java#L106-L165 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/linkedlist/Cursor.java | Cursor.previous | public synchronized Entry previous()
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "previous");
// can only do anything if the cursor is still pointing in to a list
checkEntryParent();
Entry previousEntry = null;
synchronized(parentList)
{
//get the previous entry
previousEntry = getPreviousEntry();
//if it is null
if(previousEntry == null)
{
//then hopefully we are at the top of the list
if(current == parentList.first)
{
//so move the cursor to the top
moveToTop();
}
else if(!atTop)
{
//it should not be possible for the previous entry to be null but the current
//not be the first one in the list or already at the top
SIErrorException e = new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.utils.linkedlist.Cursor",
"1:228:1.15" },
null));
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.utils.linkedlist.Cursor.previous",
"1:234:1.15",
this);
SibTr.exception(tc, e);
if (tc.isEntryEnabled())
SibTr.exit(tc, "previous", e);
throw e;
}
}
else
{
//move the cursor to the previous entry
moveCursor(previousEntry);
}
}
if (tc.isEntryEnabled())
SibTr.exit(tc, "previous", previousEntry);
return previousEntry;
} | java | public synchronized Entry previous()
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "previous");
// can only do anything if the cursor is still pointing in to a list
checkEntryParent();
Entry previousEntry = null;
synchronized(parentList)
{
//get the previous entry
previousEntry = getPreviousEntry();
//if it is null
if(previousEntry == null)
{
//then hopefully we are at the top of the list
if(current == parentList.first)
{
//so move the cursor to the top
moveToTop();
}
else if(!atTop)
{
//it should not be possible for the previous entry to be null but the current
//not be the first one in the list or already at the top
SIErrorException e = new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.utils.linkedlist.Cursor",
"1:228:1.15" },
null));
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.utils.linkedlist.Cursor.previous",
"1:234:1.15",
this);
SibTr.exception(tc, e);
if (tc.isEntryEnabled())
SibTr.exit(tc, "previous", e);
throw e;
}
}
else
{
//move the cursor to the previous entry
moveCursor(previousEntry);
}
}
if (tc.isEntryEnabled())
SibTr.exit(tc, "previous", previousEntry);
return previousEntry;
} | [
"public",
"synchronized",
"Entry",
"previous",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"previous\"",
")",
";",
"// can only do anything if the cursor is still pointing in to a list",
"checkEntryParent",
"(",
")",
";",
"Entry",
"previousEntry",
"=",
"null",
";",
"synchronized",
"(",
"parentList",
")",
"{",
"//get the previous entry",
"previousEntry",
"=",
"getPreviousEntry",
"(",
")",
";",
"//if it is null",
"if",
"(",
"previousEntry",
"==",
"null",
")",
"{",
"//then hopefully we are at the top of the list",
"if",
"(",
"current",
"==",
"parentList",
".",
"first",
")",
"{",
"//so move the cursor to the top",
"moveToTop",
"(",
")",
";",
"}",
"else",
"if",
"(",
"!",
"atTop",
")",
"{",
"//it should not be possible for the previous entry to be null but the current",
"//not be the first one in the list or already at the top",
"SIErrorException",
"e",
"=",
"new",
"SIErrorException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.utils.linkedlist.Cursor\"",
",",
"\"1:228:1.15\"",
"}",
",",
"null",
")",
")",
";",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.utils.linkedlist.Cursor.previous\"",
",",
"\"1:234:1.15\"",
",",
"this",
")",
";",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"previous\"",
",",
"e",
")",
";",
"throw",
"e",
";",
"}",
"}",
"else",
"{",
"//move the cursor to the previous entry",
"moveCursor",
"(",
"previousEntry",
")",
";",
"}",
"}",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"previous\"",
",",
"previousEntry",
")",
";",
"return",
"previousEntry",
";",
"}"
] | Synchronized. Move the cursor up to the previous entry
in the list and return it.
@return The previous entry in the list, or null if there is no previous entry. | [
"Synchronized",
".",
"Move",
"the",
"cursor",
"up",
"to",
"the",
"previous",
"entry",
"in",
"the",
"list",
"and",
"return",
"it",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/linkedlist/Cursor.java#L173-L233 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/linkedlist/Cursor.java | Cursor.current | public synchronized Entry current()
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "current");
checkEntryParent();
if (tc.isEntryEnabled())
SibTr.exit(tc, "current", current);
return current;
} | java | public synchronized Entry current()
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "current");
checkEntryParent();
if (tc.isEntryEnabled())
SibTr.exit(tc, "current", current);
return current;
} | [
"public",
"synchronized",
"Entry",
"current",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"current\"",
")",
";",
"checkEntryParent",
"(",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"current\"",
",",
"current",
")",
";",
"return",
"current",
";",
"}"
] | Synchronized. Get the entry currently pointed to by this cursor.
@return the entry currently pointed to by this cursor | [
"Synchronized",
".",
"Get",
"the",
"entry",
"currently",
"pointed",
"to",
"by",
"this",
"cursor",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/linkedlist/Cursor.java#L311-L322 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/linkedlist/Cursor.java | Cursor.moveToTop | public synchronized void moveToTop()
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "moveToTop");
checkEntryParent();
//record the reference to the parent list because the call to forceRemove
//will nullify it.
LinkedList list = parentList;
synchronized(list)
{
//remove the cursor from it's current postion
forceRemove();
//reset the parent list reference
parentList = list;
//mark this cursor as being at the top
atTop = true;
//link this cursor to the first cursor in the list's list of cursors
//which are currently at the top
next = list.firstTopCursor;
//link the old first cursor to this one
if(next != null) next.previous = this;
//mark this one as the first cursor in the list
list.firstTopCursor = this;
}
if (tc.isEntryEnabled())
SibTr.exit(tc, "moveToTop");
} | java | public synchronized void moveToTop()
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "moveToTop");
checkEntryParent();
//record the reference to the parent list because the call to forceRemove
//will nullify it.
LinkedList list = parentList;
synchronized(list)
{
//remove the cursor from it's current postion
forceRemove();
//reset the parent list reference
parentList = list;
//mark this cursor as being at the top
atTop = true;
//link this cursor to the first cursor in the list's list of cursors
//which are currently at the top
next = list.firstTopCursor;
//link the old first cursor to this one
if(next != null) next.previous = this;
//mark this one as the first cursor in the list
list.firstTopCursor = this;
}
if (tc.isEntryEnabled())
SibTr.exit(tc, "moveToTop");
} | [
"public",
"synchronized",
"void",
"moveToTop",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"moveToTop\"",
")",
";",
"checkEntryParent",
"(",
")",
";",
"//record the reference to the parent list because the call to forceRemove",
"//will nullify it.",
"LinkedList",
"list",
"=",
"parentList",
";",
"synchronized",
"(",
"list",
")",
"{",
"//remove the cursor from it's current postion",
"forceRemove",
"(",
")",
";",
"//reset the parent list reference",
"parentList",
"=",
"list",
";",
"//mark this cursor as being at the top",
"atTop",
"=",
"true",
";",
"//link this cursor to the first cursor in the list's list of cursors",
"//which are currently at the top",
"next",
"=",
"list",
".",
"firstTopCursor",
";",
"//link the old first cursor to this one ",
"if",
"(",
"next",
"!=",
"null",
")",
"next",
".",
"previous",
"=",
"this",
";",
"//mark this one as the first cursor in the list",
"list",
".",
"firstTopCursor",
"=",
"this",
";",
"}",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"moveToTop\"",
")",
";",
"}"
] | Synchronized. Move the cursor to the top of the list. | [
"Synchronized",
".",
"Move",
"the",
"cursor",
"to",
"the",
"top",
"of",
"the",
"list",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/linkedlist/Cursor.java#L327-L357 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/linkedlist/Cursor.java | Cursor.moveToBottom | public synchronized void moveToBottom()
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "moveToBottom");
checkEntryParent();
//record the parent list
LinkedList list = parentList;
synchronized(list)
{
//remove the cursor from it current position
forceRemove();
//reset the parent list
parentList = list;
//mark it as at the bottom
atBottom = true;
//insert it in front of the old first bottom cursor
next = list.firstBottomCursor;
if(next != null) next.previous = this;
//mark this on as the first bottom cursor
list.firstBottomCursor = this;
}
if (tc.isEntryEnabled())
SibTr.exit(tc, "moveToBottom");
} | java | public synchronized void moveToBottom()
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "moveToBottom");
checkEntryParent();
//record the parent list
LinkedList list = parentList;
synchronized(list)
{
//remove the cursor from it current position
forceRemove();
//reset the parent list
parentList = list;
//mark it as at the bottom
atBottom = true;
//insert it in front of the old first bottom cursor
next = list.firstBottomCursor;
if(next != null) next.previous = this;
//mark this on as the first bottom cursor
list.firstBottomCursor = this;
}
if (tc.isEntryEnabled())
SibTr.exit(tc, "moveToBottom");
} | [
"public",
"synchronized",
"void",
"moveToBottom",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"moveToBottom\"",
")",
";",
"checkEntryParent",
"(",
")",
";",
"//record the parent list",
"LinkedList",
"list",
"=",
"parentList",
";",
"synchronized",
"(",
"list",
")",
"{",
"//remove the cursor from it current position",
"forceRemove",
"(",
")",
";",
"//reset the parent list",
"parentList",
"=",
"list",
";",
"//mark it as at the bottom",
"atBottom",
"=",
"true",
";",
"//insert it in front of the old first bottom cursor",
"next",
"=",
"list",
".",
"firstBottomCursor",
";",
"if",
"(",
"next",
"!=",
"null",
")",
"next",
".",
"previous",
"=",
"this",
";",
"//mark this on as the first bottom cursor",
"list",
".",
"firstBottomCursor",
"=",
"this",
";",
"}",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"moveToBottom\"",
")",
";",
"}"
] | Synchronized. Move the cursor to the bottom of the list. | [
"Synchronized",
".",
"Move",
"the",
"cursor",
"to",
"the",
"bottom",
"of",
"the",
"list",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/linkedlist/Cursor.java#L362-L389 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/linkedlist/Cursor.java | Cursor.moveCursor | public synchronized void moveCursor(Entry newEntry)
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "moveCursor", new Object[] { newEntry });
checkEntryParent();
//if the entry is the same as the current one
//then we don't need to bother doing anything
if(newEntry != current)
{
//make sure we can find the new entry in this list
if(newEntry != null && newEntry.parentList == parentList)
{
LinkedList list = parentList;
synchronized(list)
{
//remove the cursor from it's current postion
forceRemove();
//insert this cursor before the first on for the new entry
next = newEntry.firstCursor;
if(next != null) next.previous = this;
newEntry.firstCursor = this;
previous = null;
parentList = list;
current = newEntry;
}
}
else //if the new entry is not in this list, throw a runtime exception
{
SIErrorException e = new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.utils.linkedlist.Cursor",
"1:457:1.15" },
null));
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.utils.linkedlist.Cursor.moveCursor",
"1:463:1.15",
this);
SibTr.exception(tc, e);
if (tc.isEntryEnabled())
SibTr.exit(tc, "moveCursor", e);
throw e;
}
}
if (tc.isEntryEnabled())
SibTr.exit(tc, "moveCursor");
} | java | public synchronized void moveCursor(Entry newEntry)
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "moveCursor", new Object[] { newEntry });
checkEntryParent();
//if the entry is the same as the current one
//then we don't need to bother doing anything
if(newEntry != current)
{
//make sure we can find the new entry in this list
if(newEntry != null && newEntry.parentList == parentList)
{
LinkedList list = parentList;
synchronized(list)
{
//remove the cursor from it's current postion
forceRemove();
//insert this cursor before the first on for the new entry
next = newEntry.firstCursor;
if(next != null) next.previous = this;
newEntry.firstCursor = this;
previous = null;
parentList = list;
current = newEntry;
}
}
else //if the new entry is not in this list, throw a runtime exception
{
SIErrorException e = new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.utils.linkedlist.Cursor",
"1:457:1.15" },
null));
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.utils.linkedlist.Cursor.moveCursor",
"1:463:1.15",
this);
SibTr.exception(tc, e);
if (tc.isEntryEnabled())
SibTr.exit(tc, "moveCursor", e);
throw e;
}
}
if (tc.isEntryEnabled())
SibTr.exit(tc, "moveCursor");
} | [
"public",
"synchronized",
"void",
"moveCursor",
"(",
"Entry",
"newEntry",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"moveCursor\"",
",",
"new",
"Object",
"[",
"]",
"{",
"newEntry",
"}",
")",
";",
"checkEntryParent",
"(",
")",
";",
"//if the entry is the same as the current one",
"//then we don't need to bother doing anything",
"if",
"(",
"newEntry",
"!=",
"current",
")",
"{",
"//make sure we can find the new entry in this list",
"if",
"(",
"newEntry",
"!=",
"null",
"&&",
"newEntry",
".",
"parentList",
"==",
"parentList",
")",
"{",
"LinkedList",
"list",
"=",
"parentList",
";",
"synchronized",
"(",
"list",
")",
"{",
"//remove the cursor from it's current postion",
"forceRemove",
"(",
")",
";",
"//insert this cursor before the first on for the new entry",
"next",
"=",
"newEntry",
".",
"firstCursor",
";",
"if",
"(",
"next",
"!=",
"null",
")",
"next",
".",
"previous",
"=",
"this",
";",
"newEntry",
".",
"firstCursor",
"=",
"this",
";",
"previous",
"=",
"null",
";",
"parentList",
"=",
"list",
";",
"current",
"=",
"newEntry",
";",
"}",
"}",
"else",
"//if the new entry is not in this list, throw a runtime exception",
"{",
"SIErrorException",
"e",
"=",
"new",
"SIErrorException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.utils.linkedlist.Cursor\"",
",",
"\"1:457:1.15\"",
"}",
",",
"null",
")",
")",
";",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.utils.linkedlist.Cursor.moveCursor\"",
",",
"\"1:463:1.15\"",
",",
"this",
")",
";",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"moveCursor\"",
",",
"e",
")",
";",
"throw",
"e",
";",
"}",
"}",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"moveCursor\"",
")",
";",
"}"
] | Synchronized. Move this cursor to point at a different entry in the
same list.
@param newEntry | [
"Synchronized",
".",
"Move",
"this",
"cursor",
"to",
"point",
"at",
"a",
"different",
"entry",
"in",
"the",
"same",
"list",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/linkedlist/Cursor.java#L397-L454 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/linkedlist/Cursor.java | Cursor.moveCursor | public synchronized void moveCursor(Cursor cursor)
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "moveCursor", new Object[] { cursor });
checkEntryParent();
synchronized(parentList)
{
//make sure that the cursor is pointing to an entry in the same list
if(cursor != null && cursor.parentList == parentList)
{
//if we are already pointing to the same entry, we may not have to
//do anything
if(cursor.current != current)
{
if(cursor.atTop)
{
//if the new cursor is at the top, move this one to the top
moveToTop();
}
else if(cursor.atBottom)
{
//if the new cursor is at the bottom, move this one to the bottom
moveToBottom();
}
else
{
//otherwise just move this cursor to point to the same entry as the
//one pointed to by the given cursor
moveCursor(cursor.current);
}
}
else //it is possible that the current entries are both null if they are both
{ //at the top or bottom on the list
if(cursor.current == null)
{
if(cursor.atTop && atBottom)
{
//if the given cursor is at the top but we are at the bottom, move to the top
moveToTop();
}
else if(cursor.atBottom && atTop)
{
//if the given cursor is at the bottom but we are at the top, move to the bottom
moveToBottom();
}
}
}
}
else //if the new entry is not in this list, throw a runtime exception
{
SIErrorException e = new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.utils.linkedlist.Cursor",
"1:541:1.15" },
null));
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.utils.linkedlist.Cursor.moveCursor",
"1:547:1.15",
this);
SibTr.exception(tc, e);
if (tc.isEntryEnabled())
SibTr.exit(tc, "moveCursor", e);
throw e;
}
}
if (tc.isEntryEnabled())
SibTr.exit(tc, "moveCursor");
} | java | public synchronized void moveCursor(Cursor cursor)
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "moveCursor", new Object[] { cursor });
checkEntryParent();
synchronized(parentList)
{
//make sure that the cursor is pointing to an entry in the same list
if(cursor != null && cursor.parentList == parentList)
{
//if we are already pointing to the same entry, we may not have to
//do anything
if(cursor.current != current)
{
if(cursor.atTop)
{
//if the new cursor is at the top, move this one to the top
moveToTop();
}
else if(cursor.atBottom)
{
//if the new cursor is at the bottom, move this one to the bottom
moveToBottom();
}
else
{
//otherwise just move this cursor to point to the same entry as the
//one pointed to by the given cursor
moveCursor(cursor.current);
}
}
else //it is possible that the current entries are both null if they are both
{ //at the top or bottom on the list
if(cursor.current == null)
{
if(cursor.atTop && atBottom)
{
//if the given cursor is at the top but we are at the bottom, move to the top
moveToTop();
}
else if(cursor.atBottom && atTop)
{
//if the given cursor is at the bottom but we are at the top, move to the bottom
moveToBottom();
}
}
}
}
else //if the new entry is not in this list, throw a runtime exception
{
SIErrorException e = new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.utils.linkedlist.Cursor",
"1:541:1.15" },
null));
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.utils.linkedlist.Cursor.moveCursor",
"1:547:1.15",
this);
SibTr.exception(tc, e);
if (tc.isEntryEnabled())
SibTr.exit(tc, "moveCursor", e);
throw e;
}
}
if (tc.isEntryEnabled())
SibTr.exit(tc, "moveCursor");
} | [
"public",
"synchronized",
"void",
"moveCursor",
"(",
"Cursor",
"cursor",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"moveCursor\"",
",",
"new",
"Object",
"[",
"]",
"{",
"cursor",
"}",
")",
";",
"checkEntryParent",
"(",
")",
";",
"synchronized",
"(",
"parentList",
")",
"{",
"//make sure that the cursor is pointing to an entry in the same list",
"if",
"(",
"cursor",
"!=",
"null",
"&&",
"cursor",
".",
"parentList",
"==",
"parentList",
")",
"{",
"//if we are already pointing to the same entry, we may not have to",
"//do anything",
"if",
"(",
"cursor",
".",
"current",
"!=",
"current",
")",
"{",
"if",
"(",
"cursor",
".",
"atTop",
")",
"{",
"//if the new cursor is at the top, move this one to the top",
"moveToTop",
"(",
")",
";",
"}",
"else",
"if",
"(",
"cursor",
".",
"atBottom",
")",
"{",
"//if the new cursor is at the bottom, move this one to the bottom",
"moveToBottom",
"(",
")",
";",
"}",
"else",
"{",
"//otherwise just move this cursor to point to the same entry as the",
"//one pointed to by the given cursor",
"moveCursor",
"(",
"cursor",
".",
"current",
")",
";",
"}",
"}",
"else",
"//it is possible that the current entries are both null if they are both",
"{",
"//at the top or bottom on the list",
"if",
"(",
"cursor",
".",
"current",
"==",
"null",
")",
"{",
"if",
"(",
"cursor",
".",
"atTop",
"&&",
"atBottom",
")",
"{",
"//if the given cursor is at the top but we are at the bottom, move to the top",
"moveToTop",
"(",
")",
";",
"}",
"else",
"if",
"(",
"cursor",
".",
"atBottom",
"&&",
"atTop",
")",
"{",
"//if the given cursor is at the bottom but we are at the top, move to the bottom",
"moveToBottom",
"(",
")",
";",
"}",
"}",
"}",
"}",
"else",
"//if the new entry is not in this list, throw a runtime exception",
"{",
"SIErrorException",
"e",
"=",
"new",
"SIErrorException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.utils.linkedlist.Cursor\"",
",",
"\"1:541:1.15\"",
"}",
",",
"null",
")",
")",
";",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.utils.linkedlist.Cursor.moveCursor\"",
",",
"\"1:547:1.15\"",
",",
"this",
")",
";",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"moveCursor\"",
",",
"e",
")",
";",
"throw",
"e",
";",
"}",
"}",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"moveCursor\"",
")",
";",
"}"
] | Synchronized. Move this cursor to point at the same one as a given cursor.
@param cursor | [
"Synchronized",
".",
"Move",
"this",
"cursor",
"to",
"point",
"at",
"the",
"same",
"one",
"as",
"a",
"given",
"cursor",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/linkedlist/Cursor.java#L461-L538 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/linkedlist/Cursor.java | Cursor.forceRemove | Entry forceRemove()
{
Entry removedEntry = null;
checkEntryParent();
if(atTop)
{
//if we are at the top of the list and we are the first top cursor
if(parentList.firstTopCursor == this)
{
//set the first top cursor to be the next one in the list
parentList.firstTopCursor = (Cursor) next;
}
//mark us as not at the top
atTop = false;
}
else if(atBottom)
{
//if we are at the bottom of the list and we are the first bottom cursor
if(parentList.firstBottomCursor == this)
{
//set the first bottom cursor to be the next one in the list
parentList.firstBottomCursor = (Cursor) next;
}
//mark us as not at the bottom
atBottom = false;
}
else
{
//if we are pointing to an actual entry in the list
if(current.firstCursor == this)
{
//and we are the first cursor on that entry
//set the first cursor to be the next one in the list
current.firstCursor = (Cursor) next;
}
//set the current entry to null
current = null;
}
//actually remove this cursor from the list
removedEntry = super.forceRemove();
return removedEntry;
} | java | Entry forceRemove()
{
Entry removedEntry = null;
checkEntryParent();
if(atTop)
{
//if we are at the top of the list and we are the first top cursor
if(parentList.firstTopCursor == this)
{
//set the first top cursor to be the next one in the list
parentList.firstTopCursor = (Cursor) next;
}
//mark us as not at the top
atTop = false;
}
else if(atBottom)
{
//if we are at the bottom of the list and we are the first bottom cursor
if(parentList.firstBottomCursor == this)
{
//set the first bottom cursor to be the next one in the list
parentList.firstBottomCursor = (Cursor) next;
}
//mark us as not at the bottom
atBottom = false;
}
else
{
//if we are pointing to an actual entry in the list
if(current.firstCursor == this)
{
//and we are the first cursor on that entry
//set the first cursor to be the next one in the list
current.firstCursor = (Cursor) next;
}
//set the current entry to null
current = null;
}
//actually remove this cursor from the list
removedEntry = super.forceRemove();
return removedEntry;
} | [
"Entry",
"forceRemove",
"(",
")",
"{",
"Entry",
"removedEntry",
"=",
"null",
";",
"checkEntryParent",
"(",
")",
";",
"if",
"(",
"atTop",
")",
"{",
"//if we are at the top of the list and we are the first top cursor",
"if",
"(",
"parentList",
".",
"firstTopCursor",
"==",
"this",
")",
"{",
"//set the first top cursor to be the next one in the list",
"parentList",
".",
"firstTopCursor",
"=",
"(",
"Cursor",
")",
"next",
";",
"}",
"//mark us as not at the top",
"atTop",
"=",
"false",
";",
"}",
"else",
"if",
"(",
"atBottom",
")",
"{",
"//if we are at the bottom of the list and we are the first bottom cursor",
"if",
"(",
"parentList",
".",
"firstBottomCursor",
"==",
"this",
")",
"{",
"//set the first bottom cursor to be the next one in the list",
"parentList",
".",
"firstBottomCursor",
"=",
"(",
"Cursor",
")",
"next",
";",
"}",
"//mark us as not at the bottom",
"atBottom",
"=",
"false",
";",
"}",
"else",
"{",
"//if we are pointing to an actual entry in the list",
"if",
"(",
"current",
".",
"firstCursor",
"==",
"this",
")",
"{",
"//and we are the first cursor on that entry",
"//set the first cursor to be the next one in the list",
"current",
".",
"firstCursor",
"=",
"(",
"Cursor",
")",
"next",
";",
"}",
"//set the current entry to null",
"current",
"=",
"null",
";",
"}",
"//actually remove this cursor from the list",
"removedEntry",
"=",
"super",
".",
"forceRemove",
"(",
")",
";",
"return",
"removedEntry",
";",
"}"
] | Not Synchronized.
Removes a cursor from the list. It is the responsibility of the caller
to ensure that the list AND the cursor are properly synchronized before this method
is called. | [
"Not",
"Synchronized",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/linkedlist/Cursor.java#L547-L591 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/linkedlist/Cursor.java | Cursor.finished | public synchronized void finished()
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "finished");
checkEntryParent();
synchronized(parentList)
{
//remove the cursor from the list
//this will set the parent list reference to null and make the
//cursor seubsequently unusable
forceRemove();
}
if (tc.isEntryEnabled())
SibTr.exit(tc, "finished");
} | java | public synchronized void finished()
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "finished");
checkEntryParent();
synchronized(parentList)
{
//remove the cursor from the list
//this will set the parent list reference to null and make the
//cursor seubsequently unusable
forceRemove();
}
if (tc.isEntryEnabled())
SibTr.exit(tc, "finished");
} | [
"public",
"synchronized",
"void",
"finished",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"finished\"",
")",
";",
"checkEntryParent",
"(",
")",
";",
"synchronized",
"(",
"parentList",
")",
"{",
"//remove the cursor from the list",
"//this will set the parent list reference to null and make the",
"//cursor seubsequently unusable",
"forceRemove",
"(",
")",
";",
"}",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"finished\"",
")",
";",
"}"
] | Synchronized. Indicate that this cursor is finished with. This call will
remove this cursor from the list and make it subsequently unusable. | [
"Synchronized",
".",
"Indicate",
"that",
"this",
"cursor",
"is",
"finished",
"with",
".",
"This",
"call",
"will",
"remove",
"this",
"cursor",
"from",
"the",
"list",
"and",
"make",
"it",
"subsequently",
"unusable",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/utils/linkedlist/Cursor.java#L597-L614 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java | MessageItem.getMessageIfAvailable | @Override
public JsMessage getMessageIfAvailable()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getMessageIfAvailable");
//If message is not available in the message store do not throw exception
boolean throwExceptionIfNotAvailable = false;
JsMessage localMsg = getJSMessage(throwExceptionIfNotAvailable);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getMessageIfAvailable", localMsg);
return localMsg;
} | java | @Override
public JsMessage getMessageIfAvailable()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getMessageIfAvailable");
//If message is not available in the message store do not throw exception
boolean throwExceptionIfNotAvailable = false;
JsMessage localMsg = getJSMessage(throwExceptionIfNotAvailable);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getMessageIfAvailable", localMsg);
return localMsg;
} | [
"@",
"Override",
"public",
"JsMessage",
"getMessageIfAvailable",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"getMessageIfAvailable\"",
")",
";",
"//If message is not available in the message store do not throw exception",
"boolean",
"throwExceptionIfNotAvailable",
"=",
"false",
";",
"JsMessage",
"localMsg",
"=",
"getJSMessage",
"(",
"throwExceptionIfNotAvailable",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"getMessageIfAvailable\"",
",",
"localMsg",
")",
";",
"return",
"localMsg",
";",
"}"
] | Get the underlying message object,only if the message is
available in the message store
@return The underlying message object | [
"Get",
"the",
"underlying",
"message",
"object",
"only",
"if",
"the",
"message",
"is",
"available",
"in",
"the",
"message",
"store"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java#L408-L422 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java | MessageItem.getInMemoryDataSize | @Override
public int getInMemoryDataSize()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getInMemoryDataSize");
JsMessage localMsg = getJSMessage(true);
int msgSize = localMsg.getInMemorySize();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getInMemoryDataSize", Integer.valueOf(msgSize));
return msgSize;
} | java | @Override
public int getInMemoryDataSize()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getInMemoryDataSize");
JsMessage localMsg = getJSMessage(true);
int msgSize = localMsg.getInMemorySize();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getInMemoryDataSize", Integer.valueOf(msgSize));
return msgSize;
} | [
"@",
"Override",
"public",
"int",
"getInMemoryDataSize",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"getInMemoryDataSize\"",
")",
";",
"JsMessage",
"localMsg",
"=",
"getJSMessage",
"(",
"true",
")",
";",
"int",
"msgSize",
"=",
"localMsg",
".",
"getInMemorySize",
"(",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"getInMemoryDataSize\"",
",",
"Integer",
".",
"valueOf",
"(",
"msgSize",
")",
")",
";",
"return",
"msgSize",
";",
"}"
] | Returns an estimated in memory size for the Message that we have. | [
"Returns",
"an",
"estimated",
"in",
"memory",
"size",
"for",
"the",
"Message",
"that",
"we",
"have",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java#L823-L836 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java | MessageItem.getReliability | @Override
public Reliability getReliability()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getReliability");
if (msgReliability == null)
{
JsMessage localMsg = getJSMessage(true);
msgReliability = localMsg.getReliability();
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getReliability", msgReliability);
return msgReliability;
} | java | @Override
public Reliability getReliability()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getReliability");
if (msgReliability == null)
{
JsMessage localMsg = getJSMessage(true);
msgReliability = localMsg.getReliability();
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getReliability", msgReliability);
return msgReliability;
} | [
"@",
"Override",
"public",
"Reliability",
"getReliability",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"getReliability\"",
")",
";",
"if",
"(",
"msgReliability",
"==",
"null",
")",
"{",
"JsMessage",
"localMsg",
"=",
"getJSMessage",
"(",
"true",
")",
";",
"msgReliability",
"=",
"localMsg",
".",
"getReliability",
"(",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"getReliability\"",
",",
"msgReliability",
")",
";",
"return",
"msgReliability",
";",
"}"
] | Get the message's Reliability
@return the message's Reliability | [
"Get",
"the",
"message",
"s",
"Reliability"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java#L843-L859 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java | MessageItem.setReliability | public void setReliability(Reliability reliability)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setReliability", reliability);
JsMessage localMsg = getJSMessage(true);
msgReliability = reliability;
localMsg.setReliability(msgReliability);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setReliability");
} | java | public void setReliability(Reliability reliability)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setReliability", reliability);
JsMessage localMsg = getJSMessage(true);
msgReliability = reliability;
localMsg.setReliability(msgReliability);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setReliability");
} | [
"public",
"void",
"setReliability",
"(",
"Reliability",
"reliability",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"setReliability\"",
",",
"reliability",
")",
";",
"JsMessage",
"localMsg",
"=",
"getJSMessage",
"(",
"true",
")",
";",
"msgReliability",
"=",
"reliability",
";",
"localMsg",
".",
"setReliability",
"(",
"msgReliability",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"setReliability\"",
")",
";",
"}"
] | Sets both the cached version of the reliability and the
reliability in the underlying message.
Called by the AbstractInputHandler to update the message
reliability to that of the destination.
@param reliability | [
"Sets",
"both",
"the",
"cached",
"version",
"of",
"the",
"reliability",
"and",
"the",
"reliability",
"in",
"the",
"underlying",
"message",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java#L870-L880 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java | MessageItem.getMaximumTimeInStore | @Override
public long getMaximumTimeInStore()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getMaximumTimeInStore");
JsMessage localMsg = getJSMessage(true);
long timeToLive = localMsg.getTimeToLive().longValue();
long maxTime = NEVER_EXPIRES; // 180921
if (timeToLive > 0)
{
maxTime = timeToLive - getAggregateWaitTime();
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getMaximumTimeInStore", Long.valueOf(maxTime));
return maxTime;
} | java | @Override
public long getMaximumTimeInStore()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "getMaximumTimeInStore");
JsMessage localMsg = getJSMessage(true);
long timeToLive = localMsg.getTimeToLive().longValue();
long maxTime = NEVER_EXPIRES; // 180921
if (timeToLive > 0)
{
maxTime = timeToLive - getAggregateWaitTime();
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "getMaximumTimeInStore", Long.valueOf(maxTime));
return maxTime;
} | [
"@",
"Override",
"public",
"long",
"getMaximumTimeInStore",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"getMaximumTimeInStore\"",
")",
";",
"JsMessage",
"localMsg",
"=",
"getJSMessage",
"(",
"true",
")",
";",
"long",
"timeToLive",
"=",
"localMsg",
".",
"getTimeToLive",
"(",
")",
".",
"longValue",
"(",
")",
";",
"long",
"maxTime",
"=",
"NEVER_EXPIRES",
";",
"// 180921",
"if",
"(",
"timeToLive",
">",
"0",
")",
"{",
"maxTime",
"=",
"timeToLive",
"-",
"getAggregateWaitTime",
"(",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"getMaximumTimeInStore\"",
",",
"Long",
".",
"valueOf",
"(",
"maxTime",
")",
")",
";",
"return",
"maxTime",
";",
"}"
] | Return the maximum time this message should spend in the ItemStream.
If the message has no time to live then this should be the message store's
decision. Otherwise we use the time to live less the time the message
has already spend in the ME.
This method first appeared in feature 166831.1 | [
"Return",
"the",
"maximum",
"time",
"this",
"message",
"should",
"spend",
"in",
"the",
"ItemStream",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java#L907-L926 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java | MessageItem.getProducerConnectionUuid | @Override
public SIBUuid12 getProducerConnectionUuid()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(this, tc, "getProducerConnectionUuid");
}
if (producerConnectionUuid == null)
{
JsMessage localMsg = getJSMessage(true);
producerConnectionUuid = localMsg.getConnectionUuid();
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.exit(this, tc, "getProducerConnectionUuid", producerConnectionUuid);
}
return producerConnectionUuid;
} | java | @Override
public SIBUuid12 getProducerConnectionUuid()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(this, tc, "getProducerConnectionUuid");
}
if (producerConnectionUuid == null)
{
JsMessage localMsg = getJSMessage(true);
producerConnectionUuid = localMsg.getConnectionUuid();
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.exit(this, tc, "getProducerConnectionUuid", producerConnectionUuid);
}
return producerConnectionUuid;
} | [
"@",
"Override",
"public",
"SIBUuid12",
"getProducerConnectionUuid",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"getProducerConnectionUuid\"",
")",
";",
"}",
"if",
"(",
"producerConnectionUuid",
"==",
"null",
")",
"{",
"JsMessage",
"localMsg",
"=",
"getJSMessage",
"(",
"true",
")",
";",
"producerConnectionUuid",
"=",
"localMsg",
".",
"getConnectionUuid",
"(",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"getProducerConnectionUuid\"",
",",
"producerConnectionUuid",
")",
";",
"}",
"return",
"producerConnectionUuid",
";",
"}"
] | Returns the producerConnectionUuid.
Please note, this value may be null in the case of a p2p
message.
@return SIBUuid12 | [
"Returns",
"the",
"producerConnectionUuid",
".",
"Please",
"note",
"this",
"value",
"may",
"be",
"null",
"in",
"the",
"case",
"of",
"a",
"p2p",
"message",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java#L1641-L1661 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java | MessageItem.setProducerConnectionUuid | public void setProducerConnectionUuid(SIBUuid12 producerConnectionUuid)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setProducerConnectionUuid", producerConnectionUuid);
this.producerConnectionUuid = producerConnectionUuid;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setProducerConnectionUuid");
} | java | public void setProducerConnectionUuid(SIBUuid12 producerConnectionUuid)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setProducerConnectionUuid", producerConnectionUuid);
this.producerConnectionUuid = producerConnectionUuid;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setProducerConnectionUuid");
} | [
"public",
"void",
"setProducerConnectionUuid",
"(",
"SIBUuid12",
"producerConnectionUuid",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"setProducerConnectionUuid\"",
",",
"producerConnectionUuid",
")",
";",
"this",
".",
"producerConnectionUuid",
"=",
"producerConnectionUuid",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"setProducerConnectionUuid\"",
")",
";",
"}"
] | Sets the producerConnectionUuid.
@param producerConnectionUuid The producerConnectionUuid to set | [
"Sets",
"the",
"producerConnectionUuid",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java#L1668-L1677 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java | MessageItem.isTransacted | @Override
public boolean isTransacted()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(this, tc, "isTransacted");
SibTr.exit(this, tc, "isTransacted", Boolean.valueOf(transacted));
}
return transacted;
} | java | @Override
public boolean isTransacted()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(this, tc, "isTransacted");
SibTr.exit(this, tc, "isTransacted", Boolean.valueOf(transacted));
}
return transacted;
} | [
"@",
"Override",
"public",
"boolean",
"isTransacted",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"isTransacted\"",
")",
";",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"isTransacted\"",
",",
"Boolean",
".",
"valueOf",
"(",
"transacted",
")",
")",
";",
"}",
"return",
"transacted",
";",
"}"
] | Was this message put transactionally
@return true if this message was put transactionally | [
"Was",
"this",
"message",
"put",
"transactionally"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java#L1783-L1792 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java | MessageItem.setMaxStorageStrategy | public void setMaxStorageStrategy(int requestedMaxStrategy)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this,
tc,
"setMaxStorageStrategy",
Integer.valueOf(requestedMaxStrategy));
maxStorageStrategy = requestedMaxStrategy;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setMaxStorageStrategy");
} | java | public void setMaxStorageStrategy(int requestedMaxStrategy)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this,
tc,
"setMaxStorageStrategy",
Integer.valueOf(requestedMaxStrategy));
maxStorageStrategy = requestedMaxStrategy;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setMaxStorageStrategy");
} | [
"public",
"void",
"setMaxStorageStrategy",
"(",
"int",
"requestedMaxStrategy",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"setMaxStorageStrategy\"",
",",
"Integer",
".",
"valueOf",
"(",
"requestedMaxStrategy",
")",
")",
";",
"maxStorageStrategy",
"=",
"requestedMaxStrategy",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"setMaxStorageStrategy\"",
")",
";",
"}"
] | Set the maximum storage strategy permitted | [
"Set",
"the",
"maximum",
"storage",
"strategy",
"permitted"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java#L1808-L1818 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java | MessageItem.setPriority | public void setPriority(int newPriority)
{
JsMessage localMsg = getJSMessage(true);
msgPriority = newPriority;
localMsg.setPriority(newPriority);
} | java | public void setPriority(int newPriority)
{
JsMessage localMsg = getJSMessage(true);
msgPriority = newPriority;
localMsg.setPriority(newPriority);
} | [
"public",
"void",
"setPriority",
"(",
"int",
"newPriority",
")",
"{",
"JsMessage",
"localMsg",
"=",
"getJSMessage",
"(",
"true",
")",
";",
"msgPriority",
"=",
"newPriority",
";",
"localMsg",
".",
"setPriority",
"(",
"newPriority",
")",
";",
"}"
] | Set the message priority and cache it | [
"Set",
"the",
"message",
"priority",
"and",
"cache",
"it"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java#L1871-L1876 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java | MessageItem.addPersistentRef | public void addPersistentRef()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "addPersistentRef");
// We have at least one durable reference so the message
// must maintain its level of persistence
maintainPersistence = 1;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "addPersistentRef");
} | java | public void addPersistentRef()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "addPersistentRef");
// We have at least one durable reference so the message
// must maintain its level of persistence
maintainPersistence = 1;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "addPersistentRef");
} | [
"public",
"void",
"addPersistentRef",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"addPersistentRef\"",
")",
";",
"// We have at least one durable reference so the message",
"// must maintain its level of persistence",
"maintainPersistence",
"=",
"1",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"addPersistentRef\"",
")",
";",
"}"
] | Note the existence of a persistent reference | [
"Note",
"the",
"existence",
"of",
"a",
"persistent",
"reference"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java#L2153-L2164 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java | MessageItem.setOriginatingBus | private void setOriginatingBus(String busName)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setOriginatingBus", busName);
_busName = busName;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setOriginatingBus");
} | java | private void setOriginatingBus(String busName)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "setOriginatingBus", busName);
_busName = busName;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "setOriginatingBus");
} | [
"private",
"void",
"setOriginatingBus",
"(",
"String",
"busName",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"setOriginatingBus\"",
",",
"busName",
")",
";",
"_busName",
"=",
"busName",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"setOriginatingBus\"",
")",
";",
"}"
] | Sets the previous hop Bus name
@param busName | [
"Sets",
"the",
"previous",
"hop",
"Bus",
"name"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java#L2908-L2915 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java | MessageItem.getOriginatingBus | public String getOriginatingBus()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(this, tc, "getOriginatingBus");
SibTr.exit(this, tc, "getOriginatingBus", _busName);
}
return _busName;
} | java | public String getOriginatingBus()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(this, tc, "getOriginatingBus");
SibTr.exit(this, tc, "getOriginatingBus", _busName);
}
return _busName;
} | [
"public",
"String",
"getOriginatingBus",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"getOriginatingBus\"",
")",
";",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"getOriginatingBus\"",
",",
"_busName",
")",
";",
"}",
"return",
"_busName",
";",
"}"
] | Gets the bus that the message was previously at.
@return | [
"Gets",
"the",
"bus",
"that",
"the",
"message",
"was",
"previously",
"at",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java#L2922-L2930 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java | MessageItem.forceCurrentMEArrivalTimeToJsMessage | public void forceCurrentMEArrivalTimeToJsMessage()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "forceCurrentMEArrivalTimeToJsMessage");
if (!arrivalTimeStored)
{
JsMessage localMsg = getJSMessage(true);
localMsg.setCurrentMEArrivalTimestamp(currentMEArrivalTimeStamp);
arrivalTimeStored = true;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "forceCurrentMEArrivalTimeToJsMessage");
} | java | public void forceCurrentMEArrivalTimeToJsMessage()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "forceCurrentMEArrivalTimeToJsMessage");
if (!arrivalTimeStored)
{
JsMessage localMsg = getJSMessage(true);
localMsg.setCurrentMEArrivalTimestamp(currentMEArrivalTimeStamp);
arrivalTimeStored = true;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "forceCurrentMEArrivalTimeToJsMessage");
} | [
"public",
"void",
"forceCurrentMEArrivalTimeToJsMessage",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"forceCurrentMEArrivalTimeToJsMessage\"",
")",
";",
"if",
"(",
"!",
"arrivalTimeStored",
")",
"{",
"JsMessage",
"localMsg",
"=",
"getJSMessage",
"(",
"true",
")",
";",
"localMsg",
".",
"setCurrentMEArrivalTimestamp",
"(",
"currentMEArrivalTimeStamp",
")",
";",
"arrivalTimeStored",
"=",
"true",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"forceCurrentMEArrivalTimeToJsMessage\"",
")",
";",
"}"
] | Forces the local messageItem currentMEArrivalTime value to be
set to the JsMessage rather than wait till the data has been
spilled to the db.
This method will only work if messageItem.setCurrentMEArrivalTimestamp
has been called previously. | [
"Forces",
"the",
"local",
"messageItem",
"currentMEArrivalTime",
"value",
"to",
"be",
"set",
"to",
"the",
"JsMessage",
"rather",
"than",
"wait",
"till",
"the",
"data",
"has",
"been",
"spilled",
"to",
"the",
"db",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java#L2961-L2975 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java | MessageItem.unlockMsg | @Override
public void unlockMsg(long lockID, Transaction transaction, boolean incrementUnlock) throws MessageStoreException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "unlockMsg", new Object[] { Long.valueOf(lockID), transaction, Boolean.valueOf(incrementUnlock) });
if (failedInitInRestore)
{
initialiseNonPersistent(true);
}
if (incrementUnlock)
{
// If we do not wish to increment the count, there is no point checking
// against redelivery threshold
redeliveryCountReached = false;
try
{
if (PRE_UNLOCKED_1 != null)
{
PRE_UNLOCKED_1.messageEventOccurred(MessageEvents.PRE_UNLOCKED, this, transaction);
}
if (PRE_UNLOCKED_2 != null)
{
PRE_UNLOCKED_2.messageEventOccurred(MessageEvents.PRE_UNLOCKED, this, transaction);
}
} catch (SIException e)
{
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.store.items.MessageItem.unlockMsg",
"1:2955:1.244.1.40",
this);
SibTr.exception(tc, e);
// Something went wrong so make sure we unlock the message
redeliveryCountReached = false;
}
}
// If the pre_unlocked callback redirected the message to the exc dest,
// then unlock the message.
if (!redeliveryCountReached)
{
unlock(lockID, transaction, incrementUnlock);
SIMPItemStream itemStream = (SIMPItemStream) getItemStream();
BaseDestinationHandler bdh = getDestinationHandler(false, itemStream);
// proceede if and only if the redeliverycount column exists
if (bdh.isRedeliveryCountPersisted() && bdh.getMessageProcessor().getMessageStore().isRedeliveryCountColumnAvailable()) {
int rdl_count = guessRedeliveredCount();
persistRedeliveredCount(rdl_count);
//updating the value in MFP.
if (msg != null)
msg.setRedeliveredCount(rdl_count);
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "unlockMsg");
} | java | @Override
public void unlockMsg(long lockID, Transaction transaction, boolean incrementUnlock) throws MessageStoreException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "unlockMsg", new Object[] { Long.valueOf(lockID), transaction, Boolean.valueOf(incrementUnlock) });
if (failedInitInRestore)
{
initialiseNonPersistent(true);
}
if (incrementUnlock)
{
// If we do not wish to increment the count, there is no point checking
// against redelivery threshold
redeliveryCountReached = false;
try
{
if (PRE_UNLOCKED_1 != null)
{
PRE_UNLOCKED_1.messageEventOccurred(MessageEvents.PRE_UNLOCKED, this, transaction);
}
if (PRE_UNLOCKED_2 != null)
{
PRE_UNLOCKED_2.messageEventOccurred(MessageEvents.PRE_UNLOCKED, this, transaction);
}
} catch (SIException e)
{
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.store.items.MessageItem.unlockMsg",
"1:2955:1.244.1.40",
this);
SibTr.exception(tc, e);
// Something went wrong so make sure we unlock the message
redeliveryCountReached = false;
}
}
// If the pre_unlocked callback redirected the message to the exc dest,
// then unlock the message.
if (!redeliveryCountReached)
{
unlock(lockID, transaction, incrementUnlock);
SIMPItemStream itemStream = (SIMPItemStream) getItemStream();
BaseDestinationHandler bdh = getDestinationHandler(false, itemStream);
// proceede if and only if the redeliverycount column exists
if (bdh.isRedeliveryCountPersisted() && bdh.getMessageProcessor().getMessageStore().isRedeliveryCountColumnAvailable()) {
int rdl_count = guessRedeliveredCount();
persistRedeliveredCount(rdl_count);
//updating the value in MFP.
if (msg != null)
msg.setRedeliveredCount(rdl_count);
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "unlockMsg");
} | [
"@",
"Override",
"public",
"void",
"unlockMsg",
"(",
"long",
"lockID",
",",
"Transaction",
"transaction",
",",
"boolean",
"incrementUnlock",
")",
"throws",
"MessageStoreException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"unlockMsg\"",
",",
"new",
"Object",
"[",
"]",
"{",
"Long",
".",
"valueOf",
"(",
"lockID",
")",
",",
"transaction",
",",
"Boolean",
".",
"valueOf",
"(",
"incrementUnlock",
")",
"}",
")",
";",
"if",
"(",
"failedInitInRestore",
")",
"{",
"initialiseNonPersistent",
"(",
"true",
")",
";",
"}",
"if",
"(",
"incrementUnlock",
")",
"{",
"// If we do not wish to increment the count, there is no point checking",
"// against redelivery threshold",
"redeliveryCountReached",
"=",
"false",
";",
"try",
"{",
"if",
"(",
"PRE_UNLOCKED_1",
"!=",
"null",
")",
"{",
"PRE_UNLOCKED_1",
".",
"messageEventOccurred",
"(",
"MessageEvents",
".",
"PRE_UNLOCKED",
",",
"this",
",",
"transaction",
")",
";",
"}",
"if",
"(",
"PRE_UNLOCKED_2",
"!=",
"null",
")",
"{",
"PRE_UNLOCKED_2",
".",
"messageEventOccurred",
"(",
"MessageEvents",
".",
"PRE_UNLOCKED",
",",
"this",
",",
"transaction",
")",
";",
"}",
"}",
"catch",
"(",
"SIException",
"e",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.impl.store.items.MessageItem.unlockMsg\"",
",",
"\"1:2955:1.244.1.40\"",
",",
"this",
")",
";",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"// Something went wrong so make sure we unlock the message",
"redeliveryCountReached",
"=",
"false",
";",
"}",
"}",
"// If the pre_unlocked callback redirected the message to the exc dest,",
"// then unlock the message.",
"if",
"(",
"!",
"redeliveryCountReached",
")",
"{",
"unlock",
"(",
"lockID",
",",
"transaction",
",",
"incrementUnlock",
")",
";",
"SIMPItemStream",
"itemStream",
"=",
"(",
"SIMPItemStream",
")",
"getItemStream",
"(",
")",
";",
"BaseDestinationHandler",
"bdh",
"=",
"getDestinationHandler",
"(",
"false",
",",
"itemStream",
")",
";",
"// proceede if and only if the redeliverycount column exists",
"if",
"(",
"bdh",
".",
"isRedeliveryCountPersisted",
"(",
")",
"&&",
"bdh",
".",
"getMessageProcessor",
"(",
")",
".",
"getMessageStore",
"(",
")",
".",
"isRedeliveryCountColumnAvailable",
"(",
")",
")",
"{",
"int",
"rdl_count",
"=",
"guessRedeliveredCount",
"(",
")",
";",
"persistRedeliveredCount",
"(",
"rdl_count",
")",
";",
"//updating the value in MFP.",
"if",
"(",
"msg",
"!=",
"null",
")",
"msg",
".",
"setRedeliveredCount",
"(",
"rdl_count",
")",
";",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"unlockMsg\"",
")",
";",
"}"
] | unlockMsg - call any registered callbacks before we unlock the
message
N.B All MP unlocking should go through this method | [
"unlockMsg",
"-",
"call",
"any",
"registered",
"callbacks",
"before",
"we",
"unlock",
"the",
"message",
"N",
".",
"B",
"All",
"MP",
"unlocking",
"should",
"go",
"through",
"this",
"method"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java#L3009-L3077 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java | MessageItem.setRegisterForPostEvents | public void setRegisterForPostEvents(boolean registerEvents)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(this, tc, "setRegisterForPostEvents", Boolean.valueOf(registerEvents));
SibTr.exit(this, tc, "setRegisterForPostEvents");
}
this.registerEvents = registerEvents;
} | java | public void setRegisterForPostEvents(boolean registerEvents)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(this, tc, "setRegisterForPostEvents", Boolean.valueOf(registerEvents));
SibTr.exit(this, tc, "setRegisterForPostEvents");
}
this.registerEvents = registerEvents;
} | [
"public",
"void",
"setRegisterForPostEvents",
"(",
"boolean",
"registerEvents",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"setRegisterForPostEvents\"",
",",
"Boolean",
".",
"valueOf",
"(",
"registerEvents",
")",
")",
";",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"setRegisterForPostEvents\"",
")",
";",
"}",
"this",
".",
"registerEvents",
"=",
"registerEvents",
";",
"}"
] | sets whether event listeners has to be registered for post events | [
"sets",
"whether",
"event",
"listeners",
"has",
"to",
"be",
"registered",
"for",
"post",
"events"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/MessageItem.java#L3458-L3466 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.microprofile.config.1.1/src/com/ibm/ws/microprofile/config/converters/PriorityConverterMap.java | PriorityConverterMap.addAll | @Trivial
public void addAll(PriorityConverterMap convertersToAdd) {
for (PriorityConverter converter : convertersToAdd.converters.values()) {
_addConverter(converter);
}
} | java | @Trivial
public void addAll(PriorityConverterMap convertersToAdd) {
for (PriorityConverter converter : convertersToAdd.converters.values()) {
_addConverter(converter);
}
} | [
"@",
"Trivial",
"public",
"void",
"addAll",
"(",
"PriorityConverterMap",
"convertersToAdd",
")",
"{",
"for",
"(",
"PriorityConverter",
"converter",
":",
"convertersToAdd",
".",
"converters",
".",
"values",
"(",
")",
")",
"{",
"_addConverter",
"(",
"converter",
")",
";",
"}",
"}"
] | Add all of the converters from the given map to this one... if they have a higher priority as above
@param convertersToAdd the converters to add | [
"Add",
"all",
"of",
"the",
"converters",
"from",
"the",
"given",
"map",
"to",
"this",
"one",
"...",
"if",
"they",
"have",
"a",
"higher",
"priority",
"as",
"above"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.config.1.1/src/com/ibm/ws/microprofile/config/converters/PriorityConverterMap.java#L92-L97 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.microprofile.config.1.1/src/com/ibm/ws/microprofile/config/converters/PriorityConverterMap.java | PriorityConverterMap.getConverter | public PriorityConverter getConverter(Type type) {
PriorityConverter converter = converters.get(type);
return converter;
} | java | public PriorityConverter getConverter(Type type) {
PriorityConverter converter = converters.get(type);
return converter;
} | [
"public",
"PriorityConverter",
"getConverter",
"(",
"Type",
"type",
")",
"{",
"PriorityConverter",
"converter",
"=",
"converters",
".",
"get",
"(",
"type",
")",
";",
"return",
"converter",
";",
"}"
] | Get a converter for the given type
@param <T>
@param type the type to find a converter for
@return the converter for the given type | [
"Get",
"a",
"converter",
"for",
"the",
"given",
"type"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.config.1.1/src/com/ibm/ws/microprofile/config/converters/PriorityConverterMap.java#L107-L110 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/provisioning/VersionUtility.java | VersionUtility.stringToVersion | public static Version stringToVersion(String str) {
if (str == null || str.isEmpty() || str.equals("0")) {
return Version.emptyVersion;
}
if (str.equals("1") || str.equals("1.0") || str.equals("1.0.0"))
return VERSION_1_0;
return new Version(str);
} | java | public static Version stringToVersion(String str) {
if (str == null || str.isEmpty() || str.equals("0")) {
return Version.emptyVersion;
}
if (str.equals("1") || str.equals("1.0") || str.equals("1.0.0"))
return VERSION_1_0;
return new Version(str);
} | [
"public",
"static",
"Version",
"stringToVersion",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"str",
"==",
"null",
"||",
"str",
".",
"isEmpty",
"(",
")",
"||",
"str",
".",
"equals",
"(",
"\"0\"",
")",
")",
"{",
"return",
"Version",
".",
"emptyVersion",
";",
"}",
"if",
"(",
"str",
".",
"equals",
"(",
"\"1\"",
")",
"||",
"str",
".",
"equals",
"(",
"\"1.0\"",
")",
"||",
"str",
".",
"equals",
"(",
"\"1.0.0\"",
")",
")",
"return",
"VERSION_1_0",
";",
"return",
"new",
"Version",
"(",
"str",
")",
";",
"}"
] | Convert a string into a Version, reusing common Version
objects if we can.
@param str String to convert to a Version
@return Version | [
"Convert",
"a",
"string",
"into",
"a",
"Version",
"reusing",
"common",
"Version",
"objects",
"if",
"we",
"can",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/provisioning/VersionUtility.java#L36-L45 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/provisioning/VersionUtility.java | VersionUtility.stringToVersionRange | public static final VersionRange stringToVersionRange(String str) {
if (str == null || str.isEmpty() || "0".equals(str))
return EMPTY_RANGE;
if ("[1,1.0.100)".equals(str) || "[1.0,1.0.100)".equals(str) || "[1.0.0,1.0.100)".equals(str))
return INITIAL_RANGE;
return new VersionRange(str);
} | java | public static final VersionRange stringToVersionRange(String str) {
if (str == null || str.isEmpty() || "0".equals(str))
return EMPTY_RANGE;
if ("[1,1.0.100)".equals(str) || "[1.0,1.0.100)".equals(str) || "[1.0.0,1.0.100)".equals(str))
return INITIAL_RANGE;
return new VersionRange(str);
} | [
"public",
"static",
"final",
"VersionRange",
"stringToVersionRange",
"(",
"String",
"str",
")",
"{",
"if",
"(",
"str",
"==",
"null",
"||",
"str",
".",
"isEmpty",
"(",
")",
"||",
"\"0\"",
".",
"equals",
"(",
"str",
")",
")",
"return",
"EMPTY_RANGE",
";",
"if",
"(",
"\"[1,1.0.100)\"",
".",
"equals",
"(",
"str",
")",
"||",
"\"[1.0,1.0.100)\"",
".",
"equals",
"(",
"str",
")",
"||",
"\"[1.0.0,1.0.100)\"",
".",
"equals",
"(",
"str",
")",
")",
"return",
"INITIAL_RANGE",
";",
"return",
"new",
"VersionRange",
"(",
"str",
")",
";",
"}"
] | Convert a string into a VersionRange, reusing common VersionRange
objects if we can.
@param str String to convert to a VersionRange
@return VersionRange | [
"Convert",
"a",
"string",
"into",
"a",
"VersionRange",
"reusing",
"common",
"VersionRange",
"objects",
"if",
"we",
"can",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/provisioning/VersionUtility.java#L54-L62 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/wsspi/http/HttpCookie.java | HttpCookie.setAttribute | public void setAttribute(String name, String value) {
this.myAttrs.put(name.toLowerCase(), value);
} | java | public void setAttribute(String name, String value) {
this.myAttrs.put(name.toLowerCase(), value);
} | [
"public",
"void",
"setAttribute",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"this",
".",
"myAttrs",
".",
"put",
"(",
"name",
".",
"toLowerCase",
"(",
")",
",",
"value",
")",
";",
"}"
] | Set a generic attribute on this cookie.
@param name
@param value | [
"Set",
"a",
"generic",
"attribute",
"on",
"this",
"cookie",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/wsspi/http/HttpCookie.java#L114-L116 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/internal/URLHandler.java | URLHandler.getServletURI | public String getServletURI(HttpServletRequest req) {
String uriName = req.getServletPath();
String pathInfo = req.getPathInfo();
if (pathInfo != null)
uriName = uriName.concat(pathInfo);
if (uriName == null || uriName.length() == 0)
uriName = "/";
uriName = WSUtil.resolveURI(uriName);
int sindex;
if ((sindex = uriName.indexOf(";")) != -1) {
uriName = uriName.substring(0, sindex);
}
//we need to ensure we are following the java EE spec and handle a colon in the uri
if (uriName.indexOf(":") >= 0) {
uriName = uriName.replaceAll(":", "%3A");
}
return uriName;
} | java | public String getServletURI(HttpServletRequest req) {
String uriName = req.getServletPath();
String pathInfo = req.getPathInfo();
if (pathInfo != null)
uriName = uriName.concat(pathInfo);
if (uriName == null || uriName.length() == 0)
uriName = "/";
uriName = WSUtil.resolveURI(uriName);
int sindex;
if ((sindex = uriName.indexOf(";")) != -1) {
uriName = uriName.substring(0, sindex);
}
//we need to ensure we are following the java EE spec and handle a colon in the uri
if (uriName.indexOf(":") >= 0) {
uriName = uriName.replaceAll(":", "%3A");
}
return uriName;
} | [
"public",
"String",
"getServletURI",
"(",
"HttpServletRequest",
"req",
")",
"{",
"String",
"uriName",
"=",
"req",
".",
"getServletPath",
"(",
")",
";",
"String",
"pathInfo",
"=",
"req",
".",
"getPathInfo",
"(",
")",
";",
"if",
"(",
"pathInfo",
"!=",
"null",
")",
"uriName",
"=",
"uriName",
".",
"concat",
"(",
"pathInfo",
")",
";",
"if",
"(",
"uriName",
"==",
"null",
"||",
"uriName",
".",
"length",
"(",
")",
"==",
"0",
")",
"uriName",
"=",
"\"/\"",
";",
"uriName",
"=",
"WSUtil",
".",
"resolveURI",
"(",
"uriName",
")",
";",
"int",
"sindex",
";",
"if",
"(",
"(",
"sindex",
"=",
"uriName",
".",
"indexOf",
"(",
"\";\"",
")",
")",
"!=",
"-",
"1",
")",
"{",
"uriName",
"=",
"uriName",
".",
"substring",
"(",
"0",
",",
"sindex",
")",
";",
"}",
"//we need to ensure we are following the java EE spec and handle a colon in the uri",
"if",
"(",
"uriName",
".",
"indexOf",
"(",
"\":\"",
")",
">=",
"0",
")",
"{",
"uriName",
"=",
"uriName",
".",
"replaceAll",
"(",
"\":\"",
",",
"\"%3A\"",
")",
";",
"}",
"return",
"uriName",
";",
"}"
] | Return the full servlet path, including any additional path info.
getRequestURI includes the ContextPath of the URL. As per Servlet 2.2
specifications, URL mapping does not include the ContextPath. Thus,
we should use ServletPath + PathInfo.
@param req HttpServletRequest | [
"Return",
"the",
"full",
"servlet",
"path",
"including",
"any",
"additional",
"path",
"info",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/internal/URLHandler.java#L161-L182 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/AbstractDirector.java | AbstractDirector.fireProgressEvent | void fireProgressEvent(int state, int progress, String message) {
try {
fireProgressEvent(state, progress, message, false);
} catch (InstallException e) {
}
} | java | void fireProgressEvent(int state, int progress, String message) {
try {
fireProgressEvent(state, progress, message, false);
} catch (InstallException e) {
}
} | [
"void",
"fireProgressEvent",
"(",
"int",
"state",
",",
"int",
"progress",
",",
"String",
"message",
")",
"{",
"try",
"{",
"fireProgressEvent",
"(",
"state",
",",
"progress",
",",
"message",
",",
"false",
")",
";",
"}",
"catch",
"(",
"InstallException",
"e",
")",
"{",
"}",
"}"
] | Creates a Progress event message.
@param state the state integer
@param progress the progress integer
@param message the message to be displayed | [
"Creates",
"a",
"Progress",
"event",
"message",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/AbstractDirector.java#L58-L63 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/AbstractDirector.java | AbstractDirector.fireProgressEvent | void fireProgressEvent(int state, int progress, String message, boolean allowCancel) throws InstallException {
log(Level.FINEST, message);
if (enableEvent) {
try {
eventManager.fireProgressEvent(state, progress, message);
} catch (CancelException ce) {
if (allowCancel)
throw ce;
else
log(Level.FINEST, "fireProgressEvent caught cancel exception: " + ce.getMessage());
} catch (Exception e) {
log(Level.FINEST, "fireProgressEvent caught exception: " + e.getMessage());
}
}
} | java | void fireProgressEvent(int state, int progress, String message, boolean allowCancel) throws InstallException {
log(Level.FINEST, message);
if (enableEvent) {
try {
eventManager.fireProgressEvent(state, progress, message);
} catch (CancelException ce) {
if (allowCancel)
throw ce;
else
log(Level.FINEST, "fireProgressEvent caught cancel exception: " + ce.getMessage());
} catch (Exception e) {
log(Level.FINEST, "fireProgressEvent caught exception: " + e.getMessage());
}
}
} | [
"void",
"fireProgressEvent",
"(",
"int",
"state",
",",
"int",
"progress",
",",
"String",
"message",
",",
"boolean",
"allowCancel",
")",
"throws",
"InstallException",
"{",
"log",
"(",
"Level",
".",
"FINEST",
",",
"message",
")",
";",
"if",
"(",
"enableEvent",
")",
"{",
"try",
"{",
"eventManager",
".",
"fireProgressEvent",
"(",
"state",
",",
"progress",
",",
"message",
")",
";",
"}",
"catch",
"(",
"CancelException",
"ce",
")",
"{",
"if",
"(",
"allowCancel",
")",
"throw",
"ce",
";",
"else",
"log",
"(",
"Level",
".",
"FINEST",
",",
"\"fireProgressEvent caught cancel exception: \"",
"+",
"ce",
".",
"getMessage",
"(",
")",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"log",
"(",
"Level",
".",
"FINEST",
",",
"\"fireProgressEvent caught exception: \"",
"+",
"e",
".",
"getMessage",
"(",
")",
")",
";",
"}",
"}",
"}"
] | Creates a Progress event message that can handle cancel exceptions.
@param state the state integer
@param progress the progress integer
@param message the message to be displayed
@param allowCancel if cancel exceptions should be handled
@throws InstallException | [
"Creates",
"a",
"Progress",
"event",
"message",
"that",
"can",
"handle",
"cancel",
"exceptions",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/AbstractDirector.java#L74-L88 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/AbstractDirector.java | AbstractDirector.log | void log(Level level, String msg, Exception e) {
if (e != null)
logger.log(level, msg, e);
} | java | void log(Level level, String msg, Exception e) {
if (e != null)
logger.log(level, msg, e);
} | [
"void",
"log",
"(",
"Level",
"level",
",",
"String",
"msg",
",",
"Exception",
"e",
")",
"{",
"if",
"(",
"e",
"!=",
"null",
")",
"logger",
".",
"log",
"(",
"level",
",",
"msg",
",",
"e",
")",
";",
"}"
] | Logs a message with an exception.
@param level the level of the message
@param msg the message
@param e the exception causing the message | [
"Logs",
"a",
"message",
"with",
"an",
"exception",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/AbstractDirector.java#L108-L111 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/AbstractDirector.java | AbstractDirector.isEmpty | boolean isEmpty(Map<String, List<List<RepositoryResource>>> installResources) {
if (installResources == null)
return true;
for (List<List<RepositoryResource>> targetList : installResources.values()) {
for (List<RepositoryResource> mrList : targetList) {
if (!mrList.isEmpty())
return false;
}
}
return true;
} | java | boolean isEmpty(Map<String, List<List<RepositoryResource>>> installResources) {
if (installResources == null)
return true;
for (List<List<RepositoryResource>> targetList : installResources.values()) {
for (List<RepositoryResource> mrList : targetList) {
if (!mrList.isEmpty())
return false;
}
}
return true;
} | [
"boolean",
"isEmpty",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"List",
"<",
"RepositoryResource",
">",
">",
">",
"installResources",
")",
"{",
"if",
"(",
"installResources",
"==",
"null",
")",
"return",
"true",
";",
"for",
"(",
"List",
"<",
"List",
"<",
"RepositoryResource",
">",
">",
"targetList",
":",
"installResources",
".",
"values",
"(",
")",
")",
"{",
"for",
"(",
"List",
"<",
"RepositoryResource",
">",
"mrList",
":",
"targetList",
")",
"{",
"if",
"(",
"!",
"mrList",
".",
"isEmpty",
"(",
")",
")",
"return",
"false",
";",
"}",
"}",
"return",
"true",
";",
"}"
] | Checks if installResources map contains any resources
@param installResources the map of installResources
@return true if all lists in the map are empty | [
"Checks",
"if",
"installResources",
"map",
"contains",
"any",
"resources"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/AbstractDirector.java#L119-L129 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/AbstractDirector.java | AbstractDirector.isEmpty | boolean isEmpty(List<List<RepositoryResource>> installResources) {
if (installResources == null)
return true;
for (List<RepositoryResource> mrList : installResources) {
if (!mrList.isEmpty())
return false;
}
return true;
} | java | boolean isEmpty(List<List<RepositoryResource>> installResources) {
if (installResources == null)
return true;
for (List<RepositoryResource> mrList : installResources) {
if (!mrList.isEmpty())
return false;
}
return true;
} | [
"boolean",
"isEmpty",
"(",
"List",
"<",
"List",
"<",
"RepositoryResource",
">",
">",
"installResources",
")",
"{",
"if",
"(",
"installResources",
"==",
"null",
")",
"return",
"true",
";",
"for",
"(",
"List",
"<",
"RepositoryResource",
">",
"mrList",
":",
"installResources",
")",
"{",
"if",
"(",
"!",
"mrList",
".",
"isEmpty",
"(",
")",
")",
"return",
"false",
";",
"}",
"return",
"true",
";",
"}"
] | Checks if installResources contains any resources
@param installResources the list of lists containing Install Resources
@return true if all lists are empty | [
"Checks",
"if",
"installResources",
"contains",
"any",
"resources"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/AbstractDirector.java#L137-L145 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/AbstractDirector.java | AbstractDirector.containFeature | boolean containFeature(Map<String, ProvisioningFeatureDefinition> installedFeatures, String feature) {
if (installedFeatures.containsKey(feature))
return true;
for (ProvisioningFeatureDefinition pfd : installedFeatures.values()) {
String shortName = InstallUtils.getShortName(pfd);
if (shortName != null && shortName.equalsIgnoreCase(feature))
return true;
}
return false;
} | java | boolean containFeature(Map<String, ProvisioningFeatureDefinition> installedFeatures, String feature) {
if (installedFeatures.containsKey(feature))
return true;
for (ProvisioningFeatureDefinition pfd : installedFeatures.values()) {
String shortName = InstallUtils.getShortName(pfd);
if (shortName != null && shortName.equalsIgnoreCase(feature))
return true;
}
return false;
} | [
"boolean",
"containFeature",
"(",
"Map",
"<",
"String",
",",
"ProvisioningFeatureDefinition",
">",
"installedFeatures",
",",
"String",
"feature",
")",
"{",
"if",
"(",
"installedFeatures",
".",
"containsKey",
"(",
"feature",
")",
")",
"return",
"true",
";",
"for",
"(",
"ProvisioningFeatureDefinition",
"pfd",
":",
"installedFeatures",
".",
"values",
"(",
")",
")",
"{",
"String",
"shortName",
"=",
"InstallUtils",
".",
"getShortName",
"(",
"pfd",
")",
";",
"if",
"(",
"shortName",
"!=",
"null",
"&&",
"shortName",
".",
"equalsIgnoreCase",
"(",
"feature",
")",
")",
"return",
"true",
";",
"}",
"return",
"false",
";",
"}"
] | Checks if the feature is in installedFeatures
@param installedFeatures the map of installed features
@param feature the feature to look for
@return true if feature is in installedFeatures | [
"Checks",
"if",
"the",
"feature",
"is",
"in",
"installedFeatures"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/AbstractDirector.java#L154-L163 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/AbstractDirector.java | AbstractDirector.getFeaturesToInstall | Collection<String> getFeaturesToInstall(Collection<String> requiredFeatures, boolean download) {
Collection<String> featuresToInstall = new ArrayList<String>(requiredFeatures.size());
if (!requiredFeatures.isEmpty()) {
Map<String, ProvisioningFeatureDefinition> installedFeatures = product.getFeatureDefinitions();
for (String feature : requiredFeatures) {
if (download || !containFeature(installedFeatures, feature))
featuresToInstall.add(feature);
}
}
return featuresToInstall;
} | java | Collection<String> getFeaturesToInstall(Collection<String> requiredFeatures, boolean download) {
Collection<String> featuresToInstall = new ArrayList<String>(requiredFeatures.size());
if (!requiredFeatures.isEmpty()) {
Map<String, ProvisioningFeatureDefinition> installedFeatures = product.getFeatureDefinitions();
for (String feature : requiredFeatures) {
if (download || !containFeature(installedFeatures, feature))
featuresToInstall.add(feature);
}
}
return featuresToInstall;
} | [
"Collection",
"<",
"String",
">",
"getFeaturesToInstall",
"(",
"Collection",
"<",
"String",
">",
"requiredFeatures",
",",
"boolean",
"download",
")",
"{",
"Collection",
"<",
"String",
">",
"featuresToInstall",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
"requiredFeatures",
".",
"size",
"(",
")",
")",
";",
"if",
"(",
"!",
"requiredFeatures",
".",
"isEmpty",
"(",
")",
")",
"{",
"Map",
"<",
"String",
",",
"ProvisioningFeatureDefinition",
">",
"installedFeatures",
"=",
"product",
".",
"getFeatureDefinitions",
"(",
")",
";",
"for",
"(",
"String",
"feature",
":",
"requiredFeatures",
")",
"{",
"if",
"(",
"download",
"||",
"!",
"containFeature",
"(",
"installedFeatures",
",",
"feature",
")",
")",
"featuresToInstall",
".",
"add",
"(",
"feature",
")",
";",
"}",
"}",
"return",
"featuresToInstall",
";",
"}"
] | Creates a collection of features that still need to be installed
@param requiredFeatures Collection of all features that should be installed
@param download if all features (including already installed) should be downloaded
@return The subset of requiredFeatures containing features that still need to be installed | [
"Creates",
"a",
"collection",
"of",
"features",
"that",
"still",
"need",
"to",
"be",
"installed"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/AbstractDirector.java#L172-L182 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/AbstractDirector.java | AbstractDirector.containScript | boolean containScript(List<File> filesInstalled) {
for (File f : filesInstalled) {
String path = f.getAbsolutePath().toLowerCase();
if (path.contains("/bin/") || path.contains("\\bin\\")) {
return true;
}
}
return false;
} | java | boolean containScript(List<File> filesInstalled) {
for (File f : filesInstalled) {
String path = f.getAbsolutePath().toLowerCase();
if (path.contains("/bin/") || path.contains("\\bin\\")) {
return true;
}
}
return false;
} | [
"boolean",
"containScript",
"(",
"List",
"<",
"File",
">",
"filesInstalled",
")",
"{",
"for",
"(",
"File",
"f",
":",
"filesInstalled",
")",
"{",
"String",
"path",
"=",
"f",
".",
"getAbsolutePath",
"(",
")",
".",
"toLowerCase",
"(",
")",
";",
"if",
"(",
"path",
".",
"contains",
"(",
"\"/bin/\"",
")",
"||",
"path",
".",
"contains",
"(",
"\"\\\\bin\\\\\"",
")",
")",
"{",
"return",
"true",
";",
"}",
"}",
"return",
"false",
";",
"}"
] | Checks if filesInstalled includes scripts in a bin folder.
@param filesInstalled the list of files that are installed
@return true if at least one file is in the bin path | [
"Checks",
"if",
"filesInstalled",
"includes",
"scripts",
"in",
"a",
"bin",
"folder",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/AbstractDirector.java#L190-L198 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.microprofile.openapi/src/com/ibm/ws/microprofile/openapi/impl/core/util/AnnotationsUtils.java | AnnotationsUtils.getNameOfReferenceableItem | public static String getNameOfReferenceableItem(Object annotation) {
if (annotation == null) {
return "";
}
String name = "", ref = "";
if (annotation instanceof org.eclipse.microprofile.openapi.annotations.headers.Header) {
name = ((org.eclipse.microprofile.openapi.annotations.headers.Header) annotation).name();
ref = ((org.eclipse.microprofile.openapi.annotations.headers.Header) annotation).ref();
} else if (annotation instanceof ExampleObject) {
name = ((ExampleObject) annotation).name();
ref = ((ExampleObject) annotation).ref();
} else if (annotation instanceof org.eclipse.microprofile.openapi.annotations.links.Link) {
name = ((org.eclipse.microprofile.openapi.annotations.links.Link) annotation).name();
ref = ((org.eclipse.microprofile.openapi.annotations.links.Link) annotation).ref();
} else if (annotation instanceof Callback) {
name = ((Callback) annotation).name();
ref = ((Callback) annotation).ref();
}
if (StringUtils.isBlank(name)) {
if (StringUtils.isNotBlank(ref)) {
//If the item is a reference then use the simple name of reference as the name
int index = ref.lastIndexOf('/');
return index == -1 ? ref : ref.substring(index + 1);
}
}
return name;
} | java | public static String getNameOfReferenceableItem(Object annotation) {
if (annotation == null) {
return "";
}
String name = "", ref = "";
if (annotation instanceof org.eclipse.microprofile.openapi.annotations.headers.Header) {
name = ((org.eclipse.microprofile.openapi.annotations.headers.Header) annotation).name();
ref = ((org.eclipse.microprofile.openapi.annotations.headers.Header) annotation).ref();
} else if (annotation instanceof ExampleObject) {
name = ((ExampleObject) annotation).name();
ref = ((ExampleObject) annotation).ref();
} else if (annotation instanceof org.eclipse.microprofile.openapi.annotations.links.Link) {
name = ((org.eclipse.microprofile.openapi.annotations.links.Link) annotation).name();
ref = ((org.eclipse.microprofile.openapi.annotations.links.Link) annotation).ref();
} else if (annotation instanceof Callback) {
name = ((Callback) annotation).name();
ref = ((Callback) annotation).ref();
}
if (StringUtils.isBlank(name)) {
if (StringUtils.isNotBlank(ref)) {
//If the item is a reference then use the simple name of reference as the name
int index = ref.lastIndexOf('/');
return index == -1 ? ref : ref.substring(index + 1);
}
}
return name;
} | [
"public",
"static",
"String",
"getNameOfReferenceableItem",
"(",
"Object",
"annotation",
")",
"{",
"if",
"(",
"annotation",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"String",
"name",
"=",
"\"\"",
",",
"ref",
"=",
"\"\"",
";",
"if",
"(",
"annotation",
"instanceof",
"org",
".",
"eclipse",
".",
"microprofile",
".",
"openapi",
".",
"annotations",
".",
"headers",
".",
"Header",
")",
"{",
"name",
"=",
"(",
"(",
"org",
".",
"eclipse",
".",
"microprofile",
".",
"openapi",
".",
"annotations",
".",
"headers",
".",
"Header",
")",
"annotation",
")",
".",
"name",
"(",
")",
";",
"ref",
"=",
"(",
"(",
"org",
".",
"eclipse",
".",
"microprofile",
".",
"openapi",
".",
"annotations",
".",
"headers",
".",
"Header",
")",
"annotation",
")",
".",
"ref",
"(",
")",
";",
"}",
"else",
"if",
"(",
"annotation",
"instanceof",
"ExampleObject",
")",
"{",
"name",
"=",
"(",
"(",
"ExampleObject",
")",
"annotation",
")",
".",
"name",
"(",
")",
";",
"ref",
"=",
"(",
"(",
"ExampleObject",
")",
"annotation",
")",
".",
"ref",
"(",
")",
";",
"}",
"else",
"if",
"(",
"annotation",
"instanceof",
"org",
".",
"eclipse",
".",
"microprofile",
".",
"openapi",
".",
"annotations",
".",
"links",
".",
"Link",
")",
"{",
"name",
"=",
"(",
"(",
"org",
".",
"eclipse",
".",
"microprofile",
".",
"openapi",
".",
"annotations",
".",
"links",
".",
"Link",
")",
"annotation",
")",
".",
"name",
"(",
")",
";",
"ref",
"=",
"(",
"(",
"org",
".",
"eclipse",
".",
"microprofile",
".",
"openapi",
".",
"annotations",
".",
"links",
".",
"Link",
")",
"annotation",
")",
".",
"ref",
"(",
")",
";",
"}",
"else",
"if",
"(",
"annotation",
"instanceof",
"Callback",
")",
"{",
"name",
"=",
"(",
"(",
"Callback",
")",
"annotation",
")",
".",
"name",
"(",
")",
";",
"ref",
"=",
"(",
"(",
"Callback",
")",
"annotation",
")",
".",
"ref",
"(",
")",
";",
"}",
"if",
"(",
"StringUtils",
".",
"isBlank",
"(",
"name",
")",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"ref",
")",
")",
"{",
"//If the item is a reference then use the simple name of reference as the name",
"int",
"index",
"=",
"ref",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"return",
"index",
"==",
"-",
"1",
"?",
"ref",
":",
"ref",
".",
"substring",
"(",
"index",
"+",
"1",
")",
";",
"}",
"}",
"return",
"name",
";",
"}"
] | Retrieve the name
If the item is a reference and name attribute is not specified then returns the simple name of the reference.
@param annotation item
@return name of the item | [
"Retrieve",
"the",
"name"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.openapi/src/com/ibm/ws/microprofile/openapi/impl/core/util/AnnotationsUtils.java#L175-L203 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/ConsumerMonitorRegistrar.java | ConsumerMonitorRegistrar.getExactSubsSize | public int getExactSubsSize(String topicExpression)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getExactSubsSize", topicExpression);
int numSubs = 0;
// Test whether table is now empty
if(!_registeredExactConsumerMonitors.isEmpty())
{
if(_registeredExactConsumerMonitors.containsKey(topicExpression))
{
RegisteredCallbacks rMonitor =
(RegisteredCallbacks)_registeredExactConsumerMonitors.get(topicExpression);
// Get the list of matching consumers
ArrayList consumerList = rMonitor.getMatchingConsumers();
if(consumerList != null && !consumerList.isEmpty())
{
numSubs = consumerList.size();
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "getExactSubsSize", new Integer(numSubs));
return numSubs;
} | java | public int getExactSubsSize(String topicExpression)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getExactSubsSize", topicExpression);
int numSubs = 0;
// Test whether table is now empty
if(!_registeredExactConsumerMonitors.isEmpty())
{
if(_registeredExactConsumerMonitors.containsKey(topicExpression))
{
RegisteredCallbacks rMonitor =
(RegisteredCallbacks)_registeredExactConsumerMonitors.get(topicExpression);
// Get the list of matching consumers
ArrayList consumerList = rMonitor.getMatchingConsumers();
if(consumerList != null && !consumerList.isEmpty())
{
numSubs = consumerList.size();
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "getExactSubsSize", new Integer(numSubs));
return numSubs;
} | [
"public",
"int",
"getExactSubsSize",
"(",
"String",
"topicExpression",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"getExactSubsSize\"",
",",
"topicExpression",
")",
";",
"int",
"numSubs",
"=",
"0",
";",
"// Test whether table is now empty",
"if",
"(",
"!",
"_registeredExactConsumerMonitors",
".",
"isEmpty",
"(",
")",
")",
"{",
"if",
"(",
"_registeredExactConsumerMonitors",
".",
"containsKey",
"(",
"topicExpression",
")",
")",
"{",
"RegisteredCallbacks",
"rMonitor",
"=",
"(",
"RegisteredCallbacks",
")",
"_registeredExactConsumerMonitors",
".",
"get",
"(",
"topicExpression",
")",
";",
"// Get the list of matching consumers",
"ArrayList",
"consumerList",
"=",
"rMonitor",
".",
"getMatchingConsumers",
"(",
")",
";",
"if",
"(",
"consumerList",
"!=",
"null",
"&&",
"!",
"consumerList",
".",
"isEmpty",
"(",
")",
")",
"{",
"numSubs",
"=",
"consumerList",
".",
"size",
"(",
")",
";",
"}",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"getExactSubsSize\"",
",",
"new",
"Integer",
"(",
"numSubs",
")",
")",
";",
"return",
"numSubs",
";",
"}"
] | Methods for integrity checks - used in unit testing | [
"Methods",
"for",
"integrity",
"checks",
"-",
"used",
"in",
"unit",
"testing"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/matching/ConsumerMonitorRegistrar.java#L1297-L1322 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.common/src/com/ibm/ws/security/common/time/TimeUtils.java | TimeUtils.setSimpleDateFormat | @FFDCIgnore(value = { Exception.class })
public void setSimpleDateFormat(String formatString) {
if (formatString == null) {
if (tc.isDebugEnabled()) {
Tr.debug(tc, "Null format string provided; date format will not be changed");
}
return;
}
try {
simpleDateFormat = new SimpleDateFormat(formatString);
} catch (Exception e) {
if (tc.isDebugEnabled()) {
Tr.debug(tc, "Exception caught setting date format: " + e.getMessage());
Tr.debug(tc, "Date format will not be changed");
}
}
} | java | @FFDCIgnore(value = { Exception.class })
public void setSimpleDateFormat(String formatString) {
if (formatString == null) {
if (tc.isDebugEnabled()) {
Tr.debug(tc, "Null format string provided; date format will not be changed");
}
return;
}
try {
simpleDateFormat = new SimpleDateFormat(formatString);
} catch (Exception e) {
if (tc.isDebugEnabled()) {
Tr.debug(tc, "Exception caught setting date format: " + e.getMessage());
Tr.debug(tc, "Date format will not be changed");
}
}
} | [
"@",
"FFDCIgnore",
"(",
"value",
"=",
"{",
"Exception",
".",
"class",
"}",
")",
"public",
"void",
"setSimpleDateFormat",
"(",
"String",
"formatString",
")",
"{",
"if",
"(",
"formatString",
"==",
"null",
")",
"{",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Null format string provided; date format will not be changed\"",
")",
";",
"}",
"return",
";",
"}",
"try",
"{",
"simpleDateFormat",
"=",
"new",
"SimpleDateFormat",
"(",
"formatString",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Exception caught setting date format: \"",
"+",
"e",
".",
"getMessage",
"(",
")",
")",
";",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Date format will not be changed\"",
")",
";",
"}",
"}",
"}"
] | Set the SimpleDateFormat string that should be used to format date strings created by this class.
@param formatString | [
"Set",
"the",
"SimpleDateFormat",
"string",
"that",
"should",
"be",
"used",
"to",
"format",
"date",
"strings",
"created",
"by",
"this",
"class",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.common/src/com/ibm/ws/security/common/time/TimeUtils.java#L43-L59 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/InboundVirtualConnectionImpl.java | InboundVirtualConnectionImpl.cleanUpMaybeDiscriminatorState | public void cleanUpMaybeDiscriminatorState() {
if (this.dp != null) {
Discriminator d;
Iterator<Discriminator> it = this.dp.getDiscriminators().iterator();
int i = 0;
while (it.hasNext()) {
d = it.next();
if (Discriminator.MAYBE == this.discStatus[i++]) {
d.cleanUpState(this);
}
}
}
} | java | public void cleanUpMaybeDiscriminatorState() {
if (this.dp != null) {
Discriminator d;
Iterator<Discriminator> it = this.dp.getDiscriminators().iterator();
int i = 0;
while (it.hasNext()) {
d = it.next();
if (Discriminator.MAYBE == this.discStatus[i++]) {
d.cleanUpState(this);
}
}
}
} | [
"public",
"void",
"cleanUpMaybeDiscriminatorState",
"(",
")",
"{",
"if",
"(",
"this",
".",
"dp",
"!=",
"null",
")",
"{",
"Discriminator",
"d",
";",
"Iterator",
"<",
"Discriminator",
">",
"it",
"=",
"this",
".",
"dp",
".",
"getDiscriminators",
"(",
")",
".",
"iterator",
"(",
")",
";",
"int",
"i",
"=",
"0",
";",
"while",
"(",
"it",
".",
"hasNext",
"(",
")",
")",
"{",
"d",
"=",
"it",
".",
"next",
"(",
")",
";",
"if",
"(",
"Discriminator",
".",
"MAYBE",
"==",
"this",
".",
"discStatus",
"[",
"i",
"++",
"]",
")",
"{",
"d",
".",
"cleanUpState",
"(",
"this",
")",
";",
"}",
"}",
"}",
"}"
] | Clean up potential state information left in this VC from any
of the discriminators in the group which resulted in MAYBE during
the discrimination process. | [
"Clean",
"up",
"potential",
"state",
"information",
"left",
"in",
"this",
"VC",
"from",
"any",
"of",
"the",
"discriminators",
"in",
"the",
"group",
"which",
"resulted",
"in",
"MAYBE",
"during",
"the",
"discrimination",
"process",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/InboundVirtualConnectionImpl.java#L92-L104 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/InboundVirtualConnectionImpl.java | InboundVirtualConnectionImpl.cleanUpAllDiscriminatorState | public void cleanUpAllDiscriminatorState() {
if (this.dp != null) {
Iterator<Discriminator> it = this.dp.getDiscriminators().iterator();
while (it.hasNext()) {
it.next().cleanUpState(this);
}
}
} | java | public void cleanUpAllDiscriminatorState() {
if (this.dp != null) {
Iterator<Discriminator> it = this.dp.getDiscriminators().iterator();
while (it.hasNext()) {
it.next().cleanUpState(this);
}
}
} | [
"public",
"void",
"cleanUpAllDiscriminatorState",
"(",
")",
"{",
"if",
"(",
"this",
".",
"dp",
"!=",
"null",
")",
"{",
"Iterator",
"<",
"Discriminator",
">",
"it",
"=",
"this",
".",
"dp",
".",
"getDiscriminators",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"it",
".",
"hasNext",
"(",
")",
")",
"{",
"it",
".",
"next",
"(",
")",
".",
"cleanUpState",
"(",
"this",
")",
";",
"}",
"}",
"}"
] | Clean up potential state information left in this VC from any
of the discriminators in the group. | [
"Clean",
"up",
"potential",
"state",
"information",
"left",
"in",
"this",
"VC",
"from",
"any",
"of",
"the",
"discriminators",
"in",
"the",
"group",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/InboundVirtualConnectionImpl.java#L110-L117 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/flow/cdi/FlowScopeBeanHolder.java | FlowScopeBeanHolder.getContextualStorage | public ContextualStorage getContextualStorage(BeanManager beanManager, String flowClientWindowId)
{
ContextualStorage contextualStorage = storageMap.get(flowClientWindowId);
if (contextualStorage == null)
{
synchronized (this)
{
contextualStorage = storageMap.get(flowClientWindowId);
if (contextualStorage == null)
{
contextualStorage = new ContextualStorage(beanManager, true, true);
storageMap.put(flowClientWindowId, contextualStorage);
}
}
}
return contextualStorage;
} | java | public ContextualStorage getContextualStorage(BeanManager beanManager, String flowClientWindowId)
{
ContextualStorage contextualStorage = storageMap.get(flowClientWindowId);
if (contextualStorage == null)
{
synchronized (this)
{
contextualStorage = storageMap.get(flowClientWindowId);
if (contextualStorage == null)
{
contextualStorage = new ContextualStorage(beanManager, true, true);
storageMap.put(flowClientWindowId, contextualStorage);
}
}
}
return contextualStorage;
} | [
"public",
"ContextualStorage",
"getContextualStorage",
"(",
"BeanManager",
"beanManager",
",",
"String",
"flowClientWindowId",
")",
"{",
"ContextualStorage",
"contextualStorage",
"=",
"storageMap",
".",
"get",
"(",
"flowClientWindowId",
")",
";",
"if",
"(",
"contextualStorage",
"==",
"null",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"contextualStorage",
"=",
"storageMap",
".",
"get",
"(",
"flowClientWindowId",
")",
";",
"if",
"(",
"contextualStorage",
"==",
"null",
")",
"{",
"contextualStorage",
"=",
"new",
"ContextualStorage",
"(",
"beanManager",
",",
"true",
",",
"true",
")",
";",
"storageMap",
".",
"put",
"(",
"flowClientWindowId",
",",
"contextualStorage",
")",
";",
"}",
"}",
"}",
"return",
"contextualStorage",
";",
"}"
] | This method will return the ContextualStorage or create a new one
if no one is yet assigned to the current flowClientWindowId.
@param beanManager we need the CDI {@link BeanManager} for serialisation.
@param flowClientWindowId the flowClientWindowId for the current flow. | [
"This",
"method",
"will",
"return",
"the",
"ContextualStorage",
"or",
"create",
"a",
"new",
"one",
"if",
"no",
"one",
"is",
"yet",
"assigned",
"to",
"the",
"current",
"flowClientWindowId",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/flow/cdi/FlowScopeBeanHolder.java#L104-L121 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/flow/cdi/FlowScopeBeanHolder.java | FlowScopeBeanHolder.destroyBeansOnPreDestroy | @PreDestroy
public void destroyBeansOnPreDestroy()
{
Map<String, ContextualStorage> oldWindowContextStorages = forceNewStorage();
if (!oldWindowContextStorages.isEmpty())
{
FacesContext facesContext = FacesContext.getCurrentInstance();
ServletContext servletContext = null;
if (facesContext == null)
{
try
{
servletContext = applicationContextBean.getServletContext();
}
catch (Throwable e)
{
Logger.getLogger(FlowScopeBeanHolder.class.getName()).log(Level.WARNING,
"Cannot locate servletContext to create FacesContext on @PreDestroy flow scope beans. "
+ "The beans will be destroyed without active FacesContext instance.");
servletContext = null;
}
}
if (facesContext == null &&
servletContext != null)
{
try
{
ExternalContext externalContext = new StartupServletExternalContextImpl(servletContext, false);
ExceptionHandler exceptionHandler = new ExceptionHandlerImpl();
facesContext = new StartupFacesContextImpl(externalContext,
(ReleaseableExternalContext) externalContext, exceptionHandler, false);
for (ContextualStorage contextualStorage : oldWindowContextStorages.values())
{
FlowScopedContextImpl.destroyAllActive(contextualStorage);
}
}
finally
{
facesContext.release();
}
}
else
{
for (ContextualStorage contextualStorage : oldWindowContextStorages.values())
{
FlowScopedContextImpl.destroyAllActive(contextualStorage);
}
}
}
} | java | @PreDestroy
public void destroyBeansOnPreDestroy()
{
Map<String, ContextualStorage> oldWindowContextStorages = forceNewStorage();
if (!oldWindowContextStorages.isEmpty())
{
FacesContext facesContext = FacesContext.getCurrentInstance();
ServletContext servletContext = null;
if (facesContext == null)
{
try
{
servletContext = applicationContextBean.getServletContext();
}
catch (Throwable e)
{
Logger.getLogger(FlowScopeBeanHolder.class.getName()).log(Level.WARNING,
"Cannot locate servletContext to create FacesContext on @PreDestroy flow scope beans. "
+ "The beans will be destroyed without active FacesContext instance.");
servletContext = null;
}
}
if (facesContext == null &&
servletContext != null)
{
try
{
ExternalContext externalContext = new StartupServletExternalContextImpl(servletContext, false);
ExceptionHandler exceptionHandler = new ExceptionHandlerImpl();
facesContext = new StartupFacesContextImpl(externalContext,
(ReleaseableExternalContext) externalContext, exceptionHandler, false);
for (ContextualStorage contextualStorage : oldWindowContextStorages.values())
{
FlowScopedContextImpl.destroyAllActive(contextualStorage);
}
}
finally
{
facesContext.release();
}
}
else
{
for (ContextualStorage contextualStorage : oldWindowContextStorages.values())
{
FlowScopedContextImpl.destroyAllActive(contextualStorage);
}
}
}
} | [
"@",
"PreDestroy",
"public",
"void",
"destroyBeansOnPreDestroy",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"ContextualStorage",
">",
"oldWindowContextStorages",
"=",
"forceNewStorage",
"(",
")",
";",
"if",
"(",
"!",
"oldWindowContextStorages",
".",
"isEmpty",
"(",
")",
")",
"{",
"FacesContext",
"facesContext",
"=",
"FacesContext",
".",
"getCurrentInstance",
"(",
")",
";",
"ServletContext",
"servletContext",
"=",
"null",
";",
"if",
"(",
"facesContext",
"==",
"null",
")",
"{",
"try",
"{",
"servletContext",
"=",
"applicationContextBean",
".",
"getServletContext",
"(",
")",
";",
"}",
"catch",
"(",
"Throwable",
"e",
")",
"{",
"Logger",
".",
"getLogger",
"(",
"FlowScopeBeanHolder",
".",
"class",
".",
"getName",
"(",
")",
")",
".",
"log",
"(",
"Level",
".",
"WARNING",
",",
"\"Cannot locate servletContext to create FacesContext on @PreDestroy flow scope beans. \"",
"+",
"\"The beans will be destroyed without active FacesContext instance.\"",
")",
";",
"servletContext",
"=",
"null",
";",
"}",
"}",
"if",
"(",
"facesContext",
"==",
"null",
"&&",
"servletContext",
"!=",
"null",
")",
"{",
"try",
"{",
"ExternalContext",
"externalContext",
"=",
"new",
"StartupServletExternalContextImpl",
"(",
"servletContext",
",",
"false",
")",
";",
"ExceptionHandler",
"exceptionHandler",
"=",
"new",
"ExceptionHandlerImpl",
"(",
")",
";",
"facesContext",
"=",
"new",
"StartupFacesContextImpl",
"(",
"externalContext",
",",
"(",
"ReleaseableExternalContext",
")",
"externalContext",
",",
"exceptionHandler",
",",
"false",
")",
";",
"for",
"(",
"ContextualStorage",
"contextualStorage",
":",
"oldWindowContextStorages",
".",
"values",
"(",
")",
")",
"{",
"FlowScopedContextImpl",
".",
"destroyAllActive",
"(",
"contextualStorage",
")",
";",
"}",
"}",
"finally",
"{",
"facesContext",
".",
"release",
"(",
")",
";",
"}",
"}",
"else",
"{",
"for",
"(",
"ContextualStorage",
"contextualStorage",
":",
"oldWindowContextStorages",
".",
"values",
"(",
")",
")",
"{",
"FlowScopedContextImpl",
".",
"destroyAllActive",
"(",
"contextualStorage",
")",
";",
"}",
"}",
"}",
"}"
] | See description on ViewScopeBeanHolder for details about how this works | [
"See",
"description",
"on",
"ViewScopeBeanHolder",
"for",
"details",
"about",
"how",
"this",
"works"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/flow/cdi/FlowScopeBeanHolder.java#L210-L259 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/IncidentStreamImpl.java | IncidentStreamImpl.printValueIntro | private void printValueIntro(String text) {
if (text != null) {
ffdcLog.print(text);
ffdcLog.print(EQUALS);
}
} | java | private void printValueIntro(String text) {
if (text != null) {
ffdcLog.print(text);
ffdcLog.print(EQUALS);
}
} | [
"private",
"void",
"printValueIntro",
"(",
"String",
"text",
")",
"{",
"if",
"(",
"text",
"!=",
"null",
")",
"{",
"ffdcLog",
".",
"print",
"(",
"text",
")",
";",
"ffdcLog",
".",
"print",
"(",
"EQUALS",
")",
";",
"}",
"}"
] | Print the introductory text for a value
@param text
The introductory text (null if there is to be no intro) | [
"Print",
"the",
"introductory",
"text",
"for",
"a",
"value"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/IncidentStreamImpl.java#L297-L302 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/CookieHelper.java | CookieHelper.getCookieValue | @Sensitive
public static String getCookieValue(Cookie[] cookies, String cookieName) {
if (cookies == null) {
return null;
}
String retVal = null;
for (int i = 0; i < cookies.length; ++i) {
if (cookieName.equalsIgnoreCase(cookies[i].getName())) {
retVal = cookies[i].getValue();
break;
}
}
return retVal;
} | java | @Sensitive
public static String getCookieValue(Cookie[] cookies, String cookieName) {
if (cookies == null) {
return null;
}
String retVal = null;
for (int i = 0; i < cookies.length; ++i) {
if (cookieName.equalsIgnoreCase(cookies[i].getName())) {
retVal = cookies[i].getValue();
break;
}
}
return retVal;
} | [
"@",
"Sensitive",
"public",
"static",
"String",
"getCookieValue",
"(",
"Cookie",
"[",
"]",
"cookies",
",",
"String",
"cookieName",
")",
"{",
"if",
"(",
"cookies",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"String",
"retVal",
"=",
"null",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"cookies",
".",
"length",
";",
"++",
"i",
")",
"{",
"if",
"(",
"cookieName",
".",
"equalsIgnoreCase",
"(",
"cookies",
"[",
"i",
"]",
".",
"getName",
"(",
")",
")",
")",
"{",
"retVal",
"=",
"cookies",
"[",
"i",
"]",
".",
"getValue",
"(",
")",
";",
"break",
";",
"}",
"}",
"return",
"retVal",
";",
"}"
] | Retrieve the value of the first instance of the specified Cookie name
from the array of Cookies. Note name matching ignores case.
@param cookies array of Cookie objects, may be {@code null}.
@param cookieName the name of the cookie
@return String value associated with the specified cookieName, {@code null} if no match could not be found. | [
"Retrieve",
"the",
"value",
"of",
"the",
"first",
"instance",
"of",
"the",
"specified",
"Cookie",
"name",
"from",
"the",
"array",
"of",
"Cookies",
".",
"Note",
"name",
"matching",
"ignores",
"case",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/CookieHelper.java#L39-L54 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/CookieHelper.java | CookieHelper.getCookieValues | public static String[] getCookieValues(Cookie[] cookies, String cookieName) {
if (cookies == null) {
return null;
}
Vector<String> retValues = new Vector<String>();
for (int i = 0; i < cookies.length; ++i) {
if (cookieName.equalsIgnoreCase(cookies[i].getName())) {
retValues.add(cookies[i].getValue());
}
}
if (retValues.size() > 0) {
return retValues.toArray(new String[retValues.size()]);
} else {
return null;
}
} | java | public static String[] getCookieValues(Cookie[] cookies, String cookieName) {
if (cookies == null) {
return null;
}
Vector<String> retValues = new Vector<String>();
for (int i = 0; i < cookies.length; ++i) {
if (cookieName.equalsIgnoreCase(cookies[i].getName())) {
retValues.add(cookies[i].getValue());
}
}
if (retValues.size() > 0) {
return retValues.toArray(new String[retValues.size()]);
} else {
return null;
}
} | [
"public",
"static",
"String",
"[",
"]",
"getCookieValues",
"(",
"Cookie",
"[",
"]",
"cookies",
",",
"String",
"cookieName",
")",
"{",
"if",
"(",
"cookies",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Vector",
"<",
"String",
">",
"retValues",
"=",
"new",
"Vector",
"<",
"String",
">",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"cookies",
".",
"length",
";",
"++",
"i",
")",
"{",
"if",
"(",
"cookieName",
".",
"equalsIgnoreCase",
"(",
"cookies",
"[",
"i",
"]",
".",
"getName",
"(",
")",
")",
")",
"{",
"retValues",
".",
"add",
"(",
"cookies",
"[",
"i",
"]",
".",
"getValue",
"(",
")",
")",
";",
"}",
"}",
"if",
"(",
"retValues",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"return",
"retValues",
".",
"toArray",
"(",
"new",
"String",
"[",
"retValues",
".",
"size",
"(",
")",
"]",
")",
";",
"}",
"else",
"{",
"return",
"null",
";",
"}",
"}"
] | Retrieve the value of the all instances of the specified Cookie name
from the array of Cookies. Note name matching ignores case.
@param cookies array of Cookie objects, may be {@code null}.
@param cookieName the name of the cookie
@return String[] of the values associated with the specified cookieName, {@code null} if no match could not be found. | [
"Retrieve",
"the",
"value",
"of",
"the",
"all",
"instances",
"of",
"the",
"specified",
"Cookie",
"name",
"from",
"the",
"array",
"of",
"Cookies",
".",
"Note",
"name",
"matching",
"ignores",
"case",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/CookieHelper.java#L64-L81 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/CookieHelper.java | CookieHelper.addCookiesToResponse | public static void addCookiesToResponse(List<Cookie> cookieList, HttpServletResponse resp) {
Iterator<Cookie> iterator = cookieList.listIterator();
while (iterator.hasNext()) {
Cookie cookie = iterator.next();
if (cookie != null) {
resp.addCookie(cookie);
}
}
} | java | public static void addCookiesToResponse(List<Cookie> cookieList, HttpServletResponse resp) {
Iterator<Cookie> iterator = cookieList.listIterator();
while (iterator.hasNext()) {
Cookie cookie = iterator.next();
if (cookie != null) {
resp.addCookie(cookie);
}
}
} | [
"public",
"static",
"void",
"addCookiesToResponse",
"(",
"List",
"<",
"Cookie",
">",
"cookieList",
",",
"HttpServletResponse",
"resp",
")",
"{",
"Iterator",
"<",
"Cookie",
">",
"iterator",
"=",
"cookieList",
".",
"listIterator",
"(",
")",
";",
"while",
"(",
"iterator",
".",
"hasNext",
"(",
")",
")",
"{",
"Cookie",
"cookie",
"=",
"iterator",
".",
"next",
"(",
")",
";",
"if",
"(",
"cookie",
"!=",
"null",
")",
"{",
"resp",
".",
"addCookie",
"(",
"cookie",
")",
";",
"}",
"}",
"}"
] | Given a list of Cookie objects, set them into the HttpServletResponse.
This method does not alter the cookies in any way.
@param cookieList A List of Cookie objects
@param resp HttpServletResponse into which to set the cookie | [
"Given",
"a",
"list",
"of",
"Cookie",
"objects",
"set",
"them",
"into",
"the",
"HttpServletResponse",
".",
"This",
"method",
"does",
"not",
"alter",
"the",
"cookies",
"in",
"any",
"way",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/CookieHelper.java#L90-L98 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.osgi/src/com/ibm/ws/logging/internal/osgi/MessageRouterImpl.java | MessageRouterImpl.setLogHandler | public void setLogHandler(String id, LogHandler ref) {
if (id != null && ref != null) {
logHandlerServices.put(id, ref);
}
} | java | public void setLogHandler(String id, LogHandler ref) {
if (id != null && ref != null) {
logHandlerServices.put(id, ref);
}
} | [
"public",
"void",
"setLogHandler",
"(",
"String",
"id",
",",
"LogHandler",
"ref",
")",
"{",
"if",
"(",
"id",
"!=",
"null",
"&&",
"ref",
"!=",
"null",
")",
"{",
"logHandlerServices",
".",
"put",
"(",
"id",
",",
"ref",
")",
";",
"}",
"}"
] | Add the LogHandler ref. 1 or more LogHandlers may be set. | [
"Add",
"the",
"LogHandler",
"ref",
".",
"1",
"or",
"more",
"LogHandlers",
"may",
"be",
"set",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.osgi/src/com/ibm/ws/logging/internal/osgi/MessageRouterImpl.java#L50-L54 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.osgi/src/com/ibm/ws/logging/internal/osgi/MessageRouterImpl.java | MessageRouterImpl.modified | public synchronized void modified(Properties props) {
for (Object key : props.keySet()) {
String msgId = (String) key;
String logHandlerIds = props.getProperty(msgId);
Set<String> logHandlerIdSet = getOrCreateLogHandlerIdSet(msgId);
// "logHandlerIds" is a comma-separated list of LogHandlers IDs. Each LogHandler ID
// may contain a +/- char in front, to indicate that the LogHandler should be
// added/removed to/from the list for this msgId. If the +/- is not specified,
// assume +.
for (String id : split(logHandlerIds, ",")) {
// Protect against bad input, such as empty IDs.
id = id.trim();
if (id.length() > 0) {
// Check for the +/- in first char.
char plusOrMinus = id.charAt(0);
if (plusOrMinus != '+' && plusOrMinus != '-') {
plusOrMinus = '+'; // + by default.
} else {
id = id.substring(1); // skip over the +/-.
}
// Make sure there's still something left after stripping off the +/-.
if (id.length() > 0) {
if (plusOrMinus == '+') {
logHandlerIdSet.add(id);
} else {
// '-' means remove.
logHandlerIdSet.remove(id);
}
}
}
}
if (logHandlerIdSet.size() == 1 && logHandlerIdSet.contains("DEFAULT")) {
// No entries (other than default) for this msgId. Remove it from the map.
msgIdToLogHandlerIds.remove(msgId);
}
}
} | java | public synchronized void modified(Properties props) {
for (Object key : props.keySet()) {
String msgId = (String) key;
String logHandlerIds = props.getProperty(msgId);
Set<String> logHandlerIdSet = getOrCreateLogHandlerIdSet(msgId);
// "logHandlerIds" is a comma-separated list of LogHandlers IDs. Each LogHandler ID
// may contain a +/- char in front, to indicate that the LogHandler should be
// added/removed to/from the list for this msgId. If the +/- is not specified,
// assume +.
for (String id : split(logHandlerIds, ",")) {
// Protect against bad input, such as empty IDs.
id = id.trim();
if (id.length() > 0) {
// Check for the +/- in first char.
char plusOrMinus = id.charAt(0);
if (plusOrMinus != '+' && plusOrMinus != '-') {
plusOrMinus = '+'; // + by default.
} else {
id = id.substring(1); // skip over the +/-.
}
// Make sure there's still something left after stripping off the +/-.
if (id.length() > 0) {
if (plusOrMinus == '+') {
logHandlerIdSet.add(id);
} else {
// '-' means remove.
logHandlerIdSet.remove(id);
}
}
}
}
if (logHandlerIdSet.size() == 1 && logHandlerIdSet.contains("DEFAULT")) {
// No entries (other than default) for this msgId. Remove it from the map.
msgIdToLogHandlerIds.remove(msgId);
}
}
} | [
"public",
"synchronized",
"void",
"modified",
"(",
"Properties",
"props",
")",
"{",
"for",
"(",
"Object",
"key",
":",
"props",
".",
"keySet",
"(",
")",
")",
"{",
"String",
"msgId",
"=",
"(",
"String",
")",
"key",
";",
"String",
"logHandlerIds",
"=",
"props",
".",
"getProperty",
"(",
"msgId",
")",
";",
"Set",
"<",
"String",
">",
"logHandlerIdSet",
"=",
"getOrCreateLogHandlerIdSet",
"(",
"msgId",
")",
";",
"// \"logHandlerIds\" is a comma-separated list of LogHandlers IDs. Each LogHandler ID",
"// may contain a +/- char in front, to indicate that the LogHandler should be ",
"// added/removed to/from the list for this msgId. If the +/- is not specified, ",
"// assume +.",
"for",
"(",
"String",
"id",
":",
"split",
"(",
"logHandlerIds",
",",
"\",\"",
")",
")",
"{",
"// Protect against bad input, such as empty IDs.",
"id",
"=",
"id",
".",
"trim",
"(",
")",
";",
"if",
"(",
"id",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"// Check for the +/- in first char.",
"char",
"plusOrMinus",
"=",
"id",
".",
"charAt",
"(",
"0",
")",
";",
"if",
"(",
"plusOrMinus",
"!=",
"'",
"'",
"&&",
"plusOrMinus",
"!=",
"'",
"'",
")",
"{",
"plusOrMinus",
"=",
"'",
"'",
";",
"// + by default.",
"}",
"else",
"{",
"id",
"=",
"id",
".",
"substring",
"(",
"1",
")",
";",
"// skip over the +/-.",
"}",
"// Make sure there's still something left after stripping off the +/-.",
"if",
"(",
"id",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"if",
"(",
"plusOrMinus",
"==",
"'",
"'",
")",
"{",
"logHandlerIdSet",
".",
"add",
"(",
"id",
")",
";",
"}",
"else",
"{",
"// '-' means remove.",
"logHandlerIdSet",
".",
"remove",
"(",
"id",
")",
";",
"}",
"}",
"}",
"}",
"if",
"(",
"logHandlerIdSet",
".",
"size",
"(",
")",
"==",
"1",
"&&",
"logHandlerIdSet",
".",
"contains",
"(",
"\"DEFAULT\"",
")",
")",
"{",
"// No entries (other than default) for this msgId. Remove it from the map.",
"msgIdToLogHandlerIds",
".",
"remove",
"(",
"msgId",
")",
";",
"}",
"}",
"}"
] | Process the MessageRouter.properties file contents, given by the Properties parm.
A typical MessageRouter.properties entry looks like this:
CWWKF0008I=+WTO,+HARDCOPY,-DEFAULT
The property key is a msg ID. The property value is a list of LogHandler IDs.
The +/- indicates whether to add or remove the LogHandler to/from the set of
LogHandlers that will receive messages with the given msg ID.
A LogHandler ID represents the "id" property for a LogHandler ServiceReference.
"DEFAULT" is a special LogHandler ID. It does not represent (and cannot be used for)
a LogHandler ServiceReference "id" property. Instead it indicates whether or not
the message should be logged by the normal logging mechanisms (i.e. console.log).
By default, all messages are logged normally (in addition to whatever LogHandlers
are specified in the properties file). The only way to prevent a message from being
logged normally is to specify "-DEFAULT" for the message in the properties file.
This method updates both the msgIdToLogHandlerIdSet map and the set of LogHandlerIds
for each msgId, therefore it is synchronized. Both the map and the set are implemented
using classes from the java.util.concurrent package, to allow for concurrent read
access to the map/set without blocking.
@param props The contents of the MessageRouter.properties file. | [
"Process",
"the",
"MessageRouter",
".",
"properties",
"file",
"contents",
"given",
"by",
"the",
"Properties",
"parm",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.osgi/src/com/ibm/ws/logging/internal/osgi/MessageRouterImpl.java#L123-L165 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.osgi/src/com/ibm/ws/logging/internal/osgi/MessageRouterImpl.java | MessageRouterImpl.addMsgToLogHandler | protected void addMsgToLogHandler(String msgId, String handlerId) {
Set<String> logHandlerIdSet = getOrCreateLogHandlerIdSet(msgId);
logHandlerIdSet.add(handlerId);
} | java | protected void addMsgToLogHandler(String msgId, String handlerId) {
Set<String> logHandlerIdSet = getOrCreateLogHandlerIdSet(msgId);
logHandlerIdSet.add(handlerId);
} | [
"protected",
"void",
"addMsgToLogHandler",
"(",
"String",
"msgId",
",",
"String",
"handlerId",
")",
"{",
"Set",
"<",
"String",
">",
"logHandlerIdSet",
"=",
"getOrCreateLogHandlerIdSet",
"(",
"msgId",
")",
";",
"logHandlerIdSet",
".",
"add",
"(",
"handlerId",
")",
";",
"}"
] | Add the specified log handler to the message ID's routing list. | [
"Add",
"the",
"specified",
"log",
"handler",
"to",
"the",
"message",
"ID",
"s",
"routing",
"list",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.osgi/src/com/ibm/ws/logging/internal/osgi/MessageRouterImpl.java#L170-L173 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.osgi/src/com/ibm/ws/logging/internal/osgi/MessageRouterImpl.java | MessageRouterImpl.removeMsgFromLogHandler | protected void removeMsgFromLogHandler(String msgId, String handlerId) {
Set<String> logHandlerIdSet = getOrCreateLogHandlerIdSet(msgId);
logHandlerIdSet.remove(handlerId);
} | java | protected void removeMsgFromLogHandler(String msgId, String handlerId) {
Set<String> logHandlerIdSet = getOrCreateLogHandlerIdSet(msgId);
logHandlerIdSet.remove(handlerId);
} | [
"protected",
"void",
"removeMsgFromLogHandler",
"(",
"String",
"msgId",
",",
"String",
"handlerId",
")",
"{",
"Set",
"<",
"String",
">",
"logHandlerIdSet",
"=",
"getOrCreateLogHandlerIdSet",
"(",
"msgId",
")",
";",
"logHandlerIdSet",
".",
"remove",
"(",
"handlerId",
")",
";",
"}"
] | Remove the specified log handler from the message ID's routing list. | [
"Remove",
"the",
"specified",
"log",
"handler",
"from",
"the",
"message",
"ID",
"s",
"routing",
"list",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.osgi/src/com/ibm/ws/logging/internal/osgi/MessageRouterImpl.java#L178-L181 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/security/csiv2/config/ssl/SSLConfig.java | SSLConfig.filter | private String[] filter(String[] candidateCipherSuites, String[] requested, OptionsKey options) {
List<String> candidates = Arrays.asList(candidateCipherSuites);
EnumSet<Options> supports = toOptions(options.supports, true);
EnumSet<Options> requires = toOptions(options.requires, false);
List<String> result = new ArrayList<String>(requested.length);
for (String choice : requested) {
if (!matches(supports, requires, choice)) {
Tr.warning(tc, "CSIv2_COMMON_CIPHER_SUITE_MISMATCH", choice, getOptions(choice), supports, requires);
}
if (candidates.contains(choice)) {
result.add(choice);
}
}
return result.toArray(new String[result.size()]);
} | java | private String[] filter(String[] candidateCipherSuites, String[] requested, OptionsKey options) {
List<String> candidates = Arrays.asList(candidateCipherSuites);
EnumSet<Options> supports = toOptions(options.supports, true);
EnumSet<Options> requires = toOptions(options.requires, false);
List<String> result = new ArrayList<String>(requested.length);
for (String choice : requested) {
if (!matches(supports, requires, choice)) {
Tr.warning(tc, "CSIv2_COMMON_CIPHER_SUITE_MISMATCH", choice, getOptions(choice), supports, requires);
}
if (candidates.contains(choice)) {
result.add(choice);
}
}
return result.toArray(new String[result.size()]);
} | [
"private",
"String",
"[",
"]",
"filter",
"(",
"String",
"[",
"]",
"candidateCipherSuites",
",",
"String",
"[",
"]",
"requested",
",",
"OptionsKey",
"options",
")",
"{",
"List",
"<",
"String",
">",
"candidates",
"=",
"Arrays",
".",
"asList",
"(",
"candidateCipherSuites",
")",
";",
"EnumSet",
"<",
"Options",
">",
"supports",
"=",
"toOptions",
"(",
"options",
".",
"supports",
",",
"true",
")",
";",
"EnumSet",
"<",
"Options",
">",
"requires",
"=",
"toOptions",
"(",
"options",
".",
"requires",
",",
"false",
")",
";",
"List",
"<",
"String",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
"requested",
".",
"length",
")",
";",
"for",
"(",
"String",
"choice",
":",
"requested",
")",
"{",
"if",
"(",
"!",
"matches",
"(",
"supports",
",",
"requires",
",",
"choice",
")",
")",
"{",
"Tr",
".",
"warning",
"(",
"tc",
",",
"\"CSIv2_COMMON_CIPHER_SUITE_MISMATCH\"",
",",
"choice",
",",
"getOptions",
"(",
"choice",
")",
",",
"supports",
",",
"requires",
")",
";",
"}",
"if",
"(",
"candidates",
".",
"contains",
"(",
"choice",
")",
")",
"{",
"result",
".",
"add",
"(",
"choice",
")",
";",
"}",
"}",
"return",
"result",
".",
"toArray",
"(",
"new",
"String",
"[",
"result",
".",
"size",
"(",
")",
"]",
")",
";",
"}"
] | This method will warn if any requested cipher suites appear to not match the options
@param candidateCipherSuites locally supported cipher suites
@param requested cipher suites explicitly configured
@param options association options configured
@return intersection of candidates and requested | [
"This",
"method",
"will",
"warn",
"if",
"any",
"requested",
"cipher",
"suites",
"appear",
"to",
"not",
"match",
"the",
"options"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/security/csiv2/config/ssl/SSLConfig.java#L119-L133 | train |
OpenLiberty/open-liberty | dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/controller/impl/BaseStepControllerImpl.java | BaseStepControllerImpl.markStepForFailure | protected void markStepForFailure() {
StopLock stopLock = getStopLock(); // Store in local variable to facilitate Ctrl+Shift+G search in Eclipse
synchronized (stopLock) {
updateStepBatchStatus(BatchStatus.FAILED);
if (!issuedFailureMessageToJobLog) {
stepThreadHelper.logFailedMessage();
issuedFailureMessageToJobLog = true;
}
}
} | java | protected void markStepForFailure() {
StopLock stopLock = getStopLock(); // Store in local variable to facilitate Ctrl+Shift+G search in Eclipse
synchronized (stopLock) {
updateStepBatchStatus(BatchStatus.FAILED);
if (!issuedFailureMessageToJobLog) {
stepThreadHelper.logFailedMessage();
issuedFailureMessageToJobLog = true;
}
}
} | [
"protected",
"void",
"markStepForFailure",
"(",
")",
"{",
"StopLock",
"stopLock",
"=",
"getStopLock",
"(",
")",
";",
"// Store in local variable to facilitate Ctrl+Shift+G search in Eclipse",
"synchronized",
"(",
"stopLock",
")",
"{",
"updateStepBatchStatus",
"(",
"BatchStatus",
".",
"FAILED",
")",
";",
"if",
"(",
"!",
"issuedFailureMessageToJobLog",
")",
"{",
"stepThreadHelper",
".",
"logFailedMessage",
"(",
")",
";",
"issuedFailureMessageToJobLog",
"=",
"true",
";",
"}",
"}",
"}"
] | Updates in-memory status and issues message to job log, but does not persist final status.
Possible this routine gets called more than once, e.g. we might fail during normal step
execution, then also fail in afterStep(). | [
"Updates",
"in",
"-",
"memory",
"status",
"and",
"issues",
"message",
"to",
"job",
"log",
"but",
"does",
"not",
"persist",
"final",
"status",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/controller/impl/BaseStepControllerImpl.java#L426-L435 | train |
OpenLiberty/open-liberty | dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/controller/impl/BaseStepControllerImpl.java | BaseStepControllerImpl.wasStopIssuedOnJob | protected boolean wasStopIssuedOnJob() {
StopLock stopLock = getStopLock(); // Store in local variable to facilitate Ctrl+Shift+G search in Eclipse
synchronized (stopLock) {
if (runtimeWorkUnitExecution.getBatchStatus().equals(BatchStatus.STOPPING)) {
return true;
} else {
return false;
}
}
} | java | protected boolean wasStopIssuedOnJob() {
StopLock stopLock = getStopLock(); // Store in local variable to facilitate Ctrl+Shift+G search in Eclipse
synchronized (stopLock) {
if (runtimeWorkUnitExecution.getBatchStatus().equals(BatchStatus.STOPPING)) {
return true;
} else {
return false;
}
}
} | [
"protected",
"boolean",
"wasStopIssuedOnJob",
"(",
")",
"{",
"StopLock",
"stopLock",
"=",
"getStopLock",
"(",
")",
";",
"// Store in local variable to facilitate Ctrl+Shift+G search in Eclipse",
"synchronized",
"(",
"stopLock",
")",
"{",
"if",
"(",
"runtimeWorkUnitExecution",
".",
"getBatchStatus",
"(",
")",
".",
"equals",
"(",
"BatchStatus",
".",
"STOPPING",
")",
")",
"{",
"return",
"true",
";",
"}",
"else",
"{",
"return",
"false",
";",
"}",
"}",
"}"
] | We need this because the stop can come in at the job level, while the step-level constructs
are still getting set up.
@return true if jobexecution is STOPPING. | [
"We",
"need",
"this",
"because",
"the",
"stop",
"can",
"come",
"in",
"at",
"the",
"job",
"level",
"while",
"the",
"step",
"-",
"level",
"constructs",
"are",
"still",
"getting",
"set",
"up",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/controller/impl/BaseStepControllerImpl.java#L523-L532 | train |
OpenLiberty/open-liberty | dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/controller/impl/BaseStepControllerImpl.java | BaseStepControllerImpl.createStepExecutionIfStepShouldBeExecuted | protected StepThreadExecutionEntity createStepExecutionIfStepShouldBeExecuted() throws DoNotRestartStepThreadException {
StepThreadExecutionEntity newStepExecution = null;
StepThreadInstanceKey stepThreadInstanceKey = getStepThreadInstanceKey();
stepThreadInstance = getPersistenceManagerService().getStepThreadInstance(stepThreadInstanceKey);
// Note that for a partition thread, we're assuming we won't find a partition-level step thread instance
// in the case that the top-level step is restarting after completing (i.e. in the allow-start-if-complete="true" case).
// We assume that something at the top-level will remove these step thread instances so that we don't see them.
if (stepThreadInstance == null) {
logger.finer("No existing step instance found. Create new step execution and proceed to execution.");
newStepExecution = stepThreadHelper.createStepThreadInstanceAndFirstExecution(stepThreadInstanceKey, runtimeWorkUnitExecution.isRemotePartitionDispatch());
stepThreadInstance = getPersistenceManagerService().getStepThreadInstance(stepThreadInstanceKey);
if (stepThreadInstance == null) {
throw new IllegalStateException("Should have just created step thread instance.");
}
} else {
logger.finer("Existing step instance found.");
newStepExecution = stepThreadHelper.setupStepThreadExecutionForRestartIfNecessary(runtimeWorkUnitExecution.isRemotePartitionDispatch());
}
return newStepExecution;
} | java | protected StepThreadExecutionEntity createStepExecutionIfStepShouldBeExecuted() throws DoNotRestartStepThreadException {
StepThreadExecutionEntity newStepExecution = null;
StepThreadInstanceKey stepThreadInstanceKey = getStepThreadInstanceKey();
stepThreadInstance = getPersistenceManagerService().getStepThreadInstance(stepThreadInstanceKey);
// Note that for a partition thread, we're assuming we won't find a partition-level step thread instance
// in the case that the top-level step is restarting after completing (i.e. in the allow-start-if-complete="true" case).
// We assume that something at the top-level will remove these step thread instances so that we don't see them.
if (stepThreadInstance == null) {
logger.finer("No existing step instance found. Create new step execution and proceed to execution.");
newStepExecution = stepThreadHelper.createStepThreadInstanceAndFirstExecution(stepThreadInstanceKey, runtimeWorkUnitExecution.isRemotePartitionDispatch());
stepThreadInstance = getPersistenceManagerService().getStepThreadInstance(stepThreadInstanceKey);
if (stepThreadInstance == null) {
throw new IllegalStateException("Should have just created step thread instance.");
}
} else {
logger.finer("Existing step instance found.");
newStepExecution = stepThreadHelper.setupStepThreadExecutionForRestartIfNecessary(runtimeWorkUnitExecution.isRemotePartitionDispatch());
}
return newStepExecution;
} | [
"protected",
"StepThreadExecutionEntity",
"createStepExecutionIfStepShouldBeExecuted",
"(",
")",
"throws",
"DoNotRestartStepThreadException",
"{",
"StepThreadExecutionEntity",
"newStepExecution",
"=",
"null",
";",
"StepThreadInstanceKey",
"stepThreadInstanceKey",
"=",
"getStepThreadInstanceKey",
"(",
")",
";",
"stepThreadInstance",
"=",
"getPersistenceManagerService",
"(",
")",
".",
"getStepThreadInstance",
"(",
"stepThreadInstanceKey",
")",
";",
"// Note that for a partition thread, we're assuming we won't find a partition-level step thread instance",
"// in the case that the top-level step is restarting after completing (i.e. in the allow-start-if-complete=\"true\" case).",
"// We assume that something at the top-level will remove these step thread instances so that we don't see them.",
"if",
"(",
"stepThreadInstance",
"==",
"null",
")",
"{",
"logger",
".",
"finer",
"(",
"\"No existing step instance found. Create new step execution and proceed to execution.\"",
")",
";",
"newStepExecution",
"=",
"stepThreadHelper",
".",
"createStepThreadInstanceAndFirstExecution",
"(",
"stepThreadInstanceKey",
",",
"runtimeWorkUnitExecution",
".",
"isRemotePartitionDispatch",
"(",
")",
")",
";",
"stepThreadInstance",
"=",
"getPersistenceManagerService",
"(",
")",
".",
"getStepThreadInstance",
"(",
"stepThreadInstanceKey",
")",
";",
"if",
"(",
"stepThreadInstance",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Should have just created step thread instance.\"",
")",
";",
"}",
"}",
"else",
"{",
"logger",
".",
"finer",
"(",
"\"Existing step instance found.\"",
")",
";",
"newStepExecution",
"=",
"stepThreadHelper",
".",
"setupStepThreadExecutionForRestartIfNecessary",
"(",
"runtimeWorkUnitExecution",
".",
"isRemotePartitionDispatch",
"(",
")",
")",
";",
"}",
"return",
"newStepExecution",
";",
"}"
] | stepThreadInstance and stepThreadExecution are either retrieved from the DB,
or if they don't exist yet, they're created.
@return stepThreadExecution | [
"stepThreadInstance",
"and",
"stepThreadExecution",
"are",
"either",
"retrieved",
"from",
"the",
"DB",
"or",
"if",
"they",
"don",
"t",
"exist",
"yet",
"they",
"re",
"created",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/controller/impl/BaseStepControllerImpl.java#L589-L613 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/XPath10ParserImpl.java | XPath10ParserImpl.parseWholeSelector | public Selector parseWholeSelector(String selector)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
tc.entry(
cclass,
"parseWholeSelector",
"selector: " + selector);
// Need to set the domain to XPATH1.0
Identifier ident = new IdentifierImpl(selector);
// Set the full name into the identifier. The full name is used in position assignment when
// determining uniqueness of names. Only a full name will do.
ident.setFullName(selector);
ident.setSelectorDomain(2);
// Call XPath to compile the XPath1.0 expression and store the
// resultant XPathExpression in the Identifier.
XPathExpression xpexp = null;
try
{
// Parse an expression up-front
XPath xpath0 = XPathFactory.newInstance().newXPath();
// If a namespace context has been set then set it into the XPath env
if(namespaceContext != null)
xpath0.setNamespaceContext(namespaceContext);
xpexp = xpath0.compile(selector);
}
catch (Exception ex)
{
// No FFDC Code Needed.
// FFDC driven by wrapper class.
// This signals that the XPath compiler encountered a problem
FFDC.processException(cclass,
"com.ibm.ws.sib.matchspace.selector.impl.XPath10ParserImpl",
ex,
"1:143:1.16");
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
tc.debug(this,cclass, "parseWholeSelector", ex);
// Set the identifier object to "invalid"
ident.setType(Selector.INVALID);
}
// Store xpexp in the Identifier
ident.setCompiledExpression(xpexp);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
tc.exit(this,cclass, "parseWholeSelector", ident);
return ident;
} | java | public Selector parseWholeSelector(String selector)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
tc.entry(
cclass,
"parseWholeSelector",
"selector: " + selector);
// Need to set the domain to XPATH1.0
Identifier ident = new IdentifierImpl(selector);
// Set the full name into the identifier. The full name is used in position assignment when
// determining uniqueness of names. Only a full name will do.
ident.setFullName(selector);
ident.setSelectorDomain(2);
// Call XPath to compile the XPath1.0 expression and store the
// resultant XPathExpression in the Identifier.
XPathExpression xpexp = null;
try
{
// Parse an expression up-front
XPath xpath0 = XPathFactory.newInstance().newXPath();
// If a namespace context has been set then set it into the XPath env
if(namespaceContext != null)
xpath0.setNamespaceContext(namespaceContext);
xpexp = xpath0.compile(selector);
}
catch (Exception ex)
{
// No FFDC Code Needed.
// FFDC driven by wrapper class.
// This signals that the XPath compiler encountered a problem
FFDC.processException(cclass,
"com.ibm.ws.sib.matchspace.selector.impl.XPath10ParserImpl",
ex,
"1:143:1.16");
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
tc.debug(this,cclass, "parseWholeSelector", ex);
// Set the identifier object to "invalid"
ident.setType(Selector.INVALID);
}
// Store xpexp in the Identifier
ident.setCompiledExpression(xpexp);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
tc.exit(this,cclass, "parseWholeSelector", ident);
return ident;
} | [
"public",
"Selector",
"parseWholeSelector",
"(",
"String",
"selector",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"tc",
".",
"entry",
"(",
"cclass",
",",
"\"parseWholeSelector\"",
",",
"\"selector: \"",
"+",
"selector",
")",
";",
"// Need to set the domain to XPATH1.0",
"Identifier",
"ident",
"=",
"new",
"IdentifierImpl",
"(",
"selector",
")",
";",
"// Set the full name into the identifier. The full name is used in position assignment when",
"// determining uniqueness of names. Only a full name will do.",
"ident",
".",
"setFullName",
"(",
"selector",
")",
";",
"ident",
".",
"setSelectorDomain",
"(",
"2",
")",
";",
"// Call XPath to compile the XPath1.0 expression and store the",
"// resultant XPathExpression in the Identifier.",
"XPathExpression",
"xpexp",
"=",
"null",
";",
"try",
"{",
"// Parse an expression up-front",
"XPath",
"xpath0",
"=",
"XPathFactory",
".",
"newInstance",
"(",
")",
".",
"newXPath",
"(",
")",
";",
"// If a namespace context has been set then set it into the XPath env ",
"if",
"(",
"namespaceContext",
"!=",
"null",
")",
"xpath0",
".",
"setNamespaceContext",
"(",
"namespaceContext",
")",
";",
"xpexp",
"=",
"xpath0",
".",
"compile",
"(",
"selector",
")",
";",
"}",
"catch",
"(",
"Exception",
"ex",
")",
"{",
"// No FFDC Code Needed.",
"// FFDC driven by wrapper class.",
"// This signals that the XPath compiler encountered a problem",
"FFDC",
".",
"processException",
"(",
"cclass",
",",
"\"com.ibm.ws.sib.matchspace.selector.impl.XPath10ParserImpl\"",
",",
"ex",
",",
"\"1:143:1.16\"",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"tc",
".",
"debug",
"(",
"this",
",",
"cclass",
",",
"\"parseWholeSelector\"",
",",
"ex",
")",
";",
"// Set the identifier object to \"invalid\"",
"ident",
".",
"setType",
"(",
"Selector",
".",
"INVALID",
")",
";",
"}",
"// Store xpexp in the Identifier ",
"ident",
".",
"setCompiledExpression",
"(",
"xpexp",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"tc",
".",
"exit",
"(",
"this",
",",
"cclass",
",",
"\"parseWholeSelector\"",
",",
"ident",
")",
";",
"return",
"ident",
";",
"}"
] | This method retains the behaviour of the first implementation of XPath support,
where the entire expression is wrapped in a single identifier.
@param selector
@return | [
"This",
"method",
"retains",
"the",
"behaviour",
"of",
"the",
"first",
"implementation",
"of",
"XPath",
"support",
"where",
"the",
"entire",
"expression",
"is",
"wrapped",
"in",
"a",
"single",
"identifier",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/XPath10ParserImpl.java#L83-L136 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/XPath10ParserImpl.java | XPath10ParserImpl.parseSelector | private void parseSelector(String selector) throws InvalidXPathSyntaxException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
tc.entry(cclass,
"parseSelector",
"selector: " + selector);
// Set the locationStep to -1
locationStep = -1;
int start = 0;
// find number of path separators
// Pre-check selector for multi-level wildcards. We can't handle these in
// the optimised code. Simply wrap the entire expression
int posWildCard = selector.indexOf("//", start);
if(posWildCard >= 0)
{
// We have a multi-level wildcard, process the whole thing
locationStep = 0;
selOperands.add(createIdentifierForWildExpression(selector));
return;
}
// Locate the first path separator
int posSeparator = selector.indexOf("/", start);
// Handle an initial separator character
if(posSeparator == 0)
{
// An initial slash
String step = selector.substring(start,start+1);
// Add an IdentifierImpl for the location step to the array list
selOperands.add(createIdentifierForSubExpression(step, step, true, false));
// Bump the start counter
start++;
}
// Now iterate over the rest of the selector string attempting to isolate
// Individual location path steps.
int stepEnd = 0;
while (stepEnd >= 0)
{
StepProperties stepProperties = new StepProperties();
// Drive the method that isolates the next step
isolateNextStep(selector,start, stepProperties);
stepEnd = stepProperties.endOfStep;
// Useful debug
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
if(stepEnd < 0)
{
tc.debug(this,
cclass,
"parsePredicate",
"isolated Step: " + selector.substring(start) +
" and wrapStep is " + stepProperties.wrapStep);
}
else
{
tc.debug(this,
cclass,
"parsePredicate",
"isolated Step: " + selector.substring(start,stepEnd) +
" and wrapStep is " + stepProperties.wrapStep);
}
}
// Should the entire location step be wrapped in an Identifier
if(stepProperties.wrapStep)
{
if(stepEnd <0)
{
// Wrap entire location step in an Identifier
wrapLastLocationStep(selector, start, true);
}
else
{
// Wrap intermediate location step in an Identifier
wrapLocationStep(selector, start,stepEnd);
}
}
else
{
// We can attempt to parse the step using the MatchParser
if(stepEnd <0)
{
// This is the final location step
parseLastLocationStep(selector, start);
}
else
{
// An intermediate location step
parseLocationStep(selector, start, stepEnd);
}
}
// Bump the start parameter and then look for next step
if(stepEnd >= 0)
start = stepEnd + 1;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
tc.exit(this,cclass, "parseSelector");
} | java | private void parseSelector(String selector) throws InvalidXPathSyntaxException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
tc.entry(cclass,
"parseSelector",
"selector: " + selector);
// Set the locationStep to -1
locationStep = -1;
int start = 0;
// find number of path separators
// Pre-check selector for multi-level wildcards. We can't handle these in
// the optimised code. Simply wrap the entire expression
int posWildCard = selector.indexOf("//", start);
if(posWildCard >= 0)
{
// We have a multi-level wildcard, process the whole thing
locationStep = 0;
selOperands.add(createIdentifierForWildExpression(selector));
return;
}
// Locate the first path separator
int posSeparator = selector.indexOf("/", start);
// Handle an initial separator character
if(posSeparator == 0)
{
// An initial slash
String step = selector.substring(start,start+1);
// Add an IdentifierImpl for the location step to the array list
selOperands.add(createIdentifierForSubExpression(step, step, true, false));
// Bump the start counter
start++;
}
// Now iterate over the rest of the selector string attempting to isolate
// Individual location path steps.
int stepEnd = 0;
while (stepEnd >= 0)
{
StepProperties stepProperties = new StepProperties();
// Drive the method that isolates the next step
isolateNextStep(selector,start, stepProperties);
stepEnd = stepProperties.endOfStep;
// Useful debug
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
if(stepEnd < 0)
{
tc.debug(this,
cclass,
"parsePredicate",
"isolated Step: " + selector.substring(start) +
" and wrapStep is " + stepProperties.wrapStep);
}
else
{
tc.debug(this,
cclass,
"parsePredicate",
"isolated Step: " + selector.substring(start,stepEnd) +
" and wrapStep is " + stepProperties.wrapStep);
}
}
// Should the entire location step be wrapped in an Identifier
if(stepProperties.wrapStep)
{
if(stepEnd <0)
{
// Wrap entire location step in an Identifier
wrapLastLocationStep(selector, start, true);
}
else
{
// Wrap intermediate location step in an Identifier
wrapLocationStep(selector, start,stepEnd);
}
}
else
{
// We can attempt to parse the step using the MatchParser
if(stepEnd <0)
{
// This is the final location step
parseLastLocationStep(selector, start);
}
else
{
// An intermediate location step
parseLocationStep(selector, start, stepEnd);
}
}
// Bump the start parameter and then look for next step
if(stepEnd >= 0)
start = stepEnd + 1;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
tc.exit(this,cclass, "parseSelector");
} | [
"private",
"void",
"parseSelector",
"(",
"String",
"selector",
")",
"throws",
"InvalidXPathSyntaxException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"tc",
".",
"entry",
"(",
"cclass",
",",
"\"parseSelector\"",
",",
"\"selector: \"",
"+",
"selector",
")",
";",
"// Set the locationStep to -1",
"locationStep",
"=",
"-",
"1",
";",
"int",
"start",
"=",
"0",
";",
"// find number of path separators",
"// Pre-check selector for multi-level wildcards. We can't handle these in",
"// the optimised code. Simply wrap the entire expression",
"int",
"posWildCard",
"=",
"selector",
".",
"indexOf",
"(",
"\"//\"",
",",
"start",
")",
";",
"if",
"(",
"posWildCard",
">=",
"0",
")",
"{",
"// We have a multi-level wildcard, process the whole thing",
"locationStep",
"=",
"0",
";",
"selOperands",
".",
"add",
"(",
"createIdentifierForWildExpression",
"(",
"selector",
")",
")",
";",
"return",
";",
"}",
"// Locate the first path separator",
"int",
"posSeparator",
"=",
"selector",
".",
"indexOf",
"(",
"\"/\"",
",",
"start",
")",
";",
"// Handle an initial separator character",
"if",
"(",
"posSeparator",
"==",
"0",
")",
"{",
"// An initial slash",
"String",
"step",
"=",
"selector",
".",
"substring",
"(",
"start",
",",
"start",
"+",
"1",
")",
";",
"// Add an IdentifierImpl for the location step to the array list",
"selOperands",
".",
"add",
"(",
"createIdentifierForSubExpression",
"(",
"step",
",",
"step",
",",
"true",
",",
"false",
")",
")",
";",
"// Bump the start counter ",
"start",
"++",
";",
"}",
"// Now iterate over the rest of the selector string attempting to isolate",
"// Individual location path steps.",
"int",
"stepEnd",
"=",
"0",
";",
"while",
"(",
"stepEnd",
">=",
"0",
")",
"{",
"StepProperties",
"stepProperties",
"=",
"new",
"StepProperties",
"(",
")",
";",
"// Drive the method that isolates the next step",
"isolateNextStep",
"(",
"selector",
",",
"start",
",",
"stepProperties",
")",
";",
"stepEnd",
"=",
"stepProperties",
".",
"endOfStep",
";",
"// Useful debug",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"if",
"(",
"stepEnd",
"<",
"0",
")",
"{",
"tc",
".",
"debug",
"(",
"this",
",",
"cclass",
",",
"\"parsePredicate\"",
",",
"\"isolated Step: \"",
"+",
"selector",
".",
"substring",
"(",
"start",
")",
"+",
"\" and wrapStep is \"",
"+",
"stepProperties",
".",
"wrapStep",
")",
";",
"}",
"else",
"{",
"tc",
".",
"debug",
"(",
"this",
",",
"cclass",
",",
"\"parsePredicate\"",
",",
"\"isolated Step: \"",
"+",
"selector",
".",
"substring",
"(",
"start",
",",
"stepEnd",
")",
"+",
"\" and wrapStep is \"",
"+",
"stepProperties",
".",
"wrapStep",
")",
";",
"}",
"}",
"// Should the entire location step be wrapped in an Identifier",
"if",
"(",
"stepProperties",
".",
"wrapStep",
")",
"{",
"if",
"(",
"stepEnd",
"<",
"0",
")",
"{",
"// Wrap entire location step in an Identifier",
"wrapLastLocationStep",
"(",
"selector",
",",
"start",
",",
"true",
")",
";",
"}",
"else",
"{",
"// Wrap intermediate location step in an Identifier",
"wrapLocationStep",
"(",
"selector",
",",
"start",
",",
"stepEnd",
")",
";",
"}",
"}",
"else",
"{",
"// We can attempt to parse the step using the MatchParser",
"if",
"(",
"stepEnd",
"<",
"0",
")",
"{",
"// This is the final location step",
"parseLastLocationStep",
"(",
"selector",
",",
"start",
")",
";",
"}",
"else",
"{",
"// An intermediate location step",
"parseLocationStep",
"(",
"selector",
",",
"start",
",",
"stepEnd",
")",
";",
"}",
"}",
"// Bump the start parameter and then look for next step",
"if",
"(",
"stepEnd",
">=",
"0",
")",
"start",
"=",
"stepEnd",
"+",
"1",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"tc",
".",
"exit",
"(",
"this",
",",
"cclass",
",",
"\"parseSelector\"",
")",
";",
"}"
] | Parse the XPath Selector expression.
@param selector
@throws InvalidXPathSyntaxException | [
"Parse",
"the",
"XPath",
"Selector",
"expression",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/XPath10ParserImpl.java#L191-L296 | train |
Subsets and Splits