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.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsMessageFactoryImpl.java | JsMessageFactoryImpl.createSpecialisedMessage | private final JsMessage createSpecialisedMessage(JsMsgObject jmo) {
JsMessage message = null;
/* For an API message, we need to return an instance of the appropriate */
/* specialisation. */
if (jmo.getChoiceField(JsHdrAccess.API) == JsHdrAccess.IS_API_DATA) {
/* If it is a JMS message, get the right specialisation */
if (jmo.getField(JsHdrAccess.MESSAGETYPE).equals(MessageType.JMS.toByte())) {
message = getJmsFactory().createInboundJmsMessage(jmo, ((Byte)jmo.getField(JsHdrAccess.SUBTYPE)).intValue());
}
}
/* If it isn't an API message, just return a JsMessageImpl */
else {
message = new JsMessageImpl(jmo);
}
return message;
} | java | private final JsMessage createSpecialisedMessage(JsMsgObject jmo) {
JsMessage message = null;
/* For an API message, we need to return an instance of the appropriate */
/* specialisation. */
if (jmo.getChoiceField(JsHdrAccess.API) == JsHdrAccess.IS_API_DATA) {
/* If it is a JMS message, get the right specialisation */
if (jmo.getField(JsHdrAccess.MESSAGETYPE).equals(MessageType.JMS.toByte())) {
message = getJmsFactory().createInboundJmsMessage(jmo, ((Byte)jmo.getField(JsHdrAccess.SUBTYPE)).intValue());
}
}
/* If it isn't an API message, just return a JsMessageImpl */
else {
message = new JsMessageImpl(jmo);
}
return message;
} | [
"private",
"final",
"JsMessage",
"createSpecialisedMessage",
"(",
"JsMsgObject",
"jmo",
")",
"{",
"JsMessage",
"message",
"=",
"null",
";",
"/* For an API message, we need to return an instance of the appropriate */",
"/* specialisation. */",
"if",
"(",
"jmo",
".",
"getChoiceField",
"(",
"JsHdrAccess",
".",
"API",
")",
"==",
"JsHdrAccess",
".",
"IS_API_DATA",
")",
"{",
"/* If it is a JMS message, get the right specialisation */",
"if",
"(",
"jmo",
".",
"getField",
"(",
"JsHdrAccess",
".",
"MESSAGETYPE",
")",
".",
"equals",
"(",
"MessageType",
".",
"JMS",
".",
"toByte",
"(",
")",
")",
")",
"{",
"message",
"=",
"getJmsFactory",
"(",
")",
".",
"createInboundJmsMessage",
"(",
"jmo",
",",
"(",
"(",
"Byte",
")",
"jmo",
".",
"getField",
"(",
"JsHdrAccess",
".",
"SUBTYPE",
")",
")",
".",
"intValue",
"(",
")",
")",
";",
"}",
"}",
"/* If it isn't an API message, just return a JsMessageImpl */",
"else",
"{",
"message",
"=",
"new",
"JsMessageImpl",
"(",
"jmo",
")",
";",
"}",
"return",
"message",
";",
"}"
] | Returns a new JsMessage instance, of the subclass appropriate to the
message content.
@param jmo The JsMsgObject containing the guts of the message
@return JsMessage A new instance of the appropriate JsMessage implementation | [
"Returns",
"a",
"new",
"JsMessage",
"instance",
"of",
"the",
"subclass",
"appropriate",
"to",
"the",
"message",
"content",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsMessageFactoryImpl.java#L594-L614 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/transactions/PersistentTranId.java | PersistentTranId.bytesToInt | private int bytesToInt(byte[] bytes)
{
int result = -1;
if (bytes.length >= 4)
{
result = ((bytes[0]&0xff) << 24) +
((bytes[1]&0xff) << 16) +
((bytes[2]&0xff) << 8) +
(bytes[3]&0xff);
}
return result;
} | java | private int bytesToInt(byte[] bytes)
{
int result = -1;
if (bytes.length >= 4)
{
result = ((bytes[0]&0xff) << 24) +
((bytes[1]&0xff) << 16) +
((bytes[2]&0xff) << 8) +
(bytes[3]&0xff);
}
return result;
} | [
"private",
"int",
"bytesToInt",
"(",
"byte",
"[",
"]",
"bytes",
")",
"{",
"int",
"result",
"=",
"-",
"1",
";",
"if",
"(",
"bytes",
".",
"length",
">=",
"4",
")",
"{",
"result",
"=",
"(",
"(",
"bytes",
"[",
"0",
"]",
"&",
"0xff",
")",
"<<",
"24",
")",
"+",
"(",
"(",
"bytes",
"[",
"1",
"]",
"&",
"0xff",
")",
"<<",
"16",
")",
"+",
"(",
"(",
"bytes",
"[",
"2",
"]",
"&",
"0xff",
")",
"<<",
"8",
")",
"+",
"(",
"bytes",
"[",
"3",
"]",
"&",
"0xff",
")",
";",
"}",
"return",
"result",
";",
"}"
] | A helper function which extracts an int from a byte array representation | [
"A",
"helper",
"function",
"which",
"extracts",
"an",
"int",
"from",
"a",
"byte",
"array",
"representation"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/transactions/PersistentTranId.java#L361-L372 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.event/src/com/ibm/ws/event/internal/adapter/ServiceEventAdapter.java | ServiceEventAdapter.getTopic | private String getTopic(ServiceEvent serviceEvent) {
StringBuilder topic = new StringBuilder(SERVICE_EVENT_TOPIC_PREFIX);
switch (serviceEvent.getType()) {
case ServiceEvent.REGISTERED:
topic.append("REGISTERED");
break;
case ServiceEvent.MODIFIED:
topic.append("MODIFIED");
break;
case ServiceEvent.UNREGISTERING:
topic.append("UNREGISTERING");
break;
default:
return null;
}
return topic.toString();
} | java | private String getTopic(ServiceEvent serviceEvent) {
StringBuilder topic = new StringBuilder(SERVICE_EVENT_TOPIC_PREFIX);
switch (serviceEvent.getType()) {
case ServiceEvent.REGISTERED:
topic.append("REGISTERED");
break;
case ServiceEvent.MODIFIED:
topic.append("MODIFIED");
break;
case ServiceEvent.UNREGISTERING:
topic.append("UNREGISTERING");
break;
default:
return null;
}
return topic.toString();
} | [
"private",
"String",
"getTopic",
"(",
"ServiceEvent",
"serviceEvent",
")",
"{",
"StringBuilder",
"topic",
"=",
"new",
"StringBuilder",
"(",
"SERVICE_EVENT_TOPIC_PREFIX",
")",
";",
"switch",
"(",
"serviceEvent",
".",
"getType",
"(",
")",
")",
"{",
"case",
"ServiceEvent",
".",
"REGISTERED",
":",
"topic",
".",
"append",
"(",
"\"REGISTERED\"",
")",
";",
"break",
";",
"case",
"ServiceEvent",
".",
"MODIFIED",
":",
"topic",
".",
"append",
"(",
"\"MODIFIED\"",
")",
";",
"break",
";",
"case",
"ServiceEvent",
".",
"UNREGISTERING",
":",
"topic",
".",
"append",
"(",
"\"UNREGISTERING\"",
")",
";",
"break",
";",
"default",
":",
"return",
"null",
";",
"}",
"return",
"topic",
".",
"toString",
"(",
")",
";",
"}"
] | Determine the appropriate topic to use for the Service Event.
@param serviceEvent
the service event that is being adapted
@return the topic or null if the event is not supported | [
"Determine",
"the",
"appropriate",
"topic",
"to",
"use",
"for",
"the",
"Service",
"Event",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.event/src/com/ibm/ws/event/internal/adapter/ServiceEventAdapter.java#L108-L126 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/notification/ClientNotificationFilter.java | ClientNotificationFilter.updateFilters | public synchronized void updateFilters(NotificationFilter[] filtersArray) {
filters.clear();
if (filtersArray != null)
Collections.addAll(filters, filtersArray);
} | java | public synchronized void updateFilters(NotificationFilter[] filtersArray) {
filters.clear();
if (filtersArray != null)
Collections.addAll(filters, filtersArray);
} | [
"public",
"synchronized",
"void",
"updateFilters",
"(",
"NotificationFilter",
"[",
"]",
"filtersArray",
")",
"{",
"filters",
".",
"clear",
"(",
")",
";",
"if",
"(",
"filtersArray",
"!=",
"null",
")",
"Collections",
".",
"addAll",
"(",
"filters",
",",
"filtersArray",
")",
";",
"}"
] | Override the list of filters with given array. | [
"Override",
"the",
"list",
"of",
"filters",
"with",
"given",
"array",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/notification/ClientNotificationFilter.java#L54-L58 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/notification/ClientNotificationFilter.java | ClientNotificationFilter.isNotificationEnabled | @Override
public synchronized boolean isNotificationEnabled(Notification notification) {
if (filters.isEmpty()) {
//Allow all
return true;
}
final Iterator<NotificationFilter> i = filters.iterator();
while (i.hasNext()) {
if (i.next().isNotificationEnabled(notification)) {
return true;
}
}
return false;
} | java | @Override
public synchronized boolean isNotificationEnabled(Notification notification) {
if (filters.isEmpty()) {
//Allow all
return true;
}
final Iterator<NotificationFilter> i = filters.iterator();
while (i.hasNext()) {
if (i.next().isNotificationEnabled(notification)) {
return true;
}
}
return false;
} | [
"@",
"Override",
"public",
"synchronized",
"boolean",
"isNotificationEnabled",
"(",
"Notification",
"notification",
")",
"{",
"if",
"(",
"filters",
".",
"isEmpty",
"(",
")",
")",
"{",
"//Allow all",
"return",
"true",
";",
"}",
"final",
"Iterator",
"<",
"NotificationFilter",
">",
"i",
"=",
"filters",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"i",
".",
"hasNext",
"(",
")",
")",
"{",
"if",
"(",
"i",
".",
"next",
"(",
")",
".",
"isNotificationEnabled",
"(",
"notification",
")",
")",
"{",
"return",
"true",
";",
"}",
"}",
"return",
"false",
";",
"}"
] | Handle notification filtering according to stored filters. | [
"Handle",
"notification",
"filtering",
"according",
"to",
"stored",
"filters",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/notification/ClientNotificationFilter.java#L63-L78 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/EJBModuleMetaDataImpl.java | EJBModuleMetaDataImpl.getApplicationExceptionRollback | public Boolean getApplicationExceptionRollback(Throwable t) // F743-14982
{
Class<?> klass = t.getClass();
ApplicationException ae = getApplicationException(klass);
Boolean rollback = null;
if (ae != null)
{
rollback = ae.rollback();
}
// Prior to EJB 3.1, the specification did not explicitly state that
// application exception status was inherited, so for efficiency, we
// assumed it did not. The EJB 3.1 specification clarified this but
// used a different default.
else if (!ContainerProperties.EE5Compatibility) // F743-14982CdRv
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
Tr.debug(tc, "searching for inherited application exception for " + klass.getName());
}
for (Class<?> superClass = klass.getSuperclass(); superClass != Throwable.class; superClass = superClass.getSuperclass())
{
ae = getApplicationException(superClass);
if (ae != null)
{
// The exception class itself has already been checked.
// If a super-class indicates that application exception
// status is not inherited, then the exception is not
// an application exception, so leave rollback null.
if (ae.inherited())
{
rollback = ae.rollback();
}
break;
}
}
}
return rollback;
} | java | public Boolean getApplicationExceptionRollback(Throwable t) // F743-14982
{
Class<?> klass = t.getClass();
ApplicationException ae = getApplicationException(klass);
Boolean rollback = null;
if (ae != null)
{
rollback = ae.rollback();
}
// Prior to EJB 3.1, the specification did not explicitly state that
// application exception status was inherited, so for efficiency, we
// assumed it did not. The EJB 3.1 specification clarified this but
// used a different default.
else if (!ContainerProperties.EE5Compatibility) // F743-14982CdRv
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
Tr.debug(tc, "searching for inherited application exception for " + klass.getName());
}
for (Class<?> superClass = klass.getSuperclass(); superClass != Throwable.class; superClass = superClass.getSuperclass())
{
ae = getApplicationException(superClass);
if (ae != null)
{
// The exception class itself has already been checked.
// If a super-class indicates that application exception
// status is not inherited, then the exception is not
// an application exception, so leave rollback null.
if (ae.inherited())
{
rollback = ae.rollback();
}
break;
}
}
}
return rollback;
} | [
"public",
"Boolean",
"getApplicationExceptionRollback",
"(",
"Throwable",
"t",
")",
"// F743-14982",
"{",
"Class",
"<",
"?",
">",
"klass",
"=",
"t",
".",
"getClass",
"(",
")",
";",
"ApplicationException",
"ae",
"=",
"getApplicationException",
"(",
"klass",
")",
";",
"Boolean",
"rollback",
"=",
"null",
";",
"if",
"(",
"ae",
"!=",
"null",
")",
"{",
"rollback",
"=",
"ae",
".",
"rollback",
"(",
")",
";",
"}",
"// Prior to EJB 3.1, the specification did not explicitly state that",
"// application exception status was inherited, so for efficiency, we",
"// assumed it did not. The EJB 3.1 specification clarified this but",
"// used a different default.",
"else",
"if",
"(",
"!",
"ContainerProperties",
".",
"EE5Compatibility",
")",
"// F743-14982CdRv",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"searching for inherited application exception for \"",
"+",
"klass",
".",
"getName",
"(",
")",
")",
";",
"}",
"for",
"(",
"Class",
"<",
"?",
">",
"superClass",
"=",
"klass",
".",
"getSuperclass",
"(",
")",
";",
"superClass",
"!=",
"Throwable",
".",
"class",
";",
"superClass",
"=",
"superClass",
".",
"getSuperclass",
"(",
")",
")",
"{",
"ae",
"=",
"getApplicationException",
"(",
"superClass",
")",
";",
"if",
"(",
"ae",
"!=",
"null",
")",
"{",
"// The exception class itself has already been checked.",
"// If a super-class indicates that application exception",
"// status is not inherited, then the exception is not",
"// an application exception, so leave rollback null.",
"if",
"(",
"ae",
".",
"inherited",
"(",
")",
")",
"{",
"rollback",
"=",
"ae",
".",
"rollback",
"(",
")",
";",
"}",
"break",
";",
"}",
"}",
"}",
"return",
"rollback",
";",
"}"
] | Gets the application exception and rollback status of the specified
exception.
@param t the exception
@return null if the exception is not an application exception;
otherwise, Boolean.TRUE if the exception should cause rollback
or Boolean.FALSE if it should not | [
"Gets",
"the",
"application",
"exception",
"and",
"rollback",
"status",
"of",
"the",
"specified",
"exception",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/EJBModuleMetaDataImpl.java#L385-L425 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/EJBModuleMetaDataImpl.java | EJBModuleMetaDataImpl.getApplicationException | private ApplicationException getApplicationException(Class<?> klass) // F743-14982
{
ApplicationException result = null;
if (ivApplicationExceptionMap != null)
{
result = ivApplicationExceptionMap.get(klass.getName());
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled() && result != null)
{
Tr.debug(tc, "found application-exception for " + klass.getName()
+ ", rollback=" + result.rollback() + ", inherited=" + result.inherited());
}
}
if (result == null)
{
result = klass.getAnnotation(ApplicationException.class);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled() && result != null)
{
Tr.debug(tc, "found ApplicationException for " + klass.getName()
+ ", rollback=" + result.rollback() + ", inherited=" + result.inherited());
}
}
return result;
} | java | private ApplicationException getApplicationException(Class<?> klass) // F743-14982
{
ApplicationException result = null;
if (ivApplicationExceptionMap != null)
{
result = ivApplicationExceptionMap.get(klass.getName());
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled() && result != null)
{
Tr.debug(tc, "found application-exception for " + klass.getName()
+ ", rollback=" + result.rollback() + ", inherited=" + result.inherited());
}
}
if (result == null)
{
result = klass.getAnnotation(ApplicationException.class);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled() && result != null)
{
Tr.debug(tc, "found ApplicationException for " + klass.getName()
+ ", rollback=" + result.rollback() + ", inherited=" + result.inherited());
}
}
return result;
} | [
"private",
"ApplicationException",
"getApplicationException",
"(",
"Class",
"<",
"?",
">",
"klass",
")",
"// F743-14982",
"{",
"ApplicationException",
"result",
"=",
"null",
";",
"if",
"(",
"ivApplicationExceptionMap",
"!=",
"null",
")",
"{",
"result",
"=",
"ivApplicationExceptionMap",
".",
"get",
"(",
"klass",
".",
"getName",
"(",
")",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
"&&",
"result",
"!=",
"null",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"found application-exception for \"",
"+",
"klass",
".",
"getName",
"(",
")",
"+",
"\", rollback=\"",
"+",
"result",
".",
"rollback",
"(",
")",
"+",
"\", inherited=\"",
"+",
"result",
".",
"inherited",
"(",
")",
")",
";",
"}",
"}",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"result",
"=",
"klass",
".",
"getAnnotation",
"(",
"ApplicationException",
".",
"class",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
"&&",
"result",
"!=",
"null",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"found ApplicationException for \"",
"+",
"klass",
".",
"getName",
"(",
")",
"+",
"\", rollback=\"",
"+",
"result",
".",
"rollback",
"(",
")",
"+",
"\", inherited=\"",
"+",
"result",
".",
"inherited",
"(",
")",
")",
";",
"}",
"}",
"return",
"result",
";",
"}"
] | Gets the application exception status of the specified exception class
from either the deployment descriptor or from the annotation.
@param klass is the Throwable class
@return the settings, or null if no application-exception was provided
for the specified class. | [
"Gets",
"the",
"application",
"exception",
"status",
"of",
"the",
"specified",
"exception",
"class",
"from",
"either",
"the",
"deployment",
"descriptor",
"or",
"from",
"the",
"annotation",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/EJBModuleMetaDataImpl.java#L436-L458 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/EJBModuleMetaDataImpl.java | EJBModuleMetaDataImpl.getComponentMetaDatas | @Override
public ComponentMetaData[] getComponentMetaDatas()
{
ComponentMetaData[] initializedComponentMetaDatas = null;
synchronized (ivEJBApplicationMetaData)
{
initializedComponentMetaDatas = new ComponentMetaData[ivNumFullyInitializedBeans];
int i = 0;
for (BeanMetaData bmd : ivBeanMetaDatas.values())
{
if (bmd.fullyInitialized)
{
initializedComponentMetaDatas[i++] = bmd;
}
}
}
return initializedComponentMetaDatas;
} | java | @Override
public ComponentMetaData[] getComponentMetaDatas()
{
ComponentMetaData[] initializedComponentMetaDatas = null;
synchronized (ivEJBApplicationMetaData)
{
initializedComponentMetaDatas = new ComponentMetaData[ivNumFullyInitializedBeans];
int i = 0;
for (BeanMetaData bmd : ivBeanMetaDatas.values())
{
if (bmd.fullyInitialized)
{
initializedComponentMetaDatas[i++] = bmd;
}
}
}
return initializedComponentMetaDatas;
} | [
"@",
"Override",
"public",
"ComponentMetaData",
"[",
"]",
"getComponentMetaDatas",
"(",
")",
"{",
"ComponentMetaData",
"[",
"]",
"initializedComponentMetaDatas",
"=",
"null",
";",
"synchronized",
"(",
"ivEJBApplicationMetaData",
")",
"{",
"initializedComponentMetaDatas",
"=",
"new",
"ComponentMetaData",
"[",
"ivNumFullyInitializedBeans",
"]",
";",
"int",
"i",
"=",
"0",
";",
"for",
"(",
"BeanMetaData",
"bmd",
":",
"ivBeanMetaDatas",
".",
"values",
"(",
")",
")",
"{",
"if",
"(",
"bmd",
".",
"fullyInitialized",
")",
"{",
"initializedComponentMetaDatas",
"[",
"i",
"++",
"]",
"=",
"bmd",
";",
"}",
"}",
"}",
"return",
"initializedComponentMetaDatas",
";",
"}"
] | Return an Array of fully initialized ComponentMetaDatas for this modules. | [
"Return",
"an",
"Array",
"of",
"fully",
"initialized",
"ComponentMetaDatas",
"for",
"this",
"modules",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/EJBModuleMetaDataImpl.java#L491-L511 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/EJBModuleMetaDataImpl.java | EJBModuleMetaDataImpl.toDumpString | public String toDumpString()
{
// Get the New Line separator from the Java system property.
String newLine = AccessController.doPrivileged(new SystemGetPropertyPrivileged("line.separator", "\n"));
StringBuilder sb = new StringBuilder(toString());
String indent = " ";
sb.append(newLine + newLine + "--- Dump EJBModuleMetaDataImpl fields ---");
if (ivName != null) {
sb.append(newLine + indent + "Module name = " + ivName);
} else {
sb.append(newLine + indent + "Module name = null");
}
// F743-25385
if (ivLogicalName != null) {
sb.append(newLine + indent + "Module logical name = " + ivLogicalName);
} else {
sb.append(newLine + indent + "Module logical name = null");
}
sb.append(newLine + indent + "Module version = " + ivModuleVersion);
if (getApplicationMetaData() != null) {
sb.append(newLine + indent + "Application metadata = " + getApplicationMetaData());
} else {
sb.append(newLine + indent + "Application metadata = null");
}
sb.append(newLine + indent + "Beans = " + ivBeanMetaDatas.keySet());
if (ivApplicationExceptionMap != null) {
sb.append(newLine + indent + "Application Exception map contents:");
for (Map.Entry<String, ApplicationException> entry : ivApplicationExceptionMap.entrySet()) { // F743-14982
ApplicationException value = entry.getValue();
sb.append(newLine + indent + indent + "Exception: " + entry.getKey()
+ ", rollback = " + value.rollback()
+ ", inherited = " + value.inherited());
}
} else {
sb.append(newLine + indent + "Application Exception map = null");
}
sb.append(newLine + indent + "SFSB failover = " + ivSfsbFailover);
if (ivFailoverInstanceId != null) {
sb.append(newLine + indent + "Failover instance ID = " + ivFailoverInstanceId);
} else {
sb.append(newLine + indent + "Failover instance ID = null");
}
sb.append(newLine + indent + "Fully initialized bean count = " + ivNumFullyInitializedBeans);
sb.append(newLine + indent + "JCDIHelper = " + ivJCDIHelper);
sb.append(newLine + indent + "UseExtendedSetRollbackOnlyBehavior = " + ivUseExtendedSetRollbackOnlyBehavior);
sb.append(newLine + indent + "VersionedBaseName = " + ivVersionedAppBaseName + "#" + ivVersionedModuleBaseName); // F54184
toString(sb, newLine, indent);
sb.append(newLine + "--- End EJBModuleMetaDataImpl fields ---");
sb.append(newLine);
return sb.toString();
} | java | public String toDumpString()
{
// Get the New Line separator from the Java system property.
String newLine = AccessController.doPrivileged(new SystemGetPropertyPrivileged("line.separator", "\n"));
StringBuilder sb = new StringBuilder(toString());
String indent = " ";
sb.append(newLine + newLine + "--- Dump EJBModuleMetaDataImpl fields ---");
if (ivName != null) {
sb.append(newLine + indent + "Module name = " + ivName);
} else {
sb.append(newLine + indent + "Module name = null");
}
// F743-25385
if (ivLogicalName != null) {
sb.append(newLine + indent + "Module logical name = " + ivLogicalName);
} else {
sb.append(newLine + indent + "Module logical name = null");
}
sb.append(newLine + indent + "Module version = " + ivModuleVersion);
if (getApplicationMetaData() != null) {
sb.append(newLine + indent + "Application metadata = " + getApplicationMetaData());
} else {
sb.append(newLine + indent + "Application metadata = null");
}
sb.append(newLine + indent + "Beans = " + ivBeanMetaDatas.keySet());
if (ivApplicationExceptionMap != null) {
sb.append(newLine + indent + "Application Exception map contents:");
for (Map.Entry<String, ApplicationException> entry : ivApplicationExceptionMap.entrySet()) { // F743-14982
ApplicationException value = entry.getValue();
sb.append(newLine + indent + indent + "Exception: " + entry.getKey()
+ ", rollback = " + value.rollback()
+ ", inherited = " + value.inherited());
}
} else {
sb.append(newLine + indent + "Application Exception map = null");
}
sb.append(newLine + indent + "SFSB failover = " + ivSfsbFailover);
if (ivFailoverInstanceId != null) {
sb.append(newLine + indent + "Failover instance ID = " + ivFailoverInstanceId);
} else {
sb.append(newLine + indent + "Failover instance ID = null");
}
sb.append(newLine + indent + "Fully initialized bean count = " + ivNumFullyInitializedBeans);
sb.append(newLine + indent + "JCDIHelper = " + ivJCDIHelper);
sb.append(newLine + indent + "UseExtendedSetRollbackOnlyBehavior = " + ivUseExtendedSetRollbackOnlyBehavior);
sb.append(newLine + indent + "VersionedBaseName = " + ivVersionedAppBaseName + "#" + ivVersionedModuleBaseName); // F54184
toString(sb, newLine, indent);
sb.append(newLine + "--- End EJBModuleMetaDataImpl fields ---");
sb.append(newLine);
return sb.toString();
} | [
"public",
"String",
"toDumpString",
"(",
")",
"{",
"// Get the New Line separator from the Java system property.",
"String",
"newLine",
"=",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"SystemGetPropertyPrivileged",
"(",
"\"line.separator\"",
",",
"\"\\n\"",
")",
")",
";",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"toString",
"(",
")",
")",
";",
"String",
"indent",
"=",
"\" \"",
";",
"sb",
".",
"append",
"(",
"newLine",
"+",
"newLine",
"+",
"\"--- Dump EJBModuleMetaDataImpl fields ---\"",
")",
";",
"if",
"(",
"ivName",
"!=",
"null",
")",
"{",
"sb",
".",
"append",
"(",
"newLine",
"+",
"indent",
"+",
"\"Module name = \"",
"+",
"ivName",
")",
";",
"}",
"else",
"{",
"sb",
".",
"append",
"(",
"newLine",
"+",
"indent",
"+",
"\"Module name = null\"",
")",
";",
"}",
"// F743-25385",
"if",
"(",
"ivLogicalName",
"!=",
"null",
")",
"{",
"sb",
".",
"append",
"(",
"newLine",
"+",
"indent",
"+",
"\"Module logical name = \"",
"+",
"ivLogicalName",
")",
";",
"}",
"else",
"{",
"sb",
".",
"append",
"(",
"newLine",
"+",
"indent",
"+",
"\"Module logical name = null\"",
")",
";",
"}",
"sb",
".",
"append",
"(",
"newLine",
"+",
"indent",
"+",
"\"Module version = \"",
"+",
"ivModuleVersion",
")",
";",
"if",
"(",
"getApplicationMetaData",
"(",
")",
"!=",
"null",
")",
"{",
"sb",
".",
"append",
"(",
"newLine",
"+",
"indent",
"+",
"\"Application metadata = \"",
"+",
"getApplicationMetaData",
"(",
")",
")",
";",
"}",
"else",
"{",
"sb",
".",
"append",
"(",
"newLine",
"+",
"indent",
"+",
"\"Application metadata = null\"",
")",
";",
"}",
"sb",
".",
"append",
"(",
"newLine",
"+",
"indent",
"+",
"\"Beans = \"",
"+",
"ivBeanMetaDatas",
".",
"keySet",
"(",
")",
")",
";",
"if",
"(",
"ivApplicationExceptionMap",
"!=",
"null",
")",
"{",
"sb",
".",
"append",
"(",
"newLine",
"+",
"indent",
"+",
"\"Application Exception map contents:\"",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"ApplicationException",
">",
"entry",
":",
"ivApplicationExceptionMap",
".",
"entrySet",
"(",
")",
")",
"{",
"// F743-14982",
"ApplicationException",
"value",
"=",
"entry",
".",
"getValue",
"(",
")",
";",
"sb",
".",
"append",
"(",
"newLine",
"+",
"indent",
"+",
"indent",
"+",
"\"Exception: \"",
"+",
"entry",
".",
"getKey",
"(",
")",
"+",
"\", rollback = \"",
"+",
"value",
".",
"rollback",
"(",
")",
"+",
"\", inherited = \"",
"+",
"value",
".",
"inherited",
"(",
")",
")",
";",
"}",
"}",
"else",
"{",
"sb",
".",
"append",
"(",
"newLine",
"+",
"indent",
"+",
"\"Application Exception map = null\"",
")",
";",
"}",
"sb",
".",
"append",
"(",
"newLine",
"+",
"indent",
"+",
"\"SFSB failover = \"",
"+",
"ivSfsbFailover",
")",
";",
"if",
"(",
"ivFailoverInstanceId",
"!=",
"null",
")",
"{",
"sb",
".",
"append",
"(",
"newLine",
"+",
"indent",
"+",
"\"Failover instance ID = \"",
"+",
"ivFailoverInstanceId",
")",
";",
"}",
"else",
"{",
"sb",
".",
"append",
"(",
"newLine",
"+",
"indent",
"+",
"\"Failover instance ID = null\"",
")",
";",
"}",
"sb",
".",
"append",
"(",
"newLine",
"+",
"indent",
"+",
"\"Fully initialized bean count = \"",
"+",
"ivNumFullyInitializedBeans",
")",
";",
"sb",
".",
"append",
"(",
"newLine",
"+",
"indent",
"+",
"\"JCDIHelper = \"",
"+",
"ivJCDIHelper",
")",
";",
"sb",
".",
"append",
"(",
"newLine",
"+",
"indent",
"+",
"\"UseExtendedSetRollbackOnlyBehavior = \"",
"+",
"ivUseExtendedSetRollbackOnlyBehavior",
")",
";",
"sb",
".",
"append",
"(",
"newLine",
"+",
"indent",
"+",
"\"VersionedBaseName = \"",
"+",
"ivVersionedAppBaseName",
"+",
"\"#\"",
"+",
"ivVersionedModuleBaseName",
")",
";",
"// F54184",
"toString",
"(",
"sb",
",",
"newLine",
",",
"indent",
")",
";",
"sb",
".",
"append",
"(",
"newLine",
"+",
"\"--- End EJBModuleMetaDataImpl fields ---\"",
")",
";",
"sb",
".",
"append",
"(",
"newLine",
")",
";",
"return",
"sb",
".",
"toString",
"(",
")",
";",
"}"
] | Return a String with EJB Container's module level runtime config data | [
"Return",
"a",
"String",
"with",
"EJB",
"Container",
"s",
"module",
"level",
"runtime",
"config",
"data"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/EJBModuleMetaDataImpl.java#L544-L596 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/EJBModuleMetaDataImpl.java | EJBModuleMetaDataImpl.addApplicationEventListener | public void addApplicationEventListener(EJBApplicationEventListener listener) // F743-26072
{
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "addApplicationEventListener: " + listener);
if (ivApplicationEventListeners == null)
{
ivApplicationEventListeners = new ArrayList<EJBApplicationEventListener>();
}
ivApplicationEventListeners.add(listener);
} | java | public void addApplicationEventListener(EJBApplicationEventListener listener) // F743-26072
{
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "addApplicationEventListener: " + listener);
if (ivApplicationEventListeners == null)
{
ivApplicationEventListeners = new ArrayList<EJBApplicationEventListener>();
}
ivApplicationEventListeners.add(listener);
} | [
"public",
"void",
"addApplicationEventListener",
"(",
"EJBApplicationEventListener",
"listener",
")",
"// F743-26072",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"addApplicationEventListener: \"",
"+",
"listener",
")",
";",
"if",
"(",
"ivApplicationEventListeners",
"==",
"null",
")",
"{",
"ivApplicationEventListeners",
"=",
"new",
"ArrayList",
"<",
"EJBApplicationEventListener",
">",
"(",
")",
";",
"}",
"ivApplicationEventListeners",
".",
"add",
"(",
"listener",
")",
";",
"}"
] | Adds a new application even listener to be notified when an application
has fully started or will begin stopping.
@param listener the listener | [
"Adds",
"a",
"new",
"application",
"even",
"listener",
"to",
"be",
"notified",
"when",
"an",
"application",
"has",
"fully",
"started",
"or",
"will",
"begin",
"stopping",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/EJBModuleMetaDataImpl.java#L656-L667 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/EJBModuleMetaDataImpl.java | EJBModuleMetaDataImpl.addAutomaticTimerBean | public void addAutomaticTimerBean(AutomaticTimerBean timerBean) // d604213
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "addAutomaticTimerBean: " + timerBean.getBeanMetaData().j2eeName);
if (ivAutomaticTimerBeans == null)
{
ivAutomaticTimerBeans = new ArrayList<AutomaticTimerBean>();
}
ivHasNonPersistentAutomaticTimers |= timerBean.getNumNonPersistentTimers() > 0;
ivHasPersistentAutomaticTimers |= timerBean.getNumPersistentTimers() > 0;
ivAutomaticTimerBeans.add(timerBean);
} | java | public void addAutomaticTimerBean(AutomaticTimerBean timerBean) // d604213
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "addAutomaticTimerBean: " + timerBean.getBeanMetaData().j2eeName);
if (ivAutomaticTimerBeans == null)
{
ivAutomaticTimerBeans = new ArrayList<AutomaticTimerBean>();
}
ivHasNonPersistentAutomaticTimers |= timerBean.getNumNonPersistentTimers() > 0;
ivHasPersistentAutomaticTimers |= timerBean.getNumPersistentTimers() > 0;
ivAutomaticTimerBeans.add(timerBean);
} | [
"public",
"void",
"addAutomaticTimerBean",
"(",
"AutomaticTimerBean",
"timerBean",
")",
"// d604213",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"addAutomaticTimerBean: \"",
"+",
"timerBean",
".",
"getBeanMetaData",
"(",
")",
".",
"j2eeName",
")",
";",
"if",
"(",
"ivAutomaticTimerBeans",
"==",
"null",
")",
"{",
"ivAutomaticTimerBeans",
"=",
"new",
"ArrayList",
"<",
"AutomaticTimerBean",
">",
"(",
")",
";",
"}",
"ivHasNonPersistentAutomaticTimers",
"|=",
"timerBean",
".",
"getNumNonPersistentTimers",
"(",
")",
">",
"0",
";",
"ivHasPersistentAutomaticTimers",
"|=",
"timerBean",
".",
"getNumPersistentTimers",
"(",
")",
">",
"0",
";",
"ivAutomaticTimerBeans",
".",
"add",
"(",
"timerBean",
")",
";",
"}"
] | Adds a list of timer method metadata for a bean belonging to this
application. This method will only be called for beans that contain
automatic timers.
@param timerBean the list of timer method metadata | [
"Adds",
"a",
"list",
"of",
"timer",
"method",
"metadata",
"for",
"a",
"bean",
"belonging",
"to",
"this",
"application",
".",
"This",
"method",
"will",
"only",
"be",
"called",
"for",
"beans",
"that",
"contain",
"automatic",
"timers",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/EJBModuleMetaDataImpl.java#L676-L689 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/EJBModuleMetaDataImpl.java | EJBModuleMetaDataImpl.freeResourcesAfterAllBeansInitialized | public void freeResourcesAfterAllBeansInitialized(BeanMetaData bmd)
{
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(tc, "freeResourcesAfterAllBeansInitialized: " + bmd.j2eeName + ", " +
(ivNumFullyInitializedBeans + 1) + "/" + ivBeanMetaDatas.size());
ivNumFullyInitializedBeans++;
boolean freeResources = ivNumFullyInitializedBeans == ivBeanMetaDatas.size();
// Free the resources if all beans have been initialized.
if (freeResources)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
Tr.debug(tc, "all beans are initialized in module name = " + ivName
+ ", freeing resources no longer needed");
}
// Since all beans are initialized, free any map no longer needed.
ivInterceptorMap = null;
ivInterceptorBindingMap = null; // d611747
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.exit(tc, "freeResourcesAfterAllBeansInitialized");
} | java | public void freeResourcesAfterAllBeansInitialized(BeanMetaData bmd)
{
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(tc, "freeResourcesAfterAllBeansInitialized: " + bmd.j2eeName + ", " +
(ivNumFullyInitializedBeans + 1) + "/" + ivBeanMetaDatas.size());
ivNumFullyInitializedBeans++;
boolean freeResources = ivNumFullyInitializedBeans == ivBeanMetaDatas.size();
// Free the resources if all beans have been initialized.
if (freeResources)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
Tr.debug(tc, "all beans are initialized in module name = " + ivName
+ ", freeing resources no longer needed");
}
// Since all beans are initialized, free any map no longer needed.
ivInterceptorMap = null;
ivInterceptorBindingMap = null; // d611747
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.exit(tc, "freeResourcesAfterAllBeansInitialized");
} | [
"public",
"void",
"freeResourcesAfterAllBeansInitialized",
"(",
"BeanMetaData",
"bmd",
")",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"freeResourcesAfterAllBeansInitialized: \"",
"+",
"bmd",
".",
"j2eeName",
"+",
"\", \"",
"+",
"(",
"ivNumFullyInitializedBeans",
"+",
"1",
")",
"+",
"\"/\"",
"+",
"ivBeanMetaDatas",
".",
"size",
"(",
")",
")",
";",
"ivNumFullyInitializedBeans",
"++",
";",
"boolean",
"freeResources",
"=",
"ivNumFullyInitializedBeans",
"==",
"ivBeanMetaDatas",
".",
"size",
"(",
")",
";",
"// Free the resources if all beans have been initialized.",
"if",
"(",
"freeResources",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"all beans are initialized in module name = \"",
"+",
"ivName",
"+",
"\", freeing resources no longer needed\"",
")",
";",
"}",
"// Since all beans are initialized, free any map no longer needed.",
"ivInterceptorMap",
"=",
"null",
";",
"ivInterceptorBindingMap",
"=",
"null",
";",
"// d611747",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"freeResourcesAfterAllBeansInitialized\"",
")",
";",
"}"
] | d462512 - log orphan warning message. | [
"d462512",
"-",
"log",
"orphan",
"warning",
"message",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/EJBModuleMetaDataImpl.java#L705-L731 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/EJBModuleMetaDataImpl.java | EJBModuleMetaDataImpl.setVersionedModuleBaseName | @Override
public void setVersionedModuleBaseName(String appBaseName, String modBaseName)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "ModuleName = " + ivName + ", VersionedBaseName = " +
appBaseName + "#" + modBaseName);
if (ivInitData == null) {
throw new IllegalStateException("ModuleMetaData has finished creation.");
}
if (appBaseName == null) {
throw new IllegalArgumentException("appBaseName is null");
}
if (modBaseName == null) {
throw new IllegalArgumentException("modBaseName is null");
}
ivEJBApplicationMetaData.validateVersionedModuleBaseName(appBaseName, modBaseName);
ivVersionedAppBaseName = appBaseName;
ivVersionedModuleBaseName = modBaseName;
} | java | @Override
public void setVersionedModuleBaseName(String appBaseName, String modBaseName)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "ModuleName = " + ivName + ", VersionedBaseName = " +
appBaseName + "#" + modBaseName);
if (ivInitData == null) {
throw new IllegalStateException("ModuleMetaData has finished creation.");
}
if (appBaseName == null) {
throw new IllegalArgumentException("appBaseName is null");
}
if (modBaseName == null) {
throw new IllegalArgumentException("modBaseName is null");
}
ivEJBApplicationMetaData.validateVersionedModuleBaseName(appBaseName, modBaseName);
ivVersionedAppBaseName = appBaseName;
ivVersionedModuleBaseName = modBaseName;
} | [
"@",
"Override",
"public",
"void",
"setVersionedModuleBaseName",
"(",
"String",
"appBaseName",
",",
"String",
"modBaseName",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"ModuleName = \"",
"+",
"ivName",
"+",
"\", VersionedBaseName = \"",
"+",
"appBaseName",
"+",
"\"#\"",
"+",
"modBaseName",
")",
";",
"if",
"(",
"ivInitData",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"ModuleMetaData has finished creation.\"",
")",
";",
"}",
"if",
"(",
"appBaseName",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"appBaseName is null\"",
")",
";",
"}",
"if",
"(",
"modBaseName",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"modBaseName is null\"",
")",
";",
"}",
"ivEJBApplicationMetaData",
".",
"validateVersionedModuleBaseName",
"(",
"appBaseName",
",",
"modBaseName",
")",
";",
"ivVersionedAppBaseName",
"=",
"appBaseName",
";",
"ivVersionedModuleBaseName",
"=",
"modBaseName",
";",
"}"
] | F54184 F54184.2 | [
"F54184",
"F54184",
".",
"2"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/EJBModuleMetaDataImpl.java#L738-L758 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java | HeaderHandler.addElement | private void addElement(String value) {
if (null == value) {
return;
}
this.num_items++;
this.genericValues.add(value);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "addElement: " + value + " num: " + this.num_items);
}
} | java | private void addElement(String value) {
if (null == value) {
return;
}
this.num_items++;
this.genericValues.add(value);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "addElement: " + value + " num: " + this.num_items);
}
} | [
"private",
"void",
"addElement",
"(",
"String",
"value",
")",
"{",
"if",
"(",
"null",
"==",
"value",
")",
"{",
"return",
";",
"}",
"this",
".",
"num_items",
"++",
";",
"this",
".",
"genericValues",
".",
"add",
"(",
"value",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"addElement: \"",
"+",
"value",
"+",
"\" num: \"",
"+",
"this",
".",
"num_items",
")",
";",
"}",
"}"
] | Add the given element to the generic no-key storage. The value must be
in lowercase form by the time of this call.
@param value - if null then nothing is stored | [
"Add",
"the",
"given",
"element",
"to",
"the",
"generic",
"no",
"-",
"key",
"storage",
".",
"The",
"value",
"must",
"be",
"in",
"lowercase",
"form",
"by",
"the",
"time",
"of",
"this",
"call",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java#L94-L103 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java | HeaderHandler.addElement | private void addElement(String key, String value) {
this.num_items++;
List<String> vals = this.values.get(key);
if (null == vals) {
vals = new LinkedList<String>();
}
if (null == value) {
vals.add("\"\"");
} else {
vals.add(value);
}
this.values.put(key, vals);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "addElement: " + key + "=" + value + " num: " + this.num_items);
}
} | java | private void addElement(String key, String value) {
this.num_items++;
List<String> vals = this.values.get(key);
if (null == vals) {
vals = new LinkedList<String>();
}
if (null == value) {
vals.add("\"\"");
} else {
vals.add(value);
}
this.values.put(key, vals);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "addElement: " + key + "=" + value + " num: " + this.num_items);
}
} | [
"private",
"void",
"addElement",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"this",
".",
"num_items",
"++",
";",
"List",
"<",
"String",
">",
"vals",
"=",
"this",
".",
"values",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"null",
"==",
"vals",
")",
"{",
"vals",
"=",
"new",
"LinkedList",
"<",
"String",
">",
"(",
")",
";",
"}",
"if",
"(",
"null",
"==",
"value",
")",
"{",
"vals",
".",
"add",
"(",
"\"\\\"\\\"\"",
")",
";",
"}",
"else",
"{",
"vals",
".",
"add",
"(",
"value",
")",
";",
"}",
"this",
".",
"values",
".",
"put",
"(",
"key",
",",
"vals",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"addElement: \"",
"+",
"key",
"+",
"\"=\"",
"+",
"value",
"+",
"\" num: \"",
"+",
"this",
".",
"num_items",
")",
";",
"}",
"}"
] | Add the given key=value pair into storage. Both key and value must be
in lowercase form. If this key already exists, then this value will be
appended to the existing values.
@param key
@param value - if null then an empty string value is stored | [
"Add",
"the",
"given",
"key",
"=",
"value",
"pair",
"into",
"storage",
".",
"Both",
"key",
"and",
"value",
"must",
"be",
"in",
"lowercase",
"form",
".",
"If",
"this",
"key",
"already",
"exists",
"then",
"this",
"value",
"will",
"be",
"appended",
"to",
"the",
"existing",
"values",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java#L113-L128 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java | HeaderHandler.parse | private void parse(String input) {
char[] data = input.toCharArray();
int start = 0;
int hard_stop = data.length - 1;
while (start < data.length) {
if (this.mySep == data[start]) {
start++;
continue;
}
// look for the '=', end of data, or the separator
int end = start;
String key = null;
boolean insideQuotes = false;
while (end < data.length) {
boolean extract = false;
if ('"' == data[end]) {
insideQuotes = !insideQuotes;
} else if (this.mySep == data[end]) {
extract = true;
end--;
} else if ('=' == data[end]) {
// found a key
key = extractString(data, start, end - 1);
end++; // past the '='
start = end;
continue;
}
// if we're on the last character then always extract and quit
if (end == hard_stop) {
extract = true;
}
// if we need to, extract the value and continue
if (extract) {
String value = extractString(data, start, end);
if (null == key) {
addElement(value);
} else {
addElement(key, value);
}
// at this point, end is pointing to the last char of the val
end = end + 2; // jump past delim
start = end;
if (!insideQuotes) {
break; // out of while
}
continue;
}
end++;
}
}
} | java | private void parse(String input) {
char[] data = input.toCharArray();
int start = 0;
int hard_stop = data.length - 1;
while (start < data.length) {
if (this.mySep == data[start]) {
start++;
continue;
}
// look for the '=', end of data, or the separator
int end = start;
String key = null;
boolean insideQuotes = false;
while (end < data.length) {
boolean extract = false;
if ('"' == data[end]) {
insideQuotes = !insideQuotes;
} else if (this.mySep == data[end]) {
extract = true;
end--;
} else if ('=' == data[end]) {
// found a key
key = extractString(data, start, end - 1);
end++; // past the '='
start = end;
continue;
}
// if we're on the last character then always extract and quit
if (end == hard_stop) {
extract = true;
}
// if we need to, extract the value and continue
if (extract) {
String value = extractString(data, start, end);
if (null == key) {
addElement(value);
} else {
addElement(key, value);
}
// at this point, end is pointing to the last char of the val
end = end + 2; // jump past delim
start = end;
if (!insideQuotes) {
break; // out of while
}
continue;
}
end++;
}
}
} | [
"private",
"void",
"parse",
"(",
"String",
"input",
")",
"{",
"char",
"[",
"]",
"data",
"=",
"input",
".",
"toCharArray",
"(",
")",
";",
"int",
"start",
"=",
"0",
";",
"int",
"hard_stop",
"=",
"data",
".",
"length",
"-",
"1",
";",
"while",
"(",
"start",
"<",
"data",
".",
"length",
")",
"{",
"if",
"(",
"this",
".",
"mySep",
"==",
"data",
"[",
"start",
"]",
")",
"{",
"start",
"++",
";",
"continue",
";",
"}",
"// look for the '=', end of data, or the separator",
"int",
"end",
"=",
"start",
";",
"String",
"key",
"=",
"null",
";",
"boolean",
"insideQuotes",
"=",
"false",
";",
"while",
"(",
"end",
"<",
"data",
".",
"length",
")",
"{",
"boolean",
"extract",
"=",
"false",
";",
"if",
"(",
"'",
"'",
"==",
"data",
"[",
"end",
"]",
")",
"{",
"insideQuotes",
"=",
"!",
"insideQuotes",
";",
"}",
"else",
"if",
"(",
"this",
".",
"mySep",
"==",
"data",
"[",
"end",
"]",
")",
"{",
"extract",
"=",
"true",
";",
"end",
"--",
";",
"}",
"else",
"if",
"(",
"'",
"'",
"==",
"data",
"[",
"end",
"]",
")",
"{",
"// found a key",
"key",
"=",
"extractString",
"(",
"data",
",",
"start",
",",
"end",
"-",
"1",
")",
";",
"end",
"++",
";",
"// past the '='",
"start",
"=",
"end",
";",
"continue",
";",
"}",
"// if we're on the last character then always extract and quit",
"if",
"(",
"end",
"==",
"hard_stop",
")",
"{",
"extract",
"=",
"true",
";",
"}",
"// if we need to, extract the value and continue",
"if",
"(",
"extract",
")",
"{",
"String",
"value",
"=",
"extractString",
"(",
"data",
",",
"start",
",",
"end",
")",
";",
"if",
"(",
"null",
"==",
"key",
")",
"{",
"addElement",
"(",
"value",
")",
";",
"}",
"else",
"{",
"addElement",
"(",
"key",
",",
"value",
")",
";",
"}",
"// at this point, end is pointing to the last char of the val",
"end",
"=",
"end",
"+",
"2",
";",
"// jump past delim",
"start",
"=",
"end",
";",
"if",
"(",
"!",
"insideQuotes",
")",
"{",
"break",
";",
"// out of while",
"}",
"continue",
";",
"}",
"end",
"++",
";",
"}",
"}",
"}"
] | Parse the input string for all value possibilities.
@param input | [
"Parse",
"the",
"input",
"string",
"for",
"all",
"value",
"possibilities",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java#L135-L186 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java | HeaderHandler.extractString | private String extractString(char[] data, int start, int end) {
// skip leading whitespace and quotes
while (start < end &&
(' ' == data[start] || '\t' == data[start] || '"' == data[start])) {
start++;
}
// ignore trailing whitespace and quotes
while (end >= start &&
(' ' == data[end] || '\t' == data[end] || '"' == data[end])) {
end--;
}
// check for nothing but whitespace
if (end < start) {
return null;
}
int len = end - start + 1;
String rc = Normalizer.normalize(new String(data, start, len), Normalizer.NORMALIZE_LOWER);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "extractString: [" + rc + "]");
}
return rc;
} | java | private String extractString(char[] data, int start, int end) {
// skip leading whitespace and quotes
while (start < end &&
(' ' == data[start] || '\t' == data[start] || '"' == data[start])) {
start++;
}
// ignore trailing whitespace and quotes
while (end >= start &&
(' ' == data[end] || '\t' == data[end] || '"' == data[end])) {
end--;
}
// check for nothing but whitespace
if (end < start) {
return null;
}
int len = end - start + 1;
String rc = Normalizer.normalize(new String(data, start, len), Normalizer.NORMALIZE_LOWER);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "extractString: [" + rc + "]");
}
return rc;
} | [
"private",
"String",
"extractString",
"(",
"char",
"[",
"]",
"data",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"// skip leading whitespace and quotes",
"while",
"(",
"start",
"<",
"end",
"&&",
"(",
"'",
"'",
"==",
"data",
"[",
"start",
"]",
"||",
"'",
"'",
"==",
"data",
"[",
"start",
"]",
"||",
"'",
"'",
"==",
"data",
"[",
"start",
"]",
")",
")",
"{",
"start",
"++",
";",
"}",
"// ignore trailing whitespace and quotes",
"while",
"(",
"end",
">=",
"start",
"&&",
"(",
"'",
"'",
"==",
"data",
"[",
"end",
"]",
"||",
"'",
"'",
"==",
"data",
"[",
"end",
"]",
"||",
"'",
"'",
"==",
"data",
"[",
"end",
"]",
")",
")",
"{",
"end",
"--",
";",
"}",
"// check for nothing but whitespace",
"if",
"(",
"end",
"<",
"start",
")",
"{",
"return",
"null",
";",
"}",
"int",
"len",
"=",
"end",
"-",
"start",
"+",
"1",
";",
"String",
"rc",
"=",
"Normalizer",
".",
"normalize",
"(",
"new",
"String",
"(",
"data",
",",
"start",
",",
"len",
")",
",",
"Normalizer",
".",
"NORMALIZE_LOWER",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"extractString: [\"",
"+",
"rc",
"+",
"\"]\"",
")",
";",
"}",
"return",
"rc",
";",
"}"
] | Extract a string from the input array based on the start and end markers.
This will strip off any leading and trailing white space or quotes.
@param data
@param start
@param end
@return String (lowercase converted) | [
"Extract",
"a",
"string",
"from",
"the",
"input",
"array",
"based",
"on",
"the",
"start",
"and",
"end",
"markers",
".",
"This",
"will",
"strip",
"off",
"any",
"leading",
"and",
"trailing",
"white",
"space",
"or",
"quotes",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java#L197-L218 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java | HeaderHandler.add | public boolean add(String inputValue) {
String value = Normalizer.normalize(inputValue, Normalizer.NORMALIZE_LOWER);
if (!contains(this.genericValues, value)) {
addElement(value);
return true;
}
return false;
} | java | public boolean add(String inputValue) {
String value = Normalizer.normalize(inputValue, Normalizer.NORMALIZE_LOWER);
if (!contains(this.genericValues, value)) {
addElement(value);
return true;
}
return false;
} | [
"public",
"boolean",
"add",
"(",
"String",
"inputValue",
")",
"{",
"String",
"value",
"=",
"Normalizer",
".",
"normalize",
"(",
"inputValue",
",",
"Normalizer",
".",
"NORMALIZE_LOWER",
")",
";",
"if",
"(",
"!",
"contains",
"(",
"this",
".",
"genericValues",
",",
"value",
")",
")",
"{",
"addElement",
"(",
"value",
")",
";",
"return",
"true",
";",
"}",
"return",
"false",
";",
"}"
] | Add the generic value to this handler with no required key.
@param inputValue
@return boolean (true means success adding) | [
"Add",
"the",
"generic",
"value",
"to",
"this",
"handler",
"with",
"no",
"required",
"key",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java#L226-L233 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java | HeaderHandler.add | public boolean add(String inputKey, String inputValue) {
String key = Normalizer.normalize(inputKey, Normalizer.NORMALIZE_LOWER);
String value = Normalizer.normalize(inputValue, Normalizer.NORMALIZE_LOWER);
if (!contains(this.values.get(key), value)) {
addElement(key, value);
return true;
}
return false;
} | java | public boolean add(String inputKey, String inputValue) {
String key = Normalizer.normalize(inputKey, Normalizer.NORMALIZE_LOWER);
String value = Normalizer.normalize(inputValue, Normalizer.NORMALIZE_LOWER);
if (!contains(this.values.get(key), value)) {
addElement(key, value);
return true;
}
return false;
} | [
"public",
"boolean",
"add",
"(",
"String",
"inputKey",
",",
"String",
"inputValue",
")",
"{",
"String",
"key",
"=",
"Normalizer",
".",
"normalize",
"(",
"inputKey",
",",
"Normalizer",
".",
"NORMALIZE_LOWER",
")",
";",
"String",
"value",
"=",
"Normalizer",
".",
"normalize",
"(",
"inputValue",
",",
"Normalizer",
".",
"NORMALIZE_LOWER",
")",
";",
"if",
"(",
"!",
"contains",
"(",
"this",
".",
"values",
".",
"get",
"(",
"key",
")",
",",
"value",
")",
")",
"{",
"addElement",
"(",
"key",
",",
"value",
")",
";",
"return",
"true",
";",
"}",
"return",
"false",
";",
"}"
] | Add the given key=value pair to this handler.
@param inputKey
@param inputValue
@return boolean (true means success adding) | [
"Add",
"the",
"given",
"key",
"=",
"value",
"pair",
"to",
"this",
"handler",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java#L242-L250 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java | HeaderHandler.remove | private boolean remove(List<String> list, String item) {
if (null != list) {
if (list.remove(item)) {
this.num_items--;
return true;
}
}
return false;
} | java | private boolean remove(List<String> list, String item) {
if (null != list) {
if (list.remove(item)) {
this.num_items--;
return true;
}
}
return false;
} | [
"private",
"boolean",
"remove",
"(",
"List",
"<",
"String",
">",
"list",
",",
"String",
"item",
")",
"{",
"if",
"(",
"null",
"!=",
"list",
")",
"{",
"if",
"(",
"list",
".",
"remove",
"(",
"item",
")",
")",
"{",
"this",
".",
"num_items",
"--",
";",
"return",
"true",
";",
"}",
"}",
"return",
"false",
";",
"}"
] | Remove the given item from the input list, if present, and update the
item counter appropriately.
@param list
@param item
@return boolean (true means removed) | [
"Remove",
"the",
"given",
"item",
"from",
"the",
"input",
"list",
"if",
"present",
"and",
"update",
"the",
"item",
"counter",
"appropriately",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java#L260-L268 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java | HeaderHandler.remove | public boolean remove(String inputKey, String inputValue) {
String key = Normalizer.normalize(inputKey, Normalizer.NORMALIZE_LOWER);
String value = Normalizer.normalize(inputValue, Normalizer.NORMALIZE_LOWER);
boolean rc = remove(this.values.get(key), value);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "remove: " + key + "=" + value + " rc=" + rc);
}
return rc;
} | java | public boolean remove(String inputKey, String inputValue) {
String key = Normalizer.normalize(inputKey, Normalizer.NORMALIZE_LOWER);
String value = Normalizer.normalize(inputValue, Normalizer.NORMALIZE_LOWER);
boolean rc = remove(this.values.get(key), value);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "remove: " + key + "=" + value + " rc=" + rc);
}
return rc;
} | [
"public",
"boolean",
"remove",
"(",
"String",
"inputKey",
",",
"String",
"inputValue",
")",
"{",
"String",
"key",
"=",
"Normalizer",
".",
"normalize",
"(",
"inputKey",
",",
"Normalizer",
".",
"NORMALIZE_LOWER",
")",
";",
"String",
"value",
"=",
"Normalizer",
".",
"normalize",
"(",
"inputValue",
",",
"Normalizer",
".",
"NORMALIZE_LOWER",
")",
";",
"boolean",
"rc",
"=",
"remove",
"(",
"this",
".",
"values",
".",
"get",
"(",
"key",
")",
",",
"value",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"remove: \"",
"+",
"key",
"+",
"\"=\"",
"+",
"value",
"+",
"\" rc=\"",
"+",
"rc",
")",
";",
"}",
"return",
"rc",
";",
"}"
] | Remove this specific key=value pair from storage. If this key exists with
other values, then those will not be touched, only the target value.
@param inputKey
@param inputValue
@return boolean (true means success removing) | [
"Remove",
"this",
"specific",
"key",
"=",
"value",
"pair",
"from",
"storage",
".",
"If",
"this",
"key",
"exists",
"with",
"other",
"values",
"then",
"those",
"will",
"not",
"be",
"touched",
"only",
"the",
"target",
"value",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java#L278-L286 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java | HeaderHandler.remove | public boolean remove(String inputValue) {
String value = Normalizer.normalize(inputValue, Normalizer.NORMALIZE_LOWER);
boolean rc = remove(this.genericValues, value);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "remove: " + value + " rc=" + rc);
}
return rc;
} | java | public boolean remove(String inputValue) {
String value = Normalizer.normalize(inputValue, Normalizer.NORMALIZE_LOWER);
boolean rc = remove(this.genericValues, value);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "remove: " + value + " rc=" + rc);
}
return rc;
} | [
"public",
"boolean",
"remove",
"(",
"String",
"inputValue",
")",
"{",
"String",
"value",
"=",
"Normalizer",
".",
"normalize",
"(",
"inputValue",
",",
"Normalizer",
".",
"NORMALIZE_LOWER",
")",
";",
"boolean",
"rc",
"=",
"remove",
"(",
"this",
".",
"genericValues",
",",
"value",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"remove: \"",
"+",
"value",
"+",
"\" rc=\"",
"+",
"rc",
")",
";",
"}",
"return",
"rc",
";",
"}"
] | Remove the target value from the generic no-key storage.
@param inputValue
@return boolean (true means success removing) | [
"Remove",
"the",
"target",
"value",
"from",
"the",
"generic",
"no",
"-",
"key",
"storage",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java#L294-L301 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java | HeaderHandler.removeKey | public int removeKey(String inputKey) {
String key = Normalizer.normalize(inputKey, Normalizer.NORMALIZE_LOWER);
int num_removed = 0;
List<String> vals = this.values.remove(key);
if (null != vals) {
num_removed = vals.size();
}
this.num_items -= num_removed;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "removeKey: key=" + key + " " + num_removed);
}
return num_removed;
} | java | public int removeKey(String inputKey) {
String key = Normalizer.normalize(inputKey, Normalizer.NORMALIZE_LOWER);
int num_removed = 0;
List<String> vals = this.values.remove(key);
if (null != vals) {
num_removed = vals.size();
}
this.num_items -= num_removed;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "removeKey: key=" + key + " " + num_removed);
}
return num_removed;
} | [
"public",
"int",
"removeKey",
"(",
"String",
"inputKey",
")",
"{",
"String",
"key",
"=",
"Normalizer",
".",
"normalize",
"(",
"inputKey",
",",
"Normalizer",
".",
"NORMALIZE_LOWER",
")",
";",
"int",
"num_removed",
"=",
"0",
";",
"List",
"<",
"String",
">",
"vals",
"=",
"this",
".",
"values",
".",
"remove",
"(",
"key",
")",
";",
"if",
"(",
"null",
"!=",
"vals",
")",
"{",
"num_removed",
"=",
"vals",
".",
"size",
"(",
")",
";",
"}",
"this",
".",
"num_items",
"-=",
"num_removed",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"removeKey: key=\"",
"+",
"key",
"+",
"\" \"",
"+",
"num_removed",
")",
";",
"}",
"return",
"num_removed",
";",
"}"
] | Remove an entire key from storage, regardless of how many values it may
contain.
@param inputKey
@return int (number of items removed by this action) | [
"Remove",
"an",
"entire",
"key",
"from",
"storage",
"regardless",
"of",
"how",
"many",
"values",
"it",
"may",
"contain",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java#L310-L322 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java | HeaderHandler.contains | private boolean contains(List<String> list, String item) {
return (null == list) ? false : list.contains(item);
} | java | private boolean contains(List<String> list, String item) {
return (null == list) ? false : list.contains(item);
} | [
"private",
"boolean",
"contains",
"(",
"List",
"<",
"String",
">",
"list",
",",
"String",
"item",
")",
"{",
"return",
"(",
"null",
"==",
"list",
")",
"?",
"false",
":",
"list",
".",
"contains",
"(",
"item",
")",
";",
"}"
] | Query whether the target list contains the item.
@param list
@param item
@return boolean | [
"Query",
"whether",
"the",
"target",
"list",
"contains",
"the",
"item",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java#L331-L333 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java | HeaderHandler.containsKey | public boolean containsKey(String inputKey) {
String key = Normalizer.normalize(inputKey, Normalizer.NORMALIZE_LOWER);
List<String> list = this.values.get(key);
boolean rc = (null == list) ? false : !list.isEmpty();
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "containsKey: key=" + inputKey + " rc=" + rc);
}
return rc;
} | java | public boolean containsKey(String inputKey) {
String key = Normalizer.normalize(inputKey, Normalizer.NORMALIZE_LOWER);
List<String> list = this.values.get(key);
boolean rc = (null == list) ? false : !list.isEmpty();
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "containsKey: key=" + inputKey + " rc=" + rc);
}
return rc;
} | [
"public",
"boolean",
"containsKey",
"(",
"String",
"inputKey",
")",
"{",
"String",
"key",
"=",
"Normalizer",
".",
"normalize",
"(",
"inputKey",
",",
"Normalizer",
".",
"NORMALIZE_LOWER",
")",
";",
"List",
"<",
"String",
">",
"list",
"=",
"this",
".",
"values",
".",
"get",
"(",
"key",
")",
";",
"boolean",
"rc",
"=",
"(",
"null",
"==",
"list",
")",
"?",
"false",
":",
"!",
"list",
".",
"isEmpty",
"(",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"containsKey: key=\"",
"+",
"inputKey",
"+",
"\" rc=\"",
"+",
"rc",
")",
";",
"}",
"return",
"rc",
";",
"}"
] | Query whether the target key exists with any values in this handler.
@param inputKey
@return boolean | [
"Query",
"whether",
"the",
"target",
"key",
"exists",
"with",
"any",
"values",
"in",
"this",
"handler",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java#L356-L364 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java | HeaderHandler.getValues | public Iterator<String> getValues(String inputKey) {
String key = Normalizer.normalize(inputKey, Normalizer.NORMALIZE_LOWER);
List<String> vals = this.values.get(key);
if (null != vals) {
return vals.iterator();
}
return new LinkedList<String>().iterator();
} | java | public Iterator<String> getValues(String inputKey) {
String key = Normalizer.normalize(inputKey, Normalizer.NORMALIZE_LOWER);
List<String> vals = this.values.get(key);
if (null != vals) {
return vals.iterator();
}
return new LinkedList<String>().iterator();
} | [
"public",
"Iterator",
"<",
"String",
">",
"getValues",
"(",
"String",
"inputKey",
")",
"{",
"String",
"key",
"=",
"Normalizer",
".",
"normalize",
"(",
"inputKey",
",",
"Normalizer",
".",
"NORMALIZE_LOWER",
")",
";",
"List",
"<",
"String",
">",
"vals",
"=",
"this",
".",
"values",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"null",
"!=",
"vals",
")",
"{",
"return",
"vals",
".",
"iterator",
"(",
")",
";",
"}",
"return",
"new",
"LinkedList",
"<",
"String",
">",
"(",
")",
".",
"iterator",
"(",
")",
";",
"}"
] | Access an iterator of all values for the target key.
@param inputKey
@return Iterator (empty list if none present) | [
"Access",
"an",
"iterator",
"of",
"all",
"values",
"for",
"the",
"target",
"key",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java#L398-L405 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java | HeaderHandler.marshall | public String marshall() {
if (0 == this.num_items) {
return "";
}
boolean shouldPrepend = false;
StringBuilder output = new StringBuilder(10 * this.num_items);
// walk through the list of simple values (no key=value) first
Iterator<String> i = this.genericValues.iterator();
while (i.hasNext()) {
if (shouldPrepend) {
output.append(this.mySep);
output.append(' ');
}
output.append(i.next());
shouldPrepend = true;
}
// now walk through the list of key=value pairs, where value may actually
// be multiple values
i = this.values.keySet().iterator();
while (i.hasNext()) {
String key = i.next();
List<String> vals = this.values.get(key);
if (null == vals)
continue;
int size = vals.size();
if (0 == size) {
// ignore an empty key
continue;
}
if (shouldPrepend) {
output.append(this.mySep);
output.append(' ');
}
output.append(key);
output.append('=');
if (1 == size) {
output.append(vals.get(0));
} else {
// multiple values need to be quote wrapped
shouldPrepend = false;
output.append('"');
for (int count = 0; count < size; count++) {
if (shouldPrepend) {
output.append(this.mySep);
output.append(' ');
}
output.append(vals.get(count));
shouldPrepend = true;
}
output.append('"');
}
shouldPrepend = true;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "marshalling [" + output.toString() + "]");
}
return output.toString();
} | java | public String marshall() {
if (0 == this.num_items) {
return "";
}
boolean shouldPrepend = false;
StringBuilder output = new StringBuilder(10 * this.num_items);
// walk through the list of simple values (no key=value) first
Iterator<String> i = this.genericValues.iterator();
while (i.hasNext()) {
if (shouldPrepend) {
output.append(this.mySep);
output.append(' ');
}
output.append(i.next());
shouldPrepend = true;
}
// now walk through the list of key=value pairs, where value may actually
// be multiple values
i = this.values.keySet().iterator();
while (i.hasNext()) {
String key = i.next();
List<String> vals = this.values.get(key);
if (null == vals)
continue;
int size = vals.size();
if (0 == size) {
// ignore an empty key
continue;
}
if (shouldPrepend) {
output.append(this.mySep);
output.append(' ');
}
output.append(key);
output.append('=');
if (1 == size) {
output.append(vals.get(0));
} else {
// multiple values need to be quote wrapped
shouldPrepend = false;
output.append('"');
for (int count = 0; count < size; count++) {
if (shouldPrepend) {
output.append(this.mySep);
output.append(' ');
}
output.append(vals.get(count));
shouldPrepend = true;
}
output.append('"');
}
shouldPrepend = true;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "marshalling [" + output.toString() + "]");
}
return output.toString();
} | [
"public",
"String",
"marshall",
"(",
")",
"{",
"if",
"(",
"0",
"==",
"this",
".",
"num_items",
")",
"{",
"return",
"\"\"",
";",
"}",
"boolean",
"shouldPrepend",
"=",
"false",
";",
"StringBuilder",
"output",
"=",
"new",
"StringBuilder",
"(",
"10",
"*",
"this",
".",
"num_items",
")",
";",
"// walk through the list of simple values (no key=value) first",
"Iterator",
"<",
"String",
">",
"i",
"=",
"this",
".",
"genericValues",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"i",
".",
"hasNext",
"(",
")",
")",
"{",
"if",
"(",
"shouldPrepend",
")",
"{",
"output",
".",
"append",
"(",
"this",
".",
"mySep",
")",
";",
"output",
".",
"append",
"(",
"'",
"'",
")",
";",
"}",
"output",
".",
"append",
"(",
"i",
".",
"next",
"(",
")",
")",
";",
"shouldPrepend",
"=",
"true",
";",
"}",
"// now walk through the list of key=value pairs, where value may actually",
"// be multiple values",
"i",
"=",
"this",
".",
"values",
".",
"keySet",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"i",
".",
"hasNext",
"(",
")",
")",
"{",
"String",
"key",
"=",
"i",
".",
"next",
"(",
")",
";",
"List",
"<",
"String",
">",
"vals",
"=",
"this",
".",
"values",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"null",
"==",
"vals",
")",
"continue",
";",
"int",
"size",
"=",
"vals",
".",
"size",
"(",
")",
";",
"if",
"(",
"0",
"==",
"size",
")",
"{",
"// ignore an empty key",
"continue",
";",
"}",
"if",
"(",
"shouldPrepend",
")",
"{",
"output",
".",
"append",
"(",
"this",
".",
"mySep",
")",
";",
"output",
".",
"append",
"(",
"'",
"'",
")",
";",
"}",
"output",
".",
"append",
"(",
"key",
")",
";",
"output",
".",
"append",
"(",
"'",
"'",
")",
";",
"if",
"(",
"1",
"==",
"size",
")",
"{",
"output",
".",
"append",
"(",
"vals",
".",
"get",
"(",
"0",
")",
")",
";",
"}",
"else",
"{",
"// multiple values need to be quote wrapped",
"shouldPrepend",
"=",
"false",
";",
"output",
".",
"append",
"(",
"'",
"'",
")",
";",
"for",
"(",
"int",
"count",
"=",
"0",
";",
"count",
"<",
"size",
";",
"count",
"++",
")",
"{",
"if",
"(",
"shouldPrepend",
")",
"{",
"output",
".",
"append",
"(",
"this",
".",
"mySep",
")",
";",
"output",
".",
"append",
"(",
"'",
"'",
")",
";",
"}",
"output",
".",
"append",
"(",
"vals",
".",
"get",
"(",
"count",
")",
")",
";",
"shouldPrepend",
"=",
"true",
";",
"}",
"output",
".",
"append",
"(",
"'",
"'",
")",
";",
"}",
"shouldPrepend",
"=",
"true",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"marshalling [\"",
"+",
"output",
".",
"toString",
"(",
")",
"+",
"\"]\"",
")",
";",
"}",
"return",
"output",
".",
"toString",
"(",
")",
";",
"}"
] | Take the current data in this handler and create the properly formatted
string that would represent the header.
@return String (empty string if no values are present) | [
"Take",
"the",
"current",
"data",
"in",
"this",
"handler",
"and",
"create",
"the",
"properly",
"formatted",
"string",
"that",
"would",
"represent",
"the",
"header",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java#L413-L470 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java | HeaderHandler.clear | public void clear() {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Clearing this header handler: " + this);
}
this.num_items = 0;
this.values.clear();
this.genericValues.clear();
} | java | public void clear() {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Clearing this header handler: " + this);
}
this.num_items = 0;
this.values.clear();
this.genericValues.clear();
} | [
"public",
"void",
"clear",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Clearing this header handler: \"",
"+",
"this",
")",
";",
"}",
"this",
".",
"num_items",
"=",
"0",
";",
"this",
".",
"values",
".",
"clear",
"(",
")",
";",
"this",
".",
"genericValues",
".",
"clear",
"(",
")",
";",
"}"
] | Clear everything out of storage for this handler. | [
"Clear",
"everything",
"out",
"of",
"storage",
"for",
"this",
"handler",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/genericbnf/internal/HeaderHandler.java#L493-L500 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/ConnectionWriteCompletedCallback.java | ConnectionWriteCompletedCallback.proddle | protected void proddle() throws SIConnectionDroppedException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "proddle");
boolean useThisThread = false;
synchronized (priorityQueue) {
synchronized (this) {
if (idle) {
useThisThread = isWorkAvailable();
idle = !useThisThread;
}
}
}
if (useThisThread) {
doWork(false);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "proddle");
} | java | protected void proddle() throws SIConnectionDroppedException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "proddle");
boolean useThisThread = false;
synchronized (priorityQueue) {
synchronized (this) {
if (idle) {
useThisThread = isWorkAvailable();
idle = !useThisThread;
}
}
}
if (useThisThread) {
doWork(false);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "proddle");
} | [
"protected",
"void",
"proddle",
"(",
")",
"throws",
"SIConnectionDroppedException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"proddle\"",
")",
";",
"boolean",
"useThisThread",
"=",
"false",
";",
"synchronized",
"(",
"priorityQueue",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"idle",
")",
"{",
"useThisThread",
"=",
"isWorkAvailable",
"(",
")",
";",
"idle",
"=",
"!",
"useThisThread",
";",
"}",
"}",
"}",
"if",
"(",
"useThisThread",
")",
"{",
"doWork",
"(",
"false",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"proddle\"",
")",
";",
"}"
] | being F176003, F181603.2, D192359 | [
"being",
"F176003",
"F181603",
".",
"2",
"D192359"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/ConnectionWriteCompletedCallback.java#L135-L154 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/ConnectionWriteCompletedCallback.java | ConnectionWriteCompletedCallback.complete | public void complete(NetworkConnection vc, IOWriteRequestContext wctx) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "complete", new Object[] {vc, wctx});
if (connection.isLoggingIOEvents()) connection.getConnectionEventRecorder().logDebug("complete method invoked on write context "+System.identityHashCode(wctx));
try {
doWork(true);
} catch(SIConnectionDroppedException connectionDroppedException) {
// No FFDC code needed
// This has been thrown because the priority queue was purged (most likely on another thread).
// The exception is thrown to prevent threads in this method looping forever or hanging if the
// conneciton is invalidate on another thread. Therefore we simply swallow this exception and
// allow the thread to exit this method.
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(this, tc, "Caught SIConnectionDroppedException, Priority Queue has been purged");
} catch(Error error) {
FFDCFilter.processException
(error, "com.ibm.ws.sib.jfapchannel.impl.ConnectionWriteCompletedCallback", JFapChannelConstants.CONNWRITECOMPCALLBACK_COMPLETE_03, connection.getDiagnostics(true));
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.exception(this, tc, error);
// It might appear slightly odd for this code to catch Error (especially since the JDK docs say
// that Error means that something has gone so badly wrong that you should abandon all hope).
// This code makes one final stab at putting out some diagnostics about what happened (if we
// propagate the Error up to the TCP Channel, it is sometimes lost) and closing down the
// connection. I figured that we might as well try to do something - as we can hardly make
// things worse... (famous last words)
connection.invalidate(false, error, "Error caught in ConnectionWriteCompletedCallback.complete()");
// Re-throw the error to ensure that it causes the maximum devastation.
// The JVM is probably very ill if an Error is thrown so attempt no recovery.
throw error;
} catch(RuntimeException runtimeException) {
FFDCFilter.processException
(runtimeException, "com.ibm.ws.sib.jfapchannel.impl.ConnectionWriteCompletedCallback", JFapChannelConstants.CONNWRITECOMPCALLBACK_COMPLETE_04, connection.getDiagnostics(true));
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.exception(this, tc, runtimeException);
// We can reasonably try to recover from a runtime exception by invalidating the associated
// connection. This should drive the underlying TCP/IP socket to be closed.
connection.invalidate(false, runtimeException, "RuntimeException caught in ConnectionWriteCompletedCallback.complete()");
// Don't throw the RuntimeException on as we risk blowing away part of the TCP channel.
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "complete");
} | java | public void complete(NetworkConnection vc, IOWriteRequestContext wctx) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "complete", new Object[] {vc, wctx});
if (connection.isLoggingIOEvents()) connection.getConnectionEventRecorder().logDebug("complete method invoked on write context "+System.identityHashCode(wctx));
try {
doWork(true);
} catch(SIConnectionDroppedException connectionDroppedException) {
// No FFDC code needed
// This has been thrown because the priority queue was purged (most likely on another thread).
// The exception is thrown to prevent threads in this method looping forever or hanging if the
// conneciton is invalidate on another thread. Therefore we simply swallow this exception and
// allow the thread to exit this method.
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(this, tc, "Caught SIConnectionDroppedException, Priority Queue has been purged");
} catch(Error error) {
FFDCFilter.processException
(error, "com.ibm.ws.sib.jfapchannel.impl.ConnectionWriteCompletedCallback", JFapChannelConstants.CONNWRITECOMPCALLBACK_COMPLETE_03, connection.getDiagnostics(true));
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.exception(this, tc, error);
// It might appear slightly odd for this code to catch Error (especially since the JDK docs say
// that Error means that something has gone so badly wrong that you should abandon all hope).
// This code makes one final stab at putting out some diagnostics about what happened (if we
// propagate the Error up to the TCP Channel, it is sometimes lost) and closing down the
// connection. I figured that we might as well try to do something - as we can hardly make
// things worse... (famous last words)
connection.invalidate(false, error, "Error caught in ConnectionWriteCompletedCallback.complete()");
// Re-throw the error to ensure that it causes the maximum devastation.
// The JVM is probably very ill if an Error is thrown so attempt no recovery.
throw error;
} catch(RuntimeException runtimeException) {
FFDCFilter.processException
(runtimeException, "com.ibm.ws.sib.jfapchannel.impl.ConnectionWriteCompletedCallback", JFapChannelConstants.CONNWRITECOMPCALLBACK_COMPLETE_04, connection.getDiagnostics(true));
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.exception(this, tc, runtimeException);
// We can reasonably try to recover from a runtime exception by invalidating the associated
// connection. This should drive the underlying TCP/IP socket to be closed.
connection.invalidate(false, runtimeException, "RuntimeException caught in ConnectionWriteCompletedCallback.complete()");
// Don't throw the RuntimeException on as we risk blowing away part of the TCP channel.
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "complete");
} | [
"public",
"void",
"complete",
"(",
"NetworkConnection",
"vc",
",",
"IOWriteRequestContext",
"wctx",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"complete\"",
",",
"new",
"Object",
"[",
"]",
"{",
"vc",
",",
"wctx",
"}",
")",
";",
"if",
"(",
"connection",
".",
"isLoggingIOEvents",
"(",
")",
")",
"connection",
".",
"getConnectionEventRecorder",
"(",
")",
".",
"logDebug",
"(",
"\"complete method invoked on write context \"",
"+",
"System",
".",
"identityHashCode",
"(",
"wctx",
")",
")",
";",
"try",
"{",
"doWork",
"(",
"true",
")",
";",
"}",
"catch",
"(",
"SIConnectionDroppedException",
"connectionDroppedException",
")",
"{",
"// No FFDC code needed",
"// This has been thrown because the priority queue was purged (most likely on another thread).",
"// The exception is thrown to prevent threads in this method looping forever or hanging if the",
"// conneciton is invalidate on another thread. Therefore we simply swallow this exception and",
"// allow the thread to exit this method.",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"Caught SIConnectionDroppedException, Priority Queue has been purged\"",
")",
";",
"}",
"catch",
"(",
"Error",
"error",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"error",
",",
"\"com.ibm.ws.sib.jfapchannel.impl.ConnectionWriteCompletedCallback\"",
",",
"JFapChannelConstants",
".",
"CONNWRITECOMPCALLBACK_COMPLETE_03",
",",
"connection",
".",
"getDiagnostics",
"(",
"true",
")",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"SibTr",
".",
"exception",
"(",
"this",
",",
"tc",
",",
"error",
")",
";",
"// It might appear slightly odd for this code to catch Error (especially since the JDK docs say",
"// that Error means that something has gone so badly wrong that you should abandon all hope).",
"// This code makes one final stab at putting out some diagnostics about what happened (if we",
"// propagate the Error up to the TCP Channel, it is sometimes lost) and closing down the",
"// connection. I figured that we might as well try to do something - as we can hardly make",
"// things worse... (famous last words)",
"connection",
".",
"invalidate",
"(",
"false",
",",
"error",
",",
"\"Error caught in ConnectionWriteCompletedCallback.complete()\"",
")",
";",
"// Re-throw the error to ensure that it causes the maximum devastation.",
"// The JVM is probably very ill if an Error is thrown so attempt no recovery.",
"throw",
"error",
";",
"}",
"catch",
"(",
"RuntimeException",
"runtimeException",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"runtimeException",
",",
"\"com.ibm.ws.sib.jfapchannel.impl.ConnectionWriteCompletedCallback\"",
",",
"JFapChannelConstants",
".",
"CONNWRITECOMPCALLBACK_COMPLETE_04",
",",
"connection",
".",
"getDiagnostics",
"(",
"true",
")",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"SibTr",
".",
"exception",
"(",
"this",
",",
"tc",
",",
"runtimeException",
")",
";",
"// We can reasonably try to recover from a runtime exception by invalidating the associated",
"// connection. This should drive the underlying TCP/IP socket to be closed.",
"connection",
".",
"invalidate",
"(",
"false",
",",
"runtimeException",
",",
"\"RuntimeException caught in ConnectionWriteCompletedCallback.complete()\"",
")",
";",
"// Don't throw the RuntimeException on as we risk blowing away part of the TCP channel.",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"complete\"",
")",
";",
"}"
] | begin F181603.2, D192359 | [
"begin",
"F181603",
".",
"2",
"D192359"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/ConnectionWriteCompletedCallback.java#L162-L208 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/ConnectionWriteCompletedCallback.java | ConnectionWriteCompletedCallback.doWork | private void doWork(boolean hasWritten) throws SIConnectionDroppedException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "doWork", Boolean.valueOf(hasWritten));
final BlockingQueue<Pair<SendListener,Conversation>> readySendCallbacks =
new LinkedBlockingQueue<Pair<SendListener,Conversation>>();
boolean hasGoneAsync = false;
do {
boolean hasMoreWork;
do {
if (hasWritten) {
sendCallbacks.drainTo(readySendCallbacks);
}
hasWritten = false;
hasMoreWork = false;
synchronized (priorityQueue) {
synchronized (this) {
if (!isWorkAvailable()) break;
}
}
final WsByteBuffer writeBuffer = getWriteContextBuffer();
writeBuffer.clear();
if (dequeueTransmissionData(writeBuffer)) {
synchronized (connectionClosedLock) {
if (!connectionClosed) {
writeBuffer.flip();
if (connection.isLoggingIOEvents()) connection.getConnectionEventRecorder().logDebug("invoking writeCtx.write() on context "+System.identityHashCode(writeCtx)+" to write all data with no timeout");
final NetworkConnection vc = writeCtx.write(IOWriteRequestContext.WRITE_ALL_DATA, this, false, IOWriteRequestContext.NO_TIMEOUT);
hasGoneAsync = (vc == null);
hasWritten = true;
hasMoreWork = !hasGoneAsync;
}
}
}
} while (hasMoreWork);
} while (!hasGoneAsync && !switchToIdle());
// This thread is no longer tasked with writing activity, so it is now safe to notify the "ready" send listeners -
// i.e. those whose messages have been completely sent.
// (It was not safe to do so prior to this point, as the listeners may create more messages to be sent, which
// could end in deadlock if this thread were still tasked with the writing.)
notifyReadySendListeners(readySendCallbacks);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "doWork");
} | java | private void doWork(boolean hasWritten) throws SIConnectionDroppedException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "doWork", Boolean.valueOf(hasWritten));
final BlockingQueue<Pair<SendListener,Conversation>> readySendCallbacks =
new LinkedBlockingQueue<Pair<SendListener,Conversation>>();
boolean hasGoneAsync = false;
do {
boolean hasMoreWork;
do {
if (hasWritten) {
sendCallbacks.drainTo(readySendCallbacks);
}
hasWritten = false;
hasMoreWork = false;
synchronized (priorityQueue) {
synchronized (this) {
if (!isWorkAvailable()) break;
}
}
final WsByteBuffer writeBuffer = getWriteContextBuffer();
writeBuffer.clear();
if (dequeueTransmissionData(writeBuffer)) {
synchronized (connectionClosedLock) {
if (!connectionClosed) {
writeBuffer.flip();
if (connection.isLoggingIOEvents()) connection.getConnectionEventRecorder().logDebug("invoking writeCtx.write() on context "+System.identityHashCode(writeCtx)+" to write all data with no timeout");
final NetworkConnection vc = writeCtx.write(IOWriteRequestContext.WRITE_ALL_DATA, this, false, IOWriteRequestContext.NO_TIMEOUT);
hasGoneAsync = (vc == null);
hasWritten = true;
hasMoreWork = !hasGoneAsync;
}
}
}
} while (hasMoreWork);
} while (!hasGoneAsync && !switchToIdle());
// This thread is no longer tasked with writing activity, so it is now safe to notify the "ready" send listeners -
// i.e. those whose messages have been completely sent.
// (It was not safe to do so prior to this point, as the listeners may create more messages to be sent, which
// could end in deadlock if this thread were still tasked with the writing.)
notifyReadySendListeners(readySendCallbacks);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "doWork");
} | [
"private",
"void",
"doWork",
"(",
"boolean",
"hasWritten",
")",
"throws",
"SIConnectionDroppedException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"doWork\"",
",",
"Boolean",
".",
"valueOf",
"(",
"hasWritten",
")",
")",
";",
"final",
"BlockingQueue",
"<",
"Pair",
"<",
"SendListener",
",",
"Conversation",
">",
">",
"readySendCallbacks",
"=",
"new",
"LinkedBlockingQueue",
"<",
"Pair",
"<",
"SendListener",
",",
"Conversation",
">",
">",
"(",
")",
";",
"boolean",
"hasGoneAsync",
"=",
"false",
";",
"do",
"{",
"boolean",
"hasMoreWork",
";",
"do",
"{",
"if",
"(",
"hasWritten",
")",
"{",
"sendCallbacks",
".",
"drainTo",
"(",
"readySendCallbacks",
")",
";",
"}",
"hasWritten",
"=",
"false",
";",
"hasMoreWork",
"=",
"false",
";",
"synchronized",
"(",
"priorityQueue",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"!",
"isWorkAvailable",
"(",
")",
")",
"break",
";",
"}",
"}",
"final",
"WsByteBuffer",
"writeBuffer",
"=",
"getWriteContextBuffer",
"(",
")",
";",
"writeBuffer",
".",
"clear",
"(",
")",
";",
"if",
"(",
"dequeueTransmissionData",
"(",
"writeBuffer",
")",
")",
"{",
"synchronized",
"(",
"connectionClosedLock",
")",
"{",
"if",
"(",
"!",
"connectionClosed",
")",
"{",
"writeBuffer",
".",
"flip",
"(",
")",
";",
"if",
"(",
"connection",
".",
"isLoggingIOEvents",
"(",
")",
")",
"connection",
".",
"getConnectionEventRecorder",
"(",
")",
".",
"logDebug",
"(",
"\"invoking writeCtx.write() on context \"",
"+",
"System",
".",
"identityHashCode",
"(",
"writeCtx",
")",
"+",
"\" to write all data with no timeout\"",
")",
";",
"final",
"NetworkConnection",
"vc",
"=",
"writeCtx",
".",
"write",
"(",
"IOWriteRequestContext",
".",
"WRITE_ALL_DATA",
",",
"this",
",",
"false",
",",
"IOWriteRequestContext",
".",
"NO_TIMEOUT",
")",
";",
"hasGoneAsync",
"=",
"(",
"vc",
"==",
"null",
")",
";",
"hasWritten",
"=",
"true",
";",
"hasMoreWork",
"=",
"!",
"hasGoneAsync",
";",
"}",
"}",
"}",
"}",
"while",
"(",
"hasMoreWork",
")",
";",
"}",
"while",
"(",
"!",
"hasGoneAsync",
"&&",
"!",
"switchToIdle",
"(",
")",
")",
";",
"// This thread is no longer tasked with writing activity, so it is now safe to notify the \"ready\" send listeners -",
"// i.e. those whose messages have been completely sent.",
"// (It was not safe to do so prior to this point, as the listeners may create more messages to be sent, which",
"// could end in deadlock if this thread were still tasked with the writing.)",
"notifyReadySendListeners",
"(",
"readySendCallbacks",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"doWork\"",
")",
";",
"}"
] | Looks to initiate write operations to write all available data from the priority queue to the network.
Continues until all data has been sent or until the return from a write call indicates its completion will
be asynchronous.
Once it has finished writing on this thread, calls the registered send listeners for all messages that have been
completely sent.
@param hasWritten true iff invoked as a result of a previous (async) write call.
@throws SIConnectionDroppedException | [
"Looks",
"to",
"initiate",
"write",
"operations",
"to",
"write",
"all",
"available",
"data",
"from",
"the",
"priority",
"queue",
"to",
"the",
"network",
".",
"Continues",
"until",
"all",
"data",
"has",
"been",
"sent",
"or",
"until",
"the",
"return",
"from",
"a",
"write",
"call",
"indicates",
"its",
"completion",
"will",
"be",
"asynchronous",
".",
"Once",
"it",
"has",
"finished",
"writing",
"on",
"this",
"thread",
"calls",
"the",
"registered",
"send",
"listeners",
"for",
"all",
"messages",
"that",
"have",
"been",
"completely",
"sent",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/ConnectionWriteCompletedCallback.java#L219-L263 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/ConnectionWriteCompletedCallback.java | ConnectionWriteCompletedCallback.notifyReadySendListeners | private void notifyReadySendListeners(BlockingQueue<Pair<SendListener, Conversation>> readySendCallbacks) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "notifyReadySendListeners", readySendCallbacks);
try {
for (Pair<SendListener, Conversation> callback : readySendCallbacks) {
callback.left.dataSent(callback.right);
}
} catch (Throwable t) {
FFDCFilter.processException
(t, "com.ibm.ws.sib.jfapchannel.impl.ConnectionWriteCompletedCallback", JFapChannelConstants.CONNWRITECOMPCALLBACK_COMPLETE_01, connection.getDiagnostics(true));
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(tc, "exception invoking send listener data sent");
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.exception(tc, t);
connection.invalidate(true, t, "send listener threw exception"); // D224570
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "notifyReadySendListeners");
} | java | private void notifyReadySendListeners(BlockingQueue<Pair<SendListener, Conversation>> readySendCallbacks) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "notifyReadySendListeners", readySendCallbacks);
try {
for (Pair<SendListener, Conversation> callback : readySendCallbacks) {
callback.left.dataSent(callback.right);
}
} catch (Throwable t) {
FFDCFilter.processException
(t, "com.ibm.ws.sib.jfapchannel.impl.ConnectionWriteCompletedCallback", JFapChannelConstants.CONNWRITECOMPCALLBACK_COMPLETE_01, connection.getDiagnostics(true));
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(tc, "exception invoking send listener data sent");
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.exception(tc, t);
connection.invalidate(true, t, "send listener threw exception"); // D224570
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "notifyReadySendListeners");
} | [
"private",
"void",
"notifyReadySendListeners",
"(",
"BlockingQueue",
"<",
"Pair",
"<",
"SendListener",
",",
"Conversation",
">",
">",
"readySendCallbacks",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"notifyReadySendListeners\"",
",",
"readySendCallbacks",
")",
";",
"try",
"{",
"for",
"(",
"Pair",
"<",
"SendListener",
",",
"Conversation",
">",
"callback",
":",
"readySendCallbacks",
")",
"{",
"callback",
".",
"left",
".",
"dataSent",
"(",
"callback",
".",
"right",
")",
";",
"}",
"}",
"catch",
"(",
"Throwable",
"t",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"t",
",",
"\"com.ibm.ws.sib.jfapchannel.impl.ConnectionWriteCompletedCallback\"",
",",
"JFapChannelConstants",
".",
"CONNWRITECOMPCALLBACK_COMPLETE_01",
",",
"connection",
".",
"getDiagnostics",
"(",
"true",
")",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"exception invoking send listener data sent\"",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"t",
")",
";",
"connection",
".",
"invalidate",
"(",
"true",
",",
"t",
",",
"\"send listener threw exception\"",
")",
";",
"// D224570",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"notifyReadySendListeners\"",
")",
";",
"}"
] | Call send listener callback for each entry in the given queue.
Any exception thrown from a listener's callback will cause the connection to be invalidated.
@param readySendCallbacks | [
"Call",
"send",
"listener",
"callback",
"for",
"each",
"entry",
"in",
"the",
"given",
"queue",
".",
"Any",
"exception",
"thrown",
"from",
"a",
"listener",
"s",
"callback",
"will",
"cause",
"the",
"connection",
"to",
"be",
"invalidated",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/ConnectionWriteCompletedCallback.java#L270-L285 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/ConnectionWriteCompletedCallback.java | ConnectionWriteCompletedCallback.switchToIdle | private boolean switchToIdle() throws SIConnectionDroppedException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "switchToIdle");
final boolean noMoreWork;
synchronized (priorityQueue) {
synchronized (this) {
noMoreWork = !isWorkAvailable();
idle = noMoreWork;
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "switchToIdle", Boolean.valueOf(noMoreWork));
return noMoreWork;
} | java | private boolean switchToIdle() throws SIConnectionDroppedException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "switchToIdle");
final boolean noMoreWork;
synchronized (priorityQueue) {
synchronized (this) {
noMoreWork = !isWorkAvailable();
idle = noMoreWork;
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "switchToIdle", Boolean.valueOf(noMoreWork));
return noMoreWork;
} | [
"private",
"boolean",
"switchToIdle",
"(",
")",
"throws",
"SIConnectionDroppedException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"switchToIdle\"",
")",
";",
"final",
"boolean",
"noMoreWork",
";",
"synchronized",
"(",
"priorityQueue",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"noMoreWork",
"=",
"!",
"isWorkAvailable",
"(",
")",
";",
"idle",
"=",
"noMoreWork",
";",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"switchToIdle\"",
",",
"Boolean",
".",
"valueOf",
"(",
"noMoreWork",
")",
")",
";",
"return",
"noMoreWork",
";",
"}"
] | Switch the 'idle' flag back to 'true', provided that there is no work available.
@return true iff 'idle' was set to 'true'; false iff there is now work available.
@throws SIConnectionDroppedException | [
"Switch",
"the",
"idle",
"flag",
"back",
"to",
"true",
"provided",
"that",
"there",
"is",
"no",
"work",
"available",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/ConnectionWriteCompletedCallback.java#L292-L303 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/ConnectionWriteCompletedCallback.java | ConnectionWriteCompletedCallback.getWriteContextBuffer | private WsByteBuffer getWriteContextBuffer() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getWriteContextBuffer");
WsByteBuffer writeBuffer = getSoleWriteContextBuffer();
if (firstInvocation.compareAndSet(true, false) || (writeBuffer == null)) {
final int writeBufferSize =
Integer.parseInt(RuntimeInfo.getProperty("com.ibm.ws.sib.jfapchannel.DEFAULT_WRITE_BUFFER_SIZE", "" + JFapChannelConstants.DEFAULT_WRITE_BUFFER_SIZE));
if ((writeBuffer != null) && (!writeBuffer.isDirect() || writeBuffer.capacity() < writeBufferSize)) {
writeBuffer.release();
writeBuffer = null;
}
if (writeBuffer == null) {
writeBuffer = WsByteBufferPool.getInstance().allocateDirect(writeBufferSize); // F196678.10
writeCtx.setBuffer(writeBuffer);
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getWriteContextBuffer", writeBuffer);
return writeBuffer;
} | java | private WsByteBuffer getWriteContextBuffer() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getWriteContextBuffer");
WsByteBuffer writeBuffer = getSoleWriteContextBuffer();
if (firstInvocation.compareAndSet(true, false) || (writeBuffer == null)) {
final int writeBufferSize =
Integer.parseInt(RuntimeInfo.getProperty("com.ibm.ws.sib.jfapchannel.DEFAULT_WRITE_BUFFER_SIZE", "" + JFapChannelConstants.DEFAULT_WRITE_BUFFER_SIZE));
if ((writeBuffer != null) && (!writeBuffer.isDirect() || writeBuffer.capacity() < writeBufferSize)) {
writeBuffer.release();
writeBuffer = null;
}
if (writeBuffer == null) {
writeBuffer = WsByteBufferPool.getInstance().allocateDirect(writeBufferSize); // F196678.10
writeCtx.setBuffer(writeBuffer);
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getWriteContextBuffer", writeBuffer);
return writeBuffer;
} | [
"private",
"WsByteBuffer",
"getWriteContextBuffer",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"getWriteContextBuffer\"",
")",
";",
"WsByteBuffer",
"writeBuffer",
"=",
"getSoleWriteContextBuffer",
"(",
")",
";",
"if",
"(",
"firstInvocation",
".",
"compareAndSet",
"(",
"true",
",",
"false",
")",
"||",
"(",
"writeBuffer",
"==",
"null",
")",
")",
"{",
"final",
"int",
"writeBufferSize",
"=",
"Integer",
".",
"parseInt",
"(",
"RuntimeInfo",
".",
"getProperty",
"(",
"\"com.ibm.ws.sib.jfapchannel.DEFAULT_WRITE_BUFFER_SIZE\"",
",",
"\"\"",
"+",
"JFapChannelConstants",
".",
"DEFAULT_WRITE_BUFFER_SIZE",
")",
")",
";",
"if",
"(",
"(",
"writeBuffer",
"!=",
"null",
")",
"&&",
"(",
"!",
"writeBuffer",
".",
"isDirect",
"(",
")",
"||",
"writeBuffer",
".",
"capacity",
"(",
")",
"<",
"writeBufferSize",
")",
")",
"{",
"writeBuffer",
".",
"release",
"(",
")",
";",
"writeBuffer",
"=",
"null",
";",
"}",
"if",
"(",
"writeBuffer",
"==",
"null",
")",
"{",
"writeBuffer",
"=",
"WsByteBufferPool",
".",
"getInstance",
"(",
")",
".",
"allocateDirect",
"(",
"writeBufferSize",
")",
";",
"// F196678.10",
"writeCtx",
".",
"setBuffer",
"(",
"writeBuffer",
")",
";",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"getWriteContextBuffer\"",
",",
"writeBuffer",
")",
";",
"return",
"writeBuffer",
";",
"}"
] | Returns the single WsByteBuffer set in 'writeCtx', ensuring that it is a direct byte buffer and is of
sufficient capacity.
@return the (single, non-null) byte buffer set in 'writeCtx'. | [
"Returns",
"the",
"single",
"WsByteBuffer",
"set",
"in",
"writeCtx",
"ensuring",
"that",
"it",
"is",
"a",
"direct",
"byte",
"buffer",
"and",
"is",
"of",
"sufficient",
"capacity",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/ConnectionWriteCompletedCallback.java#L310-L331 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/ConnectionWriteCompletedCallback.java | ConnectionWriteCompletedCallback.getSoleWriteContextBuffer | private WsByteBuffer getSoleWriteContextBuffer() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getSoleWriteContextBuffer");
WsByteBuffer writeBuffer = null;
final WsByteBuffer[] writeBuffers = writeCtx.getBuffers();
if (writeBuffers != null) {
final int writeBuffersSize = writeBuffers.length;
if (writeBuffersSize > 0) {
writeBuffer = writeBuffers[0];
if (writeBuffersSize > 1) {
writeCtx.setBuffer(writeBuffer);
for (int i = 1; i < writeBuffersSize; i++) {
if (writeBuffers[i] != null) writeBuffers[i].release();
}
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getSoleWriteContextBuffer", writeBuffer);
return writeBuffer;
} | java | private WsByteBuffer getSoleWriteContextBuffer() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getSoleWriteContextBuffer");
WsByteBuffer writeBuffer = null;
final WsByteBuffer[] writeBuffers = writeCtx.getBuffers();
if (writeBuffers != null) {
final int writeBuffersSize = writeBuffers.length;
if (writeBuffersSize > 0) {
writeBuffer = writeBuffers[0];
if (writeBuffersSize > 1) {
writeCtx.setBuffer(writeBuffer);
for (int i = 1; i < writeBuffersSize; i++) {
if (writeBuffers[i] != null) writeBuffers[i].release();
}
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getSoleWriteContextBuffer", writeBuffer);
return writeBuffer;
} | [
"private",
"WsByteBuffer",
"getSoleWriteContextBuffer",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"getSoleWriteContextBuffer\"",
")",
";",
"WsByteBuffer",
"writeBuffer",
"=",
"null",
";",
"final",
"WsByteBuffer",
"[",
"]",
"writeBuffers",
"=",
"writeCtx",
".",
"getBuffers",
"(",
")",
";",
"if",
"(",
"writeBuffers",
"!=",
"null",
")",
"{",
"final",
"int",
"writeBuffersSize",
"=",
"writeBuffers",
".",
"length",
";",
"if",
"(",
"writeBuffersSize",
">",
"0",
")",
"{",
"writeBuffer",
"=",
"writeBuffers",
"[",
"0",
"]",
";",
"if",
"(",
"writeBuffersSize",
">",
"1",
")",
"{",
"writeCtx",
".",
"setBuffer",
"(",
"writeBuffer",
")",
";",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<",
"writeBuffersSize",
";",
"i",
"++",
")",
"{",
"if",
"(",
"writeBuffers",
"[",
"i",
"]",
"!=",
"null",
")",
"writeBuffers",
"[",
"i",
"]",
".",
"release",
"(",
")",
";",
"}",
"}",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"getSoleWriteContextBuffer\"",
",",
"writeBuffer",
")",
";",
"return",
"writeBuffer",
";",
"}"
] | Returns the first WsByteBuffer set in 'writeCtx', ensuring that it is the sole byte buffer set in 'writeCtx', and
releasing any other byte buffers that had been registered there.
@return the sole byte buffer set in 'writeCtx'; maybe null if there is no such byte buffer. | [
"Returns",
"the",
"first",
"WsByteBuffer",
"set",
"in",
"writeCtx",
"ensuring",
"that",
"it",
"is",
"the",
"sole",
"byte",
"buffer",
"set",
"in",
"writeCtx",
"and",
"releasing",
"any",
"other",
"byte",
"buffers",
"that",
"had",
"been",
"registered",
"there",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/ConnectionWriteCompletedCallback.java#L338-L356 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/ConnectionWriteCompletedCallback.java | ConnectionWriteCompletedCallback.physicalCloseNotification | protected void physicalCloseNotification() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "physicalCloseNotification");
synchronized(connectionClosedLock) {
connectionClosed = true;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "physicalCloseNotification");
} | java | protected void physicalCloseNotification() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "physicalCloseNotification");
synchronized(connectionClosedLock) {
connectionClosed = true;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "physicalCloseNotification");
} | [
"protected",
"void",
"physicalCloseNotification",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"physicalCloseNotification\"",
")",
";",
"synchronized",
"(",
"connectionClosedLock",
")",
"{",
"connectionClosed",
"=",
"true",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"physicalCloseNotification\"",
")",
";",
"}"
] | Register notification that the physical underlying connection has been closed. | [
"Register",
"notification",
"that",
"the",
"physical",
"underlying",
"connection",
"has",
"been",
"closed",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/ConnectionWriteCompletedCallback.java#L427-L433 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/ConnectionWriteCompletedCallback.java | ConnectionWriteCompletedCallback.isWorkAvailable | private boolean isWorkAvailable() throws SIConnectionDroppedException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "isWorkAvailable");
final boolean isWork;
if (terminate) {
isWork = false;
} else {
isWork = (partiallySentTransmission != null) || !priorityQueue.isEmpty();
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "isWorkAvailable", Boolean.valueOf(isWork));
return isWork;
} | java | private boolean isWorkAvailable() throws SIConnectionDroppedException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "isWorkAvailable");
final boolean isWork;
if (terminate) {
isWork = false;
} else {
isWork = (partiallySentTransmission != null) || !priorityQueue.isEmpty();
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "isWorkAvailable", Boolean.valueOf(isWork));
return isWork;
} | [
"private",
"boolean",
"isWorkAvailable",
"(",
")",
"throws",
"SIConnectionDroppedException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"isWorkAvailable\"",
")",
";",
"final",
"boolean",
"isWork",
";",
"if",
"(",
"terminate",
")",
"{",
"isWork",
"=",
"false",
";",
"}",
"else",
"{",
"isWork",
"=",
"(",
"partiallySentTransmission",
"!=",
"null",
")",
"||",
"!",
"priorityQueue",
".",
"isEmpty",
"(",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"isWorkAvailable\"",
",",
"Boolean",
".",
"valueOf",
"(",
"isWork",
")",
")",
";",
"return",
"isWork",
";",
"}"
] | Returns true iff there is more work available to be processed.
@return true iff there is more work available to be processed.
@throws SIConnectionDroppedException | [
"Returns",
"true",
"iff",
"there",
"is",
"more",
"work",
"available",
"to",
"be",
"processed",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/ConnectionWriteCompletedCallback.java#L501-L511 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.javaee.7.0_fat/fat/src/com/ibm/ws/javaee/v70/fat/FATServerHelper.java | FATServerHelper.addWarToServer | public static boolean addWarToServer(
LibertyServer targetServer, String targetDir,
String warName, String[] warPackageNames, boolean addWarResources) throws Exception {
String earName = null;
boolean addEarResources = DO_NOT_ADD_RESOURCES;
String jarName = null;
boolean addJarResources = DO_NOT_ADD_RESOURCES;
String[] jarPackageNames = null;
return addToServer(
targetServer, targetDir,
earName, addEarResources,
warName, warPackageNames, addWarResources,
jarName, jarPackageNames, addJarResources);
} | java | public static boolean addWarToServer(
LibertyServer targetServer, String targetDir,
String warName, String[] warPackageNames, boolean addWarResources) throws Exception {
String earName = null;
boolean addEarResources = DO_NOT_ADD_RESOURCES;
String jarName = null;
boolean addJarResources = DO_NOT_ADD_RESOURCES;
String[] jarPackageNames = null;
return addToServer(
targetServer, targetDir,
earName, addEarResources,
warName, warPackageNames, addWarResources,
jarName, jarPackageNames, addJarResources);
} | [
"public",
"static",
"boolean",
"addWarToServer",
"(",
"LibertyServer",
"targetServer",
",",
"String",
"targetDir",
",",
"String",
"warName",
",",
"String",
"[",
"]",
"warPackageNames",
",",
"boolean",
"addWarResources",
")",
"throws",
"Exception",
"{",
"String",
"earName",
"=",
"null",
";",
"boolean",
"addEarResources",
"=",
"DO_NOT_ADD_RESOURCES",
";",
"String",
"jarName",
"=",
"null",
";",
"boolean",
"addJarResources",
"=",
"DO_NOT_ADD_RESOURCES",
";",
"String",
"[",
"]",
"jarPackageNames",
"=",
"null",
";",
"return",
"addToServer",
"(",
"targetServer",
",",
"targetDir",
",",
"earName",
",",
"addEarResources",
",",
"warName",
",",
"warPackageNames",
",",
"addWarResources",
",",
"jarName",
",",
"jarPackageNames",
",",
"addJarResources",
")",
";",
"}"
] | Package a WAR and add it to a server.
The rules of {@link #addToServer} are followed, using a null
EAR name and a null JAR name.
@param targetServer The server to which to add the EAR or WAR.
@param targetDir The directory of the server in which to place
the EAR or WAR.
@param warName The name of the WAR which is to be created and added.
@param warPackageNames The names of packages to be placed in the WAR.
@param addWarResources Control parameter: Tells if resources are to
be added for the WAR.
@throws Exception Thrown if any of the steps fails. | [
"Package",
"a",
"WAR",
"and",
"add",
"it",
"to",
"a",
"server",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.javaee.7.0_fat/fat/src/com/ibm/ws/javaee/v70/fat/FATServerHelper.java#L47-L63 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.javaee.7.0_fat/fat/src/com/ibm/ws/javaee/v70/fat/FATServerHelper.java | FATServerHelper.addToServer | public static boolean addToServer(
LibertyServer targetServer, String targetDir,
String earName, boolean addEarResources,
String warName, String[] warPackageNames, boolean addWarResources,
String jarName, String[] jarPackageNames, boolean addJarResources) throws Exception {
if ( warName == null ) {
throw new IllegalArgumentException("A war name must be specified.");
}
if ( targetServer.isStarted() ) {
String appName = warName.substring(0, warName.indexOf(".war"));
if ( !targetServer.getInstalledAppNames(appName).isEmpty() ) {
return false;
}
}
JavaArchive jar;
if ( jarName == null ) {
jar = null;
} else {
jar = createJar(jarName, jarPackageNames, addJarResources); // throws Exception
}
WebArchive war = createWar(warName, warPackageNames, addWarResources, jar); // throws Exception
EnterpriseArchive ear;
if ( earName == null ) {
ear = null;
} else {
ear = createEar(earName, addEarResources, war); // throws Exception
}
if ( ear != null ) {
ShrinkHelper.exportToServer(targetServer, targetDir, ear); // throws Exception
} else {
ShrinkHelper.exportToServer(targetServer, targetDir, war); // throws Exception
}
return true;
} | java | public static boolean addToServer(
LibertyServer targetServer, String targetDir,
String earName, boolean addEarResources,
String warName, String[] warPackageNames, boolean addWarResources,
String jarName, String[] jarPackageNames, boolean addJarResources) throws Exception {
if ( warName == null ) {
throw new IllegalArgumentException("A war name must be specified.");
}
if ( targetServer.isStarted() ) {
String appName = warName.substring(0, warName.indexOf(".war"));
if ( !targetServer.getInstalledAppNames(appName).isEmpty() ) {
return false;
}
}
JavaArchive jar;
if ( jarName == null ) {
jar = null;
} else {
jar = createJar(jarName, jarPackageNames, addJarResources); // throws Exception
}
WebArchive war = createWar(warName, warPackageNames, addWarResources, jar); // throws Exception
EnterpriseArchive ear;
if ( earName == null ) {
ear = null;
} else {
ear = createEar(earName, addEarResources, war); // throws Exception
}
if ( ear != null ) {
ShrinkHelper.exportToServer(targetServer, targetDir, ear); // throws Exception
} else {
ShrinkHelper.exportToServer(targetServer, targetDir, war); // throws Exception
}
return true;
} | [
"public",
"static",
"boolean",
"addToServer",
"(",
"LibertyServer",
"targetServer",
",",
"String",
"targetDir",
",",
"String",
"earName",
",",
"boolean",
"addEarResources",
",",
"String",
"warName",
",",
"String",
"[",
"]",
"warPackageNames",
",",
"boolean",
"addWarResources",
",",
"String",
"jarName",
",",
"String",
"[",
"]",
"jarPackageNames",
",",
"boolean",
"addJarResources",
")",
"throws",
"Exception",
"{",
"if",
"(",
"warName",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"A war name must be specified.\"",
")",
";",
"}",
"if",
"(",
"targetServer",
".",
"isStarted",
"(",
")",
")",
"{",
"String",
"appName",
"=",
"warName",
".",
"substring",
"(",
"0",
",",
"warName",
".",
"indexOf",
"(",
"\".war\"",
")",
")",
";",
"if",
"(",
"!",
"targetServer",
".",
"getInstalledAppNames",
"(",
"appName",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"}",
"JavaArchive",
"jar",
";",
"if",
"(",
"jarName",
"==",
"null",
")",
"{",
"jar",
"=",
"null",
";",
"}",
"else",
"{",
"jar",
"=",
"createJar",
"(",
"jarName",
",",
"jarPackageNames",
",",
"addJarResources",
")",
";",
"// throws Exception",
"}",
"WebArchive",
"war",
"=",
"createWar",
"(",
"warName",
",",
"warPackageNames",
",",
"addWarResources",
",",
"jar",
")",
";",
"// throws Exception",
"EnterpriseArchive",
"ear",
";",
"if",
"(",
"earName",
"==",
"null",
")",
"{",
"ear",
"=",
"null",
";",
"}",
"else",
"{",
"ear",
"=",
"createEar",
"(",
"earName",
",",
"addEarResources",
",",
"war",
")",
";",
"// throws Exception",
"}",
"if",
"(",
"ear",
"!=",
"null",
")",
"{",
"ShrinkHelper",
".",
"exportToServer",
"(",
"targetServer",
",",
"targetDir",
",",
"ear",
")",
";",
"// throws Exception",
"}",
"else",
"{",
"ShrinkHelper",
".",
"exportToServer",
"(",
"targetServer",
",",
"targetDir",
",",
"war",
")",
";",
"// throws Exception",
"}",
"return",
"true",
";",
"}"
] | Conditionally, package a JAR, WAR, and EAR and add them to a
server.
Most often, the target directory is one of the standard server
folders for applications, {@link #DROPINS_DIR} or {@link #APPS_DIR}.
A WAR is always created. The WAR name parameter cannot be null.
A JAR and an EAR are not always created.
When the EAR name is null, the EAR is not created, and the the
WAR is added directly to the specified directory. When the EAR
name is not-null, an EAR is created and added to the specified
directory. The WAR is added to the server indirectly by adding
the WAR to the EAR.
When the JAR name is null no JAR is created. When the JAR name
is not null, the JAR is created and is added to the server
indirectly as a fragment JAR of the WAR. The JAR is not added
directly to the server.
Resources are added for each of the EAR, WAR, and JAR which are
created according to the corresponding 'addResources' parameter.
The source resources must be located in the "test-applications"
folder under the folder for the named archive as "resources".
For example,
<code>"test-applications/" + warName + "/resources"</code>
The package names are the fully qualified names of the packages
which are to be placed in the WAR and JAR which are created.
@param targetServer The server to which to add the EAR or WAR.
@param targetDir The directory of the server in which to place
the EAR or WAR.
@param earName The name of the EAR which is to be created and added.
@param addEarResources Control parameter: Tells if resources are to
be added for the EAR.
@param warName The name of the WAR which is to be created and added.
@param warPackageNames The names of packages to be placed in the WAR.
@param addWarResources Control parameter: Tells if resources are to
be added for the WAR.
@param jarName The name of the JAR which is to be created and added.
@param jarPackageNames The names of packages to be placed in the JAR.
EAR, WAR, and JAR.
@param addJarResources Control parameter: Tells if resources are to
be added for the JAR.
@throws Exception Thrown if any of the steps fails. | [
"Conditionally",
"package",
"a",
"JAR",
"WAR",
"and",
"EAR",
"and",
"add",
"them",
"to",
"a",
"server",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.javaee.7.0_fat/fat/src/com/ibm/ws/javaee/v70/fat/FATServerHelper.java#L158-L200 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/config/annotation/_ClassByteCodeAnnotationFilter.java | _ClassByteCodeAnnotationFilter.couldContainAnnotationsOnClassDef | public boolean couldContainAnnotationsOnClassDef(DataInput in,
Set<String> byteCodeAnnotationsNames)
throws IOException
{
/* According to Java VM Spec, each .class file contains
* a single class or interface definition. The structure
* definition is shown below:
ClassFile {
u4 magic;
u2 minor_version;
u2 major_version;
u2 constant_pool_count;
cp_info constant_pool[constant_pool_count-1];
u2 access_flags;
u2 this_class;
u2 super_class;
u2 interfaces_count;
u2 interfaces[interfaces_count];
u2 fields_count;
field_info fields[fields_count];
u2 methods_count;
method_info methods[methods_count];
u2 attributes_count;
attribute_info attributes[attributes_count];
}
* u1 = readUnsignedByte
* u2 = readUnsignedShort
* u4 = readInt
*
*/
int magic = in.readInt(); //u4
if (magic != 0xCAFEBABE)
{
//the file is not recognized as a class file
return false;
}
//u2 but since in java does not exists unsigned,
//store on a bigger value
int minorVersion = in.readUnsignedShort();//u2
int majorVersion = in.readUnsignedShort();//u2
if (majorVersion < 49)
{
//Compiled with jdk 1.4, so does not have annotations
return false;
}
//constantsPoolCount is the number of entries + 1
//The index goes from 1 to constantsPoolCount-1
int constantsPoolCount = in.readUnsignedShort();
for (int i = 1; i < constantsPoolCount; i++)
{
// Format:
// cp_info {
// u1 tag;
// u1 info[];
// }
int tag = in.readUnsignedByte();
switch (tag)
{
case CP_INFO_UTF8:
//u2 length
//u1 bytes[length]
//Check if the string is a annotation reference
//name
String name = in.readUTF();
if (byteCodeAnnotationsNames.contains(name))
{
return true;
}
break;
case CP_INFO_CLASS: //ignore
//u2 name_index
in.readUnsignedShort();
break;
case CP_INFO_FIELD_REF: //ignore
case CP_INFO_METHOD_REF: //ignore
case CP_INFO_INTERFACE_REF: //ignore
//u2 class_index
//u2 name_and_type_index
in.readUnsignedShort();
in.readUnsignedShort();
break;
case CP_INFO_STRING: //ignore
//u2 string_index
in.readUnsignedShort();
break;
case CP_INFO_INTEGER: //ignore
case CP_INFO_FLOAT: //ignore
//u4 bytes
in.readInt();
break;
case CP_INFO_LONG: //ignore
case CP_INFO_DOUBLE: //ignore
//u4 high_bytes
//u4 low_bytes
in.readInt();
in.readInt();
// this tag takes two entries in the constants pool
i++;
break;
case CP_INFO_NAME_AND_TYPE: //ignore
//u2 name_index
//u2 descriptor_index
in.readUnsignedShort();
in.readUnsignedShort();
break;
case CP_INFO_METHOD_HANDLE: // Ignore
// u1 reference_kind
// u2 reference_index
in.readUnsignedByte();
in.readUnsignedShort();
break;
case CP_INFO_METHOD_TYPE: // Ignore
// u2 descriptor_index
in.readUnsignedShort();
break;
case CP_INFO_INVOKE_DYNAMIC: // Ignore
// u2 bootstrap_method_attr_index;
// u2 name_and_type_index;
in.readUnsignedShort();
in.readUnsignedShort();
break;
default:
// THIS SHOULD NOT HAPPEN! Log error info
// and break for loop, because from this point
// we are reading corrupt data.
if (log.isLoggable(Level.WARNING))
{
log.warning("Unknown tag in constants pool: " + tag);
}
i = constantsPoolCount;
break;
}
}
return false;
} | java | public boolean couldContainAnnotationsOnClassDef(DataInput in,
Set<String> byteCodeAnnotationsNames)
throws IOException
{
/* According to Java VM Spec, each .class file contains
* a single class or interface definition. The structure
* definition is shown below:
ClassFile {
u4 magic;
u2 minor_version;
u2 major_version;
u2 constant_pool_count;
cp_info constant_pool[constant_pool_count-1];
u2 access_flags;
u2 this_class;
u2 super_class;
u2 interfaces_count;
u2 interfaces[interfaces_count];
u2 fields_count;
field_info fields[fields_count];
u2 methods_count;
method_info methods[methods_count];
u2 attributes_count;
attribute_info attributes[attributes_count];
}
* u1 = readUnsignedByte
* u2 = readUnsignedShort
* u4 = readInt
*
*/
int magic = in.readInt(); //u4
if (magic != 0xCAFEBABE)
{
//the file is not recognized as a class file
return false;
}
//u2 but since in java does not exists unsigned,
//store on a bigger value
int minorVersion = in.readUnsignedShort();//u2
int majorVersion = in.readUnsignedShort();//u2
if (majorVersion < 49)
{
//Compiled with jdk 1.4, so does not have annotations
return false;
}
//constantsPoolCount is the number of entries + 1
//The index goes from 1 to constantsPoolCount-1
int constantsPoolCount = in.readUnsignedShort();
for (int i = 1; i < constantsPoolCount; i++)
{
// Format:
// cp_info {
// u1 tag;
// u1 info[];
// }
int tag = in.readUnsignedByte();
switch (tag)
{
case CP_INFO_UTF8:
//u2 length
//u1 bytes[length]
//Check if the string is a annotation reference
//name
String name = in.readUTF();
if (byteCodeAnnotationsNames.contains(name))
{
return true;
}
break;
case CP_INFO_CLASS: //ignore
//u2 name_index
in.readUnsignedShort();
break;
case CP_INFO_FIELD_REF: //ignore
case CP_INFO_METHOD_REF: //ignore
case CP_INFO_INTERFACE_REF: //ignore
//u2 class_index
//u2 name_and_type_index
in.readUnsignedShort();
in.readUnsignedShort();
break;
case CP_INFO_STRING: //ignore
//u2 string_index
in.readUnsignedShort();
break;
case CP_INFO_INTEGER: //ignore
case CP_INFO_FLOAT: //ignore
//u4 bytes
in.readInt();
break;
case CP_INFO_LONG: //ignore
case CP_INFO_DOUBLE: //ignore
//u4 high_bytes
//u4 low_bytes
in.readInt();
in.readInt();
// this tag takes two entries in the constants pool
i++;
break;
case CP_INFO_NAME_AND_TYPE: //ignore
//u2 name_index
//u2 descriptor_index
in.readUnsignedShort();
in.readUnsignedShort();
break;
case CP_INFO_METHOD_HANDLE: // Ignore
// u1 reference_kind
// u2 reference_index
in.readUnsignedByte();
in.readUnsignedShort();
break;
case CP_INFO_METHOD_TYPE: // Ignore
// u2 descriptor_index
in.readUnsignedShort();
break;
case CP_INFO_INVOKE_DYNAMIC: // Ignore
// u2 bootstrap_method_attr_index;
// u2 name_and_type_index;
in.readUnsignedShort();
in.readUnsignedShort();
break;
default:
// THIS SHOULD NOT HAPPEN! Log error info
// and break for loop, because from this point
// we are reading corrupt data.
if (log.isLoggable(Level.WARNING))
{
log.warning("Unknown tag in constants pool: " + tag);
}
i = constantsPoolCount;
break;
}
}
return false;
} | [
"public",
"boolean",
"couldContainAnnotationsOnClassDef",
"(",
"DataInput",
"in",
",",
"Set",
"<",
"String",
">",
"byteCodeAnnotationsNames",
")",
"throws",
"IOException",
"{",
"/* According to Java VM Spec, each .class file contains\n * a single class or interface definition. The structure\n * definition is shown below:\n\n ClassFile {\n u4 magic;\n u2 minor_version;\n u2 major_version;\n u2 constant_pool_count;\n cp_info constant_pool[constant_pool_count-1];\n u2 access_flags;\n u2 this_class;\n u2 super_class;\n u2 interfaces_count;\n u2 interfaces[interfaces_count];\n u2 fields_count;\n field_info fields[fields_count];\n u2 methods_count;\n method_info methods[methods_count];\n u2 attributes_count;\n attribute_info attributes[attributes_count];\n }\n\n * u1 = readUnsignedByte \n * u2 = readUnsignedShort\n * u4 = readInt\n * \n */",
"int",
"magic",
"=",
"in",
".",
"readInt",
"(",
")",
";",
"//u4",
"if",
"(",
"magic",
"!=",
"0xCAFEBABE",
")",
"{",
"//the file is not recognized as a class file ",
"return",
"false",
";",
"}",
"//u2 but since in java does not exists unsigned,",
"//store on a bigger value",
"int",
"minorVersion",
"=",
"in",
".",
"readUnsignedShort",
"(",
")",
";",
"//u2",
"int",
"majorVersion",
"=",
"in",
".",
"readUnsignedShort",
"(",
")",
";",
"//u2",
"if",
"(",
"majorVersion",
"<",
"49",
")",
"{",
"//Compiled with jdk 1.4, so does not have annotations",
"return",
"false",
";",
"}",
"//constantsPoolCount is the number of entries + 1",
"//The index goes from 1 to constantsPoolCount-1",
"int",
"constantsPoolCount",
"=",
"in",
".",
"readUnsignedShort",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<",
"constantsPoolCount",
";",
"i",
"++",
")",
"{",
"// Format:",
"// cp_info {",
"// u1 tag;",
"// u1 info[];",
"// }",
"int",
"tag",
"=",
"in",
".",
"readUnsignedByte",
"(",
")",
";",
"switch",
"(",
"tag",
")",
"{",
"case",
"CP_INFO_UTF8",
":",
"//u2 length",
"//u1 bytes[length]",
"//Check if the string is a annotation reference",
"//name",
"String",
"name",
"=",
"in",
".",
"readUTF",
"(",
")",
";",
"if",
"(",
"byteCodeAnnotationsNames",
".",
"contains",
"(",
"name",
")",
")",
"{",
"return",
"true",
";",
"}",
"break",
";",
"case",
"CP_INFO_CLASS",
":",
"//ignore",
"//u2 name_index",
"in",
".",
"readUnsignedShort",
"(",
")",
";",
"break",
";",
"case",
"CP_INFO_FIELD_REF",
":",
"//ignore",
"case",
"CP_INFO_METHOD_REF",
":",
"//ignore",
"case",
"CP_INFO_INTERFACE_REF",
":",
"//ignore",
"//u2 class_index",
"//u2 name_and_type_index",
"in",
".",
"readUnsignedShort",
"(",
")",
";",
"in",
".",
"readUnsignedShort",
"(",
")",
";",
"break",
";",
"case",
"CP_INFO_STRING",
":",
"//ignore",
"//u2 string_index",
"in",
".",
"readUnsignedShort",
"(",
")",
";",
"break",
";",
"case",
"CP_INFO_INTEGER",
":",
"//ignore",
"case",
"CP_INFO_FLOAT",
":",
"//ignore",
"//u4 bytes",
"in",
".",
"readInt",
"(",
")",
";",
"break",
";",
"case",
"CP_INFO_LONG",
":",
"//ignore",
"case",
"CP_INFO_DOUBLE",
":",
"//ignore",
"//u4 high_bytes",
"//u4 low_bytes",
"in",
".",
"readInt",
"(",
")",
";",
"in",
".",
"readInt",
"(",
")",
";",
"// this tag takes two entries in the constants pool",
"i",
"++",
";",
"break",
";",
"case",
"CP_INFO_NAME_AND_TYPE",
":",
"//ignore",
"//u2 name_index",
"//u2 descriptor_index",
"in",
".",
"readUnsignedShort",
"(",
")",
";",
"in",
".",
"readUnsignedShort",
"(",
")",
";",
"break",
";",
"case",
"CP_INFO_METHOD_HANDLE",
":",
"// Ignore",
"// u1 reference_kind",
"// u2 reference_index",
"in",
".",
"readUnsignedByte",
"(",
")",
";",
"in",
".",
"readUnsignedShort",
"(",
")",
";",
"break",
";",
"case",
"CP_INFO_METHOD_TYPE",
":",
"// Ignore",
"// u2 descriptor_index",
"in",
".",
"readUnsignedShort",
"(",
")",
";",
"break",
";",
"case",
"CP_INFO_INVOKE_DYNAMIC",
":",
"// Ignore",
"// u2 bootstrap_method_attr_index;",
"// u2 name_and_type_index;",
"in",
".",
"readUnsignedShort",
"(",
")",
";",
"in",
".",
"readUnsignedShort",
"(",
")",
";",
"break",
";",
"default",
":",
"// THIS SHOULD NOT HAPPEN! Log error info",
"// and break for loop, because from this point",
"// we are reading corrupt data.",
"if",
"(",
"log",
".",
"isLoggable",
"(",
"Level",
".",
"WARNING",
")",
")",
"{",
"log",
".",
"warning",
"(",
"\"Unknown tag in constants pool: \"",
"+",
"tag",
")",
";",
"}",
"i",
"=",
"constantsPoolCount",
";",
"break",
";",
"}",
"}",
"return",
"false",
";",
"}"
] | Checks if the .class file referenced by the DataInput could
contain the annotation names available in the set.
@param in
@param byteCodeAnnotationsNames
@return
@throws IOException | [
"Checks",
"if",
"the",
".",
"class",
"file",
"referenced",
"by",
"the",
"DataInput",
"could",
"contain",
"the",
"annotation",
"names",
"available",
"in",
"the",
"set",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/config/annotation/_ClassByteCodeAnnotationFilter.java#L66-L211 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java | ThreadContext.getProperties | public Properties getProperties() {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "getProperties");
return this.sslProperties;
} | java | public Properties getProperties() {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "getProperties");
return this.sslProperties;
} | [
"public",
"Properties",
"getProperties",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"getProperties\"",
")",
";",
"return",
"this",
".",
"sslProperties",
";",
"}"
] | Access the current properties for this context.
@return Properties - null if not set | [
"Access",
"the",
"current",
"properties",
"for",
"this",
"context",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java#L56-L60 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java | ThreadContext.setProperties | public void setProperties(Properties sslProps) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "setProperties");
this.sslProperties = sslProps;
} | java | public void setProperties(Properties sslProps) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "setProperties");
this.sslProperties = sslProps;
} | [
"public",
"void",
"setProperties",
"(",
"Properties",
"sslProps",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"setProperties\"",
")",
";",
"this",
".",
"sslProperties",
"=",
"sslProps",
";",
"}"
] | Set the properties for this thread context.
@param sslProps | [
"Set",
"the",
"properties",
"for",
"this",
"thread",
"context",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java#L67-L71 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java | ThreadContext.getSetSignerOnThread | public boolean getSetSignerOnThread() {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "getSetSignerOnThread: " + this.setSignerOnThread);
return this.setSignerOnThread;
} | java | public boolean getSetSignerOnThread() {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "getSetSignerOnThread: " + this.setSignerOnThread);
return this.setSignerOnThread;
} | [
"public",
"boolean",
"getSetSignerOnThread",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"getSetSignerOnThread: \"",
"+",
"this",
".",
"setSignerOnThread",
")",
";",
"return",
"this",
".",
"setSignerOnThread",
";",
"}"
] | Query whether the signer flag is set on this context.
@return boolean | [
"Query",
"whether",
"the",
"signer",
"flag",
"is",
"set",
"on",
"this",
"context",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java#L78-L82 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java | ThreadContext.getAutoAcceptBootstrapSigner | public boolean getAutoAcceptBootstrapSigner() {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "getAutoAcceptBootstrapSigner: " + this.autoAcceptBootstrapSigner);
return this.autoAcceptBootstrapSigner;
} | java | public boolean getAutoAcceptBootstrapSigner() {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "getAutoAcceptBootstrapSigner: " + this.autoAcceptBootstrapSigner);
return this.autoAcceptBootstrapSigner;
} | [
"public",
"boolean",
"getAutoAcceptBootstrapSigner",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"getAutoAcceptBootstrapSigner: \"",
"+",
"this",
".",
"autoAcceptBootstrapSigner",
")",
";",
"return",
"this",
".",
"autoAcceptBootstrapSigner",
";",
"}"
] | Query whether the autoaccept bootstrap signer flag is set on this context.
@return boolean | [
"Query",
"whether",
"the",
"autoaccept",
"bootstrap",
"signer",
"flag",
"is",
"set",
"on",
"this",
"context",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java#L89-L93 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java | ThreadContext.getInboundConnectionInfo | public Map<String, Object> getInboundConnectionInfo() {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "getInboundConnectionInfo");
return this.inboundConnectionInfo;
} | java | public Map<String, Object> getInboundConnectionInfo() {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "getInboundConnectionInfo");
return this.inboundConnectionInfo;
} | [
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"getInboundConnectionInfo",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"getInboundConnectionInfo\"",
")",
";",
"return",
"this",
".",
"inboundConnectionInfo",
";",
"}"
] | Access the inbound connection info object for this context.
@return Map<String,Object> - null if not set | [
"Access",
"the",
"inbound",
"connection",
"info",
"object",
"for",
"this",
"context",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java#L100-L104 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java | ThreadContext.setAutoAcceptBootstrapSigner | public void setAutoAcceptBootstrapSigner(boolean flag) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "setAutoAcceptBootstrapSigner -> " + flag);
this.autoAcceptBootstrapSigner = flag;
} | java | public void setAutoAcceptBootstrapSigner(boolean flag) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "setAutoAcceptBootstrapSigner -> " + flag);
this.autoAcceptBootstrapSigner = flag;
} | [
"public",
"void",
"setAutoAcceptBootstrapSigner",
"(",
"boolean",
"flag",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"setAutoAcceptBootstrapSigner -> \"",
"+",
"flag",
")",
";",
"this",
".",
"autoAcceptBootstrapSigner",
"=",
"flag",
";",
"}"
] | Set the autoaccept bootstrap signer flag on this context to the input
value.
@param flag | [
"Set",
"the",
"autoaccept",
"bootstrap",
"signer",
"flag",
"on",
"this",
"context",
"to",
"the",
"input",
"value",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java#L112-L116 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java | ThreadContext.getAutoAcceptBootstrapSignerWithoutStorage | public boolean getAutoAcceptBootstrapSignerWithoutStorage() {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "getAutoAcceptBootstrapSignerWithoutStorage: " + this.autoAcceptBootstrapSignerWithoutStorage);
return this.autoAcceptBootstrapSignerWithoutStorage;
} | java | public boolean getAutoAcceptBootstrapSignerWithoutStorage() {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "getAutoAcceptBootstrapSignerWithoutStorage: " + this.autoAcceptBootstrapSignerWithoutStorage);
return this.autoAcceptBootstrapSignerWithoutStorage;
} | [
"public",
"boolean",
"getAutoAcceptBootstrapSignerWithoutStorage",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"getAutoAcceptBootstrapSignerWithoutStorage: \"",
"+",
"this",
".",
"autoAcceptBootstrapSignerWithoutStorage",
")",
";",
"return",
"this",
".",
"autoAcceptBootstrapSignerWithoutStorage",
";",
"}"
] | Query whether the autoaccept bootstrap signer without storage flag is set
on this context.
@return boolean | [
"Query",
"whether",
"the",
"autoaccept",
"bootstrap",
"signer",
"without",
"storage",
"flag",
"is",
"set",
"on",
"this",
"context",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java#L124-L128 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java | ThreadContext.setAutoAcceptBootstrapSignerWithoutStorage | public void setAutoAcceptBootstrapSignerWithoutStorage(boolean flag) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "setAutoAcceptBootstrapSignerWithoutStorage -> " + flag);
this.autoAcceptBootstrapSignerWithoutStorage = flag;
} | java | public void setAutoAcceptBootstrapSignerWithoutStorage(boolean flag) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "setAutoAcceptBootstrapSignerWithoutStorage -> " + flag);
this.autoAcceptBootstrapSignerWithoutStorage = flag;
} | [
"public",
"void",
"setAutoAcceptBootstrapSignerWithoutStorage",
"(",
"boolean",
"flag",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"setAutoAcceptBootstrapSignerWithoutStorage -> \"",
"+",
"flag",
")",
";",
"this",
".",
"autoAcceptBootstrapSignerWithoutStorage",
"=",
"flag",
";",
"}"
] | Set the autoaccept bootstrap signer without storage flag to the input
value.
@param flag | [
"Set",
"the",
"autoaccept",
"bootstrap",
"signer",
"without",
"storage",
"flag",
"to",
"the",
"input",
"value",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java#L136-L140 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java | ThreadContext.setSetSignerOnThread | public void setSetSignerOnThread(boolean flag) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "setSetSignerOnThread: " + flag);
this.setSignerOnThread = flag;
} | java | public void setSetSignerOnThread(boolean flag) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "setSetSignerOnThread: " + flag);
this.setSignerOnThread = flag;
} | [
"public",
"void",
"setSetSignerOnThread",
"(",
"boolean",
"flag",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"setSetSignerOnThread: \"",
"+",
"flag",
")",
";",
"this",
".",
"setSignerOnThread",
"=",
"flag",
";",
"}"
] | Set the signer flag on this context to the input value.
@param flag | [
"Set",
"the",
"signer",
"flag",
"on",
"this",
"context",
"to",
"the",
"input",
"value",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java#L147-L151 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java | ThreadContext.getSignerChain | public X509Certificate[] getSignerChain() {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "getSignerChain");
return signer == null ? null : signer.clone();
} | java | public X509Certificate[] getSignerChain() {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "getSignerChain");
return signer == null ? null : signer.clone();
} | [
"public",
"X509Certificate",
"[",
"]",
"getSignerChain",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"getSignerChain\"",
")",
";",
"return",
"signer",
"==",
"null",
"?",
"null",
":",
"signer",
".",
"clone",
"(",
")",
";",
"}"
] | Query the signer chain set on this context.
@return X509Certificate[] - null if not set | [
"Query",
"the",
"signer",
"chain",
"set",
"on",
"this",
"context",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java#L158-L162 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java | ThreadContext.setSignerChain | public void setSignerChain(X509Certificate[] signerChain) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "setSignerChain");
this.signer = signerChain == null ? null : signerChain.clone();
} | java | public void setSignerChain(X509Certificate[] signerChain) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "setSignerChain");
this.signer = signerChain == null ? null : signerChain.clone();
} | [
"public",
"void",
"setSignerChain",
"(",
"X509Certificate",
"[",
"]",
"signerChain",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"setSignerChain\"",
")",
";",
"this",
".",
"signer",
"=",
"signerChain",
"==",
"null",
"?",
"null",
":",
"signerChain",
".",
"clone",
"(",
")",
";",
"}"
] | Set the signer chain on this context to the input value.
@param signerChain | [
"Set",
"the",
"signer",
"chain",
"on",
"this",
"context",
"to",
"the",
"input",
"value",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java#L169-L173 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java | ThreadContext.setInboundConnectionInfo | public void setInboundConnectionInfo(Map<String, Object> connectionInfo) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "setInboundConnectionInfo");
this.inboundConnectionInfo = connectionInfo;
} | java | public void setInboundConnectionInfo(Map<String, Object> connectionInfo) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "setInboundConnectionInfo");
this.inboundConnectionInfo = connectionInfo;
} | [
"public",
"void",
"setInboundConnectionInfo",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"connectionInfo",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"setInboundConnectionInfo\"",
")",
";",
"this",
".",
"inboundConnectionInfo",
"=",
"connectionInfo",
";",
"}"
] | Set the inbound connection info on this context to the input value.
@param connectionInfo | [
"Set",
"the",
"inbound",
"connection",
"info",
"on",
"this",
"context",
"to",
"the",
"input",
"value",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java#L180-L184 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java | ThreadContext.getOutboundConnectionInfo | public Map<String, Object> getOutboundConnectionInfo() {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "getOutboundConnectionInfo");
return this.outboundConnectionInfo;
} | java | public Map<String, Object> getOutboundConnectionInfo() {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "getOutboundConnectionInfo");
return this.outboundConnectionInfo;
} | [
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"getOutboundConnectionInfo",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"getOutboundConnectionInfo\"",
")",
";",
"return",
"this",
".",
"outboundConnectionInfo",
";",
"}"
] | Query the outbound connection info map of this context.
@return Map<String,Object> - null if not set | [
"Query",
"the",
"outbound",
"connection",
"info",
"map",
"of",
"this",
"context",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java#L191-L195 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java | ThreadContext.setOutboundConnectionInfo | public void setOutboundConnectionInfo(Map<String, Object> connectionInfo) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "setOutboundConnectionInfo");
this.outboundConnectionInfo = connectionInfo;
} | java | public void setOutboundConnectionInfo(Map<String, Object> connectionInfo) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "setOutboundConnectionInfo");
this.outboundConnectionInfo = connectionInfo;
} | [
"public",
"void",
"setOutboundConnectionInfo",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"connectionInfo",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"setOutboundConnectionInfo\"",
")",
";",
"this",
".",
"outboundConnectionInfo",
"=",
"connectionInfo",
";",
"}"
] | Set the outbound connection info of this context to the input value.
@param connectionInfo | [
"Set",
"the",
"outbound",
"connection",
"info",
"of",
"this",
"context",
"to",
"the",
"input",
"value",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java#L202-L206 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java | ThreadContext.getOutboundConnectionInfoInternal | public Map<String, Object> getOutboundConnectionInfoInternal() {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "getOutboundConnectionInfoInternal");
return this.outboundConnectionInfoInternal;
} | java | public Map<String, Object> getOutboundConnectionInfoInternal() {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "getOutboundConnectionInfoInternal");
return this.outboundConnectionInfoInternal;
} | [
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"getOutboundConnectionInfoInternal",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"getOutboundConnectionInfoInternal\"",
")",
";",
"return",
"this",
".",
"outboundConnectionInfoInternal",
";",
"}"
] | Get the internal outbound connection info object for this context.
@return Map<String,Object> - null if not set | [
"Get",
"the",
"internal",
"outbound",
"connection",
"info",
"object",
"for",
"this",
"context",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java#L213-L217 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java | ThreadContext.setOutboundConnectionInfoInternal | public void setOutboundConnectionInfoInternal(Map<String, Object> connectionInfo) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "setOutboundConnectionInfoInternal :" + connectionInfo);
this.outboundConnectionInfoInternal = connectionInfo;
} | java | public void setOutboundConnectionInfoInternal(Map<String, Object> connectionInfo) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "setOutboundConnectionInfoInternal :" + connectionInfo);
this.outboundConnectionInfoInternal = connectionInfo;
} | [
"public",
"void",
"setOutboundConnectionInfoInternal",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"connectionInfo",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"setOutboundConnectionInfoInternal :\"",
"+",
"connectionInfo",
")",
";",
"this",
".",
"outboundConnectionInfoInternal",
"=",
"connectionInfo",
";",
"}"
] | Set the internal outbound connection info object for this context.
@param connectionInfo | [
"Set",
"the",
"internal",
"outbound",
"connection",
"info",
"object",
"for",
"this",
"context",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/ThreadContext.java#L224-L228 | train |
OpenLiberty/open-liberty | dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/services/impl/AbstractPersistenceManager.java | AbstractPersistenceManager.serializeObject | protected byte[] serializeObject(Serializable theObject) throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oout = new ObjectOutputStream(baos);
oout.writeObject(theObject);
byte[] data = baos.toByteArray();
baos.close();
oout.close();
return data;
} | java | protected byte[] serializeObject(Serializable theObject) throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oout = new ObjectOutputStream(baos);
oout.writeObject(theObject);
byte[] data = baos.toByteArray();
baos.close();
oout.close();
return data;
} | [
"protected",
"byte",
"[",
"]",
"serializeObject",
"(",
"Serializable",
"theObject",
")",
"throws",
"IOException",
"{",
"ByteArrayOutputStream",
"baos",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"ObjectOutputStream",
"oout",
"=",
"new",
"ObjectOutputStream",
"(",
"baos",
")",
";",
"oout",
".",
"writeObject",
"(",
"theObject",
")",
";",
"byte",
"[",
"]",
"data",
"=",
"baos",
".",
"toByteArray",
"(",
")",
";",
"baos",
".",
"close",
"(",
")",
";",
"oout",
".",
"close",
"(",
")",
";",
"return",
"data",
";",
"}"
] | This method is used to serialized an object saved into a table BLOB field.
@param theObject the object to be serialized
@return a object byte array
@throws IOException | [
"This",
"method",
"is",
"used",
"to",
"serialized",
"an",
"object",
"saved",
"into",
"a",
"table",
"BLOB",
"field",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/services/impl/AbstractPersistenceManager.java#L278-L288 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/JPAPuId.java | JPAPuId.setPuName | public void setPuName(String puName)
{
// re-initialize puName only if it has not been set to avoid
// overriding valid relative puName defined in annotation/dd.
if (ivPuName == null || ivPuName.length() == 0) // d442457
{
ivPuName = puName;
reComputeHashCode(); // d416151.3.9
}
} | java | public void setPuName(String puName)
{
// re-initialize puName only if it has not been set to avoid
// overriding valid relative puName defined in annotation/dd.
if (ivPuName == null || ivPuName.length() == 0) // d442457
{
ivPuName = puName;
reComputeHashCode(); // d416151.3.9
}
} | [
"public",
"void",
"setPuName",
"(",
"String",
"puName",
")",
"{",
"// re-initialize puName only if it has not been set to avoid",
"// overriding valid relative puName defined in annotation/dd.",
"if",
"(",
"ivPuName",
"==",
"null",
"||",
"ivPuName",
".",
"length",
"(",
")",
"==",
"0",
")",
"// d442457",
"{",
"ivPuName",
"=",
"puName",
";",
"reComputeHashCode",
"(",
")",
";",
"// d416151.3.9",
"}",
"}"
] | Persistence unit name setter. | [
"Persistence",
"unit",
"name",
"setter",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/JPAPuId.java#L78-L87 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/JPAPuId.java | JPAPuId.reComputeHashCode | private void reComputeHashCode()
{
ivCurHashCode = (ivAppName != null ? ivAppName.hashCode() : 0) // d437828
+ (ivModJarName != null ? ivModJarName.hashCode() : 0)
+ (ivPuName != null ? ivPuName.hashCode() : 0);
} | java | private void reComputeHashCode()
{
ivCurHashCode = (ivAppName != null ? ivAppName.hashCode() : 0) // d437828
+ (ivModJarName != null ? ivModJarName.hashCode() : 0)
+ (ivPuName != null ? ivPuName.hashCode() : 0);
} | [
"private",
"void",
"reComputeHashCode",
"(",
")",
"{",
"ivCurHashCode",
"=",
"(",
"ivAppName",
"!=",
"null",
"?",
"ivAppName",
".",
"hashCode",
"(",
")",
":",
"0",
")",
"// d437828",
"+",
"(",
"ivModJarName",
"!=",
"null",
"?",
"ivModJarName",
".",
"hashCode",
"(",
")",
":",
"0",
")",
"+",
"(",
"ivPuName",
"!=",
"null",
"?",
"ivPuName",
".",
"hashCode",
"(",
")",
":",
"0",
")",
";",
"}"
] | Compute and cache the current hashCode. | [
"Compute",
"and",
"cache",
"the",
"current",
"hashCode",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/JPAPuId.java#L129-L134 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/ChannelDataImpl.java | ChannelDataImpl.createChild | public ChildChannelDataImpl createChild() {
String childName = this.name + CHILD_STRING + nextChildId();
ChildChannelDataImpl child = new ChildChannelDataImpl(childName, this);
this.children.add(child);
return child;
} | java | public ChildChannelDataImpl createChild() {
String childName = this.name + CHILD_STRING + nextChildId();
ChildChannelDataImpl child = new ChildChannelDataImpl(childName, this);
this.children.add(child);
return child;
} | [
"public",
"ChildChannelDataImpl",
"createChild",
"(",
")",
"{",
"String",
"childName",
"=",
"this",
".",
"name",
"+",
"CHILD_STRING",
"+",
"nextChildId",
"(",
")",
";",
"ChildChannelDataImpl",
"child",
"=",
"new",
"ChildChannelDataImpl",
"(",
"childName",
",",
"this",
")",
";",
"this",
".",
"children",
".",
"add",
"(",
"child",
")",
";",
"return",
"child",
";",
"}"
] | Create a child data object. Add it to the list of children and return it.
@return child channel data object | [
"Create",
"a",
"child",
"data",
"object",
".",
"Add",
"it",
"to",
"the",
"list",
"of",
"children",
"and",
"return",
"it",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/channelfw/internal/ChannelDataImpl.java#L229-L234 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/ReadableLogRecord.java | ReadableLogRecord.read | private static ReadableLogRecord read(ByteBuffer viewBuffer, long expectedSequenceNumber, ByteBuffer sourceBuffer)
{
ReadableLogRecord logRecord = null;
int absolutePosition = sourceBuffer.position() + viewBuffer.position();
// Read the record magic number field.
final byte[] magicNumberBuffer = new byte[RECORD_MAGIC_NUMBER.length];
viewBuffer.get(magicNumberBuffer);
int recordLength = 0;
if (Arrays.equals(magicNumberBuffer, RECORD_MAGIC_NUMBER))
{
long recordSequenceNumber = viewBuffer.getLong();
if (recordSequenceNumber >= expectedSequenceNumber)
{
// The record sequence is consistent with the expected sequence number supplied by the
// caller. So skip over the actual log record data in this record so that
// we can check the tail sequence number.
recordLength = viewBuffer.getInt();
// Preserve the current byte cursor position so that we can reset back to it later.
// Move the byte cursor to the first byte after the record data.
final int recordDataPosition = viewBuffer.position();
viewBuffer.position(recordDataPosition + recordLength);
// Read the repeated record sequence number
final long tailSequenceNumber = viewBuffer.getLong();
// Because are are only looking for sequence numbers larger than expected the only assurance that we
// have not read garbage following the magic number is that the first and tail sequence numbers are equal.
// Note its still possible garbage is in the data but that can't be helped without changing the log format.
// It will be discovered later no doubt!
if (tailSequenceNumber == recordSequenceNumber)
{
// Return the buffer's pointer to the start of
// the record's data prior to creating a new
// ReadableLogRecord to return to the caller.
viewBuffer.position(recordDataPosition);
logRecord = new ReadableLogRecord(viewBuffer, absolutePosition, tailSequenceNumber);
// Advance the original buffer's position to the end of this record. This ensures that
// the next ReadableLogRecord or WritableLogRecord constructed will read or write the
// next record in the file.
sourceBuffer.position(absolutePosition + HEADER_SIZE + recordLength);
}
}
}
return logRecord;
} | java | private static ReadableLogRecord read(ByteBuffer viewBuffer, long expectedSequenceNumber, ByteBuffer sourceBuffer)
{
ReadableLogRecord logRecord = null;
int absolutePosition = sourceBuffer.position() + viewBuffer.position();
// Read the record magic number field.
final byte[] magicNumberBuffer = new byte[RECORD_MAGIC_NUMBER.length];
viewBuffer.get(magicNumberBuffer);
int recordLength = 0;
if (Arrays.equals(magicNumberBuffer, RECORD_MAGIC_NUMBER))
{
long recordSequenceNumber = viewBuffer.getLong();
if (recordSequenceNumber >= expectedSequenceNumber)
{
// The record sequence is consistent with the expected sequence number supplied by the
// caller. So skip over the actual log record data in this record so that
// we can check the tail sequence number.
recordLength = viewBuffer.getInt();
// Preserve the current byte cursor position so that we can reset back to it later.
// Move the byte cursor to the first byte after the record data.
final int recordDataPosition = viewBuffer.position();
viewBuffer.position(recordDataPosition + recordLength);
// Read the repeated record sequence number
final long tailSequenceNumber = viewBuffer.getLong();
// Because are are only looking for sequence numbers larger than expected the only assurance that we
// have not read garbage following the magic number is that the first and tail sequence numbers are equal.
// Note its still possible garbage is in the data but that can't be helped without changing the log format.
// It will be discovered later no doubt!
if (tailSequenceNumber == recordSequenceNumber)
{
// Return the buffer's pointer to the start of
// the record's data prior to creating a new
// ReadableLogRecord to return to the caller.
viewBuffer.position(recordDataPosition);
logRecord = new ReadableLogRecord(viewBuffer, absolutePosition, tailSequenceNumber);
// Advance the original buffer's position to the end of this record. This ensures that
// the next ReadableLogRecord or WritableLogRecord constructed will read or write the
// next record in the file.
sourceBuffer.position(absolutePosition + HEADER_SIZE + recordLength);
}
}
}
return logRecord;
} | [
"private",
"static",
"ReadableLogRecord",
"read",
"(",
"ByteBuffer",
"viewBuffer",
",",
"long",
"expectedSequenceNumber",
",",
"ByteBuffer",
"sourceBuffer",
")",
"{",
"ReadableLogRecord",
"logRecord",
"=",
"null",
";",
"int",
"absolutePosition",
"=",
"sourceBuffer",
".",
"position",
"(",
")",
"+",
"viewBuffer",
".",
"position",
"(",
")",
";",
"// Read the record magic number field.",
"final",
"byte",
"[",
"]",
"magicNumberBuffer",
"=",
"new",
"byte",
"[",
"RECORD_MAGIC_NUMBER",
".",
"length",
"]",
";",
"viewBuffer",
".",
"get",
"(",
"magicNumberBuffer",
")",
";",
"int",
"recordLength",
"=",
"0",
";",
"if",
"(",
"Arrays",
".",
"equals",
"(",
"magicNumberBuffer",
",",
"RECORD_MAGIC_NUMBER",
")",
")",
"{",
"long",
"recordSequenceNumber",
"=",
"viewBuffer",
".",
"getLong",
"(",
")",
";",
"if",
"(",
"recordSequenceNumber",
">=",
"expectedSequenceNumber",
")",
"{",
"// The record sequence is consistent with the expected sequence number supplied by the",
"// caller. So skip over the actual log record data in this record so that",
"// we can check the tail sequence number.",
"recordLength",
"=",
"viewBuffer",
".",
"getInt",
"(",
")",
";",
"// Preserve the current byte cursor position so that we can reset back to it later. ",
"// Move the byte cursor to the first byte after the record data.",
"final",
"int",
"recordDataPosition",
"=",
"viewBuffer",
".",
"position",
"(",
")",
";",
"viewBuffer",
".",
"position",
"(",
"recordDataPosition",
"+",
"recordLength",
")",
";",
"// Read the repeated record sequence number",
"final",
"long",
"tailSequenceNumber",
"=",
"viewBuffer",
".",
"getLong",
"(",
")",
";",
"// Because are are only looking for sequence numbers larger than expected the only assurance that we",
"// have not read garbage following the magic number is that the first and tail sequence numbers are equal.",
"// Note its still possible garbage is in the data but that can't be helped without changing the log format.",
"// It will be discovered later no doubt!",
"if",
"(",
"tailSequenceNumber",
"==",
"recordSequenceNumber",
")",
"{",
"// Return the buffer's pointer to the start of",
"// the record's data prior to creating a new",
"// ReadableLogRecord to return to the caller.",
"viewBuffer",
".",
"position",
"(",
"recordDataPosition",
")",
";",
"logRecord",
"=",
"new",
"ReadableLogRecord",
"(",
"viewBuffer",
",",
"absolutePosition",
",",
"tailSequenceNumber",
")",
";",
"// Advance the original buffer's position to the end of this record. This ensures that",
"// the next ReadableLogRecord or WritableLogRecord constructed will read or write the",
"// next record in the file.",
"sourceBuffer",
".",
"position",
"(",
"absolutePosition",
"+",
"HEADER_SIZE",
"+",
"recordLength",
")",
";",
"}",
"}",
"}",
"return",
"logRecord",
";",
"}"
] | careful with trace in this method as it is called many times from doByteByByteScanning | [
"careful",
"with",
"trace",
"in",
"this",
"method",
"as",
"it",
"is",
"called",
"many",
"times",
"from",
"doByteByByteScanning"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/ReadableLogRecord.java#L87-L141 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/ReadableLogRecord.java | ReadableLogRecord.doByteByByteScanning | private static ReadableLogRecord doByteByByteScanning(ByteBuffer sourceBuffer, long expectedSequenceNumber)
{
if (tc.isEntryEnabled()) Tr.entry(tc, "doByteByByteScanning", new Object[] {sourceBuffer, new Long(expectedSequenceNumber)});
ReadableLogRecord logRecord = null;
ByteBuffer viewBuffer = sourceBuffer.slice();
// If there is a partial write, or a missing record, the next valid record will be at least LogRecord.HEADER_SIZE
// forward from the current position so skip to that in the viewBuffer and start from there.
for (int position = LogRecord.HEADER_SIZE;
position + LogRecord.HEADER_SIZE < viewBuffer.limit(); // its possible we will be able to find a record in the remainder
position++)
{
viewBuffer.position(position);
// Peak 2 bytes to get RC in RCRD before bothering to try parse a Record.
// This saves stack frames and avoids some Exceptions which should help with startup times
byte peak = viewBuffer.get(position);
if (peak == 82) // 'R'
{
peak = viewBuffer.get(position + 1);
if (peak == 67) // C - its a kinda magic, worth having a go.
{
try
{
logRecord = read(viewBuffer, expectedSequenceNumber, sourceBuffer);
if (logRecord != null)
break; // we found a valid record, sourceBuffer position has been updated
}
catch (RuntimeException e)
{
// No FFDC code needed
// continue till the end of the loop
}
}
}
}
if (tc.isEntryEnabled()) Tr.exit(tc, "doByteByByteScanning", logRecord);
return logRecord;
} | java | private static ReadableLogRecord doByteByByteScanning(ByteBuffer sourceBuffer, long expectedSequenceNumber)
{
if (tc.isEntryEnabled()) Tr.entry(tc, "doByteByByteScanning", new Object[] {sourceBuffer, new Long(expectedSequenceNumber)});
ReadableLogRecord logRecord = null;
ByteBuffer viewBuffer = sourceBuffer.slice();
// If there is a partial write, or a missing record, the next valid record will be at least LogRecord.HEADER_SIZE
// forward from the current position so skip to that in the viewBuffer and start from there.
for (int position = LogRecord.HEADER_SIZE;
position + LogRecord.HEADER_SIZE < viewBuffer.limit(); // its possible we will be able to find a record in the remainder
position++)
{
viewBuffer.position(position);
// Peak 2 bytes to get RC in RCRD before bothering to try parse a Record.
// This saves stack frames and avoids some Exceptions which should help with startup times
byte peak = viewBuffer.get(position);
if (peak == 82) // 'R'
{
peak = viewBuffer.get(position + 1);
if (peak == 67) // C - its a kinda magic, worth having a go.
{
try
{
logRecord = read(viewBuffer, expectedSequenceNumber, sourceBuffer);
if (logRecord != null)
break; // we found a valid record, sourceBuffer position has been updated
}
catch (RuntimeException e)
{
// No FFDC code needed
// continue till the end of the loop
}
}
}
}
if (tc.isEntryEnabled()) Tr.exit(tc, "doByteByByteScanning", logRecord);
return logRecord;
} | [
"private",
"static",
"ReadableLogRecord",
"doByteByByteScanning",
"(",
"ByteBuffer",
"sourceBuffer",
",",
"long",
"expectedSequenceNumber",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"doByteByByteScanning\"",
",",
"new",
"Object",
"[",
"]",
"{",
"sourceBuffer",
",",
"new",
"Long",
"(",
"expectedSequenceNumber",
")",
"}",
")",
";",
"ReadableLogRecord",
"logRecord",
"=",
"null",
";",
"ByteBuffer",
"viewBuffer",
"=",
"sourceBuffer",
".",
"slice",
"(",
")",
";",
"// If there is a partial write, or a missing record, the next valid record will be at least LogRecord.HEADER_SIZE",
"// forward from the current position so skip to that in the viewBuffer and start from there.",
"for",
"(",
"int",
"position",
"=",
"LogRecord",
".",
"HEADER_SIZE",
";",
"position",
"+",
"LogRecord",
".",
"HEADER_SIZE",
"<",
"viewBuffer",
".",
"limit",
"(",
")",
";",
"// its possible we will be able to find a record in the remainder ",
"position",
"++",
")",
"{",
"viewBuffer",
".",
"position",
"(",
"position",
")",
";",
"// Peak 2 bytes to get RC in RCRD before bothering to try parse a Record.",
"// This saves stack frames and avoids some Exceptions which should help with startup times",
"byte",
"peak",
"=",
"viewBuffer",
".",
"get",
"(",
"position",
")",
";",
"if",
"(",
"peak",
"==",
"82",
")",
"// 'R'",
"{",
"peak",
"=",
"viewBuffer",
".",
"get",
"(",
"position",
"+",
"1",
")",
";",
"if",
"(",
"peak",
"==",
"67",
")",
"// C - its a kinda magic, worth having a go.",
"{",
"try",
"{",
"logRecord",
"=",
"read",
"(",
"viewBuffer",
",",
"expectedSequenceNumber",
",",
"sourceBuffer",
")",
";",
"if",
"(",
"logRecord",
"!=",
"null",
")",
"break",
";",
"// we found a valid record, sourceBuffer position has been updated",
"}",
"catch",
"(",
"RuntimeException",
"e",
")",
"{",
"// No FFDC code needed",
"// continue till the end of the loop",
"}",
"}",
"}",
"}",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"doByteByByteScanning\"",
",",
"logRecord",
")",
";",
"return",
"logRecord",
";",
"}"
] | careful with trace in this methods loop | [
"careful",
"with",
"trace",
"in",
"this",
"methods",
"loop"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/ReadableLogRecord.java#L144-L183 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.core/src/com/ibm/ws/kernel/provisioning/packages/PackageIndex.java | PackageIndex.add | public synchronized boolean add(String key, T value) {
if (key.length() > 3 && key.endsWith(WILDCARD) && key.charAt(key.length() - 2) != '.') {
throw new IllegalArgumentException("Unsupported use of wildcard in key " + key);
}
// Find the key in the structure (build out to it)
Node<T> current = internalFind(key, false);
// Return false if the key already exists
if (current.getValue() != null)
return false;
// Set the value and return true
current.setValue(value);
return true;
} | java | public synchronized boolean add(String key, T value) {
if (key.length() > 3 && key.endsWith(WILDCARD) && key.charAt(key.length() - 2) != '.') {
throw new IllegalArgumentException("Unsupported use of wildcard in key " + key);
}
// Find the key in the structure (build out to it)
Node<T> current = internalFind(key, false);
// Return false if the key already exists
if (current.getValue() != null)
return false;
// Set the value and return true
current.setValue(value);
return true;
} | [
"public",
"synchronized",
"boolean",
"add",
"(",
"String",
"key",
",",
"T",
"value",
")",
"{",
"if",
"(",
"key",
".",
"length",
"(",
")",
">",
"3",
"&&",
"key",
".",
"endsWith",
"(",
"WILDCARD",
")",
"&&",
"key",
".",
"charAt",
"(",
"key",
".",
"length",
"(",
")",
"-",
"2",
")",
"!=",
"'",
"'",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Unsupported use of wildcard in key \"",
"+",
"key",
")",
";",
"}",
"// Find the key in the structure (build out to it)",
"Node",
"<",
"T",
">",
"current",
"=",
"internalFind",
"(",
"key",
",",
"false",
")",
";",
"// Return false if the key already exists",
"if",
"(",
"current",
".",
"getValue",
"(",
")",
"!=",
"null",
")",
"return",
"false",
";",
"// Set the value and return true",
"current",
".",
"setValue",
"(",
"value",
")",
";",
"return",
"true",
";",
"}"
] | Add a new value using the given key.
@param key Key, this is string
@param value Value to associate with the key
@return true if key successfully added, false if there was a collision. | [
"Add",
"a",
"new",
"value",
"using",
"the",
"given",
"key",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.core/src/com/ibm/ws/kernel/provisioning/packages/PackageIndex.java#L158-L173 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.core/src/com/ibm/ws/kernel/provisioning/packages/PackageIndex.java | PackageIndex.compact | public void compact() {
// Bare-bones iterator: no filter, don't bother with package strings
for (NodeIterator<T> i = this.getNodeIterator(); i.hasNext();) {
NodeIndex<T> n = i.next();
if (n.node.exactKids != null)
n.node.exactKids.trimToSize();
}
} | java | public void compact() {
// Bare-bones iterator: no filter, don't bother with package strings
for (NodeIterator<T> i = this.getNodeIterator(); i.hasNext();) {
NodeIndex<T> n = i.next();
if (n.node.exactKids != null)
n.node.exactKids.trimToSize();
}
} | [
"public",
"void",
"compact",
"(",
")",
"{",
"// Bare-bones iterator: no filter, don't bother with package strings",
"for",
"(",
"NodeIterator",
"<",
"T",
">",
"i",
"=",
"this",
".",
"getNodeIterator",
"(",
")",
";",
"i",
".",
"hasNext",
"(",
")",
";",
")",
"{",
"NodeIndex",
"<",
"T",
">",
"n",
"=",
"i",
".",
"next",
"(",
")",
";",
"if",
"(",
"n",
".",
"node",
".",
"exactKids",
"!=",
"null",
")",
"n",
".",
"node",
".",
"exactKids",
".",
"trimToSize",
"(",
")",
";",
"}",
"}"
] | Compact any empty space after a read-only trie has been constructed | [
"Compact",
"any",
"empty",
"space",
"after",
"a",
"read",
"-",
"only",
"trie",
"has",
"been",
"constructed"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.core/src/com/ibm/ws/kernel/provisioning/packages/PackageIndex.java#L250-L257 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.core/src/com/ibm/ws/kernel/provisioning/packages/PackageIndex.java | PackageIndex.dump | public String dump() {
StringBuilder s = new StringBuilder();
int c = 0;
// we need the flavor of iterator that does build up a package string so we can
// include it in the generated string
s.append(nl);
for (NodeIterator<T> i = this.getNodeIterator(null); i.hasNext();) {
NodeIndex<T> n = i.next();
c++;
s.append('\t').append(n.pkg).append(" = ").append(n.node.getValue()).append(nl);
}
s.append("\t---> ").append(c).append(" elements");
return s.toString();
} | java | public String dump() {
StringBuilder s = new StringBuilder();
int c = 0;
// we need the flavor of iterator that does build up a package string so we can
// include it in the generated string
s.append(nl);
for (NodeIterator<T> i = this.getNodeIterator(null); i.hasNext();) {
NodeIndex<T> n = i.next();
c++;
s.append('\t').append(n.pkg).append(" = ").append(n.node.getValue()).append(nl);
}
s.append("\t---> ").append(c).append(" elements");
return s.toString();
} | [
"public",
"String",
"dump",
"(",
")",
"{",
"StringBuilder",
"s",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"int",
"c",
"=",
"0",
";",
"// we need the flavor of iterator that does build up a package string so we can",
"// include it in the generated string",
"s",
".",
"append",
"(",
"nl",
")",
";",
"for",
"(",
"NodeIterator",
"<",
"T",
">",
"i",
"=",
"this",
".",
"getNodeIterator",
"(",
"null",
")",
";",
"i",
".",
"hasNext",
"(",
")",
";",
")",
"{",
"NodeIndex",
"<",
"T",
">",
"n",
"=",
"i",
".",
"next",
"(",
")",
";",
"c",
"++",
";",
"s",
".",
"append",
"(",
"'",
"'",
")",
".",
"append",
"(",
"n",
".",
"pkg",
")",
".",
"append",
"(",
"\" = \"",
")",
".",
"append",
"(",
"n",
".",
"node",
".",
"getValue",
"(",
")",
")",
".",
"append",
"(",
"nl",
")",
";",
"}",
"s",
".",
"append",
"(",
"\"\\t---> \"",
")",
".",
"append",
"(",
"c",
")",
".",
"append",
"(",
"\" elements\"",
")",
";",
"return",
"s",
".",
"toString",
"(",
")",
";",
"}"
] | Debugging during test, dump for FFDC
@return String representation of the contents of the structure. | [
"Debugging",
"during",
"test",
"dump",
"for",
"FFDC"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.core/src/com/ibm/ws/kernel/provisioning/packages/PackageIndex.java#L264-L278 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.core/src/com/ibm/ws/kernel/provisioning/packages/PackageIndex.java | PackageIndex.getNodeIterator | NodeIterator<T> getNodeIterator(Filter<T> filter) {
return new NodeIterator<T>(root, filter, true);
} | java | NodeIterator<T> getNodeIterator(Filter<T> filter) {
return new NodeIterator<T>(root, filter, true);
} | [
"NodeIterator",
"<",
"T",
">",
"getNodeIterator",
"(",
"Filter",
"<",
"T",
">",
"filter",
")",
"{",
"return",
"new",
"NodeIterator",
"<",
"T",
">",
"(",
"root",
",",
"filter",
",",
"true",
")",
";",
"}"
] | Get an internal iterator for nodes that allows filtering based on
packages or values.
@param filter
@return | [
"Get",
"an",
"internal",
"iterator",
"for",
"nodes",
"that",
"allows",
"filtering",
"based",
"on",
"packages",
"or",
"values",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.core/src/com/ibm/ws/kernel/provisioning/packages/PackageIndex.java#L353-L355 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.resource/src/com/ibm/ws/resource/internal/ResourceFactoryTrackerData.java | ResourceFactoryTrackerData.modifed | public void modifed(ServiceReference<ResourceFactory> ref) {
String[] newInterfaces = getServiceInterfaces(ref);
if (!Arrays.equals(interfaces, newInterfaces)) {
unregister();
register(ref, newInterfaces);
} else {
registration.setProperties(getServiceProperties(ref));
}
} | java | public void modifed(ServiceReference<ResourceFactory> ref) {
String[] newInterfaces = getServiceInterfaces(ref);
if (!Arrays.equals(interfaces, newInterfaces)) {
unregister();
register(ref, newInterfaces);
} else {
registration.setProperties(getServiceProperties(ref));
}
} | [
"public",
"void",
"modifed",
"(",
"ServiceReference",
"<",
"ResourceFactory",
">",
"ref",
")",
"{",
"String",
"[",
"]",
"newInterfaces",
"=",
"getServiceInterfaces",
"(",
"ref",
")",
";",
"if",
"(",
"!",
"Arrays",
".",
"equals",
"(",
"interfaces",
",",
"newInterfaces",
")",
")",
"{",
"unregister",
"(",
")",
";",
"register",
"(",
"ref",
",",
"newInterfaces",
")",
";",
"}",
"else",
"{",
"registration",
".",
"setProperties",
"(",
"getServiceProperties",
"(",
"ref",
")",
")",
";",
"}",
"}"
] | Notification that the properties for the ResourceFactory changed. | [
"Notification",
"that",
"the",
"properties",
"for",
"the",
"ResourceFactory",
"changed",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.resource/src/com/ibm/ws/resource/internal/ResourceFactoryTrackerData.java#L148-L156 | train |
OpenLiberty/open-liberty | dev/com.ibm.websphere.javaee.persistence.2.0/src/com/ibm/ws/javaee/persistence/internal/HybridPersistenceActivator.java | HybridPersistenceActivator.getPersistenceProviders | @Override
public List<PersistenceProvider> getPersistenceProviders() {
// try to get the context classloader first, if that fails, use the loader
// that loaded this class
ClassLoader cl = PrivClassLoader.get(null);
if (cl == null) {
cl = PrivClassLoader.get(HybridPersistenceActivator.class);
}
// Query the provider cache per-classloader
List<PersistenceProvider> nonOSGiProviders = providerCache.get(cl);
// Get all providers not registered in OSGi. These will be any third-party providers
// available to the application classloader.
if (nonOSGiProviders == null) {
nonOSGiProviders = new ArrayList<PersistenceProvider>();
try {
List<Object> providers = ProviderLocator.getServices(PersistenceProvider.class.getName(), getClass(), cl);
for (Iterator<Object> provider = providers.iterator(); provider.hasNext();) {
Object o = provider.next();
if (o instanceof PersistenceProvider) {
nonOSGiProviders.add((PersistenceProvider) o);
}
}
// load the providers into the provider cache for the context (or current) classloader
providerCache.put(cl, nonOSGiProviders);
} catch (Exception e) {
throw new PersistenceException("Failed to load provider from META-INF/services", e);
}
}
List<PersistenceProvider> combinedProviders = new ArrayList<PersistenceProvider>(nonOSGiProviders);
combinedProviders.addAll(super.getPersistenceProviders());
return combinedProviders;
} | java | @Override
public List<PersistenceProvider> getPersistenceProviders() {
// try to get the context classloader first, if that fails, use the loader
// that loaded this class
ClassLoader cl = PrivClassLoader.get(null);
if (cl == null) {
cl = PrivClassLoader.get(HybridPersistenceActivator.class);
}
// Query the provider cache per-classloader
List<PersistenceProvider> nonOSGiProviders = providerCache.get(cl);
// Get all providers not registered in OSGi. These will be any third-party providers
// available to the application classloader.
if (nonOSGiProviders == null) {
nonOSGiProviders = new ArrayList<PersistenceProvider>();
try {
List<Object> providers = ProviderLocator.getServices(PersistenceProvider.class.getName(), getClass(), cl);
for (Iterator<Object> provider = providers.iterator(); provider.hasNext();) {
Object o = provider.next();
if (o instanceof PersistenceProvider) {
nonOSGiProviders.add((PersistenceProvider) o);
}
}
// load the providers into the provider cache for the context (or current) classloader
providerCache.put(cl, nonOSGiProviders);
} catch (Exception e) {
throw new PersistenceException("Failed to load provider from META-INF/services", e);
}
}
List<PersistenceProvider> combinedProviders = new ArrayList<PersistenceProvider>(nonOSGiProviders);
combinedProviders.addAll(super.getPersistenceProviders());
return combinedProviders;
} | [
"@",
"Override",
"public",
"List",
"<",
"PersistenceProvider",
">",
"getPersistenceProviders",
"(",
")",
"{",
"// try to get the context classloader first, if that fails, use the loader",
"// that loaded this class",
"ClassLoader",
"cl",
"=",
"PrivClassLoader",
".",
"get",
"(",
"null",
")",
";",
"if",
"(",
"cl",
"==",
"null",
")",
"{",
"cl",
"=",
"PrivClassLoader",
".",
"get",
"(",
"HybridPersistenceActivator",
".",
"class",
")",
";",
"}",
"// Query the provider cache per-classloader",
"List",
"<",
"PersistenceProvider",
">",
"nonOSGiProviders",
"=",
"providerCache",
".",
"get",
"(",
"cl",
")",
";",
"// Get all providers not registered in OSGi. These will be any third-party providers",
"// available to the application classloader.",
"if",
"(",
"nonOSGiProviders",
"==",
"null",
")",
"{",
"nonOSGiProviders",
"=",
"new",
"ArrayList",
"<",
"PersistenceProvider",
">",
"(",
")",
";",
"try",
"{",
"List",
"<",
"Object",
">",
"providers",
"=",
"ProviderLocator",
".",
"getServices",
"(",
"PersistenceProvider",
".",
"class",
".",
"getName",
"(",
")",
",",
"getClass",
"(",
")",
",",
"cl",
")",
";",
"for",
"(",
"Iterator",
"<",
"Object",
">",
"provider",
"=",
"providers",
".",
"iterator",
"(",
")",
";",
"provider",
".",
"hasNext",
"(",
")",
";",
")",
"{",
"Object",
"o",
"=",
"provider",
".",
"next",
"(",
")",
";",
"if",
"(",
"o",
"instanceof",
"PersistenceProvider",
")",
"{",
"nonOSGiProviders",
".",
"add",
"(",
"(",
"PersistenceProvider",
")",
"o",
")",
";",
"}",
"}",
"// load the providers into the provider cache for the context (or current) classloader",
"providerCache",
".",
"put",
"(",
"cl",
",",
"nonOSGiProviders",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"PersistenceException",
"(",
"\"Failed to load provider from META-INF/services\"",
",",
"e",
")",
";",
"}",
"}",
"List",
"<",
"PersistenceProvider",
">",
"combinedProviders",
"=",
"new",
"ArrayList",
"<",
"PersistenceProvider",
">",
"(",
"nonOSGiProviders",
")",
";",
"combinedProviders",
".",
"addAll",
"(",
"super",
".",
"getPersistenceProviders",
"(",
")",
")",
";",
"return",
"combinedProviders",
";",
"}"
] | This method returns a combination of those persistence providers available from
the application classloader in addition to those in the OSGi service registry.
OSGi providers are not cached and should not be cached because bundles can
be moved in and out of the system and it is the job of the the service tracker
to maintain them. | [
"This",
"method",
"returns",
"a",
"combination",
"of",
"those",
"persistence",
"providers",
"available",
"from",
"the",
"application",
"classloader",
"in",
"addition",
"to",
"those",
"in",
"the",
"OSGi",
"service",
"registry",
".",
"OSGi",
"providers",
"are",
"not",
"cached",
"and",
"should",
"not",
"be",
"cached",
"because",
"bundles",
"can",
"be",
"moved",
"in",
"and",
"out",
"of",
"the",
"system",
"and",
"it",
"is",
"the",
"job",
"of",
"the",
"the",
"service",
"tracker",
"to",
"maintain",
"them",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.javaee.persistence.2.0/src/com/ibm/ws/javaee/persistence/internal/HybridPersistenceActivator.java#L42-L73 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectorProperties.java | ConnectorProperties.add | @Override
public boolean add(Object o) {
ConnectorProperty connectorPropertyToAdd = (ConnectorProperty) o;
String nameToAdd = connectorPropertyToAdd.getName();
ConnectorProperty connectorProperty = null;
String name = null;
Enumeration<Object> e = this.elements();
while (e.hasMoreElements()) {
connectorProperty = (ConnectorProperty) e.nextElement();
name = connectorProperty.getName();
if (name.equals(nameToAdd)) {
if (tc.isDebugEnabled()) {
String value = (String) connectorPropertyToAdd.getValue();
if (!value.equals("")) {
if (name.equals("UserName") || name.equals("Password")) {
Tr.debug(tc, "DUPLICATE_USERNAME_PASSWORD_CONNECTOR_PROPERTY_J2CA0103", new Object[] { (ConnectorProperty) o });
} else {
Tr.warning(tc, "DUPLICATE_CONNECTOR_PROPERTY_J2CA0308", new Object[] { (ConnectorProperty) o });
}
}
}
return true;
}
}
return super.add(o);
} | java | @Override
public boolean add(Object o) {
ConnectorProperty connectorPropertyToAdd = (ConnectorProperty) o;
String nameToAdd = connectorPropertyToAdd.getName();
ConnectorProperty connectorProperty = null;
String name = null;
Enumeration<Object> e = this.elements();
while (e.hasMoreElements()) {
connectorProperty = (ConnectorProperty) e.nextElement();
name = connectorProperty.getName();
if (name.equals(nameToAdd)) {
if (tc.isDebugEnabled()) {
String value = (String) connectorPropertyToAdd.getValue();
if (!value.equals("")) {
if (name.equals("UserName") || name.equals("Password")) {
Tr.debug(tc, "DUPLICATE_USERNAME_PASSWORD_CONNECTOR_PROPERTY_J2CA0103", new Object[] { (ConnectorProperty) o });
} else {
Tr.warning(tc, "DUPLICATE_CONNECTOR_PROPERTY_J2CA0308", new Object[] { (ConnectorProperty) o });
}
}
}
return true;
}
}
return super.add(o);
} | [
"@",
"Override",
"public",
"boolean",
"add",
"(",
"Object",
"o",
")",
"{",
"ConnectorProperty",
"connectorPropertyToAdd",
"=",
"(",
"ConnectorProperty",
")",
"o",
";",
"String",
"nameToAdd",
"=",
"connectorPropertyToAdd",
".",
"getName",
"(",
")",
";",
"ConnectorProperty",
"connectorProperty",
"=",
"null",
";",
"String",
"name",
"=",
"null",
";",
"Enumeration",
"<",
"Object",
">",
"e",
"=",
"this",
".",
"elements",
"(",
")",
";",
"while",
"(",
"e",
".",
"hasMoreElements",
"(",
")",
")",
"{",
"connectorProperty",
"=",
"(",
"ConnectorProperty",
")",
"e",
".",
"nextElement",
"(",
")",
";",
"name",
"=",
"connectorProperty",
".",
"getName",
"(",
")",
";",
"if",
"(",
"name",
".",
"equals",
"(",
"nameToAdd",
")",
")",
"{",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"String",
"value",
"=",
"(",
"String",
")",
"connectorPropertyToAdd",
".",
"getValue",
"(",
")",
";",
"if",
"(",
"!",
"value",
".",
"equals",
"(",
"\"\"",
")",
")",
"{",
"if",
"(",
"name",
".",
"equals",
"(",
"\"UserName\"",
")",
"||",
"name",
".",
"equals",
"(",
"\"Password\"",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"DUPLICATE_USERNAME_PASSWORD_CONNECTOR_PROPERTY_J2CA0103\"",
",",
"new",
"Object",
"[",
"]",
"{",
"(",
"ConnectorProperty",
")",
"o",
"}",
")",
";",
"}",
"else",
"{",
"Tr",
".",
"warning",
"(",
"tc",
",",
"\"DUPLICATE_CONNECTOR_PROPERTY_J2CA0308\"",
",",
"new",
"Object",
"[",
"]",
"{",
"(",
"ConnectorProperty",
")",
"o",
"}",
")",
";",
"}",
"}",
"}",
"return",
"true",
";",
"}",
"}",
"return",
"super",
".",
"add",
"(",
"o",
")",
";",
"}"
] | override the Vector add method to not add duplicate entries. That is, entries with the same name. | [
"override",
"the",
"Vector",
"add",
"method",
"to",
"not",
"add",
"duplicate",
"entries",
".",
"That",
"is",
"entries",
"with",
"the",
"same",
"name",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectorProperties.java#L37-L67 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectorProperties.java | ConnectorProperties.findConnectorPropertyString | public String findConnectorPropertyString(String desiredPropertyName, String defaultValue) {
String retVal = defaultValue;
String name = null;
ConnectorProperty property = null;
Enumeration<Object> e = this.elements();
while (e.hasMoreElements()) {
property = (ConnectorProperty) e.nextElement();
name = property.getName();
if (name.equals(desiredPropertyName)) {
retVal = (String) property.getValue();
}
}
return retVal;
} | java | public String findConnectorPropertyString(String desiredPropertyName, String defaultValue) {
String retVal = defaultValue;
String name = null;
ConnectorProperty property = null;
Enumeration<Object> e = this.elements();
while (e.hasMoreElements()) {
property = (ConnectorProperty) e.nextElement();
name = property.getName();
if (name.equals(desiredPropertyName)) {
retVal = (String) property.getValue();
}
}
return retVal;
} | [
"public",
"String",
"findConnectorPropertyString",
"(",
"String",
"desiredPropertyName",
",",
"String",
"defaultValue",
")",
"{",
"String",
"retVal",
"=",
"defaultValue",
";",
"String",
"name",
"=",
"null",
";",
"ConnectorProperty",
"property",
"=",
"null",
";",
"Enumeration",
"<",
"Object",
">",
"e",
"=",
"this",
".",
"elements",
"(",
")",
";",
"while",
"(",
"e",
".",
"hasMoreElements",
"(",
")",
")",
"{",
"property",
"=",
"(",
"ConnectorProperty",
")",
"e",
".",
"nextElement",
"(",
")",
";",
"name",
"=",
"property",
".",
"getName",
"(",
")",
";",
"if",
"(",
"name",
".",
"equals",
"(",
"desiredPropertyName",
")",
")",
"{",
"retVal",
"=",
"(",
"String",
")",
"property",
".",
"getValue",
"(",
")",
";",
"}",
"}",
"return",
"retVal",
";",
"}"
] | Given this ConnectorProperties Vector, find the String identified by the
input desiredPropertyName. If not found, return the defaultValue.
@param desiredPropertyName Name of com.ibm.ejs.j2c.ConnectorProperty entry to look for.
@param defaultValue value to return if the desiredPropertyName is not found, or its value is invalid.
@return String | [
"Given",
"this",
"ConnectorProperties",
"Vector",
"find",
"the",
"String",
"identified",
"by",
"the",
"input",
"desiredPropertyName",
".",
"If",
"not",
"found",
"return",
"the",
"defaultValue",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectorProperties.java#L77-L97 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java | TargetStreamManager.handleMessage | public void handleMessage(MessageItem msgItem) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "handleMessage", new Object[] { msgItem });
JsMessage jsMsg = msgItem.getMessage();
int priority = jsMsg.getPriority().intValue();
Reliability reliability = jsMsg.getReliability();
StreamSet streamSet = getStreamSetForMessage(jsMsg);
if(streamSet == null)
{
handleNewStreamID(msgItem);
}
else
{
TargetStream targetStream = null;
synchronized(streamSet)
{
targetStream = (TargetStream) streamSet.getStream(priority, reliability);
if(targetStream == null)
{
targetStream = createStream(streamSet,
priority,
reliability,
streamSet.getPersistentData(priority, reliability));
}
}
// Update the stateStream with this message
// The stateStream itself will do Gap detection
// Note that the message cannot be written to the MsgStore or
// delivered to the ConsumerDispatcher until the stream is
// in order. The TargetStream calls back into this class
// using the deliverOrderedMessages() method to do this once
// it has an ordered stream
targetStream.writeValue(msgItem);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "handleMessage");
} | java | public void handleMessage(MessageItem msgItem) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "handleMessage", new Object[] { msgItem });
JsMessage jsMsg = msgItem.getMessage();
int priority = jsMsg.getPriority().intValue();
Reliability reliability = jsMsg.getReliability();
StreamSet streamSet = getStreamSetForMessage(jsMsg);
if(streamSet == null)
{
handleNewStreamID(msgItem);
}
else
{
TargetStream targetStream = null;
synchronized(streamSet)
{
targetStream = (TargetStream) streamSet.getStream(priority, reliability);
if(targetStream == null)
{
targetStream = createStream(streamSet,
priority,
reliability,
streamSet.getPersistentData(priority, reliability));
}
}
// Update the stateStream with this message
// The stateStream itself will do Gap detection
// Note that the message cannot be written to the MsgStore or
// delivered to the ConsumerDispatcher until the stream is
// in order. The TargetStream calls back into this class
// using the deliverOrderedMessages() method to do this once
// it has an ordered stream
targetStream.writeValue(msgItem);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "handleMessage");
} | [
"public",
"void",
"handleMessage",
"(",
"MessageItem",
"msgItem",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"handleMessage\"",
",",
"new",
"Object",
"[",
"]",
"{",
"msgItem",
"}",
")",
";",
"JsMessage",
"jsMsg",
"=",
"msgItem",
".",
"getMessage",
"(",
")",
";",
"int",
"priority",
"=",
"jsMsg",
".",
"getPriority",
"(",
")",
".",
"intValue",
"(",
")",
";",
"Reliability",
"reliability",
"=",
"jsMsg",
".",
"getReliability",
"(",
")",
";",
"StreamSet",
"streamSet",
"=",
"getStreamSetForMessage",
"(",
"jsMsg",
")",
";",
"if",
"(",
"streamSet",
"==",
"null",
")",
"{",
"handleNewStreamID",
"(",
"msgItem",
")",
";",
"}",
"else",
"{",
"TargetStream",
"targetStream",
"=",
"null",
";",
"synchronized",
"(",
"streamSet",
")",
"{",
"targetStream",
"=",
"(",
"TargetStream",
")",
"streamSet",
".",
"getStream",
"(",
"priority",
",",
"reliability",
")",
";",
"if",
"(",
"targetStream",
"==",
"null",
")",
"{",
"targetStream",
"=",
"createStream",
"(",
"streamSet",
",",
"priority",
",",
"reliability",
",",
"streamSet",
".",
"getPersistentData",
"(",
"priority",
",",
"reliability",
")",
")",
";",
"}",
"}",
"// Update the stateStream with this message",
"// The stateStream itself will do Gap detection",
"// Note that the message cannot be written to the MsgStore or",
"// delivered to the ConsumerDispatcher until the stream is",
"// in order. The TargetStream calls back into this class",
"// using the deliverOrderedMessages() method to do this once",
"// it has an ordered stream",
"targetStream",
".",
"writeValue",
"(",
"msgItem",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"handleMessage\"",
")",
";",
"}"
] | Handle a new message by inserting it in to the appropriate target stream.
If the stream ID in the message is a new one, a flush query will be
sent to the source. If the ID has been seen before but the specific stream
is not found, a new one will be created and added to the stream set.
@param msgItem | [
"Handle",
"a",
"new",
"message",
"by",
"inserting",
"it",
"in",
"to",
"the",
"appropriate",
"target",
"stream",
".",
"If",
"the",
"stream",
"ID",
"in",
"the",
"message",
"is",
"a",
"new",
"one",
"a",
"flush",
"query",
"will",
"be",
"sent",
"to",
"the",
"source",
".",
"If",
"the",
"ID",
"has",
"been",
"seen",
"before",
"but",
"the",
"specific",
"stream",
"is",
"not",
"found",
"a",
"new",
"one",
"will",
"be",
"created",
"and",
"added",
"to",
"the",
"stream",
"set",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java#L225-L268 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java | TargetStreamManager.handleSilence | public void handleSilence(MessageItem msgItem) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "handleSilence", new Object[] { msgItem });
JsMessage jsMsg = msgItem.getMessage();
int priority = jsMsg.getPriority().intValue();
Reliability reliability = jsMsg.getReliability();
StreamSet streamSet = getStreamSetForMessage(jsMsg);
if(streamSet != null)
{
TargetStream targetStream = null;
synchronized(streamSet)
{
targetStream = (TargetStream) streamSet.getStream(priority, reliability);
}
if(targetStream != null)
{
// Update the stateStream with Silence
targetStream.writeSilence(msgItem);
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "handleSilence");
} | java | public void handleSilence(MessageItem msgItem) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "handleSilence", new Object[] { msgItem });
JsMessage jsMsg = msgItem.getMessage();
int priority = jsMsg.getPriority().intValue();
Reliability reliability = jsMsg.getReliability();
StreamSet streamSet = getStreamSetForMessage(jsMsg);
if(streamSet != null)
{
TargetStream targetStream = null;
synchronized(streamSet)
{
targetStream = (TargetStream) streamSet.getStream(priority, reliability);
}
if(targetStream != null)
{
// Update the stateStream with Silence
targetStream.writeSilence(msgItem);
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "handleSilence");
} | [
"public",
"void",
"handleSilence",
"(",
"MessageItem",
"msgItem",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"handleSilence\"",
",",
"new",
"Object",
"[",
"]",
"{",
"msgItem",
"}",
")",
";",
"JsMessage",
"jsMsg",
"=",
"msgItem",
".",
"getMessage",
"(",
")",
";",
"int",
"priority",
"=",
"jsMsg",
".",
"getPriority",
"(",
")",
".",
"intValue",
"(",
")",
";",
"Reliability",
"reliability",
"=",
"jsMsg",
".",
"getReliability",
"(",
")",
";",
"StreamSet",
"streamSet",
"=",
"getStreamSetForMessage",
"(",
"jsMsg",
")",
";",
"if",
"(",
"streamSet",
"!=",
"null",
")",
"{",
"TargetStream",
"targetStream",
"=",
"null",
";",
"synchronized",
"(",
"streamSet",
")",
"{",
"targetStream",
"=",
"(",
"TargetStream",
")",
"streamSet",
".",
"getStream",
"(",
"priority",
",",
"reliability",
")",
";",
"}",
"if",
"(",
"targetStream",
"!=",
"null",
")",
"{",
"// Update the stateStream with Silence",
"targetStream",
".",
"writeSilence",
"(",
"msgItem",
")",
";",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"handleSilence\"",
")",
";",
"}"
] | Handle a filtered message by inserting it in to the
appropriate target stream as Silence.
Since we only need to do this on exisiting TargetStreams, if the
streamSet or stream are null we give up
@param msgItem
@throws SIResourceException | [
"Handle",
"a",
"filtered",
"message",
"by",
"inserting",
"it",
"in",
"to",
"the",
"appropriate",
"target",
"stream",
"as",
"Silence",
".",
"Since",
"we",
"only",
"need",
"to",
"do",
"this",
"on",
"exisiting",
"TargetStreams",
"if",
"the",
"streamSet",
"or",
"stream",
"are",
"null",
"we",
"give",
"up"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java#L279-L306 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java | TargetStreamManager.handleNewStreamID | private void handleNewStreamID(ControlMessage cMsg) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "handleNewStreamID", new Object[] { cMsg });
handleNewStreamID(cMsg, null);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "handleNewStreamID");
} | java | private void handleNewStreamID(ControlMessage cMsg) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "handleNewStreamID", new Object[] { cMsg });
handleNewStreamID(cMsg, null);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "handleNewStreamID");
} | [
"private",
"void",
"handleNewStreamID",
"(",
"ControlMessage",
"cMsg",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"handleNewStreamID\"",
",",
"new",
"Object",
"[",
"]",
"{",
"cMsg",
"}",
")",
";",
"handleNewStreamID",
"(",
"cMsg",
",",
"null",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"handleNewStreamID\"",
")",
";",
"}"
] | Handle a new stream ID from a control message
@param jsMsg | [
"Handle",
"a",
"new",
"stream",
"ID",
"from",
"a",
"control",
"message"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java#L313-L322 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java | TargetStreamManager.handleNewStreamID | private void handleNewStreamID(AbstractMessage aMessage, MessageItem msgItem) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "handleNewStreamID", new Object[] { aMessage, msgItem });
SIBUuid12 streamID = aMessage.getGuaranteedStreamUUID();
// Synchronize to resolve race between multiple messages on same
// stream. Can't actually happen until multihop, e.g. messages on
// same stream arrive simultaneously from multiple cellules.
synchronized (flushMap)
{
// Otherwise, create a new flush query record and proceed
FlushQueryRecord entry = flushMap.get(streamID);
if ( (entry != null) && (msgItem != null) )
{
// Since the entry already exists, somebody else already
// started the timer so all we have to do is cache the
// message for replay later.
entry.append(msgItem);
}
else
{
// Otherwise, new entry:
// 1. Create a request ID and flush record, store it in the map.
// 2. Create and send an "are you flushed".
// 3. Start an alarm to repeat "are you flushed" a set number of
// times.
SIBUuid8 sourceMEUuid = aMessage.getGuaranteedSourceMessagingEngineUUID();
SIBUuid12 destID = aMessage.getGuaranteedTargetDestinationDefinitionUUID();
SIBUuid8 busID = aMessage.getGuaranteedCrossBusSourceBusUUID();
// Create and store the request record
long reqID = messageProcessor.nextTick();
entry = new FlushQueryRecord(sourceMEUuid, destID, busID,
msgItem, reqID);
flushMap.put(streamID, entry);
// Create and send the query
// TODO: create a proper srcID here
upControl.sendAreYouFlushedMessage(sourceMEUuid, destID, busID, reqID, streamID);
// Start the alarm. The context for the alarm is the stream id, which
// we can use to look up the FlushQueryRecord if the alarm expires.
entry.resend = am.create(GDConfig.FLUSH_QUERY_INTERVAL, this, streamID);
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "handleNewStreamID");
} | java | private void handleNewStreamID(AbstractMessage aMessage, MessageItem msgItem) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "handleNewStreamID", new Object[] { aMessage, msgItem });
SIBUuid12 streamID = aMessage.getGuaranteedStreamUUID();
// Synchronize to resolve race between multiple messages on same
// stream. Can't actually happen until multihop, e.g. messages on
// same stream arrive simultaneously from multiple cellules.
synchronized (flushMap)
{
// Otherwise, create a new flush query record and proceed
FlushQueryRecord entry = flushMap.get(streamID);
if ( (entry != null) && (msgItem != null) )
{
// Since the entry already exists, somebody else already
// started the timer so all we have to do is cache the
// message for replay later.
entry.append(msgItem);
}
else
{
// Otherwise, new entry:
// 1. Create a request ID and flush record, store it in the map.
// 2. Create and send an "are you flushed".
// 3. Start an alarm to repeat "are you flushed" a set number of
// times.
SIBUuid8 sourceMEUuid = aMessage.getGuaranteedSourceMessagingEngineUUID();
SIBUuid12 destID = aMessage.getGuaranteedTargetDestinationDefinitionUUID();
SIBUuid8 busID = aMessage.getGuaranteedCrossBusSourceBusUUID();
// Create and store the request record
long reqID = messageProcessor.nextTick();
entry = new FlushQueryRecord(sourceMEUuid, destID, busID,
msgItem, reqID);
flushMap.put(streamID, entry);
// Create and send the query
// TODO: create a proper srcID here
upControl.sendAreYouFlushedMessage(sourceMEUuid, destID, busID, reqID, streamID);
// Start the alarm. The context for the alarm is the stream id, which
// we can use to look up the FlushQueryRecord if the alarm expires.
entry.resend = am.create(GDConfig.FLUSH_QUERY_INTERVAL, this, streamID);
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "handleNewStreamID");
} | [
"private",
"void",
"handleNewStreamID",
"(",
"AbstractMessage",
"aMessage",
",",
"MessageItem",
"msgItem",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"handleNewStreamID\"",
",",
"new",
"Object",
"[",
"]",
"{",
"aMessage",
",",
"msgItem",
"}",
")",
";",
"SIBUuid12",
"streamID",
"=",
"aMessage",
".",
"getGuaranteedStreamUUID",
"(",
")",
";",
"// Synchronize to resolve race between multiple messages on same",
"// stream. Can't actually happen until multihop, e.g. messages on",
"// same stream arrive simultaneously from multiple cellules.",
"synchronized",
"(",
"flushMap",
")",
"{",
"// Otherwise, create a new flush query record and proceed",
"FlushQueryRecord",
"entry",
"=",
"flushMap",
".",
"get",
"(",
"streamID",
")",
";",
"if",
"(",
"(",
"entry",
"!=",
"null",
")",
"&&",
"(",
"msgItem",
"!=",
"null",
")",
")",
"{",
"// Since the entry already exists, somebody else already",
"// started the timer so all we have to do is cache the",
"// message for replay later.",
"entry",
".",
"append",
"(",
"msgItem",
")",
";",
"}",
"else",
"{",
"// Otherwise, new entry:",
"// 1. Create a request ID and flush record, store it in the map.",
"// 2. Create and send an \"are you flushed\".",
"// 3. Start an alarm to repeat \"are you flushed\" a set number of",
"// times.",
"SIBUuid8",
"sourceMEUuid",
"=",
"aMessage",
".",
"getGuaranteedSourceMessagingEngineUUID",
"(",
")",
";",
"SIBUuid12",
"destID",
"=",
"aMessage",
".",
"getGuaranteedTargetDestinationDefinitionUUID",
"(",
")",
";",
"SIBUuid8",
"busID",
"=",
"aMessage",
".",
"getGuaranteedCrossBusSourceBusUUID",
"(",
")",
";",
"// Create and store the request record",
"long",
"reqID",
"=",
"messageProcessor",
".",
"nextTick",
"(",
")",
";",
"entry",
"=",
"new",
"FlushQueryRecord",
"(",
"sourceMEUuid",
",",
"destID",
",",
"busID",
",",
"msgItem",
",",
"reqID",
")",
";",
"flushMap",
".",
"put",
"(",
"streamID",
",",
"entry",
")",
";",
"// Create and send the query",
"// TODO: create a proper srcID here",
"upControl",
".",
"sendAreYouFlushedMessage",
"(",
"sourceMEUuid",
",",
"destID",
",",
"busID",
",",
"reqID",
",",
"streamID",
")",
";",
"// Start the alarm. The context for the alarm is the stream id, which",
"// we can use to look up the FlushQueryRecord if the alarm expires.",
"entry",
".",
"resend",
"=",
"am",
".",
"create",
"(",
"GDConfig",
".",
"FLUSH_QUERY_INTERVAL",
",",
"this",
",",
"streamID",
")",
";",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"handleNewStreamID\"",
")",
";",
"}"
] | Handle a new stream ID and cache a MessageItem for replay later.
msgItem can be null, for example if this was triggered by a control message.
@param msgItem | [
"Handle",
"a",
"new",
"stream",
"ID",
"and",
"cache",
"a",
"MessageItem",
"for",
"replay",
"later",
".",
"msgItem",
"can",
"be",
"null",
"for",
"example",
"if",
"this",
"was",
"triggered",
"by",
"a",
"control",
"message",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java#L348-L400 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java | TargetStreamManager.addNewStreamSet | private StreamSet addNewStreamSet(SIBUuid12 streamID,
SIBUuid8 sourceMEUuid,
SIBUuid12 remoteDestUuid,
SIBUuid8 remoteBusUuid,
String linkTarget)
throws SIRollbackException,
SIConnectionLostException,
SIIncorrectCallException,
SIResourceException,
SIErrorException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "addNewStreamSet", new Object[]{streamID,
sourceMEUuid,
remoteDestUuid,
remoteBusUuid,
linkTarget});
StreamSet streamSet = null;
try
{
LocalTransaction tran = txManager.createLocalTransaction(false);
Transaction msTran = txManager.resolveAndEnlistMsgStoreTransaction(tran);
//create a persistent stream set
streamSet = new StreamSet(streamID,
sourceMEUuid,
remoteDestUuid,
remoteBusUuid,
protocolItemStream,
txManager,
0,
destination.isLink() ? StreamSet.Type.LINK_TARGET : StreamSet.Type.TARGET,
tran,
linkTarget);
protocolItemStream.addItem(streamSet, msTran);
tran.commit();
synchronized(streamSets)
{
streamSets.put(streamID, streamSet);
sourceMap.put(streamID, sourceMEUuid);
}
}
catch (OutOfCacheSpace e)
{
// No FFDC code needed
SibTr.exception(tc, e);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "addNewStreamSet", e);
throw new SIResourceException(e);
}
catch (MessageStoreException e)
{
// MessageStoreException shouldn't occur so FFDC.
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.gd.TargetStreamManager.addNewStreamSet",
"1:471:1.69",
this);
SibTr.exception(tc, e);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "addNewStreamSet", e);
throw new SIResourceException(e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "addNewStreamSet", streamSet);
return streamSet;
} | java | private StreamSet addNewStreamSet(SIBUuid12 streamID,
SIBUuid8 sourceMEUuid,
SIBUuid12 remoteDestUuid,
SIBUuid8 remoteBusUuid,
String linkTarget)
throws SIRollbackException,
SIConnectionLostException,
SIIncorrectCallException,
SIResourceException,
SIErrorException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "addNewStreamSet", new Object[]{streamID,
sourceMEUuid,
remoteDestUuid,
remoteBusUuid,
linkTarget});
StreamSet streamSet = null;
try
{
LocalTransaction tran = txManager.createLocalTransaction(false);
Transaction msTran = txManager.resolveAndEnlistMsgStoreTransaction(tran);
//create a persistent stream set
streamSet = new StreamSet(streamID,
sourceMEUuid,
remoteDestUuid,
remoteBusUuid,
protocolItemStream,
txManager,
0,
destination.isLink() ? StreamSet.Type.LINK_TARGET : StreamSet.Type.TARGET,
tran,
linkTarget);
protocolItemStream.addItem(streamSet, msTran);
tran.commit();
synchronized(streamSets)
{
streamSets.put(streamID, streamSet);
sourceMap.put(streamID, sourceMEUuid);
}
}
catch (OutOfCacheSpace e)
{
// No FFDC code needed
SibTr.exception(tc, e);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "addNewStreamSet", e);
throw new SIResourceException(e);
}
catch (MessageStoreException e)
{
// MessageStoreException shouldn't occur so FFDC.
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.gd.TargetStreamManager.addNewStreamSet",
"1:471:1.69",
this);
SibTr.exception(tc, e);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "addNewStreamSet", e);
throw new SIResourceException(e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "addNewStreamSet", streamSet);
return streamSet;
} | [
"private",
"StreamSet",
"addNewStreamSet",
"(",
"SIBUuid12",
"streamID",
",",
"SIBUuid8",
"sourceMEUuid",
",",
"SIBUuid12",
"remoteDestUuid",
",",
"SIBUuid8",
"remoteBusUuid",
",",
"String",
"linkTarget",
")",
"throws",
"SIRollbackException",
",",
"SIConnectionLostException",
",",
"SIIncorrectCallException",
",",
"SIResourceException",
",",
"SIErrorException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"addNewStreamSet\"",
",",
"new",
"Object",
"[",
"]",
"{",
"streamID",
",",
"sourceMEUuid",
",",
"remoteDestUuid",
",",
"remoteBusUuid",
",",
"linkTarget",
"}",
")",
";",
"StreamSet",
"streamSet",
"=",
"null",
";",
"try",
"{",
"LocalTransaction",
"tran",
"=",
"txManager",
".",
"createLocalTransaction",
"(",
"false",
")",
";",
"Transaction",
"msTran",
"=",
"txManager",
".",
"resolveAndEnlistMsgStoreTransaction",
"(",
"tran",
")",
";",
"//create a persistent stream set",
"streamSet",
"=",
"new",
"StreamSet",
"(",
"streamID",
",",
"sourceMEUuid",
",",
"remoteDestUuid",
",",
"remoteBusUuid",
",",
"protocolItemStream",
",",
"txManager",
",",
"0",
",",
"destination",
".",
"isLink",
"(",
")",
"?",
"StreamSet",
".",
"Type",
".",
"LINK_TARGET",
":",
"StreamSet",
".",
"Type",
".",
"TARGET",
",",
"tran",
",",
"linkTarget",
")",
";",
"protocolItemStream",
".",
"addItem",
"(",
"streamSet",
",",
"msTran",
")",
";",
"tran",
".",
"commit",
"(",
")",
";",
"synchronized",
"(",
"streamSets",
")",
"{",
"streamSets",
".",
"put",
"(",
"streamID",
",",
"streamSet",
")",
";",
"sourceMap",
".",
"put",
"(",
"streamID",
",",
"sourceMEUuid",
")",
";",
"}",
"}",
"catch",
"(",
"OutOfCacheSpace",
"e",
")",
"{",
"// No FFDC code needed",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"addNewStreamSet\"",
",",
"e",
")",
";",
"throw",
"new",
"SIResourceException",
"(",
"e",
")",
";",
"}",
"catch",
"(",
"MessageStoreException",
"e",
")",
"{",
"// MessageStoreException shouldn't occur so FFDC.",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.gd.TargetStreamManager.addNewStreamSet\"",
",",
"\"1:471:1.69\"",
",",
"this",
")",
";",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"addNewStreamSet\"",
",",
"e",
")",
";",
"throw",
"new",
"SIResourceException",
"(",
"e",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"addNewStreamSet\"",
",",
"streamSet",
")",
";",
"return",
"streamSet",
";",
"}"
] | Create a new StreamSet for a given streamID and sourceCellule.
@param streamID
@param sourceCellule
@param remoteDestUuid This may not always be the same as the
Uuid of the local destination
@param remoteBusUuid
@return A new StreamSet
@throws SIResourceException if the message store outofcache space exception is caught | [
"Create",
"a",
"new",
"StreamSet",
"for",
"a",
"given",
"streamID",
"and",
"sourceCellule",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java#L413-L488 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java | TargetStreamManager.createStream | private TargetStream createStream(StreamSet streamSet,
int priority,
Reliability reliability,
long completedPrefix)
throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"createStream",
new Object[] { streamSet, Integer.valueOf(priority), reliability, Long.valueOf(completedPrefix) });
TargetStream stream = null;
stream = createStream(streamSet, priority, reliability);
stream.setCompletedPrefix(completedPrefix);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "createStream");
return stream;
} | java | private TargetStream createStream(StreamSet streamSet,
int priority,
Reliability reliability,
long completedPrefix)
throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"createStream",
new Object[] { streamSet, Integer.valueOf(priority), reliability, Long.valueOf(completedPrefix) });
TargetStream stream = null;
stream = createStream(streamSet, priority, reliability);
stream.setCompletedPrefix(completedPrefix);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "createStream");
return stream;
} | [
"private",
"TargetStream",
"createStream",
"(",
"StreamSet",
"streamSet",
",",
"int",
"priority",
",",
"Reliability",
"reliability",
",",
"long",
"completedPrefix",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"createStream\"",
",",
"new",
"Object",
"[",
"]",
"{",
"streamSet",
",",
"Integer",
".",
"valueOf",
"(",
"priority",
")",
",",
"reliability",
",",
"Long",
".",
"valueOf",
"(",
"completedPrefix",
")",
"}",
")",
";",
"TargetStream",
"stream",
"=",
"null",
";",
"stream",
"=",
"createStream",
"(",
"streamSet",
",",
"priority",
",",
"reliability",
")",
";",
"stream",
".",
"setCompletedPrefix",
"(",
"completedPrefix",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"createStream\"",
")",
";",
"return",
"stream",
";",
"}"
] | Create a new TargetStream and initialize it with a given completed prefix.
Always called with streamSet lock
@param streamSet
@param priority
@param reliability
@param completedPrefix
@return A new TargetStream | [
"Create",
"a",
"new",
"TargetStream",
"and",
"initialize",
"it",
"with",
"a",
"given",
"completed",
"prefix",
".",
"Always",
"called",
"with",
"streamSet",
"lock"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java#L500-L521 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java | TargetStreamManager.createStream | private TargetStream createStream(StreamSet streamSet,
int priority,
Reliability reliability) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"createStream",
new Object[] { streamSet, Integer.valueOf(priority), reliability });
TargetStream stream = null;
if(reliability.compareTo(Reliability.BEST_EFFORT_NONPERSISTENT) <= 0)
{
stream = new ExpressTargetStream(deliverer,
streamSet.getRemoteMEUuid(), streamSet.getStreamID());
}
else
{
//Warning - this assumes that ASSURED is always the highest Reliability
//and that UNKNOWN is always the lowest (0).
stream = new GuaranteedTargetStream(
deliverer,
upControl,
am,
streamSet,
priority, //priority
reliability, //reliability
new ArrayList(),
messageProcessor);
}
streamSet.setStream(priority, reliability, stream);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "createStream", stream);
return stream;
} | java | private TargetStream createStream(StreamSet streamSet,
int priority,
Reliability reliability) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"createStream",
new Object[] { streamSet, Integer.valueOf(priority), reliability });
TargetStream stream = null;
if(reliability.compareTo(Reliability.BEST_EFFORT_NONPERSISTENT) <= 0)
{
stream = new ExpressTargetStream(deliverer,
streamSet.getRemoteMEUuid(), streamSet.getStreamID());
}
else
{
//Warning - this assumes that ASSURED is always the highest Reliability
//and that UNKNOWN is always the lowest (0).
stream = new GuaranteedTargetStream(
deliverer,
upControl,
am,
streamSet,
priority, //priority
reliability, //reliability
new ArrayList(),
messageProcessor);
}
streamSet.setStream(priority, reliability, stream);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "createStream", stream);
return stream;
} | [
"private",
"TargetStream",
"createStream",
"(",
"StreamSet",
"streamSet",
",",
"int",
"priority",
",",
"Reliability",
"reliability",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"createStream\"",
",",
"new",
"Object",
"[",
"]",
"{",
"streamSet",
",",
"Integer",
".",
"valueOf",
"(",
"priority",
")",
",",
"reliability",
"}",
")",
";",
"TargetStream",
"stream",
"=",
"null",
";",
"if",
"(",
"reliability",
".",
"compareTo",
"(",
"Reliability",
".",
"BEST_EFFORT_NONPERSISTENT",
")",
"<=",
"0",
")",
"{",
"stream",
"=",
"new",
"ExpressTargetStream",
"(",
"deliverer",
",",
"streamSet",
".",
"getRemoteMEUuid",
"(",
")",
",",
"streamSet",
".",
"getStreamID",
"(",
")",
")",
";",
"}",
"else",
"{",
"//Warning - this assumes that ASSURED is always the highest Reliability",
"//and that UNKNOWN is always the lowest (0).",
"stream",
"=",
"new",
"GuaranteedTargetStream",
"(",
"deliverer",
",",
"upControl",
",",
"am",
",",
"streamSet",
",",
"priority",
",",
"//priority",
"reliability",
",",
"//reliability",
"new",
"ArrayList",
"(",
")",
",",
"messageProcessor",
")",
";",
"}",
"streamSet",
".",
"setStream",
"(",
"priority",
",",
"reliability",
",",
"stream",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"createStream\"",
",",
"stream",
")",
";",
"return",
"stream",
";",
"}"
] | Create a new TargetStream in the given StreamSet
@param streamSet
@param priority
@param reliability
@return a new TargetStream
@throws SIResourceException | [
"Create",
"a",
"new",
"TargetStream",
"in",
"the",
"given",
"StreamSet"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java#L532-L571 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java | TargetStreamManager.handleFlushedMessage | public void handleFlushedMessage(ControlFlushed cMsg)
throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "handleFlushedMessage", new Object[] { cMsg });
SIBUuid12 streamID = cMsg.getGuaranteedStreamUUID();
forceFlush(streamID);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "handleFlushedMessage");
} | java | public void handleFlushedMessage(ControlFlushed cMsg)
throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "handleFlushedMessage", new Object[] { cMsg });
SIBUuid12 streamID = cMsg.getGuaranteedStreamUUID();
forceFlush(streamID);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "handleFlushedMessage");
} | [
"public",
"void",
"handleFlushedMessage",
"(",
"ControlFlushed",
"cMsg",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"handleFlushedMessage\"",
",",
"new",
"Object",
"[",
"]",
"{",
"cMsg",
"}",
")",
";",
"SIBUuid12",
"streamID",
"=",
"cMsg",
".",
"getGuaranteedStreamUUID",
"(",
")",
";",
"forceFlush",
"(",
"streamID",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"handleFlushedMessage\"",
")",
";",
"}"
] | Handle a ControlFlushed message. Flush any existing streams and
throw away any cached messages.
@param cMsg
@throws SIResourceException | [
"Handle",
"a",
"ControlFlushed",
"message",
".",
"Flush",
"any",
"existing",
"streams",
"and",
"throw",
"away",
"any",
"cached",
"messages",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java#L618-L629 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java | TargetStreamManager.forceFlush | public void forceFlush(SIBUuid12 streamID)
throws SIResourceException, SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "forceFlush", new Object[] { streamID });
// Synchronize to resolve racing messages.
synchronized (flushMap)
{
FlushQueryRecord entry = flushMap.remove(streamID);
// Remove the entry (we may not have even had
// one), then clean up any existing stream state. Also, make
// sure we turn off the alarm if there IS an entry. Note that
// an alarm will always be present if an entry exists.
if (entry != null)
entry.resend.cancel();
flush(streamID);
}
//If all the inbound stream sets are empty, queue the destination that the
//inbound streams are for to the asynch deletion thread, incase any cleanup
//of the destination is required. If not, the asynch deletion thread will do
//nothing.
// if (isEmpty())
// {
// DestinationManager destinationManager = messageProcessor.getDestinationManager();
// BaseDestinationHandler destinationHandler = protocolItemStream.getDestinationHandler();
// destinationManager.markDestinationAsCleanUpPending(destinationHandler);
// }
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "forceFlush");
} | java | public void forceFlush(SIBUuid12 streamID)
throws SIResourceException, SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "forceFlush", new Object[] { streamID });
// Synchronize to resolve racing messages.
synchronized (flushMap)
{
FlushQueryRecord entry = flushMap.remove(streamID);
// Remove the entry (we may not have even had
// one), then clean up any existing stream state. Also, make
// sure we turn off the alarm if there IS an entry. Note that
// an alarm will always be present if an entry exists.
if (entry != null)
entry.resend.cancel();
flush(streamID);
}
//If all the inbound stream sets are empty, queue the destination that the
//inbound streams are for to the asynch deletion thread, incase any cleanup
//of the destination is required. If not, the asynch deletion thread will do
//nothing.
// if (isEmpty())
// {
// DestinationManager destinationManager = messageProcessor.getDestinationManager();
// BaseDestinationHandler destinationHandler = protocolItemStream.getDestinationHandler();
// destinationManager.markDestinationAsCleanUpPending(destinationHandler);
// }
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "forceFlush");
} | [
"public",
"void",
"forceFlush",
"(",
"SIBUuid12",
"streamID",
")",
"throws",
"SIResourceException",
",",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"forceFlush\"",
",",
"new",
"Object",
"[",
"]",
"{",
"streamID",
"}",
")",
";",
"// Synchronize to resolve racing messages.",
"synchronized",
"(",
"flushMap",
")",
"{",
"FlushQueryRecord",
"entry",
"=",
"flushMap",
".",
"remove",
"(",
"streamID",
")",
";",
"// Remove the entry (we may not have even had",
"// one), then clean up any existing stream state. Also, make",
"// sure we turn off the alarm if there IS an entry. Note that",
"// an alarm will always be present if an entry exists.",
"if",
"(",
"entry",
"!=",
"null",
")",
"entry",
".",
"resend",
".",
"cancel",
"(",
")",
";",
"flush",
"(",
"streamID",
")",
";",
"}",
"//If all the inbound stream sets are empty, queue the destination that the",
"//inbound streams are for to the asynch deletion thread, incase any cleanup",
"//of the destination is required. If not, the asynch deletion thread will do",
"//nothing.",
"// if (isEmpty())",
"// {",
"// DestinationManager destinationManager = messageProcessor.getDestinationManager();",
"// BaseDestinationHandler destinationHandler = protocolItemStream.getDestinationHandler();",
"// destinationManager.markDestinationAsCleanUpPending(destinationHandler);",
"// }",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"forceFlush\"",
")",
";",
"}"
] | Flush any existing streams and throw away any cached messages.
@param streamID
@throws SIResourceException
@throws SIException | [
"Flush",
"any",
"existing",
"streams",
"and",
"throw",
"away",
"any",
"cached",
"messages",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java#L638-L674 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java | TargetStreamManager.requestFlushAtSource | public void requestFlushAtSource(SIBUuid8 source,
SIBUuid12 destID,
SIBUuid8 busID,
SIBUuid12 stream,
boolean indoubtDiscard)
throws SIException, SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "requestFlushAtSource", new Object[] { source, stream });
// Synchronize here to avoid races (not that we expect any)
synchronized (flushMap)
{
if (flushMap.containsKey(stream))
{
// Already a request on the way so ignore.
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "requestFlushAtSource");
return;
}
// Ok, new entry:
// 1. Create a request ID and flush record, store it in the map.
// 2. Create and send an "request flush".
// 3. Start an alarm to repeat "request flush" a set number of
// times.
// Create and store the request record
long reqID = messageProcessor.nextTick();
FlushQueryRecord entry = new FlushQueryRecord(source, destID, busID, reqID);
flushMap.put(stream, entry);
// Create and send the query
upControl.sendRequestFlushMessage(source, destID, busID, reqID, stream, indoubtDiscard);
// Start the alarm. The context for the alarm is the stream ID,
// which we can use to look up the FlushQueryRecord if the alarm
// expires.
entry.resend = am.create(GDConfig.REQUEST_FLUSH_INTERVAL, this, stream);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "requestFlushAtSource");
} | java | public void requestFlushAtSource(SIBUuid8 source,
SIBUuid12 destID,
SIBUuid8 busID,
SIBUuid12 stream,
boolean indoubtDiscard)
throws SIException, SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "requestFlushAtSource", new Object[] { source, stream });
// Synchronize here to avoid races (not that we expect any)
synchronized (flushMap)
{
if (flushMap.containsKey(stream))
{
// Already a request on the way so ignore.
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "requestFlushAtSource");
return;
}
// Ok, new entry:
// 1. Create a request ID and flush record, store it in the map.
// 2. Create and send an "request flush".
// 3. Start an alarm to repeat "request flush" a set number of
// times.
// Create and store the request record
long reqID = messageProcessor.nextTick();
FlushQueryRecord entry = new FlushQueryRecord(source, destID, busID, reqID);
flushMap.put(stream, entry);
// Create and send the query
upControl.sendRequestFlushMessage(source, destID, busID, reqID, stream, indoubtDiscard);
// Start the alarm. The context for the alarm is the stream ID,
// which we can use to look up the FlushQueryRecord if the alarm
// expires.
entry.resend = am.create(GDConfig.REQUEST_FLUSH_INTERVAL, this, stream);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "requestFlushAtSource");
} | [
"public",
"void",
"requestFlushAtSource",
"(",
"SIBUuid8",
"source",
",",
"SIBUuid12",
"destID",
",",
"SIBUuid8",
"busID",
",",
"SIBUuid12",
"stream",
",",
"boolean",
"indoubtDiscard",
")",
"throws",
"SIException",
",",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"requestFlushAtSource\"",
",",
"new",
"Object",
"[",
"]",
"{",
"source",
",",
"stream",
"}",
")",
";",
"// Synchronize here to avoid races (not that we expect any)",
"synchronized",
"(",
"flushMap",
")",
"{",
"if",
"(",
"flushMap",
".",
"containsKey",
"(",
"stream",
")",
")",
"{",
"// Already a request on the way so ignore.",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"requestFlushAtSource\"",
")",
";",
"return",
";",
"}",
"// Ok, new entry:",
"// 1. Create a request ID and flush record, store it in the map.",
"// 2. Create and send an \"request flush\".",
"// 3. Start an alarm to repeat \"request flush\" a set number of",
"// times.",
"// Create and store the request record",
"long",
"reqID",
"=",
"messageProcessor",
".",
"nextTick",
"(",
")",
";",
"FlushQueryRecord",
"entry",
"=",
"new",
"FlushQueryRecord",
"(",
"source",
",",
"destID",
",",
"busID",
",",
"reqID",
")",
";",
"flushMap",
".",
"put",
"(",
"stream",
",",
"entry",
")",
";",
"// Create and send the query",
"upControl",
".",
"sendRequestFlushMessage",
"(",
"source",
",",
"destID",
",",
"busID",
",",
"reqID",
",",
"stream",
",",
"indoubtDiscard",
")",
";",
"// Start the alarm. The context for the alarm is the stream ID,",
"// which we can use to look up the FlushQueryRecord if the alarm",
"// expires.",
"entry",
".",
"resend",
"=",
"am",
".",
"create",
"(",
"GDConfig",
".",
"REQUEST_FLUSH_INTERVAL",
",",
"this",
",",
"stream",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"requestFlushAtSource\"",
")",
";",
"}"
] | Send a request to flush a stream. The originator of the stream,
and the ID for the stream must be known. This method is public
because it's not clear who's going to call this yet.
@param source The originator of the stream (may be multiple hops
away).
@param stream The UUID of the stream to flush. | [
"Send",
"a",
"request",
"to",
"flush",
"a",
"stream",
".",
"The",
"originator",
"of",
"the",
"stream",
"and",
"the",
"ID",
"for",
"the",
"stream",
"must",
"be",
"known",
".",
"This",
"method",
"is",
"public",
"because",
"it",
"s",
"not",
"clear",
"who",
"s",
"going",
"to",
"call",
"this",
"yet",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java#L685-L728 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java | TargetStreamManager.handleSilenceMessage | public void handleSilenceMessage(ControlSilence cMsg) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "handleSilenceMessage", new Object[] { cMsg });
int priority = cMsg.getPriority().intValue();
Reliability reliability = cMsg.getReliability();
SIBUuid12 streamID = cMsg.getGuaranteedStreamUUID();
StreamSet streamSet = getStreamSetForMessage(cMsg);
if(streamSet == null)
{
//if this is a new stream ID, send a flush query
handleNewStreamID(cMsg);
}
else
{
TargetStream targetStream = null;
synchronized(streamSet)
{
targetStream = (TargetStream) streamSet.getStream(priority, reliability);
if(targetStream == null)
{
//if the specific stream does not exist, create it
targetStream = createStream(streamSet,
priority,
reliability,
streamSet.getPersistentData(priority, reliability));
}
}
// Update the statestream with this information
targetStream.writeSilence(cMsg);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "handleSilenceMessage");
} | java | public void handleSilenceMessage(ControlSilence cMsg) throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "handleSilenceMessage", new Object[] { cMsg });
int priority = cMsg.getPriority().intValue();
Reliability reliability = cMsg.getReliability();
SIBUuid12 streamID = cMsg.getGuaranteedStreamUUID();
StreamSet streamSet = getStreamSetForMessage(cMsg);
if(streamSet == null)
{
//if this is a new stream ID, send a flush query
handleNewStreamID(cMsg);
}
else
{
TargetStream targetStream = null;
synchronized(streamSet)
{
targetStream = (TargetStream) streamSet.getStream(priority, reliability);
if(targetStream == null)
{
//if the specific stream does not exist, create it
targetStream = createStream(streamSet,
priority,
reliability,
streamSet.getPersistentData(priority, reliability));
}
}
// Update the statestream with this information
targetStream.writeSilence(cMsg);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "handleSilenceMessage");
} | [
"public",
"void",
"handleSilenceMessage",
"(",
"ControlSilence",
"cMsg",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"handleSilenceMessage\"",
",",
"new",
"Object",
"[",
"]",
"{",
"cMsg",
"}",
")",
";",
"int",
"priority",
"=",
"cMsg",
".",
"getPriority",
"(",
")",
".",
"intValue",
"(",
")",
";",
"Reliability",
"reliability",
"=",
"cMsg",
".",
"getReliability",
"(",
")",
";",
"SIBUuid12",
"streamID",
"=",
"cMsg",
".",
"getGuaranteedStreamUUID",
"(",
")",
";",
"StreamSet",
"streamSet",
"=",
"getStreamSetForMessage",
"(",
"cMsg",
")",
";",
"if",
"(",
"streamSet",
"==",
"null",
")",
"{",
"//if this is a new stream ID, send a flush query",
"handleNewStreamID",
"(",
"cMsg",
")",
";",
"}",
"else",
"{",
"TargetStream",
"targetStream",
"=",
"null",
";",
"synchronized",
"(",
"streamSet",
")",
"{",
"targetStream",
"=",
"(",
"TargetStream",
")",
"streamSet",
".",
"getStream",
"(",
"priority",
",",
"reliability",
")",
";",
"if",
"(",
"targetStream",
"==",
"null",
")",
"{",
"//if the specific stream does not exist, create it",
"targetStream",
"=",
"createStream",
"(",
"streamSet",
",",
"priority",
",",
"reliability",
",",
"streamSet",
".",
"getPersistentData",
"(",
"priority",
",",
"reliability",
")",
")",
";",
"}",
"}",
"// Update the statestream with this information",
"targetStream",
".",
"writeSilence",
"(",
"cMsg",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"handleSilenceMessage\"",
")",
";",
"}"
] | Handle a ControlSilence message.
@param cMsg
@throws SIException | [
"Handle",
"a",
"ControlSilence",
"message",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java#L979-L1016 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java | TargetStreamManager.reconstituteStreamSet | public void reconstituteStreamSet(StreamSet streamSet)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "reconstituteStreamSet", streamSet);
synchronized(streamSets)
{
streamSets.put(streamSet.getStreamID(), streamSet);
sourceMap.put(streamSet.getStreamID(), streamSet.getRemoteMEUuid());
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "reconstituteStreamSet");
} | java | public void reconstituteStreamSet(StreamSet streamSet)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "reconstituteStreamSet", streamSet);
synchronized(streamSets)
{
streamSets.put(streamSet.getStreamID(), streamSet);
sourceMap.put(streamSet.getStreamID(), streamSet.getRemoteMEUuid());
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "reconstituteStreamSet");
} | [
"public",
"void",
"reconstituteStreamSet",
"(",
"StreamSet",
"streamSet",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"reconstituteStreamSet\"",
",",
"streamSet",
")",
";",
"synchronized",
"(",
"streamSets",
")",
"{",
"streamSets",
".",
"put",
"(",
"streamSet",
".",
"getStreamID",
"(",
")",
",",
"streamSet",
")",
";",
"sourceMap",
".",
"put",
"(",
"streamSet",
".",
"getStreamID",
"(",
")",
",",
"streamSet",
".",
"getRemoteMEUuid",
"(",
")",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"reconstituteStreamSet\"",
")",
";",
"}"
] | Restore a StreamSet to a previous state
@param streamSet
@throws SIResourceException
@throws SIException | [
"Restore",
"a",
"StreamSet",
"to",
"a",
"previous",
"state"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java#L1025-L1038 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java | TargetStreamManager.alarm | public void alarm(Object alarmContext)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "alarm", alarmContext);
// Alarm context should be an sid, make it so.
SIBUuid12 sid = (SIBUuid12) alarmContext;
// synchronized here in case we're racing with an answer to our
// query.
synchronized (flushMap)
{
// See if the query record is still around
FlushQueryRecord entry = flushMap.get(sid);
if (entry != null)
{
// Query still active, see if we need to restart.
entry.attempts--;
if (entry.attempts > 0)
{
// Yup, resend the query and reset the alarm. If
// entry.cached is null, then this is a "request flush"
// rather than an "are you flushed".
try
{
if (entry.cache == null)
{
upControl.sendRequestFlushMessage(entry.source,
entry.destId,
entry.busId,
entry.requestID,
sid,
false); //TODO check indoubtDiscard
}
else
{
upControl.sendAreYouFlushedMessage(entry.source,
entry.destId,
entry.busId,
entry.requestID, sid);
}
}
catch (SIResourceException e)
{
// No FFDC code needed
// If we run out of resources, then give up on the query
// and log an error. This is probably only important for
// "request flush" queries.
flushMap.remove(sid);
// TODO: actually, this should be an admin message.
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
SibTr.event(tc, "Flush query failed for stream: " + sid);
}
}
else
{
// Nope, didn't work. Remove the query record, log the event,
// and exit.
flushMap.remove(sid);
// TODO: actually, this should be an admin message.
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
SibTr.event(tc, "Flush query expired for stream: " + sid);
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "alarm");
} | java | public void alarm(Object alarmContext)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "alarm", alarmContext);
// Alarm context should be an sid, make it so.
SIBUuid12 sid = (SIBUuid12) alarmContext;
// synchronized here in case we're racing with an answer to our
// query.
synchronized (flushMap)
{
// See if the query record is still around
FlushQueryRecord entry = flushMap.get(sid);
if (entry != null)
{
// Query still active, see if we need to restart.
entry.attempts--;
if (entry.attempts > 0)
{
// Yup, resend the query and reset the alarm. If
// entry.cached is null, then this is a "request flush"
// rather than an "are you flushed".
try
{
if (entry.cache == null)
{
upControl.sendRequestFlushMessage(entry.source,
entry.destId,
entry.busId,
entry.requestID,
sid,
false); //TODO check indoubtDiscard
}
else
{
upControl.sendAreYouFlushedMessage(entry.source,
entry.destId,
entry.busId,
entry.requestID, sid);
}
}
catch (SIResourceException e)
{
// No FFDC code needed
// If we run out of resources, then give up on the query
// and log an error. This is probably only important for
// "request flush" queries.
flushMap.remove(sid);
// TODO: actually, this should be an admin message.
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
SibTr.event(tc, "Flush query failed for stream: " + sid);
}
}
else
{
// Nope, didn't work. Remove the query record, log the event,
// and exit.
flushMap.remove(sid);
// TODO: actually, this should be an admin message.
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
SibTr.event(tc, "Flush query expired for stream: " + sid);
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "alarm");
} | [
"public",
"void",
"alarm",
"(",
"Object",
"alarmContext",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"alarm\"",
",",
"alarmContext",
")",
";",
"// Alarm context should be an sid, make it so.",
"SIBUuid12",
"sid",
"=",
"(",
"SIBUuid12",
")",
"alarmContext",
";",
"// synchronized here in case we're racing with an answer to our",
"// query.",
"synchronized",
"(",
"flushMap",
")",
"{",
"// See if the query record is still around",
"FlushQueryRecord",
"entry",
"=",
"flushMap",
".",
"get",
"(",
"sid",
")",
";",
"if",
"(",
"entry",
"!=",
"null",
")",
"{",
"// Query still active, see if we need to restart.",
"entry",
".",
"attempts",
"--",
";",
"if",
"(",
"entry",
".",
"attempts",
">",
"0",
")",
"{",
"// Yup, resend the query and reset the alarm. If",
"// entry.cached is null, then this is a \"request flush\"",
"// rather than an \"are you flushed\".",
"try",
"{",
"if",
"(",
"entry",
".",
"cache",
"==",
"null",
")",
"{",
"upControl",
".",
"sendRequestFlushMessage",
"(",
"entry",
".",
"source",
",",
"entry",
".",
"destId",
",",
"entry",
".",
"busId",
",",
"entry",
".",
"requestID",
",",
"sid",
",",
"false",
")",
";",
"//TODO check indoubtDiscard",
"}",
"else",
"{",
"upControl",
".",
"sendAreYouFlushedMessage",
"(",
"entry",
".",
"source",
",",
"entry",
".",
"destId",
",",
"entry",
".",
"busId",
",",
"entry",
".",
"requestID",
",",
"sid",
")",
";",
"}",
"}",
"catch",
"(",
"SIResourceException",
"e",
")",
"{",
"// No FFDC code needed",
"// If we run out of resources, then give up on the query",
"// and log an error. This is probably only important for",
"// \"request flush\" queries.",
"flushMap",
".",
"remove",
"(",
"sid",
")",
";",
"// TODO: actually, this should be an admin message.",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"SibTr",
".",
"event",
"(",
"tc",
",",
"\"Flush query failed for stream: \"",
"+",
"sid",
")",
";",
"}",
"}",
"else",
"{",
"// Nope, didn't work. Remove the query record, log the event,",
"// and exit.",
"flushMap",
".",
"remove",
"(",
"sid",
")",
";",
"// TODO: actually, this should be an admin message.",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"SibTr",
".",
"event",
"(",
"tc",
",",
"\"Flush query expired for stream: \"",
"+",
"sid",
")",
";",
"}",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"alarm\"",
")",
";",
"}"
] | This method is called when an alarm expires for an "are you
flushed" or "flush request" query.
@param alarmContext the alarm context we passed into
the alarm scheduler. Contains the stream ID we were querying. | [
"This",
"method",
"is",
"called",
"when",
"an",
"alarm",
"expires",
"for",
"an",
"are",
"you",
"flushed",
"or",
"flush",
"request",
"query",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java#L1047-L1119 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java | TargetStreamManager.isEmpty | public boolean isEmpty()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(this, tc, "isEmpty");
SibTr.exit(tc, "isEmpty", new Object[] {Boolean.valueOf(streamSets.isEmpty()),
Boolean.valueOf(flushedStreamSets.isEmpty()),streamSets, this});
}
// Don't report empty until any pending flushes have completed.
// Otherwise we may run into a race with an async delete thread
// for the destination.
return (streamSets.isEmpty() && flushedStreamSets.isEmpty());
} | java | public boolean isEmpty()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(this, tc, "isEmpty");
SibTr.exit(tc, "isEmpty", new Object[] {Boolean.valueOf(streamSets.isEmpty()),
Boolean.valueOf(flushedStreamSets.isEmpty()),streamSets, this});
}
// Don't report empty until any pending flushes have completed.
// Otherwise we may run into a race with an async delete thread
// for the destination.
return (streamSets.isEmpty() && flushedStreamSets.isEmpty());
} | [
"public",
"boolean",
"isEmpty",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"isEmpty\"",
")",
";",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"isEmpty\"",
",",
"new",
"Object",
"[",
"]",
"{",
"Boolean",
".",
"valueOf",
"(",
"streamSets",
".",
"isEmpty",
"(",
")",
")",
",",
"Boolean",
".",
"valueOf",
"(",
"flushedStreamSets",
".",
"isEmpty",
"(",
")",
")",
",",
"streamSets",
",",
"this",
"}",
")",
";",
"}",
"// Don't report empty until any pending flushes have completed.",
"// Otherwise we may run into a race with an async delete thread",
"// for the destination.",
"return",
"(",
"streamSets",
".",
"isEmpty",
"(",
")",
"&&",
"flushedStreamSets",
".",
"isEmpty",
"(",
")",
")",
";",
"}"
] | Determine if there are any unflushed target streams to the destination
@return boolean | [
"Determine",
"if",
"there",
"are",
"any",
"unflushed",
"target",
"streams",
"to",
"the",
"destination"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java#L1126-L1139 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java | TargetStreamManager.queryUnflushedStreams | public void queryUnflushedStreams()
throws SIResourceException
{
synchronized (streamSets) {
for(Iterator i=streamSets.iterator(); i.hasNext();)
{
StreamSet next = (StreamSet) i.next();
// Note the use of -1 for the request ID. This guarantees
// that we won't accidentally overlap with a request
// in the local request map.
upControl.sendAreYouFlushedMessage(next.getRemoteMEUuid(),
next.getDestUuid(),
next.getBusUuid(),
-1,
next.getStreamID());
}
}
} | java | public void queryUnflushedStreams()
throws SIResourceException
{
synchronized (streamSets) {
for(Iterator i=streamSets.iterator(); i.hasNext();)
{
StreamSet next = (StreamSet) i.next();
// Note the use of -1 for the request ID. This guarantees
// that we won't accidentally overlap with a request
// in the local request map.
upControl.sendAreYouFlushedMessage(next.getRemoteMEUuid(),
next.getDestUuid(),
next.getBusUuid(),
-1,
next.getStreamID());
}
}
} | [
"public",
"void",
"queryUnflushedStreams",
"(",
")",
"throws",
"SIResourceException",
"{",
"synchronized",
"(",
"streamSets",
")",
"{",
"for",
"(",
"Iterator",
"i",
"=",
"streamSets",
".",
"iterator",
"(",
")",
";",
"i",
".",
"hasNext",
"(",
")",
";",
")",
"{",
"StreamSet",
"next",
"=",
"(",
"StreamSet",
")",
"i",
".",
"next",
"(",
")",
";",
"// Note the use of -1 for the request ID. This guarantees",
"// that we won't accidentally overlap with a request",
"// in the local request map.",
"upControl",
".",
"sendAreYouFlushedMessage",
"(",
"next",
".",
"getRemoteMEUuid",
"(",
")",
",",
"next",
".",
"getDestUuid",
"(",
")",
",",
"next",
".",
"getBusUuid",
"(",
")",
",",
"-",
"1",
",",
"next",
".",
"getStreamID",
"(",
")",
")",
";",
"}",
"}",
"}"
] | Sends an "are you flushed" query to the source of any unflushed streams.
We use this to determine when it's safe to delete a destination with
possibly indoubt messages. | [
"Sends",
"an",
"are",
"you",
"flushed",
"query",
"to",
"the",
"source",
"of",
"any",
"unflushed",
"streams",
".",
"We",
"use",
"this",
"to",
"determine",
"when",
"it",
"s",
"safe",
"to",
"delete",
"a",
"destination",
"with",
"possibly",
"indoubt",
"messages",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/TargetStreamManager.java#L1317-L1335 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/PersistentTimerTaskHandler.java | PersistentTimerTaskHandler.validateAutomaticTimer | private boolean validateAutomaticTimer(BeanMetaData bmd) {
if (bmd.timedMethodInfos == null || methodId > bmd.timedMethodInfos.length) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "validateAutomaticTimer: ivMethodId=" + methodId
+ " > " + Arrays.toString(bmd.timedMethodInfos));
return false;
}
Method method = bmd.timedMethodInfos[methodId].ivMethod;
if (!method.getName().equals(automaticMethodName)) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "validateAutomaticTimer: ivAutomaticMethodName=" + automaticMethodName
+ " != " + method.getName());
return false;
}
if (automaticClassName != null &&
!automaticClassName.equals(method.getDeclaringClass().getName())) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "validateAutomaticTimer: ivAutomaticClassName=" + automaticClassName
+ " != " + method.getDeclaringClass().getName());
return false;
}
return true;
} | java | private boolean validateAutomaticTimer(BeanMetaData bmd) {
if (bmd.timedMethodInfos == null || methodId > bmd.timedMethodInfos.length) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "validateAutomaticTimer: ivMethodId=" + methodId
+ " > " + Arrays.toString(bmd.timedMethodInfos));
return false;
}
Method method = bmd.timedMethodInfos[methodId].ivMethod;
if (!method.getName().equals(automaticMethodName)) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "validateAutomaticTimer: ivAutomaticMethodName=" + automaticMethodName
+ " != " + method.getName());
return false;
}
if (automaticClassName != null &&
!automaticClassName.equals(method.getDeclaringClass().getName())) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "validateAutomaticTimer: ivAutomaticClassName=" + automaticClassName
+ " != " + method.getDeclaringClass().getName());
return false;
}
return true;
} | [
"private",
"boolean",
"validateAutomaticTimer",
"(",
"BeanMetaData",
"bmd",
")",
"{",
"if",
"(",
"bmd",
".",
"timedMethodInfos",
"==",
"null",
"||",
"methodId",
">",
"bmd",
".",
"timedMethodInfos",
".",
"length",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"validateAutomaticTimer: ivMethodId=\"",
"+",
"methodId",
"+",
"\" > \"",
"+",
"Arrays",
".",
"toString",
"(",
"bmd",
".",
"timedMethodInfos",
")",
")",
";",
"return",
"false",
";",
"}",
"Method",
"method",
"=",
"bmd",
".",
"timedMethodInfos",
"[",
"methodId",
"]",
".",
"ivMethod",
";",
"if",
"(",
"!",
"method",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"automaticMethodName",
")",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"validateAutomaticTimer: ivAutomaticMethodName=\"",
"+",
"automaticMethodName",
"+",
"\" != \"",
"+",
"method",
".",
"getName",
"(",
")",
")",
";",
"return",
"false",
";",
"}",
"if",
"(",
"automaticClassName",
"!=",
"null",
"&&",
"!",
"automaticClassName",
".",
"equals",
"(",
"method",
".",
"getDeclaringClass",
"(",
")",
".",
"getName",
"(",
")",
")",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"validateAutomaticTimer: ivAutomaticClassName=\"",
"+",
"automaticClassName",
"+",
"\" != \"",
"+",
"method",
".",
"getDeclaringClass",
"(",
")",
".",
"getName",
"(",
")",
")",
";",
"return",
"false",
";",
"}",
"return",
"true",
";",
"}"
] | Validate that the method corresponding to the method ID stored in the
database matches the method that was used when the automatic timer was
created. For example, this validation will fail if the application is
changed to remove an automatic timer without clearing the timers from
the database. As a prerequisite to calling this method, this object
must be an automatic timer.
@param bmd the bean metadata
@return true if this automatic timer is valid, or false if not | [
"Validate",
"that",
"the",
"method",
"corresponding",
"to",
"the",
"method",
"ID",
"stored",
"in",
"the",
"database",
"matches",
"the",
"method",
"that",
"was",
"used",
"when",
"the",
"automatic",
"timer",
"was",
"created",
".",
"For",
"example",
"this",
"validation",
"will",
"fail",
"if",
"the",
"application",
"is",
"changed",
"to",
"remove",
"an",
"automatic",
"timer",
"without",
"clearing",
"the",
"timers",
"from",
"the",
"database",
".",
"As",
"a",
"prerequisite",
"to",
"calling",
"this",
"method",
"this",
"object",
"must",
"be",
"an",
"automatic",
"timer",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/PersistentTimerTaskHandler.java#L317-L342 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/PersistentTimerTaskHandler.java | PersistentTimerTaskHandler.writeObject | private void writeObject(ObjectOutputStream out) throws IOException {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(tc, "writeObject: " + this);
// Use v1 unless features are present that require v2.
int version = Constants.TIMER_TASK_V1;
if (parsedSchedule != null) {
version = Constants.TIMER_TASK_V2;
}
out.defaultWriteObject();
// Write out header information first.
out.write(EYECATCHER);
out.writeShort(PLATFORM);
out.writeShort(version);
// Write out the instance data.
out.writeObject(j2eeName.getBytes());
out.writeObject(userInfoBytes);
switch (version) {
case Constants.TIMER_TASK_V1:
out.writeLong(expiration);
out.writeLong(interval);
break;
case Constants.TIMER_TASK_V2:
out.writeObject(parsedSchedule);
out.writeInt(methodId);
out.writeObject(automaticMethodName);
out.writeObject(automaticClassName);
break;
default:
// cannot occur since initialize above
break;
}
if (isTraceOn && tc.isEntryEnabled())
Tr.exit(tc, "writeObject");
} | java | private void writeObject(ObjectOutputStream out) throws IOException {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(tc, "writeObject: " + this);
// Use v1 unless features are present that require v2.
int version = Constants.TIMER_TASK_V1;
if (parsedSchedule != null) {
version = Constants.TIMER_TASK_V2;
}
out.defaultWriteObject();
// Write out header information first.
out.write(EYECATCHER);
out.writeShort(PLATFORM);
out.writeShort(version);
// Write out the instance data.
out.writeObject(j2eeName.getBytes());
out.writeObject(userInfoBytes);
switch (version) {
case Constants.TIMER_TASK_V1:
out.writeLong(expiration);
out.writeLong(interval);
break;
case Constants.TIMER_TASK_V2:
out.writeObject(parsedSchedule);
out.writeInt(methodId);
out.writeObject(automaticMethodName);
out.writeObject(automaticClassName);
break;
default:
// cannot occur since initialize above
break;
}
if (isTraceOn && tc.isEntryEnabled())
Tr.exit(tc, "writeObject");
} | [
"private",
"void",
"writeObject",
"(",
"ObjectOutputStream",
"out",
")",
"throws",
"IOException",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"writeObject: \"",
"+",
"this",
")",
";",
"// Use v1 unless features are present that require v2.",
"int",
"version",
"=",
"Constants",
".",
"TIMER_TASK_V1",
";",
"if",
"(",
"parsedSchedule",
"!=",
"null",
")",
"{",
"version",
"=",
"Constants",
".",
"TIMER_TASK_V2",
";",
"}",
"out",
".",
"defaultWriteObject",
"(",
")",
";",
"// Write out header information first.",
"out",
".",
"write",
"(",
"EYECATCHER",
")",
";",
"out",
".",
"writeShort",
"(",
"PLATFORM",
")",
";",
"out",
".",
"writeShort",
"(",
"version",
")",
";",
"// Write out the instance data.",
"out",
".",
"writeObject",
"(",
"j2eeName",
".",
"getBytes",
"(",
")",
")",
";",
"out",
".",
"writeObject",
"(",
"userInfoBytes",
")",
";",
"switch",
"(",
"version",
")",
"{",
"case",
"Constants",
".",
"TIMER_TASK_V1",
":",
"out",
".",
"writeLong",
"(",
"expiration",
")",
";",
"out",
".",
"writeLong",
"(",
"interval",
")",
";",
"break",
";",
"case",
"Constants",
".",
"TIMER_TASK_V2",
":",
"out",
".",
"writeObject",
"(",
"parsedSchedule",
")",
";",
"out",
".",
"writeInt",
"(",
"methodId",
")",
";",
"out",
".",
"writeObject",
"(",
"automaticMethodName",
")",
";",
"out",
".",
"writeObject",
"(",
"automaticClassName",
")",
";",
"break",
";",
"default",
":",
"// cannot occur since initialize above",
"break",
";",
"}",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"writeObject\"",
")",
";",
"}"
] | Write this object to the ObjectOutputStream.
Note, this is overriding the default Serialize interface implementation.
@see java.io.Serializable | [
"Write",
"this",
"object",
"to",
"the",
"ObjectOutputStream",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/PersistentTimerTaskHandler.java#L578-L622 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/PersistentTimerTaskHandler.java | PersistentTimerTaskHandler.readObject | private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(tc, "readObject");
in.defaultReadObject();
// Read in eye catcher.
byte[] eyeCatcher = new byte[EYECATCHER.length];
// Insure that all of the bytes have been read.
int bytesRead = 0;
for (int offset = 0; offset < EYECATCHER.length; offset += bytesRead) {
bytesRead = in.read(eyeCatcher, offset, EYECATCHER.length - offset);
if (bytesRead == -1) {
throw new IOException("end of input stream while reading eye catcher");
}
}
// Validate that the eyecatcher matches
for (int i = 0; i < EYECATCHER.length; i++) {
if (EYECATCHER[i] != eyeCatcher[i]) {
String eyeCatcherString = new String(eyeCatcher);
throw new IOException("Invalid eye catcher '" + eyeCatcherString + "' in TimerHandle input stream");
}
}
// Read in the rest of the header.
@SuppressWarnings("unused")
short incoming_platform = in.readShort();
short incoming_vid = in.readShort();
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "version = " + incoming_vid);
// Verify the version is supported by this version of code.
if (incoming_vid != Constants.TIMER_TASK_V1 &&
incoming_vid != Constants.TIMER_TASK_V2) {
throw new InvalidObjectException("EJB TimerTaskHandler data stream is not of the correct version, this client should be updated.");
}
// Read in the instance data.
byte[] j2eeNameBytes = (byte[]) in.readObject();
j2eeName = EJSContainer.j2eeNameFactory.create(j2eeNameBytes);
userInfoBytes = (byte[]) in.readObject();
switch (incoming_vid) {
case Constants.TIMER_TASK_V1:
expiration = in.readLong();
interval = in.readLong();
break;
case Constants.TIMER_TASK_V2:
parsedSchedule = (ParsedScheduleExpression) in.readObject();
methodId = in.readInt();
automaticMethodName = (String) in.readObject();
automaticClassName = (String) in.readObject();
break;
default:
// cannot occur since unsupported version detected above
break;
}
if (isTraceOn && tc.isEntryEnabled())
Tr.exit(tc, "readObject: " + this);
} | java | private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(tc, "readObject");
in.defaultReadObject();
// Read in eye catcher.
byte[] eyeCatcher = new byte[EYECATCHER.length];
// Insure that all of the bytes have been read.
int bytesRead = 0;
for (int offset = 0; offset < EYECATCHER.length; offset += bytesRead) {
bytesRead = in.read(eyeCatcher, offset, EYECATCHER.length - offset);
if (bytesRead == -1) {
throw new IOException("end of input stream while reading eye catcher");
}
}
// Validate that the eyecatcher matches
for (int i = 0; i < EYECATCHER.length; i++) {
if (EYECATCHER[i] != eyeCatcher[i]) {
String eyeCatcherString = new String(eyeCatcher);
throw new IOException("Invalid eye catcher '" + eyeCatcherString + "' in TimerHandle input stream");
}
}
// Read in the rest of the header.
@SuppressWarnings("unused")
short incoming_platform = in.readShort();
short incoming_vid = in.readShort();
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "version = " + incoming_vid);
// Verify the version is supported by this version of code.
if (incoming_vid != Constants.TIMER_TASK_V1 &&
incoming_vid != Constants.TIMER_TASK_V2) {
throw new InvalidObjectException("EJB TimerTaskHandler data stream is not of the correct version, this client should be updated.");
}
// Read in the instance data.
byte[] j2eeNameBytes = (byte[]) in.readObject();
j2eeName = EJSContainer.j2eeNameFactory.create(j2eeNameBytes);
userInfoBytes = (byte[]) in.readObject();
switch (incoming_vid) {
case Constants.TIMER_TASK_V1:
expiration = in.readLong();
interval = in.readLong();
break;
case Constants.TIMER_TASK_V2:
parsedSchedule = (ParsedScheduleExpression) in.readObject();
methodId = in.readInt();
automaticMethodName = (String) in.readObject();
automaticClassName = (String) in.readObject();
break;
default:
// cannot occur since unsupported version detected above
break;
}
if (isTraceOn && tc.isEntryEnabled())
Tr.exit(tc, "readObject: " + this);
} | [
"private",
"void",
"readObject",
"(",
"ObjectInputStream",
"in",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"readObject\"",
")",
";",
"in",
".",
"defaultReadObject",
"(",
")",
";",
"// Read in eye catcher.",
"byte",
"[",
"]",
"eyeCatcher",
"=",
"new",
"byte",
"[",
"EYECATCHER",
".",
"length",
"]",
";",
"// Insure that all of the bytes have been read.",
"int",
"bytesRead",
"=",
"0",
";",
"for",
"(",
"int",
"offset",
"=",
"0",
";",
"offset",
"<",
"EYECATCHER",
".",
"length",
";",
"offset",
"+=",
"bytesRead",
")",
"{",
"bytesRead",
"=",
"in",
".",
"read",
"(",
"eyeCatcher",
",",
"offset",
",",
"EYECATCHER",
".",
"length",
"-",
"offset",
")",
";",
"if",
"(",
"bytesRead",
"==",
"-",
"1",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"end of input stream while reading eye catcher\"",
")",
";",
"}",
"}",
"// Validate that the eyecatcher matches",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"EYECATCHER",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"EYECATCHER",
"[",
"i",
"]",
"!=",
"eyeCatcher",
"[",
"i",
"]",
")",
"{",
"String",
"eyeCatcherString",
"=",
"new",
"String",
"(",
"eyeCatcher",
")",
";",
"throw",
"new",
"IOException",
"(",
"\"Invalid eye catcher '\"",
"+",
"eyeCatcherString",
"+",
"\"' in TimerHandle input stream\"",
")",
";",
"}",
"}",
"// Read in the rest of the header.",
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"short",
"incoming_platform",
"=",
"in",
".",
"readShort",
"(",
")",
";",
"short",
"incoming_vid",
"=",
"in",
".",
"readShort",
"(",
")",
";",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"version = \"",
"+",
"incoming_vid",
")",
";",
"// Verify the version is supported by this version of code.",
"if",
"(",
"incoming_vid",
"!=",
"Constants",
".",
"TIMER_TASK_V1",
"&&",
"incoming_vid",
"!=",
"Constants",
".",
"TIMER_TASK_V2",
")",
"{",
"throw",
"new",
"InvalidObjectException",
"(",
"\"EJB TimerTaskHandler data stream is not of the correct version, this client should be updated.\"",
")",
";",
"}",
"// Read in the instance data.",
"byte",
"[",
"]",
"j2eeNameBytes",
"=",
"(",
"byte",
"[",
"]",
")",
"in",
".",
"readObject",
"(",
")",
";",
"j2eeName",
"=",
"EJSContainer",
".",
"j2eeNameFactory",
".",
"create",
"(",
"j2eeNameBytes",
")",
";",
"userInfoBytes",
"=",
"(",
"byte",
"[",
"]",
")",
"in",
".",
"readObject",
"(",
")",
";",
"switch",
"(",
"incoming_vid",
")",
"{",
"case",
"Constants",
".",
"TIMER_TASK_V1",
":",
"expiration",
"=",
"in",
".",
"readLong",
"(",
")",
";",
"interval",
"=",
"in",
".",
"readLong",
"(",
")",
";",
"break",
";",
"case",
"Constants",
".",
"TIMER_TASK_V2",
":",
"parsedSchedule",
"=",
"(",
"ParsedScheduleExpression",
")",
"in",
".",
"readObject",
"(",
")",
";",
"methodId",
"=",
"in",
".",
"readInt",
"(",
")",
";",
"automaticMethodName",
"=",
"(",
"String",
")",
"in",
".",
"readObject",
"(",
")",
";",
"automaticClassName",
"=",
"(",
"String",
")",
"in",
".",
"readObject",
"(",
")",
";",
"break",
";",
"default",
":",
"// cannot occur since unsupported version detected above",
"break",
";",
"}",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"readObject: \"",
"+",
"this",
")",
";",
"}"
] | Read this object from the ObjectInputStream.
Note, this is overriding the default Serialize interface implementation.
@see java.io.Serializable | [
"Read",
"this",
"object",
"from",
"the",
"ObjectInputStream",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/PersistentTimerTaskHandler.java#L631-L699 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/PersistentTimerTaskHandler.java | PersistentTimerTaskHandler.getBeanMetaData | protected BeanMetaData getBeanMetaData() {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(tc, "getBeanMetaData: " + this);
EJSHome home;
try {
// Get the currently installed and active home for this timer. It
// is possible the home is not currently running, so an
// EJBNotFoundException may occur.
home = EJSContainer.getDefaultContainer().getInstalledHome(j2eeName);
// Verify that the bean is still a Timer bean, in case the
// application has been modified since the timer was created.
if ((home.beanMetaData.timedMethodInfos) == null) {
Tr.warning(tc, "HOME_NOT_FOUND_CNTR0092W", j2eeName);
throw new EJBNotFoundException("Incompatible Application Change: " + j2eeName + " no longer supports timers.");
}
} catch (EJBNotFoundException ejbnfex) {
FFDCFilter.processException(ejbnfex, CLASS_NAME + ".getBeanMetaData", "635", this);
if (isTraceOn && tc.isEntryEnabled())
Tr.exit(tc, "getBeanMetaData: Failed locating timer bean " + j2eeName + " : " + ejbnfex);
throw new TimerServiceException("Failed locating timer bean " + j2eeName, ejbnfex);
}
BeanMetaData bmd = home.beanMetaData;
if (isTraceOn && tc.isEntryEnabled())
Tr.exit(tc, "getBeanMetaData: " + bmd);
return bmd;
} | java | protected BeanMetaData getBeanMetaData() {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(tc, "getBeanMetaData: " + this);
EJSHome home;
try {
// Get the currently installed and active home for this timer. It
// is possible the home is not currently running, so an
// EJBNotFoundException may occur.
home = EJSContainer.getDefaultContainer().getInstalledHome(j2eeName);
// Verify that the bean is still a Timer bean, in case the
// application has been modified since the timer was created.
if ((home.beanMetaData.timedMethodInfos) == null) {
Tr.warning(tc, "HOME_NOT_FOUND_CNTR0092W", j2eeName);
throw new EJBNotFoundException("Incompatible Application Change: " + j2eeName + " no longer supports timers.");
}
} catch (EJBNotFoundException ejbnfex) {
FFDCFilter.processException(ejbnfex, CLASS_NAME + ".getBeanMetaData", "635", this);
if (isTraceOn && tc.isEntryEnabled())
Tr.exit(tc, "getBeanMetaData: Failed locating timer bean " + j2eeName + " : " + ejbnfex);
throw new TimerServiceException("Failed locating timer bean " + j2eeName, ejbnfex);
}
BeanMetaData bmd = home.beanMetaData;
if (isTraceOn && tc.isEntryEnabled())
Tr.exit(tc, "getBeanMetaData: " + bmd);
return bmd;
} | [
"protected",
"BeanMetaData",
"getBeanMetaData",
"(",
")",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"getBeanMetaData: \"",
"+",
"this",
")",
";",
"EJSHome",
"home",
";",
"try",
"{",
"// Get the currently installed and active home for this timer. It",
"// is possible the home is not currently running, so an",
"// EJBNotFoundException may occur.",
"home",
"=",
"EJSContainer",
".",
"getDefaultContainer",
"(",
")",
".",
"getInstalledHome",
"(",
"j2eeName",
")",
";",
"// Verify that the bean is still a Timer bean, in case the",
"// application has been modified since the timer was created.",
"if",
"(",
"(",
"home",
".",
"beanMetaData",
".",
"timedMethodInfos",
")",
"==",
"null",
")",
"{",
"Tr",
".",
"warning",
"(",
"tc",
",",
"\"HOME_NOT_FOUND_CNTR0092W\"",
",",
"j2eeName",
")",
";",
"throw",
"new",
"EJBNotFoundException",
"(",
"\"Incompatible Application Change: \"",
"+",
"j2eeName",
"+",
"\" no longer supports timers.\"",
")",
";",
"}",
"}",
"catch",
"(",
"EJBNotFoundException",
"ejbnfex",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"ejbnfex",
",",
"CLASS_NAME",
"+",
"\".getBeanMetaData\"",
",",
"\"635\"",
",",
"this",
")",
";",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"getBeanMetaData: Failed locating timer bean \"",
"+",
"j2eeName",
"+",
"\" : \"",
"+",
"ejbnfex",
")",
";",
"throw",
"new",
"TimerServiceException",
"(",
"\"Failed locating timer bean \"",
"+",
"j2eeName",
",",
"ejbnfex",
")",
";",
"}",
"BeanMetaData",
"bmd",
"=",
"home",
".",
"beanMetaData",
";",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"getBeanMetaData: \"",
"+",
"bmd",
")",
";",
"return",
"bmd",
";",
"}"
] | Gets BeanMetaData through EJSHome lookup | [
"Gets",
"BeanMetaData",
"through",
"EJSHome",
"lookup"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/PersistentTimerTaskHandler.java#L730-L763 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/PersistentTimerTaskHandler.java | PersistentTimerTaskHandler.serializeObject | private static byte[] serializeObject(Object obj) {
if (obj == null) {
return null;
}
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
ObjectOutputStream out = new ObjectOutputStream(baos);
out.writeObject(obj);
out.flush();
} catch (IOException ioex) {
throw new EJBException("Timer info object failed to serialize.", ioex);
}
return baos.toByteArray();
} | java | private static byte[] serializeObject(Object obj) {
if (obj == null) {
return null;
}
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
ObjectOutputStream out = new ObjectOutputStream(baos);
out.writeObject(obj);
out.flush();
} catch (IOException ioex) {
throw new EJBException("Timer info object failed to serialize.", ioex);
}
return baos.toByteArray();
} | [
"private",
"static",
"byte",
"[",
"]",
"serializeObject",
"(",
"Object",
"obj",
")",
"{",
"if",
"(",
"obj",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"ByteArrayOutputStream",
"baos",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"try",
"{",
"ObjectOutputStream",
"out",
"=",
"new",
"ObjectOutputStream",
"(",
"baos",
")",
";",
"out",
".",
"writeObject",
"(",
"obj",
")",
";",
"out",
".",
"flush",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"ioex",
")",
"{",
"throw",
"new",
"EJBException",
"(",
"\"Timer info object failed to serialize.\"",
",",
"ioex",
")",
";",
"}",
"return",
"baos",
".",
"toByteArray",
"(",
")",
";",
"}"
] | Internal convenience method for serializing the user info object to a byte array. | [
"Internal",
"convenience",
"method",
"for",
"serializing",
"the",
"user",
"info",
"object",
"to",
"a",
"byte",
"array",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/PersistentTimerTaskHandler.java#L768-L784 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/inbound/HttpInboundLink.java | HttpInboundLink.maxRequestsServed | protected boolean maxRequestsServed() {
// PK12235, check for a partial or full stop
if (getChannel().isStopping()) {
// channel has stopped, no more keep-alives
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Channel stopped, disabling keep-alive request");
}
return true;
}
if (!getChannel().getHttpConfig().isKeepAliveEnabled()) {
// keep alives are disabled, no need to check the max request number
return true;
}
int max = getChannel().getHttpConfig().getMaximumPersistentRequests();
// -1 is unlimited, 0..1 is 1 request, any above that is that exact
// number of requests
if (0 <= max) {
return (this.numRequestsProcessed >= max);
}
return false;
} | java | protected boolean maxRequestsServed() {
// PK12235, check for a partial or full stop
if (getChannel().isStopping()) {
// channel has stopped, no more keep-alives
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Channel stopped, disabling keep-alive request");
}
return true;
}
if (!getChannel().getHttpConfig().isKeepAliveEnabled()) {
// keep alives are disabled, no need to check the max request number
return true;
}
int max = getChannel().getHttpConfig().getMaximumPersistentRequests();
// -1 is unlimited, 0..1 is 1 request, any above that is that exact
// number of requests
if (0 <= max) {
return (this.numRequestsProcessed >= max);
}
return false;
} | [
"protected",
"boolean",
"maxRequestsServed",
"(",
")",
"{",
"// PK12235, check for a partial or full stop",
"if",
"(",
"getChannel",
"(",
")",
".",
"isStopping",
"(",
")",
")",
"{",
"// channel has stopped, no more keep-alives",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Channel stopped, disabling keep-alive request\"",
")",
";",
"}",
"return",
"true",
";",
"}",
"if",
"(",
"!",
"getChannel",
"(",
")",
".",
"getHttpConfig",
"(",
")",
".",
"isKeepAliveEnabled",
"(",
")",
")",
"{",
"// keep alives are disabled, no need to check the max request number",
"return",
"true",
";",
"}",
"int",
"max",
"=",
"getChannel",
"(",
")",
".",
"getHttpConfig",
"(",
")",
".",
"getMaximumPersistentRequests",
"(",
")",
";",
"// -1 is unlimited, 0..1 is 1 request, any above that is that exact",
"// number of requests",
"if",
"(",
"0",
"<=",
"max",
")",
"{",
"return",
"(",
"this",
".",
"numRequestsProcessed",
">=",
"max",
")",
";",
"}",
"return",
"false",
";",
"}"
] | Find out whether we've served the maximum number of requests allowed
on this connection already.
@return boolean | [
"Find",
"out",
"whether",
"we",
"ve",
"served",
"the",
"maximum",
"number",
"of",
"requests",
"allowed",
"on",
"this",
"connection",
"already",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/inbound/HttpInboundLink.java#L217-L237 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/inbound/HttpInboundLink.java | HttpInboundLink.ready | @Override
public void ready(VirtualConnection inVC) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "ready: " + this + " " + inVC);
}
this.myTSC = (TCPConnectionContext) getDeviceLink().getChannelAccessor();
HttpInboundServiceContextImpl sc = getHTTPContext();
sc.init(this.myTSC, this, inVC, getChannel().getHttpConfig());
if (getChannel().getHttpConfig().getDebugLog().isEnabled(DebugLog.Level.INFO)) {
getChannel().getHttpConfig().getDebugLog().log(DebugLog.Level.INFO, HttpMessages.MSG_CONN_STARTING, sc);
}
processRequest();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.exit(tc, "ready");
}
} | java | @Override
public void ready(VirtualConnection inVC) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "ready: " + this + " " + inVC);
}
this.myTSC = (TCPConnectionContext) getDeviceLink().getChannelAccessor();
HttpInboundServiceContextImpl sc = getHTTPContext();
sc.init(this.myTSC, this, inVC, getChannel().getHttpConfig());
if (getChannel().getHttpConfig().getDebugLog().isEnabled(DebugLog.Level.INFO)) {
getChannel().getHttpConfig().getDebugLog().log(DebugLog.Level.INFO, HttpMessages.MSG_CONN_STARTING, sc);
}
processRequest();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.exit(tc, "ready");
}
} | [
"@",
"Override",
"public",
"void",
"ready",
"(",
"VirtualConnection",
"inVC",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"ready: \"",
"+",
"this",
"+",
"\" \"",
"+",
"inVC",
")",
";",
"}",
"this",
".",
"myTSC",
"=",
"(",
"TCPConnectionContext",
")",
"getDeviceLink",
"(",
")",
".",
"getChannelAccessor",
"(",
")",
";",
"HttpInboundServiceContextImpl",
"sc",
"=",
"getHTTPContext",
"(",
")",
";",
"sc",
".",
"init",
"(",
"this",
".",
"myTSC",
",",
"this",
",",
"inVC",
",",
"getChannel",
"(",
")",
".",
"getHttpConfig",
"(",
")",
")",
";",
"if",
"(",
"getChannel",
"(",
")",
".",
"getHttpConfig",
"(",
")",
".",
"getDebugLog",
"(",
")",
".",
"isEnabled",
"(",
"DebugLog",
".",
"Level",
".",
"INFO",
")",
")",
"{",
"getChannel",
"(",
")",
".",
"getHttpConfig",
"(",
")",
".",
"getDebugLog",
"(",
")",
".",
"log",
"(",
"DebugLog",
".",
"Level",
".",
"INFO",
",",
"HttpMessages",
".",
"MSG_CONN_STARTING",
",",
"sc",
")",
";",
"}",
"processRequest",
"(",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"ready\"",
")",
";",
"}",
"}"
] | Called by the device side channel when a new request is ready for work.
@param inVC | [
"Called",
"by",
"the",
"device",
"side",
"channel",
"when",
"a",
"new",
"request",
"is",
"ready",
"for",
"work",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/inbound/HttpInboundLink.java#L290-L307 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/inbound/HttpInboundLink.java | HttpInboundLink.processRequest | protected void processRequest() {
final int timeout = getHTTPContext().getReadTimeout();
final TCPReadCompletedCallback callback = HttpICLReadCallback.getRef();
// keep looping on processing information until we fully parse the message
// and hand it off, or until the reads for more data go async
VirtualConnection rc = null;
do {
if (handleNewInformation()) {
// new information triggered an error message, so we're done
return;
}
// Note: handleNewInformation will allocate the read buffers
if (!isPartiallyParsed()) {
// we're done parsing at this point. Note: cannot take any action
// with information after this call because it may go all the way
// from the channel above us back to the persist read, must exit
// this callstack immediately
handleNewRequest();
return;
}
rc = this.myTSC.getReadInterface().read(1, callback, false, timeout);
} while (null != rc);
} | java | protected void processRequest() {
final int timeout = getHTTPContext().getReadTimeout();
final TCPReadCompletedCallback callback = HttpICLReadCallback.getRef();
// keep looping on processing information until we fully parse the message
// and hand it off, or until the reads for more data go async
VirtualConnection rc = null;
do {
if (handleNewInformation()) {
// new information triggered an error message, so we're done
return;
}
// Note: handleNewInformation will allocate the read buffers
if (!isPartiallyParsed()) {
// we're done parsing at this point. Note: cannot take any action
// with information after this call because it may go all the way
// from the channel above us back to the persist read, must exit
// this callstack immediately
handleNewRequest();
return;
}
rc = this.myTSC.getReadInterface().read(1, callback, false, timeout);
} while (null != rc);
} | [
"protected",
"void",
"processRequest",
"(",
")",
"{",
"final",
"int",
"timeout",
"=",
"getHTTPContext",
"(",
")",
".",
"getReadTimeout",
"(",
")",
";",
"final",
"TCPReadCompletedCallback",
"callback",
"=",
"HttpICLReadCallback",
".",
"getRef",
"(",
")",
";",
"// keep looping on processing information until we fully parse the message",
"// and hand it off, or until the reads for more data go async",
"VirtualConnection",
"rc",
"=",
"null",
";",
"do",
"{",
"if",
"(",
"handleNewInformation",
"(",
")",
")",
"{",
"// new information triggered an error message, so we're done",
"return",
";",
"}",
"// Note: handleNewInformation will allocate the read buffers",
"if",
"(",
"!",
"isPartiallyParsed",
"(",
")",
")",
"{",
"// we're done parsing at this point. Note: cannot take any action",
"// with information after this call because it may go all the way",
"// from the channel above us back to the persist read, must exit",
"// this callstack immediately",
"handleNewRequest",
"(",
")",
";",
"return",
";",
"}",
"rc",
"=",
"this",
".",
"myTSC",
".",
"getReadInterface",
"(",
")",
".",
"read",
"(",
"1",
",",
"callback",
",",
"false",
",",
"timeout",
")",
";",
"}",
"while",
"(",
"null",
"!=",
"rc",
")",
";",
"}"
] | Process new information for an inbound request that needs to be parsed
and handled by channels above. | [
"Process",
"new",
"information",
"for",
"an",
"inbound",
"request",
"that",
"needs",
"to",
"be",
"parsed",
"and",
"handled",
"by",
"channels",
"above",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/inbound/HttpInboundLink.java#L313-L336 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/inbound/HttpInboundLink.java | HttpInboundLink.handleNewInformation | private boolean handleNewInformation() {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Parsing new information: " + getVirtualConnection());
}
final HttpInboundServiceContextImpl sc = getHTTPContext();
if (!isPartiallyParsed()) {
// this is the first pass through on parsing this new request
// PK12235, check for a full stop only
if (getChannel().isStopped()) {
// channel stopped during the initial read, send error back
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Channel stopped during initial read");
}
sc.setHeadersParsed();
// since we haven't parsed the request version, force the
// response to the minimal 1.0 version
sc.getResponse().setVersion(VersionValues.V10);
sendErrorMessage(StatusCodes.UNAVAILABLE);
return true;
}
}
boolean completed = false;
// if this is an http/2 link, don't perform additional parsing
if (this.isAlpnHttp2Link(switchedVC)) {
return false;
}
try {
completed = sc.parseMessage();
} catch (UnsupportedMethodException meth) {
// no FFDC required
sc.setHeadersParsed();
sendErrorMessage(StatusCodes.NOT_IMPLEMENTED);
setPartiallyParsed(false);
return true;
} catch (UnsupportedProtocolVersionException ver) {
// no FFDC required
sc.setHeadersParsed();
sendErrorMessage(StatusCodes.UNSUPPORTED_VERSION);
setPartiallyParsed(false);
return true;
} catch (MessageTooLargeException mtle) {
// no FFDC required
sc.setHeadersParsed();
sendErrorMessage(StatusCodes.ENTITY_TOO_LARGE);
setPartiallyParsed(false);
return true;
} catch (MalformedMessageException mme) {
//no FFDC required
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "parseMessage encountered a MalformedMessageException : " + mme);
}
handleGenericHNIError(mme, sc);
return true;
} catch (IllegalArgumentException iae) {
//no FFDC required
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "parseMessage encountered an IllegalArgumentException : " + iae);
}
handleGenericHNIError(iae, sc);
return true;
} catch (CompressionException ce) {
//no FFDC required
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "parseMessage encountered a CompressionException : " + ce);
}
handleGenericHNIError(ce, sc);
return true;
} catch (Throwable t) {
FFDCFilter.processException(t,
"HttpInboundLink.handleNewInformation",
"2", this);
handleGenericHNIError(t, sc);
return true;
}
// partialParsed is the opposite of the complete flag
setPartiallyParsed(!completed);
if (isPartiallyParsed()) {
sc.setupReadBuffers(sc.getHttpConfig().getIncomingHdrBufferSize(), false);
}
return false;
} | java | private boolean handleNewInformation() {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Parsing new information: " + getVirtualConnection());
}
final HttpInboundServiceContextImpl sc = getHTTPContext();
if (!isPartiallyParsed()) {
// this is the first pass through on parsing this new request
// PK12235, check for a full stop only
if (getChannel().isStopped()) {
// channel stopped during the initial read, send error back
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Channel stopped during initial read");
}
sc.setHeadersParsed();
// since we haven't parsed the request version, force the
// response to the minimal 1.0 version
sc.getResponse().setVersion(VersionValues.V10);
sendErrorMessage(StatusCodes.UNAVAILABLE);
return true;
}
}
boolean completed = false;
// if this is an http/2 link, don't perform additional parsing
if (this.isAlpnHttp2Link(switchedVC)) {
return false;
}
try {
completed = sc.parseMessage();
} catch (UnsupportedMethodException meth) {
// no FFDC required
sc.setHeadersParsed();
sendErrorMessage(StatusCodes.NOT_IMPLEMENTED);
setPartiallyParsed(false);
return true;
} catch (UnsupportedProtocolVersionException ver) {
// no FFDC required
sc.setHeadersParsed();
sendErrorMessage(StatusCodes.UNSUPPORTED_VERSION);
setPartiallyParsed(false);
return true;
} catch (MessageTooLargeException mtle) {
// no FFDC required
sc.setHeadersParsed();
sendErrorMessage(StatusCodes.ENTITY_TOO_LARGE);
setPartiallyParsed(false);
return true;
} catch (MalformedMessageException mme) {
//no FFDC required
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "parseMessage encountered a MalformedMessageException : " + mme);
}
handleGenericHNIError(mme, sc);
return true;
} catch (IllegalArgumentException iae) {
//no FFDC required
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "parseMessage encountered an IllegalArgumentException : " + iae);
}
handleGenericHNIError(iae, sc);
return true;
} catch (CompressionException ce) {
//no FFDC required
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "parseMessage encountered a CompressionException : " + ce);
}
handleGenericHNIError(ce, sc);
return true;
} catch (Throwable t) {
FFDCFilter.processException(t,
"HttpInboundLink.handleNewInformation",
"2", this);
handleGenericHNIError(t, sc);
return true;
}
// partialParsed is the opposite of the complete flag
setPartiallyParsed(!completed);
if (isPartiallyParsed()) {
sc.setupReadBuffers(sc.getHttpConfig().getIncomingHdrBufferSize(), false);
}
return false;
} | [
"private",
"boolean",
"handleNewInformation",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Parsing new information: \"",
"+",
"getVirtualConnection",
"(",
")",
")",
";",
"}",
"final",
"HttpInboundServiceContextImpl",
"sc",
"=",
"getHTTPContext",
"(",
")",
";",
"if",
"(",
"!",
"isPartiallyParsed",
"(",
")",
")",
"{",
"// this is the first pass through on parsing this new request",
"// PK12235, check for a full stop only",
"if",
"(",
"getChannel",
"(",
")",
".",
"isStopped",
"(",
")",
")",
"{",
"// channel stopped during the initial read, send error back",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Channel stopped during initial read\"",
")",
";",
"}",
"sc",
".",
"setHeadersParsed",
"(",
")",
";",
"// since we haven't parsed the request version, force the",
"// response to the minimal 1.0 version",
"sc",
".",
"getResponse",
"(",
")",
".",
"setVersion",
"(",
"VersionValues",
".",
"V10",
")",
";",
"sendErrorMessage",
"(",
"StatusCodes",
".",
"UNAVAILABLE",
")",
";",
"return",
"true",
";",
"}",
"}",
"boolean",
"completed",
"=",
"false",
";",
"// if this is an http/2 link, don't perform additional parsing",
"if",
"(",
"this",
".",
"isAlpnHttp2Link",
"(",
"switchedVC",
")",
")",
"{",
"return",
"false",
";",
"}",
"try",
"{",
"completed",
"=",
"sc",
".",
"parseMessage",
"(",
")",
";",
"}",
"catch",
"(",
"UnsupportedMethodException",
"meth",
")",
"{",
"// no FFDC required",
"sc",
".",
"setHeadersParsed",
"(",
")",
";",
"sendErrorMessage",
"(",
"StatusCodes",
".",
"NOT_IMPLEMENTED",
")",
";",
"setPartiallyParsed",
"(",
"false",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",
"UnsupportedProtocolVersionException",
"ver",
")",
"{",
"// no FFDC required",
"sc",
".",
"setHeadersParsed",
"(",
")",
";",
"sendErrorMessage",
"(",
"StatusCodes",
".",
"UNSUPPORTED_VERSION",
")",
";",
"setPartiallyParsed",
"(",
"false",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",
"MessageTooLargeException",
"mtle",
")",
"{",
"// no FFDC required",
"sc",
".",
"setHeadersParsed",
"(",
")",
";",
"sendErrorMessage",
"(",
"StatusCodes",
".",
"ENTITY_TOO_LARGE",
")",
";",
"setPartiallyParsed",
"(",
"false",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",
"MalformedMessageException",
"mme",
")",
"{",
"//no FFDC required",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"parseMessage encountered a MalformedMessageException : \"",
"+",
"mme",
")",
";",
"}",
"handleGenericHNIError",
"(",
"mme",
",",
"sc",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",
"IllegalArgumentException",
"iae",
")",
"{",
"//no FFDC required",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"parseMessage encountered an IllegalArgumentException : \"",
"+",
"iae",
")",
";",
"}",
"handleGenericHNIError",
"(",
"iae",
",",
"sc",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",
"CompressionException",
"ce",
")",
"{",
"//no FFDC required",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"parseMessage encountered a CompressionException : \"",
"+",
"ce",
")",
";",
"}",
"handleGenericHNIError",
"(",
"ce",
",",
"sc",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",
"Throwable",
"t",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"t",
",",
"\"HttpInboundLink.handleNewInformation\"",
",",
"\"2\"",
",",
"this",
")",
";",
"handleGenericHNIError",
"(",
"t",
",",
"sc",
")",
";",
"return",
"true",
";",
"}",
"// partialParsed is the opposite of the complete flag",
"setPartiallyParsed",
"(",
"!",
"completed",
")",
";",
"if",
"(",
"isPartiallyParsed",
"(",
")",
")",
"{",
"sc",
".",
"setupReadBuffers",
"(",
"sc",
".",
"getHttpConfig",
"(",
")",
".",
"getIncomingHdrBufferSize",
"(",
")",
",",
"false",
")",
";",
"}",
"return",
"false",
";",
"}"
] | Handle parsing the incoming request message.
@return whether an error happend and this connection is already done | [
"Handle",
"parsing",
"the",
"incoming",
"request",
"message",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/inbound/HttpInboundLink.java#L343-L428 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/inbound/HttpInboundLink.java | HttpInboundLink.handleGenericHNIError | private void handleGenericHNIError(Throwable t, HttpInboundServiceContextImpl hisc) {
hisc.setHeadersParsed();
sendErrorMessage(t);
setPartiallyParsed(false);
} | java | private void handleGenericHNIError(Throwable t, HttpInboundServiceContextImpl hisc) {
hisc.setHeadersParsed();
sendErrorMessage(t);
setPartiallyParsed(false);
} | [
"private",
"void",
"handleGenericHNIError",
"(",
"Throwable",
"t",
",",
"HttpInboundServiceContextImpl",
"hisc",
")",
"{",
"hisc",
".",
"setHeadersParsed",
"(",
")",
";",
"sendErrorMessage",
"(",
"t",
")",
";",
"setPartiallyParsed",
"(",
"false",
")",
";",
"}"
] | the same thing so now they will just call this one method | [
"the",
"same",
"thing",
"so",
"now",
"they",
"will",
"just",
"call",
"this",
"one",
"method"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/inbound/HttpInboundLink.java#L432-L436 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/inbound/HttpInboundLink.java | HttpInboundLink.handleNewRequest | private void handleNewRequest() {
// if this is an http/2 request, skip to discrimination
if (!isAlpnHttp2Link(this.vc)) {
final HttpInboundServiceContextImpl sc = getHTTPContext();
// save the request info that was parsed in case somebody changes it
sc.setRequestVersion(sc.getRequest().getVersionValue());
sc.setRequestMethod(sc.getRequest().getMethodValue());
// get the response message initialized. Note: in the proxy env, this
// response message will be overwritten; however, this is the only
// spot to init() it correctly for all other cases.
sc.getResponseImpl().init(sc);
this.numRequestsProcessed++;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Received request number " + this.numRequestsProcessed + " on link " + this);
}
// check for the 100-continue scenario
if (!sc.check100Continue()) {
return;
}
}
handleDiscrimination();
} | java | private void handleNewRequest() {
// if this is an http/2 request, skip to discrimination
if (!isAlpnHttp2Link(this.vc)) {
final HttpInboundServiceContextImpl sc = getHTTPContext();
// save the request info that was parsed in case somebody changes it
sc.setRequestVersion(sc.getRequest().getVersionValue());
sc.setRequestMethod(sc.getRequest().getMethodValue());
// get the response message initialized. Note: in the proxy env, this
// response message will be overwritten; however, this is the only
// spot to init() it correctly for all other cases.
sc.getResponseImpl().init(sc);
this.numRequestsProcessed++;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Received request number " + this.numRequestsProcessed + " on link " + this);
}
// check for the 100-continue scenario
if (!sc.check100Continue()) {
return;
}
}
handleDiscrimination();
} | [
"private",
"void",
"handleNewRequest",
"(",
")",
"{",
"// if this is an http/2 request, skip to discrimination",
"if",
"(",
"!",
"isAlpnHttp2Link",
"(",
"this",
".",
"vc",
")",
")",
"{",
"final",
"HttpInboundServiceContextImpl",
"sc",
"=",
"getHTTPContext",
"(",
")",
";",
"// save the request info that was parsed in case somebody changes it",
"sc",
".",
"setRequestVersion",
"(",
"sc",
".",
"getRequest",
"(",
")",
".",
"getVersionValue",
"(",
")",
")",
";",
"sc",
".",
"setRequestMethod",
"(",
"sc",
".",
"getRequest",
"(",
")",
".",
"getMethodValue",
"(",
")",
")",
";",
"// get the response message initialized. Note: in the proxy env, this",
"// response message will be overwritten; however, this is the only",
"// spot to init() it correctly for all other cases.",
"sc",
".",
"getResponseImpl",
"(",
")",
".",
"init",
"(",
"sc",
")",
";",
"this",
".",
"numRequestsProcessed",
"++",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Received request number \"",
"+",
"this",
".",
"numRequestsProcessed",
"+",
"\" on link \"",
"+",
"this",
")",
";",
"}",
"// check for the 100-continue scenario",
"if",
"(",
"!",
"sc",
".",
"check100Continue",
"(",
")",
")",
"{",
"return",
";",
"}",
"}",
"handleDiscrimination",
"(",
")",
";",
"}"
] | Process a new request message, updating internal stats and calling the
discrimination to pass it along the channel chain. | [
"Process",
"a",
"new",
"request",
"message",
"updating",
"internal",
"stats",
"and",
"calling",
"the",
"discrimination",
"to",
"pass",
"it",
"along",
"the",
"channel",
"chain",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/inbound/HttpInboundLink.java#L442-L467 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/inbound/HttpInboundLink.java | HttpInboundLink.sendErrorMessage | private void sendErrorMessage(Throwable t) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Sending a 400 for throwable [" + t + "]");
}
sendErrorMessage(StatusCodes.BAD_REQUEST);
} | java | private void sendErrorMessage(Throwable t) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Sending a 400 for throwable [" + t + "]");
}
sendErrorMessage(StatusCodes.BAD_REQUEST);
} | [
"private",
"void",
"sendErrorMessage",
"(",
"Throwable",
"t",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Sending a 400 for throwable [\"",
"+",
"t",
"+",
"\"]\"",
")",
";",
"}",
"sendErrorMessage",
"(",
"StatusCodes",
".",
"BAD_REQUEST",
")",
";",
"}"
] | Send an error message when a generic throwable occurs.
@param t | [
"Send",
"an",
"error",
"message",
"when",
"a",
"generic",
"throwable",
"occurs",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/inbound/HttpInboundLink.java#L566-L571 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/inbound/HttpInboundLink.java | HttpInboundLink.sendErrorMessage | private void sendErrorMessage(StatusCodes code) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Sending an error page back [code: " + code + "]");
}
try {
getHTTPContext().sendError(code.getHttpError());
} catch (MessageSentException mse) {
// no FFDC required
close(getVirtualConnection(), new Exception("HTTP Message failure"));
}
} | java | private void sendErrorMessage(StatusCodes code) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Sending an error page back [code: " + code + "]");
}
try {
getHTTPContext().sendError(code.getHttpError());
} catch (MessageSentException mse) {
// no FFDC required
close(getVirtualConnection(), new Exception("HTTP Message failure"));
}
} | [
"private",
"void",
"sendErrorMessage",
"(",
"StatusCodes",
"code",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Sending an error page back [code: \"",
"+",
"code",
"+",
"\"]\"",
")",
";",
"}",
"try",
"{",
"getHTTPContext",
"(",
")",
".",
"sendError",
"(",
"code",
".",
"getHttpError",
"(",
")",
")",
";",
"}",
"catch",
"(",
"MessageSentException",
"mse",
")",
"{",
"// no FFDC required",
"close",
"(",
"getVirtualConnection",
"(",
")",
",",
"new",
"Exception",
"(",
"\"HTTP Message failure\"",
")",
")",
";",
"}",
"}"
] | Send an error message back to the client with a defined
status code, instead of an exception.
@param code | [
"Send",
"an",
"error",
"message",
"back",
"to",
"the",
"client",
"with",
"a",
"defined",
"status",
"code",
"instead",
"of",
"an",
"exception",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/inbound/HttpInboundLink.java#L579-L589 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/inbound/HttpInboundLink.java | HttpInboundLink.handlePipeLining | private void handlePipeLining() {
HttpServiceContextImpl sc = getHTTPContext();
WsByteBuffer buffer = sc.returnLastBuffer();
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "Pipelined request found: " + buffer);
}
sc.clear();
// save it back so that we always release it
sc.storeAllocatedBuffer(buffer);
sc.disableBufferModification();
EventEngine events = HttpDispatcher.getEventService();
if (null != events) {
Event event = events.createEvent(HttpPipelineEventHandler.TOPIC_PIPELINING);
event.setProperty(CallbackIDs.CALLBACK_HTTPICL.getName(), this);
events.postEvent(event);
} else {
// unable to dispatch work request, continue on this thread
ready(getVirtualConnection());
}
} | java | private void handlePipeLining() {
HttpServiceContextImpl sc = getHTTPContext();
WsByteBuffer buffer = sc.returnLastBuffer();
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "Pipelined request found: " + buffer);
}
sc.clear();
// save it back so that we always release it
sc.storeAllocatedBuffer(buffer);
sc.disableBufferModification();
EventEngine events = HttpDispatcher.getEventService();
if (null != events) {
Event event = events.createEvent(HttpPipelineEventHandler.TOPIC_PIPELINING);
event.setProperty(CallbackIDs.CALLBACK_HTTPICL.getName(), this);
events.postEvent(event);
} else {
// unable to dispatch work request, continue on this thread
ready(getVirtualConnection());
}
} | [
"private",
"void",
"handlePipeLining",
"(",
")",
"{",
"HttpServiceContextImpl",
"sc",
"=",
"getHTTPContext",
"(",
")",
";",
"WsByteBuffer",
"buffer",
"=",
"sc",
".",
"returnLastBuffer",
"(",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"Pipelined request found: \"",
"+",
"buffer",
")",
";",
"}",
"sc",
".",
"clear",
"(",
")",
";",
"// save it back so that we always release it",
"sc",
".",
"storeAllocatedBuffer",
"(",
"buffer",
")",
";",
"sc",
".",
"disableBufferModification",
"(",
")",
";",
"EventEngine",
"events",
"=",
"HttpDispatcher",
".",
"getEventService",
"(",
")",
";",
"if",
"(",
"null",
"!=",
"events",
")",
"{",
"Event",
"event",
"=",
"events",
".",
"createEvent",
"(",
"HttpPipelineEventHandler",
".",
"TOPIC_PIPELINING",
")",
";",
"event",
".",
"setProperty",
"(",
"CallbackIDs",
".",
"CALLBACK_HTTPICL",
".",
"getName",
"(",
")",
",",
"this",
")",
";",
"events",
".",
"postEvent",
"(",
"event",
")",
";",
"}",
"else",
"{",
"// unable to dispatch work request, continue on this thread",
"ready",
"(",
"getVirtualConnection",
"(",
")",
")",
";",
"}",
"}"
] | Handle a pipelined request discovered while closing the handling of the
last request. | [
"Handle",
"a",
"pipelined",
"request",
"discovered",
"while",
"closing",
"the",
"handling",
"of",
"the",
"last",
"request",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/inbound/HttpInboundLink.java#L595-L614 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/inbound/HttpInboundLink.java | HttpInboundLink.error | @Override
public void error(VirtualConnection inVC, Throwable t) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "error() called on " + this + " " + inVC);
}
try {
close(inVC, (Exception) t);
} catch (ClassCastException cce) {
// no FFDC required
close(inVC, new Exception("Problem when finishing response"));
}
} | java | @Override
public void error(VirtualConnection inVC, Throwable t) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "error() called on " + this + " " + inVC);
}
try {
close(inVC, (Exception) t);
} catch (ClassCastException cce) {
// no FFDC required
close(inVC, new Exception("Problem when finishing response"));
}
} | [
"@",
"Override",
"public",
"void",
"error",
"(",
"VirtualConnection",
"inVC",
",",
"Throwable",
"t",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"error() called on \"",
"+",
"this",
"+",
"\" \"",
"+",
"inVC",
")",
";",
"}",
"try",
"{",
"close",
"(",
"inVC",
",",
"(",
"Exception",
")",
"t",
")",
";",
"}",
"catch",
"(",
"ClassCastException",
"cce",
")",
"{",
"// no FFDC required",
"close",
"(",
"inVC",
",",
"new",
"Exception",
"(",
"\"Problem when finishing response\"",
")",
")",
";",
"}",
"}"
] | Called when an error occurs on this connection.
@param inVC
@param t | [
"Called",
"when",
"an",
"error",
"occurs",
"on",
"this",
"connection",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/inbound/HttpInboundLink.java#L879-L890 | train |
Subsets and Splits