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.runtime/src/com/ibm/ws/sib/processor/impl/PubSubOutputHandler.java | PubSubOutputHandler.sendSilenceMessage | public void sendSilenceMessage(
long startStamp,
long endStamp,
long completedPrefix,
boolean requestedOnly,
int priority,
Reliability reliability,
SIBUuid12 stream)
throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "sendSilenceMessage",
new Object[] {
new Long(startStamp),
new Long(endStamp),
new Long(completedPrefix),
new Integer(priority),
reliability });
ControlSilence sMsg;
try
{
// Create new Silence message
sMsg = _cmf.createNewControlSilence();
}
catch (Exception e)
{
// FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.PubSubOutputHandler.sendSilenceMessage",
"1:787:1.164.1.5",
this);
SibTr.exception(tc, e);
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.impl.PubSubOutputHandler",
"1:794:1.164.1.5",
e });
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "sendSilenceMessage", e);
throw new SIResourceException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.impl.PubSubOutputHandler",
"1:805:1.164.1.5",
e },
null),
e);
}
// As we are using the Guaranteed Header - set all the attributes as
// well as the ones we want.
SIMPUtils.setGuaranteedDeliveryProperties(sMsg,
_messageProcessor.getMessagingEngineUuid(),
null,
stream,
null,
_destinationHandler.getUuid(),
ProtocolType.PUBSUBINPUT,
GDConfig.PROTOCOL_VERSION);
sMsg.setStartTick(startStamp);
sMsg.setEndTick(endStamp);
sMsg.setPriority(priority);
sMsg.setReliability(reliability);
sMsg.setCompletedPrefix(completedPrefix);
sMsg.setRequestedOnly(requestedOnly);
// If the destination in a Link add Link specific properties to message
if( _isLink )
{
sMsg = (ControlSilence)addLinkProps(sMsg);
}
// Send message to destination
// Using MPIO
// Send the message to the MessageTransmitter
//add a target cellule to the array for sending
SIBUuid8[] fromTo = new SIBUuid8[1];
fromTo[0] = _targetMEUuid;
// Send at priority+1 if this is a response to a Nack
if( requestedOnly )
_mpio.sendDownTree(fromTo, priority+1, sMsg);
else
_mpio.sendDownTree(fromTo, priority, sMsg);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "sendSilenceMessage");
} | java | public void sendSilenceMessage(
long startStamp,
long endStamp,
long completedPrefix,
boolean requestedOnly,
int priority,
Reliability reliability,
SIBUuid12 stream)
throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "sendSilenceMessage",
new Object[] {
new Long(startStamp),
new Long(endStamp),
new Long(completedPrefix),
new Integer(priority),
reliability });
ControlSilence sMsg;
try
{
// Create new Silence message
sMsg = _cmf.createNewControlSilence();
}
catch (Exception e)
{
// FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.PubSubOutputHandler.sendSilenceMessage",
"1:787:1.164.1.5",
this);
SibTr.exception(tc, e);
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.impl.PubSubOutputHandler",
"1:794:1.164.1.5",
e });
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "sendSilenceMessage", e);
throw new SIResourceException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0002",
new Object[] {
"com.ibm.ws.sib.processor.impl.PubSubOutputHandler",
"1:805:1.164.1.5",
e },
null),
e);
}
// As we are using the Guaranteed Header - set all the attributes as
// well as the ones we want.
SIMPUtils.setGuaranteedDeliveryProperties(sMsg,
_messageProcessor.getMessagingEngineUuid(),
null,
stream,
null,
_destinationHandler.getUuid(),
ProtocolType.PUBSUBINPUT,
GDConfig.PROTOCOL_VERSION);
sMsg.setStartTick(startStamp);
sMsg.setEndTick(endStamp);
sMsg.setPriority(priority);
sMsg.setReliability(reliability);
sMsg.setCompletedPrefix(completedPrefix);
sMsg.setRequestedOnly(requestedOnly);
// If the destination in a Link add Link specific properties to message
if( _isLink )
{
sMsg = (ControlSilence)addLinkProps(sMsg);
}
// Send message to destination
// Using MPIO
// Send the message to the MessageTransmitter
//add a target cellule to the array for sending
SIBUuid8[] fromTo = new SIBUuid8[1];
fromTo[0] = _targetMEUuid;
// Send at priority+1 if this is a response to a Nack
if( requestedOnly )
_mpio.sendDownTree(fromTo, priority+1, sMsg);
else
_mpio.sendDownTree(fromTo, priority, sMsg);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "sendSilenceMessage");
} | [
"public",
"void",
"sendSilenceMessage",
"(",
"long",
"startStamp",
",",
"long",
"endStamp",
",",
"long",
"completedPrefix",
",",
"boolean",
"requestedOnly",
",",
"int",
"priority",
",",
"Reliability",
"reliability",
",",
"SIBUuid12",
"stream",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"sendSilenceMessage\"",
",",
"new",
"Object",
"[",
"]",
"{",
"new",
"Long",
"(",
"startStamp",
")",
",",
"new",
"Long",
"(",
"endStamp",
")",
",",
"new",
"Long",
"(",
"completedPrefix",
")",
",",
"new",
"Integer",
"(",
"priority",
")",
",",
"reliability",
"}",
")",
";",
"ControlSilence",
"sMsg",
";",
"try",
"{",
"// Create new Silence message",
"sMsg",
"=",
"_cmf",
".",
"createNewControlSilence",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"// FFDC",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.impl.PubSubOutputHandler.sendSilenceMessage\"",
",",
"\"1:787:1.164.1.5\"",
",",
"this",
")",
";",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"SibTr",
".",
"error",
"(",
"tc",
",",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.impl.PubSubOutputHandler\"",
",",
"\"1:794:1.164.1.5\"",
",",
"e",
"}",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"sendSilenceMessage\"",
",",
"e",
")",
";",
"throw",
"new",
"SIResourceException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.impl.PubSubOutputHandler\"",
",",
"\"1:805:1.164.1.5\"",
",",
"e",
"}",
",",
"null",
")",
",",
"e",
")",
";",
"}",
"// As we are using the Guaranteed Header - set all the attributes as ",
"// well as the ones we want.",
"SIMPUtils",
".",
"setGuaranteedDeliveryProperties",
"(",
"sMsg",
",",
"_messageProcessor",
".",
"getMessagingEngineUuid",
"(",
")",
",",
"null",
",",
"stream",
",",
"null",
",",
"_destinationHandler",
".",
"getUuid",
"(",
")",
",",
"ProtocolType",
".",
"PUBSUBINPUT",
",",
"GDConfig",
".",
"PROTOCOL_VERSION",
")",
";",
"sMsg",
".",
"setStartTick",
"(",
"startStamp",
")",
";",
"sMsg",
".",
"setEndTick",
"(",
"endStamp",
")",
";",
"sMsg",
".",
"setPriority",
"(",
"priority",
")",
";",
"sMsg",
".",
"setReliability",
"(",
"reliability",
")",
";",
"sMsg",
".",
"setCompletedPrefix",
"(",
"completedPrefix",
")",
";",
"sMsg",
".",
"setRequestedOnly",
"(",
"requestedOnly",
")",
";",
"// If the destination in a Link add Link specific properties to message",
"if",
"(",
"_isLink",
")",
"{",
"sMsg",
"=",
"(",
"ControlSilence",
")",
"addLinkProps",
"(",
"sMsg",
")",
";",
"}",
"// Send message to destination",
"// Using MPIO",
"// Send the message to the MessageTransmitter",
"//add a target cellule to the array for sending",
"SIBUuid8",
"[",
"]",
"fromTo",
"=",
"new",
"SIBUuid8",
"[",
"1",
"]",
";",
"fromTo",
"[",
"0",
"]",
"=",
"_targetMEUuid",
";",
"// Send at priority+1 if this is a response to a Nack",
"if",
"(",
"requestedOnly",
")",
"_mpio",
".",
"sendDownTree",
"(",
"fromTo",
",",
"priority",
"+",
"1",
",",
"sMsg",
")",
";",
"else",
"_mpio",
".",
"sendDownTree",
"(",
"fromTo",
",",
"priority",
",",
"sMsg",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"sendSilenceMessage\"",
")",
";",
"}"
] | sendSilenceMessage may be called from InternalOutputStream
when a Nack is recevied | [
"sendSilenceMessage",
"may",
"be",
"called",
"from",
"InternalOutputStream",
"when",
"a",
"Nack",
"is",
"recevied"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PubSubOutputHandler.java#L715-L812 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PubSubOutputHandler.java | PubSubOutputHandler.sendLinkMessage | public void sendLinkMessage( MessageItem msgItem, boolean rollback)
throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "sendLinkMessage", msgItem);
JsMessage jsMsg=null;
try
{
//defect 245624
jsMsg = msgItem.getMessage().getReceived();
}
catch(MessageCopyFailedException e)
{
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.PubSubOutputHandler.sendLinkMessage",
"1:1097:1.164.1.5",
this);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "sendLinkMessage", "SIErrorException");
throw new SIErrorException(e);
}
SIBUuid8[] fromTo = new SIBUuid8[1];
fromTo[0] = _targetMEUuid;
if( rollback )
{
ControlMessage cMsg = createSilenceMessage(jsMsg.getGuaranteedValueValueTick(),
jsMsg.getGuaranteedValueCompletedPrefix(),
msgItem.getPriority(),
msgItem.getReliability(),
jsMsg.getGuaranteedStreamUUID());
cMsg = addLinkProps(cMsg);
cMsg.setRoutingDestination( _routingDestination );
//call MPIO to finally send the message to the remote MEs
_mpio.sendDownTree(fromTo, //the list of source target pairs
msgItem.getPriority(), //priority
cMsg); //the Silence Message
}
else
{
// Add Link specific properties to message
jsMsg = addLinkProps(jsMsg);
jsMsg.setRoutingDestination( _routingDestination );
jsMsg.setGuaranteedSourceMessagingEngineUUID( _messageProcessor.getMessagingEngineUuid() );
//call MPIO to finally send the message to the remote MEs
_mpio.sendDownTree(fromTo, //the list of source target pairs
msgItem.getPriority(), //priority
jsMsg); //the JsMessage
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "sendLinkMessage");
} | java | public void sendLinkMessage( MessageItem msgItem, boolean rollback)
throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "sendLinkMessage", msgItem);
JsMessage jsMsg=null;
try
{
//defect 245624
jsMsg = msgItem.getMessage().getReceived();
}
catch(MessageCopyFailedException e)
{
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.PubSubOutputHandler.sendLinkMessage",
"1:1097:1.164.1.5",
this);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "sendLinkMessage", "SIErrorException");
throw new SIErrorException(e);
}
SIBUuid8[] fromTo = new SIBUuid8[1];
fromTo[0] = _targetMEUuid;
if( rollback )
{
ControlMessage cMsg = createSilenceMessage(jsMsg.getGuaranteedValueValueTick(),
jsMsg.getGuaranteedValueCompletedPrefix(),
msgItem.getPriority(),
msgItem.getReliability(),
jsMsg.getGuaranteedStreamUUID());
cMsg = addLinkProps(cMsg);
cMsg.setRoutingDestination( _routingDestination );
//call MPIO to finally send the message to the remote MEs
_mpio.sendDownTree(fromTo, //the list of source target pairs
msgItem.getPriority(), //priority
cMsg); //the Silence Message
}
else
{
// Add Link specific properties to message
jsMsg = addLinkProps(jsMsg);
jsMsg.setRoutingDestination( _routingDestination );
jsMsg.setGuaranteedSourceMessagingEngineUUID( _messageProcessor.getMessagingEngineUuid() );
//call MPIO to finally send the message to the remote MEs
_mpio.sendDownTree(fromTo, //the list of source target pairs
msgItem.getPriority(), //priority
jsMsg); //the JsMessage
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "sendLinkMessage");
} | [
"public",
"void",
"sendLinkMessage",
"(",
"MessageItem",
"msgItem",
",",
"boolean",
"rollback",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"sendLinkMessage\"",
",",
"msgItem",
")",
";",
"JsMessage",
"jsMsg",
"=",
"null",
";",
"try",
"{",
"//defect 245624",
"jsMsg",
"=",
"msgItem",
".",
"getMessage",
"(",
")",
".",
"getReceived",
"(",
")",
";",
"}",
"catch",
"(",
"MessageCopyFailedException",
"e",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.impl.PubSubOutputHandler.sendLinkMessage\"",
",",
"\"1:1097:1.164.1.5\"",
",",
"this",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"sendLinkMessage\"",
",",
"\"SIErrorException\"",
")",
";",
"throw",
"new",
"SIErrorException",
"(",
"e",
")",
";",
"}",
"SIBUuid8",
"[",
"]",
"fromTo",
"=",
"new",
"SIBUuid8",
"[",
"1",
"]",
";",
"fromTo",
"[",
"0",
"]",
"=",
"_targetMEUuid",
";",
"if",
"(",
"rollback",
")",
"{",
"ControlMessage",
"cMsg",
"=",
"createSilenceMessage",
"(",
"jsMsg",
".",
"getGuaranteedValueValueTick",
"(",
")",
",",
"jsMsg",
".",
"getGuaranteedValueCompletedPrefix",
"(",
")",
",",
"msgItem",
".",
"getPriority",
"(",
")",
",",
"msgItem",
".",
"getReliability",
"(",
")",
",",
"jsMsg",
".",
"getGuaranteedStreamUUID",
"(",
")",
")",
";",
"cMsg",
"=",
"addLinkProps",
"(",
"cMsg",
")",
";",
"cMsg",
".",
"setRoutingDestination",
"(",
"_routingDestination",
")",
";",
"//call MPIO to finally send the message to the remote MEs",
"_mpio",
".",
"sendDownTree",
"(",
"fromTo",
",",
"//the list of source target pairs",
"msgItem",
".",
"getPriority",
"(",
")",
",",
"//priority",
"cMsg",
")",
";",
"//the Silence Message ",
"}",
"else",
"{",
"// Add Link specific properties to message",
"jsMsg",
"=",
"addLinkProps",
"(",
"jsMsg",
")",
";",
"jsMsg",
".",
"setRoutingDestination",
"(",
"_routingDestination",
")",
";",
"jsMsg",
".",
"setGuaranteedSourceMessagingEngineUUID",
"(",
"_messageProcessor",
".",
"getMessagingEngineUuid",
"(",
")",
")",
";",
"//call MPIO to finally send the message to the remote MEs",
"_mpio",
".",
"sendDownTree",
"(",
"fromTo",
",",
"//the list of source target pairs",
"msgItem",
".",
"getPriority",
"(",
")",
",",
"//priority",
"jsMsg",
")",
";",
"//the JsMessage ",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"sendLinkMessage\"",
")",
";",
"}"
] | properties need to be set on the mssage | [
"properties",
"need",
"to",
"be",
"set",
"on",
"the",
"mssage"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PubSubOutputHandler.java#L1040-L1100 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PubSubOutputHandler.java | PubSubOutputHandler.removeStream | public void removeStream(SIBUuid12 stream)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "removeStream", stream);
// nuke the stream out of our internal store
_internalOutputStreamManager.remove(stream);
deregisterControlAdapterMBean();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "removeStream");
} | java | public void removeStream(SIBUuid12 stream)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "removeStream", stream);
// nuke the stream out of our internal store
_internalOutputStreamManager.remove(stream);
deregisterControlAdapterMBean();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "removeStream");
} | [
"public",
"void",
"removeStream",
"(",
"SIBUuid12",
"stream",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"removeStream\"",
",",
"stream",
")",
";",
"// nuke the stream out of our internal store",
"_internalOutputStreamManager",
".",
"remove",
"(",
"stream",
")",
";",
"deregisterControlAdapterMBean",
"(",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"removeStream\"",
")",
";",
"}"
] | This method is called by the input handler when it flushes a local stream.
This is our cue to remove any data structures we may be maintaining for
this stream.
@param stream The flushed stream | [
"This",
"method",
"is",
"called",
"by",
"the",
"input",
"handler",
"when",
"it",
"flushes",
"a",
"local",
"stream",
".",
"This",
"is",
"our",
"cue",
"to",
"remove",
"any",
"data",
"structures",
"we",
"may",
"be",
"maintaining",
"for",
"this",
"stream",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PubSubOutputHandler.java#L1808-L1817 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PubSubOutputHandler.java | PubSubOutputHandler.setTopicSpaceMapping | public void setTopicSpaceMapping(String foreignTSName)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "setTopicSpaceMapping", foreignTSName);
// Create routingDestination object
_routingDestination =
SIMPUtils.createJsDestinationAddress(foreignTSName,
null,
_neighbour.getBusId());
this._foreignTSName = foreignTSName;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "setTopicSpaceMapping");
} | java | public void setTopicSpaceMapping(String foreignTSName)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "setTopicSpaceMapping", foreignTSName);
// Create routingDestination object
_routingDestination =
SIMPUtils.createJsDestinationAddress(foreignTSName,
null,
_neighbour.getBusId());
this._foreignTSName = foreignTSName;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "setTopicSpaceMapping");
} | [
"public",
"void",
"setTopicSpaceMapping",
"(",
"String",
"foreignTSName",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"setTopicSpaceMapping\"",
",",
"foreignTSName",
")",
";",
"// Create routingDestination object",
"_routingDestination",
"=",
"SIMPUtils",
".",
"createJsDestinationAddress",
"(",
"foreignTSName",
",",
"null",
",",
"_neighbour",
".",
"getBusId",
"(",
")",
")",
";",
"this",
".",
"_foreignTSName",
"=",
"foreignTSName",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"setTopicSpaceMapping\"",
")",
";",
"}"
] | Creates the JsDestinationAddress object passed over in publications
to foreign buses.
@param String The foreign topicspace mapping | [
"Creates",
"the",
"JsDestinationAddress",
"object",
"passed",
"over",
"in",
"publications",
"to",
"foreign",
"buses",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/PubSubOutputHandler.java#L1873-L1885 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/TransactionControlImpl.java | TransactionControlImpl.getCurrentTransactionalUOW | public SynchronizationRegistryUOWScope getCurrentTransactionalUOW(boolean checkMarkedRollback)
throws CSITransactionRolledbackException
{
UOWCoordinator coord = uowCurrent.getUOWCoord(); // 131880-6
if (coord != null)
{
if (checkMarkedRollback && coord.getRollbackOnly()) // 131880-6 d173218.1
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "Attempting to do work on a tx " +
"that has been marked rollback.");
}
throw new CSITransactionRolledbackException("Transaction rolled back");
}
} // if coord != null
return (SynchronizationRegistryUOWScope) coord; // 131880-6
} | java | public SynchronizationRegistryUOWScope getCurrentTransactionalUOW(boolean checkMarkedRollback)
throws CSITransactionRolledbackException
{
UOWCoordinator coord = uowCurrent.getUOWCoord(); // 131880-6
if (coord != null)
{
if (checkMarkedRollback && coord.getRollbackOnly()) // 131880-6 d173218.1
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "Attempting to do work on a tx " +
"that has been marked rollback.");
}
throw new CSITransactionRolledbackException("Transaction rolled back");
}
} // if coord != null
return (SynchronizationRegistryUOWScope) coord; // 131880-6
} | [
"public",
"SynchronizationRegistryUOWScope",
"getCurrentTransactionalUOW",
"(",
"boolean",
"checkMarkedRollback",
")",
"throws",
"CSITransactionRolledbackException",
"{",
"UOWCoordinator",
"coord",
"=",
"uowCurrent",
".",
"getUOWCoord",
"(",
")",
";",
"// 131880-6",
"if",
"(",
"coord",
"!=",
"null",
")",
"{",
"if",
"(",
"checkMarkedRollback",
"&&",
"coord",
".",
"getRollbackOnly",
"(",
")",
")",
"// 131880-6 d173218.1",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"Attempting to do work on a tx \"",
"+",
"\"that has been marked rollback.\"",
")",
";",
"}",
"throw",
"new",
"CSITransactionRolledbackException",
"(",
"\"Transaction rolled back\"",
")",
";",
"}",
"}",
"// if coord != null",
"return",
"(",
"SynchronizationRegistryUOWScope",
")",
"coord",
";",
"// 131880-6",
"}"
] | Added checkMarkedRollback parameter. d166414 | [
"Added",
"checkMarkedRollback",
"parameter",
".",
"d166414"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/TransactionControlImpl.java#L565-L583 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/TransactionControlImpl.java | TransactionControlImpl.setRollbackOnly | public void setRollbackOnly()
{
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled()) { // d173022.3
Tr.entry(tc, "setRollbackOnly", this);
}
LocalTransactionCoordinator lCoord = getLocalCoord();
if (lCoord != null) {
lCoord.setRollbackOnly();
} else {
try {
txService.setRollbackOnly(); //LIDB1673.2.1.5
} catch (Exception e) { //LIDB1673.2.1.5 SystemException
// Shouldn't get here
FFDCFilter.processException(e, CLASS_NAME + ".setRollbackOnly",
"556", this);
throw new IllegalStateException("No active transaction");
}
}
if (isTraceOn && tc.isEntryEnabled()) { // d173022.3
Tr.exit(tc, "setRollbackOnly");
}
} | java | public void setRollbackOnly()
{
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled()) { // d173022.3
Tr.entry(tc, "setRollbackOnly", this);
}
LocalTransactionCoordinator lCoord = getLocalCoord();
if (lCoord != null) {
lCoord.setRollbackOnly();
} else {
try {
txService.setRollbackOnly(); //LIDB1673.2.1.5
} catch (Exception e) { //LIDB1673.2.1.5 SystemException
// Shouldn't get here
FFDCFilter.processException(e, CLASS_NAME + ".setRollbackOnly",
"556", this);
throw new IllegalStateException("No active transaction");
}
}
if (isTraceOn && tc.isEntryEnabled()) { // d173022.3
Tr.exit(tc, "setRollbackOnly");
}
} | [
"public",
"void",
"setRollbackOnly",
"(",
")",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"// d173022.3",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"setRollbackOnly\"",
",",
"this",
")",
";",
"}",
"LocalTransactionCoordinator",
"lCoord",
"=",
"getLocalCoord",
"(",
")",
";",
"if",
"(",
"lCoord",
"!=",
"null",
")",
"{",
"lCoord",
".",
"setRollbackOnly",
"(",
")",
";",
"}",
"else",
"{",
"try",
"{",
"txService",
".",
"setRollbackOnly",
"(",
")",
";",
"//LIDB1673.2.1.5",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"//LIDB1673.2.1.5 SystemException",
"// Shouldn't get here",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"CLASS_NAME",
"+",
"\".setRollbackOnly\"",
",",
"\"556\"",
",",
"this",
")",
";",
"throw",
"new",
"IllegalStateException",
"(",
"\"No active transaction\"",
")",
";",
"}",
"}",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"// d173022.3",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"setRollbackOnly\"",
")",
";",
"}",
"}"
] | Marks the current local or global transaction to be rolled back | [
"Marks",
"the",
"current",
"local",
"or",
"global",
"transaction",
"to",
"be",
"rolled",
"back"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/TransactionControlImpl.java#L627-L651 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/TransactionControlImpl.java | TransactionControlImpl.getRollbackOnly | public boolean getRollbackOnly()
{
LocalTransactionCoordinator lCoord = getLocalCoord();
if (lCoord != null) {
return (lCoord.getRollbackOnly());
} else {
int status = Status.STATUS_NO_TRANSACTION; //LIDB1673.2.1.5
try { //LIDB1673.2.1.5
status = txService.getStatus(); //LIDB1673.2.1.5
} //LIDB1673.2.1.5
catch (SystemException e) //LIDB1673.2.1.5
{ //LIDB1673.2.1.5
FFDCFilter.processException(e, CLASS_NAME + ".getRollbackOnly",
"667", this); //LIDB1673.2.1.5
} //LIDB1673.2.1.5
return (status == Status.STATUS_MARKED_ROLLBACK || //LIDB1673.2.1.5
status == Status.STATUS_ROLLEDBACK || //LIDB1673.2.1.5
status == Status.STATUS_ROLLING_BACK); //LIDB1673.2.1.5
}
} | java | public boolean getRollbackOnly()
{
LocalTransactionCoordinator lCoord = getLocalCoord();
if (lCoord != null) {
return (lCoord.getRollbackOnly());
} else {
int status = Status.STATUS_NO_TRANSACTION; //LIDB1673.2.1.5
try { //LIDB1673.2.1.5
status = txService.getStatus(); //LIDB1673.2.1.5
} //LIDB1673.2.1.5
catch (SystemException e) //LIDB1673.2.1.5
{ //LIDB1673.2.1.5
FFDCFilter.processException(e, CLASS_NAME + ".getRollbackOnly",
"667", this); //LIDB1673.2.1.5
} //LIDB1673.2.1.5
return (status == Status.STATUS_MARKED_ROLLBACK || //LIDB1673.2.1.5
status == Status.STATUS_ROLLEDBACK || //LIDB1673.2.1.5
status == Status.STATUS_ROLLING_BACK); //LIDB1673.2.1.5
}
} | [
"public",
"boolean",
"getRollbackOnly",
"(",
")",
"{",
"LocalTransactionCoordinator",
"lCoord",
"=",
"getLocalCoord",
"(",
")",
";",
"if",
"(",
"lCoord",
"!=",
"null",
")",
"{",
"return",
"(",
"lCoord",
".",
"getRollbackOnly",
"(",
")",
")",
";",
"}",
"else",
"{",
"int",
"status",
"=",
"Status",
".",
"STATUS_NO_TRANSACTION",
";",
"//LIDB1673.2.1.5",
"try",
"{",
"//LIDB1673.2.1.5",
"status",
"=",
"txService",
".",
"getStatus",
"(",
")",
";",
"//LIDB1673.2.1.5",
"}",
"//LIDB1673.2.1.5",
"catch",
"(",
"SystemException",
"e",
")",
"//LIDB1673.2.1.5",
"{",
"//LIDB1673.2.1.5",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"CLASS_NAME",
"+",
"\".getRollbackOnly\"",
",",
"\"667\"",
",",
"this",
")",
";",
"//LIDB1673.2.1.5",
"}",
"//LIDB1673.2.1.5",
"return",
"(",
"status",
"==",
"Status",
".",
"STATUS_MARKED_ROLLBACK",
"||",
"//LIDB1673.2.1.5",
"status",
"==",
"Status",
".",
"STATUS_ROLLEDBACK",
"||",
"//LIDB1673.2.1.5",
"status",
"==",
"Status",
".",
"STATUS_ROLLING_BACK",
")",
";",
"//LIDB1673.2.1.5",
"}",
"}"
] | Returns true iff the current local or global transaction has been
marked rollback only | [
"Returns",
"true",
"iff",
"the",
"current",
"local",
"or",
"global",
"transaction",
"has",
"been",
"marked",
"rollback",
"only"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/TransactionControlImpl.java#L659-L680 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/TransactionControlImpl.java | TransactionControlImpl.enlistWithTransaction | public void enlistWithTransaction(javax.transaction.Synchronization sync)
throws CSIException
{
SynchronizationRegistryUOWScope uowScope = getCurrentTransactionalUOW(false);
if (uowScope == null)
{
throw new IllegalStateException("No active transaction");
}
enlistWithTransaction(uowScope, sync);
} | java | public void enlistWithTransaction(javax.transaction.Synchronization sync)
throws CSIException
{
SynchronizationRegistryUOWScope uowScope = getCurrentTransactionalUOW(false);
if (uowScope == null)
{
throw new IllegalStateException("No active transaction");
}
enlistWithTransaction(uowScope, sync);
} | [
"public",
"void",
"enlistWithTransaction",
"(",
"javax",
".",
"transaction",
".",
"Synchronization",
"sync",
")",
"throws",
"CSIException",
"{",
"SynchronizationRegistryUOWScope",
"uowScope",
"=",
"getCurrentTransactionalUOW",
"(",
"false",
")",
";",
"if",
"(",
"uowScope",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"No active transaction\"",
")",
";",
"}",
"enlistWithTransaction",
"(",
"uowScope",
",",
"sync",
")",
";",
"}"
] | Enlist synchronization instance with the current local or global
transaction. | [
"Enlist",
"synchronization",
"instance",
"with",
"the",
"current",
"local",
"or",
"global",
"transaction",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/TransactionControlImpl.java#L686-L696 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/TransactionControlImpl.java | TransactionControlImpl.enlistWithTransaction | public void enlistWithTransaction(SynchronizationRegistryUOWScope uowCoord,
Synchronization sync)
throws CSIException
{
try
{
if (uowCoord.getUOWType() == UOWSynchronizationRegistry.UOW_TYPE_GLOBAL_TRANSACTION)
{
((Transaction) uowCoord).registerSynchronization(sync);
}
else
{
((LocalTransactionCoordinator) uowCoord).enlistSynchronization(sync);
}
} catch (Exception ex)
{
throw new CSIException("Failed to enlist with transaction", ex);
}
} | java | public void enlistWithTransaction(SynchronizationRegistryUOWScope uowCoord,
Synchronization sync)
throws CSIException
{
try
{
if (uowCoord.getUOWType() == UOWSynchronizationRegistry.UOW_TYPE_GLOBAL_TRANSACTION)
{
((Transaction) uowCoord).registerSynchronization(sync);
}
else
{
((LocalTransactionCoordinator) uowCoord).enlistSynchronization(sync);
}
} catch (Exception ex)
{
throw new CSIException("Failed to enlist with transaction", ex);
}
} | [
"public",
"void",
"enlistWithTransaction",
"(",
"SynchronizationRegistryUOWScope",
"uowCoord",
",",
"Synchronization",
"sync",
")",
"throws",
"CSIException",
"{",
"try",
"{",
"if",
"(",
"uowCoord",
".",
"getUOWType",
"(",
")",
"==",
"UOWSynchronizationRegistry",
".",
"UOW_TYPE_GLOBAL_TRANSACTION",
")",
"{",
"(",
"(",
"Transaction",
")",
"uowCoord",
")",
".",
"registerSynchronization",
"(",
"sync",
")",
";",
"}",
"else",
"{",
"(",
"(",
"LocalTransactionCoordinator",
")",
"uowCoord",
")",
".",
"enlistSynchronization",
"(",
"sync",
")",
";",
"}",
"}",
"catch",
"(",
"Exception",
"ex",
")",
"{",
"throw",
"new",
"CSIException",
"(",
"\"Failed to enlist with transaction\"",
",",
"ex",
")",
";",
"}",
"}"
] | Enlist synchronization instance with the specified UOWCoord | [
"Enlist",
"synchronization",
"instance",
"with",
"the",
"specified",
"UOWCoord"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/TransactionControlImpl.java#L701-L719 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/TransactionControlImpl.java | TransactionControlImpl.beginLocalTx | final LocalTransactionCoordinator beginLocalTx()
{
LocalTransactionCoordinator lCoord = null;
try {
ltcCurrent.begin();
lCoord = getLocalCoord(); // d175585
if (TraceComponent.isAnyTracingEnabled()) // d527372
{
if (tc.isEventEnabled())
{
if (lCoord != null) {
Tr.event(tc, "Began LTC cntxt: tid=" +
Integer.toHexString(lCoord.hashCode()) + "(LTC)");
} else {
Tr.event(tc, "Began LTC cntxt: " + "null Coordinator!");
}
}
// d165585 Begins
if (lCoord != null && TETxLifeCycleInfo.isTraceEnabled()) // d171555
{
TETxLifeCycleInfo.traceLocalTxBegin("" + System.identityHashCode(lCoord), "Begin Local Tx");
}
// d165585 Ends
}
} catch (Exception ex) {
FFDCFilter.processException(ex, CLASS_NAME + ".beginLocalTx", "737", this);
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "Begin local tx failed", ex);
}
}
return (lCoord);
} | java | final LocalTransactionCoordinator beginLocalTx()
{
LocalTransactionCoordinator lCoord = null;
try {
ltcCurrent.begin();
lCoord = getLocalCoord(); // d175585
if (TraceComponent.isAnyTracingEnabled()) // d527372
{
if (tc.isEventEnabled())
{
if (lCoord != null) {
Tr.event(tc, "Began LTC cntxt: tid=" +
Integer.toHexString(lCoord.hashCode()) + "(LTC)");
} else {
Tr.event(tc, "Began LTC cntxt: " + "null Coordinator!");
}
}
// d165585 Begins
if (lCoord != null && TETxLifeCycleInfo.isTraceEnabled()) // d171555
{
TETxLifeCycleInfo.traceLocalTxBegin("" + System.identityHashCode(lCoord), "Begin Local Tx");
}
// d165585 Ends
}
} catch (Exception ex) {
FFDCFilter.processException(ex, CLASS_NAME + ".beginLocalTx", "737", this);
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "Begin local tx failed", ex);
}
}
return (lCoord);
} | [
"final",
"LocalTransactionCoordinator",
"beginLocalTx",
"(",
")",
"{",
"LocalTransactionCoordinator",
"lCoord",
"=",
"null",
";",
"try",
"{",
"ltcCurrent",
".",
"begin",
"(",
")",
";",
"lCoord",
"=",
"getLocalCoord",
"(",
")",
";",
"// d175585",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
")",
"// d527372",
"{",
"if",
"(",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"{",
"if",
"(",
"lCoord",
"!=",
"null",
")",
"{",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"Began LTC cntxt: tid=\"",
"+",
"Integer",
".",
"toHexString",
"(",
"lCoord",
".",
"hashCode",
"(",
")",
")",
"+",
"\"(LTC)\"",
")",
";",
"}",
"else",
"{",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"Began LTC cntxt: \"",
"+",
"\"null Coordinator!\"",
")",
";",
"}",
"}",
"// d165585 Begins",
"if",
"(",
"lCoord",
"!=",
"null",
"&&",
"TETxLifeCycleInfo",
".",
"isTraceEnabled",
"(",
")",
")",
"// d171555",
"{",
"TETxLifeCycleInfo",
".",
"traceLocalTxBegin",
"(",
"\"\"",
"+",
"System",
".",
"identityHashCode",
"(",
"lCoord",
")",
",",
"\"Begin Local Tx\"",
")",
";",
"}",
"// d165585 Ends",
"}",
"}",
"catch",
"(",
"Exception",
"ex",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"ex",
",",
"CLASS_NAME",
"+",
"\".beginLocalTx\"",
",",
"\"737\"",
",",
"this",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"Begin local tx failed\"",
",",
"ex",
")",
";",
"}",
"}",
"return",
"(",
"lCoord",
")",
";",
"}"
] | Begin a new local trasaction context | [
"Begin",
"a",
"new",
"local",
"trasaction",
"context"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/TransactionControlImpl.java#L922-L956 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/TransactionControlImpl.java | TransactionControlImpl.suspendGlobalTx | final Transaction suspendGlobalTx(int action) throws CSIException //LIDB1673.2.1.5 //d174358.1
{
Transaction ctrl = null; //LIDB1673.2.1.5
try { //LIDB1673.2.1.5
ctrl = txService.suspend(); //LIDB1673.2.1.5
if (TraceComponent.isAnyTracingEnabled()) // d527372
{
if (tc.isEventEnabled()) //LIDB1673.2.1.5
Tr.event(tc, "Suspending TX cntxt: " + ctrl); //LIDB1673.2.1.5
// d165585 Begins
if (TETxLifeCycleInfo.isTraceEnabled()) // PQ74774
{ // PQ74774
String idStr = null; // d171555
if (ctrl != null) // d171555
idStr = ctrl.toString(); // d171555
int idx;
idStr = (idStr != null)
? (((idx = idStr.indexOf("(")) != -1)
? idStr.substring(idx + 1, idStr.indexOf(")"))
: ((idx = idStr.indexOf("tid=")) != -1)
? idStr.substring(idx + 4)
: idStr)
: "NoTx";
TETxLifeCycleInfo.traceGlobalTxSuspend(idStr, "Suspend Global Tx");
} // PQ74774
// d165585 Ends
}
} //LIDB1673.2.1.5
catch (SystemException e) //LIDB1673.2.1.5
{ //LIDB1673.2.1.5
FFDCFilter.processException(e, CLASS_NAME + ".setRollbackOnly", "770", this); //LIDB1673.2.1.5
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) //LIDB1673.2.1.5
Tr.event(tc, "Error suspending global tx", e); //LIDB1673.2.1.5
throw new CSIException("suspend global tx failed", e);//d174358.1
} //LIDB1673.2.1.5
if (ctrl != null) {
int txtype = ((UOWCoordinator) ctrl).getTxType(); //LIDB1673.2.1.5
// NonInteropControls have no coordinator
if (txtype == UOWCoordinator.TXTYPE_NONINTEROP_GLOBAL)
return ctrl; //LIDB1673.2.1.5
}
return ctrl;
} | java | final Transaction suspendGlobalTx(int action) throws CSIException //LIDB1673.2.1.5 //d174358.1
{
Transaction ctrl = null; //LIDB1673.2.1.5
try { //LIDB1673.2.1.5
ctrl = txService.suspend(); //LIDB1673.2.1.5
if (TraceComponent.isAnyTracingEnabled()) // d527372
{
if (tc.isEventEnabled()) //LIDB1673.2.1.5
Tr.event(tc, "Suspending TX cntxt: " + ctrl); //LIDB1673.2.1.5
// d165585 Begins
if (TETxLifeCycleInfo.isTraceEnabled()) // PQ74774
{ // PQ74774
String idStr = null; // d171555
if (ctrl != null) // d171555
idStr = ctrl.toString(); // d171555
int idx;
idStr = (idStr != null)
? (((idx = idStr.indexOf("(")) != -1)
? idStr.substring(idx + 1, idStr.indexOf(")"))
: ((idx = idStr.indexOf("tid=")) != -1)
? idStr.substring(idx + 4)
: idStr)
: "NoTx";
TETxLifeCycleInfo.traceGlobalTxSuspend(idStr, "Suspend Global Tx");
} // PQ74774
// d165585 Ends
}
} //LIDB1673.2.1.5
catch (SystemException e) //LIDB1673.2.1.5
{ //LIDB1673.2.1.5
FFDCFilter.processException(e, CLASS_NAME + ".setRollbackOnly", "770", this); //LIDB1673.2.1.5
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) //LIDB1673.2.1.5
Tr.event(tc, "Error suspending global tx", e); //LIDB1673.2.1.5
throw new CSIException("suspend global tx failed", e);//d174358.1
} //LIDB1673.2.1.5
if (ctrl != null) {
int txtype = ((UOWCoordinator) ctrl).getTxType(); //LIDB1673.2.1.5
// NonInteropControls have no coordinator
if (txtype == UOWCoordinator.TXTYPE_NONINTEROP_GLOBAL)
return ctrl; //LIDB1673.2.1.5
}
return ctrl;
} | [
"final",
"Transaction",
"suspendGlobalTx",
"(",
"int",
"action",
")",
"throws",
"CSIException",
"//LIDB1673.2.1.5 //d174358.1",
"{",
"Transaction",
"ctrl",
"=",
"null",
";",
"//LIDB1673.2.1.5",
"try",
"{",
"//LIDB1673.2.1.5",
"ctrl",
"=",
"txService",
".",
"suspend",
"(",
")",
";",
"//LIDB1673.2.1.5",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
")",
"// d527372",
"{",
"if",
"(",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"//LIDB1673.2.1.5",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"Suspending TX cntxt: \"",
"+",
"ctrl",
")",
";",
"//LIDB1673.2.1.5",
"// d165585 Begins",
"if",
"(",
"TETxLifeCycleInfo",
".",
"isTraceEnabled",
"(",
")",
")",
"// PQ74774",
"{",
"// PQ74774",
"String",
"idStr",
"=",
"null",
";",
"// d171555",
"if",
"(",
"ctrl",
"!=",
"null",
")",
"// d171555",
"idStr",
"=",
"ctrl",
".",
"toString",
"(",
")",
";",
"// d171555",
"int",
"idx",
";",
"idStr",
"=",
"(",
"idStr",
"!=",
"null",
")",
"?",
"(",
"(",
"(",
"idx",
"=",
"idStr",
".",
"indexOf",
"(",
"\"(\"",
")",
")",
"!=",
"-",
"1",
")",
"?",
"idStr",
".",
"substring",
"(",
"idx",
"+",
"1",
",",
"idStr",
".",
"indexOf",
"(",
"\")\"",
")",
")",
":",
"(",
"(",
"idx",
"=",
"idStr",
".",
"indexOf",
"(",
"\"tid=\"",
")",
")",
"!=",
"-",
"1",
")",
"?",
"idStr",
".",
"substring",
"(",
"idx",
"+",
"4",
")",
":",
"idStr",
")",
":",
"\"NoTx\"",
";",
"TETxLifeCycleInfo",
".",
"traceGlobalTxSuspend",
"(",
"idStr",
",",
"\"Suspend Global Tx\"",
")",
";",
"}",
"// PQ74774",
"// d165585 Ends",
"}",
"}",
"//LIDB1673.2.1.5",
"catch",
"(",
"SystemException",
"e",
")",
"//LIDB1673.2.1.5",
"{",
"//LIDB1673.2.1.5",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"CLASS_NAME",
"+",
"\".setRollbackOnly\"",
",",
"\"770\"",
",",
"this",
")",
";",
"//LIDB1673.2.1.5",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"//LIDB1673.2.1.5",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"Error suspending global tx\"",
",",
"e",
")",
";",
"//LIDB1673.2.1.5",
"throw",
"new",
"CSIException",
"(",
"\"suspend global tx failed\"",
",",
"e",
")",
";",
"//d174358.1",
"}",
"//LIDB1673.2.1.5",
"if",
"(",
"ctrl",
"!=",
"null",
")",
"{",
"int",
"txtype",
"=",
"(",
"(",
"UOWCoordinator",
")",
"ctrl",
")",
".",
"getTxType",
"(",
")",
";",
"//LIDB1673.2.1.5",
"// NonInteropControls have no coordinator",
"if",
"(",
"txtype",
"==",
"UOWCoordinator",
".",
"TXTYPE_NONINTEROP_GLOBAL",
")",
"return",
"ctrl",
";",
"//LIDB1673.2.1.5",
"}",
"return",
"ctrl",
";",
"}"
] | Suspend the current global transaction and return the Control instance for
it; the inactivity timeout is either started or stopped, according
to action. If no global transaction exists on the thread, do nothing;
returned Control object will be null is this case | [
"Suspend",
"the",
"current",
"global",
"transaction",
"and",
"return",
"the",
"Control",
"instance",
"for",
"it",
";",
"the",
"inactivity",
"timeout",
"is",
"either",
"started",
"or",
"stopped",
"according",
"to",
"action",
".",
"If",
"no",
"global",
"transaction",
"exists",
"on",
"the",
"thread",
"do",
"nothing",
";",
"returned",
"Control",
"object",
"will",
"be",
"null",
"is",
"this",
"case"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/TransactionControlImpl.java#L1009-L1055 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/TransactionControlImpl.java | TransactionControlImpl.resumeGlobalTx | final void resumeGlobalTx(Transaction ctrl, int action) //LIDB1673.2.1.5
throws SystemException, InvalidTransactionException //LIDB1673.2.1.5
{
try { //LIDB1673.2.1.5
txService.resume(ctrl); //LIDB1673.2.1.5
} //LIDB1673.2.1.5
catch (SystemException e) //LIDB1673.2.1.5
{ //LIDB1673.2.1.5
FFDCFilter.processException(e, CLASS_NAME + ".resumeGlobalTx", "814", this); //LIDB1673.2.1.5
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) //LIDB1673.2.1.5
Tr.event(tc, "Error resuming global tx", e); //LIDB1673.2.1.5
throw e; //LIDB1673.2.1.5
} //LIDB1673.2.1.5
if (TraceComponent.isAnyTracingEnabled()) // d527372
{
if (tc.isEventEnabled())
Tr.event(tc, "Resumed TX cntxt: " + txService.getTransaction()); //LIDB1673.2.1.5
// d165585 Begins
if (TETxLifeCycleInfo.isTraceEnabled()) // PQ74774
{ // PQ74774
String idStr = null; // d171555
if (ctrl != null) // d171555
idStr = ctrl.toString(); // d171555
int idx;
idStr = (idStr != null)
? (((idx = idStr.indexOf("(")) != -1)
? idStr.substring(idx + 1, idStr.indexOf(")"))
: ((idx = idStr.indexOf("tid=")) != -1)
? idStr.substring(idx + 4)
: idStr)
: "NoTx";
TETxLifeCycleInfo.traceGlobalTxResume(idStr, "Resume Global Tx");
} // PQ74774
// d165585 Ends
}
// NonInteropControls have no coordinator
if (ctrl != null && ((UOWCoordinator) ctrl).getTxType() == UOWCoordinator.TXTYPE_NONINTEROP_GLOBAL)
return; //LIDB1673.2.1.5
} | java | final void resumeGlobalTx(Transaction ctrl, int action) //LIDB1673.2.1.5
throws SystemException, InvalidTransactionException //LIDB1673.2.1.5
{
try { //LIDB1673.2.1.5
txService.resume(ctrl); //LIDB1673.2.1.5
} //LIDB1673.2.1.5
catch (SystemException e) //LIDB1673.2.1.5
{ //LIDB1673.2.1.5
FFDCFilter.processException(e, CLASS_NAME + ".resumeGlobalTx", "814", this); //LIDB1673.2.1.5
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) //LIDB1673.2.1.5
Tr.event(tc, "Error resuming global tx", e); //LIDB1673.2.1.5
throw e; //LIDB1673.2.1.5
} //LIDB1673.2.1.5
if (TraceComponent.isAnyTracingEnabled()) // d527372
{
if (tc.isEventEnabled())
Tr.event(tc, "Resumed TX cntxt: " + txService.getTransaction()); //LIDB1673.2.1.5
// d165585 Begins
if (TETxLifeCycleInfo.isTraceEnabled()) // PQ74774
{ // PQ74774
String idStr = null; // d171555
if (ctrl != null) // d171555
idStr = ctrl.toString(); // d171555
int idx;
idStr = (idStr != null)
? (((idx = idStr.indexOf("(")) != -1)
? idStr.substring(idx + 1, idStr.indexOf(")"))
: ((idx = idStr.indexOf("tid=")) != -1)
? idStr.substring(idx + 4)
: idStr)
: "NoTx";
TETxLifeCycleInfo.traceGlobalTxResume(idStr, "Resume Global Tx");
} // PQ74774
// d165585 Ends
}
// NonInteropControls have no coordinator
if (ctrl != null && ((UOWCoordinator) ctrl).getTxType() == UOWCoordinator.TXTYPE_NONINTEROP_GLOBAL)
return; //LIDB1673.2.1.5
} | [
"final",
"void",
"resumeGlobalTx",
"(",
"Transaction",
"ctrl",
",",
"int",
"action",
")",
"//LIDB1673.2.1.5",
"throws",
"SystemException",
",",
"InvalidTransactionException",
"//LIDB1673.2.1.5",
"{",
"try",
"{",
"//LIDB1673.2.1.5",
"txService",
".",
"resume",
"(",
"ctrl",
")",
";",
"//LIDB1673.2.1.5",
"}",
"//LIDB1673.2.1.5",
"catch",
"(",
"SystemException",
"e",
")",
"//LIDB1673.2.1.5",
"{",
"//LIDB1673.2.1.5",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"CLASS_NAME",
"+",
"\".resumeGlobalTx\"",
",",
"\"814\"",
",",
"this",
")",
";",
"//LIDB1673.2.1.5",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"//LIDB1673.2.1.5",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"Error resuming global tx\"",
",",
"e",
")",
";",
"//LIDB1673.2.1.5",
"throw",
"e",
";",
"//LIDB1673.2.1.5",
"}",
"//LIDB1673.2.1.5",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
")",
"// d527372",
"{",
"if",
"(",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"Resumed TX cntxt: \"",
"+",
"txService",
".",
"getTransaction",
"(",
")",
")",
";",
"//LIDB1673.2.1.5",
"// d165585 Begins",
"if",
"(",
"TETxLifeCycleInfo",
".",
"isTraceEnabled",
"(",
")",
")",
"// PQ74774",
"{",
"// PQ74774",
"String",
"idStr",
"=",
"null",
";",
"// d171555",
"if",
"(",
"ctrl",
"!=",
"null",
")",
"// d171555",
"idStr",
"=",
"ctrl",
".",
"toString",
"(",
")",
";",
"// d171555",
"int",
"idx",
";",
"idStr",
"=",
"(",
"idStr",
"!=",
"null",
")",
"?",
"(",
"(",
"(",
"idx",
"=",
"idStr",
".",
"indexOf",
"(",
"\"(\"",
")",
")",
"!=",
"-",
"1",
")",
"?",
"idStr",
".",
"substring",
"(",
"idx",
"+",
"1",
",",
"idStr",
".",
"indexOf",
"(",
"\")\"",
")",
")",
":",
"(",
"(",
"idx",
"=",
"idStr",
".",
"indexOf",
"(",
"\"tid=\"",
")",
")",
"!=",
"-",
"1",
")",
"?",
"idStr",
".",
"substring",
"(",
"idx",
"+",
"4",
")",
":",
"idStr",
")",
":",
"\"NoTx\"",
";",
"TETxLifeCycleInfo",
".",
"traceGlobalTxResume",
"(",
"idStr",
",",
"\"Resume Global Tx\"",
")",
";",
"}",
"// PQ74774",
"// d165585 Ends",
"}",
"// NonInteropControls have no coordinator",
"if",
"(",
"ctrl",
"!=",
"null",
"&&",
"(",
"(",
"UOWCoordinator",
")",
"ctrl",
")",
".",
"getTxType",
"(",
")",
"==",
"UOWCoordinator",
".",
"TXTYPE_NONINTEROP_GLOBAL",
")",
"return",
";",
"//LIDB1673.2.1.5",
"}"
] | Resume the global transaction associated with the given Control instance.
The inactivity timeout is either started or stopped, according
to action. If InvalidTransactionException is raised by the global tx service
it is passed on to the caller of this method. | [
"Resume",
"the",
"global",
"transaction",
"associated",
"with",
"the",
"given",
"Control",
"instance",
".",
"The",
"inactivity",
"timeout",
"is",
"either",
"started",
"or",
"stopped",
"according",
"to",
"action",
".",
"If",
"InvalidTransactionException",
"is",
"raised",
"by",
"the",
"global",
"tx",
"service",
"it",
"is",
"passed",
"on",
"to",
"the",
"caller",
"of",
"this",
"method",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/TransactionControlImpl.java#L1096-L1138 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/TransactionControlImpl.java | TransactionControlImpl.completeTxTimeout | final public void completeTxTimeout() throws //LIDB1673.2.1.5
CSITransactionRolledbackException //LIDB1673.2.1.5
{ //LIDB1673.2.1.5
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
try
{ //LIDB1673.2.1.5
if (isTraceOn && tc.isEntryEnabled()) { // d173022.3
Tr.entry(tc, "completeTxTimeout");// d171654
}
txService.completeTxTimeout(); //LIDB1673.2.1.5
} //LIDB1673.2.1.5
catch (TransactionRolledbackException e) //LIDB1673.2.1.5
{ //LIDB1673.2.1.5
FFDCFilter.processException(e, CLASS_NAME + ".completeTxTimeout", "1390", this); //LIDB1673.2.1.5
if (isTraceOn && tc.isEntryEnabled()) { // d173022.3
Tr.exit(tc, "completeTxTimeout throwing CSITransactionRolledBackException");// d171654
}
throw new CSITransactionRolledbackException("Transaction rolled back", e); //LIDB1673.2.1.5
}
if (isTraceOn && tc.isEntryEnabled()) { // d173022.3
//LIDB1673.2.1.5
Tr.exit(tc, "completeTxTimeout exit");// d171654 //LIDB2669.2.5
}
} | java | final public void completeTxTimeout() throws //LIDB1673.2.1.5
CSITransactionRolledbackException //LIDB1673.2.1.5
{ //LIDB1673.2.1.5
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
try
{ //LIDB1673.2.1.5
if (isTraceOn && tc.isEntryEnabled()) { // d173022.3
Tr.entry(tc, "completeTxTimeout");// d171654
}
txService.completeTxTimeout(); //LIDB1673.2.1.5
} //LIDB1673.2.1.5
catch (TransactionRolledbackException e) //LIDB1673.2.1.5
{ //LIDB1673.2.1.5
FFDCFilter.processException(e, CLASS_NAME + ".completeTxTimeout", "1390", this); //LIDB1673.2.1.5
if (isTraceOn && tc.isEntryEnabled()) { // d173022.3
Tr.exit(tc, "completeTxTimeout throwing CSITransactionRolledBackException");// d171654
}
throw new CSITransactionRolledbackException("Transaction rolled back", e); //LIDB1673.2.1.5
}
if (isTraceOn && tc.isEntryEnabled()) { // d173022.3
//LIDB1673.2.1.5
Tr.exit(tc, "completeTxTimeout exit");// d171654 //LIDB2669.2.5
}
} | [
"final",
"public",
"void",
"completeTxTimeout",
"(",
")",
"throws",
"//LIDB1673.2.1.5",
"CSITransactionRolledbackException",
"//LIDB1673.2.1.5",
"{",
"//LIDB1673.2.1.5",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"try",
"{",
"//LIDB1673.2.1.5",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"// d173022.3",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"completeTxTimeout\"",
")",
";",
"// d171654",
"}",
"txService",
".",
"completeTxTimeout",
"(",
")",
";",
"//LIDB1673.2.1.5",
"}",
"//LIDB1673.2.1.5",
"catch",
"(",
"TransactionRolledbackException",
"e",
")",
"//LIDB1673.2.1.5",
"{",
"//LIDB1673.2.1.5",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"CLASS_NAME",
"+",
"\".completeTxTimeout\"",
",",
"\"1390\"",
",",
"this",
")",
";",
"//LIDB1673.2.1.5",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"// d173022.3",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"completeTxTimeout throwing CSITransactionRolledBackException\"",
")",
";",
"// d171654",
"}",
"throw",
"new",
"CSITransactionRolledbackException",
"(",
"\"Transaction rolled back\"",
",",
"e",
")",
";",
"//LIDB1673.2.1.5",
"}",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"// d173022.3",
"//LIDB1673.2.1.5",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"completeTxTimeout exit\"",
")",
";",
"// d171654 //LIDB2669.2.5",
"}",
"}"
] | Complete processing of passive transaction timeout.
The timer pops on a timeout thread; the transaction is
rolled back on the application thread when the container
has control. d171654
@exception CSITransactionRolledbackException is thrown in the event of timeout. | [
"Complete",
"processing",
"of",
"passive",
"transaction",
"timeout",
".",
"The",
"timer",
"pops",
"on",
"a",
"timeout",
"thread",
";",
"the",
"transaction",
"is",
"rolled",
"back",
"on",
"the",
"application",
"thread",
"when",
"the",
"container",
"has",
"control",
".",
"d171654"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/TransactionControlImpl.java#L1190-L1214 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/TransactionControlImpl.java | TransactionControlImpl.isBmtActive | public boolean isBmtActive(EJBMethodInfoImpl methodInfo)
{
TranStrategy ts = txStrategies[methodInfo.getTransactionAttribute().getValue()];
return ts.isBmtActive();
} | java | public boolean isBmtActive(EJBMethodInfoImpl methodInfo)
{
TranStrategy ts = txStrategies[methodInfo.getTransactionAttribute().getValue()];
return ts.isBmtActive();
} | [
"public",
"boolean",
"isBmtActive",
"(",
"EJBMethodInfoImpl",
"methodInfo",
")",
"{",
"TranStrategy",
"ts",
"=",
"txStrategies",
"[",
"methodInfo",
".",
"getTransactionAttribute",
"(",
")",
".",
"getValue",
"(",
")",
"]",
";",
"return",
"ts",
".",
"isBmtActive",
"(",
")",
";",
"}"
] | 167937 - added entire method | [
"167937",
"-",
"added",
"entire",
"method"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/csi/TransactionControlImpl.java#L1223-L1227 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/BundleList.java | BundleList.findExtraBundles | public BundleList findExtraBundles(BundleList newBundleList, FeatureManager featureManager) {
List<RuntimeFeatureResource> bundles = new ArrayList<RuntimeFeatureResource>(resources);
bundles.removeAll(newBundleList.resources);
resources.removeAll(bundles);
BundleList result = new BundleList(featureManager);
result.resources.addAll(bundles);
stale.set(true);
return result;
} | java | public BundleList findExtraBundles(BundleList newBundleList, FeatureManager featureManager) {
List<RuntimeFeatureResource> bundles = new ArrayList<RuntimeFeatureResource>(resources);
bundles.removeAll(newBundleList.resources);
resources.removeAll(bundles);
BundleList result = new BundleList(featureManager);
result.resources.addAll(bundles);
stale.set(true);
return result;
} | [
"public",
"BundleList",
"findExtraBundles",
"(",
"BundleList",
"newBundleList",
",",
"FeatureManager",
"featureManager",
")",
"{",
"List",
"<",
"RuntimeFeatureResource",
">",
"bundles",
"=",
"new",
"ArrayList",
"<",
"RuntimeFeatureResource",
">",
"(",
"resources",
")",
";",
"bundles",
".",
"removeAll",
"(",
"newBundleList",
".",
"resources",
")",
";",
"resources",
".",
"removeAll",
"(",
"bundles",
")",
";",
"BundleList",
"result",
"=",
"new",
"BundleList",
"(",
"featureManager",
")",
";",
"result",
".",
"resources",
".",
"addAll",
"(",
"bundles",
")",
";",
"stale",
".",
"set",
"(",
"true",
")",
";",
"return",
"result",
";",
"}"
] | This is like retain all except it returns a list of what was removed.
TODO remove the bundles.
@param newBundleList
@return | [
"This",
"is",
"like",
"retain",
"all",
"except",
"it",
"returns",
"a",
"list",
"of",
"what",
"was",
"removed",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/BundleList.java#L475-L483 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/BundleList.java | BundleList.readWriteTimeAndJavaSpecVersion | @FFDCIgnore(NumberFormatException.class)
private void readWriteTimeAndJavaSpecVersion(WsResource res, String line) {
int timeIndex = line.indexOf('=');
int javaSpecVersionIndex = timeIndex >= 0 ? line.indexOf(';', timeIndex) : -1;
if (timeIndex != -1) {
try {
String sTime = javaSpecVersionIndex > timeIndex ? line.substring(timeIndex + 1, javaSpecVersionIndex) : line.substring(timeIndex + 1);
writeTime = Long.parseLong(sTime);
if (javaSpecVersionIndex != -1) {
javaSpecVersion = Integer.valueOf(line.substring(javaSpecVersionIndex + 1));
}
} catch (NumberFormatException nfe) {
}
}
if (writeTime <= 0) {
writeTime = res.getLastModified();
}
} | java | @FFDCIgnore(NumberFormatException.class)
private void readWriteTimeAndJavaSpecVersion(WsResource res, String line) {
int timeIndex = line.indexOf('=');
int javaSpecVersionIndex = timeIndex >= 0 ? line.indexOf(';', timeIndex) : -1;
if (timeIndex != -1) {
try {
String sTime = javaSpecVersionIndex > timeIndex ? line.substring(timeIndex + 1, javaSpecVersionIndex) : line.substring(timeIndex + 1);
writeTime = Long.parseLong(sTime);
if (javaSpecVersionIndex != -1) {
javaSpecVersion = Integer.valueOf(line.substring(javaSpecVersionIndex + 1));
}
} catch (NumberFormatException nfe) {
}
}
if (writeTime <= 0) {
writeTime = res.getLastModified();
}
} | [
"@",
"FFDCIgnore",
"(",
"NumberFormatException",
".",
"class",
")",
"private",
"void",
"readWriteTimeAndJavaSpecVersion",
"(",
"WsResource",
"res",
",",
"String",
"line",
")",
"{",
"int",
"timeIndex",
"=",
"line",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"int",
"javaSpecVersionIndex",
"=",
"timeIndex",
">=",
"0",
"?",
"line",
".",
"indexOf",
"(",
"'",
"'",
",",
"timeIndex",
")",
":",
"-",
"1",
";",
"if",
"(",
"timeIndex",
"!=",
"-",
"1",
")",
"{",
"try",
"{",
"String",
"sTime",
"=",
"javaSpecVersionIndex",
">",
"timeIndex",
"?",
"line",
".",
"substring",
"(",
"timeIndex",
"+",
"1",
",",
"javaSpecVersionIndex",
")",
":",
"line",
".",
"substring",
"(",
"timeIndex",
"+",
"1",
")",
";",
"writeTime",
"=",
"Long",
".",
"parseLong",
"(",
"sTime",
")",
";",
"if",
"(",
"javaSpecVersionIndex",
"!=",
"-",
"1",
")",
"{",
"javaSpecVersion",
"=",
"Integer",
".",
"valueOf",
"(",
"line",
".",
"substring",
"(",
"javaSpecVersionIndex",
"+",
"1",
")",
")",
";",
"}",
"}",
"catch",
"(",
"NumberFormatException",
"nfe",
")",
"{",
"}",
"}",
"if",
"(",
"writeTime",
"<=",
"0",
")",
"{",
"writeTime",
"=",
"res",
".",
"getLastModified",
"(",
")",
";",
"}",
"}"
] | ignore the NumberFormatException as we deal with it. | [
"ignore",
"the",
"NumberFormatException",
"as",
"we",
"deal",
"with",
"it",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.feature.core/src/com/ibm/ws/kernel/feature/internal/BundleList.java#L514-L532 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/IdToSICoreConnectionTable.java | IdToSICoreConnectionTable.add | public synchronized void add(int id, SICoreConnection connection) {
if (tc.isEntryEnabled())
SibTr.entry(tc, "add", "" + id);
map.put(id, connection);
if (tc.isEntryEnabled())
SibTr.exit(tc, "add");
} | java | public synchronized void add(int id, SICoreConnection connection) {
if (tc.isEntryEnabled())
SibTr.entry(tc, "add", "" + id);
map.put(id, connection);
if (tc.isEntryEnabled())
SibTr.exit(tc, "add");
} | [
"public",
"synchronized",
"void",
"add",
"(",
"int",
"id",
",",
"SICoreConnection",
"connection",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"add\"",
",",
"\"\"",
"+",
"id",
")",
";",
"map",
".",
"put",
"(",
"id",
",",
"connection",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"add\"",
")",
";",
"}"
] | Adds an SICoreConnection into this map with the specified ID.
@param id
@param connection | [
"Adds",
"an",
"SICoreConnection",
"into",
"this",
"map",
"with",
"the",
"specified",
"ID",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/IdToSICoreConnectionTable.java#L40-L46 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/IdToSICoreConnectionTable.java | IdToSICoreConnectionTable.get | public synchronized SICoreConnection get(int id) {
if (tc.isEntryEnabled())
SibTr.entry(tc, "get", "" + id);
SICoreConnection retValue = (SICoreConnection) map.get(id);
if (tc.isEntryEnabled())
SibTr.exit(tc, "get", retValue);
return retValue;
} | java | public synchronized SICoreConnection get(int id) {
if (tc.isEntryEnabled())
SibTr.entry(tc, "get", "" + id);
SICoreConnection retValue = (SICoreConnection) map.get(id);
if (tc.isEntryEnabled())
SibTr.exit(tc, "get", retValue);
return retValue;
} | [
"public",
"synchronized",
"SICoreConnection",
"get",
"(",
"int",
"id",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"get\"",
",",
"\"\"",
"+",
"id",
")",
";",
"SICoreConnection",
"retValue",
"=",
"(",
"SICoreConnection",
")",
"map",
".",
"get",
"(",
"id",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"get\"",
",",
"retValue",
")",
";",
"return",
"retValue",
";",
"}"
] | Returns the SICoreConnection previously stored with the specified ID.
@param id
@return SICoreConnection | [
"Returns",
"the",
"SICoreConnection",
"previously",
"stored",
"with",
"the",
"specified",
"ID",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/IdToSICoreConnectionTable.java#L54-L61 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/IdToSICoreConnectionTable.java | IdToSICoreConnectionTable.remove | public synchronized void remove(int id) {
if (tc.isEntryEnabled())
SibTr.entry(tc, "remove", "" + id);
if (tc.isEntryEnabled())
SibTr.exit(tc, "remove", "" + id);
map.remove(id);
} | java | public synchronized void remove(int id) {
if (tc.isEntryEnabled())
SibTr.entry(tc, "remove", "" + id);
if (tc.isEntryEnabled())
SibTr.exit(tc, "remove", "" + id);
map.remove(id);
} | [
"public",
"synchronized",
"void",
"remove",
"(",
"int",
"id",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"remove\"",
",",
"\"\"",
"+",
"id",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"remove\"",
",",
"\"\"",
"+",
"id",
")",
";",
"map",
".",
"remove",
"(",
"id",
")",
";",
"}"
] | Removes an SICoreConnection from the map.
@param id | [
"Removes",
"an",
"SICoreConnection",
"from",
"the",
"map",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/IdToSICoreConnectionTable.java#L68-L74 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TransformerImpl.java | TransformerImpl.resolve | public Selector resolve(Selector tree, Resolver resolver, PositionAssigner positionAssigner) {
if (tree instanceof Identifier) {
Identifier id = (Identifier) tree;
// The subtree to resolve is an Identifier. Resolve the Identifier.
return resolver.resolve(id, positionAssigner);
}
else if (tree.getNumIds() > 0) {
Operator oper = (Operator) tree;
// The subtree to resolve is an Operator, under which there are some Identifiers.
for (int i = 0; i < oper.getOperands().length; i++)
oper.setOperand(i,resolve(oper.getOperands()[i], resolver, positionAssigner));
oper.assignType();
} // else tree is a literal and not modified
return tree;
} | java | public Selector resolve(Selector tree, Resolver resolver, PositionAssigner positionAssigner) {
if (tree instanceof Identifier) {
Identifier id = (Identifier) tree;
// The subtree to resolve is an Identifier. Resolve the Identifier.
return resolver.resolve(id, positionAssigner);
}
else if (tree.getNumIds() > 0) {
Operator oper = (Operator) tree;
// The subtree to resolve is an Operator, under which there are some Identifiers.
for (int i = 0; i < oper.getOperands().length; i++)
oper.setOperand(i,resolve(oper.getOperands()[i], resolver, positionAssigner));
oper.assignType();
} // else tree is a literal and not modified
return tree;
} | [
"public",
"Selector",
"resolve",
"(",
"Selector",
"tree",
",",
"Resolver",
"resolver",
",",
"PositionAssigner",
"positionAssigner",
")",
"{",
"if",
"(",
"tree",
"instanceof",
"Identifier",
")",
"{",
"Identifier",
"id",
"=",
"(",
"Identifier",
")",
"tree",
";",
"// The subtree to resolve is an Identifier. Resolve the Identifier.",
"return",
"resolver",
".",
"resolve",
"(",
"id",
",",
"positionAssigner",
")",
";",
"}",
"else",
"if",
"(",
"tree",
".",
"getNumIds",
"(",
")",
">",
"0",
")",
"{",
"Operator",
"oper",
"=",
"(",
"Operator",
")",
"tree",
";",
"// The subtree to resolve is an Operator, under which there are some Identifiers.",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"oper",
".",
"getOperands",
"(",
")",
".",
"length",
";",
"i",
"++",
")",
"oper",
".",
"setOperand",
"(",
"i",
",",
"resolve",
"(",
"oper",
".",
"getOperands",
"(",
")",
"[",
"i",
"]",
",",
"resolver",
",",
"positionAssigner",
")",
")",
";",
"oper",
".",
"assignType",
"(",
")",
";",
"}",
"// else tree is a literal and not modified",
"return",
"tree",
";",
"}"
] | Walks a Selector tree and resolves all the Identifiers
@param tree the Selector tree to walk. The tree may be modified in place by this
method. Strictly speaking, only Identifier nodes can ever be replaced, but, since
the tree can consist of only an Identifier, this may result in the tree being
replaced rather than modified.
@param resolver an implementation of the Resolver interface which will be called with
every identifier encountered and also to push and pop Identifier resolution contexts.
@return a replacement Selector tree. This will be the old tree modified in place
except for the special case where the top level node was an Identifier and it was
replaced by the resolver. | [
"Walks",
"a",
"Selector",
"tree",
"and",
"resolves",
"all",
"the",
"Identifiers"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TransformerImpl.java#L45-L59 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TransformerImpl.java | TransformerImpl.DNF0 | private static Selector DNF0(Selector tree) {
if (!(tree instanceof Operator))
return tree;
Operator oper = (Operator) tree;
switch(oper.getOp()) {
case Selector.AND:
return processAND(oper.getOperands()[0], oper.getOperands()[1]);
case Selector.OR:
return makeOR(DNF0(oper.getOperands()[0]), DNF0(oper.getOperands()[1]));
default:
return tree;
}
} | java | private static Selector DNF0(Selector tree) {
if (!(tree instanceof Operator))
return tree;
Operator oper = (Operator) tree;
switch(oper.getOp()) {
case Selector.AND:
return processAND(oper.getOperands()[0], oper.getOperands()[1]);
case Selector.OR:
return makeOR(DNF0(oper.getOperands()[0]), DNF0(oper.getOperands()[1]));
default:
return tree;
}
} | [
"private",
"static",
"Selector",
"DNF0",
"(",
"Selector",
"tree",
")",
"{",
"if",
"(",
"!",
"(",
"tree",
"instanceof",
"Operator",
")",
")",
"return",
"tree",
";",
"Operator",
"oper",
"=",
"(",
"Operator",
")",
"tree",
";",
"switch",
"(",
"oper",
".",
"getOp",
"(",
")",
")",
"{",
"case",
"Selector",
".",
"AND",
":",
"return",
"processAND",
"(",
"oper",
".",
"getOperands",
"(",
")",
"[",
"0",
"]",
",",
"oper",
".",
"getOperands",
"(",
")",
"[",
"1",
"]",
")",
";",
"case",
"Selector",
".",
"OR",
":",
"return",
"makeOR",
"(",
"DNF0",
"(",
"oper",
".",
"getOperands",
"(",
")",
"[",
"0",
"]",
")",
",",
"DNF0",
"(",
"oper",
".",
"getOperands",
"(",
")",
"[",
"1",
"]",
")",
")",
";",
"default",
":",
"return",
"tree",
";",
"}",
"}"
] | Working recursive subroutine of DNF | [
"Working",
"recursive",
"subroutine",
"of",
"DNF"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TransformerImpl.java#L86-L98 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TransformerImpl.java | TransformerImpl.processAND | private static Selector processAND(Selector sel0, Selector sel1) {
sel0 = DNF0(sel0);
sel1 = DNF0(sel1);
if (sel0 instanceof Operator) {
Operator oper = (Operator) sel0;
if (oper.getOp() == Selector.OR)
return makeOR(processAND(oper.getOperands()[0], sel1),
processAND(oper.getOperands()[1], sel1));
}
// Left operand is not OR, so treat it as an atom while exploring the right operand
return processANDRight(sel0, sel1);
} | java | private static Selector processAND(Selector sel0, Selector sel1) {
sel0 = DNF0(sel0);
sel1 = DNF0(sel1);
if (sel0 instanceof Operator) {
Operator oper = (Operator) sel0;
if (oper.getOp() == Selector.OR)
return makeOR(processAND(oper.getOperands()[0], sel1),
processAND(oper.getOperands()[1], sel1));
}
// Left operand is not OR, so treat it as an atom while exploring the right operand
return processANDRight(sel0, sel1);
} | [
"private",
"static",
"Selector",
"processAND",
"(",
"Selector",
"sel0",
",",
"Selector",
"sel1",
")",
"{",
"sel0",
"=",
"DNF0",
"(",
"sel0",
")",
";",
"sel1",
"=",
"DNF0",
"(",
"sel1",
")",
";",
"if",
"(",
"sel0",
"instanceof",
"Operator",
")",
"{",
"Operator",
"oper",
"=",
"(",
"Operator",
")",
"sel0",
";",
"if",
"(",
"oper",
".",
"getOp",
"(",
")",
"==",
"Selector",
".",
"OR",
")",
"return",
"makeOR",
"(",
"processAND",
"(",
"oper",
".",
"getOperands",
"(",
")",
"[",
"0",
"]",
",",
"sel1",
")",
",",
"processAND",
"(",
"oper",
".",
"getOperands",
"(",
")",
"[",
"1",
"]",
",",
"sel1",
")",
")",
";",
"}",
"// Left operand is not OR, so treat it as an atom while exploring the right operand",
"return",
"processANDRight",
"(",
"sel0",
",",
"sel1",
")",
";",
"}"
] | Subroutine of DNF0 to process AND nodes | [
"Subroutine",
"of",
"DNF0",
"to",
"process",
"AND",
"nodes"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TransformerImpl.java#L103-L114 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TransformerImpl.java | TransformerImpl.processANDRight | private static Selector processANDRight(Selector sel0, Selector sel1) {
if (sel1 instanceof Operator) {
Operator oper = (Operator) sel1;
if (oper.getOp() == Selector.OR)
return makeOR(processANDRight(sel0, oper.getOperands()[0]),
processANDRight(sel0, oper.getOperands()[1]));
}
// Right operand is not OR (neither is left) so treat both as atoms
return makeAND(sel0, sel1);
} | java | private static Selector processANDRight(Selector sel0, Selector sel1) {
if (sel1 instanceof Operator) {
Operator oper = (Operator) sel1;
if (oper.getOp() == Selector.OR)
return makeOR(processANDRight(sel0, oper.getOperands()[0]),
processANDRight(sel0, oper.getOperands()[1]));
}
// Right operand is not OR (neither is left) so treat both as atoms
return makeAND(sel0, sel1);
} | [
"private",
"static",
"Selector",
"processANDRight",
"(",
"Selector",
"sel0",
",",
"Selector",
"sel1",
")",
"{",
"if",
"(",
"sel1",
"instanceof",
"Operator",
")",
"{",
"Operator",
"oper",
"=",
"(",
"Operator",
")",
"sel1",
";",
"if",
"(",
"oper",
".",
"getOp",
"(",
")",
"==",
"Selector",
".",
"OR",
")",
"return",
"makeOR",
"(",
"processANDRight",
"(",
"sel0",
",",
"oper",
".",
"getOperands",
"(",
")",
"[",
"0",
"]",
")",
",",
"processANDRight",
"(",
"sel0",
",",
"oper",
".",
"getOperands",
"(",
")",
"[",
"1",
"]",
")",
")",
";",
"}",
"// Right operand is not OR (neither is left) so treat both as atoms",
"return",
"makeAND",
"(",
"sel0",
",",
"sel1",
")",
";",
"}"
] | Subroutine of DNF0 to process AND nodes whose left child is an atom | [
"Subroutine",
"of",
"DNF0",
"to",
"process",
"AND",
"nodes",
"whose",
"left",
"child",
"is",
"an",
"atom"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TransformerImpl.java#L119-L128 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TransformerImpl.java | TransformerImpl.makeOR | private static Selector makeOR(Selector sel0, Selector sel1) {
if (sel0.getNumIds() == 0) {
Boolean staticResult = (Boolean) // was BooleanValue
Matching.getEvaluator().eval(sel0);
if (staticResult != null && staticResult.booleanValue())
return new LiteralImpl(Boolean.TRUE); // was BooleanValue
else
return evalOf(sel1);
}
if (sel1.getNumIds() == 0) {
Boolean staticResult = (Boolean) // was BooleanValue
Matching.getEvaluator().eval(sel1);
if (staticResult != null && staticResult.booleanValue())
return new LiteralImpl(Boolean.TRUE); // was BooleanValue
else
return evalOf(sel0);
}
return new OperatorImpl(Operator.OR, sel0, sel1);
} | java | private static Selector makeOR(Selector sel0, Selector sel1) {
if (sel0.getNumIds() == 0) {
Boolean staticResult = (Boolean) // was BooleanValue
Matching.getEvaluator().eval(sel0);
if (staticResult != null && staticResult.booleanValue())
return new LiteralImpl(Boolean.TRUE); // was BooleanValue
else
return evalOf(sel1);
}
if (sel1.getNumIds() == 0) {
Boolean staticResult = (Boolean) // was BooleanValue
Matching.getEvaluator().eval(sel1);
if (staticResult != null && staticResult.booleanValue())
return new LiteralImpl(Boolean.TRUE); // was BooleanValue
else
return evalOf(sel0);
}
return new OperatorImpl(Operator.OR, sel0, sel1);
} | [
"private",
"static",
"Selector",
"makeOR",
"(",
"Selector",
"sel0",
",",
"Selector",
"sel1",
")",
"{",
"if",
"(",
"sel0",
".",
"getNumIds",
"(",
")",
"==",
"0",
")",
"{",
"Boolean",
"staticResult",
"=",
"(",
"Boolean",
")",
"// was BooleanValue",
"Matching",
".",
"getEvaluator",
"(",
")",
".",
"eval",
"(",
"sel0",
")",
";",
"if",
"(",
"staticResult",
"!=",
"null",
"&&",
"staticResult",
".",
"booleanValue",
"(",
")",
")",
"return",
"new",
"LiteralImpl",
"(",
"Boolean",
".",
"TRUE",
")",
";",
"// was BooleanValue",
"else",
"return",
"evalOf",
"(",
"sel1",
")",
";",
"}",
"if",
"(",
"sel1",
".",
"getNumIds",
"(",
")",
"==",
"0",
")",
"{",
"Boolean",
"staticResult",
"=",
"(",
"Boolean",
")",
"// was BooleanValue",
"Matching",
".",
"getEvaluator",
"(",
")",
".",
"eval",
"(",
"sel1",
")",
";",
"if",
"(",
"staticResult",
"!=",
"null",
"&&",
"staticResult",
".",
"booleanValue",
"(",
")",
")",
"return",
"new",
"LiteralImpl",
"(",
"Boolean",
".",
"TRUE",
")",
";",
"// was BooleanValue",
"else",
"return",
"evalOf",
"(",
"sel0",
")",
";",
"}",
"return",
"new",
"OperatorImpl",
"(",
"Operator",
".",
"OR",
",",
"sel0",
",",
"sel1",
")",
";",
"}"
] | must be true. | [
"must",
"be",
"true",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TransformerImpl.java#L135-L153 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TransformerImpl.java | TransformerImpl.makeAND | private static Selector makeAND(Selector sel0, Selector sel1) {
if (sel0.getNumIds() == 0) {
Boolean staticResult = (Boolean) // was BooleanValue
Matching.getEvaluator().eval(sel0);
if (staticResult == null || !staticResult.booleanValue())
return new LiteralImpl(Boolean.FALSE); // was BooleanValue
else
return evalOf(sel1);
}
if (sel1.getNumIds() == 0) {
Boolean staticResult = (Boolean) // was BooleanValue
Matching.getEvaluator().eval(sel1);
if (staticResult == null || !staticResult.booleanValue())
return new LiteralImpl(Boolean.FALSE); // was BooleanValue
else
return evalOf(sel0);
}
return new OperatorImpl(Operator.AND, sel0, sel1);
} | java | private static Selector makeAND(Selector sel0, Selector sel1) {
if (sel0.getNumIds() == 0) {
Boolean staticResult = (Boolean) // was BooleanValue
Matching.getEvaluator().eval(sel0);
if (staticResult == null || !staticResult.booleanValue())
return new LiteralImpl(Boolean.FALSE); // was BooleanValue
else
return evalOf(sel1);
}
if (sel1.getNumIds() == 0) {
Boolean staticResult = (Boolean) // was BooleanValue
Matching.getEvaluator().eval(sel1);
if (staticResult == null || !staticResult.booleanValue())
return new LiteralImpl(Boolean.FALSE); // was BooleanValue
else
return evalOf(sel0);
}
return new OperatorImpl(Operator.AND, sel0, sel1);
} | [
"private",
"static",
"Selector",
"makeAND",
"(",
"Selector",
"sel0",
",",
"Selector",
"sel1",
")",
"{",
"if",
"(",
"sel0",
".",
"getNumIds",
"(",
")",
"==",
"0",
")",
"{",
"Boolean",
"staticResult",
"=",
"(",
"Boolean",
")",
"// was BooleanValue",
"Matching",
".",
"getEvaluator",
"(",
")",
".",
"eval",
"(",
"sel0",
")",
";",
"if",
"(",
"staticResult",
"==",
"null",
"||",
"!",
"staticResult",
".",
"booleanValue",
"(",
")",
")",
"return",
"new",
"LiteralImpl",
"(",
"Boolean",
".",
"FALSE",
")",
";",
"// was BooleanValue",
"else",
"return",
"evalOf",
"(",
"sel1",
")",
";",
"}",
"if",
"(",
"sel1",
".",
"getNumIds",
"(",
")",
"==",
"0",
")",
"{",
"Boolean",
"staticResult",
"=",
"(",
"Boolean",
")",
"// was BooleanValue",
"Matching",
".",
"getEvaluator",
"(",
")",
".",
"eval",
"(",
"sel1",
")",
";",
"if",
"(",
"staticResult",
"==",
"null",
"||",
"!",
"staticResult",
".",
"booleanValue",
"(",
")",
")",
"return",
"new",
"LiteralImpl",
"(",
"Boolean",
".",
"FALSE",
")",
";",
"// was BooleanValue",
"else",
"return",
"evalOf",
"(",
"sel0",
")",
";",
"}",
"return",
"new",
"OperatorImpl",
"(",
"Operator",
".",
"AND",
",",
"sel0",
",",
"sel1",
")",
";",
"}"
] | must be false. | [
"must",
"be",
"false",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TransformerImpl.java#L160-L178 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TransformerImpl.java | TransformerImpl.evalOf | private static Selector evalOf(Selector arg) {
if (arg.getNumIds() > 0)
return arg;
return new LiteralImpl(Matching.getEvaluator().eval(arg));
} | java | private static Selector evalOf(Selector arg) {
if (arg.getNumIds() > 0)
return arg;
return new LiteralImpl(Matching.getEvaluator().eval(arg));
} | [
"private",
"static",
"Selector",
"evalOf",
"(",
"Selector",
"arg",
")",
"{",
"if",
"(",
"arg",
".",
"getNumIds",
"(",
")",
">",
"0",
")",
"return",
"arg",
";",
"return",
"new",
"LiteralImpl",
"(",
"Matching",
".",
"getEvaluator",
"(",
")",
".",
"eval",
"(",
"arg",
")",
")",
";",
"}"
] | if the argument has no identifiers | [
"if",
"the",
"argument",
"has",
"no",
"identifiers"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TransformerImpl.java#L184-L188 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TransformerImpl.java | TransformerImpl.simplifyTree | private static Selector simplifyTree(Selector tree) {
if (!(tree instanceof Operator) || tree instanceof ExtensionOperatorImpl)
return tree;
Operator oper = (Operator) tree;
switch (oper.getOp()) {
case Selector.NOT:
return simplifyNOT(oper.getOperands()[0]);
case Selector.EQ:
return simplifyEQ(oper.getOperands()[0], oper.getOperands()[1]);
case Selector.NE:
return simplifyNE(oper.getOperands()[0], oper.getOperands()[1]);
case Selector.NEG:
case Selector.ISNULL:
return new OperatorImpl(oper.getOp(), simplifyTree(oper.getOperands()[0]));
case Selector.LIKE:
case Selector.TOPIC_LIKE:
LikeOperatorImpl loper = (LikeOperatorImpl) oper;
return new LikeOperatorImpl(loper.getOp(), simplifyTree(loper.getOperands()[0]),
loper.getInternalPattern(), loper.getPattern(), loper.isEscaped(),
loper.getEscape());
default:
return new OperatorImpl(oper.getOp(), simplifyTree(oper.getOperands()[0]),
simplifyTree(oper.getOperands()[1]));
}
} | java | private static Selector simplifyTree(Selector tree) {
if (!(tree instanceof Operator) || tree instanceof ExtensionOperatorImpl)
return tree;
Operator oper = (Operator) tree;
switch (oper.getOp()) {
case Selector.NOT:
return simplifyNOT(oper.getOperands()[0]);
case Selector.EQ:
return simplifyEQ(oper.getOperands()[0], oper.getOperands()[1]);
case Selector.NE:
return simplifyNE(oper.getOperands()[0], oper.getOperands()[1]);
case Selector.NEG:
case Selector.ISNULL:
return new OperatorImpl(oper.getOp(), simplifyTree(oper.getOperands()[0]));
case Selector.LIKE:
case Selector.TOPIC_LIKE:
LikeOperatorImpl loper = (LikeOperatorImpl) oper;
return new LikeOperatorImpl(loper.getOp(), simplifyTree(loper.getOperands()[0]),
loper.getInternalPattern(), loper.getPattern(), loper.isEscaped(),
loper.getEscape());
default:
return new OperatorImpl(oper.getOp(), simplifyTree(oper.getOperands()[0]),
simplifyTree(oper.getOperands()[1]));
}
} | [
"private",
"static",
"Selector",
"simplifyTree",
"(",
"Selector",
"tree",
")",
"{",
"if",
"(",
"!",
"(",
"tree",
"instanceof",
"Operator",
")",
"||",
"tree",
"instanceof",
"ExtensionOperatorImpl",
")",
"return",
"tree",
";",
"Operator",
"oper",
"=",
"(",
"Operator",
")",
"tree",
";",
"switch",
"(",
"oper",
".",
"getOp",
"(",
")",
")",
"{",
"case",
"Selector",
".",
"NOT",
":",
"return",
"simplifyNOT",
"(",
"oper",
".",
"getOperands",
"(",
")",
"[",
"0",
"]",
")",
";",
"case",
"Selector",
".",
"EQ",
":",
"return",
"simplifyEQ",
"(",
"oper",
".",
"getOperands",
"(",
")",
"[",
"0",
"]",
",",
"oper",
".",
"getOperands",
"(",
")",
"[",
"1",
"]",
")",
";",
"case",
"Selector",
".",
"NE",
":",
"return",
"simplifyNE",
"(",
"oper",
".",
"getOperands",
"(",
")",
"[",
"0",
"]",
",",
"oper",
".",
"getOperands",
"(",
")",
"[",
"1",
"]",
")",
";",
"case",
"Selector",
".",
"NEG",
":",
"case",
"Selector",
".",
"ISNULL",
":",
"return",
"new",
"OperatorImpl",
"(",
"oper",
".",
"getOp",
"(",
")",
",",
"simplifyTree",
"(",
"oper",
".",
"getOperands",
"(",
")",
"[",
"0",
"]",
")",
")",
";",
"case",
"Selector",
".",
"LIKE",
":",
"case",
"Selector",
".",
"TOPIC_LIKE",
":",
"LikeOperatorImpl",
"loper",
"=",
"(",
"LikeOperatorImpl",
")",
"oper",
";",
"return",
"new",
"LikeOperatorImpl",
"(",
"loper",
".",
"getOp",
"(",
")",
",",
"simplifyTree",
"(",
"loper",
".",
"getOperands",
"(",
")",
"[",
"0",
"]",
")",
",",
"loper",
".",
"getInternalPattern",
"(",
")",
",",
"loper",
".",
"getPattern",
"(",
")",
",",
"loper",
".",
"isEscaped",
"(",
")",
",",
"loper",
".",
"getEscape",
"(",
")",
")",
";",
"default",
":",
"return",
"new",
"OperatorImpl",
"(",
"oper",
".",
"getOp",
"(",
")",
",",
"simplifyTree",
"(",
"oper",
".",
"getOperands",
"(",
")",
"[",
"0",
"]",
")",
",",
"simplifyTree",
"(",
"oper",
".",
"getOperands",
"(",
")",
"[",
"1",
"]",
")",
")",
";",
"}",
"}"
] | and OR nodes | [
"and",
"OR",
"nodes"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TransformerImpl.java#L202-L226 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TransformerImpl.java | TransformerImpl.simplifyNOT | private static Selector simplifyNOT(Selector tree) {
if (tree instanceof Literal)
return new LiteralImpl( EvaluatorImpl.not((Boolean) ((Literal) tree).getValue())); // was BooleanValue
if (!(tree instanceof Operator))
return new OperatorImpl(Selector.NOT, tree);
Operator oper = (Operator) tree;
switch(oper.getOp()) {
case Selector.NOT:
return simplifyTree(oper.getOperands()[0]);
case Selector.AND:
return makeOR(simplifyNOT(oper.getOperands()[0]),
simplifyNOT(oper.getOperands()[1]));
case Selector.OR:
return makeAND(simplifyNOT(oper.getOperands()[0]),
simplifyNOT(oper.getOperands()[1]));
case Selector.EQ:
return simplifyNE(oper.getOperands()[0], oper.getOperands()[1]);
case Selector.NE:
return simplifyEQ(oper.getOperands()[0], oper.getOperands()[1]);
case Selector.GT:
return new OperatorImpl(Selector.LE, oper.getOperands()[0], oper.getOperands()[1]);
case Selector.LT:
return new OperatorImpl(Selector.GE, oper.getOperands()[0], oper.getOperands()[1]);
case Selector.GE:
return new OperatorImpl(Selector.LT, oper.getOperands()[0], oper.getOperands()[1]);
case Selector.LE:
return new OperatorImpl(Selector.GT, oper.getOperands()[0], oper.getOperands()[1]);
default:
return new OperatorImpl(Selector.NOT, tree);
}
} | java | private static Selector simplifyNOT(Selector tree) {
if (tree instanceof Literal)
return new LiteralImpl( EvaluatorImpl.not((Boolean) ((Literal) tree).getValue())); // was BooleanValue
if (!(tree instanceof Operator))
return new OperatorImpl(Selector.NOT, tree);
Operator oper = (Operator) tree;
switch(oper.getOp()) {
case Selector.NOT:
return simplifyTree(oper.getOperands()[0]);
case Selector.AND:
return makeOR(simplifyNOT(oper.getOperands()[0]),
simplifyNOT(oper.getOperands()[1]));
case Selector.OR:
return makeAND(simplifyNOT(oper.getOperands()[0]),
simplifyNOT(oper.getOperands()[1]));
case Selector.EQ:
return simplifyNE(oper.getOperands()[0], oper.getOperands()[1]);
case Selector.NE:
return simplifyEQ(oper.getOperands()[0], oper.getOperands()[1]);
case Selector.GT:
return new OperatorImpl(Selector.LE, oper.getOperands()[0], oper.getOperands()[1]);
case Selector.LT:
return new OperatorImpl(Selector.GE, oper.getOperands()[0], oper.getOperands()[1]);
case Selector.GE:
return new OperatorImpl(Selector.LT, oper.getOperands()[0], oper.getOperands()[1]);
case Selector.LE:
return new OperatorImpl(Selector.GT, oper.getOperands()[0], oper.getOperands()[1]);
default:
return new OperatorImpl(Selector.NOT, tree);
}
} | [
"private",
"static",
"Selector",
"simplifyNOT",
"(",
"Selector",
"tree",
")",
"{",
"if",
"(",
"tree",
"instanceof",
"Literal",
")",
"return",
"new",
"LiteralImpl",
"(",
"EvaluatorImpl",
".",
"not",
"(",
"(",
"Boolean",
")",
"(",
"(",
"Literal",
")",
"tree",
")",
".",
"getValue",
"(",
")",
")",
")",
";",
"// was BooleanValue",
"if",
"(",
"!",
"(",
"tree",
"instanceof",
"Operator",
")",
")",
"return",
"new",
"OperatorImpl",
"(",
"Selector",
".",
"NOT",
",",
"tree",
")",
";",
"Operator",
"oper",
"=",
"(",
"Operator",
")",
"tree",
";",
"switch",
"(",
"oper",
".",
"getOp",
"(",
")",
")",
"{",
"case",
"Selector",
".",
"NOT",
":",
"return",
"simplifyTree",
"(",
"oper",
".",
"getOperands",
"(",
")",
"[",
"0",
"]",
")",
";",
"case",
"Selector",
".",
"AND",
":",
"return",
"makeOR",
"(",
"simplifyNOT",
"(",
"oper",
".",
"getOperands",
"(",
")",
"[",
"0",
"]",
")",
",",
"simplifyNOT",
"(",
"oper",
".",
"getOperands",
"(",
")",
"[",
"1",
"]",
")",
")",
";",
"case",
"Selector",
".",
"OR",
":",
"return",
"makeAND",
"(",
"simplifyNOT",
"(",
"oper",
".",
"getOperands",
"(",
")",
"[",
"0",
"]",
")",
",",
"simplifyNOT",
"(",
"oper",
".",
"getOperands",
"(",
")",
"[",
"1",
"]",
")",
")",
";",
"case",
"Selector",
".",
"EQ",
":",
"return",
"simplifyNE",
"(",
"oper",
".",
"getOperands",
"(",
")",
"[",
"0",
"]",
",",
"oper",
".",
"getOperands",
"(",
")",
"[",
"1",
"]",
")",
";",
"case",
"Selector",
".",
"NE",
":",
"return",
"simplifyEQ",
"(",
"oper",
".",
"getOperands",
"(",
")",
"[",
"0",
"]",
",",
"oper",
".",
"getOperands",
"(",
")",
"[",
"1",
"]",
")",
";",
"case",
"Selector",
".",
"GT",
":",
"return",
"new",
"OperatorImpl",
"(",
"Selector",
".",
"LE",
",",
"oper",
".",
"getOperands",
"(",
")",
"[",
"0",
"]",
",",
"oper",
".",
"getOperands",
"(",
")",
"[",
"1",
"]",
")",
";",
"case",
"Selector",
".",
"LT",
":",
"return",
"new",
"OperatorImpl",
"(",
"Selector",
".",
"GE",
",",
"oper",
".",
"getOperands",
"(",
")",
"[",
"0",
"]",
",",
"oper",
".",
"getOperands",
"(",
")",
"[",
"1",
"]",
")",
";",
"case",
"Selector",
".",
"GE",
":",
"return",
"new",
"OperatorImpl",
"(",
"Selector",
".",
"LT",
",",
"oper",
".",
"getOperands",
"(",
")",
"[",
"0",
"]",
",",
"oper",
".",
"getOperands",
"(",
")",
"[",
"1",
"]",
")",
";",
"case",
"Selector",
".",
"LE",
":",
"return",
"new",
"OperatorImpl",
"(",
"Selector",
".",
"GT",
",",
"oper",
".",
"getOperands",
"(",
")",
"[",
"0",
"]",
",",
"oper",
".",
"getOperands",
"(",
")",
"[",
"1",
"]",
")",
";",
"default",
":",
"return",
"new",
"OperatorImpl",
"(",
"Selector",
".",
"NOT",
",",
"tree",
")",
";",
"}",
"}"
] | Subroutine of simplifyTree to handle NOT nodes | [
"Subroutine",
"of",
"simplifyTree",
"to",
"handle",
"NOT",
"nodes"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TransformerImpl.java#L231-L261 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TransformerImpl.java | TransformerImpl.simplifyEQ | private static Selector simplifyEQ(Selector sel0, Selector sel1) {
if (sel0.getType() != Selector.BOOLEAN)
return new OperatorImpl(Selector.EQ, sel0, sel1);
else
return makeOR(makeAND(simplifyTree(sel0), simplifyTree(sel1)),
makeAND(simplifyNOT(sel0), simplifyNOT(sel1)));
} | java | private static Selector simplifyEQ(Selector sel0, Selector sel1) {
if (sel0.getType() != Selector.BOOLEAN)
return new OperatorImpl(Selector.EQ, sel0, sel1);
else
return makeOR(makeAND(simplifyTree(sel0), simplifyTree(sel1)),
makeAND(simplifyNOT(sel0), simplifyNOT(sel1)));
} | [
"private",
"static",
"Selector",
"simplifyEQ",
"(",
"Selector",
"sel0",
",",
"Selector",
"sel1",
")",
"{",
"if",
"(",
"sel0",
".",
"getType",
"(",
")",
"!=",
"Selector",
".",
"BOOLEAN",
")",
"return",
"new",
"OperatorImpl",
"(",
"Selector",
".",
"EQ",
",",
"sel0",
",",
"sel1",
")",
";",
"else",
"return",
"makeOR",
"(",
"makeAND",
"(",
"simplifyTree",
"(",
"sel0",
")",
",",
"simplifyTree",
"(",
"sel1",
")",
")",
",",
"makeAND",
"(",
"simplifyNOT",
"(",
"sel0",
")",
",",
"simplifyNOT",
"(",
"sel1",
")",
")",
")",
";",
"}"
] | Subroutine of simplifyTree to handle EQ nodes | [
"Subroutine",
"of",
"simplifyTree",
"to",
"handle",
"EQ",
"nodes"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TransformerImpl.java#L265-L271 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TransformerImpl.java | TransformerImpl.simplifyNE | private static Selector simplifyNE(Selector sel0, Selector sel1) {
if (sel0.getType() == Selector.BOOLEAN)
return makeOR(makeAND(simplifyTree(sel0), simplifyNOT(sel1)),
makeAND(simplifyNOT(sel0), simplifyTree(sel1)));
else if (sel0.getType() == Selector.STRING || sel0.getType() == Selector.UNKNOWN)
return new OperatorImpl(Selector.NE, sel0, sel1);
else
// Numeric: transform into a pair of inequalities
return makeOR(new OperatorImpl(Selector.LT, sel0, sel1),
new OperatorImpl(Selector.GT, sel0, sel1));
} | java | private static Selector simplifyNE(Selector sel0, Selector sel1) {
if (sel0.getType() == Selector.BOOLEAN)
return makeOR(makeAND(simplifyTree(sel0), simplifyNOT(sel1)),
makeAND(simplifyNOT(sel0), simplifyTree(sel1)));
else if (sel0.getType() == Selector.STRING || sel0.getType() == Selector.UNKNOWN)
return new OperatorImpl(Selector.NE, sel0, sel1);
else
// Numeric: transform into a pair of inequalities
return makeOR(new OperatorImpl(Selector.LT, sel0, sel1),
new OperatorImpl(Selector.GT, sel0, sel1));
} | [
"private",
"static",
"Selector",
"simplifyNE",
"(",
"Selector",
"sel0",
",",
"Selector",
"sel1",
")",
"{",
"if",
"(",
"sel0",
".",
"getType",
"(",
")",
"==",
"Selector",
".",
"BOOLEAN",
")",
"return",
"makeOR",
"(",
"makeAND",
"(",
"simplifyTree",
"(",
"sel0",
")",
",",
"simplifyNOT",
"(",
"sel1",
")",
")",
",",
"makeAND",
"(",
"simplifyNOT",
"(",
"sel0",
")",
",",
"simplifyTree",
"(",
"sel1",
")",
")",
")",
";",
"else",
"if",
"(",
"sel0",
".",
"getType",
"(",
")",
"==",
"Selector",
".",
"STRING",
"||",
"sel0",
".",
"getType",
"(",
")",
"==",
"Selector",
".",
"UNKNOWN",
")",
"return",
"new",
"OperatorImpl",
"(",
"Selector",
".",
"NE",
",",
"sel0",
",",
"sel1",
")",
";",
"else",
"// Numeric: transform into a pair of inequalities",
"return",
"makeOR",
"(",
"new",
"OperatorImpl",
"(",
"Selector",
".",
"LT",
",",
"sel0",
",",
"sel1",
")",
",",
"new",
"OperatorImpl",
"(",
"Selector",
".",
"GT",
",",
"sel0",
",",
"sel1",
")",
")",
";",
"}"
] | Subroutine of simplifyTree to handle NE nodes | [
"Subroutine",
"of",
"simplifyTree",
"to",
"handle",
"NE",
"nodes"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TransformerImpl.java#L276-L286 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TransformerImpl.java | TransformerImpl.augmentConjunction | private static boolean augmentConjunction(ConjunctionImpl target, Selector toAdd) {
if (toAdd instanceof Operator) {
Operator oper = (Operator) toAdd;
if (oper.getOp() == Selector.AND)
return augmentConjunction(target, oper.getOperands()[0]) &&
augmentConjunction(target, oper.getOperands()[1]);
}
// toAdd is not an AND node, so we process and combine it in the appropriate way
if (toAdd.getNumIds() == 0)
{
// Should not be added to Conjunction, but it could render the Conjuction false if
// it is false
Boolean theEval = (Boolean) Matching.getEvaluator().eval(toAdd);
if (theEval == null)
return false;
else
return theEval.booleanValue(); // was ((BooleanValue) Matching.getEvaluator().eval(toAdd)).booleanValue()
}
else if (Matching.isSimple(toAdd))
{
if(toAdd.isExtended())
return target.and(new ExtendedSimpleTestImpl(toAdd));
else
return target.and(new SimpleTestImpl(toAdd));
}
else
{
target.and(toAdd);
return true;
}
} | java | private static boolean augmentConjunction(ConjunctionImpl target, Selector toAdd) {
if (toAdd instanceof Operator) {
Operator oper = (Operator) toAdd;
if (oper.getOp() == Selector.AND)
return augmentConjunction(target, oper.getOperands()[0]) &&
augmentConjunction(target, oper.getOperands()[1]);
}
// toAdd is not an AND node, so we process and combine it in the appropriate way
if (toAdd.getNumIds() == 0)
{
// Should not be added to Conjunction, but it could render the Conjuction false if
// it is false
Boolean theEval = (Boolean) Matching.getEvaluator().eval(toAdd);
if (theEval == null)
return false;
else
return theEval.booleanValue(); // was ((BooleanValue) Matching.getEvaluator().eval(toAdd)).booleanValue()
}
else if (Matching.isSimple(toAdd))
{
if(toAdd.isExtended())
return target.and(new ExtendedSimpleTestImpl(toAdd));
else
return target.and(new SimpleTestImpl(toAdd));
}
else
{
target.and(toAdd);
return true;
}
} | [
"private",
"static",
"boolean",
"augmentConjunction",
"(",
"ConjunctionImpl",
"target",
",",
"Selector",
"toAdd",
")",
"{",
"if",
"(",
"toAdd",
"instanceof",
"Operator",
")",
"{",
"Operator",
"oper",
"=",
"(",
"Operator",
")",
"toAdd",
";",
"if",
"(",
"oper",
".",
"getOp",
"(",
")",
"==",
"Selector",
".",
"AND",
")",
"return",
"augmentConjunction",
"(",
"target",
",",
"oper",
".",
"getOperands",
"(",
")",
"[",
"0",
"]",
")",
"&&",
"augmentConjunction",
"(",
"target",
",",
"oper",
".",
"getOperands",
"(",
")",
"[",
"1",
"]",
")",
";",
"}",
"// toAdd is not an AND node, so we process and combine it in the appropriate way",
"if",
"(",
"toAdd",
".",
"getNumIds",
"(",
")",
"==",
"0",
")",
"{",
"// Should not be added to Conjunction, but it could render the Conjuction false if",
"// it is false",
"Boolean",
"theEval",
"=",
"(",
"Boolean",
")",
"Matching",
".",
"getEvaluator",
"(",
")",
".",
"eval",
"(",
"toAdd",
")",
";",
"if",
"(",
"theEval",
"==",
"null",
")",
"return",
"false",
";",
"else",
"return",
"theEval",
".",
"booleanValue",
"(",
")",
";",
"// was ((BooleanValue) Matching.getEvaluator().eval(toAdd)).booleanValue()",
"}",
"else",
"if",
"(",
"Matching",
".",
"isSimple",
"(",
"toAdd",
")",
")",
"{",
"if",
"(",
"toAdd",
".",
"isExtended",
"(",
")",
")",
"return",
"target",
".",
"and",
"(",
"new",
"ExtendedSimpleTestImpl",
"(",
"toAdd",
")",
")",
";",
"else",
"return",
"target",
".",
"and",
"(",
"new",
"SimpleTestImpl",
"(",
"toAdd",
")",
")",
";",
"}",
"else",
"{",
"target",
".",
"and",
"(",
"toAdd",
")",
";",
"return",
"true",
";",
"}",
"}"
] | or false if the Conjunction will always be false. | [
"or",
"false",
"if",
"the",
"Conjunction",
"will",
"always",
"be",
"false",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/TransformerImpl.java#L404-L434 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.common/src/com/ibm/ws/security/common/random/RandomUtils.java | RandomUtils.getRandomAlphaNumeric | public static String getRandomAlphaNumeric(int length) {
if (length <= 0) {
return "";
}
Random r = getRandom();
StringBuffer result = new StringBuffer(length);
for (int i = 0; i < length; i++) {
int n = r.nextInt(alphaNumChars.length);
result.append(alphaNumChars[n]);
}
return result.toString();
} | java | public static String getRandomAlphaNumeric(int length) {
if (length <= 0) {
return "";
}
Random r = getRandom();
StringBuffer result = new StringBuffer(length);
for (int i = 0; i < length; i++) {
int n = r.nextInt(alphaNumChars.length);
result.append(alphaNumChars[n]);
}
return result.toString();
} | [
"public",
"static",
"String",
"getRandomAlphaNumeric",
"(",
"int",
"length",
")",
"{",
"if",
"(",
"length",
"<=",
"0",
")",
"{",
"return",
"\"\"",
";",
"}",
"Random",
"r",
"=",
"getRandom",
"(",
")",
";",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"(",
"length",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"length",
";",
"i",
"++",
")",
"{",
"int",
"n",
"=",
"r",
".",
"nextInt",
"(",
"alphaNumChars",
".",
"length",
")",
";",
"result",
".",
"append",
"(",
"alphaNumChars",
"[",
"n",
"]",
")",
";",
"}",
"return",
"result",
".",
"toString",
"(",
")",
";",
"}"
] | Generates a random alphanumeric string of length n.
@param length
@return | [
"Generates",
"a",
"random",
"alphanumeric",
"string",
"of",
"length",
"n",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.common/src/com/ibm/ws/security/common/random/RandomUtils.java#L48-L63 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/LogProviderConfigImpl.java | LogProviderConfigImpl.getLogHeader | static String getLogHeader(Map<String, String> config) {
StringBuilder builder = new StringBuilder(512);
String productInfo = config.get("websphere.product.info");
if (productInfo != null) {
builder.append("product = ").append(productInfo).append(LoggingConstants.nl);
}
String installDir = config.get("wlp.install.dir");
if (installDir != null) {
builder.append("wlp.install.dir = ").append(installDir).append(LoggingConstants.nl);
}
String serverConfigDir = config.get("server.config.dir");
if (serverConfigDir != null && !"true".equals(config.get("wlp.user.dir.isDefault"))) {
builder.append("server.config.dir = ").append(serverConfigDir).append(LoggingConstants.nl);
}
String serverOutputDir = config.get("server.output.dir");
if (serverOutputDir != null && !serverOutputDir.equals(serverConfigDir)) {
builder.append("server.output.dir = ").append(serverOutputDir).append(LoggingConstants.nl);
}
builder.append("java.home = ").append(System.getProperty("java.home")).append(LoggingConstants.nl);
builder.append("java.version = ").append(System.getProperty("java.version")).append(LoggingConstants.nl);
builder.append("java.runtime = ").append(System.getProperty("java.runtime.name")).append(" (").append(System.getProperty("java.runtime.version")).append(')').append(LoggingConstants.nl);
builder.append("os = ").append(System.getProperty("os.name")).append(" (").append(System.getProperty("os.version")).append("; ").append(System.getProperty("os.arch")).append(") (").append(Locale.getDefault()).append(")").append(LoggingConstants.nl);
// avoid the initialization overhead retrieving the RuntimeMXBean. Not guaranteed to work on all platforms, so fallback as appropriate
builder.append("process = ");
String pid = System.getProperty("sun.java.launcher.pid");
if (pid != null) {
try {
String ip = InetAddress.getLocalHost().getHostAddress();
builder.append(pid).append('@').append(ip);
} catch (Exception e) {
pid = null;
}
}
if (pid == null) {
builder.append(ManagementFactory.getRuntimeMXBean().getName());
}
builder.append(LoggingConstants.nl);
return builder.toString();
} | java | static String getLogHeader(Map<String, String> config) {
StringBuilder builder = new StringBuilder(512);
String productInfo = config.get("websphere.product.info");
if (productInfo != null) {
builder.append("product = ").append(productInfo).append(LoggingConstants.nl);
}
String installDir = config.get("wlp.install.dir");
if (installDir != null) {
builder.append("wlp.install.dir = ").append(installDir).append(LoggingConstants.nl);
}
String serverConfigDir = config.get("server.config.dir");
if (serverConfigDir != null && !"true".equals(config.get("wlp.user.dir.isDefault"))) {
builder.append("server.config.dir = ").append(serverConfigDir).append(LoggingConstants.nl);
}
String serverOutputDir = config.get("server.output.dir");
if (serverOutputDir != null && !serverOutputDir.equals(serverConfigDir)) {
builder.append("server.output.dir = ").append(serverOutputDir).append(LoggingConstants.nl);
}
builder.append("java.home = ").append(System.getProperty("java.home")).append(LoggingConstants.nl);
builder.append("java.version = ").append(System.getProperty("java.version")).append(LoggingConstants.nl);
builder.append("java.runtime = ").append(System.getProperty("java.runtime.name")).append(" (").append(System.getProperty("java.runtime.version")).append(')').append(LoggingConstants.nl);
builder.append("os = ").append(System.getProperty("os.name")).append(" (").append(System.getProperty("os.version")).append("; ").append(System.getProperty("os.arch")).append(") (").append(Locale.getDefault()).append(")").append(LoggingConstants.nl);
// avoid the initialization overhead retrieving the RuntimeMXBean. Not guaranteed to work on all platforms, so fallback as appropriate
builder.append("process = ");
String pid = System.getProperty("sun.java.launcher.pid");
if (pid != null) {
try {
String ip = InetAddress.getLocalHost().getHostAddress();
builder.append(pid).append('@').append(ip);
} catch (Exception e) {
pid = null;
}
}
if (pid == null) {
builder.append(ManagementFactory.getRuntimeMXBean().getName());
}
builder.append(LoggingConstants.nl);
return builder.toString();
} | [
"static",
"String",
"getLogHeader",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"config",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
"512",
")",
";",
"String",
"productInfo",
"=",
"config",
".",
"get",
"(",
"\"websphere.product.info\"",
")",
";",
"if",
"(",
"productInfo",
"!=",
"null",
")",
"{",
"builder",
".",
"append",
"(",
"\"product = \"",
")",
".",
"append",
"(",
"productInfo",
")",
".",
"append",
"(",
"LoggingConstants",
".",
"nl",
")",
";",
"}",
"String",
"installDir",
"=",
"config",
".",
"get",
"(",
"\"wlp.install.dir\"",
")",
";",
"if",
"(",
"installDir",
"!=",
"null",
")",
"{",
"builder",
".",
"append",
"(",
"\"wlp.install.dir = \"",
")",
".",
"append",
"(",
"installDir",
")",
".",
"append",
"(",
"LoggingConstants",
".",
"nl",
")",
";",
"}",
"String",
"serverConfigDir",
"=",
"config",
".",
"get",
"(",
"\"server.config.dir\"",
")",
";",
"if",
"(",
"serverConfigDir",
"!=",
"null",
"&&",
"!",
"\"true\"",
".",
"equals",
"(",
"config",
".",
"get",
"(",
"\"wlp.user.dir.isDefault\"",
")",
")",
")",
"{",
"builder",
".",
"append",
"(",
"\"server.config.dir = \"",
")",
".",
"append",
"(",
"serverConfigDir",
")",
".",
"append",
"(",
"LoggingConstants",
".",
"nl",
")",
";",
"}",
"String",
"serverOutputDir",
"=",
"config",
".",
"get",
"(",
"\"server.output.dir\"",
")",
";",
"if",
"(",
"serverOutputDir",
"!=",
"null",
"&&",
"!",
"serverOutputDir",
".",
"equals",
"(",
"serverConfigDir",
")",
")",
"{",
"builder",
".",
"append",
"(",
"\"server.output.dir = \"",
")",
".",
"append",
"(",
"serverOutputDir",
")",
".",
"append",
"(",
"LoggingConstants",
".",
"nl",
")",
";",
"}",
"builder",
".",
"append",
"(",
"\"java.home = \"",
")",
".",
"append",
"(",
"System",
".",
"getProperty",
"(",
"\"java.home\"",
")",
")",
".",
"append",
"(",
"LoggingConstants",
".",
"nl",
")",
";",
"builder",
".",
"append",
"(",
"\"java.version = \"",
")",
".",
"append",
"(",
"System",
".",
"getProperty",
"(",
"\"java.version\"",
")",
")",
".",
"append",
"(",
"LoggingConstants",
".",
"nl",
")",
";",
"builder",
".",
"append",
"(",
"\"java.runtime = \"",
")",
".",
"append",
"(",
"System",
".",
"getProperty",
"(",
"\"java.runtime.name\"",
")",
")",
".",
"append",
"(",
"\" (\"",
")",
".",
"append",
"(",
"System",
".",
"getProperty",
"(",
"\"java.runtime.version\"",
")",
")",
".",
"append",
"(",
"'",
"'",
")",
".",
"append",
"(",
"LoggingConstants",
".",
"nl",
")",
";",
"builder",
".",
"append",
"(",
"\"os = \"",
")",
".",
"append",
"(",
"System",
".",
"getProperty",
"(",
"\"os.name\"",
")",
")",
".",
"append",
"(",
"\" (\"",
")",
".",
"append",
"(",
"System",
".",
"getProperty",
"(",
"\"os.version\"",
")",
")",
".",
"append",
"(",
"\"; \"",
")",
".",
"append",
"(",
"System",
".",
"getProperty",
"(",
"\"os.arch\"",
")",
")",
".",
"append",
"(",
"\") (\"",
")",
".",
"append",
"(",
"Locale",
".",
"getDefault",
"(",
")",
")",
".",
"append",
"(",
"\")\"",
")",
".",
"append",
"(",
"LoggingConstants",
".",
"nl",
")",
";",
"// avoid the initialization overhead retrieving the RuntimeMXBean. Not guaranteed to work on all platforms, so fallback as appropriate",
"builder",
".",
"append",
"(",
"\"process = \"",
")",
";",
"String",
"pid",
"=",
"System",
".",
"getProperty",
"(",
"\"sun.java.launcher.pid\"",
")",
";",
"if",
"(",
"pid",
"!=",
"null",
")",
"{",
"try",
"{",
"String",
"ip",
"=",
"InetAddress",
".",
"getLocalHost",
"(",
")",
".",
"getHostAddress",
"(",
")",
";",
"builder",
".",
"append",
"(",
"pid",
")",
".",
"append",
"(",
"'",
"'",
")",
".",
"append",
"(",
"ip",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"pid",
"=",
"null",
";",
"}",
"}",
"if",
"(",
"pid",
"==",
"null",
")",
"{",
"builder",
".",
"append",
"(",
"ManagementFactory",
".",
"getRuntimeMXBean",
"(",
")",
".",
"getName",
"(",
")",
")",
";",
"}",
"builder",
".",
"append",
"(",
"LoggingConstants",
".",
"nl",
")",
";",
"return",
"builder",
".",
"toString",
"(",
")",
";",
"}"
] | Returns the header to be written at the beginning of all log files. | [
"Returns",
"the",
"header",
"to",
"be",
"written",
"at",
"the",
"beginning",
"of",
"all",
"log",
"files",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/LogProviderConfigImpl.java#L237-L284 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/BaseFFDCService.java | BaseFFDCService.init | @Override
public synchronized void init(LogProviderConfig config) {
ffdcSummaryPolicy = ((LogProviderConfigImpl) config).getFfdcSummaryPolicy();
update(config);
} | java | @Override
public synchronized void init(LogProviderConfig config) {
ffdcSummaryPolicy = ((LogProviderConfigImpl) config).getFfdcSummaryPolicy();
update(config);
} | [
"@",
"Override",
"public",
"synchronized",
"void",
"init",
"(",
"LogProviderConfig",
"config",
")",
"{",
"ffdcSummaryPolicy",
"=",
"(",
"(",
"LogProviderConfigImpl",
")",
"config",
")",
".",
"getFfdcSummaryPolicy",
"(",
")",
";",
"update",
"(",
"config",
")",
";",
"}"
] | Initialize the FFDC service based on the provided configuration | [
"Initialize",
"the",
"FFDC",
"service",
"based",
"on",
"the",
"provided",
"configuration"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/BaseFFDCService.java#L94-L98 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/BaseFFDCService.java | BaseFFDCService.update | @Override
public synchronized void update(LogProviderConfig config) {
// Get the configured log location, and derive the ffdc location from it
File location = config.getLogDirectory();
if (location == null) {
location = new File(".");
}
location = new File(location, FFDCConfigurator.FFDC_DIR);
ffdcLogDirectory = location;
int maxFiles = config.getMaxFiles();
// Creation and rolling of files should be done as the server
Object token = ThreadIdentityManager.runAsServer();
try {
summaryLogSet.update(location,
FFDCConfigurator.FFDC_SUMMARY_FILE_NAME,
FFDCConfigurator.FFDC_EXTENSION,
maxFiles);
synchronized (ffdcLogSet) {
ffdcLogSet.update(location,
FFDCConfigurator.FFDC_FILE_NAME,
FFDCConfigurator.FFDC_EXTENSION,
0 /* unlimited */);
}
} finally {
ThreadIdentityManager.reset(token);
}
} | java | @Override
public synchronized void update(LogProviderConfig config) {
// Get the configured log location, and derive the ffdc location from it
File location = config.getLogDirectory();
if (location == null) {
location = new File(".");
}
location = new File(location, FFDCConfigurator.FFDC_DIR);
ffdcLogDirectory = location;
int maxFiles = config.getMaxFiles();
// Creation and rolling of files should be done as the server
Object token = ThreadIdentityManager.runAsServer();
try {
summaryLogSet.update(location,
FFDCConfigurator.FFDC_SUMMARY_FILE_NAME,
FFDCConfigurator.FFDC_EXTENSION,
maxFiles);
synchronized (ffdcLogSet) {
ffdcLogSet.update(location,
FFDCConfigurator.FFDC_FILE_NAME,
FFDCConfigurator.FFDC_EXTENSION,
0 /* unlimited */);
}
} finally {
ThreadIdentityManager.reset(token);
}
} | [
"@",
"Override",
"public",
"synchronized",
"void",
"update",
"(",
"LogProviderConfig",
"config",
")",
"{",
"// Get the configured log location, and derive the ffdc location from it",
"File",
"location",
"=",
"config",
".",
"getLogDirectory",
"(",
")",
";",
"if",
"(",
"location",
"==",
"null",
")",
"{",
"location",
"=",
"new",
"File",
"(",
"\".\"",
")",
";",
"}",
"location",
"=",
"new",
"File",
"(",
"location",
",",
"FFDCConfigurator",
".",
"FFDC_DIR",
")",
";",
"ffdcLogDirectory",
"=",
"location",
";",
"int",
"maxFiles",
"=",
"config",
".",
"getMaxFiles",
"(",
")",
";",
"// Creation and rolling of files should be done as the server",
"Object",
"token",
"=",
"ThreadIdentityManager",
".",
"runAsServer",
"(",
")",
";",
"try",
"{",
"summaryLogSet",
".",
"update",
"(",
"location",
",",
"FFDCConfigurator",
".",
"FFDC_SUMMARY_FILE_NAME",
",",
"FFDCConfigurator",
".",
"FFDC_EXTENSION",
",",
"maxFiles",
")",
";",
"synchronized",
"(",
"ffdcLogSet",
")",
"{",
"ffdcLogSet",
".",
"update",
"(",
"location",
",",
"FFDCConfigurator",
".",
"FFDC_FILE_NAME",
",",
"FFDCConfigurator",
".",
"FFDC_EXTENSION",
",",
"0",
"/* unlimited */",
")",
";",
"}",
"}",
"finally",
"{",
"ThreadIdentityManager",
".",
"reset",
"(",
"token",
")",
";",
"}",
"}"
] | Update the FFDC service based on the provided configuration | [
"Update",
"the",
"FFDC",
"service",
"based",
"on",
"the",
"provided",
"configuration"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/BaseFFDCService.java#L103-L132 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/BaseFFDCService.java | BaseFFDCService.stop | @Override
public synchronized void stop() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "Stopping the basic FFDC service");
}
logSummary(true);
} | java | @Override
public synchronized void stop() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "Stopping the basic FFDC service");
}
logSummary(true);
} | [
"@",
"Override",
"public",
"synchronized",
"void",
"stop",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"Stopping the basic FFDC service\"",
")",
";",
"}",
"logSummary",
"(",
"true",
")",
";",
"}"
] | Stop this FFDC service instance and free up any resources currently used. | [
"Stop",
"this",
"FFDC",
"service",
"instance",
"and",
"free",
"up",
"any",
"resources",
"currently",
"used",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/BaseFFDCService.java#L142-L148 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/BaseFFDCService.java | BaseFFDCService.processException | @Override
public void processException(Throwable th, String sourceId, String probeId, Object callerThis, Object[] objectArray) {
log(sourceId, probeId, th, callerThis, objectArray);
} | java | @Override
public void processException(Throwable th, String sourceId, String probeId, Object callerThis, Object[] objectArray) {
log(sourceId, probeId, th, callerThis, objectArray);
} | [
"@",
"Override",
"public",
"void",
"processException",
"(",
"Throwable",
"th",
",",
"String",
"sourceId",
",",
"String",
"probeId",
",",
"Object",
"callerThis",
",",
"Object",
"[",
"]",
"objectArray",
")",
"{",
"log",
"(",
"sourceId",
",",
"probeId",
",",
"th",
",",
"callerThis",
",",
"objectArray",
")",
";",
"}"
] | Process an exception
@param th
The exception to be processed
@param sourceId
The source id of the reporting code
@param probeId
The probe of the reporting code
@param callerThis
The instance of the reporting code
@param objectArray
An array of additional interesting objects | [
"Process",
"an",
"exception"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/BaseFFDCService.java#L214-L217 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/BaseFFDCService.java | BaseFFDCService.log | @FFDCIgnore(PrivilegedActionException.class)
private void log(String sourceId, String probeId, Throwable th, Object callerThis, Object[] objectArray) {
IncidentImpl incident = getIncident(sourceId, probeId, th, callerThis, objectArray);
incident.log(th, callerThis, objectArray);
if (System.getSecurityManager() == null) {
logSummary(ffdcSummaryPolicy == FFDCSummaryPolicy.IMMEDIATE);
} else {
AccessController.doPrivileged(new PrivilegedAction<Void>() {
@Override
public Void run() {
logSummary(ffdcSummaryPolicy == FFDCSummaryPolicy.IMMEDIATE);
return null;
}
});
}
for (IncidentForwarder forwarder : FFDC.getIncidentForwarders()) {
forwarder.process(incident, th);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "FFDC exception: " + th);
} | java | @FFDCIgnore(PrivilegedActionException.class)
private void log(String sourceId, String probeId, Throwable th, Object callerThis, Object[] objectArray) {
IncidentImpl incident = getIncident(sourceId, probeId, th, callerThis, objectArray);
incident.log(th, callerThis, objectArray);
if (System.getSecurityManager() == null) {
logSummary(ffdcSummaryPolicy == FFDCSummaryPolicy.IMMEDIATE);
} else {
AccessController.doPrivileged(new PrivilegedAction<Void>() {
@Override
public Void run() {
logSummary(ffdcSummaryPolicy == FFDCSummaryPolicy.IMMEDIATE);
return null;
}
});
}
for (IncidentForwarder forwarder : FFDC.getIncidentForwarders()) {
forwarder.process(incident, th);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "FFDC exception: " + th);
} | [
"@",
"FFDCIgnore",
"(",
"PrivilegedActionException",
".",
"class",
")",
"private",
"void",
"log",
"(",
"String",
"sourceId",
",",
"String",
"probeId",
",",
"Throwable",
"th",
",",
"Object",
"callerThis",
",",
"Object",
"[",
"]",
"objectArray",
")",
"{",
"IncidentImpl",
"incident",
"=",
"getIncident",
"(",
"sourceId",
",",
"probeId",
",",
"th",
",",
"callerThis",
",",
"objectArray",
")",
";",
"incident",
".",
"log",
"(",
"th",
",",
"callerThis",
",",
"objectArray",
")",
";",
"if",
"(",
"System",
".",
"getSecurityManager",
"(",
")",
"==",
"null",
")",
"{",
"logSummary",
"(",
"ffdcSummaryPolicy",
"==",
"FFDCSummaryPolicy",
".",
"IMMEDIATE",
")",
";",
"}",
"else",
"{",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedAction",
"<",
"Void",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Void",
"run",
"(",
")",
"{",
"logSummary",
"(",
"ffdcSummaryPolicy",
"==",
"FFDCSummaryPolicy",
".",
"IMMEDIATE",
")",
";",
"return",
"null",
";",
"}",
"}",
")",
";",
"}",
"for",
"(",
"IncidentForwarder",
"forwarder",
":",
"FFDC",
".",
"getIncidentForwarders",
"(",
")",
")",
"{",
"forwarder",
".",
"process",
"(",
"incident",
",",
"th",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"FFDC exception: \"",
"+",
"th",
")",
";",
"}"
] | Log a problem to the global incident stream (creating it if necessary
@param txt
A description of the incident (the name of the exception)
@param sourceId
The source id of the reporting code
@param probeId
The probe id of the reporting code
@param th
The exception
@param callerThis
The instance of the reporting code (null if no specific
instance)
@param objectArray
Additional interesting object (null if there aren't any) | [
"Log",
"a",
"problem",
"to",
"the",
"global",
"incident",
"stream",
"(",
"creating",
"it",
"if",
"necessary"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/BaseFFDCService.java#L236-L258 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/BaseFFDCService.java | BaseFFDCService.createSummaryStream | private OutputStream createSummaryStream(File targetFile) throws IOException {
if (targetFile == null)
return null;
TextFileOutputStreamFactory factory = FFDCConfigurator.getFileOutputStreamFactory();
OutputStream newStream = null;
// Creation and rolling of files should be done as the server
Object token = ThreadIdentityManager.runAsServer();
try {
newStream = factory.createOutputStream(targetFile);
} finally {
ThreadIdentityManager.reset(token);
}
return newStream;
} | java | private OutputStream createSummaryStream(File targetFile) throws IOException {
if (targetFile == null)
return null;
TextFileOutputStreamFactory factory = FFDCConfigurator.getFileOutputStreamFactory();
OutputStream newStream = null;
// Creation and rolling of files should be done as the server
Object token = ThreadIdentityManager.runAsServer();
try {
newStream = factory.createOutputStream(targetFile);
} finally {
ThreadIdentityManager.reset(token);
}
return newStream;
} | [
"private",
"OutputStream",
"createSummaryStream",
"(",
"File",
"targetFile",
")",
"throws",
"IOException",
"{",
"if",
"(",
"targetFile",
"==",
"null",
")",
"return",
"null",
";",
"TextFileOutputStreamFactory",
"factory",
"=",
"FFDCConfigurator",
".",
"getFileOutputStreamFactory",
"(",
")",
";",
"OutputStream",
"newStream",
"=",
"null",
";",
"// Creation and rolling of files should be done as the server",
"Object",
"token",
"=",
"ThreadIdentityManager",
".",
"runAsServer",
"(",
")",
";",
"try",
"{",
"newStream",
"=",
"factory",
".",
"createOutputStream",
"(",
"targetFile",
")",
";",
"}",
"finally",
"{",
"ThreadIdentityManager",
".",
"reset",
"(",
"token",
")",
";",
"}",
"return",
"newStream",
";",
"}"
] | This wrapper method for creating streams should be called while
synchronized on the targetFile..
@param targetFile
@return
@throws IOException | [
"This",
"wrapper",
"method",
"for",
"creating",
"streams",
"should",
"be",
"called",
"while",
"synchronized",
"on",
"the",
"targetFile",
".."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/BaseFFDCService.java#L433-L449 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java | SRTServletResponse.alertClose | public void alertClose() {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) //306998.15
logger.logp(Level.FINE, CLASS_NAME,"alertClose", " _outWriter: --> " + _outWriter);
// 104771
writerClosed = true;
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) //306998.15
logger.logp(Level.FINE, CLASS_NAME,"alertClose", "exit");
} | java | public void alertClose() {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) //306998.15
logger.logp(Level.FINE, CLASS_NAME,"alertClose", " _outWriter: --> " + _outWriter);
// 104771
writerClosed = true;
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) //306998.15
logger.logp(Level.FINE, CLASS_NAME,"alertClose", "exit");
} | [
"public",
"void",
"alertClose",
"(",
")",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"//306998.15",
"logger",
".",
"logp",
"(",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"\"alertClose\"",
",",
"\" _outWriter: --> \"",
"+",
"_outWriter",
")",
";",
"// 104771",
"writerClosed",
"=",
"true",
";",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"//306998.15",
"logger",
".",
"logp",
"(",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"\"alertClose\"",
",",
"\"exit\"",
")",
";",
"}"
] | Alert message that the outputstream has been closed. | [
"Alert",
"message",
"that",
"the",
"outputstream",
"has",
"been",
"closed",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java#L176-L184 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java | SRTServletResponse.alertException | public void alertException() {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) //306998.15
logger.logp(Level.FINE, CLASS_NAME,"alertException", "entry _outWriter: --> " + _outWriter);
writerException = true;
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) //306998.15
logger.logp(Level.FINE, CLASS_NAME,"alertException", "exit");
} | java | public void alertException() {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) //306998.15
logger.logp(Level.FINE, CLASS_NAME,"alertException", "entry _outWriter: --> " + _outWriter);
writerException = true;
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) //306998.15
logger.logp(Level.FINE, CLASS_NAME,"alertException", "exit");
} | [
"public",
"void",
"alertException",
"(",
")",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"//306998.15",
"logger",
".",
"logp",
"(",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"\"alertException\"",
",",
"\"entry _outWriter: --> \"",
"+",
"_outWriter",
")",
";",
"writerException",
"=",
"true",
";",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"//306998.15",
"logger",
".",
"logp",
"(",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"\"alertException\"",
",",
"\"exit\"",
")",
";",
"}"
] | Alert message that there has been an exception in the outputstream. | [
"Alert",
"message",
"that",
"there",
"has",
"been",
"an",
"exception",
"in",
"the",
"outputstream",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java#L214-L220 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java | SRTServletResponse.writerObtained | public boolean writerObtained() {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) //306998.15
logger.logp(Level.FINE, CLASS_NAME,"writerObtained"," " + String.valueOf(_gotWriter),"["+this+"]");
return _gotWriter;
} | java | public boolean writerObtained() {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) //306998.15
logger.logp(Level.FINE, CLASS_NAME,"writerObtained"," " + String.valueOf(_gotWriter),"["+this+"]");
return _gotWriter;
} | [
"public",
"boolean",
"writerObtained",
"(",
")",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"//306998.15",
"logger",
".",
"logp",
"(",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"\"writerObtained\"",
",",
"\" \"",
"+",
"String",
".",
"valueOf",
"(",
"_gotWriter",
")",
",",
"\"[\"",
"+",
"this",
"+",
"\"]\"",
")",
";",
"return",
"_gotWriter",
";",
"}"
] | Used to check whether the writer has been obtained.
@return Logical true if the writer has been previously obtained, false otherwise. | [
"Used",
"to",
"check",
"whether",
"the",
"writer",
"has",
"been",
"obtained",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java#L227-L231 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java | SRTServletResponse.outputStreamObtained | public boolean outputStreamObtained() {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) //306998.15
logger.logp(Level.FINE, CLASS_NAME,"outputStreamObtained"," " + String.valueOf(_gotOutputStream),"["+this+"]");
return _gotOutputStream;
} | java | public boolean outputStreamObtained() {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) //306998.15
logger.logp(Level.FINE, CLASS_NAME,"outputStreamObtained"," " + String.valueOf(_gotOutputStream),"["+this+"]");
return _gotOutputStream;
} | [
"public",
"boolean",
"outputStreamObtained",
"(",
")",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"//306998.15",
"logger",
".",
"logp",
"(",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"\"outputStreamObtained\"",
",",
"\" \"",
"+",
"String",
".",
"valueOf",
"(",
"_gotOutputStream",
")",
",",
"\"[\"",
"+",
"this",
"+",
"\"]\"",
")",
";",
"return",
"_gotOutputStream",
";",
"}"
] | Used to check whether the output stream has been obtained.
@return Logical true if the stream has been previously obtained, false otherwise. | [
"Used",
"to",
"check",
"whether",
"the",
"output",
"stream",
"has",
"been",
"obtained",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java#L238-L242 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java | SRTServletResponse.finish | public void finish() {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) //306998.15
logger.entering(CLASS_NAME,"finish","["+this+"]");
if (!isCommitted()) {
commit();
}
// flush the OutputStream and Writer
try {
flushBuffer(false);
_rawOut.close();
}
catch (IOException e) {
// Don't want to report errors on early browser closes
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.logp(Level.FINE, CLASS_NAME,"finish", "Servlet.Exception:.Error.while.finishing.response", e);
}
}
finally {
_rawOut.reset();
// PK29451 - remove call to clearHeaders(). Implementation of clearHeaders() was empty,
// which this method relies on, but has been implemented in PK29451 to make reset() work.
// _response.clearHeaders();
cleanupFromFinish();
// LIBERTY _bufferedOut.reset();
_bufferedWriter.reset();
// LIBERTY this._responseBuffer = null;
}
resetState();
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) //306998.15
logger.exiting(CLASS_NAME,"finish");
} | java | public void finish() {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) //306998.15
logger.entering(CLASS_NAME,"finish","["+this+"]");
if (!isCommitted()) {
commit();
}
// flush the OutputStream and Writer
try {
flushBuffer(false);
_rawOut.close();
}
catch (IOException e) {
// Don't want to report errors on early browser closes
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.logp(Level.FINE, CLASS_NAME,"finish", "Servlet.Exception:.Error.while.finishing.response", e);
}
}
finally {
_rawOut.reset();
// PK29451 - remove call to clearHeaders(). Implementation of clearHeaders() was empty,
// which this method relies on, but has been implemented in PK29451 to make reset() work.
// _response.clearHeaders();
cleanupFromFinish();
// LIBERTY _bufferedOut.reset();
_bufferedWriter.reset();
// LIBERTY this._responseBuffer = null;
}
resetState();
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) //306998.15
logger.exiting(CLASS_NAME,"finish");
} | [
"public",
"void",
"finish",
"(",
")",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"//306998.15",
"logger",
".",
"entering",
"(",
"CLASS_NAME",
",",
"\"finish\"",
",",
"\"[\"",
"+",
"this",
"+",
"\"]\"",
")",
";",
"if",
"(",
"!",
"isCommitted",
"(",
")",
")",
"{",
"commit",
"(",
")",
";",
"}",
"// flush the OutputStream and Writer",
"try",
"{",
"flushBuffer",
"(",
"false",
")",
";",
"_rawOut",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"// Don't want to report errors on early browser closes",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"//306998.15",
"logger",
".",
"logp",
"(",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"\"finish\"",
",",
"\"Servlet.Exception:.Error.while.finishing.response\"",
",",
"e",
")",
";",
"}",
"}",
"finally",
"{",
"_rawOut",
".",
"reset",
"(",
")",
";",
"// PK29451 - remove call to clearHeaders(). Implementation of clearHeaders() was empty,",
"// which this method relies on, but has been implemented in PK29451 to make reset() work.",
"// _response.clearHeaders();",
"cleanupFromFinish",
"(",
")",
";",
"// LIBERTY _bufferedOut.reset();",
"_bufferedWriter",
".",
"reset",
"(",
")",
";",
"// LIBERTY this._responseBuffer = null;",
"}",
"resetState",
"(",
")",
";",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"//306998.15",
"logger",
".",
"exiting",
"(",
"CLASS_NAME",
",",
"\"finish\"",
")",
";",
"}"
] | Close this response. | [
"Close",
"this",
"response",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java#L247-L282 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java | SRTServletResponse.cleanupFromFinish | protected void cleanupFromFinish() {
_response = null;
_bufferSize = 0;
_encoding = null;
// LIBERTY _responseBuffer = null;
// _outWriterEncoding = null;
_gotOutputStream = false;
_gotWriter = false;
this._pwriter = null;
} | java | protected void cleanupFromFinish() {
_response = null;
_bufferSize = 0;
_encoding = null;
// LIBERTY _responseBuffer = null;
// _outWriterEncoding = null;
_gotOutputStream = false;
_gotWriter = false;
this._pwriter = null;
} | [
"protected",
"void",
"cleanupFromFinish",
"(",
")",
"{",
"_response",
"=",
"null",
";",
"_bufferSize",
"=",
"0",
";",
"_encoding",
"=",
"null",
";",
"// LIBERTY _responseBuffer = null;",
"// _outWriterEncoding = null;",
"_gotOutputStream",
"=",
"false",
";",
"_gotWriter",
"=",
"false",
";",
"this",
".",
"_pwriter",
"=",
"null",
";",
"}"
] | shared cleanup from finish & finishKeepConnection | [
"shared",
"cleanup",
"from",
"finish",
"&",
"finishKeepConnection"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java#L285-L294 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java | SRTServletResponse.resetBuffer | public void resetBuffer() {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) //306998.15
logger.entering(CLASS_NAME,"resetBuffer","["+this+"]");
//is committed check done in underlying layer in tWAS
if (isCommitted())
throw new IllegalStateException();
// LIBERTY
if (_gotOutputStream)
{
_response.resetBuffer();
}
// LIBERTY if (_responseBuffer != null) {
// LIBERTY _responseBuffer.clearBuffer();
// LIBERTY }
// begin 156186
if (_bufferedWriter != null) {
_bufferedWriter.clearBuffer();
}
// end 156186
_firstWriteToCurrentBuffer = false;
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) //306998.15
logger.exiting(CLASS_NAME,"resetBuffer");
} | java | public void resetBuffer() {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) //306998.15
logger.entering(CLASS_NAME,"resetBuffer","["+this+"]");
//is committed check done in underlying layer in tWAS
if (isCommitted())
throw new IllegalStateException();
// LIBERTY
if (_gotOutputStream)
{
_response.resetBuffer();
}
// LIBERTY if (_responseBuffer != null) {
// LIBERTY _responseBuffer.clearBuffer();
// LIBERTY }
// begin 156186
if (_bufferedWriter != null) {
_bufferedWriter.clearBuffer();
}
// end 156186
_firstWriteToCurrentBuffer = false;
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) //306998.15
logger.exiting(CLASS_NAME,"resetBuffer");
} | [
"public",
"void",
"resetBuffer",
"(",
")",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"//306998.15",
"logger",
".",
"entering",
"(",
"CLASS_NAME",
",",
"\"resetBuffer\"",
",",
"\"[\"",
"+",
"this",
"+",
"\"]\"",
")",
";",
"//is committed check done in underlying layer in tWAS",
"if",
"(",
"isCommitted",
"(",
")",
")",
"throw",
"new",
"IllegalStateException",
"(",
")",
";",
"// LIBERTY",
"if",
"(",
"_gotOutputStream",
")",
"{",
"_response",
".",
"resetBuffer",
"(",
")",
";",
"}",
"// LIBERTY if (_responseBuffer != null) {",
"// LIBERTY _responseBuffer.clearBuffer();",
"// LIBERTY }",
"// begin 156186",
"if",
"(",
"_bufferedWriter",
"!=",
"null",
")",
"{",
"_bufferedWriter",
".",
"clearBuffer",
"(",
")",
";",
"}",
"// end 156186",
"_firstWriteToCurrentBuffer",
"=",
"false",
";",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"//306998.15",
"logger",
".",
"exiting",
"(",
"CLASS_NAME",
",",
"\"resetBuffer\"",
")",
";",
"}"
] | Clears the content of the underlying buffer in the response without clearing
headers or status code.
@throws IllegalStateException if the response has already been committed
@since 2.3 | [
"Clears",
"the",
"content",
"of",
"the",
"underlying",
"buffer",
"in",
"the",
"response",
"without",
"clearing",
"headers",
"or",
"status",
"code",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java#L414-L439 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java | SRTServletResponse.getOutputStream | public ServletOutputStream getOutputStream() {
final boolean isTraceOn = com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled();
if (isTraceOn&&logger.isLoggable (Level.FINE)) //306998.15
logger.entering(CLASS_NAME,"getOutputStream","gotWriter="+String.valueOf(_gotWriter)+" ["+this+"]");
if (!_ignoreStateErrors && _gotWriter) {
if (isTraceOn&&logger.isLoggable (Level.FINE)) //306998.15
logger.exiting(CLASS_NAME,"getOutputStream","throw IllegalStateException");
throw new IllegalStateException(nls.getString("Writer.already.obtained", "Writer already obtained"));
}
//PK89810 Start
if(!(WCCustomProperties.FINISH_RESPONSE_ON_CLOSE) || ! _gotOutputStream)
{
_gotOutputStream = true;
// LIBERTY _bufferedOut.init(_rawOut, getBufferSize());
// LIBERTY _bufferedOut.setLimit(_contentLength);
// LIBERTY _bufferedOut.setResponse(_response);
// LIBERTY _responseBuffer = _bufferedOut;
} //PK89810 End
this.fireOutputStreamRetrievedEvent(_bufferedOut);
if (isTraceOn&&logger.isLoggable (Level.FINE)) //306998.15
logger.exiting(CLASS_NAME,"getOutputStream");
return _bufferedOut;
} | java | public ServletOutputStream getOutputStream() {
final boolean isTraceOn = com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled();
if (isTraceOn&&logger.isLoggable (Level.FINE)) //306998.15
logger.entering(CLASS_NAME,"getOutputStream","gotWriter="+String.valueOf(_gotWriter)+" ["+this+"]");
if (!_ignoreStateErrors && _gotWriter) {
if (isTraceOn&&logger.isLoggable (Level.FINE)) //306998.15
logger.exiting(CLASS_NAME,"getOutputStream","throw IllegalStateException");
throw new IllegalStateException(nls.getString("Writer.already.obtained", "Writer already obtained"));
}
//PK89810 Start
if(!(WCCustomProperties.FINISH_RESPONSE_ON_CLOSE) || ! _gotOutputStream)
{
_gotOutputStream = true;
// LIBERTY _bufferedOut.init(_rawOut, getBufferSize());
// LIBERTY _bufferedOut.setLimit(_contentLength);
// LIBERTY _bufferedOut.setResponse(_response);
// LIBERTY _responseBuffer = _bufferedOut;
} //PK89810 End
this.fireOutputStreamRetrievedEvent(_bufferedOut);
if (isTraceOn&&logger.isLoggable (Level.FINE)) //306998.15
logger.exiting(CLASS_NAME,"getOutputStream");
return _bufferedOut;
} | [
"public",
"ServletOutputStream",
"getOutputStream",
"(",
")",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"isTraceOn",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"//306998.15",
"logger",
".",
"entering",
"(",
"CLASS_NAME",
",",
"\"getOutputStream\"",
",",
"\"gotWriter=\"",
"+",
"String",
".",
"valueOf",
"(",
"_gotWriter",
")",
"+",
"\" [\"",
"+",
"this",
"+",
"\"]\"",
")",
";",
"if",
"(",
"!",
"_ignoreStateErrors",
"&&",
"_gotWriter",
")",
"{",
"if",
"(",
"isTraceOn",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"//306998.15",
"logger",
".",
"exiting",
"(",
"CLASS_NAME",
",",
"\"getOutputStream\"",
",",
"\"throw IllegalStateException\"",
")",
";",
"throw",
"new",
"IllegalStateException",
"(",
"nls",
".",
"getString",
"(",
"\"Writer.already.obtained\"",
",",
"\"Writer already obtained\"",
")",
")",
";",
"}",
"//PK89810 Start",
"if",
"(",
"!",
"(",
"WCCustomProperties",
".",
"FINISH_RESPONSE_ON_CLOSE",
")",
"||",
"!",
"_gotOutputStream",
")",
"{",
"_gotOutputStream",
"=",
"true",
";",
"// LIBERTY _bufferedOut.init(_rawOut, getBufferSize());",
"// LIBERTY _bufferedOut.setLimit(_contentLength);",
"// LIBERTY _bufferedOut.setResponse(_response);",
"// LIBERTY _responseBuffer = _bufferedOut;",
"}",
"//PK89810 End",
"this",
".",
"fireOutputStreamRetrievedEvent",
"(",
"_bufferedOut",
")",
";",
"if",
"(",
"isTraceOn",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"//306998.15",
"logger",
".",
"exiting",
"(",
"CLASS_NAME",
",",
"\"getOutputStream\"",
")",
";",
"return",
"_bufferedOut",
";",
"}"
] | Returns an output stream for writing binary response data.
@see reinitStreamState | [
"Returns",
"an",
"output",
"stream",
"for",
"writing",
"binary",
"response",
"data",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java#L761-L790 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java | SRTServletResponse.getWriter | public PrintWriter getWriter() throws IOException, UnsupportedEncodingException {
final boolean isTraceOn = com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled();
if (isTraceOn&&logger.isLoggable (Level.FINE)) //306998.15
logger.entering(CLASS_NAME,"getWriter","gotOutputStream="+String.valueOf(_gotOutputStream)+" ["+this+"]");
if (!_ignoreStateErrors && _gotOutputStream) {
if (isTraceOn&&logger.isLoggable (Level.FINE)) //306998.15
logger.exiting(CLASS_NAME,"getWriter","throw IllegalStateException");
throw new IllegalStateException(nls.getString("OutputStream.already.obtained", "OutputStream already obtained"));
}
if (!_gotWriter) {
String charEncoding = getCharacterEncoding();
// begin 249506, part 1 Set content-type charset if not set already
// begin PK27527 DEFAULT CONTENT-TYPE SETTING ON WEBSPHERE V6.0.X IS "TEXT/PLAN"
// only add charset if we are in v6 mode.
if (contentTypeCompatibility==null || (!contentTypeCompatibility.equalsIgnoreCase("V4")&&
!contentTypeCompatibility.equalsIgnoreCase("V5"))){
String contentType = getContentType();
//PK33871 - added check to make sure the content type started with 'text'.
if (contentType!=null && contentType.indexOf("charset")==-1 && contentType.startsWith(WebContainerConstants.TEXT))
{
if (contentType.endsWith(";"))
setContentType(contentType + "charset=" + charEncoding);
else
setContentType(contentType + ";charset=" + charEncoding);
}
}
// end PK27527 DEFAULT CONTENT-TYPE SETTING ON WEBSPHERE V6.0.X IS "TEXT/PLAN"
// end 249506, part 1
// if ((_outWriter == null) || (writerClosed == true) || (!charEncoding.equals(_outWriterEncoding)))
if ((_outWriter == null) || (writerException == true) || (!charEncoding.equals(_outWriterEncoding))) {
if (isTraceOn&&logger.isLoggable (Level.FINE) && writerException){ //306998.15
logger.logp(Level.FINE, CLASS_NAME,"getWriter", "writerException --> " + writerException + "--> creating new OutputStreamWriter");
}
_outWriter = new OutputStreamWriter(_rawOut, EncodingUtils.getJvmConverter(charEncoding));
_outWriterEncoding = charEncoding;
writerException = false;
}
else{
if (isTraceOn&&logger.isLoggable (Level.FINE)){ //306998.15
logger.logp(Level.FINE, CLASS_NAME,"getWriter", "reusing _outWriter: --> " + _outWriter);
}
}
if (isTraceOn&&logger.isLoggable (Level.FINE)) //306998.15
logger.logp(Level.FINE, CLASS_NAME,"getWriter", "created writer with encoding: " + _outWriter.getEncoding());
_bufferedWriter.init(_outWriter, getBufferSize());
_bufferedWriter.setLimitLong(_contentLength);
_bufferedWriter.setResponse(_response);
_pwriter = new PrintWriter(_bufferedWriter, false);
// LIBERTY _responseBuffer = _bufferedWriter;
_gotWriter = true;
writerClosed = false;
}
this.fireWriterRetrievedEvent(_pwriter);
if (isTraceOn&&logger.isLoggable (Level.FINE)) //306998.15
logger.exiting(CLASS_NAME,"getWriter");
return _pwriter;
} | java | public PrintWriter getWriter() throws IOException, UnsupportedEncodingException {
final boolean isTraceOn = com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled();
if (isTraceOn&&logger.isLoggable (Level.FINE)) //306998.15
logger.entering(CLASS_NAME,"getWriter","gotOutputStream="+String.valueOf(_gotOutputStream)+" ["+this+"]");
if (!_ignoreStateErrors && _gotOutputStream) {
if (isTraceOn&&logger.isLoggable (Level.FINE)) //306998.15
logger.exiting(CLASS_NAME,"getWriter","throw IllegalStateException");
throw new IllegalStateException(nls.getString("OutputStream.already.obtained", "OutputStream already obtained"));
}
if (!_gotWriter) {
String charEncoding = getCharacterEncoding();
// begin 249506, part 1 Set content-type charset if not set already
// begin PK27527 DEFAULT CONTENT-TYPE SETTING ON WEBSPHERE V6.0.X IS "TEXT/PLAN"
// only add charset if we are in v6 mode.
if (contentTypeCompatibility==null || (!contentTypeCompatibility.equalsIgnoreCase("V4")&&
!contentTypeCompatibility.equalsIgnoreCase("V5"))){
String contentType = getContentType();
//PK33871 - added check to make sure the content type started with 'text'.
if (contentType!=null && contentType.indexOf("charset")==-1 && contentType.startsWith(WebContainerConstants.TEXT))
{
if (contentType.endsWith(";"))
setContentType(contentType + "charset=" + charEncoding);
else
setContentType(contentType + ";charset=" + charEncoding);
}
}
// end PK27527 DEFAULT CONTENT-TYPE SETTING ON WEBSPHERE V6.0.X IS "TEXT/PLAN"
// end 249506, part 1
// if ((_outWriter == null) || (writerClosed == true) || (!charEncoding.equals(_outWriterEncoding)))
if ((_outWriter == null) || (writerException == true) || (!charEncoding.equals(_outWriterEncoding))) {
if (isTraceOn&&logger.isLoggable (Level.FINE) && writerException){ //306998.15
logger.logp(Level.FINE, CLASS_NAME,"getWriter", "writerException --> " + writerException + "--> creating new OutputStreamWriter");
}
_outWriter = new OutputStreamWriter(_rawOut, EncodingUtils.getJvmConverter(charEncoding));
_outWriterEncoding = charEncoding;
writerException = false;
}
else{
if (isTraceOn&&logger.isLoggable (Level.FINE)){ //306998.15
logger.logp(Level.FINE, CLASS_NAME,"getWriter", "reusing _outWriter: --> " + _outWriter);
}
}
if (isTraceOn&&logger.isLoggable (Level.FINE)) //306998.15
logger.logp(Level.FINE, CLASS_NAME,"getWriter", "created writer with encoding: " + _outWriter.getEncoding());
_bufferedWriter.init(_outWriter, getBufferSize());
_bufferedWriter.setLimitLong(_contentLength);
_bufferedWriter.setResponse(_response);
_pwriter = new PrintWriter(_bufferedWriter, false);
// LIBERTY _responseBuffer = _bufferedWriter;
_gotWriter = true;
writerClosed = false;
}
this.fireWriterRetrievedEvent(_pwriter);
if (isTraceOn&&logger.isLoggable (Level.FINE)) //306998.15
logger.exiting(CLASS_NAME,"getWriter");
return _pwriter;
} | [
"public",
"PrintWriter",
"getWriter",
"(",
")",
"throws",
"IOException",
",",
"UnsupportedEncodingException",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"isTraceOn",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"//306998.15",
"logger",
".",
"entering",
"(",
"CLASS_NAME",
",",
"\"getWriter\"",
",",
"\"gotOutputStream=\"",
"+",
"String",
".",
"valueOf",
"(",
"_gotOutputStream",
")",
"+",
"\" [\"",
"+",
"this",
"+",
"\"]\"",
")",
";",
"if",
"(",
"!",
"_ignoreStateErrors",
"&&",
"_gotOutputStream",
")",
"{",
"if",
"(",
"isTraceOn",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"//306998.15",
"logger",
".",
"exiting",
"(",
"CLASS_NAME",
",",
"\"getWriter\"",
",",
"\"throw IllegalStateException\"",
")",
";",
"throw",
"new",
"IllegalStateException",
"(",
"nls",
".",
"getString",
"(",
"\"OutputStream.already.obtained\"",
",",
"\"OutputStream already obtained\"",
")",
")",
";",
"}",
"if",
"(",
"!",
"_gotWriter",
")",
"{",
"String",
"charEncoding",
"=",
"getCharacterEncoding",
"(",
")",
";",
"// begin 249506, part 1 Set content-type charset if not set already",
"// begin PK27527 DEFAULT CONTENT-TYPE SETTING ON WEBSPHERE V6.0.X IS \"TEXT/PLAN\"",
"// only add charset if we are in v6 mode.",
"if",
"(",
"contentTypeCompatibility",
"==",
"null",
"||",
"(",
"!",
"contentTypeCompatibility",
".",
"equalsIgnoreCase",
"(",
"\"V4\"",
")",
"&&",
"!",
"contentTypeCompatibility",
".",
"equalsIgnoreCase",
"(",
"\"V5\"",
")",
")",
")",
"{",
"String",
"contentType",
"=",
"getContentType",
"(",
")",
";",
"//PK33871 - added check to make sure the content type started with 'text'.",
"if",
"(",
"contentType",
"!=",
"null",
"&&",
"contentType",
".",
"indexOf",
"(",
"\"charset\"",
")",
"==",
"-",
"1",
"&&",
"contentType",
".",
"startsWith",
"(",
"WebContainerConstants",
".",
"TEXT",
")",
")",
"{",
"if",
"(",
"contentType",
".",
"endsWith",
"(",
"\";\"",
")",
")",
"setContentType",
"(",
"contentType",
"+",
"\"charset=\"",
"+",
"charEncoding",
")",
";",
"else",
"setContentType",
"(",
"contentType",
"+",
"\";charset=\"",
"+",
"charEncoding",
")",
";",
"}",
"}",
"// end PK27527 DEFAULT CONTENT-TYPE SETTING ON WEBSPHERE V6.0.X IS \"TEXT/PLAN\" ",
"// end 249506, part 1",
"// if ((_outWriter == null) || (writerClosed == true) || (!charEncoding.equals(_outWriterEncoding)))",
"if",
"(",
"(",
"_outWriter",
"==",
"null",
")",
"||",
"(",
"writerException",
"==",
"true",
")",
"||",
"(",
"!",
"charEncoding",
".",
"equals",
"(",
"_outWriterEncoding",
")",
")",
")",
"{",
"if",
"(",
"isTraceOn",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
"&&",
"writerException",
")",
"{",
"//306998.15",
"logger",
".",
"logp",
"(",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"\"getWriter\"",
",",
"\"writerException --> \"",
"+",
"writerException",
"+",
"\"--> creating new OutputStreamWriter\"",
")",
";",
"}",
"_outWriter",
"=",
"new",
"OutputStreamWriter",
"(",
"_rawOut",
",",
"EncodingUtils",
".",
"getJvmConverter",
"(",
"charEncoding",
")",
")",
";",
"_outWriterEncoding",
"=",
"charEncoding",
";",
"writerException",
"=",
"false",
";",
"}",
"else",
"{",
"if",
"(",
"isTraceOn",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"//306998.15",
"logger",
".",
"logp",
"(",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"\"getWriter\"",
",",
"\"reusing _outWriter: --> \"",
"+",
"_outWriter",
")",
";",
"}",
"}",
"if",
"(",
"isTraceOn",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"//306998.15",
"logger",
".",
"logp",
"(",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"\"getWriter\"",
",",
"\"created writer with encoding: \"",
"+",
"_outWriter",
".",
"getEncoding",
"(",
")",
")",
";",
"_bufferedWriter",
".",
"init",
"(",
"_outWriter",
",",
"getBufferSize",
"(",
")",
")",
";",
"_bufferedWriter",
".",
"setLimitLong",
"(",
"_contentLength",
")",
";",
"_bufferedWriter",
".",
"setResponse",
"(",
"_response",
")",
";",
"_pwriter",
"=",
"new",
"PrintWriter",
"(",
"_bufferedWriter",
",",
"false",
")",
";",
"// LIBERTY _responseBuffer = _bufferedWriter;",
"_gotWriter",
"=",
"true",
";",
"writerClosed",
"=",
"false",
";",
"}",
"this",
".",
"fireWriterRetrievedEvent",
"(",
"_pwriter",
")",
";",
"if",
"(",
"isTraceOn",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"//306998.15",
"logger",
".",
"exiting",
"(",
"CLASS_NAME",
",",
"\"getWriter\"",
")",
";",
"return",
"_pwriter",
";",
"}"
] | Returns a PrintWriter for writing formatted text output.
@return The PrintWriter to use for writing formatted text output. | [
"Returns",
"a",
"PrintWriter",
"for",
"writing",
"formatted",
"text",
"output",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java#L797-L862 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java | SRTServletResponse.addCookie | public void addCookie(Cookie cookie) {
//
// Note: this method is overwritten in servlet 4.0
//
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.logp(Level.FINE, CLASS_NAME,"addCookie", "Adding cookie --> " + cookie.getName(),"["+this+"]");
}
// d151464 - check the include flag
WebAppDispatcherContext dispatchContext = (WebAppDispatcherContext) getRequest().getWebAppDispatcherContext();
if (dispatchContext.isInclude() == true) {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) //306998.15
logger.logp(Level.FINE, CLASS_NAME,"addCookie", nls.getString("Illegal.from.included.servlet", "Illegal from included servlet"), "addCookie cookie --> " + cookie.getName()); //311717
}
else {
if (!_ignoreStateErrors && isCommitted()) {
// log a warning (only the first time)...ignore headers set after response is committed
IServletWrapper wrapper = dispatchContext.getCurrentServletReference();
if (logWarningActionNow(wrapper)) {
logAlreadyCommittedWarning(new Throwable(), "addCookie");
} else {
logger.logp(Level.FINE, CLASS_NAME,"addCookie", "Cannot set header. Response already committed.");
}
}
else {
_response.addCookie(cookie);
}
}
} | java | public void addCookie(Cookie cookie) {
//
// Note: this method is overwritten in servlet 4.0
//
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.logp(Level.FINE, CLASS_NAME,"addCookie", "Adding cookie --> " + cookie.getName(),"["+this+"]");
}
// d151464 - check the include flag
WebAppDispatcherContext dispatchContext = (WebAppDispatcherContext) getRequest().getWebAppDispatcherContext();
if (dispatchContext.isInclude() == true) {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) //306998.15
logger.logp(Level.FINE, CLASS_NAME,"addCookie", nls.getString("Illegal.from.included.servlet", "Illegal from included servlet"), "addCookie cookie --> " + cookie.getName()); //311717
}
else {
if (!_ignoreStateErrors && isCommitted()) {
// log a warning (only the first time)...ignore headers set after response is committed
IServletWrapper wrapper = dispatchContext.getCurrentServletReference();
if (logWarningActionNow(wrapper)) {
logAlreadyCommittedWarning(new Throwable(), "addCookie");
} else {
logger.logp(Level.FINE, CLASS_NAME,"addCookie", "Cannot set header. Response already committed.");
}
}
else {
_response.addCookie(cookie);
}
}
} | [
"public",
"void",
"addCookie",
"(",
"Cookie",
"cookie",
")",
"{",
"//",
"// Note: this method is overwritten in servlet 4.0",
"//",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"//306998.15",
"logger",
".",
"logp",
"(",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"\"addCookie\"",
",",
"\"Adding cookie --> \"",
"+",
"cookie",
".",
"getName",
"(",
")",
",",
"\"[\"",
"+",
"this",
"+",
"\"]\"",
")",
";",
"}",
"// d151464 - check the include flag",
"WebAppDispatcherContext",
"dispatchContext",
"=",
"(",
"WebAppDispatcherContext",
")",
"getRequest",
"(",
")",
".",
"getWebAppDispatcherContext",
"(",
")",
";",
"if",
"(",
"dispatchContext",
".",
"isInclude",
"(",
")",
"==",
"true",
")",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"//306998.15",
"logger",
".",
"logp",
"(",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"\"addCookie\"",
",",
"nls",
".",
"getString",
"(",
"\"Illegal.from.included.servlet\"",
",",
"\"Illegal from included servlet\"",
")",
",",
"\"addCookie cookie --> \"",
"+",
"cookie",
".",
"getName",
"(",
")",
")",
";",
"//311717",
"}",
"else",
"{",
"if",
"(",
"!",
"_ignoreStateErrors",
"&&",
"isCommitted",
"(",
")",
")",
"{",
"// log a warning (only the first time)...ignore headers set after response is committed",
"IServletWrapper",
"wrapper",
"=",
"dispatchContext",
".",
"getCurrentServletReference",
"(",
")",
";",
"if",
"(",
"logWarningActionNow",
"(",
"wrapper",
")",
")",
"{",
"logAlreadyCommittedWarning",
"(",
"new",
"Throwable",
"(",
")",
",",
"\"addCookie\"",
")",
";",
"}",
"else",
"{",
"logger",
".",
"logp",
"(",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"\"addCookie\"",
",",
"\"Cannot set header. Response already committed.\"",
")",
";",
"}",
"}",
"else",
"{",
"_response",
".",
"addCookie",
"(",
"cookie",
")",
";",
"}",
"}",
"}"
] | Uses the given HTTP response message to assign a new value to
a browser-specific cookie. Updates the response to restrict
caching of sensitive cookie-related data.
@param cookie The cookie to add. | [
"Uses",
"the",
"given",
"HTTP",
"response",
"message",
"to",
"assign",
"a",
"new",
"value",
"to",
"a",
"browser",
"-",
"specific",
"cookie",
".",
"Updates",
"the",
"response",
"to",
"restrict",
"caching",
"of",
"sensitive",
"cookie",
"-",
"related",
"data",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java#L903-L931 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java | SRTServletResponse.commit | synchronized protected void commit() {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {
logger.entering(CLASS_NAME,"commit","["+this+"] ,_headersWritten -->" + _headersWritten );
}
// begin 134537: part 2
// (!isCommitted())
if (!_headersWritten && !isCommitted()) // add check if headersWritten
{
// end 134537: part 2
addLocaleHeader();
// PQ59244 - disallow content length header if content is encoded
// LIBERTY
if (containsHeader(HEADER_CONTENT_ENCODING) && containsHeader(HEADER_CONTENT_LENGTH)) {
if (keepContentLength){
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {
logger.logp(Level.FINE, CLASS_NAME,"commit", "WebContainer custom property set to keep Content-Length header w/presence of Content-Encoding header");
}
}
else{
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.logp(Level.FINE, CLASS_NAME,"commit", "Content-Length header disallowed w/presence of Content-Encoding header");
}
removeHeader(HEADER_CONTENT_LENGTH);
}
}
WebContainer.notifyHttpServletResponseListenersPreHeaderCommit((HttpServletRequest) _connContext.getRequest(), this);
String scheme = this.getRequest().getScheme();
if(scheme!=null && scheme.equalsIgnoreCase("https")){
addSTSHeader();
}
_response.prepareHeadersForWrite();
// begin 134537: part 3
_headersWritten = true;
// end 134537: part 3
if(this._bufferedOut!= null && this._bufferedOut instanceof WCOutputStream){
HttpOutputStreamConnectWeb output = ((WCOutputStream) this._bufferedOut).getOutput();
output.setWebC_headersWritten(true);
String remoteUser = _connContext.getRequest().getRemoteUser();
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.logp(Level.FINE, CLASS_NAME, "commit", "Setting remote user : " + remoteUser);
}
//Set the remote user to the channel. This will first try to get the security remote user and then fall back on the channel
output.setWC_remoteUser(remoteUser);
(((WCOutputStream) this._bufferedOut).getOutput()).setWebC_headersWritten(true);
}
}
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.exiting(CLASS_NAME,"commit");
}
} | java | synchronized protected void commit() {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {
logger.entering(CLASS_NAME,"commit","["+this+"] ,_headersWritten -->" + _headersWritten );
}
// begin 134537: part 2
// (!isCommitted())
if (!_headersWritten && !isCommitted()) // add check if headersWritten
{
// end 134537: part 2
addLocaleHeader();
// PQ59244 - disallow content length header if content is encoded
// LIBERTY
if (containsHeader(HEADER_CONTENT_ENCODING) && containsHeader(HEADER_CONTENT_LENGTH)) {
if (keepContentLength){
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {
logger.logp(Level.FINE, CLASS_NAME,"commit", "WebContainer custom property set to keep Content-Length header w/presence of Content-Encoding header");
}
}
else{
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.logp(Level.FINE, CLASS_NAME,"commit", "Content-Length header disallowed w/presence of Content-Encoding header");
}
removeHeader(HEADER_CONTENT_LENGTH);
}
}
WebContainer.notifyHttpServletResponseListenersPreHeaderCommit((HttpServletRequest) _connContext.getRequest(), this);
String scheme = this.getRequest().getScheme();
if(scheme!=null && scheme.equalsIgnoreCase("https")){
addSTSHeader();
}
_response.prepareHeadersForWrite();
// begin 134537: part 3
_headersWritten = true;
// end 134537: part 3
if(this._bufferedOut!= null && this._bufferedOut instanceof WCOutputStream){
HttpOutputStreamConnectWeb output = ((WCOutputStream) this._bufferedOut).getOutput();
output.setWebC_headersWritten(true);
String remoteUser = _connContext.getRequest().getRemoteUser();
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.logp(Level.FINE, CLASS_NAME, "commit", "Setting remote user : " + remoteUser);
}
//Set the remote user to the channel. This will first try to get the security remote user and then fall back on the channel
output.setWC_remoteUser(remoteUser);
(((WCOutputStream) this._bufferedOut).getOutput()).setWebC_headersWritten(true);
}
}
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.exiting(CLASS_NAME,"commit");
}
} | [
"synchronized",
"protected",
"void",
"commit",
"(",
")",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"logger",
".",
"entering",
"(",
"CLASS_NAME",
",",
"\"commit\"",
",",
"\"[\"",
"+",
"this",
"+",
"\"] ,_headersWritten -->\"",
"+",
"_headersWritten",
")",
";",
"}",
"// begin 134537: part 2",
"// (!isCommitted())",
"if",
"(",
"!",
"_headersWritten",
"&&",
"!",
"isCommitted",
"(",
")",
")",
"// add check if headersWritten",
"{",
"// end 134537: part 2",
"addLocaleHeader",
"(",
")",
";",
"// PQ59244 - disallow content length header if content is encoded",
"// LIBERTY",
"if",
"(",
"containsHeader",
"(",
"HEADER_CONTENT_ENCODING",
")",
"&&",
"containsHeader",
"(",
"HEADER_CONTENT_LENGTH",
")",
")",
"{",
"if",
"(",
"keepContentLength",
")",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"logger",
".",
"logp",
"(",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"\"commit\"",
",",
"\"WebContainer custom property set to keep Content-Length header w/presence of Content-Encoding header\"",
")",
";",
"}",
"}",
"else",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"//306998.15",
"logger",
".",
"logp",
"(",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"\"commit\"",
",",
"\"Content-Length header disallowed w/presence of Content-Encoding header\"",
")",
";",
"}",
"removeHeader",
"(",
"HEADER_CONTENT_LENGTH",
")",
";",
"}",
"}",
"WebContainer",
".",
"notifyHttpServletResponseListenersPreHeaderCommit",
"(",
"(",
"HttpServletRequest",
")",
"_connContext",
".",
"getRequest",
"(",
")",
",",
"this",
")",
";",
"String",
"scheme",
"=",
"this",
".",
"getRequest",
"(",
")",
".",
"getScheme",
"(",
")",
";",
"if",
"(",
"scheme",
"!=",
"null",
"&&",
"scheme",
".",
"equalsIgnoreCase",
"(",
"\"https\"",
")",
")",
"{",
"addSTSHeader",
"(",
")",
";",
"}",
"_response",
".",
"prepareHeadersForWrite",
"(",
")",
";",
"// begin 134537: part 3",
"_headersWritten",
"=",
"true",
";",
"// end 134537: part 3",
"if",
"(",
"this",
".",
"_bufferedOut",
"!=",
"null",
"&&",
"this",
".",
"_bufferedOut",
"instanceof",
"WCOutputStream",
")",
"{",
"HttpOutputStreamConnectWeb",
"output",
"=",
"(",
"(",
"WCOutputStream",
")",
"this",
".",
"_bufferedOut",
")",
".",
"getOutput",
"(",
")",
";",
"output",
".",
"setWebC_headersWritten",
"(",
"true",
")",
";",
"String",
"remoteUser",
"=",
"_connContext",
".",
"getRequest",
"(",
")",
".",
"getRemoteUser",
"(",
")",
";",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"//306998.15",
"logger",
".",
"logp",
"(",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"\"commit\"",
",",
"\"Setting remote user : \"",
"+",
"remoteUser",
")",
";",
"}",
"//Set the remote user to the channel. This will first try to get the security remote user and then fall back on the channel",
"output",
".",
"setWC_remoteUser",
"(",
"remoteUser",
")",
";",
"(",
"(",
"(",
"WCOutputStream",
")",
"this",
".",
"_bufferedOut",
")",
".",
"getOutput",
"(",
")",
")",
".",
"setWebC_headersWritten",
"(",
"true",
")",
";",
"}",
"}",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"//306998.15",
"logger",
".",
"exiting",
"(",
"CLASS_NAME",
",",
"\"commit\"",
")",
";",
"}",
"}"
] | Commits the response by sending response codes and headers. A response may only be commited once. | [
"Commits",
"the",
"response",
"by",
"sending",
"response",
"codes",
"and",
"headers",
".",
"A",
"response",
"may",
"only",
"be",
"commited",
"once",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java#L936-L997 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java | SRTServletResponse.getCharacterEncoding | public String getCharacterEncoding() {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.entering(CLASS_NAME,"getCharacterEncoding","["+this+"]");
}
if (_encoding == null) {
setDefaultResponseEncoding();
}
// 311717
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.exiting(CLASS_NAME,"getCharacterEncoding", " encoding --> " + _encoding);
}
return _encoding;
} | java | public String getCharacterEncoding() {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.entering(CLASS_NAME,"getCharacterEncoding","["+this+"]");
}
if (_encoding == null) {
setDefaultResponseEncoding();
}
// 311717
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.exiting(CLASS_NAME,"getCharacterEncoding", " encoding --> " + _encoding);
}
return _encoding;
} | [
"public",
"String",
"getCharacterEncoding",
"(",
")",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"//306998.15",
"logger",
".",
"entering",
"(",
"CLASS_NAME",
",",
"\"getCharacterEncoding\"",
",",
"\"[\"",
"+",
"this",
"+",
"\"]\"",
")",
";",
"}",
"if",
"(",
"_encoding",
"==",
"null",
")",
"{",
"setDefaultResponseEncoding",
"(",
")",
";",
"}",
"// 311717",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"//306998.15",
"logger",
".",
"exiting",
"(",
"CLASS_NAME",
",",
"\"getCharacterEncoding\"",
",",
"\" encoding --> \"",
"+",
"_encoding",
")",
";",
"}",
"return",
"_encoding",
";",
"}"
] | Returns the character encoding used for writing text to the
body of this response. | [
"Returns",
"the",
"character",
"encoding",
"used",
"for",
"writing",
"text",
"to",
"the",
"body",
"of",
"this",
"response",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java#L1206-L1219 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java | SRTServletResponse.getCookies | public Cookie[] getCookies() {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.logp(Level.FINE, CLASS_NAME,"getCookies","["+this+"]");
}
return (_response.getCookies());
} | java | public Cookie[] getCookies() {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.logp(Level.FINE, CLASS_NAME,"getCookies","["+this+"]");
}
return (_response.getCookies());
} | [
"public",
"Cookie",
"[",
"]",
"getCookies",
"(",
")",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"//306998.15",
"logger",
".",
"logp",
"(",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"\"getCookies\"",
",",
"\"[\"",
"+",
"this",
"+",
"\"]\"",
")",
";",
"}",
"return",
"(",
"_response",
".",
"getCookies",
"(",
")",
")",
";",
"}"
] | Get the Cookies that have been set in this response. | [
"Get",
"the",
"Cookies",
"that",
"have",
"been",
"set",
"in",
"this",
"response",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java#L1282-L1287 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java | SRTServletResponse.sendError | public void sendError(int status) throws IOException {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.logp(Level.FINE, CLASS_NAME,"sendError", "error --> "+ String.valueOf(status),"["+this+"]");
}
Object[] args = { new Integer(status) };
sendError(status, MessageFormat.format(nls.getString("Error.reported.{0}", "Error reported: {0}"), args));
} | java | public void sendError(int status) throws IOException {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.logp(Level.FINE, CLASS_NAME,"sendError", "error --> "+ String.valueOf(status),"["+this+"]");
}
Object[] args = { new Integer(status) };
sendError(status, MessageFormat.format(nls.getString("Error.reported.{0}", "Error reported: {0}"), args));
} | [
"public",
"void",
"sendError",
"(",
"int",
"status",
")",
"throws",
"IOException",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"//306998.15",
"logger",
".",
"logp",
"(",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"\"sendError\"",
",",
"\"error --> \"",
"+",
"String",
".",
"valueOf",
"(",
"status",
")",
",",
"\"[\"",
"+",
"this",
"+",
"\"]\"",
")",
";",
"}",
"Object",
"[",
"]",
"args",
"=",
"{",
"new",
"Integer",
"(",
"status",
")",
"}",
";",
"sendError",
"(",
"status",
",",
"MessageFormat",
".",
"format",
"(",
"nls",
".",
"getString",
"(",
"\"Error.reported.{0}\"",
",",
"\"Error reported: {0}\"",
")",
",",
"args",
")",
")",
";",
"}"
] | Sends an error response to the client using the specified status
code and no default message.
@param sc The status code.
@exception IOException
If an I/O error has occurred. | [
"Sends",
"an",
"error",
"response",
"to",
"the",
"client",
"using",
"the",
"specified",
"status",
"code",
"and",
"no",
"default",
"message",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java#L1298-L1305 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java | SRTServletResponse.sendError | public void sendError(int status, String msg) throws IOException {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.entering(CLASS_NAME,"sendError", "status --> " + status + " " + msg + " ["+this+"]");
}
WebAppDispatcherContext dispatchContext = (WebAppDispatcherContext) getRequest().getWebAppDispatcherContext();
if (!WCCustomProperties.ALLOW_INCLUDE_SEND_ERROR&&dispatchContext.isInclude()) {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.logp(Level.FINE, CLASS_NAME,"sendError", nls.getString("Illegal.from.included.servlet", "Illegal from included servlet"), "sendError --> " + status + " with message --> " + msg); //311717
}
}
else {
dispatchContext.sendError(status, msg);
this.closeResponseOutput();
}
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.exiting(CLASS_NAME,"sendError");
}
} | java | public void sendError(int status, String msg) throws IOException {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.entering(CLASS_NAME,"sendError", "status --> " + status + " " + msg + " ["+this+"]");
}
WebAppDispatcherContext dispatchContext = (WebAppDispatcherContext) getRequest().getWebAppDispatcherContext();
if (!WCCustomProperties.ALLOW_INCLUDE_SEND_ERROR&&dispatchContext.isInclude()) {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.logp(Level.FINE, CLASS_NAME,"sendError", nls.getString("Illegal.from.included.servlet", "Illegal from included servlet"), "sendError --> " + status + " with message --> " + msg); //311717
}
}
else {
dispatchContext.sendError(status, msg);
this.closeResponseOutput();
}
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.exiting(CLASS_NAME,"sendError");
}
} | [
"public",
"void",
"sendError",
"(",
"int",
"status",
",",
"String",
"msg",
")",
"throws",
"IOException",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"//306998.15",
"logger",
".",
"entering",
"(",
"CLASS_NAME",
",",
"\"sendError\"",
",",
"\"status --> \"",
"+",
"status",
"+",
"\" \"",
"+",
"msg",
"+",
"\" [\"",
"+",
"this",
"+",
"\"]\"",
")",
";",
"}",
"WebAppDispatcherContext",
"dispatchContext",
"=",
"(",
"WebAppDispatcherContext",
")",
"getRequest",
"(",
")",
".",
"getWebAppDispatcherContext",
"(",
")",
";",
"if",
"(",
"!",
"WCCustomProperties",
".",
"ALLOW_INCLUDE_SEND_ERROR",
"&&",
"dispatchContext",
".",
"isInclude",
"(",
")",
")",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"//306998.15",
"logger",
".",
"logp",
"(",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"\"sendError\"",
",",
"nls",
".",
"getString",
"(",
"\"Illegal.from.included.servlet\"",
",",
"\"Illegal from included servlet\"",
")",
",",
"\"sendError --> \"",
"+",
"status",
"+",
"\" with message --> \"",
"+",
"msg",
")",
";",
"//311717",
"}",
"}",
"else",
"{",
"dispatchContext",
".",
"sendError",
"(",
"status",
",",
"msg",
")",
";",
"this",
".",
"closeResponseOutput",
"(",
")",
";",
"}",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"//306998.15",
"logger",
".",
"exiting",
"(",
"CLASS_NAME",
",",
"\"sendError\"",
")",
";",
"}",
"}"
] | Sends an error response to the client using the specified status code and detail message.
@param status the status code.
@param msg the detail message.
@exception IOException
If an I/O error has occurred. | [
"Sends",
"an",
"error",
"response",
"to",
"the",
"client",
"using",
"the",
"specified",
"status",
"code",
"and",
"detail",
"message",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java#L1316-L1336 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java | SRTServletResponse.setReason | public void setReason(String msg) {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.logp(Level.FINE, CLASS_NAME,"setReason", " message --> " + msg,"["+this+"]");
}
_response.setReason(msg);
} | java | public void setReason(String msg) {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.logp(Level.FINE, CLASS_NAME,"setReason", " message --> " + msg,"["+this+"]");
}
_response.setReason(msg);
} | [
"public",
"void",
"setReason",
"(",
"String",
"msg",
")",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"//306998.15",
"logger",
".",
"logp",
"(",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"\"setReason\"",
",",
"\" message --> \"",
"+",
"msg",
",",
"\"[\"",
"+",
"this",
"+",
"\"]\"",
")",
";",
"}",
"_response",
".",
"setReason",
"(",
"msg",
")",
";",
"}"
] | Sends an error response directly to the client using the specified status code and
detail message.
@param status the status code.
@param msg the detail message.
@exception IOException
If an I/O error has occurred. | [
"Sends",
"an",
"error",
"response",
"directly",
"to",
"the",
"client",
"using",
"the",
"specified",
"status",
"code",
"and",
"detail",
"message",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java#L1348-L1353 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java | SRTServletResponse.setContentLength | public void setContentLength(int len) {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.entering(CLASS_NAME,"setContentLength", "length --> " + String.valueOf(len) + " ["+this+"]");
}
// d151464 - check the include flag
WebAppDispatcherContext dispatchContext = (WebAppDispatcherContext) getRequest().getWebAppDispatcherContext();
if (dispatchContext.isInclude() == true) {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.logp(Level.FINE, CLASS_NAME,"setContentLength", nls.getString("Illegal.from.included.servlet", "Illegal from included servlet"), "setContentLength length --> " + String.valueOf(len)); //311717
}
}
else
{
if (_response!=null) {
if (!_response.isCommitted()) {
_response.setContentLength(len);
}
}
_contentLength = len;
// LIBERTY _bufferedOut.setLimit(_contentLength = len);
_bufferedWriter.setLimitLong(_contentLength);
//still want to try to set the header even if the response is committed to throw the warning
setIntHeader(HEADER_CONTENT_LENGTH, len);
}
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.exiting(CLASS_NAME,"setContentLength");
}
} | java | public void setContentLength(int len) {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.entering(CLASS_NAME,"setContentLength", "length --> " + String.valueOf(len) + " ["+this+"]");
}
// d151464 - check the include flag
WebAppDispatcherContext dispatchContext = (WebAppDispatcherContext) getRequest().getWebAppDispatcherContext();
if (dispatchContext.isInclude() == true) {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.logp(Level.FINE, CLASS_NAME,"setContentLength", nls.getString("Illegal.from.included.servlet", "Illegal from included servlet"), "setContentLength length --> " + String.valueOf(len)); //311717
}
}
else
{
if (_response!=null) {
if (!_response.isCommitted()) {
_response.setContentLength(len);
}
}
_contentLength = len;
// LIBERTY _bufferedOut.setLimit(_contentLength = len);
_bufferedWriter.setLimitLong(_contentLength);
//still want to try to set the header even if the response is committed to throw the warning
setIntHeader(HEADER_CONTENT_LENGTH, len);
}
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.exiting(CLASS_NAME,"setContentLength");
}
} | [
"public",
"void",
"setContentLength",
"(",
"int",
"len",
")",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"//306998.15",
"logger",
".",
"entering",
"(",
"CLASS_NAME",
",",
"\"setContentLength\"",
",",
"\"length --> \"",
"+",
"String",
".",
"valueOf",
"(",
"len",
")",
"+",
"\" [\"",
"+",
"this",
"+",
"\"]\"",
")",
";",
"}",
"// d151464 - check the include flag",
"WebAppDispatcherContext",
"dispatchContext",
"=",
"(",
"WebAppDispatcherContext",
")",
"getRequest",
"(",
")",
".",
"getWebAppDispatcherContext",
"(",
")",
";",
"if",
"(",
"dispatchContext",
".",
"isInclude",
"(",
")",
"==",
"true",
")",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"//306998.15",
"logger",
".",
"logp",
"(",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"\"setContentLength\"",
",",
"nls",
".",
"getString",
"(",
"\"Illegal.from.included.servlet\"",
",",
"\"Illegal from included servlet\"",
")",
",",
"\"setContentLength length --> \"",
"+",
"String",
".",
"valueOf",
"(",
"len",
")",
")",
";",
"//311717",
"}",
"}",
"else",
"{",
"if",
"(",
"_response",
"!=",
"null",
")",
"{",
"if",
"(",
"!",
"_response",
".",
"isCommitted",
"(",
")",
")",
"{",
"_response",
".",
"setContentLength",
"(",
"len",
")",
";",
"}",
"}",
"_contentLength",
"=",
"len",
";",
"// LIBERTY _bufferedOut.setLimit(_contentLength = len);",
"_bufferedWriter",
".",
"setLimitLong",
"(",
"_contentLength",
")",
";",
"//still want to try to set the header even if the response is committed to throw the warning",
"setIntHeader",
"(",
"HEADER_CONTENT_LENGTH",
",",
"len",
")",
";",
"}",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"//306998.15",
"logger",
".",
"exiting",
"(",
"CLASS_NAME",
",",
"\"setContentLength\"",
")",
";",
"}",
"}"
] | Defines the content length for this response. This call must be made only once.
Not setting the content length may cause significant performance degradation.
@param len The content length. | [
"Defines",
"the",
"content",
"length",
"for",
"this",
"response",
".",
"This",
"call",
"must",
"be",
"made",
"only",
"once",
".",
"Not",
"setting",
"the",
"content",
"length",
"may",
"cause",
"significant",
"performance",
"degradation",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java#L1436-L1464 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java | SRTServletResponse.setDateHeader | public void setDateHeader(String name, long t) {
// 311717
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.entering(CLASS_NAME,"setDateHeader", " name --> " + name + " value --> " + String.valueOf(t)+ " ["+this+"]");
}
// d151464 - check the include flag
WebAppDispatcherContext dispatchContext = (WebAppDispatcherContext) getRequest().getWebAppDispatcherContext();
if (dispatchContext.isInclude() == true) {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.logp(Level.FINE,CLASS_NAME,"setDateHeader", nls.getString("Illegal.from.included.servlet", "Illegal from included servlet")); //311717
}
}
else {
// d128646 - if we're not ignoring state errors and response is committed or closed, throw an exception
if (!_ignoreStateErrors && isCommitted()) {
// log a warning (only the first time)...ignore headers set after response is committed
IServletWrapper wrapper = dispatchContext.getCurrentServletReference();
if (logWarningActionNow(wrapper)) {
logAlreadyCommittedWarning(new Throwable(), "setDateHeader");
} else {
logger.logp(Level.FINE, CLASS_NAME,"setDateHeader", "Cannot set header. Response already committed.");
}
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.exiting(CLASS_NAME,"setDateHeader","Response already committed");
}
return;
}
// _header.setDateField(name, t);
_response.setDateHeader(name, t);
}
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.exiting(CLASS_NAME,"setDateHeader");
}
} | java | public void setDateHeader(String name, long t) {
// 311717
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.entering(CLASS_NAME,"setDateHeader", " name --> " + name + " value --> " + String.valueOf(t)+ " ["+this+"]");
}
// d151464 - check the include flag
WebAppDispatcherContext dispatchContext = (WebAppDispatcherContext) getRequest().getWebAppDispatcherContext();
if (dispatchContext.isInclude() == true) {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.logp(Level.FINE,CLASS_NAME,"setDateHeader", nls.getString("Illegal.from.included.servlet", "Illegal from included servlet")); //311717
}
}
else {
// d128646 - if we're not ignoring state errors and response is committed or closed, throw an exception
if (!_ignoreStateErrors && isCommitted()) {
// log a warning (only the first time)...ignore headers set after response is committed
IServletWrapper wrapper = dispatchContext.getCurrentServletReference();
if (logWarningActionNow(wrapper)) {
logAlreadyCommittedWarning(new Throwable(), "setDateHeader");
} else {
logger.logp(Level.FINE, CLASS_NAME,"setDateHeader", "Cannot set header. Response already committed.");
}
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.exiting(CLASS_NAME,"setDateHeader","Response already committed");
}
return;
}
// _header.setDateField(name, t);
_response.setDateHeader(name, t);
}
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.exiting(CLASS_NAME,"setDateHeader");
}
} | [
"public",
"void",
"setDateHeader",
"(",
"String",
"name",
",",
"long",
"t",
")",
"{",
"// 311717",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"//306998.15",
"logger",
".",
"entering",
"(",
"CLASS_NAME",
",",
"\"setDateHeader\"",
",",
"\" name --> \"",
"+",
"name",
"+",
"\" value --> \"",
"+",
"String",
".",
"valueOf",
"(",
"t",
")",
"+",
"\" [\"",
"+",
"this",
"+",
"\"]\"",
")",
";",
"}",
"// d151464 - check the include flag",
"WebAppDispatcherContext",
"dispatchContext",
"=",
"(",
"WebAppDispatcherContext",
")",
"getRequest",
"(",
")",
".",
"getWebAppDispatcherContext",
"(",
")",
";",
"if",
"(",
"dispatchContext",
".",
"isInclude",
"(",
")",
"==",
"true",
")",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"//306998.15",
"logger",
".",
"logp",
"(",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"\"setDateHeader\"",
",",
"nls",
".",
"getString",
"(",
"\"Illegal.from.included.servlet\"",
",",
"\"Illegal from included servlet\"",
")",
")",
";",
"//311717",
"}",
"}",
"else",
"{",
"// d128646 - if we're not ignoring state errors and response is committed or closed, throw an exception",
"if",
"(",
"!",
"_ignoreStateErrors",
"&&",
"isCommitted",
"(",
")",
")",
"{",
"// log a warning (only the first time)...ignore headers set after response is committed",
"IServletWrapper",
"wrapper",
"=",
"dispatchContext",
".",
"getCurrentServletReference",
"(",
")",
";",
"if",
"(",
"logWarningActionNow",
"(",
"wrapper",
")",
")",
"{",
"logAlreadyCommittedWarning",
"(",
"new",
"Throwable",
"(",
")",
",",
"\"setDateHeader\"",
")",
";",
"}",
"else",
"{",
"logger",
".",
"logp",
"(",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"\"setDateHeader\"",
",",
"\"Cannot set header. Response already committed.\"",
")",
";",
"}",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"//306998.15",
"logger",
".",
"exiting",
"(",
"CLASS_NAME",
",",
"\"setDateHeader\"",
",",
"\"Response already committed\"",
")",
";",
"}",
"return",
";",
"}",
"// _header.setDateField(name, t);",
"_response",
".",
"setDateHeader",
"(",
"name",
",",
"t",
")",
";",
"}",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"//306998.15",
"logger",
".",
"exiting",
"(",
"CLASS_NAME",
",",
"\"setDateHeader\"",
")",
";",
"}",
"}"
] | Adds a date header with the specified time. If this is called more than once,
the current value will replace the previous value.
@param name The header field name.
@param t The time in milliseconds since the epoch. | [
"Adds",
"a",
"date",
"header",
"with",
"the",
"specified",
"time",
".",
"If",
"this",
"is",
"called",
"more",
"than",
"once",
"the",
"current",
"value",
"will",
"replace",
"the",
"previous",
"value",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java#L1670-L1705 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java | SRTServletResponse.logWarningActionNow | protected boolean logWarningActionNow(IServletWrapper w) {
if (w instanceof IServletWrapperInternal) {
boolean firstTime = ((IServletWrapperInternal) w).hitWarningStatus();
return firstTime;
} else {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {
logger.logp(Level.FINE, CLASS_NAME,"logWarningActionNow","Not dealing with internal wrapper");
}
return true;
}
} | java | protected boolean logWarningActionNow(IServletWrapper w) {
if (w instanceof IServletWrapperInternal) {
boolean firstTime = ((IServletWrapperInternal) w).hitWarningStatus();
return firstTime;
} else {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {
logger.logp(Level.FINE, CLASS_NAME,"logWarningActionNow","Not dealing with internal wrapper");
}
return true;
}
} | [
"protected",
"boolean",
"logWarningActionNow",
"(",
"IServletWrapper",
"w",
")",
"{",
"if",
"(",
"w",
"instanceof",
"IServletWrapperInternal",
")",
"{",
"boolean",
"firstTime",
"=",
"(",
"(",
"IServletWrapperInternal",
")",
"w",
")",
".",
"hitWarningStatus",
"(",
")",
";",
"return",
"firstTime",
";",
"}",
"else",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"logger",
".",
"logp",
"(",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"\"logWarningActionNow\"",
",",
"\"Not dealing with internal wrapper\"",
")",
";",
"}",
"return",
"true",
";",
"}",
"}"
] | Do not sync for performance reasons. It is ok to print this warning more than once, just trying to limit it for the most part. | [
"Do",
"not",
"sync",
"for",
"performance",
"reasons",
".",
"It",
"is",
"ok",
"to",
"print",
"this",
"warning",
"more",
"than",
"once",
"just",
"trying",
"to",
"limit",
"it",
"for",
"the",
"most",
"part",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java#L1805-L1816 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java | SRTServletResponse.setInternalHeader | public void setInternalHeader(String name, String s) {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.logp(Level.FINE, CLASS_NAME,"setInternalHeader", " name --> " + name + " value --> " + s,"["+this+"]");
}
setHeader(name, s, false);
} | java | public void setInternalHeader(String name, String s) {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.logp(Level.FINE, CLASS_NAME,"setInternalHeader", " name --> " + name + " value --> " + s,"["+this+"]");
}
setHeader(name, s, false);
} | [
"public",
"void",
"setInternalHeader",
"(",
"String",
"name",
",",
"String",
"s",
")",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"//306998.15",
"logger",
".",
"logp",
"(",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"\"setInternalHeader\"",
",",
"\" name --> \"",
"+",
"name",
"+",
"\" value --> \"",
"+",
"s",
",",
"\"[\"",
"+",
"this",
"+",
"\"]\"",
")",
";",
"}",
"setHeader",
"(",
"name",
",",
"s",
",",
"false",
")",
";",
"}"
] | Adds a header field with the specified string value.
Does not check to see if this is an include. If this is
called more than once, the current value will replace the previous value.
@param name The header field name.
@param s The field's string value. | [
"Adds",
"a",
"header",
"field",
"with",
"the",
"specified",
"string",
"value",
".",
"Does",
"not",
"check",
"to",
"see",
"if",
"this",
"is",
"an",
"include",
".",
"If",
"this",
"is",
"called",
"more",
"than",
"once",
"the",
"current",
"value",
"will",
"replace",
"the",
"previous",
"value",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java#L1846-L1851 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java | SRTServletResponse.setStatus | public void setStatus(int status) {
// 311717
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.entering(CLASS_NAME,"setStatus", " status --> " + String.valueOf(status)+ " ["+this+"]");
}
WebAppDispatcherContext dispatchContext = (WebAppDispatcherContext) getRequest().getWebAppDispatcherContext();
if (dispatchContext.isInclude() == true) {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.logp(Level.FINE, CLASS_NAME,"setStatus", nls.getString("Illegal.from.included.servlet", "Illegal from included servlet"), "setStatus status --> " + String.valueOf(status)); //311717
}
}
else {
if (!_ignoreStateErrors && isCommitted()) {
logger.logp(Level.WARNING, CLASS_NAME,"setStatus", "Cannot.set.status.Response.already.committed");
}
else {
if (WCCustomProperties.RESET_BUFFER_ON_SET_STATUS)
resetBuffer();
_response.setStatusCode(status);
_statusCode = status;
}
}
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.exiting(CLASS_NAME,"setStatus");
}
} | java | public void setStatus(int status) {
// 311717
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.entering(CLASS_NAME,"setStatus", " status --> " + String.valueOf(status)+ " ["+this+"]");
}
WebAppDispatcherContext dispatchContext = (WebAppDispatcherContext) getRequest().getWebAppDispatcherContext();
if (dispatchContext.isInclude() == true) {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.logp(Level.FINE, CLASS_NAME,"setStatus", nls.getString("Illegal.from.included.servlet", "Illegal from included servlet"), "setStatus status --> " + String.valueOf(status)); //311717
}
}
else {
if (!_ignoreStateErrors && isCommitted()) {
logger.logp(Level.WARNING, CLASS_NAME,"setStatus", "Cannot.set.status.Response.already.committed");
}
else {
if (WCCustomProperties.RESET_BUFFER_ON_SET_STATUS)
resetBuffer();
_response.setStatusCode(status);
_statusCode = status;
}
}
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.exiting(CLASS_NAME,"setStatus");
}
} | [
"public",
"void",
"setStatus",
"(",
"int",
"status",
")",
"{",
"// 311717",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"//306998.15",
"logger",
".",
"entering",
"(",
"CLASS_NAME",
",",
"\"setStatus\"",
",",
"\" status --> \"",
"+",
"String",
".",
"valueOf",
"(",
"status",
")",
"+",
"\" [\"",
"+",
"this",
"+",
"\"]\"",
")",
";",
"}",
"WebAppDispatcherContext",
"dispatchContext",
"=",
"(",
"WebAppDispatcherContext",
")",
"getRequest",
"(",
")",
".",
"getWebAppDispatcherContext",
"(",
")",
";",
"if",
"(",
"dispatchContext",
".",
"isInclude",
"(",
")",
"==",
"true",
")",
"{",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"//306998.15",
"logger",
".",
"logp",
"(",
"Level",
".",
"FINE",
",",
"CLASS_NAME",
",",
"\"setStatus\"",
",",
"nls",
".",
"getString",
"(",
"\"Illegal.from.included.servlet\"",
",",
"\"Illegal from included servlet\"",
")",
",",
"\"setStatus status --> \"",
"+",
"String",
".",
"valueOf",
"(",
"status",
")",
")",
";",
"//311717",
"}",
"}",
"else",
"{",
"if",
"(",
"!",
"_ignoreStateErrors",
"&&",
"isCommitted",
"(",
")",
")",
"{",
"logger",
".",
"logp",
"(",
"Level",
".",
"WARNING",
",",
"CLASS_NAME",
",",
"\"setStatus\"",
",",
"\"Cannot.set.status.Response.already.committed\"",
")",
";",
"}",
"else",
"{",
"if",
"(",
"WCCustomProperties",
".",
"RESET_BUFFER_ON_SET_STATUS",
")",
"resetBuffer",
"(",
")",
";",
"_response",
".",
"setStatusCode",
"(",
"status",
")",
";",
"_statusCode",
"=",
"status",
";",
"}",
"}",
"if",
"(",
"com",
".",
"ibm",
".",
"ejs",
".",
"ras",
".",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"//306998.15",
"logger",
".",
"exiting",
"(",
"CLASS_NAME",
",",
"\"setStatus\"",
")",
";",
"}",
"}"
] | Sets the status code and a default message for this response.
@param status The status code. | [
"Sets",
"the",
"status",
"code",
"and",
"a",
"default",
"message",
"for",
"this",
"response",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/SRTServletResponse.java#L1984-L2009 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/transactions/impl/XidManager.java | XidManager.start | public TransactionParticipant start(PersistentTranId ptid, int flags) throws XidUnknownException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "start", new Object[]{"PersistentTranId="+ptid, xaFlagsToString(flags)});
TransactionParticipant retval = null;
if ((flags & XAResource.TMJOIN) != 0)
{
// Find the existing branch in the associated
// and return it so that the XAResource can
// associate with it.
retval = _associatedTrans.get(ptid);
if (retval == null)
{
XidUnknownException xue = new XidUnknownException("XID_NOT_RECOGNISED_SIMS1007", new Object[]{"start(XID,TMJOIN)", ptid.toTMString()});
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Cannot JOIN with this Xid. It has not previously been started!", xue);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start");
throw xue;
}
}
else if ((flags & XAResource.TMRESUME) != 0)
{
// Defect 455354
// We need to make sure that any changes to the association
// lists occur under a lock.
synchronized(_associationLock)
{
// Find the existing branch in the suspended
// list and move it to the associated list.
retval = _suspendedTrans.remove(ptid);
if (retval == null)
{
XidUnknownException xue = new XidUnknownException("XID_NOT_RECOGNISED_SIMS1007", new Object[]{"start(XID,TMRESUME)", ptid.toTMString()});
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Cannot RESUME this Xid. It has not previously been SUSPENDED!", xue);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start");
throw xue;
}
else
{
_associatedTrans.put(ptid, retval);
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start", "return="+retval);
return retval;
} | java | public TransactionParticipant start(PersistentTranId ptid, int flags) throws XidUnknownException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "start", new Object[]{"PersistentTranId="+ptid, xaFlagsToString(flags)});
TransactionParticipant retval = null;
if ((flags & XAResource.TMJOIN) != 0)
{
// Find the existing branch in the associated
// and return it so that the XAResource can
// associate with it.
retval = _associatedTrans.get(ptid);
if (retval == null)
{
XidUnknownException xue = new XidUnknownException("XID_NOT_RECOGNISED_SIMS1007", new Object[]{"start(XID,TMJOIN)", ptid.toTMString()});
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Cannot JOIN with this Xid. It has not previously been started!", xue);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start");
throw xue;
}
}
else if ((flags & XAResource.TMRESUME) != 0)
{
// Defect 455354
// We need to make sure that any changes to the association
// lists occur under a lock.
synchronized(_associationLock)
{
// Find the existing branch in the suspended
// list and move it to the associated list.
retval = _suspendedTrans.remove(ptid);
if (retval == null)
{
XidUnknownException xue = new XidUnknownException("XID_NOT_RECOGNISED_SIMS1007", new Object[]{"start(XID,TMRESUME)", ptid.toTMString()});
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Cannot RESUME this Xid. It has not previously been SUSPENDED!", xue);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start");
throw xue;
}
else
{
_associatedTrans.put(ptid, retval);
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start", "return="+retval);
return retval;
} | [
"public",
"TransactionParticipant",
"start",
"(",
"PersistentTranId",
"ptid",
",",
"int",
"flags",
")",
"throws",
"XidUnknownException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"start\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"PersistentTranId=\"",
"+",
"ptid",
",",
"xaFlagsToString",
"(",
"flags",
")",
"}",
")",
";",
"TransactionParticipant",
"retval",
"=",
"null",
";",
"if",
"(",
"(",
"flags",
"&",
"XAResource",
".",
"TMJOIN",
")",
"!=",
"0",
")",
"{",
"// Find the existing branch in the associated",
"// and return it so that the XAResource can",
"// associate with it.",
"retval",
"=",
"_associatedTrans",
".",
"get",
"(",
"ptid",
")",
";",
"if",
"(",
"retval",
"==",
"null",
")",
"{",
"XidUnknownException",
"xue",
"=",
"new",
"XidUnknownException",
"(",
"\"XID_NOT_RECOGNISED_SIMS1007\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"start(XID,TMJOIN)\"",
",",
"ptid",
".",
"toTMString",
"(",
")",
"}",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"SibTr",
".",
"event",
"(",
"this",
",",
"tc",
",",
"\"Cannot JOIN with this Xid. It has not previously been started!\"",
",",
"xue",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"start\"",
")",
";",
"throw",
"xue",
";",
"}",
"}",
"else",
"if",
"(",
"(",
"flags",
"&",
"XAResource",
".",
"TMRESUME",
")",
"!=",
"0",
")",
"{",
"// Defect 455354",
"// We need to make sure that any changes to the association",
"// lists occur under a lock.",
"synchronized",
"(",
"_associationLock",
")",
"{",
"// Find the existing branch in the suspended",
"// list and move it to the associated list.",
"retval",
"=",
"_suspendedTrans",
".",
"remove",
"(",
"ptid",
")",
";",
"if",
"(",
"retval",
"==",
"null",
")",
"{",
"XidUnknownException",
"xue",
"=",
"new",
"XidUnknownException",
"(",
"\"XID_NOT_RECOGNISED_SIMS1007\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"start(XID,TMRESUME)\"",
",",
"ptid",
".",
"toTMString",
"(",
")",
"}",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"SibTr",
".",
"event",
"(",
"this",
",",
"tc",
",",
"\"Cannot RESUME this Xid. It has not previously been SUSPENDED!\"",
",",
"xue",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"start\"",
")",
";",
"throw",
"xue",
";",
"}",
"else",
"{",
"_associatedTrans",
".",
"put",
"(",
"ptid",
",",
"retval",
")",
";",
"}",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"start\"",
",",
"\"return=\"",
"+",
"retval",
")",
";",
"return",
"retval",
";",
"}"
] | using either the TMJOIN or TMRESUME flags. | [
"using",
"either",
"the",
"TMJOIN",
"or",
"TMRESUME",
"flags",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/transactions/impl/XidManager.java#L92-L140 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/transactions/impl/XidManager.java | XidManager.start | public void start(PersistentTranId ptid, TransactionParticipant participant) throws XidAlreadyKnownException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "start", new Object[]{"PersistentTranId="+ptid, "Participant="+participant});
// Defect 455354
// We need to make sure that any changes to the association
// lists occur under a lock.
//
// We also need to check the _unassociatedTrans and _suspendedTrans lists
// to make sure that we aren't being asked to start a new branch using an
// Xid that is still running or in the process of being completed.
synchronized(_associationLock)
{
if (!_associatedTrans.containsKey(ptid) &&
!_unassociatedTrans.containsKey(ptid) &&
!_suspendedTrans.containsKey(ptid))
{
_associatedTrans.put(ptid, participant);
}
else
{
XidAlreadyKnownException xake = new XidAlreadyKnownException("XID_ALREADY_ASSOCIATED_SIMS1009", new Object[]{"start(XID,TMNOFLAGS)", ptid.toTMString()});
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Cannot start new association with this Xid. It is already known!", xake);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start");
throw xake;
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start");
} | java | public void start(PersistentTranId ptid, TransactionParticipant participant) throws XidAlreadyKnownException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "start", new Object[]{"PersistentTranId="+ptid, "Participant="+participant});
// Defect 455354
// We need to make sure that any changes to the association
// lists occur under a lock.
//
// We also need to check the _unassociatedTrans and _suspendedTrans lists
// to make sure that we aren't being asked to start a new branch using an
// Xid that is still running or in the process of being completed.
synchronized(_associationLock)
{
if (!_associatedTrans.containsKey(ptid) &&
!_unassociatedTrans.containsKey(ptid) &&
!_suspendedTrans.containsKey(ptid))
{
_associatedTrans.put(ptid, participant);
}
else
{
XidAlreadyKnownException xake = new XidAlreadyKnownException("XID_ALREADY_ASSOCIATED_SIMS1009", new Object[]{"start(XID,TMNOFLAGS)", ptid.toTMString()});
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Cannot start new association with this Xid. It is already known!", xake);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start");
throw xake;
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "start");
} | [
"public",
"void",
"start",
"(",
"PersistentTranId",
"ptid",
",",
"TransactionParticipant",
"participant",
")",
"throws",
"XidAlreadyKnownException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"start\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"PersistentTranId=\"",
"+",
"ptid",
",",
"\"Participant=\"",
"+",
"participant",
"}",
")",
";",
"// Defect 455354",
"// We need to make sure that any changes to the association",
"// lists occur under a lock.",
"//",
"// We also need to check the _unassociatedTrans and _suspendedTrans lists",
"// to make sure that we aren't being asked to start a new branch using an",
"// Xid that is still running or in the process of being completed.",
"synchronized",
"(",
"_associationLock",
")",
"{",
"if",
"(",
"!",
"_associatedTrans",
".",
"containsKey",
"(",
"ptid",
")",
"&&",
"!",
"_unassociatedTrans",
".",
"containsKey",
"(",
"ptid",
")",
"&&",
"!",
"_suspendedTrans",
".",
"containsKey",
"(",
"ptid",
")",
")",
"{",
"_associatedTrans",
".",
"put",
"(",
"ptid",
",",
"participant",
")",
";",
"}",
"else",
"{",
"XidAlreadyKnownException",
"xake",
"=",
"new",
"XidAlreadyKnownException",
"(",
"\"XID_ALREADY_ASSOCIATED_SIMS1009\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"start(XID,TMNOFLAGS)\"",
",",
"ptid",
".",
"toTMString",
"(",
")",
"}",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"SibTr",
".",
"event",
"(",
"this",
",",
"tc",
",",
"\"Cannot start new association with this Xid. It is already known!\"",
",",
"xake",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"start\"",
")",
";",
"throw",
"xake",
";",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"start\"",
")",
";",
"}"
] | with a NEW transaction branch. | [
"with",
"a",
"NEW",
"transaction",
"branch",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/transactions/impl/XidManager.java#L144-L173 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/transactions/impl/XidManager.java | XidManager.end | public void end(PersistentTranId ptid, int flags) throws XidUnknownException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "end", new Object[]{"PersistentTranId="+ptid, xaFlagsToString(flags)});
// Defect 455354
// We need to make sure that any changes to the association
// lists occur under a lock.
synchronized(_associationLock)
{
TransactionParticipant tran = _associatedTrans.remove(ptid);
if (tran != null)
{
// If we are suspending then we need to store the
// tran in a different list so that it can be
// resumed later.
if ((flags & XAResource.TMSUSPEND) != 0)
{
_suspendedTrans.put(ptid, tran);
}
else
{
_unassociatedTrans.put(ptid, tran);
}
}
else
{
// Feature SIB0048c.ms.1
// The JTA spec also allows end(TMSUCCESS) on XIDs that
// have previously been suspended so we need to check the
// suspended list if the XID supplied is not currently
// associated.
if (_suspendedTrans.containsKey(ptid))
{
// If the flags are TMSUCCESS or TMFAIL then we can move this
// XID to the unassociated list as it is now ready for
// completion. Otherwise we assume the flags are TMSUSPEND
if (((flags & XAResource.TMSUCCESS) != 0) || ((flags & XAResource.TMFAIL) != 0))
{
tran = _suspendedTrans.remove(ptid);
_unassociatedTrans.put(ptid, tran);
}
}
else
{
// Defect 373006.3
// If the Xid is in the unassociated list then we can assume
// this is a duplicate end from a TMJOIN case. This at least
// allows us to maintain better error checking for a
// completely unknown Xid.
if (!_unassociatedTrans.containsKey(ptid))
{
XidUnknownException xue = new XidUnknownException("XID_NOT_RECOGNISED_SIMS1007", new Object[]{"end(XID)", ptid.toTMString()});
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Cannot disassociate from this Xid. It is not currently associated!", xue);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "end");
throw xue;
}
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "end");
} | java | public void end(PersistentTranId ptid, int flags) throws XidUnknownException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "end", new Object[]{"PersistentTranId="+ptid, xaFlagsToString(flags)});
// Defect 455354
// We need to make sure that any changes to the association
// lists occur under a lock.
synchronized(_associationLock)
{
TransactionParticipant tran = _associatedTrans.remove(ptid);
if (tran != null)
{
// If we are suspending then we need to store the
// tran in a different list so that it can be
// resumed later.
if ((flags & XAResource.TMSUSPEND) != 0)
{
_suspendedTrans.put(ptid, tran);
}
else
{
_unassociatedTrans.put(ptid, tran);
}
}
else
{
// Feature SIB0048c.ms.1
// The JTA spec also allows end(TMSUCCESS) on XIDs that
// have previously been suspended so we need to check the
// suspended list if the XID supplied is not currently
// associated.
if (_suspendedTrans.containsKey(ptid))
{
// If the flags are TMSUCCESS or TMFAIL then we can move this
// XID to the unassociated list as it is now ready for
// completion. Otherwise we assume the flags are TMSUSPEND
if (((flags & XAResource.TMSUCCESS) != 0) || ((flags & XAResource.TMFAIL) != 0))
{
tran = _suspendedTrans.remove(ptid);
_unassociatedTrans.put(ptid, tran);
}
}
else
{
// Defect 373006.3
// If the Xid is in the unassociated list then we can assume
// this is a duplicate end from a TMJOIN case. This at least
// allows us to maintain better error checking for a
// completely unknown Xid.
if (!_unassociatedTrans.containsKey(ptid))
{
XidUnknownException xue = new XidUnknownException("XID_NOT_RECOGNISED_SIMS1007", new Object[]{"end(XID)", ptid.toTMString()});
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Cannot disassociate from this Xid. It is not currently associated!", xue);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "end");
throw xue;
}
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "end");
} | [
"public",
"void",
"end",
"(",
"PersistentTranId",
"ptid",
",",
"int",
"flags",
")",
"throws",
"XidUnknownException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"end\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"PersistentTranId=\"",
"+",
"ptid",
",",
"xaFlagsToString",
"(",
"flags",
")",
"}",
")",
";",
"// Defect 455354",
"// We need to make sure that any changes to the association",
"// lists occur under a lock.",
"synchronized",
"(",
"_associationLock",
")",
"{",
"TransactionParticipant",
"tran",
"=",
"_associatedTrans",
".",
"remove",
"(",
"ptid",
")",
";",
"if",
"(",
"tran",
"!=",
"null",
")",
"{",
"// If we are suspending then we need to store the",
"// tran in a different list so that it can be",
"// resumed later.",
"if",
"(",
"(",
"flags",
"&",
"XAResource",
".",
"TMSUSPEND",
")",
"!=",
"0",
")",
"{",
"_suspendedTrans",
".",
"put",
"(",
"ptid",
",",
"tran",
")",
";",
"}",
"else",
"{",
"_unassociatedTrans",
".",
"put",
"(",
"ptid",
",",
"tran",
")",
";",
"}",
"}",
"else",
"{",
"// Feature SIB0048c.ms.1",
"// The JTA spec also allows end(TMSUCCESS) on XIDs that",
"// have previously been suspended so we need to check the",
"// suspended list if the XID supplied is not currently",
"// associated.",
"if",
"(",
"_suspendedTrans",
".",
"containsKey",
"(",
"ptid",
")",
")",
"{",
"// If the flags are TMSUCCESS or TMFAIL then we can move this",
"// XID to the unassociated list as it is now ready for",
"// completion. Otherwise we assume the flags are TMSUSPEND",
"if",
"(",
"(",
"(",
"flags",
"&",
"XAResource",
".",
"TMSUCCESS",
")",
"!=",
"0",
")",
"||",
"(",
"(",
"flags",
"&",
"XAResource",
".",
"TMFAIL",
")",
"!=",
"0",
")",
")",
"{",
"tran",
"=",
"_suspendedTrans",
".",
"remove",
"(",
"ptid",
")",
";",
"_unassociatedTrans",
".",
"put",
"(",
"ptid",
",",
"tran",
")",
";",
"}",
"}",
"else",
"{",
"// Defect 373006.3",
"// If the Xid is in the unassociated list then we can assume",
"// this is a duplicate end from a TMJOIN case. This at least",
"// allows us to maintain better error checking for a",
"// completely unknown Xid.",
"if",
"(",
"!",
"_unassociatedTrans",
".",
"containsKey",
"(",
"ptid",
")",
")",
"{",
"XidUnknownException",
"xue",
"=",
"new",
"XidUnknownException",
"(",
"\"XID_NOT_RECOGNISED_SIMS1007\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"end(XID)\"",
",",
"ptid",
".",
"toTMString",
"(",
")",
"}",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"SibTr",
".",
"event",
"(",
"this",
",",
"tc",
",",
"\"Cannot disassociate from this Xid. It is not currently associated!\"",
",",
"xue",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"end\"",
")",
";",
"throw",
"xue",
";",
"}",
"}",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"end\"",
")",
";",
"}"
] | later point. | [
"later",
"point",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/transactions/impl/XidManager.java#L179-L242 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/transactions/impl/XidManager.java | XidManager.restart | public void restart(PersistentMessageStore PM) throws TransactionException, SevereMessageStoreException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "restart", "PersistenceManager="+PM);
if (PM != null)
{
// We need to store the PM so that we can call
// it during transaction completion.
if (PM instanceof PersistenceManager)
{
_persistence = (PersistenceManager)PM;
}
else
{
// We don't have a valid PersistenceManager so we
// are up the spout. Need to fall over in a big heap.
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "No PersistenceManager provided at startup. MessageStore cannot continue!");
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "restart");
throw new SevereMessageStoreException("UNRECOVERABLE_ERROR_SIMS1499", new Object[]{});
}
// We need to read our indoubt xid list in preperation
// for a call from the transaction manager at recovery
// time.
try
{
List list = PM.readIndoubtXIDs();
Iterator iterator = list.iterator();
while (iterator.hasNext())
{
PersistentTranId ptid = (PersistentTranId)iterator.next();
_indoubtXids.add(ptid);
synchronized(_associationLock)
{
_unassociatedTrans.put(ptid, new XidParticipant(_ms, ptid, _persistence, 0, TransactionState.STATE_PREPARED));
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Indoubt Transaction Re-instated from database: "+ptid);
}
}
catch (PersistenceException pe)
{
com.ibm.ws.ffdc.FFDCFilter.processException(pe, "com.ibm.ws.sib.msgstore.transactions.XidManager.restart", "1:516:1.62");
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Persistence exception caught reading indoubt transactions from database!", pe);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "restart");
throw new TransactionException("UNEXPECTED_EXCEPTION_SIMS1099", new Object[]{pe}, pe);
}
}
else
{
// We don't have a valid PersistenceManager so we
// are up the spout. Need to fall over in a big heap.
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "PersistenceManager is null. MessageStore cannot continue!");
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "restart");
throw new SevereMessageStoreException("UNRECOVERABLE_ERROR_SIMS1499", new Object[]{});
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "restart");
} | java | public void restart(PersistentMessageStore PM) throws TransactionException, SevereMessageStoreException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "restart", "PersistenceManager="+PM);
if (PM != null)
{
// We need to store the PM so that we can call
// it during transaction completion.
if (PM instanceof PersistenceManager)
{
_persistence = (PersistenceManager)PM;
}
else
{
// We don't have a valid PersistenceManager so we
// are up the spout. Need to fall over in a big heap.
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "No PersistenceManager provided at startup. MessageStore cannot continue!");
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "restart");
throw new SevereMessageStoreException("UNRECOVERABLE_ERROR_SIMS1499", new Object[]{});
}
// We need to read our indoubt xid list in preperation
// for a call from the transaction manager at recovery
// time.
try
{
List list = PM.readIndoubtXIDs();
Iterator iterator = list.iterator();
while (iterator.hasNext())
{
PersistentTranId ptid = (PersistentTranId)iterator.next();
_indoubtXids.add(ptid);
synchronized(_associationLock)
{
_unassociatedTrans.put(ptid, new XidParticipant(_ms, ptid, _persistence, 0, TransactionState.STATE_PREPARED));
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Indoubt Transaction Re-instated from database: "+ptid);
}
}
catch (PersistenceException pe)
{
com.ibm.ws.ffdc.FFDCFilter.processException(pe, "com.ibm.ws.sib.msgstore.transactions.XidManager.restart", "1:516:1.62");
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Persistence exception caught reading indoubt transactions from database!", pe);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "restart");
throw new TransactionException("UNEXPECTED_EXCEPTION_SIMS1099", new Object[]{pe}, pe);
}
}
else
{
// We don't have a valid PersistenceManager so we
// are up the spout. Need to fall over in a big heap.
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "PersistenceManager is null. MessageStore cannot continue!");
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "restart");
throw new SevereMessageStoreException("UNRECOVERABLE_ERROR_SIMS1499", new Object[]{});
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "restart");
} | [
"public",
"void",
"restart",
"(",
"PersistentMessageStore",
"PM",
")",
"throws",
"TransactionException",
",",
"SevereMessageStoreException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"restart\"",
",",
"\"PersistenceManager=\"",
"+",
"PM",
")",
";",
"if",
"(",
"PM",
"!=",
"null",
")",
"{",
"// We need to store the PM so that we can call",
"// it during transaction completion.",
"if",
"(",
"PM",
"instanceof",
"PersistenceManager",
")",
"{",
"_persistence",
"=",
"(",
"PersistenceManager",
")",
"PM",
";",
"}",
"else",
"{",
"// We don't have a valid PersistenceManager so we",
"// are up the spout. Need to fall over in a big heap.",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"SibTr",
".",
"event",
"(",
"this",
",",
"tc",
",",
"\"No PersistenceManager provided at startup. MessageStore cannot continue!\"",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"restart\"",
")",
";",
"throw",
"new",
"SevereMessageStoreException",
"(",
"\"UNRECOVERABLE_ERROR_SIMS1499\"",
",",
"new",
"Object",
"[",
"]",
"{",
"}",
")",
";",
"}",
"// We need to read our indoubt xid list in preperation",
"// for a call from the transaction manager at recovery",
"// time.",
"try",
"{",
"List",
"list",
"=",
"PM",
".",
"readIndoubtXIDs",
"(",
")",
";",
"Iterator",
"iterator",
"=",
"list",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"iterator",
".",
"hasNext",
"(",
")",
")",
"{",
"PersistentTranId",
"ptid",
"=",
"(",
"PersistentTranId",
")",
"iterator",
".",
"next",
"(",
")",
";",
"_indoubtXids",
".",
"add",
"(",
"ptid",
")",
";",
"synchronized",
"(",
"_associationLock",
")",
"{",
"_unassociatedTrans",
".",
"put",
"(",
"ptid",
",",
"new",
"XidParticipant",
"(",
"_ms",
",",
"ptid",
",",
"_persistence",
",",
"0",
",",
"TransactionState",
".",
"STATE_PREPARED",
")",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"Indoubt Transaction Re-instated from database: \"",
"+",
"ptid",
")",
";",
"}",
"}",
"catch",
"(",
"PersistenceException",
"pe",
")",
"{",
"com",
".",
"ibm",
".",
"ws",
".",
"ffdc",
".",
"FFDCFilter",
".",
"processException",
"(",
"pe",
",",
"\"com.ibm.ws.sib.msgstore.transactions.XidManager.restart\"",
",",
"\"1:516:1.62\"",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"SibTr",
".",
"event",
"(",
"this",
",",
"tc",
",",
"\"Persistence exception caught reading indoubt transactions from database!\"",
",",
"pe",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"restart\"",
")",
";",
"throw",
"new",
"TransactionException",
"(",
"\"UNEXPECTED_EXCEPTION_SIMS1099\"",
",",
"new",
"Object",
"[",
"]",
"{",
"pe",
"}",
",",
"pe",
")",
";",
"}",
"}",
"else",
"{",
"// We don't have a valid PersistenceManager so we",
"// are up the spout. Need to fall over in a big heap.",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"SibTr",
".",
"event",
"(",
"this",
",",
"tc",
",",
"\"PersistenceManager is null. MessageStore cannot continue!\"",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"restart\"",
")",
";",
"throw",
"new",
"SevereMessageStoreException",
"(",
"\"UNRECOVERABLE_ERROR_SIMS1499\"",
",",
"new",
"Object",
"[",
"]",
"{",
"}",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"restart\"",
")",
";",
"}"
] | Called at server startup to rebuild our list of indoubt
transactions from the datastore.
@param PM The PersistentMessageStore to use to access our datastore.
@exception TransactionException
Thrown if any unexpected exceptions occur.
@throws SevereMessageStoreException | [
"Called",
"at",
"server",
"startup",
"to",
"rebuild",
"our",
"list",
"of",
"indoubt",
"transactions",
"from",
"the",
"datastore",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/transactions/impl/XidManager.java#L441-L503 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/transactions/impl/XidManager.java | XidManager.recover | public Xid[] recover()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "recover");
Xid[] xids = new Xid[_indoubtXids.size()];
_indoubtXids.toArray(xids);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "recover", "return="+Arrays.toString(xids)+", size="+xids.length);
return xids;
} | java | public Xid[] recover()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "recover");
Xid[] xids = new Xid[_indoubtXids.size()];
_indoubtXids.toArray(xids);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "recover", "return="+Arrays.toString(xids)+", size="+xids.length);
return xids;
} | [
"public",
"Xid",
"[",
"]",
"recover",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"recover\"",
")",
";",
"Xid",
"[",
"]",
"xids",
"=",
"new",
"Xid",
"[",
"_indoubtXids",
".",
"size",
"(",
")",
"]",
";",
"_indoubtXids",
".",
"toArray",
"(",
"xids",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"recover\"",
",",
"\"return=\"",
"+",
"Arrays",
".",
"toString",
"(",
"xids",
")",
"+",
"\", size=\"",
"+",
"xids",
".",
"length",
")",
";",
"return",
"xids",
";",
"}"
] | This method returns the list of indoubt Xids that the MessageStore
knows about at the time. This includes those recovered from the
datastore at restart time and any that are currently known about
as part of normal runtime processing.
@return The list of prepared Xids known to the MessageStore at the
time the method was called. | [
"This",
"method",
"returns",
"the",
"list",
"of",
"indoubt",
"Xids",
"that",
"the",
"MessageStore",
"knows",
"about",
"at",
"the",
"time",
".",
"This",
"includes",
"those",
"recovered",
"from",
"the",
"datastore",
"at",
"restart",
"time",
"and",
"any",
"that",
"are",
"currently",
"known",
"about",
"as",
"part",
"of",
"normal",
"runtime",
"processing",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/transactions/impl/XidManager.java#L515-L525 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/transactions/impl/XidManager.java | XidManager.listRemoteInDoubts | public Xid[] listRemoteInDoubts()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "listRemoteInDoubts");
Vector<PersistentTranId> xids = (Vector<PersistentTranId>)_indoubtXids.clone();
Xid[] retval = null;
if (xids.size() > 0)
{
retval = new Xid[xids.size()];
xids.toArray(retval);
}
else
{
// The ME doesn't know of any indoubt xids at
// this moment in time.
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "There are currently no in-doubt transaction branches within the ME.");
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "listRemoteInDoubts", "return="+retval);
return retval;
} | java | public Xid[] listRemoteInDoubts()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "listRemoteInDoubts");
Vector<PersistentTranId> xids = (Vector<PersistentTranId>)_indoubtXids.clone();
Xid[] retval = null;
if (xids.size() > 0)
{
retval = new Xid[xids.size()];
xids.toArray(retval);
}
else
{
// The ME doesn't know of any indoubt xids at
// this moment in time.
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "There are currently no in-doubt transaction branches within the ME.");
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "listRemoteInDoubts", "return="+retval);
return retval;
} | [
"public",
"Xid",
"[",
"]",
"listRemoteInDoubts",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"listRemoteInDoubts\"",
")",
";",
"Vector",
"<",
"PersistentTranId",
">",
"xids",
"=",
"(",
"Vector",
"<",
"PersistentTranId",
">",
")",
"_indoubtXids",
".",
"clone",
"(",
")",
";",
"Xid",
"[",
"]",
"retval",
"=",
"null",
";",
"if",
"(",
"xids",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"retval",
"=",
"new",
"Xid",
"[",
"xids",
".",
"size",
"(",
")",
"]",
";",
"xids",
".",
"toArray",
"(",
"retval",
")",
";",
"}",
"else",
"{",
"// The ME doesn't know of any indoubt xids at",
"// this moment in time.",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"There are currently no in-doubt transaction branches within the ME.\"",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"listRemoteInDoubts\"",
",",
"\"return=\"",
"+",
"retval",
")",
";",
"return",
"retval",
";",
"}"
] | This method returns a list representing all Xid known by the ME which do
not match those currently known by the local Transaction Manager. The
admin console can therefore use the output of this method to display a
list of xids that can be completed through the ME admin console.
@return The list of xids that the admin console should display. | [
"This",
"method",
"returns",
"a",
"list",
"representing",
"all",
"Xid",
"known",
"by",
"the",
"ME",
"which",
"do",
"not",
"match",
"those",
"currently",
"known",
"by",
"the",
"local",
"Transaction",
"Manager",
".",
"The",
"admin",
"console",
"can",
"therefore",
"use",
"the",
"output",
"of",
"this",
"method",
"to",
"display",
"a",
"list",
"of",
"xids",
"that",
"can",
"be",
"completed",
"through",
"the",
"ME",
"admin",
"console",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/transactions/impl/XidManager.java#L564-L586 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/transactions/impl/XidManager.java | XidManager.xaFlagsToString | public String xaFlagsToString(int flags)
{
StringBuilder retval = new StringBuilder("Flags=");
retval.append(Integer.toHexString(flags));
retval.append("( ");
if (flags == XAResource.TMNOFLAGS)
{
retval.append("TMNOFLAGS ");
}
else
{
if ((flags & XAResource.TMENDRSCAN) != 0) retval.append("TMENDRSCAN ");
if ((flags & XAResource.TMFAIL) != 0) retval.append("TMFAIL ");
if ((flags & XAResource.TMJOIN) != 0) retval.append("TMJOIN ");
if ((flags & XAResource.TMONEPHASE) != 0) retval.append("TMONEPHASE ");
if ((flags & XAResource.TMRESUME) != 0) retval.append("TMRESUME ");
if ((flags & XAResource.TMSTARTRSCAN) != 0) retval.append("TMSTARTRSCAN ");
if ((flags & XAResource.TMSUCCESS) != 0) retval.append("TMSUCCESS ");
if ((flags & XAResource.TMSUSPEND) != 0) retval.append("TMSUSPEND ");
}
retval.append(")");
return retval.toString();
} | java | public String xaFlagsToString(int flags)
{
StringBuilder retval = new StringBuilder("Flags=");
retval.append(Integer.toHexString(flags));
retval.append("( ");
if (flags == XAResource.TMNOFLAGS)
{
retval.append("TMNOFLAGS ");
}
else
{
if ((flags & XAResource.TMENDRSCAN) != 0) retval.append("TMENDRSCAN ");
if ((flags & XAResource.TMFAIL) != 0) retval.append("TMFAIL ");
if ((flags & XAResource.TMJOIN) != 0) retval.append("TMJOIN ");
if ((flags & XAResource.TMONEPHASE) != 0) retval.append("TMONEPHASE ");
if ((flags & XAResource.TMRESUME) != 0) retval.append("TMRESUME ");
if ((flags & XAResource.TMSTARTRSCAN) != 0) retval.append("TMSTARTRSCAN ");
if ((flags & XAResource.TMSUCCESS) != 0) retval.append("TMSUCCESS ");
if ((flags & XAResource.TMSUSPEND) != 0) retval.append("TMSUSPEND ");
}
retval.append(")");
return retval.toString();
} | [
"public",
"String",
"xaFlagsToString",
"(",
"int",
"flags",
")",
"{",
"StringBuilder",
"retval",
"=",
"new",
"StringBuilder",
"(",
"\"Flags=\"",
")",
";",
"retval",
".",
"append",
"(",
"Integer",
".",
"toHexString",
"(",
"flags",
")",
")",
";",
"retval",
".",
"append",
"(",
"\"( \"",
")",
";",
"if",
"(",
"flags",
"==",
"XAResource",
".",
"TMNOFLAGS",
")",
"{",
"retval",
".",
"append",
"(",
"\"TMNOFLAGS \"",
")",
";",
"}",
"else",
"{",
"if",
"(",
"(",
"flags",
"&",
"XAResource",
".",
"TMENDRSCAN",
")",
"!=",
"0",
")",
"retval",
".",
"append",
"(",
"\"TMENDRSCAN \"",
")",
";",
"if",
"(",
"(",
"flags",
"&",
"XAResource",
".",
"TMFAIL",
")",
"!=",
"0",
")",
"retval",
".",
"append",
"(",
"\"TMFAIL \"",
")",
";",
"if",
"(",
"(",
"flags",
"&",
"XAResource",
".",
"TMJOIN",
")",
"!=",
"0",
")",
"retval",
".",
"append",
"(",
"\"TMJOIN \"",
")",
";",
"if",
"(",
"(",
"flags",
"&",
"XAResource",
".",
"TMONEPHASE",
")",
"!=",
"0",
")",
"retval",
".",
"append",
"(",
"\"TMONEPHASE \"",
")",
";",
"if",
"(",
"(",
"flags",
"&",
"XAResource",
".",
"TMRESUME",
")",
"!=",
"0",
")",
"retval",
".",
"append",
"(",
"\"TMRESUME \"",
")",
";",
"if",
"(",
"(",
"flags",
"&",
"XAResource",
".",
"TMSTARTRSCAN",
")",
"!=",
"0",
")",
"retval",
".",
"append",
"(",
"\"TMSTARTRSCAN \"",
")",
";",
"if",
"(",
"(",
"flags",
"&",
"XAResource",
".",
"TMSUCCESS",
")",
"!=",
"0",
")",
"retval",
".",
"append",
"(",
"\"TMSUCCESS \"",
")",
";",
"if",
"(",
"(",
"flags",
"&",
"XAResource",
".",
"TMSUSPEND",
")",
"!=",
"0",
")",
"retval",
".",
"append",
"(",
"\"TMSUSPEND \"",
")",
";",
"}",
"retval",
".",
"append",
"(",
"\")\"",
")",
";",
"return",
"retval",
".",
"toString",
"(",
")",
";",
"}"
] | Feature SIB0048c.ms.1 | [
"Feature",
"SIB0048c",
".",
"ms",
".",
"1"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/transactions/impl/XidManager.java#L654-L678 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/PositionAssignerImpl.java | PositionAssignerImpl.assign | public void assign(Identifier id)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
tc.entry(
cclass,
"assign",
"identifier: " + id);
// Assign ordinal position
String key = null;
switch (id.getType())
{
case Identifier.STRING :
// Changed from using the Identifier name to using the full name under defect 504438. The full name is only
// relevant in the XPath Selector Domain and incorporates the full path for the attribute or element referenced.
// This is necessary so that we are able to distinguish between common names at the same depth in an XML
// document. For example you might encounter 2 XPath expressions:
//
// /company/department[@name='test'] and /company/location[@name='London']
//
// We must ensure that the system can distinguish these attributes.
//
key = "S:" + id.getFullName();
break;
case Identifier.BOOLEAN :
key = "B:" + id.getFullName();
break;
case Identifier.CHILD :
key = "C:" + id.getFullName();
break;
case Identifier.TOPIC:
key = "T:" + id.getFullName();
break;
case Identifier.UNKNOWN :
case Identifier.OBJECT :
key = "U:" + id.getFullName();
break;
default :
key = "N:" + id.getFullName();
}
// Get the map for the specified level. The level is only relevant in the XPath Selector Domain. It represents the
// level of a location step in an XPath expression
Integer level = new Integer(id.getStep());
LevelEntry positions = (LevelEntry) levels.get(level);
if (positions == null)
{
positions = new LevelEntry();
levels.put(level, positions);
}
int levelPos = 0;
if (key != null)
{
levelPos = positions.getPosition(key);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
tc.debug(this,cclass, "assign", "level: " + level + ", levelPos: " + Integer.valueOf(levelPos) + ", for key: " + key);
// Now we're ready to set the OrdinalPosition
OrdinalPosition ordPos = new OrdinalPosition(level.intValue(), levelPos);
id.setOrdinalPosition(ordPos);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
tc.exit(this,cclass, "assign");
} | java | public void assign(Identifier id)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
tc.entry(
cclass,
"assign",
"identifier: " + id);
// Assign ordinal position
String key = null;
switch (id.getType())
{
case Identifier.STRING :
// Changed from using the Identifier name to using the full name under defect 504438. The full name is only
// relevant in the XPath Selector Domain and incorporates the full path for the attribute or element referenced.
// This is necessary so that we are able to distinguish between common names at the same depth in an XML
// document. For example you might encounter 2 XPath expressions:
//
// /company/department[@name='test'] and /company/location[@name='London']
//
// We must ensure that the system can distinguish these attributes.
//
key = "S:" + id.getFullName();
break;
case Identifier.BOOLEAN :
key = "B:" + id.getFullName();
break;
case Identifier.CHILD :
key = "C:" + id.getFullName();
break;
case Identifier.TOPIC:
key = "T:" + id.getFullName();
break;
case Identifier.UNKNOWN :
case Identifier.OBJECT :
key = "U:" + id.getFullName();
break;
default :
key = "N:" + id.getFullName();
}
// Get the map for the specified level. The level is only relevant in the XPath Selector Domain. It represents the
// level of a location step in an XPath expression
Integer level = new Integer(id.getStep());
LevelEntry positions = (LevelEntry) levels.get(level);
if (positions == null)
{
positions = new LevelEntry();
levels.put(level, positions);
}
int levelPos = 0;
if (key != null)
{
levelPos = positions.getPosition(key);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
tc.debug(this,cclass, "assign", "level: " + level + ", levelPos: " + Integer.valueOf(levelPos) + ", for key: " + key);
// Now we're ready to set the OrdinalPosition
OrdinalPosition ordPos = new OrdinalPosition(level.intValue(), levelPos);
id.setOrdinalPosition(ordPos);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
tc.exit(this,cclass, "assign");
} | [
"public",
"void",
"assign",
"(",
"Identifier",
"id",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"tc",
".",
"entry",
"(",
"cclass",
",",
"\"assign\"",
",",
"\"identifier: \"",
"+",
"id",
")",
";",
"// Assign ordinal position",
"String",
"key",
"=",
"null",
";",
"switch",
"(",
"id",
".",
"getType",
"(",
")",
")",
"{",
"case",
"Identifier",
".",
"STRING",
":",
"// Changed from using the Identifier name to using the full name under defect 504438. The full name is only",
"// relevant in the XPath Selector Domain and incorporates the full path for the attribute or element referenced.",
"// This is necessary so that we are able to distinguish between common names at the same depth in an XML",
"// document. For example you might encounter 2 XPath expressions:",
"//",
"// /company/department[@name='test'] and /company/location[@name='London']",
"//",
"// We must ensure that the system can distinguish these attributes.",
"//",
"key",
"=",
"\"S:\"",
"+",
"id",
".",
"getFullName",
"(",
")",
";",
"break",
";",
"case",
"Identifier",
".",
"BOOLEAN",
":",
"key",
"=",
"\"B:\"",
"+",
"id",
".",
"getFullName",
"(",
")",
";",
"break",
";",
"case",
"Identifier",
".",
"CHILD",
":",
"key",
"=",
"\"C:\"",
"+",
"id",
".",
"getFullName",
"(",
")",
";",
"break",
";",
"case",
"Identifier",
".",
"TOPIC",
":",
"key",
"=",
"\"T:\"",
"+",
"id",
".",
"getFullName",
"(",
")",
";",
"break",
";",
"case",
"Identifier",
".",
"UNKNOWN",
":",
"case",
"Identifier",
".",
"OBJECT",
":",
"key",
"=",
"\"U:\"",
"+",
"id",
".",
"getFullName",
"(",
")",
";",
"break",
";",
"default",
":",
"key",
"=",
"\"N:\"",
"+",
"id",
".",
"getFullName",
"(",
")",
";",
"}",
"// Get the map for the specified level. The level is only relevant in the XPath Selector Domain. It represents the",
"// level of a location step in an XPath expression",
"Integer",
"level",
"=",
"new",
"Integer",
"(",
"id",
".",
"getStep",
"(",
")",
")",
";",
"LevelEntry",
"positions",
"=",
"(",
"LevelEntry",
")",
"levels",
".",
"get",
"(",
"level",
")",
";",
"if",
"(",
"positions",
"==",
"null",
")",
"{",
"positions",
"=",
"new",
"LevelEntry",
"(",
")",
";",
"levels",
".",
"put",
"(",
"level",
",",
"positions",
")",
";",
"}",
"int",
"levelPos",
"=",
"0",
";",
"if",
"(",
"key",
"!=",
"null",
")",
"{",
"levelPos",
"=",
"positions",
".",
"getPosition",
"(",
"key",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"tc",
".",
"debug",
"(",
"this",
",",
"cclass",
",",
"\"assign\"",
",",
"\"level: \"",
"+",
"level",
"+",
"\", levelPos: \"",
"+",
"Integer",
".",
"valueOf",
"(",
"levelPos",
")",
"+",
"\", for key: \"",
"+",
"key",
")",
";",
"// Now we're ready to set the OrdinalPosition",
"OrdinalPosition",
"ordPos",
"=",
"new",
"OrdinalPosition",
"(",
"level",
".",
"intValue",
"(",
")",
",",
"levelPos",
")",
";",
"id",
".",
"setOrdinalPosition",
"(",
"ordPos",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"tc",
".",
"exit",
"(",
"this",
",",
"cclass",
",",
"\"assign\"",
")",
";",
"}"
] | Implement the assignPosition method | [
"Implement",
"the",
"assignPosition",
"method"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/selector/impl/PositionAssignerImpl.java#L72-L138 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.injection/src/com/ibm/ws/injectionengine/osgi/util/OSGiJNDIEnvironmentRefBindingHelper.java | OSGiJNDIEnvironmentRefBindingHelper.processBndAndExt | public static void processBndAndExt(Map<JNDIEnvironmentRefType, Map<String, String>> allBindings,
Map<String, String> envEntryValues,
ResourceRefConfigList resRefList,
RefBindingsGroup refBindingsGroup,
List<com.ibm.ws.javaee.dd.commonext.ResourceRef> resRefExts) {
RefBndAndExtHelper.configureEJBRefBindings(refBindingsGroup, allBindings.get(JNDIEnvironmentRefType.EJBRef));
RefBndAndExtHelper.configureMessageDestinationRefBindings(refBindingsGroup, allBindings.get(JNDIEnvironmentRefType.MessageDestinationRef));
RefBndAndExtHelper.configureResourceRefBindings(refBindingsGroup, allBindings.get(JNDIEnvironmentRefType.ResourceRef), resRefList);
if (resRefExts != null) {
RefBndAndExtHelper.configureResourceRefExtensions(resRefExts, resRefList);
}
RefBndAndExtHelper.configureResourceEnvRefBindings(refBindingsGroup, allBindings.get(JNDIEnvironmentRefType.ResourceEnvRef));
RefBndAndExtHelper.configureEnvEntryBindings(refBindingsGroup, envEntryValues, allBindings.get(JNDIEnvironmentRefType.EnvEntry));
RefBndAndExtHelper.configureDataSourceBindings(refBindingsGroup, allBindings.get(JNDIEnvironmentRefType.DataSource));
} | java | public static void processBndAndExt(Map<JNDIEnvironmentRefType, Map<String, String>> allBindings,
Map<String, String> envEntryValues,
ResourceRefConfigList resRefList,
RefBindingsGroup refBindingsGroup,
List<com.ibm.ws.javaee.dd.commonext.ResourceRef> resRefExts) {
RefBndAndExtHelper.configureEJBRefBindings(refBindingsGroup, allBindings.get(JNDIEnvironmentRefType.EJBRef));
RefBndAndExtHelper.configureMessageDestinationRefBindings(refBindingsGroup, allBindings.get(JNDIEnvironmentRefType.MessageDestinationRef));
RefBndAndExtHelper.configureResourceRefBindings(refBindingsGroup, allBindings.get(JNDIEnvironmentRefType.ResourceRef), resRefList);
if (resRefExts != null) {
RefBndAndExtHelper.configureResourceRefExtensions(resRefExts, resRefList);
}
RefBndAndExtHelper.configureResourceEnvRefBindings(refBindingsGroup, allBindings.get(JNDIEnvironmentRefType.ResourceEnvRef));
RefBndAndExtHelper.configureEnvEntryBindings(refBindingsGroup, envEntryValues, allBindings.get(JNDIEnvironmentRefType.EnvEntry));
RefBndAndExtHelper.configureDataSourceBindings(refBindingsGroup, allBindings.get(JNDIEnvironmentRefType.DataSource));
} | [
"public",
"static",
"void",
"processBndAndExt",
"(",
"Map",
"<",
"JNDIEnvironmentRefType",
",",
"Map",
"<",
"String",
",",
"String",
">",
">",
"allBindings",
",",
"Map",
"<",
"String",
",",
"String",
">",
"envEntryValues",
",",
"ResourceRefConfigList",
"resRefList",
",",
"RefBindingsGroup",
"refBindingsGroup",
",",
"List",
"<",
"com",
".",
"ibm",
".",
"ws",
".",
"javaee",
".",
"dd",
".",
"commonext",
".",
"ResourceRef",
">",
"resRefExts",
")",
"{",
"RefBndAndExtHelper",
".",
"configureEJBRefBindings",
"(",
"refBindingsGroup",
",",
"allBindings",
".",
"get",
"(",
"JNDIEnvironmentRefType",
".",
"EJBRef",
")",
")",
";",
"RefBndAndExtHelper",
".",
"configureMessageDestinationRefBindings",
"(",
"refBindingsGroup",
",",
"allBindings",
".",
"get",
"(",
"JNDIEnvironmentRefType",
".",
"MessageDestinationRef",
")",
")",
";",
"RefBndAndExtHelper",
".",
"configureResourceRefBindings",
"(",
"refBindingsGroup",
",",
"allBindings",
".",
"get",
"(",
"JNDIEnvironmentRefType",
".",
"ResourceRef",
")",
",",
"resRefList",
")",
";",
"if",
"(",
"resRefExts",
"!=",
"null",
")",
"{",
"RefBndAndExtHelper",
".",
"configureResourceRefExtensions",
"(",
"resRefExts",
",",
"resRefList",
")",
";",
"}",
"RefBndAndExtHelper",
".",
"configureResourceEnvRefBindings",
"(",
"refBindingsGroup",
",",
"allBindings",
".",
"get",
"(",
"JNDIEnvironmentRefType",
".",
"ResourceEnvRef",
")",
")",
";",
"RefBndAndExtHelper",
".",
"configureEnvEntryBindings",
"(",
"refBindingsGroup",
",",
"envEntryValues",
",",
"allBindings",
".",
"get",
"(",
"JNDIEnvironmentRefType",
".",
"EnvEntry",
")",
")",
";",
"RefBndAndExtHelper",
".",
"configureDataSourceBindings",
"(",
"refBindingsGroup",
",",
"allBindings",
".",
"get",
"(",
"JNDIEnvironmentRefType",
".",
"DataSource",
")",
")",
";",
"}"
] | Process bindings and extensions for all JNDIEnvironmentRef. This method
can be called multiple times with different source objects.
@param allBindings the map of all bindings to update
@param envEntryValues the env-entry value bindings map to update
@param resRefList the resource-ref binding and extension list to update
@param refBindingsGroup the source binding data
@param resRefExts the source extension data | [
"Process",
"bindings",
"and",
"extensions",
"for",
"all",
"JNDIEnvironmentRef",
".",
"This",
"method",
"can",
"be",
"called",
"multiple",
"times",
"with",
"different",
"source",
"objects",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.injection/src/com/ibm/ws/injectionengine/osgi/util/OSGiJNDIEnvironmentRefBindingHelper.java#L33-L47 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/StaticCATConsumer.java | StaticCATConsumer.rcvStartSess | static void rcvStartSess(CommsByteBuffer request, Conversation conversation, int requestNumber,
boolean allocatedFromBufferPool, boolean partOfExchange, boolean restart) //471642
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "rcvStartSess",
new Object[]
{
request,
conversation,
requestNumber,
allocatedFromBufferPool,
restart //471642
});
short connectionObjectID = request.getShort(); // BIT16 ConnectionObjectId
short consumerObjectID = request.getShort(); // BIT16 SyncConsumerSessionId
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
SibTr.debug(tc, "connectionObjectID", connectionObjectID);
SibTr.debug(tc, "consumerObjectID", consumerObjectID);
}
CATMainConsumer mainConsumer =
((CATMainConsumer) ((ConversationState) conversation.getAttachment()).getObject(consumerObjectID));
mainConsumer.start(requestNumber, true, partOfExchange, null, restart); //471642
request.release(allocatedFromBufferPool);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "rcvStartSess");
} | java | static void rcvStartSess(CommsByteBuffer request, Conversation conversation, int requestNumber,
boolean allocatedFromBufferPool, boolean partOfExchange, boolean restart) //471642
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "rcvStartSess",
new Object[]
{
request,
conversation,
requestNumber,
allocatedFromBufferPool,
restart //471642
});
short connectionObjectID = request.getShort(); // BIT16 ConnectionObjectId
short consumerObjectID = request.getShort(); // BIT16 SyncConsumerSessionId
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
SibTr.debug(tc, "connectionObjectID", connectionObjectID);
SibTr.debug(tc, "consumerObjectID", consumerObjectID);
}
CATMainConsumer mainConsumer =
((CATMainConsumer) ((ConversationState) conversation.getAttachment()).getObject(consumerObjectID));
mainConsumer.start(requestNumber, true, partOfExchange, null, restart); //471642
request.release(allocatedFromBufferPool);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "rcvStartSess");
} | [
"static",
"void",
"rcvStartSess",
"(",
"CommsByteBuffer",
"request",
",",
"Conversation",
"conversation",
",",
"int",
"requestNumber",
",",
"boolean",
"allocatedFromBufferPool",
",",
"boolean",
"partOfExchange",
",",
"boolean",
"restart",
")",
"//471642",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"rcvStartSess\"",
",",
"new",
"Object",
"[",
"]",
"{",
"request",
",",
"conversation",
",",
"requestNumber",
",",
"allocatedFromBufferPool",
",",
"restart",
"//471642",
"}",
")",
";",
"short",
"connectionObjectID",
"=",
"request",
".",
"getShort",
"(",
")",
";",
"// BIT16 ConnectionObjectId",
"short",
"consumerObjectID",
"=",
"request",
".",
"getShort",
"(",
")",
";",
"// BIT16 SyncConsumerSessionId",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"connectionObjectID\"",
",",
"connectionObjectID",
")",
";",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"consumerObjectID\"",
",",
"consumerObjectID",
")",
";",
"}",
"CATMainConsumer",
"mainConsumer",
"=",
"(",
"(",
"CATMainConsumer",
")",
"(",
"(",
"ConversationState",
")",
"conversation",
".",
"getAttachment",
"(",
")",
")",
".",
"getObject",
"(",
"consumerObjectID",
")",
")",
";",
"mainConsumer",
".",
"start",
"(",
"requestNumber",
",",
"true",
",",
"partOfExchange",
",",
"null",
",",
"restart",
")",
";",
"//471642",
"request",
".",
"release",
"(",
"allocatedFromBufferPool",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"rcvStartSess\"",
")",
";",
"}"
] | Start the Synchronous Consumer Session provided by the client.
Fields:
BIT16 ConnectionObjectId
BIT16 SyncConsumerSessionId
@param request
@param conversation
@param requestNumber
@param allocatedFromBufferPool
@param partOfExchange
@param restart indicates (re)start rather than start | [
"Start",
"the",
"Synchronous",
"Consumer",
"Session",
"provided",
"by",
"the",
"client",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/StaticCATConsumer.java#L395-L427 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/StaticCATConsumer.java | StaticCATConsumer.rcvStopSess | static void rcvStopSess(CommsByteBuffer request, Conversation conversation, int requestNumber,
boolean allocatedFromBufferPool, boolean partOfExchange)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "rcvStopSess",
new Object[]
{
request,
conversation,
"" + requestNumber,
"" + allocatedFromBufferPool
});
short connectionObjectID = request.getShort(); // BIT16 ConnectionObjectId
short consumerObjectID = request.getShort(); // BIT16 SyncConsumerSessionId
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
SibTr.debug(tc, "connectionObjectID", connectionObjectID);
SibTr.debug(tc, "consumerObjectID", consumerObjectID);
}
CATMainConsumer mainConsumer =
((CATMainConsumer) ((ConversationState) conversation.getAttachment()).getObject(consumerObjectID));
mainConsumer.stop(requestNumber);
request.release(allocatedFromBufferPool);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "rcvStopSess");
} | java | static void rcvStopSess(CommsByteBuffer request, Conversation conversation, int requestNumber,
boolean allocatedFromBufferPool, boolean partOfExchange)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "rcvStopSess",
new Object[]
{
request,
conversation,
"" + requestNumber,
"" + allocatedFromBufferPool
});
short connectionObjectID = request.getShort(); // BIT16 ConnectionObjectId
short consumerObjectID = request.getShort(); // BIT16 SyncConsumerSessionId
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
SibTr.debug(tc, "connectionObjectID", connectionObjectID);
SibTr.debug(tc, "consumerObjectID", consumerObjectID);
}
CATMainConsumer mainConsumer =
((CATMainConsumer) ((ConversationState) conversation.getAttachment()).getObject(consumerObjectID));
mainConsumer.stop(requestNumber);
request.release(allocatedFromBufferPool);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "rcvStopSess");
} | [
"static",
"void",
"rcvStopSess",
"(",
"CommsByteBuffer",
"request",
",",
"Conversation",
"conversation",
",",
"int",
"requestNumber",
",",
"boolean",
"allocatedFromBufferPool",
",",
"boolean",
"partOfExchange",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"rcvStopSess\"",
",",
"new",
"Object",
"[",
"]",
"{",
"request",
",",
"conversation",
",",
"\"\"",
"+",
"requestNumber",
",",
"\"\"",
"+",
"allocatedFromBufferPool",
"}",
")",
";",
"short",
"connectionObjectID",
"=",
"request",
".",
"getShort",
"(",
")",
";",
"// BIT16 ConnectionObjectId",
"short",
"consumerObjectID",
"=",
"request",
".",
"getShort",
"(",
")",
";",
"// BIT16 SyncConsumerSessionId",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"connectionObjectID\"",
",",
"connectionObjectID",
")",
";",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"consumerObjectID\"",
",",
"consumerObjectID",
")",
";",
"}",
"CATMainConsumer",
"mainConsumer",
"=",
"(",
"(",
"CATMainConsumer",
")",
"(",
"(",
"ConversationState",
")",
"conversation",
".",
"getAttachment",
"(",
")",
")",
".",
"getObject",
"(",
"consumerObjectID",
")",
")",
";",
"mainConsumer",
".",
"stop",
"(",
"requestNumber",
")",
";",
"request",
".",
"release",
"(",
"allocatedFromBufferPool",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"rcvStopSess\"",
")",
";",
"}"
] | Stop the Synchronous Consumer Session provided by the client.
Fields:
BIT16 ConnectionObjectId
BIT16 SyncConsumerSessionId
Note: The client reply is done by the CAT consumer instance
@param request
@param conversation
@param requestNumber
@param allocatedFromBufferPool
@param partOfExchange | [
"Stop",
"the",
"Synchronous",
"Consumer",
"Session",
"provided",
"by",
"the",
"client",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/StaticCATConsumer.java#L445-L476 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/StaticCATConsumer.java | StaticCATConsumer.rcvRegisterAsyncConsumer | static void rcvRegisterAsyncConsumer(CommsByteBuffer request, Conversation conversation,
int requestNumber, boolean allocatedFromBufferPool,
boolean partOfExchange, boolean stoppable) //SIB0115d.comms
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "rcvRegisterAsyncConsumer",
new Object[]
{
request,
conversation,
requestNumber,
allocatedFromBufferPool,
stoppable //SIB0115d.comms
});
short connectionObjectId = request.getShort(); // BIT16 ConnectionObjectId
short consumerObjectId = request.getShort(); // BIT16 SyncConsumerSessionId
short orderContextId = request.getShort(); // BIT16 OrderContextId
short clientSessionId = request.getShort(); // BIT16 ClientSessionId
int maxActiveMessages = request.getInt(); // BIT32 Max active messages
long messageLockExpiry = request.getLong(); // BIT64 Message lock expiry
int maxBatchSize = request.getInt(); // BIT32 Maximum batch size
int maxSequentialFailures = 0; // BIT32 Max Sequental Failures SIB0115d.comms
long hiddenMessageDelay = 0; // BIT64 hidden message delay
// If stoppable get the maxSequentialFailures value
if (stoppable) { //SIB0115d.comms
maxSequentialFailures = request.getInt(); //SIB0115d.comms
hiddenMessageDelay = request.getLong();
} //SIB0115d.comms
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
SibTr.debug(tc, "connectionObjectID=" + connectionObjectId);
SibTr.debug(tc, "consumerObjectID=" + consumerObjectId);
SibTr.debug(tc, "orderContextID=" + orderContextId);
SibTr.debug(tc, "clientSessionID=" + clientSessionId);
SibTr.debug(tc, "maxActiveMessages=" + maxActiveMessages);
SibTr.debug(tc, "messageLockExpiry=" + messageLockExpiry);
SibTr.debug(tc, "maxBatchSize=" + maxBatchSize);
SibTr.debug(tc, "maxSequentialFailures=" + maxSequentialFailures); //SIB0115d.comms
SibTr.debug(tc, "hiddenMesageDelay=" + hiddenMessageDelay);
}
ConversationState convState = (ConversationState) conversation.getAttachment();
CATMainConsumer mainConsumer = ((CATMainConsumer) convState.getObject(consumerObjectId));
OrderingContext orderContext = null;
// Get the message order context if there was one passed up
if (orderContextId != CommsConstants.NO_ORDER_CONTEXT)
{
orderContext = ((CATOrderingContext) convState.getObject(orderContextId)).getOrderingContext(); // F201521
}
mainConsumer.setClientSessionId(clientSessionId);
mainConsumer.setAsynchConsumerCallback(requestNumber,
maxActiveMessages,
messageLockExpiry,
maxBatchSize,
orderContext,
stoppable, //SIB0115d.comms
maxSequentialFailures,
hiddenMessageDelay); //SIB0115d.comms
request.release(allocatedFromBufferPool);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "rcvRegisterAsyncConsumer");
} | java | static void rcvRegisterAsyncConsumer(CommsByteBuffer request, Conversation conversation,
int requestNumber, boolean allocatedFromBufferPool,
boolean partOfExchange, boolean stoppable) //SIB0115d.comms
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "rcvRegisterAsyncConsumer",
new Object[]
{
request,
conversation,
requestNumber,
allocatedFromBufferPool,
stoppable //SIB0115d.comms
});
short connectionObjectId = request.getShort(); // BIT16 ConnectionObjectId
short consumerObjectId = request.getShort(); // BIT16 SyncConsumerSessionId
short orderContextId = request.getShort(); // BIT16 OrderContextId
short clientSessionId = request.getShort(); // BIT16 ClientSessionId
int maxActiveMessages = request.getInt(); // BIT32 Max active messages
long messageLockExpiry = request.getLong(); // BIT64 Message lock expiry
int maxBatchSize = request.getInt(); // BIT32 Maximum batch size
int maxSequentialFailures = 0; // BIT32 Max Sequental Failures SIB0115d.comms
long hiddenMessageDelay = 0; // BIT64 hidden message delay
// If stoppable get the maxSequentialFailures value
if (stoppable) { //SIB0115d.comms
maxSequentialFailures = request.getInt(); //SIB0115d.comms
hiddenMessageDelay = request.getLong();
} //SIB0115d.comms
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
SibTr.debug(tc, "connectionObjectID=" + connectionObjectId);
SibTr.debug(tc, "consumerObjectID=" + consumerObjectId);
SibTr.debug(tc, "orderContextID=" + orderContextId);
SibTr.debug(tc, "clientSessionID=" + clientSessionId);
SibTr.debug(tc, "maxActiveMessages=" + maxActiveMessages);
SibTr.debug(tc, "messageLockExpiry=" + messageLockExpiry);
SibTr.debug(tc, "maxBatchSize=" + maxBatchSize);
SibTr.debug(tc, "maxSequentialFailures=" + maxSequentialFailures); //SIB0115d.comms
SibTr.debug(tc, "hiddenMesageDelay=" + hiddenMessageDelay);
}
ConversationState convState = (ConversationState) conversation.getAttachment();
CATMainConsumer mainConsumer = ((CATMainConsumer) convState.getObject(consumerObjectId));
OrderingContext orderContext = null;
// Get the message order context if there was one passed up
if (orderContextId != CommsConstants.NO_ORDER_CONTEXT)
{
orderContext = ((CATOrderingContext) convState.getObject(orderContextId)).getOrderingContext(); // F201521
}
mainConsumer.setClientSessionId(clientSessionId);
mainConsumer.setAsynchConsumerCallback(requestNumber,
maxActiveMessages,
messageLockExpiry,
maxBatchSize,
orderContext,
stoppable, //SIB0115d.comms
maxSequentialFailures,
hiddenMessageDelay); //SIB0115d.comms
request.release(allocatedFromBufferPool);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "rcvRegisterAsyncConsumer");
} | [
"static",
"void",
"rcvRegisterAsyncConsumer",
"(",
"CommsByteBuffer",
"request",
",",
"Conversation",
"conversation",
",",
"int",
"requestNumber",
",",
"boolean",
"allocatedFromBufferPool",
",",
"boolean",
"partOfExchange",
",",
"boolean",
"stoppable",
")",
"//SIB0115d.comms",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"rcvRegisterAsyncConsumer\"",
",",
"new",
"Object",
"[",
"]",
"{",
"request",
",",
"conversation",
",",
"requestNumber",
",",
"allocatedFromBufferPool",
",",
"stoppable",
"//SIB0115d.comms",
"}",
")",
";",
"short",
"connectionObjectId",
"=",
"request",
".",
"getShort",
"(",
")",
";",
"// BIT16 ConnectionObjectId",
"short",
"consumerObjectId",
"=",
"request",
".",
"getShort",
"(",
")",
";",
"// BIT16 SyncConsumerSessionId",
"short",
"orderContextId",
"=",
"request",
".",
"getShort",
"(",
")",
";",
"// BIT16 OrderContextId",
"short",
"clientSessionId",
"=",
"request",
".",
"getShort",
"(",
")",
";",
"// BIT16 ClientSessionId",
"int",
"maxActiveMessages",
"=",
"request",
".",
"getInt",
"(",
")",
";",
"// BIT32 Max active messages",
"long",
"messageLockExpiry",
"=",
"request",
".",
"getLong",
"(",
")",
";",
"// BIT64 Message lock expiry",
"int",
"maxBatchSize",
"=",
"request",
".",
"getInt",
"(",
")",
";",
"// BIT32 Maximum batch size",
"int",
"maxSequentialFailures",
"=",
"0",
";",
"// BIT32 Max Sequental Failures SIB0115d.comms",
"long",
"hiddenMessageDelay",
"=",
"0",
";",
"// BIT64 hidden message delay",
"// If stoppable get the maxSequentialFailures value",
"if",
"(",
"stoppable",
")",
"{",
"//SIB0115d.comms",
"maxSequentialFailures",
"=",
"request",
".",
"getInt",
"(",
")",
";",
"//SIB0115d.comms",
"hiddenMessageDelay",
"=",
"request",
".",
"getLong",
"(",
")",
";",
"}",
"//SIB0115d.comms",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"connectionObjectID=\"",
"+",
"connectionObjectId",
")",
";",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"consumerObjectID=\"",
"+",
"consumerObjectId",
")",
";",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"orderContextID=\"",
"+",
"orderContextId",
")",
";",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"clientSessionID=\"",
"+",
"clientSessionId",
")",
";",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"maxActiveMessages=\"",
"+",
"maxActiveMessages",
")",
";",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"messageLockExpiry=\"",
"+",
"messageLockExpiry",
")",
";",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"maxBatchSize=\"",
"+",
"maxBatchSize",
")",
";",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"maxSequentialFailures=\"",
"+",
"maxSequentialFailures",
")",
";",
"//SIB0115d.comms",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"hiddenMesageDelay=\"",
"+",
"hiddenMessageDelay",
")",
";",
"}",
"ConversationState",
"convState",
"=",
"(",
"ConversationState",
")",
"conversation",
".",
"getAttachment",
"(",
")",
";",
"CATMainConsumer",
"mainConsumer",
"=",
"(",
"(",
"CATMainConsumer",
")",
"convState",
".",
"getObject",
"(",
"consumerObjectId",
")",
")",
";",
"OrderingContext",
"orderContext",
"=",
"null",
";",
"// Get the message order context if there was one passed up",
"if",
"(",
"orderContextId",
"!=",
"CommsConstants",
".",
"NO_ORDER_CONTEXT",
")",
"{",
"orderContext",
"=",
"(",
"(",
"CATOrderingContext",
")",
"convState",
".",
"getObject",
"(",
"orderContextId",
")",
")",
".",
"getOrderingContext",
"(",
")",
";",
"// F201521",
"}",
"mainConsumer",
".",
"setClientSessionId",
"(",
"clientSessionId",
")",
";",
"mainConsumer",
".",
"setAsynchConsumerCallback",
"(",
"requestNumber",
",",
"maxActiveMessages",
",",
"messageLockExpiry",
",",
"maxBatchSize",
",",
"orderContext",
",",
"stoppable",
",",
"//SIB0115d.comms",
"maxSequentialFailures",
",",
"hiddenMessageDelay",
")",
";",
"//SIB0115d.comms",
"request",
".",
"release",
"(",
"allocatedFromBufferPool",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"rcvRegisterAsyncConsumer\"",
")",
";",
"}"
] | Register an asynchronous consumer for this consumer session.
Fields:
BIT16 ConnectionObjectId
BIT16 SyncConsumerSessionId
BIT16 MessageOrderContextId
BIT16 ClientSessionId
BIT32 Max batch size
BIT32 Max Sequential Failures
@param request
@param conversation
@param requestNumber
@param allocatedFromBufferPool
@param partOfExchange
@param stoppable | [
"Register",
"an",
"asynchronous",
"consumer",
"for",
"this",
"consumer",
"session",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/StaticCATConsumer.java#L497-L566 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/StaticCATConsumer.java | StaticCATConsumer.rcvRequestMsgs | static void rcvRequestMsgs(CommsByteBuffer request, Conversation conversation, int requestNumber,
boolean allocatedFromBufferPool, boolean partOfExchange)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "rcvRequestMsgs",
new Object[]
{
request,
conversation,
"" + requestNumber,
"" + allocatedFromBufferPool
});
short connectionObjectID = request.getShort(); // BIT16 ConnectionObjectId
short consumerObjectID = request.getShort(); // BIT16 SyncConsumerSessionId
int receivedBytes = request.getInt(); // BIT32 ReceivedBytes
int requestedBytes = request.getInt(); // BIT32 RequestedBytes
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
SibTr.debug(tc, "connectionObjectID", connectionObjectID);
SibTr.debug(tc, "consumerObjectID", consumerObjectID);
SibTr.debug(tc, "receivedBytes", receivedBytes);
SibTr.debug(tc, "requestedBytes", requestedBytes);
}
CATMainConsumer mainConsumer =
((CATMainConsumer) ((ConversationState) conversation.getAttachment()).getObject(consumerObjectID));
mainConsumer.requestMsgs(requestNumber, receivedBytes, requestedBytes);
request.release(allocatedFromBufferPool);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "rcvRequestMsgs");
} | java | static void rcvRequestMsgs(CommsByteBuffer request, Conversation conversation, int requestNumber,
boolean allocatedFromBufferPool, boolean partOfExchange)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "rcvRequestMsgs",
new Object[]
{
request,
conversation,
"" + requestNumber,
"" + allocatedFromBufferPool
});
short connectionObjectID = request.getShort(); // BIT16 ConnectionObjectId
short consumerObjectID = request.getShort(); // BIT16 SyncConsumerSessionId
int receivedBytes = request.getInt(); // BIT32 ReceivedBytes
int requestedBytes = request.getInt(); // BIT32 RequestedBytes
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
SibTr.debug(tc, "connectionObjectID", connectionObjectID);
SibTr.debug(tc, "consumerObjectID", consumerObjectID);
SibTr.debug(tc, "receivedBytes", receivedBytes);
SibTr.debug(tc, "requestedBytes", requestedBytes);
}
CATMainConsumer mainConsumer =
((CATMainConsumer) ((ConversationState) conversation.getAttachment()).getObject(consumerObjectID));
mainConsumer.requestMsgs(requestNumber, receivedBytes, requestedBytes);
request.release(allocatedFromBufferPool);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "rcvRequestMsgs");
} | [
"static",
"void",
"rcvRequestMsgs",
"(",
"CommsByteBuffer",
"request",
",",
"Conversation",
"conversation",
",",
"int",
"requestNumber",
",",
"boolean",
"allocatedFromBufferPool",
",",
"boolean",
"partOfExchange",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"rcvRequestMsgs\"",
",",
"new",
"Object",
"[",
"]",
"{",
"request",
",",
"conversation",
",",
"\"\"",
"+",
"requestNumber",
",",
"\"\"",
"+",
"allocatedFromBufferPool",
"}",
")",
";",
"short",
"connectionObjectID",
"=",
"request",
".",
"getShort",
"(",
")",
";",
"// BIT16 ConnectionObjectId",
"short",
"consumerObjectID",
"=",
"request",
".",
"getShort",
"(",
")",
";",
"// BIT16 SyncConsumerSessionId",
"int",
"receivedBytes",
"=",
"request",
".",
"getInt",
"(",
")",
";",
"// BIT32 ReceivedBytes",
"int",
"requestedBytes",
"=",
"request",
".",
"getInt",
"(",
")",
";",
"// BIT32 RequestedBytes",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"connectionObjectID\"",
",",
"connectionObjectID",
")",
";",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"consumerObjectID\"",
",",
"consumerObjectID",
")",
";",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"receivedBytes\"",
",",
"receivedBytes",
")",
";",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"requestedBytes\"",
",",
"requestedBytes",
")",
";",
"}",
"CATMainConsumer",
"mainConsumer",
"=",
"(",
"(",
"CATMainConsumer",
")",
"(",
"(",
"ConversationState",
")",
"conversation",
".",
"getAttachment",
"(",
")",
")",
".",
"getObject",
"(",
"consumerObjectID",
")",
")",
";",
"mainConsumer",
".",
"requestMsgs",
"(",
"requestNumber",
",",
"receivedBytes",
",",
"requestedBytes",
")",
";",
"request",
".",
"release",
"(",
"allocatedFromBufferPool",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"rcvRequestMsgs\"",
")",
";",
"}"
] | Request messages for this consumer.
Fields:
BIT16 ConnectionObjectId
BIT16 ConsumerSessionId
BIT32 ReceivedBytes
BIT32 RequestedBytes
@param request
@param conversation
@param requestNumber
@param allocatedFromBufferPool
@param partOfExchange | [
"Request",
"messages",
"for",
"this",
"consumer",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/StaticCATConsumer.java#L584-L619 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/StaticCATConsumer.java | StaticCATConsumer.rcvSessReceive | static void rcvSessReceive(CommsServerByteBuffer request,
Conversation conversation,
int requestNumber,
boolean allocatedFromBufferPool,
boolean partOfExchange)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "rcvSessReceive",
new Object[]
{
request,
conversation,
"" + requestNumber,
"" + allocatedFromBufferPool
});
ConversationState conversationState = (ConversationState) conversation.getAttachment();
ServerLinkLevelState linkState = (ServerLinkLevelState) conversation.getLinkLevelAttachment();
final boolean optimizedTx = CommsUtils.requiresOptimizedTransaction(conversation);
short connectionObjectID = request.getShort(); // BIT16 ConnectionObjectId
short consumerObjectID = request.getShort(); // BIT16 ConsumerObjectId
int transactionObjectId = request.getSITransactionId(connectionObjectID, linkState, optimizedTx);
long timeout = request.getLong(); // BIT64 TimeOut
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
SibTr.debug(tc, "connectionObjectID", connectionObjectID);
SibTr.debug(tc, "consumerObjectID", consumerObjectID);
SibTr.debug(tc, "transaction Id", transactionObjectId);
SibTr.debug(tc, "timeout", timeout);
}
CATMainConsumer mainConsumer = (CATMainConsumer) conversationState.getObject(consumerObjectID);
mainConsumer.receive(requestNumber, transactionObjectId, timeout);
request.release(allocatedFromBufferPool);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "rcvSessReceive");
} | java | static void rcvSessReceive(CommsServerByteBuffer request,
Conversation conversation,
int requestNumber,
boolean allocatedFromBufferPool,
boolean partOfExchange)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "rcvSessReceive",
new Object[]
{
request,
conversation,
"" + requestNumber,
"" + allocatedFromBufferPool
});
ConversationState conversationState = (ConversationState) conversation.getAttachment();
ServerLinkLevelState linkState = (ServerLinkLevelState) conversation.getLinkLevelAttachment();
final boolean optimizedTx = CommsUtils.requiresOptimizedTransaction(conversation);
short connectionObjectID = request.getShort(); // BIT16 ConnectionObjectId
short consumerObjectID = request.getShort(); // BIT16 ConsumerObjectId
int transactionObjectId = request.getSITransactionId(connectionObjectID, linkState, optimizedTx);
long timeout = request.getLong(); // BIT64 TimeOut
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
SibTr.debug(tc, "connectionObjectID", connectionObjectID);
SibTr.debug(tc, "consumerObjectID", consumerObjectID);
SibTr.debug(tc, "transaction Id", transactionObjectId);
SibTr.debug(tc, "timeout", timeout);
}
CATMainConsumer mainConsumer = (CATMainConsumer) conversationState.getObject(consumerObjectID);
mainConsumer.receive(requestNumber, transactionObjectId, timeout);
request.release(allocatedFromBufferPool);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "rcvSessReceive");
} | [
"static",
"void",
"rcvSessReceive",
"(",
"CommsServerByteBuffer",
"request",
",",
"Conversation",
"conversation",
",",
"int",
"requestNumber",
",",
"boolean",
"allocatedFromBufferPool",
",",
"boolean",
"partOfExchange",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"rcvSessReceive\"",
",",
"new",
"Object",
"[",
"]",
"{",
"request",
",",
"conversation",
",",
"\"\"",
"+",
"requestNumber",
",",
"\"\"",
"+",
"allocatedFromBufferPool",
"}",
")",
";",
"ConversationState",
"conversationState",
"=",
"(",
"ConversationState",
")",
"conversation",
".",
"getAttachment",
"(",
")",
";",
"ServerLinkLevelState",
"linkState",
"=",
"(",
"ServerLinkLevelState",
")",
"conversation",
".",
"getLinkLevelAttachment",
"(",
")",
";",
"final",
"boolean",
"optimizedTx",
"=",
"CommsUtils",
".",
"requiresOptimizedTransaction",
"(",
"conversation",
")",
";",
"short",
"connectionObjectID",
"=",
"request",
".",
"getShort",
"(",
")",
";",
"// BIT16 ConnectionObjectId",
"short",
"consumerObjectID",
"=",
"request",
".",
"getShort",
"(",
")",
";",
"// BIT16 ConsumerObjectId",
"int",
"transactionObjectId",
"=",
"request",
".",
"getSITransactionId",
"(",
"connectionObjectID",
",",
"linkState",
",",
"optimizedTx",
")",
";",
"long",
"timeout",
"=",
"request",
".",
"getLong",
"(",
")",
";",
"// BIT64 TimeOut",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"connectionObjectID\"",
",",
"connectionObjectID",
")",
";",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"consumerObjectID\"",
",",
"consumerObjectID",
")",
";",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"transaction Id\"",
",",
"transactionObjectId",
")",
";",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"timeout\"",
",",
"timeout",
")",
";",
"}",
"CATMainConsumer",
"mainConsumer",
"=",
"(",
"CATMainConsumer",
")",
"conversationState",
".",
"getObject",
"(",
"consumerObjectID",
")",
";",
"mainConsumer",
".",
"receive",
"(",
"requestNumber",
",",
"transactionObjectId",
",",
"timeout",
")",
";",
"request",
".",
"release",
"(",
"allocatedFromBufferPool",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"rcvSessReceive\"",
")",
";",
"}"
] | Receive a message using the Synchronous Consumer Session provided by the client.
The receive is farmed off to the CATConsumer handling the receives for this session.
Typically this will be the synchronous handler.
Fields:
BIT16 ConnectionObjectId
BIT16 SyncConsumerSessionId
BIT32 TransactionId
BIT64 TimeOut
@param request
@param conversation
@param requestNumber
@param allocatedFromBufferPool
@param partOfExchange | [
"Receive",
"a",
"message",
"using",
"the",
"Synchronous",
"Consumer",
"Session",
"provided",
"by",
"the",
"client",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/StaticCATConsumer.java#L690-L731 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/StaticCATConsumer.java | StaticCATConsumer.rcvUnlockAll | static void rcvUnlockAll(CommsByteBuffer request, Conversation conversation, int requestNumber,
boolean allocatedFromBufferPool, boolean partOfExchange)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "rcvUnlockAll",
new Object[]
{
request,
conversation,
"" + requestNumber,
"" + allocatedFromBufferPool
});
short connectionObjectId = request.getShort(); // BIT16 ConnectionObjectId
short consumerObjectId = request.getShort(); // BIT16 ConsumerSessionId
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
SibTr.debug(tc, "connectionObjectId", connectionObjectId);
SibTr.debug(tc, "consumerObjectId", consumerObjectId);
}
CATMainConsumer mainConsumer =
(CATMainConsumer) ((ConversationState) conversation.getAttachment()).getObject(consumerObjectId);
mainConsumer.unlockAll(requestNumber);
request.release(allocatedFromBufferPool);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "rcvUnlockAll");
} | java | static void rcvUnlockAll(CommsByteBuffer request, Conversation conversation, int requestNumber,
boolean allocatedFromBufferPool, boolean partOfExchange)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "rcvUnlockAll",
new Object[]
{
request,
conversation,
"" + requestNumber,
"" + allocatedFromBufferPool
});
short connectionObjectId = request.getShort(); // BIT16 ConnectionObjectId
short consumerObjectId = request.getShort(); // BIT16 ConsumerSessionId
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
SibTr.debug(tc, "connectionObjectId", connectionObjectId);
SibTr.debug(tc, "consumerObjectId", consumerObjectId);
}
CATMainConsumer mainConsumer =
(CATMainConsumer) ((ConversationState) conversation.getAttachment()).getObject(consumerObjectId);
mainConsumer.unlockAll(requestNumber);
request.release(allocatedFromBufferPool);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "rcvUnlockAll");
} | [
"static",
"void",
"rcvUnlockAll",
"(",
"CommsByteBuffer",
"request",
",",
"Conversation",
"conversation",
",",
"int",
"requestNumber",
",",
"boolean",
"allocatedFromBufferPool",
",",
"boolean",
"partOfExchange",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"rcvUnlockAll\"",
",",
"new",
"Object",
"[",
"]",
"{",
"request",
",",
"conversation",
",",
"\"\"",
"+",
"requestNumber",
",",
"\"\"",
"+",
"allocatedFromBufferPool",
"}",
")",
";",
"short",
"connectionObjectId",
"=",
"request",
".",
"getShort",
"(",
")",
";",
"// BIT16 ConnectionObjectId",
"short",
"consumerObjectId",
"=",
"request",
".",
"getShort",
"(",
")",
";",
"// BIT16 ConsumerSessionId",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"connectionObjectId\"",
",",
"connectionObjectId",
")",
";",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"consumerObjectId\"",
",",
"consumerObjectId",
")",
";",
"}",
"CATMainConsumer",
"mainConsumer",
"=",
"(",
"CATMainConsumer",
")",
"(",
"(",
"ConversationState",
")",
"conversation",
".",
"getAttachment",
"(",
")",
")",
".",
"getObject",
"(",
"consumerObjectId",
")",
";",
"mainConsumer",
".",
"unlockAll",
"(",
"requestNumber",
")",
";",
"request",
".",
"release",
"(",
"allocatedFromBufferPool",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"rcvUnlockAll\"",
")",
";",
"}"
] | Unlocks all locked messages on the server.
Fields:
BIT16 ConnectionObjectId
BIT16 ConsumerSessionId
@param request
@param conversation
@param requestNumber
@param allocatedFromBufferPool
@param partOfExchange | [
"Unlocks",
"all",
"locked",
"messages",
"on",
"the",
"server",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/StaticCATConsumer.java#L843-L874 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/StaticCATConsumer.java | StaticCATConsumer.rcvDeleteSet | static void rcvDeleteSet(CommsServerByteBuffer request,
Conversation conversation,
int requestNumber,
boolean allocatedFromBufferPool,
boolean partOfExchange)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "rcvDeleteSet",
new Object[]
{
request,
conversation,
"" + requestNumber
});
ServerLinkLevelState linkState = (ServerLinkLevelState) conversation.getLinkLevelAttachment();
final boolean optimizedTx = CommsUtils.requiresOptimizedTransaction(conversation);
short connectionObjectId = request.getShort(); // BIT16 ConnectionObjectId
short consumerObjectId = request.getShort(); // BIT16 ConsumerSessionId
int transactionId = request.getSITransactionId(connectionObjectId, linkState, optimizedTx);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
SibTr.debug(tc, "connectionObjectId", connectionObjectId);
SibTr.debug(tc, "consumerObjectId", consumerObjectId);
SibTr.debug(tc, "transactionId", transactionId);
}
SIMessageHandle[] siMsgHandles = request.getSIMessageHandles();
CATMainConsumer mainConsumer =
(CATMainConsumer) ((ConversationState) conversation.getAttachment()).getObject(consumerObjectId);
// If the transaction id is not null then retrieve the
// transaction object from the table in the link level
mainConsumer.deleteSet(requestNumber, siMsgHandles, transactionId, partOfExchange); // f187521.2.1, F219476.2
request.release(allocatedFromBufferPool);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "rcvDeleteSet");
} | java | static void rcvDeleteSet(CommsServerByteBuffer request,
Conversation conversation,
int requestNumber,
boolean allocatedFromBufferPool,
boolean partOfExchange)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "rcvDeleteSet",
new Object[]
{
request,
conversation,
"" + requestNumber
});
ServerLinkLevelState linkState = (ServerLinkLevelState) conversation.getLinkLevelAttachment();
final boolean optimizedTx = CommsUtils.requiresOptimizedTransaction(conversation);
short connectionObjectId = request.getShort(); // BIT16 ConnectionObjectId
short consumerObjectId = request.getShort(); // BIT16 ConsumerSessionId
int transactionId = request.getSITransactionId(connectionObjectId, linkState, optimizedTx);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
SibTr.debug(tc, "connectionObjectId", connectionObjectId);
SibTr.debug(tc, "consumerObjectId", consumerObjectId);
SibTr.debug(tc, "transactionId", transactionId);
}
SIMessageHandle[] siMsgHandles = request.getSIMessageHandles();
CATMainConsumer mainConsumer =
(CATMainConsumer) ((ConversationState) conversation.getAttachment()).getObject(consumerObjectId);
// If the transaction id is not null then retrieve the
// transaction object from the table in the link level
mainConsumer.deleteSet(requestNumber, siMsgHandles, transactionId, partOfExchange); // f187521.2.1, F219476.2
request.release(allocatedFromBufferPool);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "rcvDeleteSet");
} | [
"static",
"void",
"rcvDeleteSet",
"(",
"CommsServerByteBuffer",
"request",
",",
"Conversation",
"conversation",
",",
"int",
"requestNumber",
",",
"boolean",
"allocatedFromBufferPool",
",",
"boolean",
"partOfExchange",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"rcvDeleteSet\"",
",",
"new",
"Object",
"[",
"]",
"{",
"request",
",",
"conversation",
",",
"\"\"",
"+",
"requestNumber",
"}",
")",
";",
"ServerLinkLevelState",
"linkState",
"=",
"(",
"ServerLinkLevelState",
")",
"conversation",
".",
"getLinkLevelAttachment",
"(",
")",
";",
"final",
"boolean",
"optimizedTx",
"=",
"CommsUtils",
".",
"requiresOptimizedTransaction",
"(",
"conversation",
")",
";",
"short",
"connectionObjectId",
"=",
"request",
".",
"getShort",
"(",
")",
";",
"// BIT16 ConnectionObjectId",
"short",
"consumerObjectId",
"=",
"request",
".",
"getShort",
"(",
")",
";",
"// BIT16 ConsumerSessionId",
"int",
"transactionId",
"=",
"request",
".",
"getSITransactionId",
"(",
"connectionObjectId",
",",
"linkState",
",",
"optimizedTx",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"connectionObjectId\"",
",",
"connectionObjectId",
")",
";",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"consumerObjectId\"",
",",
"consumerObjectId",
")",
";",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"transactionId\"",
",",
"transactionId",
")",
";",
"}",
"SIMessageHandle",
"[",
"]",
"siMsgHandles",
"=",
"request",
".",
"getSIMessageHandles",
"(",
")",
";",
"CATMainConsumer",
"mainConsumer",
"=",
"(",
"CATMainConsumer",
")",
"(",
"(",
"ConversationState",
")",
"conversation",
".",
"getAttachment",
"(",
")",
")",
".",
"getObject",
"(",
"consumerObjectId",
")",
";",
"// If the transaction id is not null then retrieve the",
"// transaction object from the table in the link level",
"mainConsumer",
".",
"deleteSet",
"(",
"requestNumber",
",",
"siMsgHandles",
",",
"transactionId",
",",
"partOfExchange",
")",
";",
"// f187521.2.1, F219476.2",
"request",
".",
"release",
"(",
"allocatedFromBufferPool",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"rcvDeleteSet\"",
")",
";",
"}"
] | Deletes a set of messages that are currently locked by the
server.
Fields:
BIT16 ConnectionObjectId
BIT16 ConsumerSessionId
BIT32 TranasctionId
BIT32 ArrayCount
BIT32[] MsgIds
@param request
@param conversation
@param requestNumber
@param allocatedFromBufferPool
@param partOfExchange
@param optimizedTx | [
"Deletes",
"a",
"set",
"of",
"messages",
"that",
"are",
"currently",
"locked",
"by",
"the",
"server",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/StaticCATConsumer.java#L966-L1009 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/StaticCATConsumer.java | StaticCATConsumer.rcvReadSet | static void rcvReadSet(CommsByteBuffer request, Conversation conversation, int requestNumber,
boolean allocatedFromBufferPool, boolean partOfExchange)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "rcvReadSet",
new Object[]
{
request,
conversation,
"" + requestNumber,
"" + allocatedFromBufferPool
});
short connectionObjectId = request.getShort(); // BIT16 ConnectionObjectId
short consumerObjectId = request.getShort(); // BIT16 ConsumerSessionId
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
SibTr.debug(tc, "connectionObjectId", connectionObjectId);
SibTr.debug(tc, "consumerObjectId", consumerObjectId);
}
SIMessageHandle[] msgHandles = request.getSIMessageHandles();
CATMainConsumer mainConsumer =
(CATMainConsumer) ((ConversationState) conversation.getAttachment()).getObject(consumerObjectId);
mainConsumer.readSet(requestNumber, msgHandles);
request.release(allocatedFromBufferPool);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "rcvReadSet");
} | java | static void rcvReadSet(CommsByteBuffer request, Conversation conversation, int requestNumber,
boolean allocatedFromBufferPool, boolean partOfExchange)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "rcvReadSet",
new Object[]
{
request,
conversation,
"" + requestNumber,
"" + allocatedFromBufferPool
});
short connectionObjectId = request.getShort(); // BIT16 ConnectionObjectId
short consumerObjectId = request.getShort(); // BIT16 ConsumerSessionId
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
SibTr.debug(tc, "connectionObjectId", connectionObjectId);
SibTr.debug(tc, "consumerObjectId", consumerObjectId);
}
SIMessageHandle[] msgHandles = request.getSIMessageHandles();
CATMainConsumer mainConsumer =
(CATMainConsumer) ((ConversationState) conversation.getAttachment()).getObject(consumerObjectId);
mainConsumer.readSet(requestNumber, msgHandles);
request.release(allocatedFromBufferPool);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "rcvReadSet");
} | [
"static",
"void",
"rcvReadSet",
"(",
"CommsByteBuffer",
"request",
",",
"Conversation",
"conversation",
",",
"int",
"requestNumber",
",",
"boolean",
"allocatedFromBufferPool",
",",
"boolean",
"partOfExchange",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"rcvReadSet\"",
",",
"new",
"Object",
"[",
"]",
"{",
"request",
",",
"conversation",
",",
"\"\"",
"+",
"requestNumber",
",",
"\"\"",
"+",
"allocatedFromBufferPool",
"}",
")",
";",
"short",
"connectionObjectId",
"=",
"request",
".",
"getShort",
"(",
")",
";",
"// BIT16 ConnectionObjectId",
"short",
"consumerObjectId",
"=",
"request",
".",
"getShort",
"(",
")",
";",
"// BIT16 ConsumerSessionId",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"connectionObjectId\"",
",",
"connectionObjectId",
")",
";",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"consumerObjectId\"",
",",
"consumerObjectId",
")",
";",
"}",
"SIMessageHandle",
"[",
"]",
"msgHandles",
"=",
"request",
".",
"getSIMessageHandles",
"(",
")",
";",
"CATMainConsumer",
"mainConsumer",
"=",
"(",
"CATMainConsumer",
")",
"(",
"(",
"ConversationState",
")",
"conversation",
".",
"getAttachment",
"(",
")",
")",
".",
"getObject",
"(",
"consumerObjectId",
")",
";",
"mainConsumer",
".",
"readSet",
"(",
"requestNumber",
",",
"msgHandles",
")",
";",
"request",
".",
"release",
"(",
"allocatedFromBufferPool",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"rcvReadSet\"",
")",
";",
"}"
] | Reads a set of messages that are currently locked by the server.
Fields:
BIT16 ConnectionObjectId
BIT16 ConsumerSessionId
BIT32 ArrayCount
BIT32[] MsgIds
@param request
@param conversation
@param requestNumber
@param allocatedFromBufferPool
@param partOfExchange | [
"Reads",
"a",
"set",
"of",
"messages",
"that",
"are",
"currently",
"locked",
"by",
"the",
"server",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/StaticCATConsumer.java#L1028-L1061 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AsynchDeletionThread.java | AsynchDeletionThread.cleanupSubscription | private void cleanupSubscription(SubscriptionItemStream stream)
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "cleanupSubscription", stream);
try
{
// Indicate that we don't want the asynch deletion thread restarted if the
// subscription fails to delete, otherwise we might end up in a tight loop trying
// to delete the subscription
stream.deleteIfPossible(false);
}
catch (Exception e)
{
// FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.AsynchDeletionThread.cleanupSubscription",
"1:340:1.50",
stream);
if (tc.isDebugEnabled())
{
SibTr.debug(tc, "Failed to delete subscription " + stream);
SibTr.exception(tc, e);
}
}
if (tc.isEntryEnabled())
SibTr.exit(tc, "cleanupSubscription");
} | java | private void cleanupSubscription(SubscriptionItemStream stream)
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "cleanupSubscription", stream);
try
{
// Indicate that we don't want the asynch deletion thread restarted if the
// subscription fails to delete, otherwise we might end up in a tight loop trying
// to delete the subscription
stream.deleteIfPossible(false);
}
catch (Exception e)
{
// FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.AsynchDeletionThread.cleanupSubscription",
"1:340:1.50",
stream);
if (tc.isDebugEnabled())
{
SibTr.debug(tc, "Failed to delete subscription " + stream);
SibTr.exception(tc, e);
}
}
if (tc.isEntryEnabled())
SibTr.exit(tc, "cleanupSubscription");
} | [
"private",
"void",
"cleanupSubscription",
"(",
"SubscriptionItemStream",
"stream",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"cleanupSubscription\"",
",",
"stream",
")",
";",
"try",
"{",
"// Indicate that we don't want the asynch deletion thread restarted if the ",
"// subscription fails to delete, otherwise we might end up in a tight loop trying",
"// to delete the subscription",
"stream",
".",
"deleteIfPossible",
"(",
"false",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"// FFDC",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.impl.AsynchDeletionThread.cleanupSubscription\"",
",",
"\"1:340:1.50\"",
",",
"stream",
")",
";",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"Failed to delete subscription \"",
"+",
"stream",
")",
";",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"}",
"}",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"cleanupSubscription\"",
")",
";",
"}"
] | Delete the subscription in question.
@param stream | [
"Delete",
"the",
"subscription",
"in",
"question",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AsynchDeletionThread.java#L301-L332 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AsynchDeletionThread.java | AsynchDeletionThread.setRunning | public void setRunning(boolean running)
{
if (tc.isEntryEnabled())
{
SibTr.entry(tc, "setRunning");
SibTr.exit(tc, "setRunning");
}
_isRunning = running;
return;
} | java | public void setRunning(boolean running)
{
if (tc.isEntryEnabled())
{
SibTr.entry(tc, "setRunning");
SibTr.exit(tc, "setRunning");
}
_isRunning = running;
return;
} | [
"public",
"void",
"setRunning",
"(",
"boolean",
"running",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"setRunning\"",
")",
";",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"setRunning\"",
")",
";",
"}",
"_isRunning",
"=",
"running",
";",
"return",
";",
"}"
] | Method setRunning - Set indicator that the asynchDeletionThread is running | [
"Method",
"setRunning",
"-",
"Set",
"indicator",
"that",
"the",
"asynchDeletionThread",
"is",
"running"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AsynchDeletionThread.java#L396-L407 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AsynchDeletionThread.java | AsynchDeletionThread.isRunning | public boolean isRunning()
{
if (tc.isEntryEnabled())
{
SibTr.entry(tc, "isRunning");
SibTr.exit(tc, "isRunning", new Boolean(_isRunning));
}
return _isRunning;
} | java | public boolean isRunning()
{
if (tc.isEntryEnabled())
{
SibTr.entry(tc, "isRunning");
SibTr.exit(tc, "isRunning", new Boolean(_isRunning));
}
return _isRunning;
} | [
"public",
"boolean",
"isRunning",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"isRunning\"",
")",
";",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"isRunning\"",
",",
"new",
"Boolean",
"(",
"_isRunning",
")",
")",
";",
"}",
"return",
"_isRunning",
";",
"}"
] | Method isRunning - Determine if the AsynchDeletionThread is running or not.
@return boolean | [
"Method",
"isRunning",
"-",
"Determine",
"if",
"the",
"AsynchDeletionThread",
"is",
"running",
"or",
"not",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AsynchDeletionThread.java#L413-L422 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AsynchDeletionThread.java | AsynchDeletionThread.setStopping | public void setStopping()
{
if (tc.isEntryEnabled())
{
SibTr.entry(tc, "setStopping");
SibTr.exit(tc, "setStopping");
}
_isStopping = true;
return;
} | java | public void setStopping()
{
if (tc.isEntryEnabled())
{
SibTr.entry(tc, "setStopping");
SibTr.exit(tc, "setStopping");
}
_isStopping = true;
return;
} | [
"public",
"void",
"setStopping",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"setStopping\"",
")",
";",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"setStopping\"",
")",
";",
"}",
"_isStopping",
"=",
"true",
";",
"return",
";",
"}"
] | Method setStopping - Set indicator that the asynchDeletionThread is stopping | [
"Method",
"setStopping",
"-",
"Set",
"indicator",
"that",
"the",
"asynchDeletionThread",
"is",
"stopping"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AsynchDeletionThread.java#L427-L438 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AsynchDeletionThread.java | AsynchDeletionThread.isStopping | public boolean isStopping()
{
if (tc.isEntryEnabled())
{
SibTr.entry(tc, "isStopping");
SibTr.exit(tc, "isStopping", new Boolean(_isStopping));
}
return _isStopping;
} | java | public boolean isStopping()
{
if (tc.isEntryEnabled())
{
SibTr.entry(tc, "isStopping");
SibTr.exit(tc, "isStopping", new Boolean(_isStopping));
}
return _isStopping;
} | [
"public",
"boolean",
"isStopping",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"isStopping\"",
")",
";",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"isStopping\"",
",",
"new",
"Boolean",
"(",
"_isStopping",
")",
")",
";",
"}",
"return",
"_isStopping",
";",
"}"
] | Method isStopping - Determine if the AsynchDeletionThread is stopping or not.
@return boolean | [
"Method",
"isStopping",
"-",
"Determine",
"if",
"the",
"AsynchDeletionThread",
"is",
"stopping",
"or",
"not",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AsynchDeletionThread.java#L444-L453 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AsynchDeletionThread.java | AsynchDeletionThread.rerun | public void rerun()
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "rerun");
_rerunRequested = true;
if (tc.isEntryEnabled())
SibTr.exit(tc, "rerun");
} | java | public void rerun()
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "rerun");
_rerunRequested = true;
if (tc.isEntryEnabled())
SibTr.exit(tc, "rerun");
} | [
"public",
"void",
"rerun",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"rerun\"",
")",
";",
"_rerunRequested",
"=",
"true",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"rerun\"",
")",
";",
"}"
] | Indicate that we want the Asynch deletion thread to run again | [
"Indicate",
"that",
"we",
"want",
"the",
"Asynch",
"deletion",
"thread",
"to",
"run",
"again"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AsynchDeletionThread.java#L458-L467 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsfContainer_fat_2.3/fat/src/com/ibm/ws/jsf/container/fat/utils/JSFUtils.java | JSFUtils.waitForPageResponse | public static boolean waitForPageResponse(HtmlPage page, String responseMessage) throws InterruptedException {
int i = 0;
boolean isTextFound = false;
while (!isTextFound && i < 5) {
isTextFound = page.asText().contains(responseMessage);
i++;
Thread.sleep(1000);
Log.info(c, "waitForPageResponse", "Waiting for: " + responseMessage + " isTextFound: " + isTextFound + " i: " + i);
}
return isTextFound;
} | java | public static boolean waitForPageResponse(HtmlPage page, String responseMessage) throws InterruptedException {
int i = 0;
boolean isTextFound = false;
while (!isTextFound && i < 5) {
isTextFound = page.asText().contains(responseMessage);
i++;
Thread.sleep(1000);
Log.info(c, "waitForPageResponse", "Waiting for: " + responseMessage + " isTextFound: " + isTextFound + " i: " + i);
}
return isTextFound;
} | [
"public",
"static",
"boolean",
"waitForPageResponse",
"(",
"HtmlPage",
"page",
",",
"String",
"responseMessage",
")",
"throws",
"InterruptedException",
"{",
"int",
"i",
"=",
"0",
";",
"boolean",
"isTextFound",
"=",
"false",
";",
"while",
"(",
"!",
"isTextFound",
"&&",
"i",
"<",
"5",
")",
"{",
"isTextFound",
"=",
"page",
".",
"asText",
"(",
")",
".",
"contains",
"(",
"responseMessage",
")",
";",
"i",
"++",
";",
"Thread",
".",
"sleep",
"(",
"1000",
")",
";",
"Log",
".",
"info",
"(",
"c",
",",
"\"waitForPageResponse\"",
",",
"\"Waiting for: \"",
"+",
"responseMessage",
"+",
"\" isTextFound: \"",
"+",
"isTextFound",
"+",
"\" i: \"",
"+",
"i",
")",
";",
"}",
"return",
"isTextFound",
";",
"}"
] | Create a custom wait mechanism that waits for any background JavaScript to finish
and verifies a message in the page response.
@param page The current HtmlPage
@return A boolean value indicating if the response message was found
@throws InterruptedException | [
"Create",
"a",
"custom",
"wait",
"mechanism",
"that",
"waits",
"for",
"any",
"background",
"JavaScript",
"to",
"finish",
"and",
"verifies",
"a",
"message",
"in",
"the",
"page",
"response",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsfContainer_fat_2.3/fat/src/com/ibm/ws/jsf/container/fat/utils/JSFUtils.java#L72-L82 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/MessageProxyInvocationHandler.java | MessageProxyInvocationHandler.invoke | @FFDCIgnore(InvocationTargetException.class)
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "invoke", method.toGenericString());
if (actualMessageObject instanceof JmsMessageImpl) {
if (((JmsMessageImpl) actualMessageObject).isAsynSendInProgress()) {
//Async send is in progress... application is trying to access message object
//throw JMSException
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(this, tc, "Application is trying to access message object.. when asysn send is in progress.. throwing JMSException");
throw (JMSException) JmsErrorUtils.newThrowable(JMSException.class,
"INVALID_MESSAGE_ACCESS_CWSIA0516E",
null, // object[] argument
tc
);
}
}
Object retObject = null;
try {
retObject = method.invoke(actualMessageObject, args);
} catch (InvocationTargetException e) {
throw e.getCause();
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "invoke", retObject);
//call the method on actual message object.
return retObject;
} | java | @FFDCIgnore(InvocationTargetException.class)
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "invoke", method.toGenericString());
if (actualMessageObject instanceof JmsMessageImpl) {
if (((JmsMessageImpl) actualMessageObject).isAsynSendInProgress()) {
//Async send is in progress... application is trying to access message object
//throw JMSException
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(this, tc, "Application is trying to access message object.. when asysn send is in progress.. throwing JMSException");
throw (JMSException) JmsErrorUtils.newThrowable(JMSException.class,
"INVALID_MESSAGE_ACCESS_CWSIA0516E",
null, // object[] argument
tc
);
}
}
Object retObject = null;
try {
retObject = method.invoke(actualMessageObject, args);
} catch (InvocationTargetException e) {
throw e.getCause();
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "invoke", retObject);
//call the method on actual message object.
return retObject;
} | [
"@",
"FFDCIgnore",
"(",
"InvocationTargetException",
".",
"class",
")",
"@",
"Override",
"public",
"Object",
"invoke",
"(",
"Object",
"proxy",
",",
"Method",
"method",
",",
"Object",
"[",
"]",
"args",
")",
"throws",
"Throwable",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"invoke\"",
",",
"method",
".",
"toGenericString",
"(",
")",
")",
";",
"if",
"(",
"actualMessageObject",
"instanceof",
"JmsMessageImpl",
")",
"{",
"if",
"(",
"(",
"(",
"JmsMessageImpl",
")",
"actualMessageObject",
")",
".",
"isAsynSendInProgress",
"(",
")",
")",
"{",
"//Async send is in progress... application is trying to access message object",
"//throw JMSException",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"Application is trying to access message object.. when asysn send is in progress.. throwing JMSException\"",
")",
";",
"throw",
"(",
"JMSException",
")",
"JmsErrorUtils",
".",
"newThrowable",
"(",
"JMSException",
".",
"class",
",",
"\"INVALID_MESSAGE_ACCESS_CWSIA0516E\"",
",",
"null",
",",
"// object[] argument",
"tc",
")",
";",
"}",
"}",
"Object",
"retObject",
"=",
"null",
";",
"try",
"{",
"retObject",
"=",
"method",
".",
"invoke",
"(",
"actualMessageObject",
",",
"args",
")",
";",
"}",
"catch",
"(",
"InvocationTargetException",
"e",
")",
"{",
"throw",
"e",
".",
"getCause",
"(",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"invoke\"",
",",
"retObject",
")",
";",
"//call the method on actual message object.",
"return",
"retObject",
";",
"}"
] | While Async send operation is in progress, do not allow application to access message object | [
"While",
"Async",
"send",
"operation",
"is",
"in",
"progress",
"do",
"not",
"allow",
"application",
"to",
"access",
"message",
"object"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/MessageProxyInvocationHandler.java#L48-L88 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java | HtmlRendererUtils.hasClientBehavior | public static boolean hasClientBehavior(String eventName,
Map<String, List<ClientBehavior>> behaviors,
FacesContext facesContext)
{
if (behaviors == null)
{
return false;
}
return (behaviors.get(eventName) != null);
} | java | public static boolean hasClientBehavior(String eventName,
Map<String, List<ClientBehavior>> behaviors,
FacesContext facesContext)
{
if (behaviors == null)
{
return false;
}
return (behaviors.get(eventName) != null);
} | [
"public",
"static",
"boolean",
"hasClientBehavior",
"(",
"String",
"eventName",
",",
"Map",
"<",
"String",
",",
"List",
"<",
"ClientBehavior",
">",
">",
"behaviors",
",",
"FacesContext",
"facesContext",
")",
"{",
"if",
"(",
"behaviors",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
"behaviors",
".",
"get",
"(",
"eventName",
")",
"!=",
"null",
")",
";",
"}"
] | Checks if the given component has a behavior attachment with a given name.
@param eventName the event name to be checked for
@param behaviors map of behaviors attached to the component
@return true if client behavior with given name is attached, false otherwise
@since 4.0.0 | [
"Checks",
"if",
"the",
"given",
"component",
"has",
"a",
"behavior",
"attachment",
"with",
"a",
"given",
"name",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java#L1762-L1771 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java | HtmlRendererUtils.renderBehaviorizedAttribute | public static boolean renderBehaviorizedAttribute(
FacesContext facesContext, ResponseWriter writer,
String componentProperty, UIComponent component, String eventName,
Collection<ClientBehaviorContext.Parameter> eventParameters,
Map<String, List<ClientBehavior>> clientBehaviors,
String htmlAttrName, String attributeValue) throws IOException
{
return renderBehaviorizedAttribute(facesContext, writer,
componentProperty, component,
component.getClientId(facesContext), eventName,
eventParameters, clientBehaviors, htmlAttrName, attributeValue);
} | java | public static boolean renderBehaviorizedAttribute(
FacesContext facesContext, ResponseWriter writer,
String componentProperty, UIComponent component, String eventName,
Collection<ClientBehaviorContext.Parameter> eventParameters,
Map<String, List<ClientBehavior>> clientBehaviors,
String htmlAttrName, String attributeValue) throws IOException
{
return renderBehaviorizedAttribute(facesContext, writer,
componentProperty, component,
component.getClientId(facesContext), eventName,
eventParameters, clientBehaviors, htmlAttrName, attributeValue);
} | [
"public",
"static",
"boolean",
"renderBehaviorizedAttribute",
"(",
"FacesContext",
"facesContext",
",",
"ResponseWriter",
"writer",
",",
"String",
"componentProperty",
",",
"UIComponent",
"component",
",",
"String",
"eventName",
",",
"Collection",
"<",
"ClientBehaviorContext",
".",
"Parameter",
">",
"eventParameters",
",",
"Map",
"<",
"String",
",",
"List",
"<",
"ClientBehavior",
">",
">",
"clientBehaviors",
",",
"String",
"htmlAttrName",
",",
"String",
"attributeValue",
")",
"throws",
"IOException",
"{",
"return",
"renderBehaviorizedAttribute",
"(",
"facesContext",
",",
"writer",
",",
"componentProperty",
",",
"component",
",",
"component",
".",
"getClientId",
"(",
"facesContext",
")",
",",
"eventName",
",",
"eventParameters",
",",
"clientBehaviors",
",",
"htmlAttrName",
",",
"attributeValue",
")",
";",
"}"
] | Render an attribute taking into account the passed event,
the component property and the passed attribute value for the component
property. The event will be rendered on the selected htmlAttrName.
@param facesContext
@param writer
@param componentProperty
@param component
@param eventName
@param clientBehaviors
@param htmlAttrName
@param attributeValue
@return
@throws IOException | [
"Render",
"an",
"attribute",
"taking",
"into",
"account",
"the",
"passed",
"event",
"the",
"component",
"property",
"and",
"the",
"passed",
"attribute",
"value",
"for",
"the",
"component",
"property",
".",
"The",
"event",
"will",
"be",
"rendered",
"on",
"the",
"selected",
"htmlAttrName",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java#L2233-L2244 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java | HtmlRendererUtils.isHideNoSelectionOption | public static boolean isHideNoSelectionOption(UIComponent component)
{
// check hideNoSelectionOption for literal value (String) or ValueExpression (Boolean)
Object hideNoSelectionOptionAttr = component.getAttributes().get(
JSFAttr.HIDE_NO_SELECTION_OPTION_ATTR);
return ((hideNoSelectionOptionAttr instanceof String && "true"
.equalsIgnoreCase((String) hideNoSelectionOptionAttr)) ||
(hideNoSelectionOptionAttr instanceof Boolean && ((Boolean) hideNoSelectionOptionAttr)));
} | java | public static boolean isHideNoSelectionOption(UIComponent component)
{
// check hideNoSelectionOption for literal value (String) or ValueExpression (Boolean)
Object hideNoSelectionOptionAttr = component.getAttributes().get(
JSFAttr.HIDE_NO_SELECTION_OPTION_ATTR);
return ((hideNoSelectionOptionAttr instanceof String && "true"
.equalsIgnoreCase((String) hideNoSelectionOptionAttr)) ||
(hideNoSelectionOptionAttr instanceof Boolean && ((Boolean) hideNoSelectionOptionAttr)));
} | [
"public",
"static",
"boolean",
"isHideNoSelectionOption",
"(",
"UIComponent",
"component",
")",
"{",
"// check hideNoSelectionOption for literal value (String) or ValueExpression (Boolean)",
"Object",
"hideNoSelectionOptionAttr",
"=",
"component",
".",
"getAttributes",
"(",
")",
".",
"get",
"(",
"JSFAttr",
".",
"HIDE_NO_SELECTION_OPTION_ATTR",
")",
";",
"return",
"(",
"(",
"hideNoSelectionOptionAttr",
"instanceof",
"String",
"&&",
"\"true\"",
".",
"equalsIgnoreCase",
"(",
"(",
"String",
")",
"hideNoSelectionOptionAttr",
")",
")",
"||",
"(",
"hideNoSelectionOptionAttr",
"instanceof",
"Boolean",
"&&",
"(",
"(",
"Boolean",
")",
"hideNoSelectionOptionAttr",
")",
")",
")",
";",
"}"
] | Returns the value of the hideNoSelectionOption attribute of the given UIComponent
@param component
@return | [
"Returns",
"the",
"value",
"of",
"the",
"hideNoSelectionOption",
"attribute",
"of",
"the",
"given",
"UIComponent"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java#L2739-L2747 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java | HtmlRendererUtils.renderUnhandledFacesMessages | public static void renderUnhandledFacesMessages(FacesContext facesContext)
throws IOException
{
// create and configure HtmlMessages component
HtmlMessages messages = (HtmlMessages) facesContext.getApplication()
.createComponent(HtmlMessages.COMPONENT_TYPE);
messages.setId("javax_faces_developmentstage_messages");
messages.setTitle("Project Stage[Development]: Unhandled Messages");
messages.setStyle("color:orange");
messages.setRedisplay(false);
// render the component
messages.encodeAll(facesContext);
} | java | public static void renderUnhandledFacesMessages(FacesContext facesContext)
throws IOException
{
// create and configure HtmlMessages component
HtmlMessages messages = (HtmlMessages) facesContext.getApplication()
.createComponent(HtmlMessages.COMPONENT_TYPE);
messages.setId("javax_faces_developmentstage_messages");
messages.setTitle("Project Stage[Development]: Unhandled Messages");
messages.setStyle("color:orange");
messages.setRedisplay(false);
// render the component
messages.encodeAll(facesContext);
} | [
"public",
"static",
"void",
"renderUnhandledFacesMessages",
"(",
"FacesContext",
"facesContext",
")",
"throws",
"IOException",
"{",
"// create and configure HtmlMessages component",
"HtmlMessages",
"messages",
"=",
"(",
"HtmlMessages",
")",
"facesContext",
".",
"getApplication",
"(",
")",
".",
"createComponent",
"(",
"HtmlMessages",
".",
"COMPONENT_TYPE",
")",
";",
"messages",
".",
"setId",
"(",
"\"javax_faces_developmentstage_messages\"",
")",
";",
"messages",
".",
"setTitle",
"(",
"\"Project Stage[Development]: Unhandled Messages\"",
")",
";",
"messages",
".",
"setStyle",
"(",
"\"color:orange\"",
")",
";",
"messages",
".",
"setRedisplay",
"(",
"false",
")",
";",
"// render the component",
"messages",
".",
"encodeAll",
"(",
"facesContext",
")",
";",
"}"
] | Renders all FacesMessages which have not been rendered yet with
the help of a HtmlMessages component.
@param facesContext | [
"Renders",
"all",
"FacesMessages",
"which",
"have",
"not",
"been",
"rendered",
"yet",
"with",
"the",
"help",
"of",
"a",
"HtmlMessages",
"component",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java#L2754-L2766 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.cdi.weld/src/com/ibm/ws/cdi/config/liberty/CDI12ContainerConfig.java | CDI12ContainerConfig.deactivate | protected void deactivate(ComponentContext compcontext) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Deactivating " + this);
}
INSTANCE.compareAndSet(this, null);
} | java | protected void deactivate(ComponentContext compcontext) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Deactivating " + this);
}
INSTANCE.compareAndSet(this, null);
} | [
"protected",
"void",
"deactivate",
"(",
"ComponentContext",
"compcontext",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Deactivating \"",
"+",
"this",
")",
";",
"}",
"INSTANCE",
".",
"compareAndSet",
"(",
"this",
",",
"null",
")",
";",
"}"
] | DS method to deactivate this component
@param compcontext the context of this component | [
"DS",
"method",
"to",
"deactivate",
"this",
"component"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.cdi.weld/src/com/ibm/ws/cdi/config/liberty/CDI12ContainerConfig.java#L100-L105 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.cdi.weld/src/com/ibm/ws/cdi/config/liberty/CDI12ContainerConfig.java | CDI12ContainerConfig.updateConfiguration | protected void updateConfiguration(Map<String, Object> properties) {
if (properties != null) {
this.properties.clear();
this.properties.putAll(properties);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Current Properties: " + this.properties);
}
} | java | protected void updateConfiguration(Map<String, Object> properties) {
if (properties != null) {
this.properties.clear();
this.properties.putAll(properties);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Current Properties: " + this.properties);
}
} | [
"protected",
"void",
"updateConfiguration",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"if",
"(",
"properties",
"!=",
"null",
")",
"{",
"this",
".",
"properties",
".",
"clear",
"(",
")",
";",
"this",
".",
"properties",
".",
"putAll",
"(",
"properties",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Current Properties: \"",
"+",
"this",
".",
"properties",
")",
";",
"}",
"}"
] | Updates the current configuration properties
@param properties the updated configuration properties | [
"Updates",
"the",
"current",
"configuration",
"properties"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.cdi.weld/src/com/ibm/ws/cdi/config/liberty/CDI12ContainerConfig.java#L126-L134 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.cdi.weld/src/com/ibm/ws/cdi/config/liberty/CDI12ContainerConfig.java | CDI12ContainerConfig.isImplicitBeanArchivesScanningDisabled | @Override
public boolean isImplicitBeanArchivesScanningDisabled() {
boolean enableImplicitBeanArchivesValue = (Boolean) this.properties.get("enableImplicitBeanArchives");
if (tc.isWarningEnabled() && !hasLoggedNoImplicitMsg && !enableImplicitBeanArchivesValue) {
hasLoggedNoImplicitMsg = true;
Tr.warning(tc, "implicit.bean.scanning.disabled.CWOWB1009W");
}
return !enableImplicitBeanArchivesValue;
} | java | @Override
public boolean isImplicitBeanArchivesScanningDisabled() {
boolean enableImplicitBeanArchivesValue = (Boolean) this.properties.get("enableImplicitBeanArchives");
if (tc.isWarningEnabled() && !hasLoggedNoImplicitMsg && !enableImplicitBeanArchivesValue) {
hasLoggedNoImplicitMsg = true;
Tr.warning(tc, "implicit.bean.scanning.disabled.CWOWB1009W");
}
return !enableImplicitBeanArchivesValue;
} | [
"@",
"Override",
"public",
"boolean",
"isImplicitBeanArchivesScanningDisabled",
"(",
")",
"{",
"boolean",
"enableImplicitBeanArchivesValue",
"=",
"(",
"Boolean",
")",
"this",
".",
"properties",
".",
"get",
"(",
"\"enableImplicitBeanArchives\"",
")",
";",
"if",
"(",
"tc",
".",
"isWarningEnabled",
"(",
")",
"&&",
"!",
"hasLoggedNoImplicitMsg",
"&&",
"!",
"enableImplicitBeanArchivesValue",
")",
"{",
"hasLoggedNoImplicitMsg",
"=",
"true",
";",
"Tr",
".",
"warning",
"(",
"tc",
",",
"\"implicit.bean.scanning.disabled.CWOWB1009W\"",
")",
";",
"}",
"return",
"!",
"enableImplicitBeanArchivesValue",
";",
"}"
] | Get the Container level configuration about whether to disable the scanning for implicit bean archives.
If the value is true, it means CDI Container will not scan archives without beans.xml to see whether they are implicit archives.
@return true if the value set in the server configuration for the property of enableImplicitBeanArchives is false | [
"Get",
"the",
"Container",
"level",
"configuration",
"about",
"whether",
"to",
"disable",
"the",
"scanning",
"for",
"implicit",
"bean",
"archives",
".",
"If",
"the",
"value",
"is",
"true",
"it",
"means",
"CDI",
"Container",
"will",
"not",
"scan",
"archives",
"without",
"beans",
".",
"xml",
"to",
"see",
"whether",
"they",
"are",
"implicit",
"archives",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.cdi.weld/src/com/ibm/ws/cdi/config/liberty/CDI12ContainerConfig.java#L142-L152 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.clientcontainer/src/com/ibm/ws/clientcontainer/internal/ClientRunnerImpl.java | ClientRunnerImpl.processPostConstruct | @FFDCIgnore(InjectionException.class)
private void processPostConstruct() {
ApplicationClient appClient = ((ClientModuleMetaData) cmd.getModuleMetaData()).getAppClient();
boolean isMetadataComplete = appClient.isMetadataComplete();
LifecycleCallbackHelper helper = new LifecycleCallbackHelper(isMetadataComplete);
List<LifecycleCallback> postConstruct = appClient.getPostConstruct();
CallbackHandler loginCallbackHandler = cmi.getCallbackHandler();
try {
if (loginCallbackHandler != null) {
helper.doPostConstruct(loginCallbackHandler, postConstruct);
}
helper.doPostConstruct(mainClass, postConstruct);
} catch (InjectionException e) {
Tr.error(tc, "INJECTION_POSTCONSTRUCT_CWWKC2452E", new Object[] { e.getLocalizedMessage() });
}
} | java | @FFDCIgnore(InjectionException.class)
private void processPostConstruct() {
ApplicationClient appClient = ((ClientModuleMetaData) cmd.getModuleMetaData()).getAppClient();
boolean isMetadataComplete = appClient.isMetadataComplete();
LifecycleCallbackHelper helper = new LifecycleCallbackHelper(isMetadataComplete);
List<LifecycleCallback> postConstruct = appClient.getPostConstruct();
CallbackHandler loginCallbackHandler = cmi.getCallbackHandler();
try {
if (loginCallbackHandler != null) {
helper.doPostConstruct(loginCallbackHandler, postConstruct);
}
helper.doPostConstruct(mainClass, postConstruct);
} catch (InjectionException e) {
Tr.error(tc, "INJECTION_POSTCONSTRUCT_CWWKC2452E", new Object[] { e.getLocalizedMessage() });
}
} | [
"@",
"FFDCIgnore",
"(",
"InjectionException",
".",
"class",
")",
"private",
"void",
"processPostConstruct",
"(",
")",
"{",
"ApplicationClient",
"appClient",
"=",
"(",
"(",
"ClientModuleMetaData",
")",
"cmd",
".",
"getModuleMetaData",
"(",
")",
")",
".",
"getAppClient",
"(",
")",
";",
"boolean",
"isMetadataComplete",
"=",
"appClient",
".",
"isMetadataComplete",
"(",
")",
";",
"LifecycleCallbackHelper",
"helper",
"=",
"new",
"LifecycleCallbackHelper",
"(",
"isMetadataComplete",
")",
";",
"List",
"<",
"LifecycleCallback",
">",
"postConstruct",
"=",
"appClient",
".",
"getPostConstruct",
"(",
")",
";",
"CallbackHandler",
"loginCallbackHandler",
"=",
"cmi",
".",
"getCallbackHandler",
"(",
")",
";",
"try",
"{",
"if",
"(",
"loginCallbackHandler",
"!=",
"null",
")",
"{",
"helper",
".",
"doPostConstruct",
"(",
"loginCallbackHandler",
",",
"postConstruct",
")",
";",
"}",
"helper",
".",
"doPostConstruct",
"(",
"mainClass",
",",
"postConstruct",
")",
";",
"}",
"catch",
"(",
"InjectionException",
"e",
")",
"{",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"INJECTION_POSTCONSTRUCT_CWWKC2452E\"",
",",
"new",
"Object",
"[",
"]",
"{",
"e",
".",
"getLocalizedMessage",
"(",
")",
"}",
")",
";",
"}",
"}"
] | Process PostContruct annotation or metadata for Main class or Login Callback class. | [
"Process",
"PostContruct",
"annotation",
"or",
"metadata",
"for",
"Main",
"class",
"or",
"Login",
"Callback",
"class",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.clientcontainer/src/com/ibm/ws/clientcontainer/internal/ClientRunnerImpl.java#L117-L133 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.clientcontainer/src/com/ibm/ws/clientcontainer/internal/ClientRunnerImpl.java | ClientRunnerImpl.processPreDestroy | @FFDCIgnore(InjectionException.class)
private void processPreDestroy() {
ApplicationClient appClient = ((ClientModuleMetaData) cmd.getModuleMetaData()).getAppClient();
boolean isMetadataComplete = appClient.isMetadataComplete();
LifecycleCallbackHelper helper = new LifecycleCallbackHelper(isMetadataComplete);
List<LifecycleCallback> preDestroy = appClient.getPreDestroy();
CallbackHandler loginCallbackHandler = cmi.getCallbackHandler();
try {
if (loginCallbackHandler != null) {
helper.doPreDestroy(loginCallbackHandler, preDestroy);
}
} catch (InjectionException e) {
Tr.error(tc, "INJECTION_PREDESTROY_CWWKC2453E", new Object[] { e.getLocalizedMessage() });
}
} | java | @FFDCIgnore(InjectionException.class)
private void processPreDestroy() {
ApplicationClient appClient = ((ClientModuleMetaData) cmd.getModuleMetaData()).getAppClient();
boolean isMetadataComplete = appClient.isMetadataComplete();
LifecycleCallbackHelper helper = new LifecycleCallbackHelper(isMetadataComplete);
List<LifecycleCallback> preDestroy = appClient.getPreDestroy();
CallbackHandler loginCallbackHandler = cmi.getCallbackHandler();
try {
if (loginCallbackHandler != null) {
helper.doPreDestroy(loginCallbackHandler, preDestroy);
}
} catch (InjectionException e) {
Tr.error(tc, "INJECTION_PREDESTROY_CWWKC2453E", new Object[] { e.getLocalizedMessage() });
}
} | [
"@",
"FFDCIgnore",
"(",
"InjectionException",
".",
"class",
")",
"private",
"void",
"processPreDestroy",
"(",
")",
"{",
"ApplicationClient",
"appClient",
"=",
"(",
"(",
"ClientModuleMetaData",
")",
"cmd",
".",
"getModuleMetaData",
"(",
")",
")",
".",
"getAppClient",
"(",
")",
";",
"boolean",
"isMetadataComplete",
"=",
"appClient",
".",
"isMetadataComplete",
"(",
")",
";",
"LifecycleCallbackHelper",
"helper",
"=",
"new",
"LifecycleCallbackHelper",
"(",
"isMetadataComplete",
")",
";",
"List",
"<",
"LifecycleCallback",
">",
"preDestroy",
"=",
"appClient",
".",
"getPreDestroy",
"(",
")",
";",
"CallbackHandler",
"loginCallbackHandler",
"=",
"cmi",
".",
"getCallbackHandler",
"(",
")",
";",
"try",
"{",
"if",
"(",
"loginCallbackHandler",
"!=",
"null",
")",
"{",
"helper",
".",
"doPreDestroy",
"(",
"loginCallbackHandler",
",",
"preDestroy",
")",
";",
"}",
"}",
"catch",
"(",
"InjectionException",
"e",
")",
"{",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"INJECTION_PREDESTROY_CWWKC2453E\"",
",",
"new",
"Object",
"[",
"]",
"{",
"e",
".",
"getLocalizedMessage",
"(",
")",
"}",
")",
";",
"}",
"}"
] | Process PreDestroy annotation or metadata for Login Callback class. | [
"Process",
"PreDestroy",
"annotation",
"or",
"metadata",
"for",
"Login",
"Callback",
"class",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.clientcontainer/src/com/ibm/ws/clientcontainer/internal/ClientRunnerImpl.java#L138-L153 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.diagnostics/src/com/ibm/ws/diagnostics/java/NetworkInterfaces.java | NetworkInterfaces.introspect | @Override
public void introspect(final PrintWriter writer) throws Exception {
// Put out a header before the information
writer.println("Network Interface Information");
writer.println("-----------------------------");
// Extract the interface information inside a doPriv
try {
AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() {
@Override
public Void run() throws IOException {
// Iterate over the system network interfaces
Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
while (interfaces.hasMoreElements()) {
getInterfaceInfo(interfaces.nextElement(), writer);
}
return null;
}
});
} catch (PrivilegedActionException pae) {
throw (Exception) pae.getCause();
}
} | java | @Override
public void introspect(final PrintWriter writer) throws Exception {
// Put out a header before the information
writer.println("Network Interface Information");
writer.println("-----------------------------");
// Extract the interface information inside a doPriv
try {
AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() {
@Override
public Void run() throws IOException {
// Iterate over the system network interfaces
Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
while (interfaces.hasMoreElements()) {
getInterfaceInfo(interfaces.nextElement(), writer);
}
return null;
}
});
} catch (PrivilegedActionException pae) {
throw (Exception) pae.getCause();
}
} | [
"@",
"Override",
"public",
"void",
"introspect",
"(",
"final",
"PrintWriter",
"writer",
")",
"throws",
"Exception",
"{",
"// Put out a header before the information",
"writer",
".",
"println",
"(",
"\"Network Interface Information\"",
")",
";",
"writer",
".",
"println",
"(",
"\"-----------------------------\"",
")",
";",
"// Extract the interface information inside a doPriv",
"try",
"{",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedExceptionAction",
"<",
"Void",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Void",
"run",
"(",
")",
"throws",
"IOException",
"{",
"// Iterate over the system network interfaces",
"Enumeration",
"<",
"NetworkInterface",
">",
"interfaces",
"=",
"NetworkInterface",
".",
"getNetworkInterfaces",
"(",
")",
";",
"while",
"(",
"interfaces",
".",
"hasMoreElements",
"(",
")",
")",
"{",
"getInterfaceInfo",
"(",
"interfaces",
".",
"nextElement",
"(",
")",
",",
"writer",
")",
";",
"}",
"return",
"null",
";",
"}",
"}",
")",
";",
"}",
"catch",
"(",
"PrivilegedActionException",
"pae",
")",
"{",
"throw",
"(",
"Exception",
")",
"pae",
".",
"getCause",
"(",
")",
";",
"}",
"}"
] | Introspect all network interfaces for diagnostic information.
@param out the output stream to write diagnostics to | [
"Introspect",
"all",
"network",
"interfaces",
"for",
"diagnostic",
"information",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.diagnostics/src/com/ibm/ws/diagnostics/java/NetworkInterfaces.java#L46-L69 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.diagnostics/src/com/ibm/ws/diagnostics/java/NetworkInterfaces.java | NetworkInterfaces.getInterfaceInfo | private void getInterfaceInfo(NetworkInterface networkInterface, PrintWriter out) throws IOException {
final String indent = " ";
// Basic information from the interface
out.println();
out.append("Interface: ").append(networkInterface.getDisplayName()).println();
out.append(indent).append(" loopback: ").append(Boolean.toString(networkInterface.isLoopback())).println();
out.append(indent).append(" mtu: ").append(Integer.toString(networkInterface.getMTU())).println();
out.append(indent).append(" point-to-point: ").append(Boolean.toString(networkInterface.isPointToPoint())).println();
out.append(indent).append("supports multicast: ").append(Boolean.toString(networkInterface.supportsMulticast())).println();
out.append(indent).append(" up: ").append(Boolean.toString(networkInterface.isUp())).println();
out.append(indent).append(" virtual: ").append(Boolean.toString(networkInterface.isVirtual())).println();
// Interface address information
List<InterfaceAddress> intfAddresses = networkInterface.getInterfaceAddresses();
for (int i = 0; i < intfAddresses.size(); i++) {
out.append(indent).append("InterfaceAddress #").append(Integer.toString(i + 1)).append(": ").append(String.valueOf(intfAddresses.get(i))).println();
}
// Network interface information
Enumeration<InetAddress> inetAddresses = networkInterface.getInetAddresses();
for (int i = 1; inetAddresses.hasMoreElements(); i++) {
InetAddress inetAddress = inetAddresses.nextElement();
out.append(indent).append("InetAddress #").append(Integer.toString(i)).println(":");
out.append(indent).append(indent).append(" IP address: ").append(inetAddress.getHostAddress()).println();
out.append(indent).append(indent).append(" host name: ").append(inetAddress.getHostName()).println();
out.append(indent).append(indent).append("FQDN host name: ").append(inetAddress.getCanonicalHostName()).println();
}
} | java | private void getInterfaceInfo(NetworkInterface networkInterface, PrintWriter out) throws IOException {
final String indent = " ";
// Basic information from the interface
out.println();
out.append("Interface: ").append(networkInterface.getDisplayName()).println();
out.append(indent).append(" loopback: ").append(Boolean.toString(networkInterface.isLoopback())).println();
out.append(indent).append(" mtu: ").append(Integer.toString(networkInterface.getMTU())).println();
out.append(indent).append(" point-to-point: ").append(Boolean.toString(networkInterface.isPointToPoint())).println();
out.append(indent).append("supports multicast: ").append(Boolean.toString(networkInterface.supportsMulticast())).println();
out.append(indent).append(" up: ").append(Boolean.toString(networkInterface.isUp())).println();
out.append(indent).append(" virtual: ").append(Boolean.toString(networkInterface.isVirtual())).println();
// Interface address information
List<InterfaceAddress> intfAddresses = networkInterface.getInterfaceAddresses();
for (int i = 0; i < intfAddresses.size(); i++) {
out.append(indent).append("InterfaceAddress #").append(Integer.toString(i + 1)).append(": ").append(String.valueOf(intfAddresses.get(i))).println();
}
// Network interface information
Enumeration<InetAddress> inetAddresses = networkInterface.getInetAddresses();
for (int i = 1; inetAddresses.hasMoreElements(); i++) {
InetAddress inetAddress = inetAddresses.nextElement();
out.append(indent).append("InetAddress #").append(Integer.toString(i)).println(":");
out.append(indent).append(indent).append(" IP address: ").append(inetAddress.getHostAddress()).println();
out.append(indent).append(indent).append(" host name: ").append(inetAddress.getHostName()).println();
out.append(indent).append(indent).append("FQDN host name: ").append(inetAddress.getCanonicalHostName()).println();
}
} | [
"private",
"void",
"getInterfaceInfo",
"(",
"NetworkInterface",
"networkInterface",
",",
"PrintWriter",
"out",
")",
"throws",
"IOException",
"{",
"final",
"String",
"indent",
"=",
"\" \"",
";",
"// Basic information from the interface",
"out",
".",
"println",
"(",
")",
";",
"out",
".",
"append",
"(",
"\"Interface: \"",
")",
".",
"append",
"(",
"networkInterface",
".",
"getDisplayName",
"(",
")",
")",
".",
"println",
"(",
")",
";",
"out",
".",
"append",
"(",
"indent",
")",
".",
"append",
"(",
"\" loopback: \"",
")",
".",
"append",
"(",
"Boolean",
".",
"toString",
"(",
"networkInterface",
".",
"isLoopback",
"(",
")",
")",
")",
".",
"println",
"(",
")",
";",
"out",
".",
"append",
"(",
"indent",
")",
".",
"append",
"(",
"\" mtu: \"",
")",
".",
"append",
"(",
"Integer",
".",
"toString",
"(",
"networkInterface",
".",
"getMTU",
"(",
")",
")",
")",
".",
"println",
"(",
")",
";",
"out",
".",
"append",
"(",
"indent",
")",
".",
"append",
"(",
"\" point-to-point: \"",
")",
".",
"append",
"(",
"Boolean",
".",
"toString",
"(",
"networkInterface",
".",
"isPointToPoint",
"(",
")",
")",
")",
".",
"println",
"(",
")",
";",
"out",
".",
"append",
"(",
"indent",
")",
".",
"append",
"(",
"\"supports multicast: \"",
")",
".",
"append",
"(",
"Boolean",
".",
"toString",
"(",
"networkInterface",
".",
"supportsMulticast",
"(",
")",
")",
")",
".",
"println",
"(",
")",
";",
"out",
".",
"append",
"(",
"indent",
")",
".",
"append",
"(",
"\" up: \"",
")",
".",
"append",
"(",
"Boolean",
".",
"toString",
"(",
"networkInterface",
".",
"isUp",
"(",
")",
")",
")",
".",
"println",
"(",
")",
";",
"out",
".",
"append",
"(",
"indent",
")",
".",
"append",
"(",
"\" virtual: \"",
")",
".",
"append",
"(",
"Boolean",
".",
"toString",
"(",
"networkInterface",
".",
"isVirtual",
"(",
")",
")",
")",
".",
"println",
"(",
")",
";",
"// Interface address information",
"List",
"<",
"InterfaceAddress",
">",
"intfAddresses",
"=",
"networkInterface",
".",
"getInterfaceAddresses",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"intfAddresses",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"out",
".",
"append",
"(",
"indent",
")",
".",
"append",
"(",
"\"InterfaceAddress #\"",
")",
".",
"append",
"(",
"Integer",
".",
"toString",
"(",
"i",
"+",
"1",
")",
")",
".",
"append",
"(",
"\": \"",
")",
".",
"append",
"(",
"String",
".",
"valueOf",
"(",
"intfAddresses",
".",
"get",
"(",
"i",
")",
")",
")",
".",
"println",
"(",
")",
";",
"}",
"// Network interface information",
"Enumeration",
"<",
"InetAddress",
">",
"inetAddresses",
"=",
"networkInterface",
".",
"getInetAddresses",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"inetAddresses",
".",
"hasMoreElements",
"(",
")",
";",
"i",
"++",
")",
"{",
"InetAddress",
"inetAddress",
"=",
"inetAddresses",
".",
"nextElement",
"(",
")",
";",
"out",
".",
"append",
"(",
"indent",
")",
".",
"append",
"(",
"\"InetAddress #\"",
")",
".",
"append",
"(",
"Integer",
".",
"toString",
"(",
"i",
")",
")",
".",
"println",
"(",
"\":\"",
")",
";",
"out",
".",
"append",
"(",
"indent",
")",
".",
"append",
"(",
"indent",
")",
".",
"append",
"(",
"\" IP address: \"",
")",
".",
"append",
"(",
"inetAddress",
".",
"getHostAddress",
"(",
")",
")",
".",
"println",
"(",
")",
";",
"out",
".",
"append",
"(",
"indent",
")",
".",
"append",
"(",
"indent",
")",
".",
"append",
"(",
"\" host name: \"",
")",
".",
"append",
"(",
"inetAddress",
".",
"getHostName",
"(",
")",
")",
".",
"println",
"(",
")",
";",
"out",
".",
"append",
"(",
"indent",
")",
".",
"append",
"(",
"indent",
")",
".",
"append",
"(",
"\"FQDN host name: \"",
")",
".",
"append",
"(",
"inetAddress",
".",
"getCanonicalHostName",
"(",
")",
")",
".",
"println",
"(",
")",
";",
"}",
"}"
] | Capture interface specific information and write it to the provided writer.
@param networkInterface the interface to introspect
@param writer the print writer to write information to | [
"Capture",
"interface",
"specific",
"information",
"and",
"write",
"it",
"to",
"the",
"provided",
"writer",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.diagnostics/src/com/ibm/ws/diagnostics/java/NetworkInterfaces.java#L77-L105 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.context/src/com/ibm/ws/context/service/serializable/ContextualInvocationHandler.java | ContextualInvocationHandler.invoke | private Object invoke(Method method, Object[] args) throws IllegalAccessException, InvocationTargetException {
ArrayList<ThreadContext> contextAppliedToThread = threadContextDescriptor.taskStarting();
try {
return method.invoke(object, args);
} finally {
threadContextDescriptor.taskStopping(contextAppliedToThread);
}
} | java | private Object invoke(Method method, Object[] args) throws IllegalAccessException, InvocationTargetException {
ArrayList<ThreadContext> contextAppliedToThread = threadContextDescriptor.taskStarting();
try {
return method.invoke(object, args);
} finally {
threadContextDescriptor.taskStopping(contextAppliedToThread);
}
} | [
"private",
"Object",
"invoke",
"(",
"Method",
"method",
",",
"Object",
"[",
"]",
"args",
")",
"throws",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"ArrayList",
"<",
"ThreadContext",
">",
"contextAppliedToThread",
"=",
"threadContextDescriptor",
".",
"taskStarting",
"(",
")",
";",
"try",
"{",
"return",
"method",
".",
"invoke",
"(",
"object",
",",
"args",
")",
";",
"}",
"finally",
"{",
"threadContextDescriptor",
".",
"taskStopping",
"(",
"contextAppliedToThread",
")",
";",
"}",
"}"
] | Apply context, invoke the method, then remove the context from the thread.
@param method the method
@param args method parameters
@return result of the method
@throws IllegalAccessException if unable to access the method
@throws InvocationTargetException if the method fails | [
"Apply",
"context",
"invoke",
"the",
"method",
"then",
"remove",
"the",
"context",
"from",
"the",
"thread",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.context/src/com/ibm/ws/context/service/serializable/ContextualInvocationHandler.java#L73-L80 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/ViewDeclarationLanguageFactoryImpl.java | ViewDeclarationLanguageFactoryImpl.initialize | private synchronized void initialize()
{
if (!_initialized)
{
FacesContext context = FacesContext.getCurrentInstance();
if (isFacelets2Enabled(context))
{
logWarningIfLegacyFaceletViewHandlerIsPresent(context);
if (MyfacesConfig.getCurrentInstance(
context.getExternalContext()).isSupportJSPAndFacesEL())
{
_supportedLanguages = new ViewDeclarationLanguageStrategy[2];
_supportedLanguages[0] = new FaceletViewDeclarationLanguageStrategy();
_supportedLanguages[1] = new JspViewDeclarationLanguageStrategy();
}
else
{
_supportedLanguages = new ViewDeclarationLanguageStrategy[1];
_supportedLanguages[0] = new FaceletViewDeclarationLanguageStrategy();
}
}
else
{
// Support JSP only
_supportedLanguages = new ViewDeclarationLanguageStrategy[1];
_supportedLanguages[0] = new JspViewDeclarationLanguageStrategy();
}
_initialized = true;
}
} | java | private synchronized void initialize()
{
if (!_initialized)
{
FacesContext context = FacesContext.getCurrentInstance();
if (isFacelets2Enabled(context))
{
logWarningIfLegacyFaceletViewHandlerIsPresent(context);
if (MyfacesConfig.getCurrentInstance(
context.getExternalContext()).isSupportJSPAndFacesEL())
{
_supportedLanguages = new ViewDeclarationLanguageStrategy[2];
_supportedLanguages[0] = new FaceletViewDeclarationLanguageStrategy();
_supportedLanguages[1] = new JspViewDeclarationLanguageStrategy();
}
else
{
_supportedLanguages = new ViewDeclarationLanguageStrategy[1];
_supportedLanguages[0] = new FaceletViewDeclarationLanguageStrategy();
}
}
else
{
// Support JSP only
_supportedLanguages = new ViewDeclarationLanguageStrategy[1];
_supportedLanguages[0] = new JspViewDeclarationLanguageStrategy();
}
_initialized = true;
}
} | [
"private",
"synchronized",
"void",
"initialize",
"(",
")",
"{",
"if",
"(",
"!",
"_initialized",
")",
"{",
"FacesContext",
"context",
"=",
"FacesContext",
".",
"getCurrentInstance",
"(",
")",
";",
"if",
"(",
"isFacelets2Enabled",
"(",
"context",
")",
")",
"{",
"logWarningIfLegacyFaceletViewHandlerIsPresent",
"(",
"context",
")",
";",
"if",
"(",
"MyfacesConfig",
".",
"getCurrentInstance",
"(",
"context",
".",
"getExternalContext",
"(",
")",
")",
".",
"isSupportJSPAndFacesEL",
"(",
")",
")",
"{",
"_supportedLanguages",
"=",
"new",
"ViewDeclarationLanguageStrategy",
"[",
"2",
"]",
";",
"_supportedLanguages",
"[",
"0",
"]",
"=",
"new",
"FaceletViewDeclarationLanguageStrategy",
"(",
")",
";",
"_supportedLanguages",
"[",
"1",
"]",
"=",
"new",
"JspViewDeclarationLanguageStrategy",
"(",
")",
";",
"}",
"else",
"{",
"_supportedLanguages",
"=",
"new",
"ViewDeclarationLanguageStrategy",
"[",
"1",
"]",
";",
"_supportedLanguages",
"[",
"0",
"]",
"=",
"new",
"FaceletViewDeclarationLanguageStrategy",
"(",
")",
";",
"}",
"}",
"else",
"{",
"// Support JSP only",
"_supportedLanguages",
"=",
"new",
"ViewDeclarationLanguageStrategy",
"[",
"1",
"]",
";",
"_supportedLanguages",
"[",
"0",
"]",
"=",
"new",
"JspViewDeclarationLanguageStrategy",
"(",
")",
";",
"}",
"_initialized",
"=",
"true",
";",
"}",
"}"
] | Initialize the supported view declaration languages. | [
"Initialize",
"the",
"supported",
"view",
"declaration",
"languages",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/ViewDeclarationLanguageFactoryImpl.java#L90-L122 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/ViewDeclarationLanguageFactoryImpl.java | ViewDeclarationLanguageFactoryImpl.isFacelets2Enabled | private boolean isFacelets2Enabled(FacesContext context)
{
String param = context.getExternalContext().getInitParameter(PARAM_DISABLE_JSF_FACELET);
boolean facelets2ParamDisabled = (param != null && Boolean.parseBoolean(param.toLowerCase()));
return !facelets2ParamDisabled;
} | java | private boolean isFacelets2Enabled(FacesContext context)
{
String param = context.getExternalContext().getInitParameter(PARAM_DISABLE_JSF_FACELET);
boolean facelets2ParamDisabled = (param != null && Boolean.parseBoolean(param.toLowerCase()));
return !facelets2ParamDisabled;
} | [
"private",
"boolean",
"isFacelets2Enabled",
"(",
"FacesContext",
"context",
")",
"{",
"String",
"param",
"=",
"context",
".",
"getExternalContext",
"(",
")",
".",
"getInitParameter",
"(",
"PARAM_DISABLE_JSF_FACELET",
")",
";",
"boolean",
"facelets2ParamDisabled",
"=",
"(",
"param",
"!=",
"null",
"&&",
"Boolean",
".",
"parseBoolean",
"(",
"param",
".",
"toLowerCase",
"(",
")",
")",
")",
";",
"return",
"!",
"facelets2ParamDisabled",
";",
"}"
] | Determines if the current application uses Facelets-2.
To accomplish that it looks at the init param javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER,
@param context the <code>FacesContext</code>
@return <code>true</code> if the current application uses the built in Facelets-2,
<code>false</code> otherwise (e.g. it uses Facelets-1 or only JSP). | [
"Determines",
"if",
"the",
"current",
"application",
"uses",
"Facelets",
"-",
"2",
".",
"To",
"accomplish",
"that",
"it",
"looks",
"at",
"the",
"init",
"param",
"javax",
".",
"faces",
".",
"DISABLE_FACELET_JSF_VIEWHANDLER"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/ViewDeclarationLanguageFactoryImpl.java#L132-L138 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jaxrs.2.0.common/src/org/apache/cxf/common/logging/LogUtils.java | LogUtils.createLogger | @FFDCIgnore({ MissingResourceException.class, IllegalArgumentException.class })
protected static Logger createLogger(final Class<?> cls,
String name,
String loggerName) {
ClassLoader orig = getContextClassLoader();
ClassLoader n = getClassLoader(cls);
if (n != null) {
setContextClassLoader(n);
}
String bundleName = name;
try {
Logger logger = null;
ResourceBundle b = null;
if (bundleName == null) {
//grab the bundle prior to the call to Logger.getLogger(...) so the
//ResourceBundle can be loaded outside the big sync block that getLogger really is
bundleName = BundleUtils.getBundleName(cls);
try {
b = BundleUtils.getBundle(cls);
} catch (MissingResourceException rex) {
//ignore
}
} else {
bundleName = BundleUtils.getBundleName(cls, bundleName);
try {
b = BundleUtils.getBundle(cls, bundleName);
} catch (MissingResourceException rex) {
//ignore
}
}
if (b != null) {
b.getLocale();
}
if (loggerClass != null) {
try {
Constructor<?> cns = loggerClass.getConstructor(String.class, String.class);
if (name == null) {
try {
return (Logger) cns.newInstance(loggerName, bundleName);
} catch (InvocationTargetException ite) {
if (ite.getTargetException() instanceof MissingResourceException) {
return (Logger) cns.newInstance(loggerName, null);
} else {
throw ite;
}
}
} else {
try {
return (Logger) cns.newInstance(loggerName, bundleName);
} catch (InvocationTargetException ite) {
if (ite.getTargetException() instanceof MissingResourceException) {
throw (MissingResourceException) ite.getTargetException();
} else {
throw ite;
}
}
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
try {
logger = Logger.getLogger(loggerName, bundleName); //NOPMD
} catch (IllegalArgumentException iae) {
//likely a mismatch on the bundle name, just return the default
logger = Logger.getLogger(loggerName); //NOPMD
} catch (MissingResourceException rex) {
logger = Logger.getLogger(loggerName); //NOPMD
} finally {
b = null;
}
return logger;
} finally {
if (n != orig) {
setContextClassLoader(orig);
}
}
} | java | @FFDCIgnore({ MissingResourceException.class, IllegalArgumentException.class })
protected static Logger createLogger(final Class<?> cls,
String name,
String loggerName) {
ClassLoader orig = getContextClassLoader();
ClassLoader n = getClassLoader(cls);
if (n != null) {
setContextClassLoader(n);
}
String bundleName = name;
try {
Logger logger = null;
ResourceBundle b = null;
if (bundleName == null) {
//grab the bundle prior to the call to Logger.getLogger(...) so the
//ResourceBundle can be loaded outside the big sync block that getLogger really is
bundleName = BundleUtils.getBundleName(cls);
try {
b = BundleUtils.getBundle(cls);
} catch (MissingResourceException rex) {
//ignore
}
} else {
bundleName = BundleUtils.getBundleName(cls, bundleName);
try {
b = BundleUtils.getBundle(cls, bundleName);
} catch (MissingResourceException rex) {
//ignore
}
}
if (b != null) {
b.getLocale();
}
if (loggerClass != null) {
try {
Constructor<?> cns = loggerClass.getConstructor(String.class, String.class);
if (name == null) {
try {
return (Logger) cns.newInstance(loggerName, bundleName);
} catch (InvocationTargetException ite) {
if (ite.getTargetException() instanceof MissingResourceException) {
return (Logger) cns.newInstance(loggerName, null);
} else {
throw ite;
}
}
} else {
try {
return (Logger) cns.newInstance(loggerName, bundleName);
} catch (InvocationTargetException ite) {
if (ite.getTargetException() instanceof MissingResourceException) {
throw (MissingResourceException) ite.getTargetException();
} else {
throw ite;
}
}
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
try {
logger = Logger.getLogger(loggerName, bundleName); //NOPMD
} catch (IllegalArgumentException iae) {
//likely a mismatch on the bundle name, just return the default
logger = Logger.getLogger(loggerName); //NOPMD
} catch (MissingResourceException rex) {
logger = Logger.getLogger(loggerName); //NOPMD
} finally {
b = null;
}
return logger;
} finally {
if (n != orig) {
setContextClassLoader(orig);
}
}
} | [
"@",
"FFDCIgnore",
"(",
"{",
"MissingResourceException",
".",
"class",
",",
"IllegalArgumentException",
".",
"class",
"}",
")",
"protected",
"static",
"Logger",
"createLogger",
"(",
"final",
"Class",
"<",
"?",
">",
"cls",
",",
"String",
"name",
",",
"String",
"loggerName",
")",
"{",
"ClassLoader",
"orig",
"=",
"getContextClassLoader",
"(",
")",
";",
"ClassLoader",
"n",
"=",
"getClassLoader",
"(",
"cls",
")",
";",
"if",
"(",
"n",
"!=",
"null",
")",
"{",
"setContextClassLoader",
"(",
"n",
")",
";",
"}",
"String",
"bundleName",
"=",
"name",
";",
"try",
"{",
"Logger",
"logger",
"=",
"null",
";",
"ResourceBundle",
"b",
"=",
"null",
";",
"if",
"(",
"bundleName",
"==",
"null",
")",
"{",
"//grab the bundle prior to the call to Logger.getLogger(...) so the",
"//ResourceBundle can be loaded outside the big sync block that getLogger really is",
"bundleName",
"=",
"BundleUtils",
".",
"getBundleName",
"(",
"cls",
")",
";",
"try",
"{",
"b",
"=",
"BundleUtils",
".",
"getBundle",
"(",
"cls",
")",
";",
"}",
"catch",
"(",
"MissingResourceException",
"rex",
")",
"{",
"//ignore",
"}",
"}",
"else",
"{",
"bundleName",
"=",
"BundleUtils",
".",
"getBundleName",
"(",
"cls",
",",
"bundleName",
")",
";",
"try",
"{",
"b",
"=",
"BundleUtils",
".",
"getBundle",
"(",
"cls",
",",
"bundleName",
")",
";",
"}",
"catch",
"(",
"MissingResourceException",
"rex",
")",
"{",
"//ignore",
"}",
"}",
"if",
"(",
"b",
"!=",
"null",
")",
"{",
"b",
".",
"getLocale",
"(",
")",
";",
"}",
"if",
"(",
"loggerClass",
"!=",
"null",
")",
"{",
"try",
"{",
"Constructor",
"<",
"?",
">",
"cns",
"=",
"loggerClass",
".",
"getConstructor",
"(",
"String",
".",
"class",
",",
"String",
".",
"class",
")",
";",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"try",
"{",
"return",
"(",
"Logger",
")",
"cns",
".",
"newInstance",
"(",
"loggerName",
",",
"bundleName",
")",
";",
"}",
"catch",
"(",
"InvocationTargetException",
"ite",
")",
"{",
"if",
"(",
"ite",
".",
"getTargetException",
"(",
")",
"instanceof",
"MissingResourceException",
")",
"{",
"return",
"(",
"Logger",
")",
"cns",
".",
"newInstance",
"(",
"loggerName",
",",
"null",
")",
";",
"}",
"else",
"{",
"throw",
"ite",
";",
"}",
"}",
"}",
"else",
"{",
"try",
"{",
"return",
"(",
"Logger",
")",
"cns",
".",
"newInstance",
"(",
"loggerName",
",",
"bundleName",
")",
";",
"}",
"catch",
"(",
"InvocationTargetException",
"ite",
")",
"{",
"if",
"(",
"ite",
".",
"getTargetException",
"(",
")",
"instanceof",
"MissingResourceException",
")",
"{",
"throw",
"(",
"MissingResourceException",
")",
"ite",
".",
"getTargetException",
"(",
")",
";",
"}",
"else",
"{",
"throw",
"ite",
";",
"}",
"}",
"}",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"e",
")",
";",
"}",
"}",
"try",
"{",
"logger",
"=",
"Logger",
".",
"getLogger",
"(",
"loggerName",
",",
"bundleName",
")",
";",
"//NOPMD",
"}",
"catch",
"(",
"IllegalArgumentException",
"iae",
")",
"{",
"//likely a mismatch on the bundle name, just return the default",
"logger",
"=",
"Logger",
".",
"getLogger",
"(",
"loggerName",
")",
";",
"//NOPMD",
"}",
"catch",
"(",
"MissingResourceException",
"rex",
")",
"{",
"logger",
"=",
"Logger",
".",
"getLogger",
"(",
"loggerName",
")",
";",
"//NOPMD",
"}",
"finally",
"{",
"b",
"=",
"null",
";",
"}",
"return",
"logger",
";",
"}",
"finally",
"{",
"if",
"(",
"n",
"!=",
"orig",
")",
"{",
"setContextClassLoader",
"(",
"orig",
")",
";",
"}",
"}",
"}"
] | Create a logger | [
"Create",
"a",
"logger"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxrs.2.0.common/src/org/apache/cxf/common/logging/LogUtils.java#L237-L316 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.