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.jca.cm/src/com/ibm/ejs/j2c/ConnectionManager.java | ConnectionManager.raSupportsCCILocalTran | private boolean raSupportsCCILocalTran(ManagedConnectionFactory mcf) throws ResourceException {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
ConnectionFactory cf;
ResourceAdapterMetaData raMetaData;
boolean cciLocalTranSupported = false;
if (isTraceOn
&& tc.isEntryEnabled())
Tr.entry(this, tc, "raSupportsCCILocalTran");
if (gConfigProps.transactionSupport == TransactionSupportLevel.XATransaction
|| gConfigProps.transactionSupport == TransactionSupportLevel.LocalTransaction) {
cf = (ConnectionFactory) mcf.createConnectionFactory(this);
raMetaData = cf.getMetaData();
if (raMetaData != null)
cciLocalTranSupported = raMetaData.supportsLocalTransactionDemarcation();
}
if (isTraceOn
&& tc.isEntryEnabled())
Tr.exit(this, tc, "raSupportsCCILocalTran " + cciLocalTranSupported);
return cciLocalTranSupported;
} | java | private boolean raSupportsCCILocalTran(ManagedConnectionFactory mcf) throws ResourceException {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
ConnectionFactory cf;
ResourceAdapterMetaData raMetaData;
boolean cciLocalTranSupported = false;
if (isTraceOn
&& tc.isEntryEnabled())
Tr.entry(this, tc, "raSupportsCCILocalTran");
if (gConfigProps.transactionSupport == TransactionSupportLevel.XATransaction
|| gConfigProps.transactionSupport == TransactionSupportLevel.LocalTransaction) {
cf = (ConnectionFactory) mcf.createConnectionFactory(this);
raMetaData = cf.getMetaData();
if (raMetaData != null)
cciLocalTranSupported = raMetaData.supportsLocalTransactionDemarcation();
}
if (isTraceOn
&& tc.isEntryEnabled())
Tr.exit(this, tc, "raSupportsCCILocalTran " + cciLocalTranSupported);
return cciLocalTranSupported;
} | [
"private",
"boolean",
"raSupportsCCILocalTran",
"(",
"ManagedConnectionFactory",
"mcf",
")",
"throws",
"ResourceException",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"ConnectionFactory",
"cf",
";",
"ResourceAdapterMetaData",
"raMetaData",
";",
"boolean",
"cciLocalTranSupported",
"=",
"false",
";",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"raSupportsCCILocalTran\"",
")",
";",
"if",
"(",
"gConfigProps",
".",
"transactionSupport",
"==",
"TransactionSupportLevel",
".",
"XATransaction",
"||",
"gConfigProps",
".",
"transactionSupport",
"==",
"TransactionSupportLevel",
".",
"LocalTransaction",
")",
"{",
"cf",
"=",
"(",
"ConnectionFactory",
")",
"mcf",
".",
"createConnectionFactory",
"(",
"this",
")",
";",
"raMetaData",
"=",
"cf",
".",
"getMetaData",
"(",
")",
";",
"if",
"(",
"raMetaData",
"!=",
"null",
")",
"cciLocalTranSupported",
"=",
"raMetaData",
".",
"supportsLocalTransactionDemarcation",
"(",
")",
";",
"}",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"raSupportsCCILocalTran \"",
"+",
"cciLocalTranSupported",
")",
";",
"return",
"cciLocalTranSupported",
";",
"}"
] | This method returns a boolean value indicating whether
or not CCI Local Transaction support is provided
by the resource adapter. | [
"This",
"method",
"returns",
"a",
"boolean",
"value",
"indicating",
"whether",
"or",
"not",
"CCI",
"Local",
"Transaction",
"support",
"is",
"provided",
"by",
"the",
"resource",
"adapter",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectionManager.java#L1527-L1551 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectionManager.java | ConnectionManager.readObject | private void readObject(ObjectInputStream s) throws java.io.IOException, java.lang.ClassNotFoundException {
throw new UnsupportedOperationException(); // not serializable
} | java | private void readObject(ObjectInputStream s) throws java.io.IOException, java.lang.ClassNotFoundException {
throw new UnsupportedOperationException(); // not serializable
} | [
"private",
"void",
"readObject",
"(",
"ObjectInputStream",
"s",
")",
"throws",
"java",
".",
"io",
".",
"IOException",
",",
"java",
".",
"lang",
".",
"ClassNotFoundException",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(",
")",
";",
"// not serializable",
"}"
] | Overrides the default deserialization for reading this object | [
"Overrides",
"the",
"default",
"deserialization",
"for",
"reading",
"this",
"object"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectionManager.java#L1556-L1558 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectionManager.java | ConnectionManager.purgePool | @Override
public void purgePool() throws ResourceException {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled()) {
Tr.entry(this, tc, "purgePool");
}
_pm.purgePoolContents();
if (isTraceOn && tc.isEntryEnabled()) {
Tr.exit(this, tc, "purgePool");
}
} | java | @Override
public void purgePool() throws ResourceException {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled()) {
Tr.entry(this, tc, "purgePool");
}
_pm.purgePoolContents();
if (isTraceOn && tc.isEntryEnabled()) {
Tr.exit(this, tc, "purgePool");
}
} | [
"@",
"Override",
"public",
"void",
"purgePool",
"(",
")",
"throws",
"ResourceException",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"purgePool\"",
")",
";",
"}",
"_pm",
".",
"purgePoolContents",
"(",
")",
";",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"purgePool\"",
")",
";",
"}",
"}"
] | This is called by the RRA only when db2 reroute is being used | [
"This",
"is",
"called",
"by",
"the",
"RRA",
"only",
"when",
"db2",
"reroute",
"is",
"being",
"used"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectionManager.java#L1561-L1574 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectionManager.java | ConnectionManager.supportsBranchCoupling | protected int supportsBranchCoupling(int couplingType, ManagedConnectionFactory managedConnectionFactory) {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
int startFlag;
if (isJDBC) {
startFlag = ((WSManagedConnectionFactory) managedConnectionFactory).getXAStartFlagForBranchCoupling(couplingType);
} else {
String bcInfo = "branch-coupling=LOOSE";
if (couplingType == ResourceRefInfo.BRANCH_COUPLING_TIGHT)
bcInfo = "branch-coupling=TIGHT";
Tr.warning(tc, "IGNORE_FEATURE_J2CA0240", new Object[] { bcInfo, gConfigProps.cfName });
startFlag = XAResource.TMNOFLAGS; // take default
}
if (isTraceOn && tc.isDebugEnabled()) {
Tr.debug(this, tc, "Branch coupling request for " + cmConfig.getCFDetailsKey() + " is " + couplingType + " startFlag is " + startFlag);
}
return startFlag;
} | java | protected int supportsBranchCoupling(int couplingType, ManagedConnectionFactory managedConnectionFactory) {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
int startFlag;
if (isJDBC) {
startFlag = ((WSManagedConnectionFactory) managedConnectionFactory).getXAStartFlagForBranchCoupling(couplingType);
} else {
String bcInfo = "branch-coupling=LOOSE";
if (couplingType == ResourceRefInfo.BRANCH_COUPLING_TIGHT)
bcInfo = "branch-coupling=TIGHT";
Tr.warning(tc, "IGNORE_FEATURE_J2CA0240", new Object[] { bcInfo, gConfigProps.cfName });
startFlag = XAResource.TMNOFLAGS; // take default
}
if (isTraceOn && tc.isDebugEnabled()) {
Tr.debug(this, tc, "Branch coupling request for " + cmConfig.getCFDetailsKey() + " is " + couplingType + " startFlag is " + startFlag);
}
return startFlag;
} | [
"protected",
"int",
"supportsBranchCoupling",
"(",
"int",
"couplingType",
",",
"ManagedConnectionFactory",
"managedConnectionFactory",
")",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"int",
"startFlag",
";",
"if",
"(",
"isJDBC",
")",
"{",
"startFlag",
"=",
"(",
"(",
"WSManagedConnectionFactory",
")",
"managedConnectionFactory",
")",
".",
"getXAStartFlagForBranchCoupling",
"(",
"couplingType",
")",
";",
"}",
"else",
"{",
"String",
"bcInfo",
"=",
"\"branch-coupling=LOOSE\"",
";",
"if",
"(",
"couplingType",
"==",
"ResourceRefInfo",
".",
"BRANCH_COUPLING_TIGHT",
")",
"bcInfo",
"=",
"\"branch-coupling=TIGHT\"",
";",
"Tr",
".",
"warning",
"(",
"tc",
",",
"\"IGNORE_FEATURE_J2CA0240\"",
",",
"new",
"Object",
"[",
"]",
"{",
"bcInfo",
",",
"gConfigProps",
".",
"cfName",
"}",
")",
";",
"startFlag",
"=",
"XAResource",
".",
"TMNOFLAGS",
";",
"// take default",
"}",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"Branch coupling request for \"",
"+",
"cmConfig",
".",
"getCFDetailsKey",
"(",
")",
"+",
"\" is \"",
"+",
"couplingType",
"+",
"\" startFlag is \"",
"+",
"startFlag",
")",
";",
"}",
"return",
"startFlag",
";",
"}"
] | Only called if couplingType indicates LOOSE or TIGHT | [
"Only",
"called",
"if",
"couplingType",
"indicates",
"LOOSE",
"or",
"TIGHT"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectionManager.java#L1579-L1596 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectionManager.java | ConnectionManager.matchBranchCoupling | protected boolean matchBranchCoupling(int couplingType1, int couplingType2, ManagedConnectionFactory managedConnectionFactory) {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
boolean matched = true;
if (isJDBC && couplingType1 != couplingType2) {
// ResourceRefInfo.BRANCH_COUPLING_UNSET can default to BRANCH_COUPLING_TIGHT or BRANCH_COUPLING_LOOSE
if (couplingType1 == ResourceRefInfo.BRANCH_COUPLING_UNSET)
couplingType1 = ((WSManagedConnectionFactory) managedConnectionFactory).getDefaultBranchCoupling();
else if (couplingType2 == ResourceRefInfo.BRANCH_COUPLING_UNSET)
couplingType2 = ((WSManagedConnectionFactory) managedConnectionFactory).getDefaultBranchCoupling();
matched = couplingType1 == couplingType2;
}
if (isTraceOn && tc.isDebugEnabled()) {
Tr.debug(this, tc, "Match coupling request for " + couplingType1 + " and " + couplingType2 + " match is " + matched);
}
return matched;
} | java | protected boolean matchBranchCoupling(int couplingType1, int couplingType2, ManagedConnectionFactory managedConnectionFactory) {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
boolean matched = true;
if (isJDBC && couplingType1 != couplingType2) {
// ResourceRefInfo.BRANCH_COUPLING_UNSET can default to BRANCH_COUPLING_TIGHT or BRANCH_COUPLING_LOOSE
if (couplingType1 == ResourceRefInfo.BRANCH_COUPLING_UNSET)
couplingType1 = ((WSManagedConnectionFactory) managedConnectionFactory).getDefaultBranchCoupling();
else if (couplingType2 == ResourceRefInfo.BRANCH_COUPLING_UNSET)
couplingType2 = ((WSManagedConnectionFactory) managedConnectionFactory).getDefaultBranchCoupling();
matched = couplingType1 == couplingType2;
}
if (isTraceOn && tc.isDebugEnabled()) {
Tr.debug(this, tc, "Match coupling request for " + couplingType1 + " and " + couplingType2 + " match is " + matched);
}
return matched;
} | [
"protected",
"boolean",
"matchBranchCoupling",
"(",
"int",
"couplingType1",
",",
"int",
"couplingType2",
",",
"ManagedConnectionFactory",
"managedConnectionFactory",
")",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"boolean",
"matched",
"=",
"true",
";",
"if",
"(",
"isJDBC",
"&&",
"couplingType1",
"!=",
"couplingType2",
")",
"{",
"// ResourceRefInfo.BRANCH_COUPLING_UNSET can default to BRANCH_COUPLING_TIGHT or BRANCH_COUPLING_LOOSE",
"if",
"(",
"couplingType1",
"==",
"ResourceRefInfo",
".",
"BRANCH_COUPLING_UNSET",
")",
"couplingType1",
"=",
"(",
"(",
"WSManagedConnectionFactory",
")",
"managedConnectionFactory",
")",
".",
"getDefaultBranchCoupling",
"(",
")",
";",
"else",
"if",
"(",
"couplingType2",
"==",
"ResourceRefInfo",
".",
"BRANCH_COUPLING_UNSET",
")",
"couplingType2",
"=",
"(",
"(",
"WSManagedConnectionFactory",
")",
"managedConnectionFactory",
")",
".",
"getDefaultBranchCoupling",
"(",
")",
";",
"matched",
"=",
"couplingType1",
"==",
"couplingType2",
";",
"}",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"Match coupling request for \"",
"+",
"couplingType1",
"+",
"\" and \"",
"+",
"couplingType2",
"+",
"\" match is \"",
"+",
"matched",
")",
";",
"}",
"return",
"matched",
";",
"}"
] | May be called if couplingType indicates LOOSE or TIGHT or is UNSET | [
"May",
"be",
"called",
"if",
"couplingType",
"indicates",
"LOOSE",
"or",
"TIGHT",
"or",
"is",
"UNSET"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectionManager.java#L1601-L1616 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectionManager.java | ConnectionManager.getFinalSubject | private final Subject getFinalSubject(ConnectionRequestInfo requestInfo,
final ManagedConnectionFactory mangedConnectionFactory, Object CM) throws ResourceException {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
Subject subj = null;
if (this.containerManagedAuth) {
final Map<String, Object> loginConfigProps = (Map<String, Object>) this.cmConfig.getLoginConfigProperties().clone();
String name = this.cmConfig.getLoginConfigurationName();
final String loginConfigurationName = name == null ? connectionFactorySvc.getJaasLoginContextEntryName() : name;
String authDataID = (String) loginConfigProps.get("DefaultPrincipalMapping");
// If no authentication-alias is found in the bindings, then use the default container managed auth alias (if any)
if (authDataID == null)
authDataID = connectionFactorySvc.getContainerAuthDataID();
if (isTraceOn && tc.isDebugEnabled()) {
Tr.debug(this, tc, "login configuration name", loginConfigurationName);
Tr.debug(this, tc, "container managed auth", authDataID);
}
if (authDataID != null || loginConfigurationName != null) {
loginConfigProps.put("com.ibm.mapping.authDataAlias", authDataID);
final AuthDataService authSvc = _pm.connectorSvc.authDataServiceRef.getServiceWithException();
try {
subj = AccessController.doPrivileged(new PrivilegedExceptionAction<Subject>() {
@Override
public Subject run() throws LoginException {
return authSvc.getSubject(mangedConnectionFactory, loginConfigurationName, loginConfigProps);
}
});
} catch (PrivilegedActionException e) {
FFDCFilter.processException(e.getCause(), getClass().getName(), "3070", this, new Object[] { this });
ResourceException r = new ResourceException(e.getCause());
throw r;
}
}
subj = this.securityHelper.finalizeSubject(subj, requestInfo, this.cmConfig);
} else {
if (isTraceOn && tc.isDebugEnabled()) {
Tr.debug(this, tc, "Subject is", subj);
}
}
return subj;
} | java | private final Subject getFinalSubject(ConnectionRequestInfo requestInfo,
final ManagedConnectionFactory mangedConnectionFactory, Object CM) throws ResourceException {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
Subject subj = null;
if (this.containerManagedAuth) {
final Map<String, Object> loginConfigProps = (Map<String, Object>) this.cmConfig.getLoginConfigProperties().clone();
String name = this.cmConfig.getLoginConfigurationName();
final String loginConfigurationName = name == null ? connectionFactorySvc.getJaasLoginContextEntryName() : name;
String authDataID = (String) loginConfigProps.get("DefaultPrincipalMapping");
// If no authentication-alias is found in the bindings, then use the default container managed auth alias (if any)
if (authDataID == null)
authDataID = connectionFactorySvc.getContainerAuthDataID();
if (isTraceOn && tc.isDebugEnabled()) {
Tr.debug(this, tc, "login configuration name", loginConfigurationName);
Tr.debug(this, tc, "container managed auth", authDataID);
}
if (authDataID != null || loginConfigurationName != null) {
loginConfigProps.put("com.ibm.mapping.authDataAlias", authDataID);
final AuthDataService authSvc = _pm.connectorSvc.authDataServiceRef.getServiceWithException();
try {
subj = AccessController.doPrivileged(new PrivilegedExceptionAction<Subject>() {
@Override
public Subject run() throws LoginException {
return authSvc.getSubject(mangedConnectionFactory, loginConfigurationName, loginConfigProps);
}
});
} catch (PrivilegedActionException e) {
FFDCFilter.processException(e.getCause(), getClass().getName(), "3070", this, new Object[] { this });
ResourceException r = new ResourceException(e.getCause());
throw r;
}
}
subj = this.securityHelper.finalizeSubject(subj, requestInfo, this.cmConfig);
} else {
if (isTraceOn && tc.isDebugEnabled()) {
Tr.debug(this, tc, "Subject is", subj);
}
}
return subj;
} | [
"private",
"final",
"Subject",
"getFinalSubject",
"(",
"ConnectionRequestInfo",
"requestInfo",
",",
"final",
"ManagedConnectionFactory",
"mangedConnectionFactory",
",",
"Object",
"CM",
")",
"throws",
"ResourceException",
"{",
"final",
"boolean",
"isTraceOn",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"Subject",
"subj",
"=",
"null",
";",
"if",
"(",
"this",
".",
"containerManagedAuth",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"loginConfigProps",
"=",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"this",
".",
"cmConfig",
".",
"getLoginConfigProperties",
"(",
")",
".",
"clone",
"(",
")",
";",
"String",
"name",
"=",
"this",
".",
"cmConfig",
".",
"getLoginConfigurationName",
"(",
")",
";",
"final",
"String",
"loginConfigurationName",
"=",
"name",
"==",
"null",
"?",
"connectionFactorySvc",
".",
"getJaasLoginContextEntryName",
"(",
")",
":",
"name",
";",
"String",
"authDataID",
"=",
"(",
"String",
")",
"loginConfigProps",
".",
"get",
"(",
"\"DefaultPrincipalMapping\"",
")",
";",
"// If no authentication-alias is found in the bindings, then use the default container managed auth alias (if any)",
"if",
"(",
"authDataID",
"==",
"null",
")",
"authDataID",
"=",
"connectionFactorySvc",
".",
"getContainerAuthDataID",
"(",
")",
";",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"login configuration name\"",
",",
"loginConfigurationName",
")",
";",
"Tr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"container managed auth\"",
",",
"authDataID",
")",
";",
"}",
"if",
"(",
"authDataID",
"!=",
"null",
"||",
"loginConfigurationName",
"!=",
"null",
")",
"{",
"loginConfigProps",
".",
"put",
"(",
"\"com.ibm.mapping.authDataAlias\"",
",",
"authDataID",
")",
";",
"final",
"AuthDataService",
"authSvc",
"=",
"_pm",
".",
"connectorSvc",
".",
"authDataServiceRef",
".",
"getServiceWithException",
"(",
")",
";",
"try",
"{",
"subj",
"=",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedExceptionAction",
"<",
"Subject",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Subject",
"run",
"(",
")",
"throws",
"LoginException",
"{",
"return",
"authSvc",
".",
"getSubject",
"(",
"mangedConnectionFactory",
",",
"loginConfigurationName",
",",
"loginConfigProps",
")",
";",
"}",
"}",
")",
";",
"}",
"catch",
"(",
"PrivilegedActionException",
"e",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"e",
".",
"getCause",
"(",
")",
",",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
",",
"\"3070\"",
",",
"this",
",",
"new",
"Object",
"[",
"]",
"{",
"this",
"}",
")",
";",
"ResourceException",
"r",
"=",
"new",
"ResourceException",
"(",
"e",
".",
"getCause",
"(",
")",
")",
";",
"throw",
"r",
";",
"}",
"}",
"subj",
"=",
"this",
".",
"securityHelper",
".",
"finalizeSubject",
"(",
"subj",
",",
"requestInfo",
",",
"this",
".",
"cmConfig",
")",
";",
"}",
"else",
"{",
"if",
"(",
"isTraceOn",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"Subject is\"",
",",
"subj",
")",
";",
"}",
"}",
"return",
"subj",
";",
"}"
] | Returns the subject for container managed authentication.
@param requestInfo - connection request information
@param mangedConnectionFactory - managed connection factory
@param CM - connection manager
@return subject for container managed authentication.
@throws ResourceException | [
"Returns",
"the",
"subject",
"for",
"container",
"managed",
"authentication",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/ConnectionManager.java#L1627-L1671 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/ServerCommsDiagnosticModule.java | ServerCommsDiagnosticModule.dumpJFapServerStatus | @Override
protected void dumpJFapServerStatus(final IncidentStream is)
{
if(TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "dumpJFapServerStatus", is);
dumpMEtoMEConversations(is);
dumpInboundConversations(is);
if(TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "dumpJFapServerStatus");
} | java | @Override
protected void dumpJFapServerStatus(final IncidentStream is)
{
if(TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "dumpJFapServerStatus", is);
dumpMEtoMEConversations(is);
dumpInboundConversations(is);
if(TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "dumpJFapServerStatus");
} | [
"@",
"Override",
"protected",
"void",
"dumpJFapServerStatus",
"(",
"final",
"IncidentStream",
"is",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"dumpJFapServerStatus\"",
",",
"is",
")",
";",
"dumpMEtoMEConversations",
"(",
"is",
")",
";",
"dumpInboundConversations",
"(",
"is",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"dumpJFapServerStatus\"",
")",
";",
"}"
] | Dump all information relating to server side comms.
@param is the incident stream to log information to. | [
"Dump",
"all",
"information",
"relating",
"to",
"server",
"side",
"comms",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/ServerCommsDiagnosticModule.java#L73-L82 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/ServerCommsDiagnosticModule.java | ServerCommsDiagnosticModule.dumpMEtoMEConversations | private void dumpMEtoMEConversations(final IncidentStream is)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "dumpMEtoMEConversations", is);
final ServerConnectionManager scm = ServerConnectionManager.getRef();
final List obc = scm.getActiveOutboundMEtoMEConversations();
is.writeLine("", "");
is.writeLine("\n------ ME to ME Conversation Dump ------ ", ">");
if (obc != null)
{
//Build a map of connection -> conversation so that we can output the
//connection information once per set of conversations.
final Map<Object, LinkedList<Conversation>> connectionToConversationMap = convertToMap(is, obc);
//Go through the map and dump out a connection - followed by its conversations
for (final Iterator<Entry<Object,LinkedList<Conversation>>>i = connectionToConversationMap.entrySet().iterator(); i.hasNext();)
{
final Entry<Object, LinkedList<Conversation>>entry = i.next();
is.writeLine("\nOutbound connection:", entry.getKey());
final LinkedList conversationList = entry.getValue();
while(!conversationList.isEmpty())
{
final Conversation c = (Conversation)conversationList.removeFirst();
is.writeLine("\nOutbound Conversation[" + c.getId() + "]: ", c.getFullSummary());
try
{
dumpMEtoMEConversation(is, c);
}
catch(Throwable t)
{
// No FFDC Code Needed
is.writeLine("\nUnable to dump conversation", t);
}
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "dumpMEtoMEConversations");
} | java | private void dumpMEtoMEConversations(final IncidentStream is)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "dumpMEtoMEConversations", is);
final ServerConnectionManager scm = ServerConnectionManager.getRef();
final List obc = scm.getActiveOutboundMEtoMEConversations();
is.writeLine("", "");
is.writeLine("\n------ ME to ME Conversation Dump ------ ", ">");
if (obc != null)
{
//Build a map of connection -> conversation so that we can output the
//connection information once per set of conversations.
final Map<Object, LinkedList<Conversation>> connectionToConversationMap = convertToMap(is, obc);
//Go through the map and dump out a connection - followed by its conversations
for (final Iterator<Entry<Object,LinkedList<Conversation>>>i = connectionToConversationMap.entrySet().iterator(); i.hasNext();)
{
final Entry<Object, LinkedList<Conversation>>entry = i.next();
is.writeLine("\nOutbound connection:", entry.getKey());
final LinkedList conversationList = entry.getValue();
while(!conversationList.isEmpty())
{
final Conversation c = (Conversation)conversationList.removeFirst();
is.writeLine("\nOutbound Conversation[" + c.getId() + "]: ", c.getFullSummary());
try
{
dumpMEtoMEConversation(is, c);
}
catch(Throwable t)
{
// No FFDC Code Needed
is.writeLine("\nUnable to dump conversation", t);
}
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "dumpMEtoMEConversations");
} | [
"private",
"void",
"dumpMEtoMEConversations",
"(",
"final",
"IncidentStream",
"is",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"dumpMEtoMEConversations\"",
",",
"is",
")",
";",
"final",
"ServerConnectionManager",
"scm",
"=",
"ServerConnectionManager",
".",
"getRef",
"(",
")",
";",
"final",
"List",
"obc",
"=",
"scm",
".",
"getActiveOutboundMEtoMEConversations",
"(",
")",
";",
"is",
".",
"writeLine",
"(",
"\"\"",
",",
"\"\"",
")",
";",
"is",
".",
"writeLine",
"(",
"\"\\n------ ME to ME Conversation Dump ------ \"",
",",
"\">\"",
")",
";",
"if",
"(",
"obc",
"!=",
"null",
")",
"{",
"//Build a map of connection -> conversation so that we can output the",
"//connection information once per set of conversations.",
"final",
"Map",
"<",
"Object",
",",
"LinkedList",
"<",
"Conversation",
">",
">",
"connectionToConversationMap",
"=",
"convertToMap",
"(",
"is",
",",
"obc",
")",
";",
"//Go through the map and dump out a connection - followed by its conversations",
"for",
"(",
"final",
"Iterator",
"<",
"Entry",
"<",
"Object",
",",
"LinkedList",
"<",
"Conversation",
">",
">",
">",
"i",
"=",
"connectionToConversationMap",
".",
"entrySet",
"(",
")",
".",
"iterator",
"(",
")",
";",
"i",
".",
"hasNext",
"(",
")",
";",
")",
"{",
"final",
"Entry",
"<",
"Object",
",",
"LinkedList",
"<",
"Conversation",
">",
">",
"entry",
"=",
"i",
".",
"next",
"(",
")",
";",
"is",
".",
"writeLine",
"(",
"\"\\nOutbound connection:\"",
",",
"entry",
".",
"getKey",
"(",
")",
")",
";",
"final",
"LinkedList",
"conversationList",
"=",
"entry",
".",
"getValue",
"(",
")",
";",
"while",
"(",
"!",
"conversationList",
".",
"isEmpty",
"(",
")",
")",
"{",
"final",
"Conversation",
"c",
"=",
"(",
"Conversation",
")",
"conversationList",
".",
"removeFirst",
"(",
")",
";",
"is",
".",
"writeLine",
"(",
"\"\\nOutbound Conversation[\"",
"+",
"c",
".",
"getId",
"(",
")",
"+",
"\"]: \"",
",",
"c",
".",
"getFullSummary",
"(",
")",
")",
";",
"try",
"{",
"dumpMEtoMEConversation",
"(",
"is",
",",
"c",
")",
";",
"}",
"catch",
"(",
"Throwable",
"t",
")",
"{",
"// No FFDC Code Needed",
"is",
".",
"writeLine",
"(",
"\"\\nUnable to dump conversation\"",
",",
"t",
")",
";",
"}",
"}",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"dumpMEtoMEConversations\"",
")",
";",
"}"
] | Dump out all outbound ME to ME conversations.
@param is the incident stream to log information to. | [
"Dump",
"out",
"all",
"outbound",
"ME",
"to",
"ME",
"conversations",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/ServerCommsDiagnosticModule.java#L89-L131 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/ServerCommsDiagnosticModule.java | ServerCommsDiagnosticModule.dumpInboundConversations | private void dumpInboundConversations(final IncidentStream is)
{
if(TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "dumpInboundConversations", is);
final List serverConvs = ServerTransportAcceptListener.getInstance().getActiveConversations();
is.writeLine("", "");
is.writeLine("\n------ Inbound Conversation Dump ------ ", ">");
if (serverConvs != null)
{
// Build a map of connection -> conversation so that we can output the
// connection information once per set of conversations.
final Map<Object, LinkedList<Conversation>> connectionToConversationMap = new HashMap<Object, LinkedList<Conversation>>();
for (final Iterator i = serverConvs.iterator(); i.hasNext();)
{
try
{
final Conversation c = (Conversation) i.next();
final Object connectionObject = c.getConnectionReference();
final LinkedList<Conversation> conversationList;
if (!connectionToConversationMap.containsKey(connectionObject))
{
conversationList = new LinkedList<Conversation>();
connectionToConversationMap.put(connectionObject, conversationList);
}
else
{
conversationList = connectionToConversationMap.get(connectionObject);
}
conversationList.add(c);
}
catch (Throwable t)
{
// No FFDC Code Needed
is.writeLine("\nUnable to dump conversation", t);
}
}
// Go through the map and dump out a connection - followed by its conversations
final Set<Map.Entry<Object, LinkedList<Conversation>>> entries = connectionToConversationMap.entrySet();
for(final Map.Entry<Object, LinkedList<Conversation>> entry: entries)
{
final Object connectionObject = entry.getKey();
is.writeLine("\nInbound connection:", connectionObject);
final LinkedList<Conversation> conversationList = entry.getValue();
while(!conversationList.isEmpty())
{
final Conversation c = conversationList.removeFirst();
is.writeLine("\nInbound Conversation[" + c.getId() + "]: ", c.getFullSummary());
try
{
dumpServerConversation(is, c);
}
catch(Throwable t)
{
// No FFDC Code Needed
is.writeLine("\nUnable to dump conversation", t);
}
}
}
}
if(TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "dumpInboundConversations");
} | java | private void dumpInboundConversations(final IncidentStream is)
{
if(TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "dumpInboundConversations", is);
final List serverConvs = ServerTransportAcceptListener.getInstance().getActiveConversations();
is.writeLine("", "");
is.writeLine("\n------ Inbound Conversation Dump ------ ", ">");
if (serverConvs != null)
{
// Build a map of connection -> conversation so that we can output the
// connection information once per set of conversations.
final Map<Object, LinkedList<Conversation>> connectionToConversationMap = new HashMap<Object, LinkedList<Conversation>>();
for (final Iterator i = serverConvs.iterator(); i.hasNext();)
{
try
{
final Conversation c = (Conversation) i.next();
final Object connectionObject = c.getConnectionReference();
final LinkedList<Conversation> conversationList;
if (!connectionToConversationMap.containsKey(connectionObject))
{
conversationList = new LinkedList<Conversation>();
connectionToConversationMap.put(connectionObject, conversationList);
}
else
{
conversationList = connectionToConversationMap.get(connectionObject);
}
conversationList.add(c);
}
catch (Throwable t)
{
// No FFDC Code Needed
is.writeLine("\nUnable to dump conversation", t);
}
}
// Go through the map and dump out a connection - followed by its conversations
final Set<Map.Entry<Object, LinkedList<Conversation>>> entries = connectionToConversationMap.entrySet();
for(final Map.Entry<Object, LinkedList<Conversation>> entry: entries)
{
final Object connectionObject = entry.getKey();
is.writeLine("\nInbound connection:", connectionObject);
final LinkedList<Conversation> conversationList = entry.getValue();
while(!conversationList.isEmpty())
{
final Conversation c = conversationList.removeFirst();
is.writeLine("\nInbound Conversation[" + c.getId() + "]: ", c.getFullSummary());
try
{
dumpServerConversation(is, c);
}
catch(Throwable t)
{
// No FFDC Code Needed
is.writeLine("\nUnable to dump conversation", t);
}
}
}
}
if(TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "dumpInboundConversations");
} | [
"private",
"void",
"dumpInboundConversations",
"(",
"final",
"IncidentStream",
"is",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"dumpInboundConversations\"",
",",
"is",
")",
";",
"final",
"List",
"serverConvs",
"=",
"ServerTransportAcceptListener",
".",
"getInstance",
"(",
")",
".",
"getActiveConversations",
"(",
")",
";",
"is",
".",
"writeLine",
"(",
"\"\"",
",",
"\"\"",
")",
";",
"is",
".",
"writeLine",
"(",
"\"\\n------ Inbound Conversation Dump ------ \"",
",",
"\">\"",
")",
";",
"if",
"(",
"serverConvs",
"!=",
"null",
")",
"{",
"// Build a map of connection -> conversation so that we can output the",
"// connection information once per set of conversations.",
"final",
"Map",
"<",
"Object",
",",
"LinkedList",
"<",
"Conversation",
">",
">",
"connectionToConversationMap",
"=",
"new",
"HashMap",
"<",
"Object",
",",
"LinkedList",
"<",
"Conversation",
">",
">",
"(",
")",
";",
"for",
"(",
"final",
"Iterator",
"i",
"=",
"serverConvs",
".",
"iterator",
"(",
")",
";",
"i",
".",
"hasNext",
"(",
")",
";",
")",
"{",
"try",
"{",
"final",
"Conversation",
"c",
"=",
"(",
"Conversation",
")",
"i",
".",
"next",
"(",
")",
";",
"final",
"Object",
"connectionObject",
"=",
"c",
".",
"getConnectionReference",
"(",
")",
";",
"final",
"LinkedList",
"<",
"Conversation",
">",
"conversationList",
";",
"if",
"(",
"!",
"connectionToConversationMap",
".",
"containsKey",
"(",
"connectionObject",
")",
")",
"{",
"conversationList",
"=",
"new",
"LinkedList",
"<",
"Conversation",
">",
"(",
")",
";",
"connectionToConversationMap",
".",
"put",
"(",
"connectionObject",
",",
"conversationList",
")",
";",
"}",
"else",
"{",
"conversationList",
"=",
"connectionToConversationMap",
".",
"get",
"(",
"connectionObject",
")",
";",
"}",
"conversationList",
".",
"add",
"(",
"c",
")",
";",
"}",
"catch",
"(",
"Throwable",
"t",
")",
"{",
"// No FFDC Code Needed",
"is",
".",
"writeLine",
"(",
"\"\\nUnable to dump conversation\"",
",",
"t",
")",
";",
"}",
"}",
"// Go through the map and dump out a connection - followed by its conversations",
"final",
"Set",
"<",
"Map",
".",
"Entry",
"<",
"Object",
",",
"LinkedList",
"<",
"Conversation",
">",
">",
">",
"entries",
"=",
"connectionToConversationMap",
".",
"entrySet",
"(",
")",
";",
"for",
"(",
"final",
"Map",
".",
"Entry",
"<",
"Object",
",",
"LinkedList",
"<",
"Conversation",
">",
">",
"entry",
":",
"entries",
")",
"{",
"final",
"Object",
"connectionObject",
"=",
"entry",
".",
"getKey",
"(",
")",
";",
"is",
".",
"writeLine",
"(",
"\"\\nInbound connection:\"",
",",
"connectionObject",
")",
";",
"final",
"LinkedList",
"<",
"Conversation",
">",
"conversationList",
"=",
"entry",
".",
"getValue",
"(",
")",
";",
"while",
"(",
"!",
"conversationList",
".",
"isEmpty",
"(",
")",
")",
"{",
"final",
"Conversation",
"c",
"=",
"conversationList",
".",
"removeFirst",
"(",
")",
";",
"is",
".",
"writeLine",
"(",
"\"\\nInbound Conversation[\"",
"+",
"c",
".",
"getId",
"(",
")",
"+",
"\"]: \"",
",",
"c",
".",
"getFullSummary",
"(",
")",
")",
";",
"try",
"{",
"dumpServerConversation",
"(",
"is",
",",
"c",
")",
";",
"}",
"catch",
"(",
"Throwable",
"t",
")",
"{",
"// No FFDC Code Needed",
"is",
".",
"writeLine",
"(",
"\"\\nUnable to dump conversation\"",
",",
"t",
")",
";",
"}",
"}",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"dumpInboundConversations\"",
")",
";",
"}"
] | This method dumps the status of any inbound conversations that are currently active. It does
this by asking the accept listeners for their list of active conversations and dumping out the
details in their conversation states.
@param is the incident stream to log information to. | [
"This",
"method",
"dumps",
"the",
"status",
"of",
"any",
"inbound",
"conversations",
"that",
"are",
"currently",
"active",
".",
"It",
"does",
"this",
"by",
"asking",
"the",
"accept",
"listeners",
"for",
"their",
"list",
"of",
"active",
"conversations",
"and",
"dumping",
"out",
"the",
"details",
"in",
"their",
"conversation",
"states",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/ServerCommsDiagnosticModule.java#L140-L208 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/ServerCommsDiagnosticModule.java | ServerCommsDiagnosticModule.dumpServerConversation | private void dumpServerConversation(IncidentStream is, Conversation conv)
{
if(TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "dumpServerConversation", new Object[]{is, conv});
final ConversationState convState = (ConversationState) conv.getAttachment();
final List allObjs = convState.getAllObjects();
is.writeLine("Number of associated resources", allObjs.size());
for (final Iterator i2 = allObjs.iterator(); i2.hasNext();)
{
final Object obj = i2.next();
if (obj instanceof SICoreConnection)
{
final SICoreConnection conn = (SICoreConnection) obj;
is.writeLine(" ",
"SICoreConnection@" + Integer.toHexString(obj.hashCode()) + ": " +
"ME Name: " + conn.getMeName() + " [" + conn.getMeUuid() + "] " +
"Version: " + conn.getApiLevelDescription());
}
else
{
is.writeLine(" ", obj);
}
}
if(TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "dumpServerConversation");
} | java | private void dumpServerConversation(IncidentStream is, Conversation conv)
{
if(TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "dumpServerConversation", new Object[]{is, conv});
final ConversationState convState = (ConversationState) conv.getAttachment();
final List allObjs = convState.getAllObjects();
is.writeLine("Number of associated resources", allObjs.size());
for (final Iterator i2 = allObjs.iterator(); i2.hasNext();)
{
final Object obj = i2.next();
if (obj instanceof SICoreConnection)
{
final SICoreConnection conn = (SICoreConnection) obj;
is.writeLine(" ",
"SICoreConnection@" + Integer.toHexString(obj.hashCode()) + ": " +
"ME Name: " + conn.getMeName() + " [" + conn.getMeUuid() + "] " +
"Version: " + conn.getApiLevelDescription());
}
else
{
is.writeLine(" ", obj);
}
}
if(TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "dumpServerConversation");
} | [
"private",
"void",
"dumpServerConversation",
"(",
"IncidentStream",
"is",
",",
"Conversation",
"conv",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"dumpServerConversation\"",
",",
"new",
"Object",
"[",
"]",
"{",
"is",
",",
"conv",
"}",
")",
";",
"final",
"ConversationState",
"convState",
"=",
"(",
"ConversationState",
")",
"conv",
".",
"getAttachment",
"(",
")",
";",
"final",
"List",
"allObjs",
"=",
"convState",
".",
"getAllObjects",
"(",
")",
";",
"is",
".",
"writeLine",
"(",
"\"Number of associated resources\"",
",",
"allObjs",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
"final",
"Iterator",
"i2",
"=",
"allObjs",
".",
"iterator",
"(",
")",
";",
"i2",
".",
"hasNext",
"(",
")",
";",
")",
"{",
"final",
"Object",
"obj",
"=",
"i2",
".",
"next",
"(",
")",
";",
"if",
"(",
"obj",
"instanceof",
"SICoreConnection",
")",
"{",
"final",
"SICoreConnection",
"conn",
"=",
"(",
"SICoreConnection",
")",
"obj",
";",
"is",
".",
"writeLine",
"(",
"\" \"",
",",
"\"SICoreConnection@\"",
"+",
"Integer",
".",
"toHexString",
"(",
"obj",
".",
"hashCode",
"(",
")",
")",
"+",
"\": \"",
"+",
"\"ME Name: \"",
"+",
"conn",
".",
"getMeName",
"(",
")",
"+",
"\" [\"",
"+",
"conn",
".",
"getMeUuid",
"(",
")",
"+",
"\"] \"",
"+",
"\"Version: \"",
"+",
"conn",
".",
"getApiLevelDescription",
"(",
")",
")",
";",
"}",
"else",
"{",
"is",
".",
"writeLine",
"(",
"\" \"",
",",
"obj",
")",
";",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"dumpServerConversation\"",
")",
";",
"}"
] | Dumps the details of a particular server conversation.
@param is the incident stream to log information to.
@param conv the conversation we want to dump. | [
"Dumps",
"the",
"details",
"of",
"a",
"particular",
"server",
"conversation",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/ServerCommsDiagnosticModule.java#L216-L243 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/ServerCommsDiagnosticModule.java | ServerCommsDiagnosticModule.dumpMEtoMEConversation | private void dumpMEtoMEConversation(IncidentStream is, Conversation conv)
{
if(TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "dumpMEtoMEConversation", new Object[]{is, conv});
//Get the conversation state and use it to find out what we can.
final ConversationState convState = (ConversationState) conv.getAttachment();
final MEConnection commsConnection = (MEConnection) convState.getCommsConnection();
is.writeLine(" Connected using: ", commsConnection);
final JsMessagingEngine me = commsConnection.getMessagingEngine();
final String meInfo = me == null ? "<null>" : me.getName()+ " [" + me.getUuid() + "]";
is.writeLine(" Local ME: ", meInfo);
is.writeLine(" Target ME: ", commsConnection.getTargetInformation());
//Introspect details of conversation state.
is.introspectAndWriteLine("Introspection of the conversation state:", convState);
if(TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "dumpMEtoMEConversation");
} | java | private void dumpMEtoMEConversation(IncidentStream is, Conversation conv)
{
if(TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "dumpMEtoMEConversation", new Object[]{is, conv});
//Get the conversation state and use it to find out what we can.
final ConversationState convState = (ConversationState) conv.getAttachment();
final MEConnection commsConnection = (MEConnection) convState.getCommsConnection();
is.writeLine(" Connected using: ", commsConnection);
final JsMessagingEngine me = commsConnection.getMessagingEngine();
final String meInfo = me == null ? "<null>" : me.getName()+ " [" + me.getUuid() + "]";
is.writeLine(" Local ME: ", meInfo);
is.writeLine(" Target ME: ", commsConnection.getTargetInformation());
//Introspect details of conversation state.
is.introspectAndWriteLine("Introspection of the conversation state:", convState);
if(TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "dumpMEtoMEConversation");
} | [
"private",
"void",
"dumpMEtoMEConversation",
"(",
"IncidentStream",
"is",
",",
"Conversation",
"conv",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"this",
",",
"tc",
",",
"\"dumpMEtoMEConversation\"",
",",
"new",
"Object",
"[",
"]",
"{",
"is",
",",
"conv",
"}",
")",
";",
"//Get the conversation state and use it to find out what we can.",
"final",
"ConversationState",
"convState",
"=",
"(",
"ConversationState",
")",
"conv",
".",
"getAttachment",
"(",
")",
";",
"final",
"MEConnection",
"commsConnection",
"=",
"(",
"MEConnection",
")",
"convState",
".",
"getCommsConnection",
"(",
")",
";",
"is",
".",
"writeLine",
"(",
"\" Connected using: \"",
",",
"commsConnection",
")",
";",
"final",
"JsMessagingEngine",
"me",
"=",
"commsConnection",
".",
"getMessagingEngine",
"(",
")",
";",
"final",
"String",
"meInfo",
"=",
"me",
"==",
"null",
"?",
"\"<null>\"",
":",
"me",
".",
"getName",
"(",
")",
"+",
"\" [\"",
"+",
"me",
".",
"getUuid",
"(",
")",
"+",
"\"]\"",
";",
"is",
".",
"writeLine",
"(",
"\" Local ME: \"",
",",
"meInfo",
")",
";",
"is",
".",
"writeLine",
"(",
"\" Target ME: \"",
",",
"commsConnection",
".",
"getTargetInformation",
"(",
")",
")",
";",
"//Introspect details of conversation state.",
"is",
".",
"introspectAndWriteLine",
"(",
"\"Introspection of the conversation state:\"",
",",
"convState",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"this",
",",
"tc",
",",
"\"dumpMEtoMEConversation\"",
")",
";",
"}"
] | Dumps the particulars of a ME to ME client side conversation.
@param is the incident stream to log information to.
@param conv the conversation we want to dump. | [
"Dumps",
"the",
"particulars",
"of",
"a",
"ME",
"to",
"ME",
"client",
"side",
"conversation",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/ServerCommsDiagnosticModule.java#L251-L271 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSField.java | JSField.getAccessor | public int getAccessor(JMFSchema schema) {
for (Accessor acc = accessor; acc != null; acc = acc.next)
if (schema == acc.schema)
return acc.accessor;
return -1;
} | java | public int getAccessor(JMFSchema schema) {
for (Accessor acc = accessor; acc != null; acc = acc.next)
if (schema == acc.schema)
return acc.accessor;
return -1;
} | [
"public",
"int",
"getAccessor",
"(",
"JMFSchema",
"schema",
")",
"{",
"for",
"(",
"Accessor",
"acc",
"=",
"accessor",
";",
"acc",
"!=",
"null",
";",
"acc",
"=",
"acc",
".",
"next",
")",
"if",
"(",
"schema",
"==",
"acc",
".",
"schema",
")",
"return",
"acc",
".",
"accessor",
";",
"return",
"-",
"1",
";",
"}"
] | Implement the general getAccessor method | [
"Implement",
"the",
"general",
"getAccessor",
"method"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSField.java#L56-L61 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSField.java | JSField.copyValue | public Object copyValue(Object val, int indirect)
throws JMFSchemaViolationException {
if (indirect == 0)
return copy(val, 0);
else
return coder.copy(val, indirect - 1);
} | java | public Object copyValue(Object val, int indirect)
throws JMFSchemaViolationException {
if (indirect == 0)
return copy(val, 0);
else
return coder.copy(val, indirect - 1);
} | [
"public",
"Object",
"copyValue",
"(",
"Object",
"val",
",",
"int",
"indirect",
")",
"throws",
"JMFSchemaViolationException",
"{",
"if",
"(",
"indirect",
"==",
"0",
")",
"return",
"copy",
"(",
"val",
",",
"0",
")",
";",
"else",
"return",
"coder",
".",
"copy",
"(",
"val",
",",
"indirect",
"-",
"1",
")",
";",
"}"
] | Create a copy of the value of this JSField's type
@param val the value to be copied
@param indirect the list indirection that applies to the object or -1 if the
JSField's maximum list indirection (based on the number of JSRepeated nodes that
dominate it in the schema) is to be used: this, of course, includes the possibility
that it isn't a list at all.
@return a copy of val. This can be the original if the type for this field is immutable. | [
"Create",
"a",
"copy",
"of",
"the",
"value",
"of",
"this",
"JSField",
"s",
"type"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSField.java#L239-L245 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.wim.adapter.ldap_fat/fat/src/com/ibm/ws/security/wim/adapter/ldap/fat/URAPIs_LDAP_NestedGroupBase.java | URAPIs_LDAP_NestedGroupBase.getGroupsForUserInTopGroup | @Test
public void getGroupsForUserInTopGroup() throws Exception {
// This test will only be executed when using physical LDAP server
Assume.assumeTrue(!LDAPUtils.USE_LOCAL_LDAP_SERVER);
String user = topGroupUser;
Log.info(logClass, "getGroupsForUserInTopGroup", "Checking with a valid user.");
List<String> list = myServlet.getGroupsForUser(user);
System.out.println("List of groups : " + list.toString());
assertTrue(list.contains(getCN() + topGroup + getSuffix()));
} | java | @Test
public void getGroupsForUserInTopGroup() throws Exception {
// This test will only be executed when using physical LDAP server
Assume.assumeTrue(!LDAPUtils.USE_LOCAL_LDAP_SERVER);
String user = topGroupUser;
Log.info(logClass, "getGroupsForUserInTopGroup", "Checking with a valid user.");
List<String> list = myServlet.getGroupsForUser(user);
System.out.println("List of groups : " + list.toString());
assertTrue(list.contains(getCN() + topGroup + getSuffix()));
} | [
"@",
"Test",
"public",
"void",
"getGroupsForUserInTopGroup",
"(",
")",
"throws",
"Exception",
"{",
"// This test will only be executed when using physical LDAP server",
"Assume",
".",
"assumeTrue",
"(",
"!",
"LDAPUtils",
".",
"USE_LOCAL_LDAP_SERVER",
")",
";",
"String",
"user",
"=",
"topGroupUser",
";",
"Log",
".",
"info",
"(",
"logClass",
",",
"\"getGroupsForUserInTopGroup\"",
",",
"\"Checking with a valid user.\"",
")",
";",
"List",
"<",
"String",
">",
"list",
"=",
"myServlet",
".",
"getGroupsForUser",
"(",
"user",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"List of groups : \"",
"+",
"list",
".",
"toString",
"(",
")",
")",
";",
"assertTrue",
"(",
"list",
".",
"contains",
"(",
"getCN",
"(",
")",
"+",
"topGroup",
"+",
"getSuffix",
"(",
")",
")",
")",
";",
"}"
] | Hit the test servlet to see if getGroupsForUser works when supplied with a valid user in top level nested group.
This test expects that only the top level nested group, nested_g1, will be returned.
This verifies the various required bundles got installed and are working. | [
"Hit",
"the",
"test",
"servlet",
"to",
"see",
"if",
"getGroupsForUser",
"works",
"when",
"supplied",
"with",
"a",
"valid",
"user",
"in",
"top",
"level",
"nested",
"group",
".",
"This",
"test",
"expects",
"that",
"only",
"the",
"top",
"level",
"nested",
"group",
"nested_g1",
"will",
"be",
"returned",
".",
"This",
"verifies",
"the",
"various",
"required",
"bundles",
"got",
"installed",
"and",
"are",
"working",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.adapter.ldap_fat/fat/src/com/ibm/ws/security/wim/adapter/ldap/fat/URAPIs_LDAP_NestedGroupBase.java#L82-L91 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.wim.adapter.ldap_fat/fat/src/com/ibm/ws/security/wim/adapter/ldap/fat/URAPIs_LDAP_NestedGroupBase.java | URAPIs_LDAP_NestedGroupBase.getUniqueGroupIdsForUserInNestedGroup | @Test
public void getUniqueGroupIdsForUserInNestedGroup() throws Exception {
// This test will only be executed when using physical LDAP server
Assume.assumeTrue(!LDAPUtils.USE_LOCAL_LDAP_SERVER);
String user = getCN() + nestedUser + getSuffix();
Log.info(logClass, "getUniqueGroupIdsForUserInNestedGroup", "Checking with a valid user.");
List<String> list = myServlet.getUniqueGroupIdsForUser(user);
assertTrue(list.contains(getCN() + topGroup + getSuffix()) && list.contains(getCN() + embeddedGroup + getSuffix()));
assertEquals("There should be two entries", 2, list.size());
} | java | @Test
public void getUniqueGroupIdsForUserInNestedGroup() throws Exception {
// This test will only be executed when using physical LDAP server
Assume.assumeTrue(!LDAPUtils.USE_LOCAL_LDAP_SERVER);
String user = getCN() + nestedUser + getSuffix();
Log.info(logClass, "getUniqueGroupIdsForUserInNestedGroup", "Checking with a valid user.");
List<String> list = myServlet.getUniqueGroupIdsForUser(user);
assertTrue(list.contains(getCN() + topGroup + getSuffix()) && list.contains(getCN() + embeddedGroup + getSuffix()));
assertEquals("There should be two entries", 2, list.size());
} | [
"@",
"Test",
"public",
"void",
"getUniqueGroupIdsForUserInNestedGroup",
"(",
")",
"throws",
"Exception",
"{",
"// This test will only be executed when using physical LDAP server",
"Assume",
".",
"assumeTrue",
"(",
"!",
"LDAPUtils",
".",
"USE_LOCAL_LDAP_SERVER",
")",
";",
"String",
"user",
"=",
"getCN",
"(",
")",
"+",
"nestedUser",
"+",
"getSuffix",
"(",
")",
";",
"Log",
".",
"info",
"(",
"logClass",
",",
"\"getUniqueGroupIdsForUserInNestedGroup\"",
",",
"\"Checking with a valid user.\"",
")",
";",
"List",
"<",
"String",
">",
"list",
"=",
"myServlet",
".",
"getUniqueGroupIdsForUser",
"(",
"user",
")",
";",
"assertTrue",
"(",
"list",
".",
"contains",
"(",
"getCN",
"(",
")",
"+",
"topGroup",
"+",
"getSuffix",
"(",
")",
")",
"&&",
"list",
".",
"contains",
"(",
"getCN",
"(",
")",
"+",
"embeddedGroup",
"+",
"getSuffix",
"(",
")",
")",
")",
";",
"assertEquals",
"(",
"\"There should be two entries\"",
",",
"2",
",",
"list",
".",
"size",
"(",
")",
")",
";",
"}"
] | Hit the test servlet to see if getUniqueGroupIdsForUser works when supplied with a valid user in a nested group.
This verifies the various required bundles got installed and are working. | [
"Hit",
"the",
"test",
"servlet",
"to",
"see",
"if",
"getUniqueGroupIdsForUser",
"works",
"when",
"supplied",
"with",
"a",
"valid",
"user",
"in",
"a",
"nested",
"group",
".",
"This",
"verifies",
"the",
"various",
"required",
"bundles",
"got",
"installed",
"and",
"are",
"working",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.adapter.ldap_fat/fat/src/com/ibm/ws/security/wim/adapter/ldap/fat/URAPIs_LDAP_NestedGroupBase.java#L113-L122 | train |
OpenLiberty/open-liberty | dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/execution/impl/RuntimeStepExecution.java | RuntimeStepExecution.getCommittedMetric | private MetricImpl getCommittedMetric(MetricImpl.MetricType metricType) {
return (MetricImpl)committedMetrics.get(metricType.name());
} | java | private MetricImpl getCommittedMetric(MetricImpl.MetricType metricType) {
return (MetricImpl)committedMetrics.get(metricType.name());
} | [
"private",
"MetricImpl",
"getCommittedMetric",
"(",
"MetricImpl",
".",
"MetricType",
"metricType",
")",
"{",
"return",
"(",
"MetricImpl",
")",
"committedMetrics",
".",
"get",
"(",
"metricType",
".",
"name",
"(",
")",
")",
";",
"}"
] | Since this is a non-trivial behavior to support, let's keep it internal rather than exposing it. | [
"Since",
"this",
"is",
"a",
"non",
"-",
"trivial",
"behavior",
"to",
"support",
"let",
"s",
"keep",
"it",
"internal",
"rather",
"than",
"exposing",
"it",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/execution/impl/RuntimeStepExecution.java#L126-L128 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/reader/RemoteAllResults.java | RemoteAllResults.getLogLists | public Iterable<RemoteInstanceDetails> getLogLists() {
ArrayList<RemoteInstanceDetails> result = new ArrayList<RemoteInstanceDetails>();
for (Date startTime: resultList) {
result.add(new RemoteInstanceDetails(query, startTime, new String[0]));
}
return result;
} | java | public Iterable<RemoteInstanceDetails> getLogLists() {
ArrayList<RemoteInstanceDetails> result = new ArrayList<RemoteInstanceDetails>();
for (Date startTime: resultList) {
result.add(new RemoteInstanceDetails(query, startTime, new String[0]));
}
return result;
} | [
"public",
"Iterable",
"<",
"RemoteInstanceDetails",
">",
"getLogLists",
"(",
")",
"{",
"ArrayList",
"<",
"RemoteInstanceDetails",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"RemoteInstanceDetails",
">",
"(",
")",
";",
"for",
"(",
"Date",
"startTime",
":",
"resultList",
")",
"{",
"result",
".",
"add",
"(",
"new",
"RemoteInstanceDetails",
"(",
"query",
",",
"startTime",
",",
"new",
"String",
"[",
"0",
"]",
")",
")",
";",
"}",
"return",
"result",
";",
"}"
] | returns list of server instances satisfying the request.
@return iterable over RemoteInstanceDetails objects | [
"returns",
"list",
"of",
"server",
"instances",
"satisfying",
"the",
"request",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/reader/RemoteAllResults.java#L56-L62 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.fat.common/src/com/ibm/ws/security/fat/common/utils/CommonExpectations.java | CommonExpectations.successfullyReachedUrl | public static Expectations successfullyReachedUrl(String url) {
Expectations expectations = new Expectations();
expectations.addSuccessCodeForCurrentAction();
expectations.addExpectation(new ResponseUrlExpectation(Constants.STRING_EQUALS, url, "Did not reach the expected URL."));
return expectations;
} | java | public static Expectations successfullyReachedUrl(String url) {
Expectations expectations = new Expectations();
expectations.addSuccessCodeForCurrentAction();
expectations.addExpectation(new ResponseUrlExpectation(Constants.STRING_EQUALS, url, "Did not reach the expected URL."));
return expectations;
} | [
"public",
"static",
"Expectations",
"successfullyReachedUrl",
"(",
"String",
"url",
")",
"{",
"Expectations",
"expectations",
"=",
"new",
"Expectations",
"(",
")",
";",
"expectations",
".",
"addSuccessCodeForCurrentAction",
"(",
")",
";",
"expectations",
".",
"addExpectation",
"(",
"new",
"ResponseUrlExpectation",
"(",
"Constants",
".",
"STRING_EQUALS",
",",
"url",
",",
"\"Did not reach the expected URL.\"",
")",
")",
";",
"return",
"expectations",
";",
"}"
] | Set success for current action only
@param url
@return | [
"Set",
"success",
"for",
"current",
"action",
"only"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.fat.common/src/com/ibm/ws/security/fat/common/utils/CommonExpectations.java#L43-L48 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/config/ManagedBeanDestroyer.java | ManagedBeanDestroyer.destroy | public void destroy(String name, Object instance)
{
if (instance != null && isManagedBean(name))
{
try
{
_lifecycleProvider.destroyInstance(instance);
}
catch (IllegalAccessException e)
{
log.log(Level.SEVERE, "Could not access @PreDestroy method of managed bean " + name, e);
}
catch (InvocationTargetException e)
{
log.log(Level.SEVERE, "An Exception occured while invoking " +
"@PreDestroy method of managed bean " + name, e);
}
}
} | java | public void destroy(String name, Object instance)
{
if (instance != null && isManagedBean(name))
{
try
{
_lifecycleProvider.destroyInstance(instance);
}
catch (IllegalAccessException e)
{
log.log(Level.SEVERE, "Could not access @PreDestroy method of managed bean " + name, e);
}
catch (InvocationTargetException e)
{
log.log(Level.SEVERE, "An Exception occured while invoking " +
"@PreDestroy method of managed bean " + name, e);
}
}
} | [
"public",
"void",
"destroy",
"(",
"String",
"name",
",",
"Object",
"instance",
")",
"{",
"if",
"(",
"instance",
"!=",
"null",
"&&",
"isManagedBean",
"(",
"name",
")",
")",
"{",
"try",
"{",
"_lifecycleProvider",
".",
"destroyInstance",
"(",
"instance",
")",
";",
"}",
"catch",
"(",
"IllegalAccessException",
"e",
")",
"{",
"log",
".",
"log",
"(",
"Level",
".",
"SEVERE",
",",
"\"Could not access @PreDestroy method of managed bean \"",
"+",
"name",
",",
"e",
")",
";",
"}",
"catch",
"(",
"InvocationTargetException",
"e",
")",
"{",
"log",
".",
"log",
"(",
"Level",
".",
"SEVERE",
",",
"\"An Exception occured while invoking \"",
"+",
"\"@PreDestroy method of managed bean \"",
"+",
"name",
",",
"e",
")",
";",
"}",
"}",
"}"
] | Destroys the given managed bean.
@param name
@param instance | [
"Destroys",
"the",
"given",
"managed",
"bean",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/config/ManagedBeanDestroyer.java#L129-L147 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/OracleHelper.java | OracleHelper.cacheVendorConnectionProps | @Override
public Map<String, Object> cacheVendorConnectionProps(Connection sqlConn) throws SQLException {
try {
Class<?> c = OracleConnection.get();
if (c == null)
OracleConnection.set(c = WSManagedConnectionFactoryImpl.priv.loadClass(mcf.jdbcDriverLoader, oracle_jdbc_OracleConnection));
Map<String, Object> tempProps = new HashMap<String, Object>();
if (driverMajorVersion == NOT_CACHED) {
driverMajorVersion = sqlConn.getMetaData().getDriverMajorVersion();
}
// If tempProps is changed then WSRdbManagedConnectionImpl.VENDOR_PROPERTY_SETTERS must be updated
Method m = getDefaultExecuteBatch.get();
if (m == null)
getDefaultExecuteBatch.set(m = c.getMethod("getDefaultExecuteBatch"));
tempProps.put("DefaultExecuteBatch", m.invoke(sqlConn));
m = getDefaultRowPrefetch.get();
if (m == null)
getDefaultRowPrefetch.set(m = c.getMethod("getDefaultRowPrefetch"));
tempProps.put("DefaultRowPrefetch", m.invoke(sqlConn));
if (driverMajorVersion > 10) {
m = getDefaultTimeZone.get();
if (m == null)
getDefaultTimeZone.set(m = c.getMethod("getDefaultTimeZone"));
tempProps.put("DefaultTimeZone", m.invoke(sqlConn));
}
m = getIncludeSynonyms.get();
if (m == null)
getIncludeSynonyms.set(m = c.getMethod("getIncludeSynonyms"));
tempProps.put("IncludeSynonyms", m.invoke(sqlConn));
m = getRemarksReporting.get();
if (m == null)
getRemarksReporting.set(m = c.getMethod("getRemarksReporting"));
tempProps.put("RemarksReporting", m.invoke(sqlConn));
m = getRestrictGetTables.get();
if (m == null)
getRestrictGetTables.set(m = c.getMethod("getRestrictGetTables"));
tempProps.put("RestrictGetTables", m.invoke(sqlConn));
m = getSessionTimeZone.get();
if (m == null)
getSessionTimeZone.set(m = c.getMethod("getSessionTimeZone"));
tempProps.put("SessionTimeZone", m.invoke(sqlConn));
return tempProps;
} catch (RuntimeException x) {
throw x;
} catch (Exception x) {
throw AdapterUtil.toSQLException(x);
}
} | java | @Override
public Map<String, Object> cacheVendorConnectionProps(Connection sqlConn) throws SQLException {
try {
Class<?> c = OracleConnection.get();
if (c == null)
OracleConnection.set(c = WSManagedConnectionFactoryImpl.priv.loadClass(mcf.jdbcDriverLoader, oracle_jdbc_OracleConnection));
Map<String, Object> tempProps = new HashMap<String, Object>();
if (driverMajorVersion == NOT_CACHED) {
driverMajorVersion = sqlConn.getMetaData().getDriverMajorVersion();
}
// If tempProps is changed then WSRdbManagedConnectionImpl.VENDOR_PROPERTY_SETTERS must be updated
Method m = getDefaultExecuteBatch.get();
if (m == null)
getDefaultExecuteBatch.set(m = c.getMethod("getDefaultExecuteBatch"));
tempProps.put("DefaultExecuteBatch", m.invoke(sqlConn));
m = getDefaultRowPrefetch.get();
if (m == null)
getDefaultRowPrefetch.set(m = c.getMethod("getDefaultRowPrefetch"));
tempProps.put("DefaultRowPrefetch", m.invoke(sqlConn));
if (driverMajorVersion > 10) {
m = getDefaultTimeZone.get();
if (m == null)
getDefaultTimeZone.set(m = c.getMethod("getDefaultTimeZone"));
tempProps.put("DefaultTimeZone", m.invoke(sqlConn));
}
m = getIncludeSynonyms.get();
if (m == null)
getIncludeSynonyms.set(m = c.getMethod("getIncludeSynonyms"));
tempProps.put("IncludeSynonyms", m.invoke(sqlConn));
m = getRemarksReporting.get();
if (m == null)
getRemarksReporting.set(m = c.getMethod("getRemarksReporting"));
tempProps.put("RemarksReporting", m.invoke(sqlConn));
m = getRestrictGetTables.get();
if (m == null)
getRestrictGetTables.set(m = c.getMethod("getRestrictGetTables"));
tempProps.put("RestrictGetTables", m.invoke(sqlConn));
m = getSessionTimeZone.get();
if (m == null)
getSessionTimeZone.set(m = c.getMethod("getSessionTimeZone"));
tempProps.put("SessionTimeZone", m.invoke(sqlConn));
return tempProps;
} catch (RuntimeException x) {
throw x;
} catch (Exception x) {
throw AdapterUtil.toSQLException(x);
}
} | [
"@",
"Override",
"public",
"Map",
"<",
"String",
",",
"Object",
">",
"cacheVendorConnectionProps",
"(",
"Connection",
"sqlConn",
")",
"throws",
"SQLException",
"{",
"try",
"{",
"Class",
"<",
"?",
">",
"c",
"=",
"OracleConnection",
".",
"get",
"(",
")",
";",
"if",
"(",
"c",
"==",
"null",
")",
"OracleConnection",
".",
"set",
"(",
"c",
"=",
"WSManagedConnectionFactoryImpl",
".",
"priv",
".",
"loadClass",
"(",
"mcf",
".",
"jdbcDriverLoader",
",",
"oracle_jdbc_OracleConnection",
")",
")",
";",
"Map",
"<",
"String",
",",
"Object",
">",
"tempProps",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"if",
"(",
"driverMajorVersion",
"==",
"NOT_CACHED",
")",
"{",
"driverMajorVersion",
"=",
"sqlConn",
".",
"getMetaData",
"(",
")",
".",
"getDriverMajorVersion",
"(",
")",
";",
"}",
"// If tempProps is changed then WSRdbManagedConnectionImpl.VENDOR_PROPERTY_SETTERS must be updated",
"Method",
"m",
"=",
"getDefaultExecuteBatch",
".",
"get",
"(",
")",
";",
"if",
"(",
"m",
"==",
"null",
")",
"getDefaultExecuteBatch",
".",
"set",
"(",
"m",
"=",
"c",
".",
"getMethod",
"(",
"\"getDefaultExecuteBatch\"",
")",
")",
";",
"tempProps",
".",
"put",
"(",
"\"DefaultExecuteBatch\"",
",",
"m",
".",
"invoke",
"(",
"sqlConn",
")",
")",
";",
"m",
"=",
"getDefaultRowPrefetch",
".",
"get",
"(",
")",
";",
"if",
"(",
"m",
"==",
"null",
")",
"getDefaultRowPrefetch",
".",
"set",
"(",
"m",
"=",
"c",
".",
"getMethod",
"(",
"\"getDefaultRowPrefetch\"",
")",
")",
";",
"tempProps",
".",
"put",
"(",
"\"DefaultRowPrefetch\"",
",",
"m",
".",
"invoke",
"(",
"sqlConn",
")",
")",
";",
"if",
"(",
"driverMajorVersion",
">",
"10",
")",
"{",
"m",
"=",
"getDefaultTimeZone",
".",
"get",
"(",
")",
";",
"if",
"(",
"m",
"==",
"null",
")",
"getDefaultTimeZone",
".",
"set",
"(",
"m",
"=",
"c",
".",
"getMethod",
"(",
"\"getDefaultTimeZone\"",
")",
")",
";",
"tempProps",
".",
"put",
"(",
"\"DefaultTimeZone\"",
",",
"m",
".",
"invoke",
"(",
"sqlConn",
")",
")",
";",
"}",
"m",
"=",
"getIncludeSynonyms",
".",
"get",
"(",
")",
";",
"if",
"(",
"m",
"==",
"null",
")",
"getIncludeSynonyms",
".",
"set",
"(",
"m",
"=",
"c",
".",
"getMethod",
"(",
"\"getIncludeSynonyms\"",
")",
")",
";",
"tempProps",
".",
"put",
"(",
"\"IncludeSynonyms\"",
",",
"m",
".",
"invoke",
"(",
"sqlConn",
")",
")",
";",
"m",
"=",
"getRemarksReporting",
".",
"get",
"(",
")",
";",
"if",
"(",
"m",
"==",
"null",
")",
"getRemarksReporting",
".",
"set",
"(",
"m",
"=",
"c",
".",
"getMethod",
"(",
"\"getRemarksReporting\"",
")",
")",
";",
"tempProps",
".",
"put",
"(",
"\"RemarksReporting\"",
",",
"m",
".",
"invoke",
"(",
"sqlConn",
")",
")",
";",
"m",
"=",
"getRestrictGetTables",
".",
"get",
"(",
")",
";",
"if",
"(",
"m",
"==",
"null",
")",
"getRestrictGetTables",
".",
"set",
"(",
"m",
"=",
"c",
".",
"getMethod",
"(",
"\"getRestrictGetTables\"",
")",
")",
";",
"tempProps",
".",
"put",
"(",
"\"RestrictGetTables\"",
",",
"m",
".",
"invoke",
"(",
"sqlConn",
")",
")",
";",
"m",
"=",
"getSessionTimeZone",
".",
"get",
"(",
")",
";",
"if",
"(",
"m",
"==",
"null",
")",
"getSessionTimeZone",
".",
"set",
"(",
"m",
"=",
"c",
".",
"getMethod",
"(",
"\"getSessionTimeZone\"",
")",
")",
";",
"tempProps",
".",
"put",
"(",
"\"SessionTimeZone\"",
",",
"m",
".",
"invoke",
"(",
"sqlConn",
")",
")",
";",
"return",
"tempProps",
";",
"}",
"catch",
"(",
"RuntimeException",
"x",
")",
"{",
"throw",
"x",
";",
"}",
"catch",
"(",
"Exception",
"x",
")",
"{",
"throw",
"AdapterUtil",
".",
"toSQLException",
"(",
"x",
")",
";",
"}",
"}"
] | This method is called to cache the default set of properties for a Connection.
The properties only need to be cached when applications are invoking a
set of specific Vendor APIs, which change properties, that must be returned to
default values before pooling a connection.
@return Map of properties or Null if not implemented
@param java.sql.Connection
@throws SQLException | [
"This",
"method",
"is",
"called",
"to",
"cache",
"the",
"default",
"set",
"of",
"properties",
"for",
"a",
"Connection",
".",
"The",
"properties",
"only",
"need",
"to",
"be",
"cached",
"when",
"applications",
"are",
"invoking",
"a",
"set",
"of",
"specific",
"Vendor",
"APIs",
"which",
"change",
"properties",
"that",
"must",
"be",
"returned",
"to",
"default",
"values",
"before",
"pooling",
"a",
"connection",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/OracleHelper.java#L275-L332 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/OracleHelper.java | OracleHelper.doConnectionCleanup | @Override
public boolean doConnectionCleanup(Connection conn) throws SQLException {
final boolean trace = TraceComponent.isAnyTracingEnabled();
if (trace && tc.isEntryEnabled())
Tr.entry(tc, "doConnectionCleanup");
boolean result = false;
try {
Class<?> c = OracleConnection.get();
if (c == null)
OracleConnection.set(c = WSManagedConnectionFactoryImpl.priv.loadClass(mcf.jdbcDriverLoader, oracle_jdbc_OracleConnection));
if (c.isInstance(conn)) {
try {
Method m = isProxySession.get();
if (m == null)
isProxySession.set(m = c.getMethod("isProxySession"));
if ((Boolean) m.invoke(conn)) {
m = close.get();
if (m == null)
close.set(m = c.getMethod("close", int.class));
m.invoke(conn, 1); // value of OracleConnection.PROXY_SESSION
result = true;
}
} catch (NoSuchMethodException nsme) {
// This is expected when older version of the Oracle JDBC Driver
// like classes12.zip are being used
}
}
} catch (RuntimeException x) {
throw x;
} catch (Exception x) {
throw AdapterUtil.toSQLException(x);
}
if (trace && tc.isEntryEnabled())
Tr.exit(tc, "doConnectionCleanup", result);
return result;
} | java | @Override
public boolean doConnectionCleanup(Connection conn) throws SQLException {
final boolean trace = TraceComponent.isAnyTracingEnabled();
if (trace && tc.isEntryEnabled())
Tr.entry(tc, "doConnectionCleanup");
boolean result = false;
try {
Class<?> c = OracleConnection.get();
if (c == null)
OracleConnection.set(c = WSManagedConnectionFactoryImpl.priv.loadClass(mcf.jdbcDriverLoader, oracle_jdbc_OracleConnection));
if (c.isInstance(conn)) {
try {
Method m = isProxySession.get();
if (m == null)
isProxySession.set(m = c.getMethod("isProxySession"));
if ((Boolean) m.invoke(conn)) {
m = close.get();
if (m == null)
close.set(m = c.getMethod("close", int.class));
m.invoke(conn, 1); // value of OracleConnection.PROXY_SESSION
result = true;
}
} catch (NoSuchMethodException nsme) {
// This is expected when older version of the Oracle JDBC Driver
// like classes12.zip are being used
}
}
} catch (RuntimeException x) {
throw x;
} catch (Exception x) {
throw AdapterUtil.toSQLException(x);
}
if (trace && tc.isEntryEnabled())
Tr.exit(tc, "doConnectionCleanup", result);
return result;
} | [
"@",
"Override",
"public",
"boolean",
"doConnectionCleanup",
"(",
"Connection",
"conn",
")",
"throws",
"SQLException",
"{",
"final",
"boolean",
"trace",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"if",
"(",
"trace",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"doConnectionCleanup\"",
")",
";",
"boolean",
"result",
"=",
"false",
";",
"try",
"{",
"Class",
"<",
"?",
">",
"c",
"=",
"OracleConnection",
".",
"get",
"(",
")",
";",
"if",
"(",
"c",
"==",
"null",
")",
"OracleConnection",
".",
"set",
"(",
"c",
"=",
"WSManagedConnectionFactoryImpl",
".",
"priv",
".",
"loadClass",
"(",
"mcf",
".",
"jdbcDriverLoader",
",",
"oracle_jdbc_OracleConnection",
")",
")",
";",
"if",
"(",
"c",
".",
"isInstance",
"(",
"conn",
")",
")",
"{",
"try",
"{",
"Method",
"m",
"=",
"isProxySession",
".",
"get",
"(",
")",
";",
"if",
"(",
"m",
"==",
"null",
")",
"isProxySession",
".",
"set",
"(",
"m",
"=",
"c",
".",
"getMethod",
"(",
"\"isProxySession\"",
")",
")",
";",
"if",
"(",
"(",
"Boolean",
")",
"m",
".",
"invoke",
"(",
"conn",
")",
")",
"{",
"m",
"=",
"close",
".",
"get",
"(",
")",
";",
"if",
"(",
"m",
"==",
"null",
")",
"close",
".",
"set",
"(",
"m",
"=",
"c",
".",
"getMethod",
"(",
"\"close\"",
",",
"int",
".",
"class",
")",
")",
";",
"m",
".",
"invoke",
"(",
"conn",
",",
"1",
")",
";",
"// value of OracleConnection.PROXY_SESSION",
"result",
"=",
"true",
";",
"}",
"}",
"catch",
"(",
"NoSuchMethodException",
"nsme",
")",
"{",
"// This is expected when older version of the Oracle JDBC Driver",
"// like classes12.zip are being used",
"}",
"}",
"}",
"catch",
"(",
"RuntimeException",
"x",
")",
"{",
"throw",
"x",
";",
"}",
"catch",
"(",
"Exception",
"x",
")",
"{",
"throw",
"AdapterUtil",
".",
"toSQLException",
"(",
"x",
")",
";",
"}",
"if",
"(",
"trace",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"doConnectionCleanup\"",
",",
"result",
")",
";",
"return",
"result",
";",
"}"
] | Closes the proxy session. | [
"Closes",
"the",
"proxy",
"session",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/OracleHelper.java#L337-L375 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/OracleHelper.java | OracleHelper.psSetString | @Override
public void psSetString(PreparedStatement pstmtImpl, int i, String x) throws SQLException {
int length = (x == null ? 0 : x.getBytes().length);
if (tc.isDebugEnabled()) {
Tr.debug(this, tc, "string length: " + length);
}
if (length > 4000) {
if (tc.isDebugEnabled())
Tr.debug(this, tc, "Oracle setString length > 4000 bytes workaround.");
/*
* length in setCharacterStream is number of character in
* stream
*/
pstmtImpl.setCharacterStream(i, new StringReader(x), x.length());
} else {
pstmtImpl.setString(i, x);
}
} | java | @Override
public void psSetString(PreparedStatement pstmtImpl, int i, String x) throws SQLException {
int length = (x == null ? 0 : x.getBytes().length);
if (tc.isDebugEnabled()) {
Tr.debug(this, tc, "string length: " + length);
}
if (length > 4000) {
if (tc.isDebugEnabled())
Tr.debug(this, tc, "Oracle setString length > 4000 bytes workaround.");
/*
* length in setCharacterStream is number of character in
* stream
*/
pstmtImpl.setCharacterStream(i, new StringReader(x), x.length());
} else {
pstmtImpl.setString(i, x);
}
} | [
"@",
"Override",
"public",
"void",
"psSetString",
"(",
"PreparedStatement",
"pstmtImpl",
",",
"int",
"i",
",",
"String",
"x",
")",
"throws",
"SQLException",
"{",
"int",
"length",
"=",
"(",
"x",
"==",
"null",
"?",
"0",
":",
"x",
".",
"getBytes",
"(",
")",
".",
"length",
")",
";",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"string length: \"",
"+",
"length",
")",
";",
"}",
"if",
"(",
"length",
">",
"4000",
")",
"{",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"Oracle setString length > 4000 bytes workaround.\"",
")",
";",
"/*\n * length in setCharacterStream is number of character in\n * stream\n */",
"pstmtImpl",
".",
"setCharacterStream",
"(",
"i",
",",
"new",
"StringReader",
"(",
"x",
")",
",",
"x",
".",
"length",
"(",
")",
")",
";",
"}",
"else",
"{",
"pstmtImpl",
".",
"setString",
"(",
"i",
",",
"x",
")",
";",
"}",
"}"
] | - allow for special handling of Oracle prepared statement setString | [
"-",
"allow",
"for",
"special",
"handling",
"of",
"Oracle",
"prepared",
"statement",
"setString"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/impl/OracleHelper.java#L741-L760 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.microprofile.metrics.1.1.cdi/src/com/ibm/ws/microprofile/metrics11/cdi/MetricResolver11.java | MetricResolver11.checkReusable | private <T extends Annotation> boolean checkReusable(MetricResolver.Of<T> of) {
String name = of.metadata().getName();
// If the metric has been registered before (eg. metrics found in RequestScoped beans),
// we don't need to worry about re-usable
if (!of.isInitialDiscovery()) {
return true;
}
Metadata existingMetadata = registry.getMetadata().get(name);
if (existingMetadata != null && (existingMetadata.isReusable() == false || of.metadata().isReusable() == false)) {
throw new IllegalArgumentException("Cannot reuse metric for " + of.metricName());
}
return true;
} | java | private <T extends Annotation> boolean checkReusable(MetricResolver.Of<T> of) {
String name = of.metadata().getName();
// If the metric has been registered before (eg. metrics found in RequestScoped beans),
// we don't need to worry about re-usable
if (!of.isInitialDiscovery()) {
return true;
}
Metadata existingMetadata = registry.getMetadata().get(name);
if (existingMetadata != null && (existingMetadata.isReusable() == false || of.metadata().isReusable() == false)) {
throw new IllegalArgumentException("Cannot reuse metric for " + of.metricName());
}
return true;
} | [
"private",
"<",
"T",
"extends",
"Annotation",
">",
"boolean",
"checkReusable",
"(",
"MetricResolver",
".",
"Of",
"<",
"T",
">",
"of",
")",
"{",
"String",
"name",
"=",
"of",
".",
"metadata",
"(",
")",
".",
"getName",
"(",
")",
";",
"// If the metric has been registered before (eg. metrics found in RequestScoped beans),",
"// we don't need to worry about re-usable",
"if",
"(",
"!",
"of",
".",
"isInitialDiscovery",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"Metadata",
"existingMetadata",
"=",
"registry",
".",
"getMetadata",
"(",
")",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"existingMetadata",
"!=",
"null",
"&&",
"(",
"existingMetadata",
".",
"isReusable",
"(",
")",
"==",
"false",
"||",
"of",
".",
"metadata",
"(",
")",
".",
"isReusable",
"(",
")",
"==",
"false",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Cannot reuse metric for \"",
"+",
"of",
".",
"metricName",
"(",
")",
")",
";",
"}",
"return",
"true",
";",
"}"
] | Checks whether the metric should be re-usable | [
"Checks",
"whether",
"the",
"metric",
"should",
"be",
"re",
"-",
"usable"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.metrics.1.1.cdi/src/com/ibm/ws/microprofile/metrics11/cdi/MetricResolver11.java#L94-L108 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/TagAttributesImpl.java | TagAttributesImpl.getAll | public TagAttribute[] getAll(String namespace)
{
int idx = 0;
if (namespace == null)
{
idx = Arrays.binarySearch(_namespaces, "");
}
else
{
idx = Arrays.binarySearch(_namespaces, namespace);
}
if (idx >= 0)
{
return _nsattrs.get(idx);
}
return EMPTY;
} | java | public TagAttribute[] getAll(String namespace)
{
int idx = 0;
if (namespace == null)
{
idx = Arrays.binarySearch(_namespaces, "");
}
else
{
idx = Arrays.binarySearch(_namespaces, namespace);
}
if (idx >= 0)
{
return _nsattrs.get(idx);
}
return EMPTY;
} | [
"public",
"TagAttribute",
"[",
"]",
"getAll",
"(",
"String",
"namespace",
")",
"{",
"int",
"idx",
"=",
"0",
";",
"if",
"(",
"namespace",
"==",
"null",
")",
"{",
"idx",
"=",
"Arrays",
".",
"binarySearch",
"(",
"_namespaces",
",",
"\"\"",
")",
";",
"}",
"else",
"{",
"idx",
"=",
"Arrays",
".",
"binarySearch",
"(",
"_namespaces",
",",
"namespace",
")",
";",
"}",
"if",
"(",
"idx",
">=",
"0",
")",
"{",
"return",
"_nsattrs",
".",
"get",
"(",
"idx",
")",
";",
"}",
"return",
"EMPTY",
";",
"}"
] | Get all TagAttributes for the passed namespace
@param namespace
namespace to search
@return a non-null array of TagAttributes | [
"Get",
"all",
"TagAttributes",
"for",
"the",
"passed",
"namespace"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/TagAttributesImpl.java#L150-L168 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/wsspi/sib/core/SIMessageHandleRestorer.java | SIMessageHandleRestorer.createRestorerInstance | private static void createRestorerInstance() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createRestorerInstance");
try {
Class cls = Class.forName(SI_MESSAGE_HANDLE_RESTORER_CLASS);
instance = (SIMessageHandleRestorer) cls.newInstance();
}
catch (Exception e) {
FFDCFilter.processException(e, "com.ibm.wsspi.sib.core.SIMessageHandleRestorer.createRestorerInstance", "100");
SibTr.error(tc,"UNABLE_TO_CREATE_HANDLERESTORER_CWSIB0010",e);
NoClassDefFoundError ncdfe = new NoClassDefFoundError(e.getMessage());
ncdfe.initCause(e);
throw ncdfe;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createRestorerInstance");
} | java | private static void createRestorerInstance() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createRestorerInstance");
try {
Class cls = Class.forName(SI_MESSAGE_HANDLE_RESTORER_CLASS);
instance = (SIMessageHandleRestorer) cls.newInstance();
}
catch (Exception e) {
FFDCFilter.processException(e, "com.ibm.wsspi.sib.core.SIMessageHandleRestorer.createRestorerInstance", "100");
SibTr.error(tc,"UNABLE_TO_CREATE_HANDLERESTORER_CWSIB0010",e);
NoClassDefFoundError ncdfe = new NoClassDefFoundError(e.getMessage());
ncdfe.initCause(e);
throw ncdfe;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createRestorerInstance");
} | [
"private",
"static",
"void",
"createRestorerInstance",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"createRestorerInstance\"",
")",
";",
"try",
"{",
"Class",
"cls",
"=",
"Class",
".",
"forName",
"(",
"SI_MESSAGE_HANDLE_RESTORER_CLASS",
")",
";",
"instance",
"=",
"(",
"SIMessageHandleRestorer",
")",
"cls",
".",
"newInstance",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.wsspi.sib.core.SIMessageHandleRestorer.createRestorerInstance\"",
",",
"\"100\"",
")",
";",
"SibTr",
".",
"error",
"(",
"tc",
",",
"\"UNABLE_TO_CREATE_HANDLERESTORER_CWSIB0010\"",
",",
"e",
")",
";",
"NoClassDefFoundError",
"ncdfe",
"=",
"new",
"NoClassDefFoundError",
"(",
"e",
".",
"getMessage",
"(",
")",
")",
";",
"ncdfe",
".",
"initCause",
"(",
"e",
")",
";",
"throw",
"ncdfe",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"createRestorerInstance\"",
")",
";",
"}"
] | Create the singleton Restorer instance. | [
"Create",
"the",
"singleton",
"Restorer",
"instance",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/wsspi/sib/core/SIMessageHandleRestorer.java#L91-L105 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/ContainerTx.java | ContainerTx.queueTimerToStart | public void queueTimerToStart(TimerNpImpl timer) { // F743-13022
if (globalTransaction) {
if (timersQueuedToStart == null) { // F743-425.CodRev
// Lazy creation of HashMap
timersQueuedToStart = new HashMap<String, TimerNpImpl>(); // F473-425.1
}
timersQueuedToStart.put(timer.getTaskId(), timer);
}
else {
timer.start();
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "tran ctx is not global, so started timer immediately.");
}
}
} | java | public void queueTimerToStart(TimerNpImpl timer) { // F743-13022
if (globalTransaction) {
if (timersQueuedToStart == null) { // F743-425.CodRev
// Lazy creation of HashMap
timersQueuedToStart = new HashMap<String, TimerNpImpl>(); // F473-425.1
}
timersQueuedToStart.put(timer.getTaskId(), timer);
}
else {
timer.start();
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "tran ctx is not global, so started timer immediately.");
}
}
} | [
"public",
"void",
"queueTimerToStart",
"(",
"TimerNpImpl",
"timer",
")",
"{",
"// F743-13022",
"if",
"(",
"globalTransaction",
")",
"{",
"if",
"(",
"timersQueuedToStart",
"==",
"null",
")",
"{",
"// F743-425.CodRev",
"// Lazy creation of HashMap",
"timersQueuedToStart",
"=",
"new",
"HashMap",
"<",
"String",
",",
"TimerNpImpl",
">",
"(",
")",
";",
"// F473-425.1",
"}",
"timersQueuedToStart",
".",
"put",
"(",
"timer",
".",
"getTaskId",
"(",
")",
",",
"timer",
")",
";",
"}",
"else",
"{",
"timer",
".",
"start",
"(",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"tran ctx is not global, so started timer immediately.\"",
")",
";",
"}",
"}",
"}"
] | Add the input non-persistent timer to the queue
of timers to be started upon commit of the global
transaction. If not in a global transaction,
start the timer immediately.
Called by each of the BeanO.createXxxTimer methods
immediately after creating a non-persistent timer. | [
"Add",
"the",
"input",
"non",
"-",
"persistent",
"timer",
"to",
"the",
"queue",
"of",
"timers",
"to",
"be",
"started",
"upon",
"commit",
"of",
"the",
"global",
"transaction",
".",
"If",
"not",
"in",
"a",
"global",
"transaction",
"start",
"the",
"timer",
"immediately",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/ContainerTx.java#L1102-L1123 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/ContainerTx.java | ContainerTx.find | public BeanO find(BeanId beanId)
{
BeanO bean = null;
if (beanOs != null)
{
bean = beanOs.get(beanId);
}
// If debug is enabled, go ahead and calculate some hit rate
// metrics and print out whether found or not.
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
ivTxCacheSearch++;
if (bean != null)
{
ivTxCacheHits++;
Tr.debug(tc, "Bean found in Transaction cache (Hit Rate:" +
ivTxCacheHits + "/" + ivTxCacheSearch + ")");
}
else
{
Tr.debug(tc, "Bean not in Transaction cache (Hit Rate:" +
ivTxCacheHits + "/" + ivTxCacheSearch + ")");
}
}
return bean;
} | java | public BeanO find(BeanId beanId)
{
BeanO bean = null;
if (beanOs != null)
{
bean = beanOs.get(beanId);
}
// If debug is enabled, go ahead and calculate some hit rate
// metrics and print out whether found or not.
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
ivTxCacheSearch++;
if (bean != null)
{
ivTxCacheHits++;
Tr.debug(tc, "Bean found in Transaction cache (Hit Rate:" +
ivTxCacheHits + "/" + ivTxCacheSearch + ")");
}
else
{
Tr.debug(tc, "Bean not in Transaction cache (Hit Rate:" +
ivTxCacheHits + "/" + ivTxCacheSearch + ")");
}
}
return bean;
} | [
"public",
"BeanO",
"find",
"(",
"BeanId",
"beanId",
")",
"{",
"BeanO",
"bean",
"=",
"null",
";",
"if",
"(",
"beanOs",
"!=",
"null",
")",
"{",
"bean",
"=",
"beanOs",
".",
"get",
"(",
"beanId",
")",
";",
"}",
"// If debug is enabled, go ahead and calculate some hit rate",
"// metrics and print out whether found or not.",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"ivTxCacheSearch",
"++",
";",
"if",
"(",
"bean",
"!=",
"null",
")",
"{",
"ivTxCacheHits",
"++",
";",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Bean found in Transaction cache (Hit Rate:\"",
"+",
"ivTxCacheHits",
"+",
"\"/\"",
"+",
"ivTxCacheSearch",
"+",
"\")\"",
")",
";",
"}",
"else",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Bean not in Transaction cache (Hit Rate:\"",
"+",
"ivTxCacheHits",
"+",
"\"/\"",
"+",
"ivTxCacheSearch",
"+",
"\")\"",
")",
";",
"}",
"}",
"return",
"bean",
";",
"}"
] | d173022.4 | [
"d173022",
".",
"4"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/ContainerTx.java#L1141-L1170 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/ContainerTx.java | ContainerTx.setIsolationLevel | protected void setIsolationLevel(int isolationLevel)
throws IsolationLevelChangeException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
{
Tr.event(tc, "current isolation level = "
+ MethodAttribUtils.getIsolationLevelString(ivIsolationLevel)
+ ", attempting to change to = "
+ MethodAttribUtils.getIsolationLevelString(isolationLevel)); // PK31372
}
// Treat TRANSACTION_NONE as "don't care". The current value may be
// NONE because it hasn't been set yet, or because all the methods
// invoked so far did not have an isolation level specified by
// the customer (in the deployment descriptor). d107762
if (ivIsolationLevel == java.sql.Connection.TRANSACTION_NONE) {
ivIsolationLevel = isolationLevel;
} else if (ivIsolationLevel != isolationLevel &&
isolationLevel != java.sql.Connection.TRANSACTION_NONE) {
throw new IsolationLevelChangeException();
}
} | java | protected void setIsolationLevel(int isolationLevel)
throws IsolationLevelChangeException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
{
Tr.event(tc, "current isolation level = "
+ MethodAttribUtils.getIsolationLevelString(ivIsolationLevel)
+ ", attempting to change to = "
+ MethodAttribUtils.getIsolationLevelString(isolationLevel)); // PK31372
}
// Treat TRANSACTION_NONE as "don't care". The current value may be
// NONE because it hasn't been set yet, or because all the methods
// invoked so far did not have an isolation level specified by
// the customer (in the deployment descriptor). d107762
if (ivIsolationLevel == java.sql.Connection.TRANSACTION_NONE) {
ivIsolationLevel = isolationLevel;
} else if (ivIsolationLevel != isolationLevel &&
isolationLevel != java.sql.Connection.TRANSACTION_NONE) {
throw new IsolationLevelChangeException();
}
} | [
"protected",
"void",
"setIsolationLevel",
"(",
"int",
"isolationLevel",
")",
"throws",
"IsolationLevelChangeException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"current isolation level = \"",
"+",
"MethodAttribUtils",
".",
"getIsolationLevelString",
"(",
"ivIsolationLevel",
")",
"+",
"\", attempting to change to = \"",
"+",
"MethodAttribUtils",
".",
"getIsolationLevelString",
"(",
"isolationLevel",
")",
")",
";",
"// PK31372",
"}",
"// Treat TRANSACTION_NONE as \"don't care\". The current value may be",
"// NONE because it hasn't been set yet, or because all the methods",
"// invoked so far did not have an isolation level specified by",
"// the customer (in the deployment descriptor). d107762",
"if",
"(",
"ivIsolationLevel",
"==",
"java",
".",
"sql",
".",
"Connection",
".",
"TRANSACTION_NONE",
")",
"{",
"ivIsolationLevel",
"=",
"isolationLevel",
";",
"}",
"else",
"if",
"(",
"ivIsolationLevel",
"!=",
"isolationLevel",
"&&",
"isolationLevel",
"!=",
"java",
".",
"sql",
".",
"Connection",
".",
"TRANSACTION_NONE",
")",
"{",
"throw",
"new",
"IsolationLevelChangeException",
"(",
")",
";",
"}",
"}"
] | Set the isolation level for the current transacion and ensure
that it has not changed within the transaction. | [
"Set",
"the",
"isolation",
"level",
"for",
"the",
"current",
"transacion",
"and",
"ensure",
"that",
"it",
"has",
"not",
"changed",
"within",
"the",
"transaction",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/ContainerTx.java#L1404-L1425 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/ContainerTx.java | ContainerTx.setCompleting | @Override
public void setCompleting(boolean isCompleting)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "setCompleting= " + isCompleting);
isActivitySessionCompleting = isCompleting;
//d138562.11
if (finderSyncList != null) // d173022.12
{ // d173022.12
int numberofCallers = finderSyncList.size();
for (int i = 0; i < numberofCallers; ++i) {
((ContainerSynchronization) finderSyncList.get(i)).setCompleting(isCompleting);
}
} // d173022.12
if (txListener != null)
try {
//txListener.afterCompletion(); d153430
txListener.setCompleting(isCompleting); //d153430
} catch (Throwable e) {
FFDCFilter.processException(e, CLASS_NAME + ".afterCompletion",
"1733", this);
throw new RuntimeException("txListener exception" + e.toString());
}
} | java | @Override
public void setCompleting(boolean isCompleting)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "setCompleting= " + isCompleting);
isActivitySessionCompleting = isCompleting;
//d138562.11
if (finderSyncList != null) // d173022.12
{ // d173022.12
int numberofCallers = finderSyncList.size();
for (int i = 0; i < numberofCallers; ++i) {
((ContainerSynchronization) finderSyncList.get(i)).setCompleting(isCompleting);
}
} // d173022.12
if (txListener != null)
try {
//txListener.afterCompletion(); d153430
txListener.setCompleting(isCompleting); //d153430
} catch (Throwable e) {
FFDCFilter.processException(e, CLASS_NAME + ".afterCompletion",
"1733", this);
throw new RuntimeException("txListener exception" + e.toString());
}
} | [
"@",
"Override",
"public",
"void",
"setCompleting",
"(",
"boolean",
"isCompleting",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"setCompleting= \"",
"+",
"isCompleting",
")",
";",
"isActivitySessionCompleting",
"=",
"isCompleting",
";",
"//d138562.11",
"if",
"(",
"finderSyncList",
"!=",
"null",
")",
"// d173022.12",
"{",
"// d173022.12",
"int",
"numberofCallers",
"=",
"finderSyncList",
".",
"size",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"numberofCallers",
";",
"++",
"i",
")",
"{",
"(",
"(",
"ContainerSynchronization",
")",
"finderSyncList",
".",
"get",
"(",
"i",
")",
")",
".",
"setCompleting",
"(",
"isCompleting",
")",
";",
"}",
"}",
"// d173022.12",
"if",
"(",
"txListener",
"!=",
"null",
")",
"try",
"{",
"//txListener.afterCompletion(); d153430",
"txListener",
".",
"setCompleting",
"(",
"isCompleting",
")",
";",
"//d153430",
"}",
"catch",
"(",
"Throwable",
"e",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"CLASS_NAME",
"+",
"\".afterCompletion\"",
",",
"\"1733\"",
",",
"this",
")",
";",
"throw",
"new",
"RuntimeException",
"(",
"\"txListener exception\"",
"+",
"e",
".",
"toString",
"(",
")",
")",
";",
"}",
"}"
] | d126930.3 | [
"d126930",
".",
"3"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/ContainerTx.java#L1682-L1707 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/ContainerTx.java | ContainerTx.enlistContainerSync | public void enlistContainerSync(Synchronization s)
throws CPIException
{
if (!(s instanceof ContainerSynchronization)) {
throw new CPIException("Must implement ContainerSynchronization interface");
}
if (finderSyncList == null) // d173022.12
{ // d173022.12
finderSyncList = new ArrayList<Synchronization>(); // d173022.12
} // d173022.12
finderSyncList.add(s);
} | java | public void enlistContainerSync(Synchronization s)
throws CPIException
{
if (!(s instanceof ContainerSynchronization)) {
throw new CPIException("Must implement ContainerSynchronization interface");
}
if (finderSyncList == null) // d173022.12
{ // d173022.12
finderSyncList = new ArrayList<Synchronization>(); // d173022.12
} // d173022.12
finderSyncList.add(s);
} | [
"public",
"void",
"enlistContainerSync",
"(",
"Synchronization",
"s",
")",
"throws",
"CPIException",
"{",
"if",
"(",
"!",
"(",
"s",
"instanceof",
"ContainerSynchronization",
")",
")",
"{",
"throw",
"new",
"CPIException",
"(",
"\"Must implement ContainerSynchronization interface\"",
")",
";",
"}",
"if",
"(",
"finderSyncList",
"==",
"null",
")",
"// d173022.12",
"{",
"// d173022.12",
"finderSyncList",
"=",
"new",
"ArrayList",
"<",
"Synchronization",
">",
"(",
")",
";",
"// d173022.12",
"}",
"// d173022.12",
"finderSyncList",
".",
"add",
"(",
"s",
")",
";",
"}"
] | d139562.11 | [
"d139562",
".",
"11"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/ContainerTx.java#L1713-L1724 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/ContainerTx.java | ContainerTx.releaseResources | protected void releaseResources()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "releaseResources : State = " + stateStrs[state]);
// If the state is not complete, then the ContainerTx should not
// be cleared, and should not be returned to the pool. This is common
// for BMT, where a method may begin the tx, but not complete it
// until a subsequent method call. d157262
if (state != COMMITTED && state != ROLLEDBACK)
{
return;
}
// Simply clear all instance variables that may hold a reference to
// another object. d215317
afterList = null;
beanOList = null;
beanOs = null;
cmdAccessor = null;
containerAS = null;
currentBeanOs = null;
finderSyncList = null;
homesForPMManagedBeans = null;
ivContainer = null;
ivPostProcessingException = null; // PQ90221
ivTxKey = null;
tempList = null;
txListener = null;
uowCtrl = null;
timersQueuedToStart = null; // F743-425.CodRev
timersCanceled = null; // F743-425.CodRev
} | java | protected void releaseResources()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "releaseResources : State = " + stateStrs[state]);
// If the state is not complete, then the ContainerTx should not
// be cleared, and should not be returned to the pool. This is common
// for BMT, where a method may begin the tx, but not complete it
// until a subsequent method call. d157262
if (state != COMMITTED && state != ROLLEDBACK)
{
return;
}
// Simply clear all instance variables that may hold a reference to
// another object. d215317
afterList = null;
beanOList = null;
beanOs = null;
cmdAccessor = null;
containerAS = null;
currentBeanOs = null;
finderSyncList = null;
homesForPMManagedBeans = null;
ivContainer = null;
ivPostProcessingException = null; // PQ90221
ivTxKey = null;
tempList = null;
txListener = null;
uowCtrl = null;
timersQueuedToStart = null; // F743-425.CodRev
timersCanceled = null; // F743-425.CodRev
} | [
"protected",
"void",
"releaseResources",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"releaseResources : State = \"",
"+",
"stateStrs",
"[",
"state",
"]",
")",
";",
"// If the state is not complete, then the ContainerTx should not",
"// be cleared, and should not be returned to the pool. This is common",
"// for BMT, where a method may begin the tx, but not complete it",
"// until a subsequent method call. d157262",
"if",
"(",
"state",
"!=",
"COMMITTED",
"&&",
"state",
"!=",
"ROLLEDBACK",
")",
"{",
"return",
";",
"}",
"// Simply clear all instance variables that may hold a reference to",
"// another object. d215317",
"afterList",
"=",
"null",
";",
"beanOList",
"=",
"null",
";",
"beanOs",
"=",
"null",
";",
"cmdAccessor",
"=",
"null",
";",
"containerAS",
"=",
"null",
";",
"currentBeanOs",
"=",
"null",
";",
"finderSyncList",
"=",
"null",
";",
"homesForPMManagedBeans",
"=",
"null",
";",
"ivContainer",
"=",
"null",
";",
"ivPostProcessingException",
"=",
"null",
";",
"// PQ90221",
"ivTxKey",
"=",
"null",
";",
"tempList",
"=",
"null",
";",
"txListener",
"=",
"null",
";",
"uowCtrl",
"=",
"null",
";",
"timersQueuedToStart",
"=",
"null",
";",
"// F743-425.CodRev",
"timersCanceled",
"=",
"null",
";",
"// F743-425.CodRev",
"}"
] | d154342.10 d215317 | [
"d154342",
".",
"10",
"d215317"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/ContainerTx.java#L1747-L1780 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/ContainerTx.java | ContainerTx.uowIdToString | protected static String uowIdToString(Object uowId)
{
String tidStr = null;
if (uowId != null)
{
if (uowId instanceof LocalTransactionCoordinator)
{
tidStr = "tid=" + Integer.toHexString(uowId.hashCode()) + "(LTC)";
}
else
{
int idx;
tidStr = uowId.toString();
if ((idx = tidStr.lastIndexOf("#")) != -1)
tidStr = tidStr.substring(idx + 1);
}
}
return tidStr;
} | java | protected static String uowIdToString(Object uowId)
{
String tidStr = null;
if (uowId != null)
{
if (uowId instanceof LocalTransactionCoordinator)
{
tidStr = "tid=" + Integer.toHexString(uowId.hashCode()) + "(LTC)";
}
else
{
int idx;
tidStr = uowId.toString();
if ((idx = tidStr.lastIndexOf("#")) != -1)
tidStr = tidStr.substring(idx + 1);
}
}
return tidStr;
} | [
"protected",
"static",
"String",
"uowIdToString",
"(",
"Object",
"uowId",
")",
"{",
"String",
"tidStr",
"=",
"null",
";",
"if",
"(",
"uowId",
"!=",
"null",
")",
"{",
"if",
"(",
"uowId",
"instanceof",
"LocalTransactionCoordinator",
")",
"{",
"tidStr",
"=",
"\"tid=\"",
"+",
"Integer",
".",
"toHexString",
"(",
"uowId",
".",
"hashCode",
"(",
")",
")",
"+",
"\"(LTC)\"",
";",
"}",
"else",
"{",
"int",
"idx",
";",
"tidStr",
"=",
"uowId",
".",
"toString",
"(",
")",
";",
"if",
"(",
"(",
"idx",
"=",
"tidStr",
".",
"lastIndexOf",
"(",
"\"#\"",
")",
")",
"!=",
"-",
"1",
")",
"tidStr",
"=",
"tidStr",
".",
"substring",
"(",
"idx",
"+",
"1",
")",
";",
"}",
"}",
"return",
"tidStr",
";",
"}"
] | LI3795-56 | [
"LI3795",
"-",
"56"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/ContainerTx.java#L1893-L1911 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.token.ltpa/src/com/ibm/ws/security/token/ltpa/internal/LTPATokenizer.java | LTPATokenizer.parseToken | @FFDCIgnore(Exception.class)
protected static final String[] parseToken(String tokenStr) throws InvalidTokenException {
String[] fields = new String[3];
int tokenLen = tokenStr.length();
char c;
int signBegin = -1, expireBegin = -1;
// LTPA Token has 3 fields: userdata, expiration and sign
// SSO Token has only two : userdata, and expiration
try {
for (int i = tokenLen - 1; i > -1; i--) {
c = tokenStr.charAt(i);
if (c == TOKEN_DELIM) {
if (tokenStr.charAt(i - 1) == '\\') {
// this is not a TOKEN_DELIM but part of the string tested
continue;
}
// we will encounter two of these
if (signBegin == -1) {
signBegin = i + 1;
} else {
expireBegin = i + 1;
break;
}
}
}
if (expireBegin == -1) {
// only one DELIM encountered
expireBegin = signBegin;
fields[0] = tokenStr.substring(0, expireBegin - 1);
fields[1] = tokenStr.substring(expireBegin, tokenLen);
} else {
fields[0] = tokenStr.substring(0, expireBegin - 1);
fields[1] = tokenStr.substring(expireBegin, signBegin - 1);
fields[2] = tokenStr.substring(signBegin, tokenLen);
}
} catch (Exception e) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "Error parsing token; " + e);
}
throw new InvalidTokenException(e.getMessage(), e);
}
return fields;
} | java | @FFDCIgnore(Exception.class)
protected static final String[] parseToken(String tokenStr) throws InvalidTokenException {
String[] fields = new String[3];
int tokenLen = tokenStr.length();
char c;
int signBegin = -1, expireBegin = -1;
// LTPA Token has 3 fields: userdata, expiration and sign
// SSO Token has only two : userdata, and expiration
try {
for (int i = tokenLen - 1; i > -1; i--) {
c = tokenStr.charAt(i);
if (c == TOKEN_DELIM) {
if (tokenStr.charAt(i - 1) == '\\') {
// this is not a TOKEN_DELIM but part of the string tested
continue;
}
// we will encounter two of these
if (signBegin == -1) {
signBegin = i + 1;
} else {
expireBegin = i + 1;
break;
}
}
}
if (expireBegin == -1) {
// only one DELIM encountered
expireBegin = signBegin;
fields[0] = tokenStr.substring(0, expireBegin - 1);
fields[1] = tokenStr.substring(expireBegin, tokenLen);
} else {
fields[0] = tokenStr.substring(0, expireBegin - 1);
fields[1] = tokenStr.substring(expireBegin, signBegin - 1);
fields[2] = tokenStr.substring(signBegin, tokenLen);
}
} catch (Exception e) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "Error parsing token; " + e);
}
throw new InvalidTokenException(e.getMessage(), e);
}
return fields;
} | [
"@",
"FFDCIgnore",
"(",
"Exception",
".",
"class",
")",
"protected",
"static",
"final",
"String",
"[",
"]",
"parseToken",
"(",
"String",
"tokenStr",
")",
"throws",
"InvalidTokenException",
"{",
"String",
"[",
"]",
"fields",
"=",
"new",
"String",
"[",
"3",
"]",
";",
"int",
"tokenLen",
"=",
"tokenStr",
".",
"length",
"(",
")",
";",
"char",
"c",
";",
"int",
"signBegin",
"=",
"-",
"1",
",",
"expireBegin",
"=",
"-",
"1",
";",
"// LTPA Token has 3 fields: userdata, expiration and sign",
"// SSO Token has only two : userdata, and expiration",
"try",
"{",
"for",
"(",
"int",
"i",
"=",
"tokenLen",
"-",
"1",
";",
"i",
">",
"-",
"1",
";",
"i",
"--",
")",
"{",
"c",
"=",
"tokenStr",
".",
"charAt",
"(",
"i",
")",
";",
"if",
"(",
"c",
"==",
"TOKEN_DELIM",
")",
"{",
"if",
"(",
"tokenStr",
".",
"charAt",
"(",
"i",
"-",
"1",
")",
"==",
"'",
"'",
")",
"{",
"// this is not a TOKEN_DELIM but part of the string tested",
"continue",
";",
"}",
"// we will encounter two of these",
"if",
"(",
"signBegin",
"==",
"-",
"1",
")",
"{",
"signBegin",
"=",
"i",
"+",
"1",
";",
"}",
"else",
"{",
"expireBegin",
"=",
"i",
"+",
"1",
";",
"break",
";",
"}",
"}",
"}",
"if",
"(",
"expireBegin",
"==",
"-",
"1",
")",
"{",
"// only one DELIM encountered",
"expireBegin",
"=",
"signBegin",
";",
"fields",
"[",
"0",
"]",
"=",
"tokenStr",
".",
"substring",
"(",
"0",
",",
"expireBegin",
"-",
"1",
")",
";",
"fields",
"[",
"1",
"]",
"=",
"tokenStr",
".",
"substring",
"(",
"expireBegin",
",",
"tokenLen",
")",
";",
"}",
"else",
"{",
"fields",
"[",
"0",
"]",
"=",
"tokenStr",
".",
"substring",
"(",
"0",
",",
"expireBegin",
"-",
"1",
")",
";",
"fields",
"[",
"1",
"]",
"=",
"tokenStr",
".",
"substring",
"(",
"expireBegin",
",",
"signBegin",
"-",
"1",
")",
";",
"fields",
"[",
"2",
"]",
"=",
"tokenStr",
".",
"substring",
"(",
"signBegin",
",",
"tokenLen",
")",
";",
"}",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"Error parsing token; \"",
"+",
"e",
")",
";",
"}",
"throw",
"new",
"InvalidTokenException",
"(",
"e",
".",
"getMessage",
"(",
")",
",",
"e",
")",
";",
"}",
"return",
"fields",
";",
"}"
] | Parse the String form of a LTPA token and extract the UserData,
expiration limit, and the signature.
@param tokenStr The String form of a LTPA token
@return A list of the strings. 0: The String form of the UserData,
1: Expiration limit of the token, 2: The signature of the token | [
"Parse",
"the",
"String",
"form",
"of",
"a",
"LTPA",
"token",
"and",
"extract",
"the",
"UserData",
"expiration",
"limit",
"and",
"the",
"signature",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.token.ltpa/src/com/ibm/ws/security/token/ltpa/internal/LTPATokenizer.java#L78-L122 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.token.ltpa/src/com/ibm/ws/security/token/ltpa/internal/LTPATokenizer.java | LTPATokenizer.addAttributes | private static void addAttributes(String data, Map<String, ArrayList<String>> attribs) {
String key;
String value;
int keyIndex = 0;
int dataLen = data.length();
for (keyIndex = 0; keyIndex < dataLen; keyIndex++) {
if ((data.charAt(keyIndex) == USER_ATTRIB_DELIM) && (data.charAt(keyIndex - 1) != '\\')) {
key = data.substring(0, keyIndex);
value = data.substring(keyIndex + 1, dataLen);
ArrayList<String> list = convertStringToArrayList(value);
if (list != null) {
attribs.put(key, list);
}
}
}
} | java | private static void addAttributes(String data, Map<String, ArrayList<String>> attribs) {
String key;
String value;
int keyIndex = 0;
int dataLen = data.length();
for (keyIndex = 0; keyIndex < dataLen; keyIndex++) {
if ((data.charAt(keyIndex) == USER_ATTRIB_DELIM) && (data.charAt(keyIndex - 1) != '\\')) {
key = data.substring(0, keyIndex);
value = data.substring(keyIndex + 1, dataLen);
ArrayList<String> list = convertStringToArrayList(value);
if (list != null) {
attribs.put(key, list);
}
}
}
} | [
"private",
"static",
"void",
"addAttributes",
"(",
"String",
"data",
",",
"Map",
"<",
"String",
",",
"ArrayList",
"<",
"String",
">",
">",
"attribs",
")",
"{",
"String",
"key",
";",
"String",
"value",
";",
"int",
"keyIndex",
"=",
"0",
";",
"int",
"dataLen",
"=",
"data",
".",
"length",
"(",
")",
";",
"for",
"(",
"keyIndex",
"=",
"0",
";",
"keyIndex",
"<",
"dataLen",
";",
"keyIndex",
"++",
")",
"{",
"if",
"(",
"(",
"data",
".",
"charAt",
"(",
"keyIndex",
")",
"==",
"USER_ATTRIB_DELIM",
")",
"&&",
"(",
"data",
".",
"charAt",
"(",
"keyIndex",
"-",
"1",
")",
"!=",
"'",
"'",
")",
")",
"{",
"key",
"=",
"data",
".",
"substring",
"(",
"0",
",",
"keyIndex",
")",
";",
"value",
"=",
"data",
".",
"substring",
"(",
"keyIndex",
"+",
"1",
",",
"dataLen",
")",
";",
"ArrayList",
"<",
"String",
">",
"list",
"=",
"convertStringToArrayList",
"(",
"value",
")",
";",
"if",
"(",
"list",
"!=",
"null",
")",
"{",
"attribs",
".",
"put",
"(",
"key",
",",
"list",
")",
";",
"}",
"}",
"}",
"}"
] | Given a specified String, parse to find attributes and add to specified Map.
@param data String to parse attribtues from
@param attribs Target map to add attributes | [
"Given",
"a",
"specified",
"String",
"parse",
"to",
"find",
"attributes",
"and",
"add",
"to",
"specified",
"Map",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.token.ltpa/src/com/ibm/ws/security/token/ltpa/internal/LTPATokenizer.java#L130-L145 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.token.ltpa/src/com/ibm/ws/security/token/ltpa/internal/LTPATokenizer.java | LTPATokenizer.parseUserData | protected static final Map<String, ArrayList<String>> parseUserData(String userData) {
int tokenLen = userData.length();
int numOfAttribs = 1; // default has "user" (u) attribute
int lastDelim = 0;
int i = 0;
Map<String, ArrayList<String>> attribs = new HashMap<String, ArrayList<String>>();
for (i = 0; i < tokenLen; i++) {
if ((userData.charAt(i) == USER_DATA_DELIM) && (userData.charAt(i - 1) != '\\')) {
numOfAttribs++;
String data = userData.substring(lastDelim, i);
lastDelim = i + 1;
addAttributes(data, attribs);
}
}
// add the last element
String data = userData.substring(lastDelim, tokenLen);
addAttributes(data, attribs);
return attribs;
} | java | protected static final Map<String, ArrayList<String>> parseUserData(String userData) {
int tokenLen = userData.length();
int numOfAttribs = 1; // default has "user" (u) attribute
int lastDelim = 0;
int i = 0;
Map<String, ArrayList<String>> attribs = new HashMap<String, ArrayList<String>>();
for (i = 0; i < tokenLen; i++) {
if ((userData.charAt(i) == USER_DATA_DELIM) && (userData.charAt(i - 1) != '\\')) {
numOfAttribs++;
String data = userData.substring(lastDelim, i);
lastDelim = i + 1;
addAttributes(data, attribs);
}
}
// add the last element
String data = userData.substring(lastDelim, tokenLen);
addAttributes(data, attribs);
return attribs;
} | [
"protected",
"static",
"final",
"Map",
"<",
"String",
",",
"ArrayList",
"<",
"String",
">",
">",
"parseUserData",
"(",
"String",
"userData",
")",
"{",
"int",
"tokenLen",
"=",
"userData",
".",
"length",
"(",
")",
";",
"int",
"numOfAttribs",
"=",
"1",
";",
"// default has \"user\" (u) attribute",
"int",
"lastDelim",
"=",
"0",
";",
"int",
"i",
"=",
"0",
";",
"Map",
"<",
"String",
",",
"ArrayList",
"<",
"String",
">",
">",
"attribs",
"=",
"new",
"HashMap",
"<",
"String",
",",
"ArrayList",
"<",
"String",
">",
">",
"(",
")",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"tokenLen",
";",
"i",
"++",
")",
"{",
"if",
"(",
"(",
"userData",
".",
"charAt",
"(",
"i",
")",
"==",
"USER_DATA_DELIM",
")",
"&&",
"(",
"userData",
".",
"charAt",
"(",
"i",
"-",
"1",
")",
"!=",
"'",
"'",
")",
")",
"{",
"numOfAttribs",
"++",
";",
"String",
"data",
"=",
"userData",
".",
"substring",
"(",
"lastDelim",
",",
"i",
")",
";",
"lastDelim",
"=",
"i",
"+",
"1",
";",
"addAttributes",
"(",
"data",
",",
"attribs",
")",
";",
"}",
"}",
"// add the last element",
"String",
"data",
"=",
"userData",
".",
"substring",
"(",
"lastDelim",
",",
"tokenLen",
")",
";",
"addAttributes",
"(",
"data",
",",
"attribs",
")",
";",
"return",
"attribs",
";",
"}"
] | Parse the String form of a UserData and get a Map of the UserData.
@param userData The String form of a UserData
@return A Map of the UserData | [
"Parse",
"the",
"String",
"form",
"of",
"a",
"UserData",
"and",
"get",
"a",
"Map",
"of",
"the",
"UserData",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.token.ltpa/src/com/ibm/ws/security/token/ltpa/internal/LTPATokenizer.java#L153-L174 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.classloading/src/com/ibm/ws/classloading/internal/providers/Providers.java | Providers.getSharedLibrary | static Library getSharedLibrary(String id) {
if (bundleContext == null) {
return null;
}
// Filter the SharedLibrary service references by ID.
String filter = "(" + "id=" + id + ")";
Collection<ServiceReference<Library>> refs = null;
try {
refs = bundleContext.getServiceReferences(Library.class, filter);
} catch (InvalidSyntaxException e) {
if (tc.isErrorEnabled()) {
Tr.error(tc, "cls.library.id.invalid", id, e.toString());
}
return null;
}
if (refs.isEmpty())
return null;
return bundleContext.getService(getHighestRankedService(refs));
} | java | static Library getSharedLibrary(String id) {
if (bundleContext == null) {
return null;
}
// Filter the SharedLibrary service references by ID.
String filter = "(" + "id=" + id + ")";
Collection<ServiceReference<Library>> refs = null;
try {
refs = bundleContext.getServiceReferences(Library.class, filter);
} catch (InvalidSyntaxException e) {
if (tc.isErrorEnabled()) {
Tr.error(tc, "cls.library.id.invalid", id, e.toString());
}
return null;
}
if (refs.isEmpty())
return null;
return bundleContext.getService(getHighestRankedService(refs));
} | [
"static",
"Library",
"getSharedLibrary",
"(",
"String",
"id",
")",
"{",
"if",
"(",
"bundleContext",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"// Filter the SharedLibrary service references by ID.",
"String",
"filter",
"=",
"\"(\"",
"+",
"\"id=\"",
"+",
"id",
"+",
"\")\"",
";",
"Collection",
"<",
"ServiceReference",
"<",
"Library",
">",
">",
"refs",
"=",
"null",
";",
"try",
"{",
"refs",
"=",
"bundleContext",
".",
"getServiceReferences",
"(",
"Library",
".",
"class",
",",
"filter",
")",
";",
"}",
"catch",
"(",
"InvalidSyntaxException",
"e",
")",
"{",
"if",
"(",
"tc",
".",
"isErrorEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"cls.library.id.invalid\"",
",",
"id",
",",
"e",
".",
"toString",
"(",
")",
")",
";",
"}",
"return",
"null",
";",
"}",
"if",
"(",
"refs",
".",
"isEmpty",
"(",
")",
")",
"return",
"null",
";",
"return",
"bundleContext",
".",
"getService",
"(",
"getHighestRankedService",
"(",
"refs",
")",
")",
";",
"}"
] | Retrieve a library from the service registry.
@return A library with the given id or <code>null</code> if no match was found | [
"Retrieve",
"a",
"library",
"from",
"the",
"service",
"registry",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.classloading/src/com/ibm/ws/classloading/internal/providers/Providers.java#L124-L146 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.classloading/src/com/ibm/ws/classloading/internal/providers/Providers.java | Providers.checkBundleContext | private static BundleContext checkBundleContext() {
if (bundleContext == null) {
if (tc.isDebugEnabled()) {
Tr.debug(tc, "BundleContext is null and should not be");
}
}
return bundleContext;
} | java | private static BundleContext checkBundleContext() {
if (bundleContext == null) {
if (tc.isDebugEnabled()) {
Tr.debug(tc, "BundleContext is null and should not be");
}
}
return bundleContext;
} | [
"private",
"static",
"BundleContext",
"checkBundleContext",
"(",
")",
"{",
"if",
"(",
"bundleContext",
"==",
"null",
")",
"{",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"BundleContext is null and should not be\"",
")",
";",
"}",
"}",
"return",
"bundleContext",
";",
"}"
] | Check to make sure the bundleContext has been set.
@return The BundleContext, or null if it could not be retrieved. | [
"Check",
"to",
"make",
"sure",
"the",
"bundleContext",
"has",
"been",
"set",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.classloading/src/com/ibm/ws/classloading/internal/providers/Providers.java#L204-L211 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TEEJBInvocationInfo.java | TEEJBInvocationInfo.tracePreInvokeBegins | public static void tracePreInvokeBegins(EJSDeployedSupport s, EJSWrapperBase wrapper)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
StringBuffer sbuf = new StringBuffer();
sbuf
.append(MthdPreInvokeEntry_Type_Str).append(DataDelimiter)
.append(MthdPreInvokeEntry_Type).append(DataDelimiter);
writeDeployedSupportInfo(s, sbuf, wrapper, null);
Tr.debug(tc, sbuf.toString());
}
} | java | public static void tracePreInvokeBegins(EJSDeployedSupport s, EJSWrapperBase wrapper)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
StringBuffer sbuf = new StringBuffer();
sbuf
.append(MthdPreInvokeEntry_Type_Str).append(DataDelimiter)
.append(MthdPreInvokeEntry_Type).append(DataDelimiter);
writeDeployedSupportInfo(s, sbuf, wrapper, null);
Tr.debug(tc, sbuf.toString());
}
} | [
"public",
"static",
"void",
"tracePreInvokeBegins",
"(",
"EJSDeployedSupport",
"s",
",",
"EJSWrapperBase",
"wrapper",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"StringBuffer",
"sbuf",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"sbuf",
".",
"append",
"(",
"MthdPreInvokeEntry_Type_Str",
")",
".",
"append",
"(",
"DataDelimiter",
")",
".",
"append",
"(",
"MthdPreInvokeEntry_Type",
")",
".",
"append",
"(",
"DataDelimiter",
")",
";",
"writeDeployedSupportInfo",
"(",
"s",
",",
"sbuf",
",",
"wrapper",
",",
"null",
")",
";",
"Tr",
".",
"debug",
"(",
"tc",
",",
"sbuf",
".",
"toString",
"(",
")",
")",
";",
"}",
"}"
] | This is called by the EJB container server code to write a
EJB method call preinvoke begins record to the trace log, if enabled. | [
"This",
"is",
"called",
"by",
"the",
"EJB",
"container",
"server",
"code",
"to",
"write",
"a",
"EJB",
"method",
"call",
"preinvoke",
"begins",
"record",
"to",
"the",
"trace",
"log",
"if",
"enabled",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TEEJBInvocationInfo.java#L31-L45 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TEEJBInvocationInfo.java | TEEJBInvocationInfo.tracePreInvokeEnds | public static void tracePreInvokeEnds(EJSDeployedSupport s, EJSWrapperBase wrapper)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
StringBuffer sbuf = new StringBuffer();
sbuf
.append(MthdPreInvokeExit_Type_Str).append(DataDelimiter)
.append(MthdPreInvokeExit_Type).append(DataDelimiter);
writeDeployedSupportInfo(s, sbuf, wrapper, null);
Tr.debug(tc, sbuf.toString());
}
} | java | public static void tracePreInvokeEnds(EJSDeployedSupport s, EJSWrapperBase wrapper)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
StringBuffer sbuf = new StringBuffer();
sbuf
.append(MthdPreInvokeExit_Type_Str).append(DataDelimiter)
.append(MthdPreInvokeExit_Type).append(DataDelimiter);
writeDeployedSupportInfo(s, sbuf, wrapper, null);
Tr.debug(tc, sbuf.toString());
}
} | [
"public",
"static",
"void",
"tracePreInvokeEnds",
"(",
"EJSDeployedSupport",
"s",
",",
"EJSWrapperBase",
"wrapper",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"StringBuffer",
"sbuf",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"sbuf",
".",
"append",
"(",
"MthdPreInvokeExit_Type_Str",
")",
".",
"append",
"(",
"DataDelimiter",
")",
".",
"append",
"(",
"MthdPreInvokeExit_Type",
")",
".",
"append",
"(",
"DataDelimiter",
")",
";",
"writeDeployedSupportInfo",
"(",
"s",
",",
"sbuf",
",",
"wrapper",
",",
"null",
")",
";",
"Tr",
".",
"debug",
"(",
"tc",
",",
"sbuf",
".",
"toString",
"(",
")",
")",
";",
"}",
"}"
] | This is called by the EJB container server code to write a
EJB method call preinvoke ends record to the trace log, if enabled. | [
"This",
"is",
"called",
"by",
"the",
"EJB",
"container",
"server",
"code",
"to",
"write",
"a",
"EJB",
"method",
"call",
"preinvoke",
"ends",
"record",
"to",
"the",
"trace",
"log",
"if",
"enabled",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TEEJBInvocationInfo.java#L51-L65 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TEEJBInvocationInfo.java | TEEJBInvocationInfo.tracePreInvokeException | public static void tracePreInvokeException(EJSDeployedSupport s,
EJSWrapperBase wrapper,
Throwable t)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
StringBuffer sbuf = new StringBuffer();
sbuf
.append(MthdPreInvokeException_Type_Str).append(DataDelimiter)
.append(MthdPreInvokeException_Type).append(DataDelimiter);
writeDeployedSupportInfo(s, sbuf, wrapper, t);
Tr.debug(tc, sbuf.toString());
}
} | java | public static void tracePreInvokeException(EJSDeployedSupport s,
EJSWrapperBase wrapper,
Throwable t)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
StringBuffer sbuf = new StringBuffer();
sbuf
.append(MthdPreInvokeException_Type_Str).append(DataDelimiter)
.append(MthdPreInvokeException_Type).append(DataDelimiter);
writeDeployedSupportInfo(s, sbuf, wrapper, t);
Tr.debug(tc, sbuf.toString());
}
} | [
"public",
"static",
"void",
"tracePreInvokeException",
"(",
"EJSDeployedSupport",
"s",
",",
"EJSWrapperBase",
"wrapper",
",",
"Throwable",
"t",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"StringBuffer",
"sbuf",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"sbuf",
".",
"append",
"(",
"MthdPreInvokeException_Type_Str",
")",
".",
"append",
"(",
"DataDelimiter",
")",
".",
"append",
"(",
"MthdPreInvokeException_Type",
")",
".",
"append",
"(",
"DataDelimiter",
")",
";",
"writeDeployedSupportInfo",
"(",
"s",
",",
"sbuf",
",",
"wrapper",
",",
"t",
")",
";",
"Tr",
".",
"debug",
"(",
"tc",
",",
"sbuf",
".",
"toString",
"(",
")",
")",
";",
"}",
"}"
] | This is called by the EJB container server code to write a
EJB method call preinvoke exceptions record to the trace log, if enabled. | [
"This",
"is",
"called",
"by",
"the",
"EJB",
"container",
"server",
"code",
"to",
"write",
"a",
"EJB",
"method",
"call",
"preinvoke",
"exceptions",
"record",
"to",
"the",
"trace",
"log",
"if",
"enabled",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TEEJBInvocationInfo.java#L71-L87 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TEEJBInvocationInfo.java | TEEJBInvocationInfo.tracePostInvokeBegins | public static void tracePostInvokeBegins(EJSDeployedSupport s,
EJSWrapperBase wrapper)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
StringBuffer sbuf = new StringBuffer();
sbuf
.append(MthdPostInvokeEntry_Type_Str).append(DataDelimiter)
.append(MthdPostInvokeEntry_Type).append(DataDelimiter);
writeDeployedSupportInfo(s, sbuf, wrapper, null);
Tr.debug(tc, sbuf.toString());
}
} | java | public static void tracePostInvokeBegins(EJSDeployedSupport s,
EJSWrapperBase wrapper)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
StringBuffer sbuf = new StringBuffer();
sbuf
.append(MthdPostInvokeEntry_Type_Str).append(DataDelimiter)
.append(MthdPostInvokeEntry_Type).append(DataDelimiter);
writeDeployedSupportInfo(s, sbuf, wrapper, null);
Tr.debug(tc, sbuf.toString());
}
} | [
"public",
"static",
"void",
"tracePostInvokeBegins",
"(",
"EJSDeployedSupport",
"s",
",",
"EJSWrapperBase",
"wrapper",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"StringBuffer",
"sbuf",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"sbuf",
".",
"append",
"(",
"MthdPostInvokeEntry_Type_Str",
")",
".",
"append",
"(",
"DataDelimiter",
")",
".",
"append",
"(",
"MthdPostInvokeEntry_Type",
")",
".",
"append",
"(",
"DataDelimiter",
")",
";",
"writeDeployedSupportInfo",
"(",
"s",
",",
"sbuf",
",",
"wrapper",
",",
"null",
")",
";",
"Tr",
".",
"debug",
"(",
"tc",
",",
"sbuf",
".",
"toString",
"(",
")",
")",
";",
"}",
"}"
] | This is called by the EJB container server code to write a
EJB method call postinvoke begins record to the trace log, if enabled. | [
"This",
"is",
"called",
"by",
"the",
"EJB",
"container",
"server",
"code",
"to",
"write",
"a",
"EJB",
"method",
"call",
"postinvoke",
"begins",
"record",
"to",
"the",
"trace",
"log",
"if",
"enabled",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TEEJBInvocationInfo.java#L93-L108 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TEEJBInvocationInfo.java | TEEJBInvocationInfo.tracePostInvokeEnds | public static void tracePostInvokeEnds(EJSDeployedSupport s, EJSWrapperBase wrapper)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
StringBuffer sbuf = new StringBuffer();
sbuf
.append(MthdPostInvokeExit_Type_Str).append(DataDelimiter)
.append(MthdPostInvokeExit_Type).append(DataDelimiter);
writeDeployedSupportInfo(s, sbuf, wrapper, null);
Tr.debug(tc, sbuf.toString());
}
} | java | public static void tracePostInvokeEnds(EJSDeployedSupport s, EJSWrapperBase wrapper)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
StringBuffer sbuf = new StringBuffer();
sbuf
.append(MthdPostInvokeExit_Type_Str).append(DataDelimiter)
.append(MthdPostInvokeExit_Type).append(DataDelimiter);
writeDeployedSupportInfo(s, sbuf, wrapper, null);
Tr.debug(tc, sbuf.toString());
}
} | [
"public",
"static",
"void",
"tracePostInvokeEnds",
"(",
"EJSDeployedSupport",
"s",
",",
"EJSWrapperBase",
"wrapper",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"StringBuffer",
"sbuf",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"sbuf",
".",
"append",
"(",
"MthdPostInvokeExit_Type_Str",
")",
".",
"append",
"(",
"DataDelimiter",
")",
".",
"append",
"(",
"MthdPostInvokeExit_Type",
")",
".",
"append",
"(",
"DataDelimiter",
")",
";",
"writeDeployedSupportInfo",
"(",
"s",
",",
"sbuf",
",",
"wrapper",
",",
"null",
")",
";",
"Tr",
".",
"debug",
"(",
"tc",
",",
"sbuf",
".",
"toString",
"(",
")",
")",
";",
"}",
"}"
] | This is called by the EJB container server code to write a
EJB method call postinvoke ends record to the trace log, if enabled. | [
"This",
"is",
"called",
"by",
"the",
"EJB",
"container",
"server",
"code",
"to",
"write",
"a",
"EJB",
"method",
"call",
"postinvoke",
"ends",
"record",
"to",
"the",
"trace",
"log",
"if",
"enabled",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/traceinfo/ejbcontainer/TEEJBInvocationInfo.java#L114-L128 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/runtime/impl/MediatedMessageHandlerControl.java | MediatedMessageHandlerControl.assertMessageHandlerNotCorrupt | protected void assertMessageHandlerNotCorrupt() throws SIMPException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "assertMessageHandlerNotCorrupt");
if (baseDest.isCorruptOrIndoubt())
{
String nlsMsg = nls.getFormattedMessage(
"MESSAGE_HANDLER_CORRUPT_ERROR_CWSIP0201", null, null);
SIMPException e = new SIMPException(nlsMsg);
SibTr.exception(tc, e);
throw e;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "assertMessageHandlerNotCorrupt");
} | java | protected void assertMessageHandlerNotCorrupt() throws SIMPException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "assertMessageHandlerNotCorrupt");
if (baseDest.isCorruptOrIndoubt())
{
String nlsMsg = nls.getFormattedMessage(
"MESSAGE_HANDLER_CORRUPT_ERROR_CWSIP0201", null, null);
SIMPException e = new SIMPException(nlsMsg);
SibTr.exception(tc, e);
throw e;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "assertMessageHandlerNotCorrupt");
} | [
"protected",
"void",
"assertMessageHandlerNotCorrupt",
"(",
")",
"throws",
"SIMPException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"assertMessageHandlerNotCorrupt\"",
")",
";",
"if",
"(",
"baseDest",
".",
"isCorruptOrIndoubt",
"(",
")",
")",
"{",
"String",
"nlsMsg",
"=",
"nls",
".",
"getFormattedMessage",
"(",
"\"MESSAGE_HANDLER_CORRUPT_ERROR_CWSIP0201\"",
",",
"null",
",",
"null",
")",
";",
"SIMPException",
"e",
"=",
"new",
"SIMPException",
"(",
"nlsMsg",
")",
";",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"throw",
"e",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"assertMessageHandlerNotCorrupt\"",
")",
";",
"}"
] | A utility method for methods which can only execute if the underlying
message handler is not corrupt or waiting to be reset on restart.
@throws SIMPException | [
"A",
"utility",
"method",
"for",
"methods",
"which",
"can",
"only",
"execute",
"if",
"the",
"underlying",
"message",
"handler",
"is",
"not",
"corrupt",
"or",
"waiting",
"to",
"be",
"reset",
"on",
"restart",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/runtime/impl/MediatedMessageHandlerControl.java#L358-L377 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.container.service.compat/src/com/ibm/ws/util/WSThreadLocal.java | WSThreadLocal.remove | public void remove() {
Thread thread = Thread.currentThread();
if (thread instanceof ThreadPool.Worker) {
Object[] wsLocals = getThreadLocals((ThreadPool.Worker) thread);
wsLocals[index] = null;
} else {
super.remove();
}
} | java | public void remove() {
Thread thread = Thread.currentThread();
if (thread instanceof ThreadPool.Worker) {
Object[] wsLocals = getThreadLocals((ThreadPool.Worker) thread);
wsLocals[index] = null;
} else {
super.remove();
}
} | [
"public",
"void",
"remove",
"(",
")",
"{",
"Thread",
"thread",
"=",
"Thread",
".",
"currentThread",
"(",
")",
";",
"if",
"(",
"thread",
"instanceof",
"ThreadPool",
".",
"Worker",
")",
"{",
"Object",
"[",
"]",
"wsLocals",
"=",
"getThreadLocals",
"(",
"(",
"ThreadPool",
".",
"Worker",
")",
"thread",
")",
";",
"wsLocals",
"[",
"index",
"]",
"=",
"null",
";",
"}",
"else",
"{",
"super",
".",
"remove",
"(",
")",
";",
"}",
"}"
] | doesn't) and that it resets the value to its initial value | [
"doesn",
"t",
")",
"and",
"that",
"it",
"resets",
"the",
"value",
"to",
"its",
"initial",
"value"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.container.service.compat/src/com/ibm/ws/util/WSThreadLocal.java#L105-L113 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer/src/com/ibm/ws/ejbcontainer/osgi/internal/ModuleInitDataFactory.java | ModuleInitDataFactory.getManagedBeansInternalEJBName | private String getManagedBeansInternalEJBName(ClassInfo classInfo, AnnotationInfo managedBeanAnn) {
String name = getStringValue(managedBeanAnn, "value");
if (name == null) {
name = '$' + classInfo.getName();
}
return name;
} | java | private String getManagedBeansInternalEJBName(ClassInfo classInfo, AnnotationInfo managedBeanAnn) {
String name = getStringValue(managedBeanAnn, "value");
if (name == null) {
name = '$' + classInfo.getName();
}
return name;
} | [
"private",
"String",
"getManagedBeansInternalEJBName",
"(",
"ClassInfo",
"classInfo",
",",
"AnnotationInfo",
"managedBeanAnn",
")",
"{",
"String",
"name",
"=",
"getStringValue",
"(",
"managedBeanAnn",
",",
"\"value\"",
")",
";",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"name",
"=",
"'",
"'",
"+",
"classInfo",
".",
"getName",
"(",
")",
";",
"}",
"return",
"name",
";",
"}"
] | Return the ManagedBean name to be used internally by the EJBContainer.
The internal ManagedBean name is the value on the annotation (which
must be unique even compared to EJBs in the module) or the class name
of the ManagedBean with a $ prefix. This is done for two reasons:
1 - when a name is not specified, our internal derived name cannot
conflict with other EJB names that happen to be the same.
2 - when a name is not specified, the managed bean is not supposed
to be bound into naming... the '$' will tip off the binding code.
'$' is used for consistency with JDK synthesized names. | [
"Return",
"the",
"ManagedBean",
"name",
"to",
"be",
"used",
"internally",
"by",
"the",
"EJBContainer",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer/src/com/ibm/ws/ejbcontainer/osgi/internal/ModuleInitDataFactory.java#L882-L888 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.mdb.core/src/com/ibm/ws/ejbcontainer/mdb/MessageEndpointBase.java | MessageEndpointBase.mdbMethodPostInvoke | public void mdbMethodPostInvoke() throws Throwable
{
// If there is a registered message endpoint collaborator, call it for postInvoke processing.
Map<String, Object> meContext = ivEJSDeployedSupport.getMessageEndpointContext();
if (meContext != null) {
MessageEndpointCollaborator meCollaborator = container.getEJBRuntime().getMessageEndpointCollaborator(this.bmd);
if (meCollaborator != null) {
try {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Invoking MECollaborator " + meCollaborator + " for postInvoke processing with the following context data: " + meContext);
}
meCollaborator.postInvoke(meContext);
} finally {
ivEJSDeployedSupport.setMessageEndpointContext(null);
}
}
}
// Since checkState method in this class preceeded the call
// to this method, we know we are running in the correct
// thread and the correct Proxy instance is using this
// MessageEndpointBase. Therefore, we can safely examine
// ivState outside of a synchronization block. However,
// to change the state, we do need to make change inside a
// synchronization block. This is necessary to ensure the
// checkState method throws IllegalStateException if some other
// thread tries to use this InvocationHandler instance while
// this thread is using the instance. This should never happen, but
// JCA 1.5 requires us to throw IllegalStateException if it does happen.
// If it does happen, then resource adapter does not comply with
// JCA 1.5 specification (or there is a bug in this class).
if (ivState == IN_METHOD_OPTION_B_STATE)
{
// Option B message delivery was used. So
// change the state to afterDelivery is pending.
// postInvoke processing is deferred until the
// afterDelivery method is invoked by RA.
// Necessary since we are required to leave
// transaction active until afterDelivery occurs.
synchronized (this)
{
ivState = AFTER_DELIVERY_PENDING_STATE;
}
}
else
{
// OPTION A message delivery was used,
// so do the postInvoke processing now and
// enter the READY_STATE.
try
{
if (ivEJSDeployedSupport != null)
{
// Preinvoke did occur, so do post invoke processing.
container.postInvoke(this, ivMethodId, ivEJSDeployedSupport);
}
} catch (EJBException e)
{
//FFDCFilter.processException(e, CLASS_NAME + "mdbMethodPostInvoke", "589", this);
throw e;
} catch (Throwable e)
{
FFDCFilter.processException(e, CLASS_NAME + ".mdbMethodPostInvoke", "1106", this);
if (ivEJSDeployedSupport != null)
{
ivEJSDeployedSupport.setUncheckedLocalException(e);
}
// if we get this far, then setUncheckedLocalException
// for some reason did not throw an exception. If that
// happens, we will throw an EJBException since that is
// what EJB spec requires for MDB.
EJBException ejbex = new EJBException();
ejbex.initCause(e);
throw e;
} finally
{
// Release objects no longer needed.
ivEJSDeployedSupport = null;
ivMDB = null;
// Option A message processing completed, so re-enter the ready state
// to indicate we are ready to handle the next message.
synchronized (this)
{
ivState = READY_STATE;
ivThread = null;
}
}
}
} | java | public void mdbMethodPostInvoke() throws Throwable
{
// If there is a registered message endpoint collaborator, call it for postInvoke processing.
Map<String, Object> meContext = ivEJSDeployedSupport.getMessageEndpointContext();
if (meContext != null) {
MessageEndpointCollaborator meCollaborator = container.getEJBRuntime().getMessageEndpointCollaborator(this.bmd);
if (meCollaborator != null) {
try {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Invoking MECollaborator " + meCollaborator + " for postInvoke processing with the following context data: " + meContext);
}
meCollaborator.postInvoke(meContext);
} finally {
ivEJSDeployedSupport.setMessageEndpointContext(null);
}
}
}
// Since checkState method in this class preceeded the call
// to this method, we know we are running in the correct
// thread and the correct Proxy instance is using this
// MessageEndpointBase. Therefore, we can safely examine
// ivState outside of a synchronization block. However,
// to change the state, we do need to make change inside a
// synchronization block. This is necessary to ensure the
// checkState method throws IllegalStateException if some other
// thread tries to use this InvocationHandler instance while
// this thread is using the instance. This should never happen, but
// JCA 1.5 requires us to throw IllegalStateException if it does happen.
// If it does happen, then resource adapter does not comply with
// JCA 1.5 specification (or there is a bug in this class).
if (ivState == IN_METHOD_OPTION_B_STATE)
{
// Option B message delivery was used. So
// change the state to afterDelivery is pending.
// postInvoke processing is deferred until the
// afterDelivery method is invoked by RA.
// Necessary since we are required to leave
// transaction active until afterDelivery occurs.
synchronized (this)
{
ivState = AFTER_DELIVERY_PENDING_STATE;
}
}
else
{
// OPTION A message delivery was used,
// so do the postInvoke processing now and
// enter the READY_STATE.
try
{
if (ivEJSDeployedSupport != null)
{
// Preinvoke did occur, so do post invoke processing.
container.postInvoke(this, ivMethodId, ivEJSDeployedSupport);
}
} catch (EJBException e)
{
//FFDCFilter.processException(e, CLASS_NAME + "mdbMethodPostInvoke", "589", this);
throw e;
} catch (Throwable e)
{
FFDCFilter.processException(e, CLASS_NAME + ".mdbMethodPostInvoke", "1106", this);
if (ivEJSDeployedSupport != null)
{
ivEJSDeployedSupport.setUncheckedLocalException(e);
}
// if we get this far, then setUncheckedLocalException
// for some reason did not throw an exception. If that
// happens, we will throw an EJBException since that is
// what EJB spec requires for MDB.
EJBException ejbex = new EJBException();
ejbex.initCause(e);
throw e;
} finally
{
// Release objects no longer needed.
ivEJSDeployedSupport = null;
ivMDB = null;
// Option A message processing completed, so re-enter the ready state
// to indicate we are ready to handle the next message.
synchronized (this)
{
ivState = READY_STATE;
ivThread = null;
}
}
}
} | [
"public",
"void",
"mdbMethodPostInvoke",
"(",
")",
"throws",
"Throwable",
"{",
"// If there is a registered message endpoint collaborator, call it for postInvoke processing.",
"Map",
"<",
"String",
",",
"Object",
">",
"meContext",
"=",
"ivEJSDeployedSupport",
".",
"getMessageEndpointContext",
"(",
")",
";",
"if",
"(",
"meContext",
"!=",
"null",
")",
"{",
"MessageEndpointCollaborator",
"meCollaborator",
"=",
"container",
".",
"getEJBRuntime",
"(",
")",
".",
"getMessageEndpointCollaborator",
"(",
"this",
".",
"bmd",
")",
";",
"if",
"(",
"meCollaborator",
"!=",
"null",
")",
"{",
"try",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Invoking MECollaborator \"",
"+",
"meCollaborator",
"+",
"\" for postInvoke processing with the following context data: \"",
"+",
"meContext",
")",
";",
"}",
"meCollaborator",
".",
"postInvoke",
"(",
"meContext",
")",
";",
"}",
"finally",
"{",
"ivEJSDeployedSupport",
".",
"setMessageEndpointContext",
"(",
"null",
")",
";",
"}",
"}",
"}",
"// Since checkState method in this class preceeded the call",
"// to this method, we know we are running in the correct",
"// thread and the correct Proxy instance is using this",
"// MessageEndpointBase. Therefore, we can safely examine",
"// ivState outside of a synchronization block. However,",
"// to change the state, we do need to make change inside a",
"// synchronization block. This is necessary to ensure the",
"// checkState method throws IllegalStateException if some other",
"// thread tries to use this InvocationHandler instance while",
"// this thread is using the instance. This should never happen, but",
"// JCA 1.5 requires us to throw IllegalStateException if it does happen.",
"// If it does happen, then resource adapter does not comply with",
"// JCA 1.5 specification (or there is a bug in this class).",
"if",
"(",
"ivState",
"==",
"IN_METHOD_OPTION_B_STATE",
")",
"{",
"// Option B message delivery was used. So",
"// change the state to afterDelivery is pending.",
"// postInvoke processing is deferred until the",
"// afterDelivery method is invoked by RA.",
"// Necessary since we are required to leave",
"// transaction active until afterDelivery occurs.",
"synchronized",
"(",
"this",
")",
"{",
"ivState",
"=",
"AFTER_DELIVERY_PENDING_STATE",
";",
"}",
"}",
"else",
"{",
"// OPTION A message delivery was used,",
"// so do the postInvoke processing now and",
"// enter the READY_STATE.",
"try",
"{",
"if",
"(",
"ivEJSDeployedSupport",
"!=",
"null",
")",
"{",
"// Preinvoke did occur, so do post invoke processing.",
"container",
".",
"postInvoke",
"(",
"this",
",",
"ivMethodId",
",",
"ivEJSDeployedSupport",
")",
";",
"}",
"}",
"catch",
"(",
"EJBException",
"e",
")",
"{",
"//FFDCFilter.processException(e, CLASS_NAME + \"mdbMethodPostInvoke\", \"589\", this);",
"throw",
"e",
";",
"}",
"catch",
"(",
"Throwable",
"e",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"CLASS_NAME",
"+",
"\".mdbMethodPostInvoke\"",
",",
"\"1106\"",
",",
"this",
")",
";",
"if",
"(",
"ivEJSDeployedSupport",
"!=",
"null",
")",
"{",
"ivEJSDeployedSupport",
".",
"setUncheckedLocalException",
"(",
"e",
")",
";",
"}",
"// if we get this far, then setUncheckedLocalException",
"// for some reason did not throw an exception. If that",
"// happens, we will throw an EJBException since that is",
"// what EJB spec requires for MDB.",
"EJBException",
"ejbex",
"=",
"new",
"EJBException",
"(",
")",
";",
"ejbex",
".",
"initCause",
"(",
"e",
")",
";",
"throw",
"e",
";",
"}",
"finally",
"{",
"// Release objects no longer needed.",
"ivEJSDeployedSupport",
"=",
"null",
";",
"ivMDB",
"=",
"null",
";",
"// Option A message processing completed, so re-enter the ready state",
"// to indicate we are ready to handle the next message.",
"synchronized",
"(",
"this",
")",
"{",
"ivState",
"=",
"READY_STATE",
";",
"ivThread",
"=",
"null",
";",
"}",
"}",
"}",
"}"
] | Must be called when MDB method completes so that internal
state is updated to reflect the completion of MDB method invocation.
<dl>
<dt>pre-condition
<dd>
Invoked MDB method has returned.
<dd>
ivState == IN_METHOD_OPTION_A_STATE or ivState == IN_METHOD_OPTION_B_STATE
<dt>post-condition
<dd>
if ivState == IN_METHOD_OPTION_A_STATE, then ivState is changed to READY_STATE.
Otherwise, ivState is changed to AFTER_DELIVERY_PENDING_STATE.
</dl> | [
"Must",
"be",
"called",
"when",
"MDB",
"method",
"completes",
"so",
"that",
"internal",
"state",
"is",
"updated",
"to",
"reflect",
"the",
"completion",
"of",
"MDB",
"method",
"invocation",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.mdb.core/src/com/ibm/ws/ejbcontainer/mdb/MessageEndpointBase.java#L865-L956 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.mdb.core/src/com/ibm/ws/ejbcontainer/mdb/MessageEndpointBase.java | MessageEndpointBase.discard | public static void discard(MessageEndpointBase proxy)
{
// Ensure we are no longer holding any object references.
proxy.ivMDB = null;
proxy.ivMessageEndpointFactory = null;
proxy.ivMethod = null;
proxy.ivXAResource = null;
proxy.ivRecoverableXAResource = false;
proxy.container = null;
proxy.ivEJSDeployedSupport = null;
proxy.ivTransactionManager = null;
proxy.ivThread = null;
} | java | public static void discard(MessageEndpointBase proxy)
{
// Ensure we are no longer holding any object references.
proxy.ivMDB = null;
proxy.ivMessageEndpointFactory = null;
proxy.ivMethod = null;
proxy.ivXAResource = null;
proxy.ivRecoverableXAResource = false;
proxy.container = null;
proxy.ivEJSDeployedSupport = null;
proxy.ivTransactionManager = null;
proxy.ivThread = null;
} | [
"public",
"static",
"void",
"discard",
"(",
"MessageEndpointBase",
"proxy",
")",
"{",
"// Ensure we are no longer holding any object references.",
"proxy",
".",
"ivMDB",
"=",
"null",
";",
"proxy",
".",
"ivMessageEndpointFactory",
"=",
"null",
";",
"proxy",
".",
"ivMethod",
"=",
"null",
";",
"proxy",
".",
"ivXAResource",
"=",
"null",
";",
"proxy",
".",
"ivRecoverableXAResource",
"=",
"false",
";",
"proxy",
".",
"container",
"=",
"null",
";",
"proxy",
".",
"ivEJSDeployedSupport",
"=",
"null",
";",
"proxy",
".",
"ivTransactionManager",
"=",
"null",
";",
"proxy",
".",
"ivThread",
"=",
"null",
";",
"}"
] | Called after the pool discards the object. This gives the
object an opportunity to perform any required clean up. | [
"Called",
"after",
"the",
"pool",
"discards",
"the",
"object",
".",
"This",
"gives",
"the",
"object",
"an",
"opportunity",
"to",
"perform",
"any",
"required",
"clean",
"up",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.mdb.core/src/com/ibm/ws/ejbcontainer/mdb/MessageEndpointBase.java#L1334-L1346 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.config/src/com/ibm/ws/config/admin/internal/ConfigEventDispatcher.java | ConfigEventDispatcher.dispatch | protected Future<?> dispatch(final int eventType, final String factoryPid, final String pid) {
final ConfigurationEvent event = createConfigurationEvent(eventType, factoryPid, pid);
if (event == null)
return null;
final ServiceReference<ConfigurationListener>[] refs = st.getServiceReferences();
if (refs == null)
return null;
final String qPid = (factoryPid != null) ? factoryPid : pid;
return caFactory.updateQueue.add(qPid, new Runnable() {
@Override
@FFDCIgnore(Exception.class)
public void run() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "dispatch: sending configuration listener event for " + qPid);
}
for (ServiceReference<ConfigurationListener> sr : refs) {
if (sr != null) {
ConfigurationListener cl = st.getService(sr);
if (cl != null && FrameworkState.isValid()) {
try {
cl.configurationEvent(event);
} catch (Exception e) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "dispatch(): Exception thrown while trying to dispatch ConfigurationEvent.", e);
}
FFDCFilter.processException(e, ME,
"dispatch(): Exception thrown while trying to dispatch ConfigurationEvent.",
new Object[] { pid, factoryPid, eventType, cl });
}
}
}
}
}
});
} | java | protected Future<?> dispatch(final int eventType, final String factoryPid, final String pid) {
final ConfigurationEvent event = createConfigurationEvent(eventType, factoryPid, pid);
if (event == null)
return null;
final ServiceReference<ConfigurationListener>[] refs = st.getServiceReferences();
if (refs == null)
return null;
final String qPid = (factoryPid != null) ? factoryPid : pid;
return caFactory.updateQueue.add(qPid, new Runnable() {
@Override
@FFDCIgnore(Exception.class)
public void run() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "dispatch: sending configuration listener event for " + qPid);
}
for (ServiceReference<ConfigurationListener> sr : refs) {
if (sr != null) {
ConfigurationListener cl = st.getService(sr);
if (cl != null && FrameworkState.isValid()) {
try {
cl.configurationEvent(event);
} catch (Exception e) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "dispatch(): Exception thrown while trying to dispatch ConfigurationEvent.", e);
}
FFDCFilter.processException(e, ME,
"dispatch(): Exception thrown while trying to dispatch ConfigurationEvent.",
new Object[] { pid, factoryPid, eventType, cl });
}
}
}
}
}
});
} | [
"protected",
"Future",
"<",
"?",
">",
"dispatch",
"(",
"final",
"int",
"eventType",
",",
"final",
"String",
"factoryPid",
",",
"final",
"String",
"pid",
")",
"{",
"final",
"ConfigurationEvent",
"event",
"=",
"createConfigurationEvent",
"(",
"eventType",
",",
"factoryPid",
",",
"pid",
")",
";",
"if",
"(",
"event",
"==",
"null",
")",
"return",
"null",
";",
"final",
"ServiceReference",
"<",
"ConfigurationListener",
">",
"[",
"]",
"refs",
"=",
"st",
".",
"getServiceReferences",
"(",
")",
";",
"if",
"(",
"refs",
"==",
"null",
")",
"return",
"null",
";",
"final",
"String",
"qPid",
"=",
"(",
"factoryPid",
"!=",
"null",
")",
"?",
"factoryPid",
":",
"pid",
";",
"return",
"caFactory",
".",
"updateQueue",
".",
"add",
"(",
"qPid",
",",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"@",
"FFDCIgnore",
"(",
"Exception",
".",
"class",
")",
"public",
"void",
"run",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"event",
"(",
"tc",
",",
"\"dispatch: sending configuration listener event for \"",
"+",
"qPid",
")",
";",
"}",
"for",
"(",
"ServiceReference",
"<",
"ConfigurationListener",
">",
"sr",
":",
"refs",
")",
"{",
"if",
"(",
"sr",
"!=",
"null",
")",
"{",
"ConfigurationListener",
"cl",
"=",
"st",
".",
"getService",
"(",
"sr",
")",
";",
"if",
"(",
"cl",
"!=",
"null",
"&&",
"FrameworkState",
".",
"isValid",
"(",
")",
")",
"{",
"try",
"{",
"cl",
".",
"configurationEvent",
"(",
"event",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"dispatch(): Exception thrown while trying to dispatch ConfigurationEvent.\"",
",",
"e",
")",
";",
"}",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"ME",
",",
"\"dispatch(): Exception thrown while trying to dispatch ConfigurationEvent.\"",
",",
"new",
"Object",
"[",
"]",
"{",
"pid",
",",
"factoryPid",
",",
"eventType",
",",
"cl",
"}",
")",
";",
"}",
"}",
"}",
"}",
"}",
"}",
")",
";",
"}"
] | Dispatch ConfigurationEvent to the ConfigurationListeners.
@param pid
- Service PID
@param factoryPid
- factory PID
@param eventType
- ConfigurationEvent type | [
"Dispatch",
"ConfigurationEvent",
"to",
"the",
"ConfigurationListeners",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.config/src/com/ibm/ws/config/admin/internal/ConfigEventDispatcher.java#L79-L115 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/jitdeploy/EJBWrapper.java | EJBWrapper.addDefaultEqualsMethod | private static void addDefaultEqualsMethod(ClassWriter cw, String implClassName)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, INDENT + "adding method : equals (Ljava/lang/Object;)Z");
// -----------------------------------------------------------------------
// public boolean equals(Object other)
// {
// -----------------------------------------------------------------------
final String desc = "(Ljava/lang/Object;)Z";
MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "equals", desc, null, null);
GeneratorAdapter mg = new GeneratorAdapter(mv, ACC_PUBLIC, "equals", desc);
mg.visitCode();
// -----------------------------------------------------------------------
// return this == other;
// -----------------------------------------------------------------------
mg.loadThis();
mg.loadArg(0);
Label not_equal = new Label();
mv.visitJumpInsn(IF_ACMPNE, not_equal);
mg.visitInsn(ICONST_1);
mg.returnValue();
mg.visitLabel(not_equal);
mg.visitInsn(ICONST_0);
mg.returnValue();
// -----------------------------------------------------------------------
// }
// -----------------------------------------------------------------------
mg.endMethod();
mg.visitEnd();
} | java | private static void addDefaultEqualsMethod(ClassWriter cw, String implClassName)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, INDENT + "adding method : equals (Ljava/lang/Object;)Z");
// -----------------------------------------------------------------------
// public boolean equals(Object other)
// {
// -----------------------------------------------------------------------
final String desc = "(Ljava/lang/Object;)Z";
MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "equals", desc, null, null);
GeneratorAdapter mg = new GeneratorAdapter(mv, ACC_PUBLIC, "equals", desc);
mg.visitCode();
// -----------------------------------------------------------------------
// return this == other;
// -----------------------------------------------------------------------
mg.loadThis();
mg.loadArg(0);
Label not_equal = new Label();
mv.visitJumpInsn(IF_ACMPNE, not_equal);
mg.visitInsn(ICONST_1);
mg.returnValue();
mg.visitLabel(not_equal);
mg.visitInsn(ICONST_0);
mg.returnValue();
// -----------------------------------------------------------------------
// }
// -----------------------------------------------------------------------
mg.endMethod();
mg.visitEnd();
} | [
"private",
"static",
"void",
"addDefaultEqualsMethod",
"(",
"ClassWriter",
"cw",
",",
"String",
"implClassName",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"INDENT",
"+",
"\"adding method : equals (Ljava/lang/Object;)Z\"",
")",
";",
"// -----------------------------------------------------------------------",
"// public boolean equals(Object other)",
"// {",
"// -----------------------------------------------------------------------",
"final",
"String",
"desc",
"=",
"\"(Ljava/lang/Object;)Z\"",
";",
"MethodVisitor",
"mv",
"=",
"cw",
".",
"visitMethod",
"(",
"ACC_PUBLIC",
",",
"\"equals\"",
",",
"desc",
",",
"null",
",",
"null",
")",
";",
"GeneratorAdapter",
"mg",
"=",
"new",
"GeneratorAdapter",
"(",
"mv",
",",
"ACC_PUBLIC",
",",
"\"equals\"",
",",
"desc",
")",
";",
"mg",
".",
"visitCode",
"(",
")",
";",
"// -----------------------------------------------------------------------",
"// return this == other;",
"// -----------------------------------------------------------------------",
"mg",
".",
"loadThis",
"(",
")",
";",
"mg",
".",
"loadArg",
"(",
"0",
")",
";",
"Label",
"not_equal",
"=",
"new",
"Label",
"(",
")",
";",
"mv",
".",
"visitJumpInsn",
"(",
"IF_ACMPNE",
",",
"not_equal",
")",
";",
"mg",
".",
"visitInsn",
"(",
"ICONST_1",
")",
";",
"mg",
".",
"returnValue",
"(",
")",
";",
"mg",
".",
"visitLabel",
"(",
"not_equal",
")",
";",
"mg",
".",
"visitInsn",
"(",
"ICONST_0",
")",
";",
"mg",
".",
"returnValue",
"(",
")",
";",
"// -----------------------------------------------------------------------",
"// }",
"// -----------------------------------------------------------------------",
"mg",
".",
"endMethod",
"(",
")",
";",
"mg",
".",
"visitEnd",
"(",
")",
";",
"}"
] | Adds the default definition for the Object.equals method.
@param cw ASM ClassWriter to add the method to.
@param implClassName name of the wrapper class being generated. | [
"Adds",
"the",
"default",
"definition",
"for",
"the",
"Object",
".",
"equals",
"method",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/jitdeploy/EJBWrapper.java#L631-L664 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/jitdeploy/EJBWrapper.java | EJBWrapper.addDefaultHashCodeMethod | private static void addDefaultHashCodeMethod(ClassWriter cw, String implClassName)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, INDENT + "adding method : hashCode ()I");
// -----------------------------------------------------------------------
// public int hashCode()
// {
// -----------------------------------------------------------------------
final String desc = "()I";
MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "hashCode", desc, null, null);
GeneratorAdapter mg = new GeneratorAdapter(mv, ACC_PUBLIC, "hashCode", desc);
mg.visitCode();
// -----------------------------------------------------------------------
// return System.identityHashCode(this);
// -----------------------------------------------------------------------
mg.loadThis();
mg.visitMethodInsn(INVOKESTATIC, "java/lang/System", "identityHashCode", "(Ljava/lang/Object;)I");
mg.returnValue();
// -----------------------------------------------------------------------
// }
// -----------------------------------------------------------------------
mg.endMethod();
mg.visitEnd();
} | java | private static void addDefaultHashCodeMethod(ClassWriter cw, String implClassName)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, INDENT + "adding method : hashCode ()I");
// -----------------------------------------------------------------------
// public int hashCode()
// {
// -----------------------------------------------------------------------
final String desc = "()I";
MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "hashCode", desc, null, null);
GeneratorAdapter mg = new GeneratorAdapter(mv, ACC_PUBLIC, "hashCode", desc);
mg.visitCode();
// -----------------------------------------------------------------------
// return System.identityHashCode(this);
// -----------------------------------------------------------------------
mg.loadThis();
mg.visitMethodInsn(INVOKESTATIC, "java/lang/System", "identityHashCode", "(Ljava/lang/Object;)I");
mg.returnValue();
// -----------------------------------------------------------------------
// }
// -----------------------------------------------------------------------
mg.endMethod();
mg.visitEnd();
} | [
"private",
"static",
"void",
"addDefaultHashCodeMethod",
"(",
"ClassWriter",
"cw",
",",
"String",
"implClassName",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"INDENT",
"+",
"\"adding method : hashCode ()I\"",
")",
";",
"// -----------------------------------------------------------------------",
"// public int hashCode()",
"// {",
"// -----------------------------------------------------------------------",
"final",
"String",
"desc",
"=",
"\"()I\"",
";",
"MethodVisitor",
"mv",
"=",
"cw",
".",
"visitMethod",
"(",
"ACC_PUBLIC",
",",
"\"hashCode\"",
",",
"desc",
",",
"null",
",",
"null",
")",
";",
"GeneratorAdapter",
"mg",
"=",
"new",
"GeneratorAdapter",
"(",
"mv",
",",
"ACC_PUBLIC",
",",
"\"hashCode\"",
",",
"desc",
")",
";",
"mg",
".",
"visitCode",
"(",
")",
";",
"// -----------------------------------------------------------------------",
"// return System.identityHashCode(this);",
"// -----------------------------------------------------------------------",
"mg",
".",
"loadThis",
"(",
")",
";",
"mg",
".",
"visitMethodInsn",
"(",
"INVOKESTATIC",
",",
"\"java/lang/System\"",
",",
"\"identityHashCode\"",
",",
"\"(Ljava/lang/Object;)I\"",
")",
";",
"mg",
".",
"returnValue",
"(",
")",
";",
"// -----------------------------------------------------------------------",
"// }",
"// -----------------------------------------------------------------------",
"mg",
".",
"endMethod",
"(",
")",
";",
"mg",
".",
"visitEnd",
"(",
")",
";",
"}"
] | Adds the default definition for the Object.hashCode method.
@param cw ASM ClassWriter to add the method to.
@param implClassName name of the wrapper class being generated. | [
"Adds",
"the",
"default",
"definition",
"for",
"the",
"Object",
".",
"hashCode",
"method",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/jitdeploy/EJBWrapper.java#L672-L698 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/jitdeploy/EJBWrapper.java | EJBWrapper.getInvalidBusinessExtends | private static Class<?> getInvalidBusinessExtends(Class<?> wrapperInterface)
{
if ((EJBLocalObject.class).isAssignableFrom(wrapperInterface))
return EJBLocalObject.class;
if ((EJBLocalHome.class).isAssignableFrom(wrapperInterface))
return EJBLocalHome.class;
if ((EJBObject.class).isAssignableFrom(wrapperInterface))
return EJBObject.class;
if ((EJBHome.class).isAssignableFrom(wrapperInterface))
return EJBHome.class;
return null;
} | java | private static Class<?> getInvalidBusinessExtends(Class<?> wrapperInterface)
{
if ((EJBLocalObject.class).isAssignableFrom(wrapperInterface))
return EJBLocalObject.class;
if ((EJBLocalHome.class).isAssignableFrom(wrapperInterface))
return EJBLocalHome.class;
if ((EJBObject.class).isAssignableFrom(wrapperInterface))
return EJBObject.class;
if ((EJBHome.class).isAssignableFrom(wrapperInterface))
return EJBHome.class;
return null;
} | [
"private",
"static",
"Class",
"<",
"?",
">",
"getInvalidBusinessExtends",
"(",
"Class",
"<",
"?",
">",
"wrapperInterface",
")",
"{",
"if",
"(",
"(",
"EJBLocalObject",
".",
"class",
")",
".",
"isAssignableFrom",
"(",
"wrapperInterface",
")",
")",
"return",
"EJBLocalObject",
".",
"class",
";",
"if",
"(",
"(",
"EJBLocalHome",
".",
"class",
")",
".",
"isAssignableFrom",
"(",
"wrapperInterface",
")",
")",
"return",
"EJBLocalHome",
".",
"class",
";",
"if",
"(",
"(",
"EJBObject",
".",
"class",
")",
".",
"isAssignableFrom",
"(",
"wrapperInterface",
")",
")",
"return",
"EJBObject",
".",
"class",
";",
"if",
"(",
"(",
"EJBHome",
".",
"class",
")",
".",
"isAssignableFrom",
"(",
"wrapperInterface",
")",
")",
"return",
"EJBHome",
".",
"class",
";",
"return",
"null",
";",
"}"
] | d457128.2 | [
"d457128",
".",
"2"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/jitdeploy/EJBWrapper.java#L2406-L2418 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/bytebuffer/internal/WsByteBufferPool.java | WsByteBufferPool.getEntry | public PooledWsByteBufferImpl getEntry() {
PooledWsByteBufferImpl returnValue = pool.get();
if (returnValue == null) {
returnValue = create();
}
if (inUseTable != null) {
inUseTable.put(returnValue, returnValue);
}
return returnValue;
} | java | public PooledWsByteBufferImpl getEntry() {
PooledWsByteBufferImpl returnValue = pool.get();
if (returnValue == null) {
returnValue = create();
}
if (inUseTable != null) {
inUseTable.put(returnValue, returnValue);
}
return returnValue;
} | [
"public",
"PooledWsByteBufferImpl",
"getEntry",
"(",
")",
"{",
"PooledWsByteBufferImpl",
"returnValue",
"=",
"pool",
".",
"get",
"(",
")",
";",
"if",
"(",
"returnValue",
"==",
"null",
")",
"{",
"returnValue",
"=",
"create",
"(",
")",
";",
"}",
"if",
"(",
"inUseTable",
"!=",
"null",
")",
"{",
"inUseTable",
".",
"put",
"(",
"returnValue",
",",
"returnValue",
")",
";",
"}",
"return",
"returnValue",
";",
"}"
] | Return a buffer from the pool, or allocate a new buffer is the pool
is full.
@return PooledWsByteBufferImpl | [
"Return",
"a",
"buffer",
"from",
"the",
"pool",
"or",
"allocate",
"a",
"new",
"buffer",
"is",
"the",
"pool",
"is",
"full",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/bytebuffer/internal/WsByteBufferPool.java#L102-L111 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/bytebuffer/internal/WsByteBufferPool.java | WsByteBufferPool.release | public void release(PooledWsByteBufferImpl buffer) {
if (inUseTable != null) {
inUseTable.remove(buffer);
}
boolean pooled = pool.put(buffer);
if (isDirectPool && !pooled) {
destroy(buffer);
}
} | java | public void release(PooledWsByteBufferImpl buffer) {
if (inUseTable != null) {
inUseTable.remove(buffer);
}
boolean pooled = pool.put(buffer);
if (isDirectPool && !pooled) {
destroy(buffer);
}
} | [
"public",
"void",
"release",
"(",
"PooledWsByteBufferImpl",
"buffer",
")",
"{",
"if",
"(",
"inUseTable",
"!=",
"null",
")",
"{",
"inUseTable",
".",
"remove",
"(",
"buffer",
")",
";",
"}",
"boolean",
"pooled",
"=",
"pool",
".",
"put",
"(",
"buffer",
")",
";",
"if",
"(",
"isDirectPool",
"&&",
"!",
"pooled",
")",
"{",
"destroy",
"(",
"buffer",
")",
";",
"}",
"}"
] | Return a buffer to the pool or free the buffer to be garbage
collected if the pool is full.
@param buffer to be released.
@param entryID | [
"Return",
"a",
"buffer",
"to",
"the",
"pool",
"or",
"free",
"the",
"buffer",
"to",
"be",
"garbage",
"collected",
"if",
"the",
"pool",
"is",
"full",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/bytebuffer/internal/WsByteBufferPool.java#L120-L128 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/bytebuffer/internal/WsByteBufferPool.java | WsByteBufferPool.getInUse | @SuppressWarnings("unchecked")
public Object[] getInUse() {
return inUseTable != null ? (((Hashtable<PooledWsByteBufferImpl, PooledWsByteBufferImpl>) inUseTable.clone()).keySet().toArray()) : new Object[0];
} | java | @SuppressWarnings("unchecked")
public Object[] getInUse() {
return inUseTable != null ? (((Hashtable<PooledWsByteBufferImpl, PooledWsByteBufferImpl>) inUseTable.clone()).keySet().toArray()) : new Object[0];
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"Object",
"[",
"]",
"getInUse",
"(",
")",
"{",
"return",
"inUseTable",
"!=",
"null",
"?",
"(",
"(",
"(",
"Hashtable",
"<",
"PooledWsByteBufferImpl",
",",
"PooledWsByteBufferImpl",
">",
")",
"inUseTable",
".",
"clone",
"(",
")",
")",
".",
"keySet",
"(",
")",
".",
"toArray",
"(",
")",
")",
":",
"new",
"Object",
"[",
"0",
"]",
";",
"}"
] | Return the inUse table.
@return Object[] an array of Objects representing the inUse table | [
"Return",
"the",
"inUse",
"table",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/bytebuffer/internal/WsByteBufferPool.java#L135-L138 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/bytebuffer/internal/WsByteBufferPool.java | WsByteBufferPool.removeFromInUse | public void removeFromInUse(Object buffer) {
if (inUseTable != null) {
if (null == buffer) {
throw new NullPointerException();
}
inUseTable.remove(buffer);
}
} | java | public void removeFromInUse(Object buffer) {
if (inUseTable != null) {
if (null == buffer) {
throw new NullPointerException();
}
inUseTable.remove(buffer);
}
} | [
"public",
"void",
"removeFromInUse",
"(",
"Object",
"buffer",
")",
"{",
"if",
"(",
"inUseTable",
"!=",
"null",
")",
"{",
"if",
"(",
"null",
"==",
"buffer",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}",
"inUseTable",
".",
"remove",
"(",
"buffer",
")",
";",
"}",
"}"
] | Remove a buffer from the InUse pool. To be used when the buffer
should be removed without waiting for the release logic to remove it.
@param buffer to be released. | [
"Remove",
"a",
"buffer",
"from",
"the",
"InUse",
"pool",
".",
"To",
"be",
"used",
"when",
"the",
"buffer",
"should",
"be",
"removed",
"without",
"waiting",
"for",
"the",
"release",
"logic",
"to",
"remove",
"it",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/bytebuffer/internal/WsByteBufferPool.java#L146-L153 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/ra/inbound/impl/SibRaDispatchEndpointActivation.java | SibRaDispatchEndpointActivation.internalDeactivate | void internalDeactivate ()
{
final String methodName = "internalDeactivate";
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.entry(this, TRACE, methodName);
}
synchronized (_sessionsByMeUuid) {
_sessionsByMeUuid.clear();
}
super.deactivate();
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.exit(this, TRACE, methodName);
}
} | java | void internalDeactivate ()
{
final String methodName = "internalDeactivate";
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.entry(this, TRACE, methodName);
}
synchronized (_sessionsByMeUuid) {
_sessionsByMeUuid.clear();
}
super.deactivate();
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.exit(this, TRACE, methodName);
}
} | [
"void",
"internalDeactivate",
"(",
")",
"{",
"final",
"String",
"methodName",
"=",
"\"internalDeactivate\"",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"TRACE",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"this",
",",
"TRACE",
",",
"methodName",
")",
";",
"}",
"synchronized",
"(",
"_sessionsByMeUuid",
")",
"{",
"_sessionsByMeUuid",
".",
"clear",
"(",
")",
";",
"}",
"super",
".",
"deactivate",
"(",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"TRACE",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"exit",
"(",
"this",
",",
"TRACE",
",",
"methodName",
")",
";",
"}",
"}"
] | This method performs tidy up on the endpoint activation and calls the base class's
deactivate method | [
"This",
"method",
"performs",
"tidy",
"up",
"on",
"the",
"endpoint",
"activation",
"and",
"calls",
"the",
"base",
"class",
"s",
"deactivate",
"method"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/ra/inbound/impl/SibRaDispatchEndpointActivation.java#L401-L418 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/ra/inbound/impl/SibRaDispatchEndpointActivation.java | SibRaDispatchEndpointActivation.closeConnection | protected void closeConnection(final String meUuid, boolean alreadyClosed) {
final String methodName = "closeConnection";
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.entry(this, TRACE, methodName, meUuid);
}
synchronized (_sessionsByMeUuid) {
super.closeConnection(meUuid, alreadyClosed);
_sessionsByMeUuid.remove(meUuid);
}
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.exit(this, TRACE, methodName);
}
} | java | protected void closeConnection(final String meUuid, boolean alreadyClosed) {
final String methodName = "closeConnection";
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.entry(this, TRACE, methodName, meUuid);
}
synchronized (_sessionsByMeUuid) {
super.closeConnection(meUuid, alreadyClosed);
_sessionsByMeUuid.remove(meUuid);
}
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.exit(this, TRACE, methodName);
}
} | [
"protected",
"void",
"closeConnection",
"(",
"final",
"String",
"meUuid",
",",
"boolean",
"alreadyClosed",
")",
"{",
"final",
"String",
"methodName",
"=",
"\"closeConnection\"",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"TRACE",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"this",
",",
"TRACE",
",",
"methodName",
",",
"meUuid",
")",
";",
"}",
"synchronized",
"(",
"_sessionsByMeUuid",
")",
"{",
"super",
".",
"closeConnection",
"(",
"meUuid",
",",
"alreadyClosed",
")",
";",
"_sessionsByMeUuid",
".",
"remove",
"(",
"meUuid",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"TRACE",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"exit",
"(",
"this",
",",
"TRACE",
",",
"methodName",
")",
";",
"}",
"}"
] | Closes the connection for the given messaging engine if there is one
open. Removes any corresponding sessions from the maps.
@param meUuid
the UUID for the messaging engine to close the connection for | [
"Closes",
"the",
"connection",
"for",
"the",
"given",
"messaging",
"engine",
"if",
"there",
"is",
"one",
"open",
".",
"Removes",
"any",
"corresponding",
"sessions",
"from",
"the",
"maps",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/ra/inbound/impl/SibRaDispatchEndpointActivation.java#L427-L446 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/ra/inbound/impl/SibRaDispatchEndpointActivation.java | SibRaDispatchEndpointActivation.getEndpointActivation | static SibRaDispatchEndpointActivation getEndpointActivation(
final String j2eeName) {
final String methodName = "getEndpointActivation";
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.entry(SibRaDispatchEndpointActivation.class,
TRACE, methodName, new Object [] { j2eeName } );
}
SibRaDispatchEndpointActivation endpoint = null;
synchronized (_endpointActivations) {
SibRaEndpointArray endpointActivationArray = (SibRaEndpointArray) _endpointActivations.get(j2eeName);
if (endpointActivationArray != null) {
// Get the next endpoint
endpoint = endpointActivationArray.getNextEndpoint();
}
}
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.exit(SibRaDispatchEndpointActivation.class, TRACE, methodName, endpoint);
}
return endpoint;
} | java | static SibRaDispatchEndpointActivation getEndpointActivation(
final String j2eeName) {
final String methodName = "getEndpointActivation";
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.entry(SibRaDispatchEndpointActivation.class,
TRACE, methodName, new Object [] { j2eeName } );
}
SibRaDispatchEndpointActivation endpoint = null;
synchronized (_endpointActivations) {
SibRaEndpointArray endpointActivationArray = (SibRaEndpointArray) _endpointActivations.get(j2eeName);
if (endpointActivationArray != null) {
// Get the next endpoint
endpoint = endpointActivationArray.getNextEndpoint();
}
}
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.exit(SibRaDispatchEndpointActivation.class, TRACE, methodName, endpoint);
}
return endpoint;
} | [
"static",
"SibRaDispatchEndpointActivation",
"getEndpointActivation",
"(",
"final",
"String",
"j2eeName",
")",
"{",
"final",
"String",
"methodName",
"=",
"\"getEndpointActivation\"",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"TRACE",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"entry",
"(",
"SibRaDispatchEndpointActivation",
".",
"class",
",",
"TRACE",
",",
"methodName",
",",
"new",
"Object",
"[",
"]",
"{",
"j2eeName",
"}",
")",
";",
"}",
"SibRaDispatchEndpointActivation",
"endpoint",
"=",
"null",
";",
"synchronized",
"(",
"_endpointActivations",
")",
"{",
"SibRaEndpointArray",
"endpointActivationArray",
"=",
"(",
"SibRaEndpointArray",
")",
"_endpointActivations",
".",
"get",
"(",
"j2eeName",
")",
";",
"if",
"(",
"endpointActivationArray",
"!=",
"null",
")",
"{",
"// Get the next endpoint",
"endpoint",
"=",
"endpointActivationArray",
".",
"getNextEndpoint",
"(",
")",
";",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"TRACE",
".",
"isEntryEnabled",
"(",
")",
")",
"{",
"SibTr",
".",
"exit",
"(",
"SibRaDispatchEndpointActivation",
".",
"class",
",",
"TRACE",
",",
"methodName",
",",
"endpoint",
")",
";",
"}",
"return",
"endpoint",
";",
"}"
] | Returns the endpoint activation for the message-driven bean with the
given J2EE name. There is an array of endpoint activations and this method
will return one by going round robin through them all. The round robin
behaviour is obtained by using an internal cursor to iterate through
the endpoints in the array.
@param j2eeName
the J2EE name of the message-driven bean
@return the endpoint activation | [
"Returns",
"the",
"endpoint",
"activation",
"for",
"the",
"message",
"-",
"driven",
"bean",
"with",
"the",
"given",
"J2EE",
"name",
".",
"There",
"is",
"an",
"array",
"of",
"endpoint",
"activations",
"and",
"this",
"method",
"will",
"return",
"one",
"by",
"going",
"round",
"robin",
"through",
"them",
"all",
".",
"The",
"round",
"robin",
"behaviour",
"is",
"obtained",
"by",
"using",
"an",
"internal",
"cursor",
"to",
"iterate",
"through",
"the",
"endpoints",
"in",
"the",
"array",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/ra/inbound/impl/SibRaDispatchEndpointActivation.java#L621-L650 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/RecoveryLogImpl.java | RecoveryLogImpl.associateLog | @Override
public void associateLog(DistributedRecoveryLog otherLog, boolean failAssociatedLog)
{
if (tc.isEntryEnabled())
Tr.entry(tc, "associateLog", new Object[] { otherLog, failAssociatedLog, this });
if (otherLog instanceof RecoveryLogImpl)
_recoveryLog.associateLog(((RecoveryLogImpl) otherLog).getMultiScopeLog(), failAssociatedLog);
else
_recoveryLog.associateLog(otherLog, failAssociatedLog);
if (tc.isEntryEnabled())
Tr.exit(tc, "associateLog");
} | java | @Override
public void associateLog(DistributedRecoveryLog otherLog, boolean failAssociatedLog)
{
if (tc.isEntryEnabled())
Tr.entry(tc, "associateLog", new Object[] { otherLog, failAssociatedLog, this });
if (otherLog instanceof RecoveryLogImpl)
_recoveryLog.associateLog(((RecoveryLogImpl) otherLog).getMultiScopeLog(), failAssociatedLog);
else
_recoveryLog.associateLog(otherLog, failAssociatedLog);
if (tc.isEntryEnabled())
Tr.exit(tc, "associateLog");
} | [
"@",
"Override",
"public",
"void",
"associateLog",
"(",
"DistributedRecoveryLog",
"otherLog",
",",
"boolean",
"failAssociatedLog",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"entry",
"(",
"tc",
",",
"\"associateLog\"",
",",
"new",
"Object",
"[",
"]",
"{",
"otherLog",
",",
"failAssociatedLog",
",",
"this",
"}",
")",
";",
"if",
"(",
"otherLog",
"instanceof",
"RecoveryLogImpl",
")",
"_recoveryLog",
".",
"associateLog",
"(",
"(",
"(",
"RecoveryLogImpl",
")",
"otherLog",
")",
".",
"getMultiScopeLog",
"(",
")",
",",
"failAssociatedLog",
")",
";",
"else",
"_recoveryLog",
".",
"associateLog",
"(",
"otherLog",
",",
"failAssociatedLog",
")",
";",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"Tr",
".",
"exit",
"(",
"tc",
",",
"\"associateLog\"",
")",
";",
"}"
] | Associates another log with this one. | [
"Associates",
"another",
"log",
"with",
"this",
"one",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/RecoveryLogImpl.java#L281-L293 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transaction/src/com/ibm/ws/transaction/services/JTMConfigurationProvider.java | JTMConfigurationProvider.setTMS | public void setTMS(TransactionManagerService tms) {
if (tc.isDebugEnabled())
Tr.debug(tc, "setTMS " + tms);
tmsRef = tms;
} | java | public void setTMS(TransactionManagerService tms) {
if (tc.isDebugEnabled())
Tr.debug(tc, "setTMS " + tms);
tmsRef = tms;
} | [
"public",
"void",
"setTMS",
"(",
"TransactionManagerService",
"tms",
")",
"{",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"setTMS \"",
"+",
"tms",
")",
";",
"tmsRef",
"=",
"tms",
";",
"}"
] | The setTMS method call is used to alert the JTMConfigurationProvider to the presence of a
TransactionManagerService.
@param tms | [
"The",
"setTMS",
"method",
"call",
"is",
"used",
"to",
"alert",
"the",
"JTMConfigurationProvider",
"to",
"the",
"presence",
"of",
"a",
"TransactionManagerService",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transaction/src/com/ibm/ws/transaction/services/JTMConfigurationProvider.java#L387-L391 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transaction/src/com/ibm/ws/transaction/services/JTMConfigurationProvider.java | JTMConfigurationProvider.checkDataSourceRef | private void checkDataSourceRef() {
Object configuredDSR = _props.get("dataSourceRef");
if (configuredDSR == null) {
if (tc.isDebugEnabled())
Tr.debug(tc, "dataSourceRef is not specified, log to filesys");
_isSQLRecoveryLog = false;
} else {
if (tc.isDebugEnabled())
Tr.debug(tc, "dataSourceRef is specified, log to RDBMS");
// We'll set the logDir to maintain tWAS code compatibility. First we need to
// check get the table suffix string if it is set in server.xml
String suffixStr = (String) _props.get("transactionLogDBTableSuffix");
if (tc.isDebugEnabled())
Tr.debug(tc, "suffixStr is " + suffixStr + ", of length " + suffixStr.length());
if (suffixStr != null && !suffixStr.trim().isEmpty()) {
suffixStr = suffixStr.trim();
logDir = "custom://com.ibm.rls.jdbc.SQLRecoveryLogFactory?datasource=Liberty" +
",tablesuffix=" + suffixStr;
} else
logDir = "custom://com.ibm.rls.jdbc.SQLRecoveryLogFactory?datasource=Liberty";
if (tc.isDebugEnabled())
Tr.debug(tc, "logDir now set to ", logDir);
_isSQLRecoveryLog = true;
}
} | java | private void checkDataSourceRef() {
Object configuredDSR = _props.get("dataSourceRef");
if (configuredDSR == null) {
if (tc.isDebugEnabled())
Tr.debug(tc, "dataSourceRef is not specified, log to filesys");
_isSQLRecoveryLog = false;
} else {
if (tc.isDebugEnabled())
Tr.debug(tc, "dataSourceRef is specified, log to RDBMS");
// We'll set the logDir to maintain tWAS code compatibility. First we need to
// check get the table suffix string if it is set in server.xml
String suffixStr = (String) _props.get("transactionLogDBTableSuffix");
if (tc.isDebugEnabled())
Tr.debug(tc, "suffixStr is " + suffixStr + ", of length " + suffixStr.length());
if (suffixStr != null && !suffixStr.trim().isEmpty()) {
suffixStr = suffixStr.trim();
logDir = "custom://com.ibm.rls.jdbc.SQLRecoveryLogFactory?datasource=Liberty" +
",tablesuffix=" + suffixStr;
} else
logDir = "custom://com.ibm.rls.jdbc.SQLRecoveryLogFactory?datasource=Liberty";
if (tc.isDebugEnabled())
Tr.debug(tc, "logDir now set to ", logDir);
_isSQLRecoveryLog = true;
}
} | [
"private",
"void",
"checkDataSourceRef",
"(",
")",
"{",
"Object",
"configuredDSR",
"=",
"_props",
".",
"get",
"(",
"\"dataSourceRef\"",
")",
";",
"if",
"(",
"configuredDSR",
"==",
"null",
")",
"{",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"dataSourceRef is not specified, log to filesys\"",
")",
";",
"_isSQLRecoveryLog",
"=",
"false",
";",
"}",
"else",
"{",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"dataSourceRef is specified, log to RDBMS\"",
")",
";",
"// We'll set the logDir to maintain tWAS code compatibility. First we need to",
"// check get the table suffix string if it is set in server.xml",
"String",
"suffixStr",
"=",
"(",
"String",
")",
"_props",
".",
"get",
"(",
"\"transactionLogDBTableSuffix\"",
")",
";",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"suffixStr is \"",
"+",
"suffixStr",
"+",
"\", of length \"",
"+",
"suffixStr",
".",
"length",
"(",
")",
")",
";",
"if",
"(",
"suffixStr",
"!=",
"null",
"&&",
"!",
"suffixStr",
".",
"trim",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"{",
"suffixStr",
"=",
"suffixStr",
".",
"trim",
"(",
")",
";",
"logDir",
"=",
"\"custom://com.ibm.rls.jdbc.SQLRecoveryLogFactory?datasource=Liberty\"",
"+",
"\",tablesuffix=\"",
"+",
"suffixStr",
";",
"}",
"else",
"logDir",
"=",
"\"custom://com.ibm.rls.jdbc.SQLRecoveryLogFactory?datasource=Liberty\"",
";",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"logDir now set to \"",
",",
"logDir",
")",
";",
"_isSQLRecoveryLog",
"=",
"true",
";",
"}",
"}"
] | Determine whether the server is configured to store Tran Logs in an RDBMS, | [
"Determine",
"whether",
"the",
"server",
"is",
"configured",
"to",
"store",
"Tran",
"Logs",
"in",
"an",
"RDBMS"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transaction/src/com/ibm/ws/transaction/services/JTMConfigurationProvider.java#L450-L478 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.transaction/src/com/ibm/ws/transaction/services/JTMConfigurationProvider.java | JTMConfigurationProvider.parseTransactionLogDirectory | private String parseTransactionLogDirectory() {
if (tc.isDebugEnabled())
Tr.debug(tc, "parseTransactionLogDirectory working with " + _props);
String configuredLogDir = (String) _props.get("transactionLogDirectory");
// don't allow null to be returned - it will result in use of a location
// that is shared
// across all local servers and thus risks log corruption
if (configuredLogDir == null) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "using default log dir as config is null");
// set default
configuredLogDir = defaultLogDir;
} else {
// ensure dir string ends with a '/'
if (!configuredLogDir.endsWith("/")) {
configuredLogDir = configuredLogDir + "/";
}
}
// resolve the configured value
WsResource logDirResource = null;
try {
// Synchronize to ensure we see a valid locationService
synchronized (this) {
logDirResource = locationService.resolveResource(configuredLogDir);
}
} catch (IllegalArgumentException e) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "IllegalArgumentException from location service for dir string: " + configuredLogDir);
if (!configuredLogDir.equals(defaultLogDir)) {
// try using the default
configuredLogDir = defaultLogDir;
try {
// Synchronize to ensure we see a valid locationService
synchronized (this) {
logDirResource = locationService.resolveResource(configuredLogDir);
}
} catch (IllegalArgumentException ex) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "Secondary IllegalArgumentException " + ex + " from location service for dir string: " + configuredLogDir);
// if we can't establish a tran log dir, we need a way to disable
// the transaction service
// rethrow the original exception
throw e;
}
} else {
throw e;
}
}
// get full path string from resource
logDir = logDirResource.toExternalURI().getPath();
return logDir;
} | java | private String parseTransactionLogDirectory() {
if (tc.isDebugEnabled())
Tr.debug(tc, "parseTransactionLogDirectory working with " + _props);
String configuredLogDir = (String) _props.get("transactionLogDirectory");
// don't allow null to be returned - it will result in use of a location
// that is shared
// across all local servers and thus risks log corruption
if (configuredLogDir == null) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "using default log dir as config is null");
// set default
configuredLogDir = defaultLogDir;
} else {
// ensure dir string ends with a '/'
if (!configuredLogDir.endsWith("/")) {
configuredLogDir = configuredLogDir + "/";
}
}
// resolve the configured value
WsResource logDirResource = null;
try {
// Synchronize to ensure we see a valid locationService
synchronized (this) {
logDirResource = locationService.resolveResource(configuredLogDir);
}
} catch (IllegalArgumentException e) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "IllegalArgumentException from location service for dir string: " + configuredLogDir);
if (!configuredLogDir.equals(defaultLogDir)) {
// try using the default
configuredLogDir = defaultLogDir;
try {
// Synchronize to ensure we see a valid locationService
synchronized (this) {
logDirResource = locationService.resolveResource(configuredLogDir);
}
} catch (IllegalArgumentException ex) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "Secondary IllegalArgumentException " + ex + " from location service for dir string: " + configuredLogDir);
// if we can't establish a tran log dir, we need a way to disable
// the transaction service
// rethrow the original exception
throw e;
}
} else {
throw e;
}
}
// get full path string from resource
logDir = logDirResource.toExternalURI().getPath();
return logDir;
} | [
"private",
"String",
"parseTransactionLogDirectory",
"(",
")",
"{",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"parseTransactionLogDirectory working with \"",
"+",
"_props",
")",
";",
"String",
"configuredLogDir",
"=",
"(",
"String",
")",
"_props",
".",
"get",
"(",
"\"transactionLogDirectory\"",
")",
";",
"// don't allow null to be returned - it will result in use of a location",
"// that is shared",
"// across all local servers and thus risks log corruption",
"if",
"(",
"configuredLogDir",
"==",
"null",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"using default log dir as config is null\"",
")",
";",
"// set default",
"configuredLogDir",
"=",
"defaultLogDir",
";",
"}",
"else",
"{",
"// ensure dir string ends with a '/'",
"if",
"(",
"!",
"configuredLogDir",
".",
"endsWith",
"(",
"\"/\"",
")",
")",
"{",
"configuredLogDir",
"=",
"configuredLogDir",
"+",
"\"/\"",
";",
"}",
"}",
"// resolve the configured value",
"WsResource",
"logDirResource",
"=",
"null",
";",
"try",
"{",
"// Synchronize to ensure we see a valid locationService",
"synchronized",
"(",
"this",
")",
"{",
"logDirResource",
"=",
"locationService",
".",
"resolveResource",
"(",
"configuredLogDir",
")",
";",
"}",
"}",
"catch",
"(",
"IllegalArgumentException",
"e",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"IllegalArgumentException from location service for dir string: \"",
"+",
"configuredLogDir",
")",
";",
"if",
"(",
"!",
"configuredLogDir",
".",
"equals",
"(",
"defaultLogDir",
")",
")",
"{",
"// try using the default",
"configuredLogDir",
"=",
"defaultLogDir",
";",
"try",
"{",
"// Synchronize to ensure we see a valid locationService",
"synchronized",
"(",
"this",
")",
"{",
"logDirResource",
"=",
"locationService",
".",
"resolveResource",
"(",
"configuredLogDir",
")",
";",
"}",
"}",
"catch",
"(",
"IllegalArgumentException",
"ex",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Secondary IllegalArgumentException \"",
"+",
"ex",
"+",
"\" from location service for dir string: \"",
"+",
"configuredLogDir",
")",
";",
"// if we can't establish a tran log dir, we need a way to disable",
"// the transaction service",
"// rethrow the original exception",
"throw",
"e",
";",
"}",
"}",
"else",
"{",
"throw",
"e",
";",
"}",
"}",
"// get full path string from resource",
"logDir",
"=",
"logDirResource",
".",
"toExternalURI",
"(",
")",
".",
"getPath",
"(",
")",
";",
"return",
"logDir",
";",
"}"
] | This method should only be used where logging to a file system.
@return the full path of the log directory | [
"This",
"method",
"should",
"only",
"be",
"used",
"where",
"logging",
"to",
"a",
"file",
"system",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transaction/src/com/ibm/ws/transaction/services/JTMConfigurationProvider.java#L485-L540 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/config/DefaultFacesConfigurationProvider.java | DefaultFacesConfigurationProvider.getClassloaderFacesConfig | @Override
public List<FacesConfig> getClassloaderFacesConfig(ExternalContext ectx)
{
List<FacesConfig> appConfigResources = new ArrayList<FacesConfig>();
try
{
FacesConfigResourceProvider provider = FacesConfigResourceProviderFactory.
getFacesConfigResourceProviderFactory(ectx).createFacesConfigResourceProvider(ectx);
Collection<URL> facesConfigs = provider.getMetaInfConfigurationResources(ectx);
for (URL url : facesConfigs)
{
if (MyfacesConfig.getCurrentInstance(ectx).isValidateXML())
{
validateFacesConfig(ectx, url);
}
InputStream stream = null;
try
{
stream = openStreamWithoutCache(url);
if (log.isLoggable(Level.INFO))
{
log.info("Reading config : " + url.toExternalForm());
}
appConfigResources.add(getUnmarshaller(ectx).getFacesConfig(stream, url.toExternalForm()));
//getDispenser().feed(getUnmarshaller().getFacesConfig(stream, entry.getKey()));
}
finally
{
if (stream != null)
{
stream.close();
}
}
}
}
catch (Throwable e)
{
throw new FacesException(e);
}
return appConfigResources;
} | java | @Override
public List<FacesConfig> getClassloaderFacesConfig(ExternalContext ectx)
{
List<FacesConfig> appConfigResources = new ArrayList<FacesConfig>();
try
{
FacesConfigResourceProvider provider = FacesConfigResourceProviderFactory.
getFacesConfigResourceProviderFactory(ectx).createFacesConfigResourceProvider(ectx);
Collection<URL> facesConfigs = provider.getMetaInfConfigurationResources(ectx);
for (URL url : facesConfigs)
{
if (MyfacesConfig.getCurrentInstance(ectx).isValidateXML())
{
validateFacesConfig(ectx, url);
}
InputStream stream = null;
try
{
stream = openStreamWithoutCache(url);
if (log.isLoggable(Level.INFO))
{
log.info("Reading config : " + url.toExternalForm());
}
appConfigResources.add(getUnmarshaller(ectx).getFacesConfig(stream, url.toExternalForm()));
//getDispenser().feed(getUnmarshaller().getFacesConfig(stream, entry.getKey()));
}
finally
{
if (stream != null)
{
stream.close();
}
}
}
}
catch (Throwable e)
{
throw new FacesException(e);
}
return appConfigResources;
} | [
"@",
"Override",
"public",
"List",
"<",
"FacesConfig",
">",
"getClassloaderFacesConfig",
"(",
"ExternalContext",
"ectx",
")",
"{",
"List",
"<",
"FacesConfig",
">",
"appConfigResources",
"=",
"new",
"ArrayList",
"<",
"FacesConfig",
">",
"(",
")",
";",
"try",
"{",
"FacesConfigResourceProvider",
"provider",
"=",
"FacesConfigResourceProviderFactory",
".",
"getFacesConfigResourceProviderFactory",
"(",
"ectx",
")",
".",
"createFacesConfigResourceProvider",
"(",
"ectx",
")",
";",
"Collection",
"<",
"URL",
">",
"facesConfigs",
"=",
"provider",
".",
"getMetaInfConfigurationResources",
"(",
"ectx",
")",
";",
"for",
"(",
"URL",
"url",
":",
"facesConfigs",
")",
"{",
"if",
"(",
"MyfacesConfig",
".",
"getCurrentInstance",
"(",
"ectx",
")",
".",
"isValidateXML",
"(",
")",
")",
"{",
"validateFacesConfig",
"(",
"ectx",
",",
"url",
")",
";",
"}",
"InputStream",
"stream",
"=",
"null",
";",
"try",
"{",
"stream",
"=",
"openStreamWithoutCache",
"(",
"url",
")",
";",
"if",
"(",
"log",
".",
"isLoggable",
"(",
"Level",
".",
"INFO",
")",
")",
"{",
"log",
".",
"info",
"(",
"\"Reading config : \"",
"+",
"url",
".",
"toExternalForm",
"(",
")",
")",
";",
"}",
"appConfigResources",
".",
"add",
"(",
"getUnmarshaller",
"(",
"ectx",
")",
".",
"getFacesConfig",
"(",
"stream",
",",
"url",
".",
"toExternalForm",
"(",
")",
")",
")",
";",
"//getDispenser().feed(getUnmarshaller().getFacesConfig(stream, entry.getKey()));",
"}",
"finally",
"{",
"if",
"(",
"stream",
"!=",
"null",
")",
"{",
"stream",
".",
"close",
"(",
")",
";",
"}",
"}",
"}",
"}",
"catch",
"(",
"Throwable",
"e",
")",
"{",
"throw",
"new",
"FacesException",
"(",
"e",
")",
";",
"}",
"return",
"appConfigResources",
";",
"}"
] | This method fixes MYFACES-208 | [
"This",
"method",
"fixes",
"MYFACES",
"-",
"208"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/config/DefaultFacesConfigurationProvider.java#L303-L345 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableInputHandler.java | DurableInputHandler.handleMessage | public void handleMessage(
MessageItem msg,
TransactionCommon transaction,
SIBUuid8 sourceMEUuid)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "handleMessage", new Object[]{msg, transaction, sourceMEUuid});
SIErrorException e = new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0001",
new Object[] {
"com.ibm.ws.sib.processor.impl.DurableInputHandler",
"1:143:1.52.1.1" },
null));
// FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.DurableInputHandler.handleMessage",
"1:150:1.52.1.1",
this);
SibTr.exception(tc, e);
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0001",
new Object[] {
"com.ibm.ws.sib.processor.impl.DurableInputHandler",
"1:158:1.52.1.1" });
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "handleMessage", e);
throw e;
} | java | public void handleMessage(
MessageItem msg,
TransactionCommon transaction,
SIBUuid8 sourceMEUuid)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "handleMessage", new Object[]{msg, transaction, sourceMEUuid});
SIErrorException e = new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0001",
new Object[] {
"com.ibm.ws.sib.processor.impl.DurableInputHandler",
"1:143:1.52.1.1" },
null));
// FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.DurableInputHandler.handleMessage",
"1:150:1.52.1.1",
this);
SibTr.exception(tc, e);
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0001",
new Object[] {
"com.ibm.ws.sib.processor.impl.DurableInputHandler",
"1:158:1.52.1.1" });
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "handleMessage", e);
throw e;
} | [
"public",
"void",
"handleMessage",
"(",
"MessageItem",
"msg",
",",
"TransactionCommon",
"transaction",
",",
"SIBUuid8",
"sourceMEUuid",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"handleMessage\"",
",",
"new",
"Object",
"[",
"]",
"{",
"msg",
",",
"transaction",
",",
"sourceMEUuid",
"}",
")",
";",
"SIErrorException",
"e",
"=",
"new",
"SIErrorException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0001\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.impl.DurableInputHandler\"",
",",
"\"1:143:1.52.1.1\"",
"}",
",",
"null",
")",
")",
";",
"// FFDC",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.impl.DurableInputHandler.handleMessage\"",
",",
"\"1:150:1.52.1.1\"",
",",
"this",
")",
";",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"SibTr",
".",
"error",
"(",
"tc",
",",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0001\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.impl.DurableInputHandler\"",
",",
"\"1:158:1.52.1.1\"",
"}",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"handleMessage\"",
",",
"e",
")",
";",
"throw",
"e",
";",
"}"
] | This method is a NOP for durable handlers.
@param msg ignored
@param transaction ignored
@param producerSession ignored
@param sourceCellule ignored
@param targetCellule ignored | [
"This",
"method",
"is",
"a",
"NOP",
"for",
"durable",
"handlers",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableInputHandler.java#L108-L142 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableInputHandler.java | DurableInputHandler.handleControlMessage | public void handleControlMessage(SIBUuid8 sourceMEUuid, ControlMessage cMsg)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "handleControlMessage", new Object[]{sourceMEUuid, cMsg});
InvalidOperationException e = new InvalidOperationException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0001",
new Object[] {
"com.ibm.ws.sib.processor.impl.DurableInputHandler",
"1:183:1.52.1.1" },
null));
// FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.DurableInputHandler.handleControlMessage",
"1:190:1.52.1.1",
this);
SibTr.exception(tc, e);
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0001",
new Object[] {
"com.ibm.ws.sib.processor.impl.DurableInputHandler",
"1:197:1.52.1.1" });
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "handleControlMessage", e);
throw e;
} | java | public void handleControlMessage(SIBUuid8 sourceMEUuid, ControlMessage cMsg)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "handleControlMessage", new Object[]{sourceMEUuid, cMsg});
InvalidOperationException e = new InvalidOperationException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0001",
new Object[] {
"com.ibm.ws.sib.processor.impl.DurableInputHandler",
"1:183:1.52.1.1" },
null));
// FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.DurableInputHandler.handleControlMessage",
"1:190:1.52.1.1",
this);
SibTr.exception(tc, e);
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0001",
new Object[] {
"com.ibm.ws.sib.processor.impl.DurableInputHandler",
"1:197:1.52.1.1" });
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "handleControlMessage", e);
throw e;
} | [
"public",
"void",
"handleControlMessage",
"(",
"SIBUuid8",
"sourceMEUuid",
",",
"ControlMessage",
"cMsg",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"handleControlMessage\"",
",",
"new",
"Object",
"[",
"]",
"{",
"sourceMEUuid",
",",
"cMsg",
"}",
")",
";",
"InvalidOperationException",
"e",
"=",
"new",
"InvalidOperationException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0001\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.impl.DurableInputHandler\"",
",",
"\"1:183:1.52.1.1\"",
"}",
",",
"null",
")",
")",
";",
"// FFDC",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.impl.DurableInputHandler.handleControlMessage\"",
",",
"\"1:190:1.52.1.1\"",
",",
"this",
")",
";",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"SibTr",
".",
"error",
"(",
"tc",
",",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0001\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.impl.DurableInputHandler\"",
",",
"\"1:197:1.52.1.1\"",
"}",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"handleControlMessage\"",
",",
"e",
")",
";",
"throw",
"e",
";",
"}"
] | NOP for the durable handlers. | [
"NOP",
"for",
"the",
"durable",
"handlers",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableInputHandler.java#L151-L180 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableInputHandler.java | DurableInputHandler.staticHandleControlMessage | public static void staticHandleControlMessage(ControlMessage cMsg)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "staticHandleControlMessage",
new Object[] {cMsg});
ControlMessageType type = cMsg.getControlMessageType();
if ((type == ControlMessageType.NOTFLUSHED) ||
(type == ControlMessageType.CARDINALITYINFO) ||
(type == ControlMessageType.DURABLECONFIRM))
{
// See if the request ID is pending and wakeup the waiter
long reqID = 0;
if (cMsg instanceof ControlNotFlushed)
reqID = ((ControlNotFlushed) cMsg).getRequestID();
else if (cMsg instanceof ControlCardinalityInfo)
reqID = ((ControlCardinalityInfo) cMsg).getRequestID();
else if (cMsg instanceof ControlDurableConfirm)
reqID = ((ControlDurableConfirm) cMsg).getRequestID();
// Now wakeup any waiters. If this is a stale reply, then it's ignored.
wakeupWaiter(reqID, cMsg);
}
else
{
// unknown type, log error
SIErrorException e = new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0001",
new Object[] {
"com.ibm.ws.sib.processor.impl.DurableInputHandler",
"1:245:1.52.1.1" },
null));
// FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.DurableInputHandler.staticHandleControlMessage",
"1:252:1.52.1.1",
DurableInputHandler.class);
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0001",
new Object[] {
"com.ibm.ws.sib.processor.impl.DurableInputHandler",
"1:258:1.52.1.1" });
SibTr.exception(tc, e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "staticHandleControlMessage");
} | java | public static void staticHandleControlMessage(ControlMessage cMsg)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "staticHandleControlMessage",
new Object[] {cMsg});
ControlMessageType type = cMsg.getControlMessageType();
if ((type == ControlMessageType.NOTFLUSHED) ||
(type == ControlMessageType.CARDINALITYINFO) ||
(type == ControlMessageType.DURABLECONFIRM))
{
// See if the request ID is pending and wakeup the waiter
long reqID = 0;
if (cMsg instanceof ControlNotFlushed)
reqID = ((ControlNotFlushed) cMsg).getRequestID();
else if (cMsg instanceof ControlCardinalityInfo)
reqID = ((ControlCardinalityInfo) cMsg).getRequestID();
else if (cMsg instanceof ControlDurableConfirm)
reqID = ((ControlDurableConfirm) cMsg).getRequestID();
// Now wakeup any waiters. If this is a stale reply, then it's ignored.
wakeupWaiter(reqID, cMsg);
}
else
{
// unknown type, log error
SIErrorException e = new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0001",
new Object[] {
"com.ibm.ws.sib.processor.impl.DurableInputHandler",
"1:245:1.52.1.1" },
null));
// FFDC
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.impl.DurableInputHandler.staticHandleControlMessage",
"1:252:1.52.1.1",
DurableInputHandler.class);
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0001",
new Object[] {
"com.ibm.ws.sib.processor.impl.DurableInputHandler",
"1:258:1.52.1.1" });
SibTr.exception(tc, e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "staticHandleControlMessage");
} | [
"public",
"static",
"void",
"staticHandleControlMessage",
"(",
"ControlMessage",
"cMsg",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"staticHandleControlMessage\"",
",",
"new",
"Object",
"[",
"]",
"{",
"cMsg",
"}",
")",
";",
"ControlMessageType",
"type",
"=",
"cMsg",
".",
"getControlMessageType",
"(",
")",
";",
"if",
"(",
"(",
"type",
"==",
"ControlMessageType",
".",
"NOTFLUSHED",
")",
"||",
"(",
"type",
"==",
"ControlMessageType",
".",
"CARDINALITYINFO",
")",
"||",
"(",
"type",
"==",
"ControlMessageType",
".",
"DURABLECONFIRM",
")",
")",
"{",
"// See if the request ID is pending and wakeup the waiter",
"long",
"reqID",
"=",
"0",
";",
"if",
"(",
"cMsg",
"instanceof",
"ControlNotFlushed",
")",
"reqID",
"=",
"(",
"(",
"ControlNotFlushed",
")",
"cMsg",
")",
".",
"getRequestID",
"(",
")",
";",
"else",
"if",
"(",
"cMsg",
"instanceof",
"ControlCardinalityInfo",
")",
"reqID",
"=",
"(",
"(",
"ControlCardinalityInfo",
")",
"cMsg",
")",
".",
"getRequestID",
"(",
")",
";",
"else",
"if",
"(",
"cMsg",
"instanceof",
"ControlDurableConfirm",
")",
"reqID",
"=",
"(",
"(",
"ControlDurableConfirm",
")",
"cMsg",
")",
".",
"getRequestID",
"(",
")",
";",
"// Now wakeup any waiters. If this is a stale reply, then it's ignored. ",
"wakeupWaiter",
"(",
"reqID",
",",
"cMsg",
")",
";",
"}",
"else",
"{",
"// unknown type, log error",
"SIErrorException",
"e",
"=",
"new",
"SIErrorException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0001\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.impl.DurableInputHandler\"",
",",
"\"1:245:1.52.1.1\"",
"}",
",",
"null",
")",
")",
";",
"// FFDC",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.impl.DurableInputHandler.staticHandleControlMessage\"",
",",
"\"1:252:1.52.1.1\"",
",",
"DurableInputHandler",
".",
"class",
")",
";",
"SibTr",
".",
"error",
"(",
"tc",
",",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0001\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.impl.DurableInputHandler\"",
",",
"\"1:258:1.52.1.1\"",
"}",
")",
";",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"staticHandleControlMessage\"",
")",
";",
"}"
] | This is the only message handling method which should be invoked
on the DurableInputHandler. This method will receive control messages
giving the status of durable subcription creation or deletion, as well
as stream creation requests.
@param sourceCellue The origin of the message.
@param cMsg The ControlMessage to process. | [
"This",
"is",
"the",
"only",
"message",
"handling",
"method",
"which",
"should",
"be",
"invoked",
"on",
"the",
"DurableInputHandler",
".",
"This",
"method",
"will",
"receive",
"control",
"messages",
"giving",
"the",
"status",
"of",
"durable",
"subcription",
"creation",
"or",
"deletion",
"as",
"well",
"as",
"stream",
"creation",
"requests",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableInputHandler.java#L191-L243 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableInputHandler.java | DurableInputHandler.wakeupWaiter | protected static void wakeupWaiter(long reqID, Object result)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "wakeupWaiter", new Object[] {new Long(reqID), result});
synchronized (_requestMap)
{
Long key = new Long(reqID);
Object[] waiter = _requestMap.get(key);
if (waiter != null)
{
// Waiting request, wake up
waiter[0] = result;
_requestMap.remove(key);
synchronized (waiter)
{
waiter.notify();
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "wakeupWaiter");
} | java | protected static void wakeupWaiter(long reqID, Object result)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "wakeupWaiter", new Object[] {new Long(reqID), result});
synchronized (_requestMap)
{
Long key = new Long(reqID);
Object[] waiter = _requestMap.get(key);
if (waiter != null)
{
// Waiting request, wake up
waiter[0] = result;
_requestMap.remove(key);
synchronized (waiter)
{
waiter.notify();
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "wakeupWaiter");
} | [
"protected",
"static",
"void",
"wakeupWaiter",
"(",
"long",
"reqID",
",",
"Object",
"result",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"wakeupWaiter\"",
",",
"new",
"Object",
"[",
"]",
"{",
"new",
"Long",
"(",
"reqID",
")",
",",
"result",
"}",
")",
";",
"synchronized",
"(",
"_requestMap",
")",
"{",
"Long",
"key",
"=",
"new",
"Long",
"(",
"reqID",
")",
";",
"Object",
"[",
"]",
"waiter",
"=",
"_requestMap",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"waiter",
"!=",
"null",
")",
"{",
"// Waiting request, wake up",
"waiter",
"[",
"0",
"]",
"=",
"result",
";",
"_requestMap",
".",
"remove",
"(",
"key",
")",
";",
"synchronized",
"(",
"waiter",
")",
"{",
"waiter",
".",
"notify",
"(",
")",
";",
"}",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"wakeupWaiter\"",
")",
";",
"}"
] | Attempt to wake up a blocked thread waiting for a request reply.
@param reqID The ID of the request for which a reply was received.
@param result The reply message. | [
"Attempt",
"to",
"wake",
"up",
"a",
"blocked",
"thread",
"waiting",
"for",
"a",
"request",
"reply",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableInputHandler.java#L251-L275 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableInputHandler.java | DurableInputHandler.createDurableCreateStream | protected static ControlCreateStream createDurableCreateStream(
MessageProcessor MP,
ConsumerDispatcherState subState,
long reqID,
SIBUuid8 dme)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "createDurableCreateStream", new Object[] {MP, subState, new Long(reqID), dme});
ControlCreateStream msg = null;
try
{
// Create and initialize the message
msg = MessageProcessor.getControlMessageFactory().createNewControlCreateStream();
initializeControlMessage(MP.getMessagingEngineUuid(), msg, dme);
// Parameterize for CreateStream
msg.setRequestID(reqID);
msg.setDurableSubName(subState.getSubscriberID());
msg.setGuaranteedTargetDestinationDefinitionUUID(subState.getTopicSpaceUuid());
SelectionCriteria criteria = subState.getSelectionCriteria();
//check for null values for MFP - defect 251989
//the discriminator
if(criteria==null || criteria.getDiscriminator()==null)
{
msg.setDurableDiscriminator(null);
}
else
{
msg.setDurableDiscriminator(criteria.getDiscriminator());
}
//the selector
if(criteria==null || criteria.getSelectorString()==null)
{
msg.setDurableSelector(null);
}
else
{
msg.setDurableSelector(subState.getSelectionCriteria().getSelectorString());
}
//the selector domain
if(criteria==null || criteria.getSelectorDomain()==null)
{
msg.setDurableSelectorDomain(SelectorDomain.SIMESSAGE.toInt());
}
else
{
msg.setDurableSelectorDomain(criteria.getSelectorDomain().toInt());
}
//defect 259036
msg.setCloned(subState.isCloned());
msg.setNoLocal(subState.isNoLocal());
msg.setSecurityUserid(subState.getUser());
// Set the flag that signals whether this is
// the privileged SIBServerSubject.
msg.setSecurityUseridSentBySystem(subState.isSIBServerSubject());
}
catch (Exception e)
{
FFDCFilter.processException(e,
"com.ibm.ws.sib.processor.impl.DurableInputHandler.createDurableCreateStream",
"1:372:1.52.1.1",
DurableInputHandler.class);
SibTr.exception(tc, e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "createDurableCreateStream", msg);
return msg;
} | java | protected static ControlCreateStream createDurableCreateStream(
MessageProcessor MP,
ConsumerDispatcherState subState,
long reqID,
SIBUuid8 dme)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "createDurableCreateStream", new Object[] {MP, subState, new Long(reqID), dme});
ControlCreateStream msg = null;
try
{
// Create and initialize the message
msg = MessageProcessor.getControlMessageFactory().createNewControlCreateStream();
initializeControlMessage(MP.getMessagingEngineUuid(), msg, dme);
// Parameterize for CreateStream
msg.setRequestID(reqID);
msg.setDurableSubName(subState.getSubscriberID());
msg.setGuaranteedTargetDestinationDefinitionUUID(subState.getTopicSpaceUuid());
SelectionCriteria criteria = subState.getSelectionCriteria();
//check for null values for MFP - defect 251989
//the discriminator
if(criteria==null || criteria.getDiscriminator()==null)
{
msg.setDurableDiscriminator(null);
}
else
{
msg.setDurableDiscriminator(criteria.getDiscriminator());
}
//the selector
if(criteria==null || criteria.getSelectorString()==null)
{
msg.setDurableSelector(null);
}
else
{
msg.setDurableSelector(subState.getSelectionCriteria().getSelectorString());
}
//the selector domain
if(criteria==null || criteria.getSelectorDomain()==null)
{
msg.setDurableSelectorDomain(SelectorDomain.SIMESSAGE.toInt());
}
else
{
msg.setDurableSelectorDomain(criteria.getSelectorDomain().toInt());
}
//defect 259036
msg.setCloned(subState.isCloned());
msg.setNoLocal(subState.isNoLocal());
msg.setSecurityUserid(subState.getUser());
// Set the flag that signals whether this is
// the privileged SIBServerSubject.
msg.setSecurityUseridSentBySystem(subState.isSIBServerSubject());
}
catch (Exception e)
{
FFDCFilter.processException(e,
"com.ibm.ws.sib.processor.impl.DurableInputHandler.createDurableCreateStream",
"1:372:1.52.1.1",
DurableInputHandler.class);
SibTr.exception(tc, e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "createDurableCreateStream", msg);
return msg;
} | [
"protected",
"static",
"ControlCreateStream",
"createDurableCreateStream",
"(",
"MessageProcessor",
"MP",
",",
"ConsumerDispatcherState",
"subState",
",",
"long",
"reqID",
",",
"SIBUuid8",
"dme",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"createDurableCreateStream\"",
",",
"new",
"Object",
"[",
"]",
"{",
"MP",
",",
"subState",
",",
"new",
"Long",
"(",
"reqID",
")",
",",
"dme",
"}",
")",
";",
"ControlCreateStream",
"msg",
"=",
"null",
";",
"try",
"{",
"// Create and initialize the message",
"msg",
"=",
"MessageProcessor",
".",
"getControlMessageFactory",
"(",
")",
".",
"createNewControlCreateStream",
"(",
")",
";",
"initializeControlMessage",
"(",
"MP",
".",
"getMessagingEngineUuid",
"(",
")",
",",
"msg",
",",
"dme",
")",
";",
"// Parameterize for CreateStream",
"msg",
".",
"setRequestID",
"(",
"reqID",
")",
";",
"msg",
".",
"setDurableSubName",
"(",
"subState",
".",
"getSubscriberID",
"(",
")",
")",
";",
"msg",
".",
"setGuaranteedTargetDestinationDefinitionUUID",
"(",
"subState",
".",
"getTopicSpaceUuid",
"(",
")",
")",
";",
"SelectionCriteria",
"criteria",
"=",
"subState",
".",
"getSelectionCriteria",
"(",
")",
";",
"//check for null values for MFP - defect 251989",
"//the discriminator",
"if",
"(",
"criteria",
"==",
"null",
"||",
"criteria",
".",
"getDiscriminator",
"(",
")",
"==",
"null",
")",
"{",
"msg",
".",
"setDurableDiscriminator",
"(",
"null",
")",
";",
"}",
"else",
"{",
"msg",
".",
"setDurableDiscriminator",
"(",
"criteria",
".",
"getDiscriminator",
"(",
")",
")",
";",
"}",
"//the selector",
"if",
"(",
"criteria",
"==",
"null",
"||",
"criteria",
".",
"getSelectorString",
"(",
")",
"==",
"null",
")",
"{",
"msg",
".",
"setDurableSelector",
"(",
"null",
")",
";",
"}",
"else",
"{",
"msg",
".",
"setDurableSelector",
"(",
"subState",
".",
"getSelectionCriteria",
"(",
")",
".",
"getSelectorString",
"(",
")",
")",
";",
"}",
"//the selector domain",
"if",
"(",
"criteria",
"==",
"null",
"||",
"criteria",
".",
"getSelectorDomain",
"(",
")",
"==",
"null",
")",
"{",
"msg",
".",
"setDurableSelectorDomain",
"(",
"SelectorDomain",
".",
"SIMESSAGE",
".",
"toInt",
"(",
")",
")",
";",
"}",
"else",
"{",
"msg",
".",
"setDurableSelectorDomain",
"(",
"criteria",
".",
"getSelectorDomain",
"(",
")",
".",
"toInt",
"(",
")",
")",
";",
"}",
"//defect 259036",
"msg",
".",
"setCloned",
"(",
"subState",
".",
"isCloned",
"(",
")",
")",
";",
"msg",
".",
"setNoLocal",
"(",
"subState",
".",
"isNoLocal",
"(",
")",
")",
";",
"msg",
".",
"setSecurityUserid",
"(",
"subState",
".",
"getUser",
"(",
")",
")",
";",
"// Set the flag that signals whether this is",
"// the privileged SIBServerSubject.",
"msg",
".",
"setSecurityUseridSentBySystem",
"(",
"subState",
".",
"isSIBServerSubject",
"(",
")",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.impl.DurableInputHandler.createDurableCreateStream\"",
",",
"\"1:372:1.52.1.1\"",
",",
"DurableInputHandler",
".",
"class",
")",
";",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"createDurableCreateStream\"",
",",
"msg",
")",
";",
"return",
"msg",
";",
"}"
] | Create a CreateStream request for an existing durable connection.
@param subState The state describing the subscription we are attaching to.
@param reqID The request ID to be used for the request.
@param dme The dme to which the request should be sent | [
"Create",
"a",
"CreateStream",
"request",
"for",
"an",
"existing",
"durable",
"connection",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableInputHandler.java#L284-L359 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableInputHandler.java | DurableInputHandler.createDurableCreateDurable | protected static ControlCreateDurable createDurableCreateDurable(
MessageProcessor MP,
ConsumerDispatcherState subState,
long reqID,
SIBUuid8 dme)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "createDurableCreateDurable", new Object[] {MP, subState, new Long(reqID), dme});
ControlCreateDurable msg = null;
try
{
// Create and initialize the message
msg = MessageProcessor.getControlMessageFactory().createNewControlCreateDurable();
initializeControlMessage(MP.getMessagingEngineUuid(), msg, dme);
// Parameterize for CreateStream
msg.setRequestID(reqID);
msg.setDurableSubName(subState.getSubscriberID());
SelectionCriteria criteria = subState.getSelectionCriteria();
//check for null values for MFP - discriminator can be null
//the discriminator
if(criteria==null || criteria.getDiscriminator()==null)
{
msg.setDurableDiscriminator(null);
}
else
{
msg.setDurableDiscriminator(criteria.getDiscriminator());
}
//the selector
if(criteria==null || criteria.getSelectorString()==null)
{
msg.setDurableSelector(null);
}
else
{
msg.setDurableSelector(subState.getSelectionCriteria().getSelectorString());
}
//the selector domain
if(criteria==null || criteria.getSelectorDomain()==null)
{
msg.setDurableSelectorDomain(SelectorDomain.SIMESSAGE.toInt());
}
else
{
msg.setDurableSelectorDomain(criteria.getSelectorDomain().toInt());
}
// Check the selectorProperties Map to see if we need to convey any additional properties associated
// with the selector. At present (26/03/08) there is only one additional property
// which is itself a map (of name spaces). The name space map is used in the XPath10 selector domain
// to map URLs to prefixes. The use of a selectorProperties map keeps the Core SPI generic but
// when conveying information over JMF we need a simpler structure and so will need to
// break out individual properties for transportation.
if(criteria==null)
{
msg.setDurableSelectorNamespaceMap(null);
}
else
{
// See if these criteria have any selector properties. They might if they are MPSelectionCriteria
if(criteria instanceof MPSelectionCriteria)
{
MPSelectionCriteria mpCriteria = (MPSelectionCriteria)criteria;
Map<String, Object> selectorProperties = mpCriteria.getSelectorProperties();
if(selectorProperties != null)
{
Map<String, String> selectorNamespaceMap =
(Map<String, String>)selectorProperties.get("namespacePrefixMappings");
if(selectorNamespaceMap != null)
msg.setDurableSelectorNamespaceMap(selectorNamespaceMap);
else
msg.setDurableSelectorNamespaceMap(null);
}
else
{
msg.setDurableSelectorNamespaceMap(null);
}
}
else
{
msg.setDurableSelectorNamespaceMap(null);
} // eof instanceof MPSelectionCriteria
} // eof null criteria
//defect 259036
msg.setCloned(subState.isCloned());
msg.setNoLocal(subState.isNoLocal());
msg.setSecurityUserid(subState.getUser());
// Set the flag that signals whether this is
// the privileged SIBServerSubject.
msg.setSecurityUseridSentBySystem(subState.isSIBServerSubject());
}
catch (Exception e)
{
FFDCFilter.processException(e,
"com.ibm.ws.sib.processor.impl.DurableInputHandler.createDurableCreateDurable",
"1:495:1.52.1.1",
DurableInputHandler.class);
SibTr.exception(tc, e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "createDurableCreateDurable", msg);
return msg;
} | java | protected static ControlCreateDurable createDurableCreateDurable(
MessageProcessor MP,
ConsumerDispatcherState subState,
long reqID,
SIBUuid8 dme)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "createDurableCreateDurable", new Object[] {MP, subState, new Long(reqID), dme});
ControlCreateDurable msg = null;
try
{
// Create and initialize the message
msg = MessageProcessor.getControlMessageFactory().createNewControlCreateDurable();
initializeControlMessage(MP.getMessagingEngineUuid(), msg, dme);
// Parameterize for CreateStream
msg.setRequestID(reqID);
msg.setDurableSubName(subState.getSubscriberID());
SelectionCriteria criteria = subState.getSelectionCriteria();
//check for null values for MFP - discriminator can be null
//the discriminator
if(criteria==null || criteria.getDiscriminator()==null)
{
msg.setDurableDiscriminator(null);
}
else
{
msg.setDurableDiscriminator(criteria.getDiscriminator());
}
//the selector
if(criteria==null || criteria.getSelectorString()==null)
{
msg.setDurableSelector(null);
}
else
{
msg.setDurableSelector(subState.getSelectionCriteria().getSelectorString());
}
//the selector domain
if(criteria==null || criteria.getSelectorDomain()==null)
{
msg.setDurableSelectorDomain(SelectorDomain.SIMESSAGE.toInt());
}
else
{
msg.setDurableSelectorDomain(criteria.getSelectorDomain().toInt());
}
// Check the selectorProperties Map to see if we need to convey any additional properties associated
// with the selector. At present (26/03/08) there is only one additional property
// which is itself a map (of name spaces). The name space map is used in the XPath10 selector domain
// to map URLs to prefixes. The use of a selectorProperties map keeps the Core SPI generic but
// when conveying information over JMF we need a simpler structure and so will need to
// break out individual properties for transportation.
if(criteria==null)
{
msg.setDurableSelectorNamespaceMap(null);
}
else
{
// See if these criteria have any selector properties. They might if they are MPSelectionCriteria
if(criteria instanceof MPSelectionCriteria)
{
MPSelectionCriteria mpCriteria = (MPSelectionCriteria)criteria;
Map<String, Object> selectorProperties = mpCriteria.getSelectorProperties();
if(selectorProperties != null)
{
Map<String, String> selectorNamespaceMap =
(Map<String, String>)selectorProperties.get("namespacePrefixMappings");
if(selectorNamespaceMap != null)
msg.setDurableSelectorNamespaceMap(selectorNamespaceMap);
else
msg.setDurableSelectorNamespaceMap(null);
}
else
{
msg.setDurableSelectorNamespaceMap(null);
}
}
else
{
msg.setDurableSelectorNamespaceMap(null);
} // eof instanceof MPSelectionCriteria
} // eof null criteria
//defect 259036
msg.setCloned(subState.isCloned());
msg.setNoLocal(subState.isNoLocal());
msg.setSecurityUserid(subState.getUser());
// Set the flag that signals whether this is
// the privileged SIBServerSubject.
msg.setSecurityUseridSentBySystem(subState.isSIBServerSubject());
}
catch (Exception e)
{
FFDCFilter.processException(e,
"com.ibm.ws.sib.processor.impl.DurableInputHandler.createDurableCreateDurable",
"1:495:1.52.1.1",
DurableInputHandler.class);
SibTr.exception(tc, e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "createDurableCreateDurable", msg);
return msg;
} | [
"protected",
"static",
"ControlCreateDurable",
"createDurableCreateDurable",
"(",
"MessageProcessor",
"MP",
",",
"ConsumerDispatcherState",
"subState",
",",
"long",
"reqID",
",",
"SIBUuid8",
"dme",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"createDurableCreateDurable\"",
",",
"new",
"Object",
"[",
"]",
"{",
"MP",
",",
"subState",
",",
"new",
"Long",
"(",
"reqID",
")",
",",
"dme",
"}",
")",
";",
"ControlCreateDurable",
"msg",
"=",
"null",
";",
"try",
"{",
"// Create and initialize the message",
"msg",
"=",
"MessageProcessor",
".",
"getControlMessageFactory",
"(",
")",
".",
"createNewControlCreateDurable",
"(",
")",
";",
"initializeControlMessage",
"(",
"MP",
".",
"getMessagingEngineUuid",
"(",
")",
",",
"msg",
",",
"dme",
")",
";",
"// Parameterize for CreateStream",
"msg",
".",
"setRequestID",
"(",
"reqID",
")",
";",
"msg",
".",
"setDurableSubName",
"(",
"subState",
".",
"getSubscriberID",
"(",
")",
")",
";",
"SelectionCriteria",
"criteria",
"=",
"subState",
".",
"getSelectionCriteria",
"(",
")",
";",
"//check for null values for MFP - discriminator can be null",
"//the discriminator",
"if",
"(",
"criteria",
"==",
"null",
"||",
"criteria",
".",
"getDiscriminator",
"(",
")",
"==",
"null",
")",
"{",
"msg",
".",
"setDurableDiscriminator",
"(",
"null",
")",
";",
"}",
"else",
"{",
"msg",
".",
"setDurableDiscriminator",
"(",
"criteria",
".",
"getDiscriminator",
"(",
")",
")",
";",
"}",
"//the selector",
"if",
"(",
"criteria",
"==",
"null",
"||",
"criteria",
".",
"getSelectorString",
"(",
")",
"==",
"null",
")",
"{",
"msg",
".",
"setDurableSelector",
"(",
"null",
")",
";",
"}",
"else",
"{",
"msg",
".",
"setDurableSelector",
"(",
"subState",
".",
"getSelectionCriteria",
"(",
")",
".",
"getSelectorString",
"(",
")",
")",
";",
"}",
"//the selector domain",
"if",
"(",
"criteria",
"==",
"null",
"||",
"criteria",
".",
"getSelectorDomain",
"(",
")",
"==",
"null",
")",
"{",
"msg",
".",
"setDurableSelectorDomain",
"(",
"SelectorDomain",
".",
"SIMESSAGE",
".",
"toInt",
"(",
")",
")",
";",
"}",
"else",
"{",
"msg",
".",
"setDurableSelectorDomain",
"(",
"criteria",
".",
"getSelectorDomain",
"(",
")",
".",
"toInt",
"(",
")",
")",
";",
"}",
"// Check the selectorProperties Map to see if we need to convey any additional properties associated",
"// with the selector. At present (26/03/08) there is only one additional property",
"// which is itself a map (of name spaces). The name space map is used in the XPath10 selector domain",
"// to map URLs to prefixes. The use of a selectorProperties map keeps the Core SPI generic but",
"// when conveying information over JMF we need a simpler structure and so will need to",
"// break out individual properties for transportation.",
"if",
"(",
"criteria",
"==",
"null",
")",
"{",
"msg",
".",
"setDurableSelectorNamespaceMap",
"(",
"null",
")",
";",
"}",
"else",
"{",
"// See if these criteria have any selector properties. They might if they are MPSelectionCriteria",
"if",
"(",
"criteria",
"instanceof",
"MPSelectionCriteria",
")",
"{",
"MPSelectionCriteria",
"mpCriteria",
"=",
"(",
"MPSelectionCriteria",
")",
"criteria",
";",
"Map",
"<",
"String",
",",
"Object",
">",
"selectorProperties",
"=",
"mpCriteria",
".",
"getSelectorProperties",
"(",
")",
";",
"if",
"(",
"selectorProperties",
"!=",
"null",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"selectorNamespaceMap",
"=",
"(",
"Map",
"<",
"String",
",",
"String",
">",
")",
"selectorProperties",
".",
"get",
"(",
"\"namespacePrefixMappings\"",
")",
";",
"if",
"(",
"selectorNamespaceMap",
"!=",
"null",
")",
"msg",
".",
"setDurableSelectorNamespaceMap",
"(",
"selectorNamespaceMap",
")",
";",
"else",
"msg",
".",
"setDurableSelectorNamespaceMap",
"(",
"null",
")",
";",
"}",
"else",
"{",
"msg",
".",
"setDurableSelectorNamespaceMap",
"(",
"null",
")",
";",
"}",
"}",
"else",
"{",
"msg",
".",
"setDurableSelectorNamespaceMap",
"(",
"null",
")",
";",
"}",
"// eof instanceof MPSelectionCriteria",
"}",
"// eof null criteria",
"//defect 259036",
"msg",
".",
"setCloned",
"(",
"subState",
".",
"isCloned",
"(",
")",
")",
";",
"msg",
".",
"setNoLocal",
"(",
"subState",
".",
"isNoLocal",
"(",
")",
")",
";",
"msg",
".",
"setSecurityUserid",
"(",
"subState",
".",
"getUser",
"(",
")",
")",
";",
"// Set the flag that signals whether this is",
"// the privileged SIBServerSubject.",
"msg",
".",
"setSecurityUseridSentBySystem",
"(",
"subState",
".",
"isSIBServerSubject",
"(",
")",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.impl.DurableInputHandler.createDurableCreateDurable\"",
",",
"\"1:495:1.52.1.1\"",
",",
"DurableInputHandler",
".",
"class",
")",
";",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"createDurableCreateDurable\"",
",",
"msg",
")",
";",
"return",
"msg",
";",
"}"
] | Create a CreateDurable request for a new durable connection.
@param subState The state describing the subscription to be created.
@param reqID The request ID to be used for the request.
@param dme The dme to which the request should be sent | [
"Create",
"a",
"CreateDurable",
"request",
"for",
"a",
"new",
"durable",
"connection",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableInputHandler.java#L368-L482 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableInputHandler.java | DurableInputHandler.createDurableDeleteDurable | protected static ControlDeleteDurable createDurableDeleteDurable(
MessageProcessor MP,
String subName,
String userName,
long reqID,
SIBUuid8 dme)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "createDurableDeleteDurable", new Object[] {MP, subName, userName, new Long(reqID), dme});
ControlDeleteDurable msg = null;
try
{
// Create and initialize the message
msg = MessageProcessor.getControlMessageFactory().createNewControlDeleteDurable();
initializeControlMessage(MP.getMessagingEngineUuid(), msg, dme);
// Parameterize for CreateStream
msg.setRequestID(reqID);
msg.setDurableSubName(subName);
msg.setSecurityUserid(userName);
}
catch (Exception e)
{
FFDCFilter.processException(e,
"com.ibm.ws.sib.processor.impl.DurableInputHandler.createDurableDeleteDurable",
"1:540:1.52.1.1",
DurableInputHandler.class);
SibTr.exception(tc, e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "createDurableDeleteDurable", msg);
return msg;
} | java | protected static ControlDeleteDurable createDurableDeleteDurable(
MessageProcessor MP,
String subName,
String userName,
long reqID,
SIBUuid8 dme)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "createDurableDeleteDurable", new Object[] {MP, subName, userName, new Long(reqID), dme});
ControlDeleteDurable msg = null;
try
{
// Create and initialize the message
msg = MessageProcessor.getControlMessageFactory().createNewControlDeleteDurable();
initializeControlMessage(MP.getMessagingEngineUuid(), msg, dme);
// Parameterize for CreateStream
msg.setRequestID(reqID);
msg.setDurableSubName(subName);
msg.setSecurityUserid(userName);
}
catch (Exception e)
{
FFDCFilter.processException(e,
"com.ibm.ws.sib.processor.impl.DurableInputHandler.createDurableDeleteDurable",
"1:540:1.52.1.1",
DurableInputHandler.class);
SibTr.exception(tc, e);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "createDurableDeleteDurable", msg);
return msg;
} | [
"protected",
"static",
"ControlDeleteDurable",
"createDurableDeleteDurable",
"(",
"MessageProcessor",
"MP",
",",
"String",
"subName",
",",
"String",
"userName",
",",
"long",
"reqID",
",",
"SIBUuid8",
"dme",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"createDurableDeleteDurable\"",
",",
"new",
"Object",
"[",
"]",
"{",
"MP",
",",
"subName",
",",
"userName",
",",
"new",
"Long",
"(",
"reqID",
")",
",",
"dme",
"}",
")",
";",
"ControlDeleteDurable",
"msg",
"=",
"null",
";",
"try",
"{",
"// Create and initialize the message",
"msg",
"=",
"MessageProcessor",
".",
"getControlMessageFactory",
"(",
")",
".",
"createNewControlDeleteDurable",
"(",
")",
";",
"initializeControlMessage",
"(",
"MP",
".",
"getMessagingEngineUuid",
"(",
")",
",",
"msg",
",",
"dme",
")",
";",
"// Parameterize for CreateStream",
"msg",
".",
"setRequestID",
"(",
"reqID",
")",
";",
"msg",
".",
"setDurableSubName",
"(",
"subName",
")",
";",
"msg",
".",
"setSecurityUserid",
"(",
"userName",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"FFDCFilter",
".",
"processException",
"(",
"e",
",",
"\"com.ibm.ws.sib.processor.impl.DurableInputHandler.createDurableDeleteDurable\"",
",",
"\"1:540:1.52.1.1\"",
",",
"DurableInputHandler",
".",
"class",
")",
";",
"SibTr",
".",
"exception",
"(",
"tc",
",",
"e",
")",
";",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"createDurableDeleteDurable\"",
",",
"msg",
")",
";",
"return",
"msg",
";",
"}"
] | Create a DeleteDurable request for an existing durable connection.
@param subName the name of the subscription to delete.
@param reqID The request ID to be used for the request.
@param dme The dme to which the request should be sent | [
"Create",
"a",
"DeleteDurable",
"request",
"for",
"an",
"existing",
"durable",
"connection",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableInputHandler.java#L491-L527 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableInputHandler.java | DurableInputHandler.issueRequest | public static Object issueRequest(
MessageProcessor MP,
ControlMessage msg,
SIBUuid8 remoteUuid,
long retry,
int tries,
long requestID)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "issueRequest", new Object[] {MP, msg, remoteUuid, new Long(retry), new Integer(tries), new Long(requestID)});
// Short circuit ME rechability test
if (!MP.getMPIO().isMEReachable(remoteUuid))
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "issueRequest", null);
return null;
}
// Prepare the request map
Object[] awaitResult = new Object[1];
synchronized (_requestMap)
{
_requestMap.put(new Long(requestID), awaitResult);
}
synchronized (awaitResult)
{
// Now send the request, setup the retry alarm, and wait for a result
MP.getMPIO().sendToMe(remoteUuid, SIMPConstants.CONTROL_MESSAGE_PRIORITY, msg);
ResendRecord retryRecord = new ResendRecord(MP, msg, remoteUuid, retry, tries, requestID);
MP.getAlarmManager().create(retry, _alarmHandler, retryRecord);
while (true)
try
{
awaitResult.wait();
break;
}
catch (InterruptedException e)
{
// No FFDC code needed
// We shouldn't be interrupted, but if we are loop around and try again
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "issueRequest", awaitResult[0]);
return awaitResult[0];
} | java | public static Object issueRequest(
MessageProcessor MP,
ControlMessage msg,
SIBUuid8 remoteUuid,
long retry,
int tries,
long requestID)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "issueRequest", new Object[] {MP, msg, remoteUuid, new Long(retry), new Integer(tries), new Long(requestID)});
// Short circuit ME rechability test
if (!MP.getMPIO().isMEReachable(remoteUuid))
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "issueRequest", null);
return null;
}
// Prepare the request map
Object[] awaitResult = new Object[1];
synchronized (_requestMap)
{
_requestMap.put(new Long(requestID), awaitResult);
}
synchronized (awaitResult)
{
// Now send the request, setup the retry alarm, and wait for a result
MP.getMPIO().sendToMe(remoteUuid, SIMPConstants.CONTROL_MESSAGE_PRIORITY, msg);
ResendRecord retryRecord = new ResendRecord(MP, msg, remoteUuid, retry, tries, requestID);
MP.getAlarmManager().create(retry, _alarmHandler, retryRecord);
while (true)
try
{
awaitResult.wait();
break;
}
catch (InterruptedException e)
{
// No FFDC code needed
// We shouldn't be interrupted, but if we are loop around and try again
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "issueRequest", awaitResult[0]);
return awaitResult[0];
} | [
"public",
"static",
"Object",
"issueRequest",
"(",
"MessageProcessor",
"MP",
",",
"ControlMessage",
"msg",
",",
"SIBUuid8",
"remoteUuid",
",",
"long",
"retry",
",",
"int",
"tries",
",",
"long",
"requestID",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"issueRequest\"",
",",
"new",
"Object",
"[",
"]",
"{",
"MP",
",",
"msg",
",",
"remoteUuid",
",",
"new",
"Long",
"(",
"retry",
")",
",",
"new",
"Integer",
"(",
"tries",
")",
",",
"new",
"Long",
"(",
"requestID",
")",
"}",
")",
";",
"// Short circuit ME rechability test",
"if",
"(",
"!",
"MP",
".",
"getMPIO",
"(",
")",
".",
"isMEReachable",
"(",
"remoteUuid",
")",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"issueRequest\"",
",",
"null",
")",
";",
"return",
"null",
";",
"}",
"// Prepare the request map",
"Object",
"[",
"]",
"awaitResult",
"=",
"new",
"Object",
"[",
"1",
"]",
";",
"synchronized",
"(",
"_requestMap",
")",
"{",
"_requestMap",
".",
"put",
"(",
"new",
"Long",
"(",
"requestID",
")",
",",
"awaitResult",
")",
";",
"}",
"synchronized",
"(",
"awaitResult",
")",
"{",
"// Now send the request, setup the retry alarm, and wait for a result",
"MP",
".",
"getMPIO",
"(",
")",
".",
"sendToMe",
"(",
"remoteUuid",
",",
"SIMPConstants",
".",
"CONTROL_MESSAGE_PRIORITY",
",",
"msg",
")",
";",
"ResendRecord",
"retryRecord",
"=",
"new",
"ResendRecord",
"(",
"MP",
",",
"msg",
",",
"remoteUuid",
",",
"retry",
",",
"tries",
",",
"requestID",
")",
";",
"MP",
".",
"getAlarmManager",
"(",
")",
".",
"create",
"(",
"retry",
",",
"_alarmHandler",
",",
"retryRecord",
")",
";",
"while",
"(",
"true",
")",
"try",
"{",
"awaitResult",
".",
"wait",
"(",
")",
";",
"break",
";",
"}",
"catch",
"(",
"InterruptedException",
"e",
")",
"{",
"// No FFDC code needed",
"// We shouldn't be interrupted, but if we are loop around and try again",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"issueRequest\"",
",",
"awaitResult",
"[",
"0",
"]",
")",
";",
"return",
"awaitResult",
"[",
"0",
"]",
";",
"}"
] | Issue a general request, wait for the reply, then return it.
@param msg The ControlMessage to send.
@param me The ME to send the request to.
@param retry The retry interval (in milliseconds) for the request.
@param tries The number of times to attempt to send the request.
@param requestID The unique ID of the request
@return The result of sending the request, either null for a timeout, or
some valid return code for the actual request. | [
"Issue",
"a",
"general",
"request",
"wait",
"for",
"the",
"reply",
"then",
"return",
"it",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableInputHandler.java#L567-L616 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableInputHandler.java | DurableInputHandler.issueCreateDurableRequest | public static int issueCreateDurableRequest(
MessageProcessor MP,
ConsumerDispatcherState subState,
SIBUuid8 remoteMEUuid,
SIBUuid12 destinationID)
throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "issueCreateDurableRequest", new Object[] { MP, subState, remoteMEUuid, destinationID});
long requestID = MP.nextTick();
ControlMessage msg = createDurableCreateDurable(MP, subState, requestID, remoteMEUuid);
// Create requires a destination ID
msg.setGuaranteedTargetDestinationDefinitionUUID(destinationID);
Object result =
issueRequest(MP, msg, remoteMEUuid,
CREATEDURABLE_RETRY_TIMEOUT, -1, // 219870: retry forever, otherwise use CREATEDURABLE_NUMTRIES,
requestID);
if (result == null)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "issueCreateDurableRequest", "SIResourceException");
// Timeout, throw a general error
throw new SIResourceException(
nls.getFormattedMessage(
"REMOTE_DURABLE_TIMEOUT_ERROR_CWSIP0631",
new Object[] {
"create",
subState.getSubscriberID(),
subState.getDurableHome()},
null));
}
// Otherwise, reply should always be a ControlDurableConfirm with a status code
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "issueCreateDurableRequest", new Integer(((ControlDurableConfirm) result).getStatus()));
return ((ControlDurableConfirm) result).getStatus();
} | java | public static int issueCreateDurableRequest(
MessageProcessor MP,
ConsumerDispatcherState subState,
SIBUuid8 remoteMEUuid,
SIBUuid12 destinationID)
throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "issueCreateDurableRequest", new Object[] { MP, subState, remoteMEUuid, destinationID});
long requestID = MP.nextTick();
ControlMessage msg = createDurableCreateDurable(MP, subState, requestID, remoteMEUuid);
// Create requires a destination ID
msg.setGuaranteedTargetDestinationDefinitionUUID(destinationID);
Object result =
issueRequest(MP, msg, remoteMEUuid,
CREATEDURABLE_RETRY_TIMEOUT, -1, // 219870: retry forever, otherwise use CREATEDURABLE_NUMTRIES,
requestID);
if (result == null)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "issueCreateDurableRequest", "SIResourceException");
// Timeout, throw a general error
throw new SIResourceException(
nls.getFormattedMessage(
"REMOTE_DURABLE_TIMEOUT_ERROR_CWSIP0631",
new Object[] {
"create",
subState.getSubscriberID(),
subState.getDurableHome()},
null));
}
// Otherwise, reply should always be a ControlDurableConfirm with a status code
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "issueCreateDurableRequest", new Integer(((ControlDurableConfirm) result).getStatus()));
return ((ControlDurableConfirm) result).getStatus();
} | [
"public",
"static",
"int",
"issueCreateDurableRequest",
"(",
"MessageProcessor",
"MP",
",",
"ConsumerDispatcherState",
"subState",
",",
"SIBUuid8",
"remoteMEUuid",
",",
"SIBUuid12",
"destinationID",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"issueCreateDurableRequest\"",
",",
"new",
"Object",
"[",
"]",
"{",
"MP",
",",
"subState",
",",
"remoteMEUuid",
",",
"destinationID",
"}",
")",
";",
"long",
"requestID",
"=",
"MP",
".",
"nextTick",
"(",
")",
";",
"ControlMessage",
"msg",
"=",
"createDurableCreateDurable",
"(",
"MP",
",",
"subState",
",",
"requestID",
",",
"remoteMEUuid",
")",
";",
"// Create requires a destination ID",
"msg",
".",
"setGuaranteedTargetDestinationDefinitionUUID",
"(",
"destinationID",
")",
";",
"Object",
"result",
"=",
"issueRequest",
"(",
"MP",
",",
"msg",
",",
"remoteMEUuid",
",",
"CREATEDURABLE_RETRY_TIMEOUT",
",",
"-",
"1",
",",
"// 219870: retry forever, otherwise use CREATEDURABLE_NUMTRIES,",
"requestID",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"issueCreateDurableRequest\"",
",",
"\"SIResourceException\"",
")",
";",
"// Timeout, throw a general error",
"throw",
"new",
"SIResourceException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"REMOTE_DURABLE_TIMEOUT_ERROR_CWSIP0631\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"create\"",
",",
"subState",
".",
"getSubscriberID",
"(",
")",
",",
"subState",
".",
"getDurableHome",
"(",
")",
"}",
",",
"null",
")",
")",
";",
"}",
"// Otherwise, reply should always be a ControlDurableConfirm with a status code",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"issueCreateDurableRequest\"",
",",
"new",
"Integer",
"(",
"(",
"(",
"ControlDurableConfirm",
")",
"result",
")",
".",
"getStatus",
"(",
")",
")",
")",
";",
"return",
"(",
"(",
"ControlDurableConfirm",
")",
"result",
")",
".",
"getStatus",
"(",
")",
";",
"}"
] | Issue a CreateDurable request for a new remote durable subscription.
The caller is blocked until we receive a reply for this request.
@param req The state describing the request
@return One of STATUS_OK, STATUS_SUB_ALREADY_EXISTS, or STATUS_SUB_GENERAL_ERROR | [
"Issue",
"a",
"CreateDurable",
"request",
"for",
"a",
"new",
"remote",
"durable",
"subscription",
".",
"The",
"caller",
"is",
"blocked",
"until",
"we",
"receive",
"a",
"reply",
"for",
"this",
"request",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableInputHandler.java#L753-L793 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableInputHandler.java | DurableInputHandler.issueDeleteDurableRequest | public static int issueDeleteDurableRequest(
MessageProcessor MP,
String subName,
String userName,
SIBUuid8 remoteMEUuid)
throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "issueDeleteDurableRequest", new Object[] {MP, subName, userName, remoteMEUuid});
long requestID = MP.nextTick();
ControlMessage msg = createDurableDeleteDurable(MP, subName, userName, requestID, remoteMEUuid);
Object result =
issueRequest(MP, msg, remoteMEUuid,
DELETEDURABLE_RETRY_TIMEOUT, -1, // 219870: retry forever, otherwise use DELETEDURABLE_NUMTRIES,
requestID);
if (result == null)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "issueDeleteDurableRequest", "SIResourceException");
// Timeout, throw a general error
throw new SIResourceException(
nls.getFormattedMessage(
"REMOTE_DURABLE_TIMEOUT_ERROR_CWSIP0631",
new Object[] {
"delete",
subName,
remoteMEUuid},
null));
}
// Otherwise, reply should always be a ControlDurableConfirm with a status code
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "issueDeleteDurableRequest", new Integer(((ControlDurableConfirm) result).getStatus()));
return ((ControlDurableConfirm) result).getStatus();
} | java | public static int issueDeleteDurableRequest(
MessageProcessor MP,
String subName,
String userName,
SIBUuid8 remoteMEUuid)
throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "issueDeleteDurableRequest", new Object[] {MP, subName, userName, remoteMEUuid});
long requestID = MP.nextTick();
ControlMessage msg = createDurableDeleteDurable(MP, subName, userName, requestID, remoteMEUuid);
Object result =
issueRequest(MP, msg, remoteMEUuid,
DELETEDURABLE_RETRY_TIMEOUT, -1, // 219870: retry forever, otherwise use DELETEDURABLE_NUMTRIES,
requestID);
if (result == null)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "issueDeleteDurableRequest", "SIResourceException");
// Timeout, throw a general error
throw new SIResourceException(
nls.getFormattedMessage(
"REMOTE_DURABLE_TIMEOUT_ERROR_CWSIP0631",
new Object[] {
"delete",
subName,
remoteMEUuid},
null));
}
// Otherwise, reply should always be a ControlDurableConfirm with a status code
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "issueDeleteDurableRequest", new Integer(((ControlDurableConfirm) result).getStatus()));
return ((ControlDurableConfirm) result).getStatus();
} | [
"public",
"static",
"int",
"issueDeleteDurableRequest",
"(",
"MessageProcessor",
"MP",
",",
"String",
"subName",
",",
"String",
"userName",
",",
"SIBUuid8",
"remoteMEUuid",
")",
"throws",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"issueDeleteDurableRequest\"",
",",
"new",
"Object",
"[",
"]",
"{",
"MP",
",",
"subName",
",",
"userName",
",",
"remoteMEUuid",
"}",
")",
";",
"long",
"requestID",
"=",
"MP",
".",
"nextTick",
"(",
")",
";",
"ControlMessage",
"msg",
"=",
"createDurableDeleteDurable",
"(",
"MP",
",",
"subName",
",",
"userName",
",",
"requestID",
",",
"remoteMEUuid",
")",
";",
"Object",
"result",
"=",
"issueRequest",
"(",
"MP",
",",
"msg",
",",
"remoteMEUuid",
",",
"DELETEDURABLE_RETRY_TIMEOUT",
",",
"-",
"1",
",",
"// 219870: retry forever, otherwise use DELETEDURABLE_NUMTRIES,",
"requestID",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"issueDeleteDurableRequest\"",
",",
"\"SIResourceException\"",
")",
";",
"// Timeout, throw a general error",
"throw",
"new",
"SIResourceException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"REMOTE_DURABLE_TIMEOUT_ERROR_CWSIP0631\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"delete\"",
",",
"subName",
",",
"remoteMEUuid",
"}",
",",
"null",
")",
")",
";",
"}",
"// Otherwise, reply should always be a ControlDurableConfirm with a status code",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"issueDeleteDurableRequest\"",
",",
"new",
"Integer",
"(",
"(",
"(",
"ControlDurableConfirm",
")",
"result",
")",
".",
"getStatus",
"(",
")",
")",
")",
";",
"return",
"(",
"(",
"ControlDurableConfirm",
")",
"result",
")",
".",
"getStatus",
"(",
")",
";",
"}"
] | Issue a DeleteDurable request for an existing remote durable subscription.
The caller is blocked until we receive a reply for this request.
@param req The state describing the request
@return One of STATUS_OK, STATUS_SUB_NOT_FOUND, or STATUS_SUB_GENERAL_ERROR | [
"Issue",
"a",
"DeleteDurable",
"request",
"for",
"an",
"existing",
"remote",
"durable",
"subscription",
".",
"The",
"caller",
"is",
"blocked",
"until",
"we",
"receive",
"a",
"reply",
"for",
"this",
"request",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableInputHandler.java#L802-L839 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableInputHandler.java | DurableInputHandler.internalAlarmHandler | protected static void internalAlarmHandler(Object arg)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "internalAlarmHandler", arg);
ResendRecord record = (ResendRecord) arg;
synchronized (_requestMap)
{
Long key = new Long(record.requestID);
if (_requestMap.containsKey(key))
{
// Someone still waiting for the request, figure out what to do about it
if (record.triesRemaining != 0)
{
// We have tries remaining so resend
// Short circuit if ME unreachable
if (!record.MP.getMPIO().isMEReachable(record.targetUuid))
wakeupWaiter(record.requestID, null);
record.MP.getMPIO().sendToMe(record.targetUuid, SIMPConstants.CONTROL_MESSAGE_PRIORITY, record.msg);
// 219870: use triesRemaining < 0 to try forever
if (record.triesRemaining > 0)
record.triesRemaining--;
record.MP.getAlarmManager().create(record.resendInterval, _alarmHandler, record);
}
else
{
// Wakeup the waiter with a timeout error
wakeupWaiter(record.requestID, null);
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "internalAlarmHandler");
} | java | protected static void internalAlarmHandler(Object arg)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "internalAlarmHandler", arg);
ResendRecord record = (ResendRecord) arg;
synchronized (_requestMap)
{
Long key = new Long(record.requestID);
if (_requestMap.containsKey(key))
{
// Someone still waiting for the request, figure out what to do about it
if (record.triesRemaining != 0)
{
// We have tries remaining so resend
// Short circuit if ME unreachable
if (!record.MP.getMPIO().isMEReachable(record.targetUuid))
wakeupWaiter(record.requestID, null);
record.MP.getMPIO().sendToMe(record.targetUuid, SIMPConstants.CONTROL_MESSAGE_PRIORITY, record.msg);
// 219870: use triesRemaining < 0 to try forever
if (record.triesRemaining > 0)
record.triesRemaining--;
record.MP.getAlarmManager().create(record.resendInterval, _alarmHandler, record);
}
else
{
// Wakeup the waiter with a timeout error
wakeupWaiter(record.requestID, null);
}
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "internalAlarmHandler");
} | [
"protected",
"static",
"void",
"internalAlarmHandler",
"(",
"Object",
"arg",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"internalAlarmHandler\"",
",",
"arg",
")",
";",
"ResendRecord",
"record",
"=",
"(",
"ResendRecord",
")",
"arg",
";",
"synchronized",
"(",
"_requestMap",
")",
"{",
"Long",
"key",
"=",
"new",
"Long",
"(",
"record",
".",
"requestID",
")",
";",
"if",
"(",
"_requestMap",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"// Someone still waiting for the request, figure out what to do about it",
"if",
"(",
"record",
".",
"triesRemaining",
"!=",
"0",
")",
"{",
"// We have tries remaining so resend",
"// Short circuit if ME unreachable",
"if",
"(",
"!",
"record",
".",
"MP",
".",
"getMPIO",
"(",
")",
".",
"isMEReachable",
"(",
"record",
".",
"targetUuid",
")",
")",
"wakeupWaiter",
"(",
"record",
".",
"requestID",
",",
"null",
")",
";",
"record",
".",
"MP",
".",
"getMPIO",
"(",
")",
".",
"sendToMe",
"(",
"record",
".",
"targetUuid",
",",
"SIMPConstants",
".",
"CONTROL_MESSAGE_PRIORITY",
",",
"record",
".",
"msg",
")",
";",
"// 219870: use triesRemaining < 0 to try forever",
"if",
"(",
"record",
".",
"triesRemaining",
">",
"0",
")",
"record",
".",
"triesRemaining",
"--",
";",
"record",
".",
"MP",
".",
"getAlarmManager",
"(",
")",
".",
"create",
"(",
"record",
".",
"resendInterval",
",",
"_alarmHandler",
",",
"record",
")",
";",
"}",
"else",
"{",
"// Wakeup the waiter with a timeout error",
"wakeupWaiter",
"(",
"record",
".",
"requestID",
",",
"null",
")",
";",
"}",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"internalAlarmHandler\"",
")",
";",
"}"
] | Process a retry alarm.
@param arg This should be an instance of ResendRecord indicating
how we should retry the request. | [
"Process",
"a",
"retry",
"alarm",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableInputHandler.java#L851-L887 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableInputHandler.java | DurableInputHandler.createRemoteDurableSubscription | public static void createRemoteDurableSubscription(
MessageProcessor MP,
ConsumerDispatcherState subState,
SIBUuid8 remoteMEUuid,
SIBUuid12 destinationID)
throws SIDurableSubscriptionAlreadyExistsException,
SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "createRemoteDurableSubscription", new Object[] { MP, subState, remoteMEUuid, destinationID });
// Issue the request via the DurableInputHandler
int status = issueCreateDurableRequest(MP, subState, remoteMEUuid, destinationID);
switch (status)
{
case DurableConstants.STATUS_SUB_ALREADY_EXISTS:
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "createRemoteDurableSubscription", "SIDurableSubscriptionAlreadyExistsException");
throw new SIDurableSubscriptionAlreadyExistsException(
nls.getFormattedMessage(
"SUBSCRIPTION_ALREADY_EXISTS_ERROR_CWSIP0143",
new Object[] {subState.getSubscriberID(),
subState.getDurableHome()},
null));
}
case DurableConstants.STATUS_SUB_GENERAL_ERROR:
{
// Problem on other side which should be logged, best we
// can do is throw an exception here.
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "createRemoteDurableSubscription", "SIErrorException");
SibTr.error(tc,"INTERNAL_MESSAGING_ERROR_CWSIP0001",
new Object[] {
"com.ibm.ws.sib.processor.impl.DurableInputHandler",
"1:955:1.52.1.1" });
throw new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0001",
new Object[] {
"com.ibm.ws.sib.processor.impl.DurableInputHandler",
"1:962:1.52.1.1" },
null));
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "createRemoteDurableSubscription");
} | java | public static void createRemoteDurableSubscription(
MessageProcessor MP,
ConsumerDispatcherState subState,
SIBUuid8 remoteMEUuid,
SIBUuid12 destinationID)
throws SIDurableSubscriptionAlreadyExistsException,
SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "createRemoteDurableSubscription", new Object[] { MP, subState, remoteMEUuid, destinationID });
// Issue the request via the DurableInputHandler
int status = issueCreateDurableRequest(MP, subState, remoteMEUuid, destinationID);
switch (status)
{
case DurableConstants.STATUS_SUB_ALREADY_EXISTS:
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "createRemoteDurableSubscription", "SIDurableSubscriptionAlreadyExistsException");
throw new SIDurableSubscriptionAlreadyExistsException(
nls.getFormattedMessage(
"SUBSCRIPTION_ALREADY_EXISTS_ERROR_CWSIP0143",
new Object[] {subState.getSubscriberID(),
subState.getDurableHome()},
null));
}
case DurableConstants.STATUS_SUB_GENERAL_ERROR:
{
// Problem on other side which should be logged, best we
// can do is throw an exception here.
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "createRemoteDurableSubscription", "SIErrorException");
SibTr.error(tc,"INTERNAL_MESSAGING_ERROR_CWSIP0001",
new Object[] {
"com.ibm.ws.sib.processor.impl.DurableInputHandler",
"1:955:1.52.1.1" });
throw new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0001",
new Object[] {
"com.ibm.ws.sib.processor.impl.DurableInputHandler",
"1:962:1.52.1.1" },
null));
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "createRemoteDurableSubscription");
} | [
"public",
"static",
"void",
"createRemoteDurableSubscription",
"(",
"MessageProcessor",
"MP",
",",
"ConsumerDispatcherState",
"subState",
",",
"SIBUuid8",
"remoteMEUuid",
",",
"SIBUuid12",
"destinationID",
")",
"throws",
"SIDurableSubscriptionAlreadyExistsException",
",",
"SIResourceException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"createRemoteDurableSubscription\"",
",",
"new",
"Object",
"[",
"]",
"{",
"MP",
",",
"subState",
",",
"remoteMEUuid",
",",
"destinationID",
"}",
")",
";",
"// Issue the request via the DurableInputHandler",
"int",
"status",
"=",
"issueCreateDurableRequest",
"(",
"MP",
",",
"subState",
",",
"remoteMEUuid",
",",
"destinationID",
")",
";",
"switch",
"(",
"status",
")",
"{",
"case",
"DurableConstants",
".",
"STATUS_SUB_ALREADY_EXISTS",
":",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"createRemoteDurableSubscription\"",
",",
"\"SIDurableSubscriptionAlreadyExistsException\"",
")",
";",
"throw",
"new",
"SIDurableSubscriptionAlreadyExistsException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"SUBSCRIPTION_ALREADY_EXISTS_ERROR_CWSIP0143\"",
",",
"new",
"Object",
"[",
"]",
"{",
"subState",
".",
"getSubscriberID",
"(",
")",
",",
"subState",
".",
"getDurableHome",
"(",
")",
"}",
",",
"null",
")",
")",
";",
"}",
"case",
"DurableConstants",
".",
"STATUS_SUB_GENERAL_ERROR",
":",
"{",
"// Problem on other side which should be logged, best we ",
"// can do is throw an exception here.",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"createRemoteDurableSubscription\"",
",",
"\"SIErrorException\"",
")",
";",
"SibTr",
".",
"error",
"(",
"tc",
",",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0001\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.impl.DurableInputHandler\"",
",",
"\"1:955:1.52.1.1\"",
"}",
")",
";",
"throw",
"new",
"SIErrorException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0001\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.impl.DurableInputHandler\"",
",",
"\"1:962:1.52.1.1\"",
"}",
",",
"null",
")",
")",
";",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"createRemoteDurableSubscription\"",
")",
";",
"}"
] | Attempt to create a durable subscription on a remote ME.
@param MP The MessageProcessor.
@param subState State describing the subscription to create.
@param remoteME The ME where the subscription should be created. | [
"Attempt",
"to",
"create",
"a",
"durable",
"subscription",
"on",
"a",
"remote",
"ME",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableInputHandler.java#L896-L947 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableInputHandler.java | DurableInputHandler.deleteRemoteDurableSub | public static void deleteRemoteDurableSub(
MessageProcessor MP,
String subName,
String userName,
SIBUuid8 remoteMEUuid)
throws SIResourceException,
SIDurableSubscriptionNotFoundException,
SIDestinationLockedException,
SINotAuthorizedException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "deleteRemoteDurableSub",
new Object[]{MP, subName, userName, remoteMEUuid});
// Issue the request
int status = issueDeleteDurableRequest(MP, subName, userName, remoteMEUuid);
switch (status)
{
case DurableConstants.STATUS_SUB_NOT_FOUND:
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "deleteRemoteDurableSub", "SIDurableSubscriptionNotFoundException");
throw new SIDurableSubscriptionNotFoundException(
nls.getFormattedMessage(
"SUBSCRIPTION_DOESNT_EXIST_ERROR_CWSIP0072",
new Object[] { subName,
remoteMEUuid },
null));
}
case DurableConstants.STATUS_SUB_CARDINALITY_ERROR:
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "deleteRemoteDurableSub", "SIDurableSubscriptionLockedException");
throw new SIDestinationLockedException(
nls.getFormattedMessage(
"SUBSCRIPTION_IN_USE_ERROR_CWSIP0152",
new Object[] { subName,
remoteMEUuid },
null));
}
case DurableConstants.STATUS_NOT_AUTH_ERROR:
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "deleteRemoteDurableSub", "SINotAuthorizedException");
throw new SINotAuthorizedException(
nls.getFormattedMessage(
"USER_NOT_AUTH_DELETE_ERROR_CWSIP0311",
new Object[] { userName, subName, null},
null));
}
case DurableConstants.STATUS_SIB_LOCKED_ERROR:
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "deleteRemoteDurableSub", "SIDestinationLockedException");
throw new SIDestinationLockedException(
nls.getFormattedMessage(
"SUBSCRIPTION_IN_USE_ERROR_CWSIP0153",
new Object[] { subName,
remoteMEUuid },
null));
}
case DurableConstants.STATUS_SUB_GENERAL_ERROR:
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "deleteRemoteDurableSub", "SIResourceException");
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0001",
new Object[] {
"com.ibm.ws.sib.processor.impl.DurableInputHandler",
"1:1053:1.52.1.1" });
throw new SIResourceException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0001",
new Object[] {
"com.ibm.ws.sib.processor.impl.DurableInputHandler",
"1:1060:1.52.1.1" },
null));
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "deleteRemoteDurableSub");
} | java | public static void deleteRemoteDurableSub(
MessageProcessor MP,
String subName,
String userName,
SIBUuid8 remoteMEUuid)
throws SIResourceException,
SIDurableSubscriptionNotFoundException,
SIDestinationLockedException,
SINotAuthorizedException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "deleteRemoteDurableSub",
new Object[]{MP, subName, userName, remoteMEUuid});
// Issue the request
int status = issueDeleteDurableRequest(MP, subName, userName, remoteMEUuid);
switch (status)
{
case DurableConstants.STATUS_SUB_NOT_FOUND:
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "deleteRemoteDurableSub", "SIDurableSubscriptionNotFoundException");
throw new SIDurableSubscriptionNotFoundException(
nls.getFormattedMessage(
"SUBSCRIPTION_DOESNT_EXIST_ERROR_CWSIP0072",
new Object[] { subName,
remoteMEUuid },
null));
}
case DurableConstants.STATUS_SUB_CARDINALITY_ERROR:
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "deleteRemoteDurableSub", "SIDurableSubscriptionLockedException");
throw new SIDestinationLockedException(
nls.getFormattedMessage(
"SUBSCRIPTION_IN_USE_ERROR_CWSIP0152",
new Object[] { subName,
remoteMEUuid },
null));
}
case DurableConstants.STATUS_NOT_AUTH_ERROR:
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "deleteRemoteDurableSub", "SINotAuthorizedException");
throw new SINotAuthorizedException(
nls.getFormattedMessage(
"USER_NOT_AUTH_DELETE_ERROR_CWSIP0311",
new Object[] { userName, subName, null},
null));
}
case DurableConstants.STATUS_SIB_LOCKED_ERROR:
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "deleteRemoteDurableSub", "SIDestinationLockedException");
throw new SIDestinationLockedException(
nls.getFormattedMessage(
"SUBSCRIPTION_IN_USE_ERROR_CWSIP0153",
new Object[] { subName,
remoteMEUuid },
null));
}
case DurableConstants.STATUS_SUB_GENERAL_ERROR:
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "deleteRemoteDurableSub", "SIResourceException");
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0001",
new Object[] {
"com.ibm.ws.sib.processor.impl.DurableInputHandler",
"1:1053:1.52.1.1" });
throw new SIResourceException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0001",
new Object[] {
"com.ibm.ws.sib.processor.impl.DurableInputHandler",
"1:1060:1.52.1.1" },
null));
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "deleteRemoteDurableSub");
} | [
"public",
"static",
"void",
"deleteRemoteDurableSub",
"(",
"MessageProcessor",
"MP",
",",
"String",
"subName",
",",
"String",
"userName",
",",
"SIBUuid8",
"remoteMEUuid",
")",
"throws",
"SIResourceException",
",",
"SIDurableSubscriptionNotFoundException",
",",
"SIDestinationLockedException",
",",
"SINotAuthorizedException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"deleteRemoteDurableSub\"",
",",
"new",
"Object",
"[",
"]",
"{",
"MP",
",",
"subName",
",",
"userName",
",",
"remoteMEUuid",
"}",
")",
";",
"// Issue the request",
"int",
"status",
"=",
"issueDeleteDurableRequest",
"(",
"MP",
",",
"subName",
",",
"userName",
",",
"remoteMEUuid",
")",
";",
"switch",
"(",
"status",
")",
"{",
"case",
"DurableConstants",
".",
"STATUS_SUB_NOT_FOUND",
":",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"deleteRemoteDurableSub\"",
",",
"\"SIDurableSubscriptionNotFoundException\"",
")",
";",
"throw",
"new",
"SIDurableSubscriptionNotFoundException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"SUBSCRIPTION_DOESNT_EXIST_ERROR_CWSIP0072\"",
",",
"new",
"Object",
"[",
"]",
"{",
"subName",
",",
"remoteMEUuid",
"}",
",",
"null",
")",
")",
";",
"}",
"case",
"DurableConstants",
".",
"STATUS_SUB_CARDINALITY_ERROR",
":",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"deleteRemoteDurableSub\"",
",",
"\"SIDurableSubscriptionLockedException\"",
")",
";",
"throw",
"new",
"SIDestinationLockedException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"SUBSCRIPTION_IN_USE_ERROR_CWSIP0152\"",
",",
"new",
"Object",
"[",
"]",
"{",
"subName",
",",
"remoteMEUuid",
"}",
",",
"null",
")",
")",
";",
"}",
"case",
"DurableConstants",
".",
"STATUS_NOT_AUTH_ERROR",
":",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"deleteRemoteDurableSub\"",
",",
"\"SINotAuthorizedException\"",
")",
";",
"throw",
"new",
"SINotAuthorizedException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"USER_NOT_AUTH_DELETE_ERROR_CWSIP0311\"",
",",
"new",
"Object",
"[",
"]",
"{",
"userName",
",",
"subName",
",",
"null",
"}",
",",
"null",
")",
")",
";",
"}",
"case",
"DurableConstants",
".",
"STATUS_SIB_LOCKED_ERROR",
":",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"deleteRemoteDurableSub\"",
",",
"\"SIDestinationLockedException\"",
")",
";",
"throw",
"new",
"SIDestinationLockedException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"SUBSCRIPTION_IN_USE_ERROR_CWSIP0153\"",
",",
"new",
"Object",
"[",
"]",
"{",
"subName",
",",
"remoteMEUuid",
"}",
",",
"null",
")",
")",
";",
"}",
"case",
"DurableConstants",
".",
"STATUS_SUB_GENERAL_ERROR",
":",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"deleteRemoteDurableSub\"",
",",
"\"SIResourceException\"",
")",
";",
"SibTr",
".",
"error",
"(",
"tc",
",",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0001\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.impl.DurableInputHandler\"",
",",
"\"1:1053:1.52.1.1\"",
"}",
")",
";",
"throw",
"new",
"SIResourceException",
"(",
"nls",
".",
"getFormattedMessage",
"(",
"\"INTERNAL_MESSAGING_ERROR_CWSIP0001\"",
",",
"new",
"Object",
"[",
"]",
"{",
"\"com.ibm.ws.sib.processor.impl.DurableInputHandler\"",
",",
"\"1:1060:1.52.1.1\"",
"}",
",",
"null",
")",
")",
";",
"}",
"}",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"deleteRemoteDurableSub\"",
")",
";",
"}"
] | Attempt to delete a durable subscription on a remote ME. | [
"Attempt",
"to",
"delete",
"a",
"durable",
"subscription",
"on",
"a",
"remote",
"ME",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableInputHandler.java#L953-L1046 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.authentication.builtin/src/com/ibm/ws/security/authentication/internal/jaas/JAASServiceImpl.java | JAASServiceImpl.performLogin | @Override
public Subject performLogin(String jaasEntryName, CallbackHandler callbackHandler, Subject partialSubject) throws LoginException {
LoginContext loginContext = null;
loginContext = doLoginContext(jaasEntryName, callbackHandler, partialSubject);
return (loginContext == null ? null : loginContext.getSubject());
} | java | @Override
public Subject performLogin(String jaasEntryName, CallbackHandler callbackHandler, Subject partialSubject) throws LoginException {
LoginContext loginContext = null;
loginContext = doLoginContext(jaasEntryName, callbackHandler, partialSubject);
return (loginContext == null ? null : loginContext.getSubject());
} | [
"@",
"Override",
"public",
"Subject",
"performLogin",
"(",
"String",
"jaasEntryName",
",",
"CallbackHandler",
"callbackHandler",
",",
"Subject",
"partialSubject",
")",
"throws",
"LoginException",
"{",
"LoginContext",
"loginContext",
"=",
"null",
";",
"loginContext",
"=",
"doLoginContext",
"(",
"jaasEntryName",
",",
"callbackHandler",
",",
"partialSubject",
")",
";",
"return",
"(",
"loginContext",
"==",
"null",
"?",
"null",
":",
"loginContext",
".",
"getSubject",
"(",
")",
")",
";",
"}"
] | Performs a JAAS login.
@param jaasEntryName
@param callbackHandler
@param partialSubject
@return the authenticated subject.
@throws javax.security.auth.login.LoginException | [
"Performs",
"a",
"JAAS",
"login",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.authentication.builtin/src/com/ibm/ws/security/authentication/internal/jaas/JAASServiceImpl.java#L326-L331 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.authentication.builtin/src/com/ibm/ws/security/authentication/internal/jaas/JAASServiceImpl.java | JAASServiceImpl.configReady | public void configReady() {
if (authenticationService != null) {
JAASChangeNotifier notifier = jaasChangeNotifierService.getService();
if (notifier != null) {
notifier.notifyListeners();
}
}
} | java | public void configReady() {
if (authenticationService != null) {
JAASChangeNotifier notifier = jaasChangeNotifierService.getService();
if (notifier != null) {
notifier.notifyListeners();
}
}
} | [
"public",
"void",
"configReady",
"(",
")",
"{",
"if",
"(",
"authenticationService",
"!=",
"null",
")",
"{",
"JAASChangeNotifier",
"notifier",
"=",
"jaasChangeNotifierService",
".",
"getService",
"(",
")",
";",
"if",
"(",
"notifier",
"!=",
"null",
")",
"{",
"notifier",
".",
"notifyListeners",
"(",
")",
";",
"}",
"}",
"}"
] | Notify interested parties that the configuration was changed only if the authentication service
is already up and running. | [
"Notify",
"interested",
"parties",
"that",
"the",
"configuration",
"was",
"changed",
"only",
"if",
"the",
"authentication",
"service",
"is",
"already",
"up",
"and",
"running",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.authentication.builtin/src/com/ibm/ws/security/authentication/internal/jaas/JAASServiceImpl.java#L365-L372 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.session/src/com/ibm/ws/webcontainer/httpsession/SessionMgrCoordinator.java | SessionMgrCoordinator.deactivate | protected void deactivate(ComponentContext context) {
if (TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINER)) {
LoggingUtil.SESSION_LOGGER_CORE.entering(CLASS_NAME, "deactivate", context);
}
this.unregisterSessionManager(); // we won't restart applications in this case, so assume someone else stops them
if (TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINER)) {
LoggingUtil.SESSION_LOGGER_CORE.exiting(CLASS_NAME, "deactivate");
}
} | java | protected void deactivate(ComponentContext context) {
if (TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINER)) {
LoggingUtil.SESSION_LOGGER_CORE.entering(CLASS_NAME, "deactivate", context);
}
this.unregisterSessionManager(); // we won't restart applications in this case, so assume someone else stops them
if (TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINER)) {
LoggingUtil.SESSION_LOGGER_CORE.exiting(CLASS_NAME, "deactivate");
}
} | [
"protected",
"void",
"deactivate",
"(",
"ComponentContext",
"context",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"LoggingUtil",
".",
"SESSION_LOGGER_CORE",
".",
"isLoggable",
"(",
"Level",
".",
"FINER",
")",
")",
"{",
"LoggingUtil",
".",
"SESSION_LOGGER_CORE",
".",
"entering",
"(",
"CLASS_NAME",
",",
"\"deactivate\"",
",",
"context",
")",
";",
"}",
"this",
".",
"unregisterSessionManager",
"(",
")",
";",
"// we won't restart applications in this case, so assume someone else stops them",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"LoggingUtil",
".",
"SESSION_LOGGER_CORE",
".",
"isLoggable",
"(",
"Level",
".",
"FINER",
")",
")",
"{",
"LoggingUtil",
".",
"SESSION_LOGGER_CORE",
".",
"exiting",
"(",
"CLASS_NAME",
",",
"\"deactivate\"",
")",
";",
"}",
"}"
] | Since this service is immediate and dynamic, it will not be
deactivated unless the Servlet feature is removed. When this happens,
we assume that an external feature stops applications appropariately.
The deactivate should NOT stop applications via the appRecycleService
because it will NOT be able to issue a corresponding start operation
on the appRecycleService.
@param context the context used to register the SessionManager service | [
"Since",
"this",
"service",
"is",
"immediate",
"and",
"dynamic",
"it",
"will",
"not",
"be",
"deactivated",
"unless",
"the",
"Servlet",
"feature",
"is",
"removed",
".",
"When",
"this",
"happens",
"we",
"assume",
"that",
"an",
"external",
"feature",
"stops",
"applications",
"appropariately",
".",
"The",
"deactivate",
"should",
"NOT",
"stop",
"applications",
"via",
"the",
"appRecycleService",
"because",
"it",
"will",
"NOT",
"be",
"able",
"to",
"issue",
"a",
"corresponding",
"start",
"operation",
"on",
"the",
"appRecycleService",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.session/src/com/ibm/ws/webcontainer/httpsession/SessionMgrCoordinator.java#L123-L131 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.session/src/com/ibm/ws/webcontainer/httpsession/SessionMgrCoordinator.java | SessionMgrCoordinator.setLocationService | protected void setLocationService(WsLocationAdmin wsLocationAdmin) {
if (TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINER)) {
LoggingUtil.SESSION_LOGGER_CORE.entering(CLASS_NAME, "setLocationService", wsLocationAdmin);
}
this.wsLocationAdmin = wsLocationAdmin;
if (TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINER)) {
LoggingUtil.SESSION_LOGGER_CORE.exiting(CLASS_NAME, "setLocationService");
}
} | java | protected void setLocationService(WsLocationAdmin wsLocationAdmin) {
if (TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINER)) {
LoggingUtil.SESSION_LOGGER_CORE.entering(CLASS_NAME, "setLocationService", wsLocationAdmin);
}
this.wsLocationAdmin = wsLocationAdmin;
if (TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINER)) {
LoggingUtil.SESSION_LOGGER_CORE.exiting(CLASS_NAME, "setLocationService");
}
} | [
"protected",
"void",
"setLocationService",
"(",
"WsLocationAdmin",
"wsLocationAdmin",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"LoggingUtil",
".",
"SESSION_LOGGER_CORE",
".",
"isLoggable",
"(",
"Level",
".",
"FINER",
")",
")",
"{",
"LoggingUtil",
".",
"SESSION_LOGGER_CORE",
".",
"entering",
"(",
"CLASS_NAME",
",",
"\"setLocationService\"",
",",
"wsLocationAdmin",
")",
";",
"}",
"this",
".",
"wsLocationAdmin",
"=",
"wsLocationAdmin",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"LoggingUtil",
".",
"SESSION_LOGGER_CORE",
".",
"isLoggable",
"(",
"Level",
".",
"FINER",
")",
")",
"{",
"LoggingUtil",
".",
"SESSION_LOGGER_CORE",
".",
"exiting",
"(",
"CLASS_NAME",
",",
"\"setLocationService\"",
")",
";",
"}",
"}"
] | Since the location service is only used during SessionManager initialization,
we don't need to re-register the SessionManager service or restart applications
if there's a change to the location service.
@param wsLocationAdmin the service used to determine the default session clone ID | [
"Since",
"the",
"location",
"service",
"is",
"only",
"used",
"during",
"SessionManager",
"initialization",
"we",
"don",
"t",
"need",
"to",
"re",
"-",
"register",
"the",
"SessionManager",
"service",
"or",
"restart",
"applications",
"if",
"there",
"s",
"a",
"change",
"to",
"the",
"location",
"service",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.session/src/com/ibm/ws/webcontainer/httpsession/SessionMgrCoordinator.java#L318-L326 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.session/src/com/ibm/ws/webcontainer/httpsession/SessionMgrCoordinator.java | SessionMgrCoordinator.setScheduledExecutorService | protected void setScheduledExecutorService(ScheduledExecutorService scheduledExecutorService) {
if (TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINER)) {
LoggingUtil.SESSION_LOGGER_CORE.entering(CLASS_NAME, "setScheduledExecutorService", scheduledExecutorService);
}
this.scheduledExecutorService = scheduledExecutorService;
if (TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINER)) {
LoggingUtil.SESSION_LOGGER_CORE.exiting(CLASS_NAME, "setScheduledExecutorService");
}
} | java | protected void setScheduledExecutorService(ScheduledExecutorService scheduledExecutorService) {
if (TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINER)) {
LoggingUtil.SESSION_LOGGER_CORE.entering(CLASS_NAME, "setScheduledExecutorService", scheduledExecutorService);
}
this.scheduledExecutorService = scheduledExecutorService;
if (TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINER)) {
LoggingUtil.SESSION_LOGGER_CORE.exiting(CLASS_NAME, "setScheduledExecutorService");
}
} | [
"protected",
"void",
"setScheduledExecutorService",
"(",
"ScheduledExecutorService",
"scheduledExecutorService",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"LoggingUtil",
".",
"SESSION_LOGGER_CORE",
".",
"isLoggable",
"(",
"Level",
".",
"FINER",
")",
")",
"{",
"LoggingUtil",
".",
"SESSION_LOGGER_CORE",
".",
"entering",
"(",
"CLASS_NAME",
",",
"\"setScheduledExecutorService\"",
",",
"scheduledExecutorService",
")",
";",
"}",
"this",
".",
"scheduledExecutorService",
"=",
"scheduledExecutorService",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"LoggingUtil",
".",
"SESSION_LOGGER_CORE",
".",
"isLoggable",
"(",
"Level",
".",
"FINER",
")",
")",
"{",
"LoggingUtil",
".",
"SESSION_LOGGER_CORE",
".",
"exiting",
"(",
"CLASS_NAME",
",",
"\"setScheduledExecutorService\"",
")",
";",
"}",
"}"
] | Tracing is also added for debugging purposes | [
"Tracing",
"is",
"also",
"added",
"for",
"debugging",
"purposes"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.session/src/com/ibm/ws/webcontainer/httpsession/SessionMgrCoordinator.java#L446-L454 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca.utils/src/com/ibm/ws/jca/utils/metagen/RAAnnotationProcessor.java | RAAnnotationProcessor.getProcessedConnector | public RaConnector getProcessedConnector() throws ResourceAdapterInternalException {
final boolean trace = TraceComponent.isAnyTracingEnabled();
String jcaVersion = getAdapterVersion(deploymentDescriptor);
boolean processAnno = checkProcessAnnotations(deploymentDescriptor, jcaVersion);
if (!processAnno) {
if (trace && tc.isDebugEnabled())
Tr.debug(this, tc, "Skip annotation processing and return the RaConnector that was passed in");
return deploymentDescriptor;
}
findAnnotatedClasses();
// JCA 1.6 spec
// The implementation class name of the ResourceAdapter interface is specified in
// the resource adapter deployment descriptor or through the Connector annotation
// described in Section 18.4, “@Connector” on page 18-6.
//
// It is optional for a resource adapter implementation to bundle a JavaBean class
// implementing the javax.resource.spi.ResourceAdapter interface (see
// Section 5.3.1, “ResourceAdapter JavaBean and Bootstrapping a Resource Adapter
// Instance” on page 5-4). In particular, a resource adapter implementation that only
// performs outbound communication to the EIS might not provide a JavaBean that
// implements the ResourceAdapter interface or a JavaBean annotated with the
// Connector annotation.
//
// If the descriptor has a resource adapter descriptor that has the name of the resource adapter class
// then
// If there are one or more @Connector,
// then need to verify the class is annotated by only one of them or none of them
// If no classes are annotated with @Connector, then verify the class can be loaded
// If there isn't a resource adapter class specified in the descriptor or there isn't a ra.xml,
// then verify there is only one class annotated with @Connector
//
// It is not necessary to locate a JavaBean that implements the ResourceAdapter interface.
Class<?> resourceAdapterClass = null;
if (deploymentDescriptor != null) {
RaResourceAdapter rxRA = deploymentDescriptor.getResourceAdapter();
if (rxRA != null) {
String rxAdapterClassName = rxRA.getResourceAdapterClass();
if (trace && tc.isDebugEnabled())
Tr.debug(this, tc, "rxAdapterClassName: ", rxAdapterClassName);
if (rxAdapterClassName != null) {
// look to see if this class name is in the list of classes annotated with @Connector
for (Class<?> connectorClass : connectorClasses) {
if (trace && tc.isDebugEnabled())
Tr.debug(this, tc, "connectorClass to examine: ", connectorClass);
if (rxAdapterClassName.equals(connectorClass.getName())) {
resourceAdapterClass = connectorClass;
if (trace && tc.isDebugEnabled())
Tr.debug(this, tc, "connectorClasses - resourceAdapterClass: ", resourceAdapterClass);
break;
}
} // end for ClassInfo : connectorClasses
// if an annotated class was not found, check the <resourceadapter-class> is present by loading it
if (resourceAdapterClass == null) {
try {
resourceAdapterClass = raClassLoader.loadClass(rxAdapterClassName);
if (trace && tc.isDebugEnabled())
Tr.debug(this, tc, "raClassLoader - resourceAdapterClass: ", resourceAdapterClass);
} catch (ClassNotFoundException e) {
throw new ResourceAdapterInternalException(Tr.formatMessage(tc, "J2CA9904.required.raclass.missing", rxAdapterClassName, adapterName), e);
}
} // end adapterClass == null
} else { // rxAdapterClass == null, check for class annotated with @Connector
if (trace && tc.isDebugEnabled())
Tr.debug(this, tc, "ra.xml does not contain a <resourceadapter-class> entry");
}
} else { // ra.xml does not have a <resourceadapter> entry
if (trace && tc.isDebugEnabled())
Tr.debug(this, tc, "ra.xml does not contain a <resourceadapter> entry");
}
} else {
// rar does not have a ra.xml
if (trace && tc.isDebugEnabled())
Tr.debug(this, tc, "rar does not contain a ra.xml", resourceAdapterClass);
}
// If resource adapter class was not found, do @Connector annotation validation and try to get the
// resource adapter class from there.
if (resourceAdapterClass == null) {
if (connectorClasses.size() == 0) {
if (trace && tc.isDebugEnabled()) {
Tr.debug(this, tc, "rar does not contain a class annotated with @Connector");
// throw new ResourceAdapterInternalException(Tr.formatMessage(tc, "J2CA9923.connector.anno.missing", adapterName));
}
} else if (connectorClasses.size() > 1) {
throw new ResourceAdapterInternalException(Tr.formatMessage(tc, "J2CA9922.multiple.connector.anno.found", adapterName));
} else { // there is only one annotated connectorClass
resourceAdapterClass = connectorClasses.get(0);
}
}
RaConnector connector = processConnector(resourceAdapterClass, deploymentDescriptor);
return connector;
} | java | public RaConnector getProcessedConnector() throws ResourceAdapterInternalException {
final boolean trace = TraceComponent.isAnyTracingEnabled();
String jcaVersion = getAdapterVersion(deploymentDescriptor);
boolean processAnno = checkProcessAnnotations(deploymentDescriptor, jcaVersion);
if (!processAnno) {
if (trace && tc.isDebugEnabled())
Tr.debug(this, tc, "Skip annotation processing and return the RaConnector that was passed in");
return deploymentDescriptor;
}
findAnnotatedClasses();
// JCA 1.6 spec
// The implementation class name of the ResourceAdapter interface is specified in
// the resource adapter deployment descriptor or through the Connector annotation
// described in Section 18.4, “@Connector” on page 18-6.
//
// It is optional for a resource adapter implementation to bundle a JavaBean class
// implementing the javax.resource.spi.ResourceAdapter interface (see
// Section 5.3.1, “ResourceAdapter JavaBean and Bootstrapping a Resource Adapter
// Instance” on page 5-4). In particular, a resource adapter implementation that only
// performs outbound communication to the EIS might not provide a JavaBean that
// implements the ResourceAdapter interface or a JavaBean annotated with the
// Connector annotation.
//
// If the descriptor has a resource adapter descriptor that has the name of the resource adapter class
// then
// If there are one or more @Connector,
// then need to verify the class is annotated by only one of them or none of them
// If no classes are annotated with @Connector, then verify the class can be loaded
// If there isn't a resource adapter class specified in the descriptor or there isn't a ra.xml,
// then verify there is only one class annotated with @Connector
//
// It is not necessary to locate a JavaBean that implements the ResourceAdapter interface.
Class<?> resourceAdapterClass = null;
if (deploymentDescriptor != null) {
RaResourceAdapter rxRA = deploymentDescriptor.getResourceAdapter();
if (rxRA != null) {
String rxAdapterClassName = rxRA.getResourceAdapterClass();
if (trace && tc.isDebugEnabled())
Tr.debug(this, tc, "rxAdapterClassName: ", rxAdapterClassName);
if (rxAdapterClassName != null) {
// look to see if this class name is in the list of classes annotated with @Connector
for (Class<?> connectorClass : connectorClasses) {
if (trace && tc.isDebugEnabled())
Tr.debug(this, tc, "connectorClass to examine: ", connectorClass);
if (rxAdapterClassName.equals(connectorClass.getName())) {
resourceAdapterClass = connectorClass;
if (trace && tc.isDebugEnabled())
Tr.debug(this, tc, "connectorClasses - resourceAdapterClass: ", resourceAdapterClass);
break;
}
} // end for ClassInfo : connectorClasses
// if an annotated class was not found, check the <resourceadapter-class> is present by loading it
if (resourceAdapterClass == null) {
try {
resourceAdapterClass = raClassLoader.loadClass(rxAdapterClassName);
if (trace && tc.isDebugEnabled())
Tr.debug(this, tc, "raClassLoader - resourceAdapterClass: ", resourceAdapterClass);
} catch (ClassNotFoundException e) {
throw new ResourceAdapterInternalException(Tr.formatMessage(tc, "J2CA9904.required.raclass.missing", rxAdapterClassName, adapterName), e);
}
} // end adapterClass == null
} else { // rxAdapterClass == null, check for class annotated with @Connector
if (trace && tc.isDebugEnabled())
Tr.debug(this, tc, "ra.xml does not contain a <resourceadapter-class> entry");
}
} else { // ra.xml does not have a <resourceadapter> entry
if (trace && tc.isDebugEnabled())
Tr.debug(this, tc, "ra.xml does not contain a <resourceadapter> entry");
}
} else {
// rar does not have a ra.xml
if (trace && tc.isDebugEnabled())
Tr.debug(this, tc, "rar does not contain a ra.xml", resourceAdapterClass);
}
// If resource adapter class was not found, do @Connector annotation validation and try to get the
// resource adapter class from there.
if (resourceAdapterClass == null) {
if (connectorClasses.size() == 0) {
if (trace && tc.isDebugEnabled()) {
Tr.debug(this, tc, "rar does not contain a class annotated with @Connector");
// throw new ResourceAdapterInternalException(Tr.formatMessage(tc, "J2CA9923.connector.anno.missing", adapterName));
}
} else if (connectorClasses.size() > 1) {
throw new ResourceAdapterInternalException(Tr.formatMessage(tc, "J2CA9922.multiple.connector.anno.found", adapterName));
} else { // there is only one annotated connectorClass
resourceAdapterClass = connectorClasses.get(0);
}
}
RaConnector connector = processConnector(resourceAdapterClass, deploymentDescriptor);
return connector;
} | [
"public",
"RaConnector",
"getProcessedConnector",
"(",
")",
"throws",
"ResourceAdapterInternalException",
"{",
"final",
"boolean",
"trace",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"String",
"jcaVersion",
"=",
"getAdapterVersion",
"(",
"deploymentDescriptor",
")",
";",
"boolean",
"processAnno",
"=",
"checkProcessAnnotations",
"(",
"deploymentDescriptor",
",",
"jcaVersion",
")",
";",
"if",
"(",
"!",
"processAnno",
")",
"{",
"if",
"(",
"trace",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"Skip annotation processing and return the RaConnector that was passed in\"",
")",
";",
"return",
"deploymentDescriptor",
";",
"}",
"findAnnotatedClasses",
"(",
")",
";",
"// JCA 1.6 spec",
"// The implementation class name of the ResourceAdapter interface is specified in",
"// the resource adapter deployment descriptor or through the Connector annotation",
"// described in Section 18.4, “@Connector” on page 18-6.",
"//",
"// It is optional for a resource adapter implementation to bundle a JavaBean class",
"// implementing the javax.resource.spi.ResourceAdapter interface (see",
"// Section 5.3.1, “ResourceAdapter JavaBean and Bootstrapping a Resource Adapter",
"// Instance” on page 5-4). In particular, a resource adapter implementation that only",
"// performs outbound communication to the EIS might not provide a JavaBean that",
"// implements the ResourceAdapter interface or a JavaBean annotated with the",
"// Connector annotation.",
"//",
"// If the descriptor has a resource adapter descriptor that has the name of the resource adapter class",
"// then ",
"// If there are one or more @Connector, ",
"// then need to verify the class is annotated by only one of them or none of them",
"// If no classes are annotated with @Connector, then verify the class can be loaded",
"// If there isn't a resource adapter class specified in the descriptor or there isn't a ra.xml, ",
"// then verify there is only one class annotated with @Connector",
"// ",
"// It is not necessary to locate a JavaBean that implements the ResourceAdapter interface.",
"Class",
"<",
"?",
">",
"resourceAdapterClass",
"=",
"null",
";",
"if",
"(",
"deploymentDescriptor",
"!=",
"null",
")",
"{",
"RaResourceAdapter",
"rxRA",
"=",
"deploymentDescriptor",
".",
"getResourceAdapter",
"(",
")",
";",
"if",
"(",
"rxRA",
"!=",
"null",
")",
"{",
"String",
"rxAdapterClassName",
"=",
"rxRA",
".",
"getResourceAdapterClass",
"(",
")",
";",
"if",
"(",
"trace",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"rxAdapterClassName: \"",
",",
"rxAdapterClassName",
")",
";",
"if",
"(",
"rxAdapterClassName",
"!=",
"null",
")",
"{",
"// look to see if this class name is in the list of classes annotated with @Connector",
"for",
"(",
"Class",
"<",
"?",
">",
"connectorClass",
":",
"connectorClasses",
")",
"{",
"if",
"(",
"trace",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"connectorClass to examine: \"",
",",
"connectorClass",
")",
";",
"if",
"(",
"rxAdapterClassName",
".",
"equals",
"(",
"connectorClass",
".",
"getName",
"(",
")",
")",
")",
"{",
"resourceAdapterClass",
"=",
"connectorClass",
";",
"if",
"(",
"trace",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"connectorClasses - resourceAdapterClass: \"",
",",
"resourceAdapterClass",
")",
";",
"break",
";",
"}",
"}",
"// end for ClassInfo : connectorClasses",
"// if an annotated class was not found, check the <resourceadapter-class> is present by loading it",
"if",
"(",
"resourceAdapterClass",
"==",
"null",
")",
"{",
"try",
"{",
"resourceAdapterClass",
"=",
"raClassLoader",
".",
"loadClass",
"(",
"rxAdapterClassName",
")",
";",
"if",
"(",
"trace",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"raClassLoader - resourceAdapterClass: \"",
",",
"resourceAdapterClass",
")",
";",
"}",
"catch",
"(",
"ClassNotFoundException",
"e",
")",
"{",
"throw",
"new",
"ResourceAdapterInternalException",
"(",
"Tr",
".",
"formatMessage",
"(",
"tc",
",",
"\"J2CA9904.required.raclass.missing\"",
",",
"rxAdapterClassName",
",",
"adapterName",
")",
",",
"e",
")",
";",
"}",
"}",
"// end adapterClass == null",
"}",
"else",
"{",
"// rxAdapterClass == null, check for class annotated with @Connector",
"if",
"(",
"trace",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"ra.xml does not contain a <resourceadapter-class> entry\"",
")",
";",
"}",
"}",
"else",
"{",
"// ra.xml does not have a <resourceadapter> entry",
"if",
"(",
"trace",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"ra.xml does not contain a <resourceadapter> entry\"",
")",
";",
"}",
"}",
"else",
"{",
"// rar does not have a ra.xml",
"if",
"(",
"trace",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"rar does not contain a ra.xml\"",
",",
"resourceAdapterClass",
")",
";",
"}",
"// If resource adapter class was not found, do @Connector annotation validation and try to get the",
"// resource adapter class from there.",
"if",
"(",
"resourceAdapterClass",
"==",
"null",
")",
"{",
"if",
"(",
"connectorClasses",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"if",
"(",
"trace",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"Tr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"rar does not contain a class annotated with @Connector\"",
")",
";",
"// throw new ResourceAdapterInternalException(Tr.formatMessage(tc, \"J2CA9923.connector.anno.missing\", adapterName));",
"}",
"}",
"else",
"if",
"(",
"connectorClasses",
".",
"size",
"(",
")",
">",
"1",
")",
"{",
"throw",
"new",
"ResourceAdapterInternalException",
"(",
"Tr",
".",
"formatMessage",
"(",
"tc",
",",
"\"J2CA9922.multiple.connector.anno.found\"",
",",
"adapterName",
")",
")",
";",
"}",
"else",
"{",
"// there is only one annotated connectorClass",
"resourceAdapterClass",
"=",
"connectorClasses",
".",
"get",
"(",
"0",
")",
";",
"}",
"}",
"RaConnector",
"connector",
"=",
"processConnector",
"(",
"resourceAdapterClass",
",",
"deploymentDescriptor",
")",
";",
"return",
"connector",
";",
"}"
] | Create a RaConnector xml object and all its associated xml objects
that represents the combined ra.xml, wlp-ra.xml, and annotations, if any
that are present in the rar file.
@return RaConnector that represents the resource adapter instance
@throws ResourceAdapterInternalException if any JCA spec violations are detected | [
"Create",
"a",
"RaConnector",
"xml",
"object",
"and",
"all",
"its",
"associated",
"xml",
"objects",
"that",
"represents",
"the",
"combined",
"ra",
".",
"xml",
"wlp",
"-",
"ra",
".",
"xml",
"and",
"annotations",
"if",
"any",
"that",
"are",
"present",
"in",
"the",
"rar",
"file",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.utils/src/com/ibm/ws/jca/utils/metagen/RAAnnotationProcessor.java#L183-L282 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca.utils/src/com/ibm/ws/jca/utils/metagen/RAAnnotationProcessor.java | RAAnnotationProcessor.mergeConfigProperties | @SuppressWarnings("unchecked")
private List<RaConfigProperty> mergeConfigProperties(List<RaConfigProperty> rxConfigProperties, List<RaConfigProperty> annotatedConfigProperties) {
final boolean trace = TraceComponent.isAnyTracingEnabled();
LinkedList<RaConfigProperty> configProperties = new LinkedList<RaConfigProperty>();
List<RaConfigProperty> annoConfigProperties = null;
if (annotatedConfigProperties != null)
annoConfigProperties = (List<RaConfigProperty>) ((LinkedList<RaConfigProperty>) annotatedConfigProperties).clone();
else
annoConfigProperties = new LinkedList<RaConfigProperty>();
if (trace && tc.isDebugEnabled())
Tr.debug(this, tc,
"rxConfigProperties size: " + rxConfigProperties.size());
for (RaConfigProperty rxConfigProp : rxConfigProperties) {
RaConfigProperty annoConfigProp = null;
if (annoConfigProperties.isEmpty()) {
return (List<RaConfigProperty>) ((LinkedList<RaConfigProperty>) rxConfigProperties).clone();
} else {
for (RaConfigProperty configProp : annoConfigProperties)
if (isEqual(rxConfigProp.getName(), configProp.getName())) {
annoConfigProp = configProp;
break;
}
if (annoConfigProp != null) {
if (trace && tc.isDebugEnabled())
Tr.debug(this, tc, "merging " + rxConfigProp + ", " + annoConfigProp);
// remove the config property from the list so we know at the end if there
// are any additional annotated-only config properties that we need to copy
// into the master
annoConfigProperties.remove(annoConfigProp);
// merge the two config properties
if (rxConfigProp.getConfidential() == null)
rxConfigProp.setConfidential(annoConfigProp.getConfidential());
if (rxConfigProp.getDescription() == null || rxConfigProp.getDescription().isEmpty())
rxConfigProp.setDescription(annoConfigProp.getDescription());
if (rxConfigProp.getIgnore() == null)
rxConfigProp.setIgnore(annoConfigProp.getIgnore());
if (rxConfigProp.getSupportsDynamicUpdates() == null)
rxConfigProp.setSupportsDynamicUpdates(annoConfigProp.getSupportsDynamicUpdates());
if (rxConfigProp.getType() == null || rxConfigProp.getType().equals(""))
rxConfigProp.setType(annoConfigProp.getType());
if (rxConfigProp.getDefault() == null || rxConfigProp.getDefault().equals(""))
rxConfigProp.setDefault(annoConfigProp.getDefault());
configProperties.add(rxConfigProp);
} else {
configProperties.add(rxConfigProp);
}
}
}
if (!annoConfigProperties.isEmpty()) {
// there are annotated config properties that do not exist already in the ra.xml,
// thus add them to the master
for (RaConfigProperty configProp : annoConfigProperties)
configProperties.add(configProp);
}
return configProperties;
} | java | @SuppressWarnings("unchecked")
private List<RaConfigProperty> mergeConfigProperties(List<RaConfigProperty> rxConfigProperties, List<RaConfigProperty> annotatedConfigProperties) {
final boolean trace = TraceComponent.isAnyTracingEnabled();
LinkedList<RaConfigProperty> configProperties = new LinkedList<RaConfigProperty>();
List<RaConfigProperty> annoConfigProperties = null;
if (annotatedConfigProperties != null)
annoConfigProperties = (List<RaConfigProperty>) ((LinkedList<RaConfigProperty>) annotatedConfigProperties).clone();
else
annoConfigProperties = new LinkedList<RaConfigProperty>();
if (trace && tc.isDebugEnabled())
Tr.debug(this, tc,
"rxConfigProperties size: " + rxConfigProperties.size());
for (RaConfigProperty rxConfigProp : rxConfigProperties) {
RaConfigProperty annoConfigProp = null;
if (annoConfigProperties.isEmpty()) {
return (List<RaConfigProperty>) ((LinkedList<RaConfigProperty>) rxConfigProperties).clone();
} else {
for (RaConfigProperty configProp : annoConfigProperties)
if (isEqual(rxConfigProp.getName(), configProp.getName())) {
annoConfigProp = configProp;
break;
}
if (annoConfigProp != null) {
if (trace && tc.isDebugEnabled())
Tr.debug(this, tc, "merging " + rxConfigProp + ", " + annoConfigProp);
// remove the config property from the list so we know at the end if there
// are any additional annotated-only config properties that we need to copy
// into the master
annoConfigProperties.remove(annoConfigProp);
// merge the two config properties
if (rxConfigProp.getConfidential() == null)
rxConfigProp.setConfidential(annoConfigProp.getConfidential());
if (rxConfigProp.getDescription() == null || rxConfigProp.getDescription().isEmpty())
rxConfigProp.setDescription(annoConfigProp.getDescription());
if (rxConfigProp.getIgnore() == null)
rxConfigProp.setIgnore(annoConfigProp.getIgnore());
if (rxConfigProp.getSupportsDynamicUpdates() == null)
rxConfigProp.setSupportsDynamicUpdates(annoConfigProp.getSupportsDynamicUpdates());
if (rxConfigProp.getType() == null || rxConfigProp.getType().equals(""))
rxConfigProp.setType(annoConfigProp.getType());
if (rxConfigProp.getDefault() == null || rxConfigProp.getDefault().equals(""))
rxConfigProp.setDefault(annoConfigProp.getDefault());
configProperties.add(rxConfigProp);
} else {
configProperties.add(rxConfigProp);
}
}
}
if (!annoConfigProperties.isEmpty()) {
// there are annotated config properties that do not exist already in the ra.xml,
// thus add them to the master
for (RaConfigProperty configProp : annoConfigProperties)
configProperties.add(configProp);
}
return configProperties;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"List",
"<",
"RaConfigProperty",
">",
"mergeConfigProperties",
"(",
"List",
"<",
"RaConfigProperty",
">",
"rxConfigProperties",
",",
"List",
"<",
"RaConfigProperty",
">",
"annotatedConfigProperties",
")",
"{",
"final",
"boolean",
"trace",
"=",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
";",
"LinkedList",
"<",
"RaConfigProperty",
">",
"configProperties",
"=",
"new",
"LinkedList",
"<",
"RaConfigProperty",
">",
"(",
")",
";",
"List",
"<",
"RaConfigProperty",
">",
"annoConfigProperties",
"=",
"null",
";",
"if",
"(",
"annotatedConfigProperties",
"!=",
"null",
")",
"annoConfigProperties",
"=",
"(",
"List",
"<",
"RaConfigProperty",
">",
")",
"(",
"(",
"LinkedList",
"<",
"RaConfigProperty",
">",
")",
"annotatedConfigProperties",
")",
".",
"clone",
"(",
")",
";",
"else",
"annoConfigProperties",
"=",
"new",
"LinkedList",
"<",
"RaConfigProperty",
">",
"(",
")",
";",
"if",
"(",
"trace",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"rxConfigProperties size: \"",
"+",
"rxConfigProperties",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
"RaConfigProperty",
"rxConfigProp",
":",
"rxConfigProperties",
")",
"{",
"RaConfigProperty",
"annoConfigProp",
"=",
"null",
";",
"if",
"(",
"annoConfigProperties",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"(",
"List",
"<",
"RaConfigProperty",
">",
")",
"(",
"(",
"LinkedList",
"<",
"RaConfigProperty",
">",
")",
"rxConfigProperties",
")",
".",
"clone",
"(",
")",
";",
"}",
"else",
"{",
"for",
"(",
"RaConfigProperty",
"configProp",
":",
"annoConfigProperties",
")",
"if",
"(",
"isEqual",
"(",
"rxConfigProp",
".",
"getName",
"(",
")",
",",
"configProp",
".",
"getName",
"(",
")",
")",
")",
"{",
"annoConfigProp",
"=",
"configProp",
";",
"break",
";",
"}",
"if",
"(",
"annoConfigProp",
"!=",
"null",
")",
"{",
"if",
"(",
"trace",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"this",
",",
"tc",
",",
"\"merging \"",
"+",
"rxConfigProp",
"+",
"\", \"",
"+",
"annoConfigProp",
")",
";",
"// remove the config property from the list so we know at the end if there",
"// are any additional annotated-only config properties that we need to copy",
"// into the master",
"annoConfigProperties",
".",
"remove",
"(",
"annoConfigProp",
")",
";",
"// merge the two config properties",
"if",
"(",
"rxConfigProp",
".",
"getConfidential",
"(",
")",
"==",
"null",
")",
"rxConfigProp",
".",
"setConfidential",
"(",
"annoConfigProp",
".",
"getConfidential",
"(",
")",
")",
";",
"if",
"(",
"rxConfigProp",
".",
"getDescription",
"(",
")",
"==",
"null",
"||",
"rxConfigProp",
".",
"getDescription",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
"rxConfigProp",
".",
"setDescription",
"(",
"annoConfigProp",
".",
"getDescription",
"(",
")",
")",
";",
"if",
"(",
"rxConfigProp",
".",
"getIgnore",
"(",
")",
"==",
"null",
")",
"rxConfigProp",
".",
"setIgnore",
"(",
"annoConfigProp",
".",
"getIgnore",
"(",
")",
")",
";",
"if",
"(",
"rxConfigProp",
".",
"getSupportsDynamicUpdates",
"(",
")",
"==",
"null",
")",
"rxConfigProp",
".",
"setSupportsDynamicUpdates",
"(",
"annoConfigProp",
".",
"getSupportsDynamicUpdates",
"(",
")",
")",
";",
"if",
"(",
"rxConfigProp",
".",
"getType",
"(",
")",
"==",
"null",
"||",
"rxConfigProp",
".",
"getType",
"(",
")",
".",
"equals",
"(",
"\"\"",
")",
")",
"rxConfigProp",
".",
"setType",
"(",
"annoConfigProp",
".",
"getType",
"(",
")",
")",
";",
"if",
"(",
"rxConfigProp",
".",
"getDefault",
"(",
")",
"==",
"null",
"||",
"rxConfigProp",
".",
"getDefault",
"(",
")",
".",
"equals",
"(",
"\"\"",
")",
")",
"rxConfigProp",
".",
"setDefault",
"(",
"annoConfigProp",
".",
"getDefault",
"(",
")",
")",
";",
"configProperties",
".",
"add",
"(",
"rxConfigProp",
")",
";",
"}",
"else",
"{",
"configProperties",
".",
"add",
"(",
"rxConfigProp",
")",
";",
"}",
"}",
"}",
"if",
"(",
"!",
"annoConfigProperties",
".",
"isEmpty",
"(",
")",
")",
"{",
"// there are annotated config properties that do not exist already in the ra.xml,",
"// thus add them to the master",
"for",
"(",
"RaConfigProperty",
"configProp",
":",
"annoConfigProperties",
")",
"configProperties",
".",
"(",
"configProp",
")",
";",
"}",
"return",
"configProperties",
";",
"}"
] | Merge config properties
@param rxConfigProperties config properties from ra.xml
@param annoConfigProperties config properties from annotations
@return a list of the merged config properties | [
"Merge",
"config",
"properties"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.utils/src/com/ibm/ws/jca/utils/metagen/RAAnnotationProcessor.java#L1105-L1175 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/AIMessageItem.java | AIMessageItem.getMaximumTimeInStore | public long getMaximumTimeInStore()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getMaximumTimeInStore");
long originalExpiryTime = super.getMaximumTimeInStore();
long rejectTime = aih.getRCD().getRejectTimeout();
if (originalExpiryTime == NEVER_EXPIRES)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "getMaximumTimeInStore", Long.valueOf(rejectTime));
return rejectTime;
}
else if (rejectTime == NEVER_EXPIRES)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "getMaximumTimeInStore", Long.valueOf(originalExpiryTime));
return originalExpiryTime;
}
else
{
// neither is NEVER_EXPIRES, so return the minimum of the two
long min = originalExpiryTime < rejectTime?originalExpiryTime:rejectTime;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getMaximumTimeInStore", Long.valueOf(min));
return min;
}
} | java | public long getMaximumTimeInStore()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getMaximumTimeInStore");
long originalExpiryTime = super.getMaximumTimeInStore();
long rejectTime = aih.getRCD().getRejectTimeout();
if (originalExpiryTime == NEVER_EXPIRES)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "getMaximumTimeInStore", Long.valueOf(rejectTime));
return rejectTime;
}
else if (rejectTime == NEVER_EXPIRES)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "getMaximumTimeInStore", Long.valueOf(originalExpiryTime));
return originalExpiryTime;
}
else
{
// neither is NEVER_EXPIRES, so return the minimum of the two
long min = originalExpiryTime < rejectTime?originalExpiryTime:rejectTime;
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getMaximumTimeInStore", Long.valueOf(min));
return min;
}
} | [
"public",
"long",
"getMaximumTimeInStore",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"getMaximumTimeInStore\"",
")",
";",
"long",
"originalExpiryTime",
"=",
"super",
".",
"getMaximumTimeInStore",
"(",
")",
";",
"long",
"rejectTime",
"=",
"aih",
".",
"getRCD",
"(",
")",
".",
"getRejectTimeout",
"(",
")",
";",
"if",
"(",
"originalExpiryTime",
"==",
"NEVER_EXPIRES",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"getMaximumTimeInStore\"",
",",
"Long",
".",
"valueOf",
"(",
"rejectTime",
")",
")",
";",
"return",
"rejectTime",
";",
"}",
"else",
"if",
"(",
"rejectTime",
"==",
"NEVER_EXPIRES",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"getMaximumTimeInStore\"",
",",
"Long",
".",
"valueOf",
"(",
"originalExpiryTime",
")",
")",
";",
"return",
"originalExpiryTime",
";",
"}",
"else",
"{",
"// neither is NEVER_EXPIRES, so return the minimum of the two",
"long",
"min",
"=",
"originalExpiryTime",
"<",
"rejectTime",
"?",
"originalExpiryTime",
":",
"rejectTime",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"getMaximumTimeInStore\"",
",",
"Long",
".",
"valueOf",
"(",
"min",
")",
")",
";",
"return",
"min",
";",
"}",
"}"
] | Expiry at the Remote ME causes the message to be rejected by the
Remote ME. | [
"Expiry",
"at",
"the",
"Remote",
"ME",
"causes",
"the",
"message",
"to",
"be",
"rejected",
"by",
"the",
"Remote",
"ME",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/AIMessageItem.java#L283-L307 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/AIMessageItem.java | AIMessageItem.eventLocked | public void eventLocked()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "eventLocked");
// modify prefetching info
synchronized (this)
{
RemoteDispatchableKey dkey = key.getRemoteDispatchableKey();
RemoteQPConsumerKey ck = null;
if (dkey instanceof RemoteQPConsumerKey)
ck = (RemoteQPConsumerKey) dkey;
if (ck != null)
{
ck.messageLocked(key);
informedConsumerKeyThatLocked = true;
}
}
// call superclass
super.eventLocked();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "eventLocked");
} | java | public void eventLocked()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "eventLocked");
// modify prefetching info
synchronized (this)
{
RemoteDispatchableKey dkey = key.getRemoteDispatchableKey();
RemoteQPConsumerKey ck = null;
if (dkey instanceof RemoteQPConsumerKey)
ck = (RemoteQPConsumerKey) dkey;
if (ck != null)
{
ck.messageLocked(key);
informedConsumerKeyThatLocked = true;
}
}
// call superclass
super.eventLocked();
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "eventLocked");
} | [
"public",
"void",
"eventLocked",
"(",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"tc",
",",
"\"eventLocked\"",
")",
";",
"// modify prefetching info",
"synchronized",
"(",
"this",
")",
"{",
"RemoteDispatchableKey",
"dkey",
"=",
"key",
".",
"getRemoteDispatchableKey",
"(",
")",
";",
"RemoteQPConsumerKey",
"ck",
"=",
"null",
";",
"if",
"(",
"dkey",
"instanceof",
"RemoteQPConsumerKey",
")",
"ck",
"=",
"(",
"RemoteQPConsumerKey",
")",
"dkey",
";",
"if",
"(",
"ck",
"!=",
"null",
")",
"{",
"ck",
".",
"messageLocked",
"(",
"key",
")",
";",
"informedConsumerKeyThatLocked",
"=",
"true",
";",
"}",
"}",
"// call superclass",
"super",
".",
"eventLocked",
"(",
")",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"exit",
"(",
"tc",
",",
"\"eventLocked\"",
")",
";",
"}"
] | Notification that this message has been locked. | [
"Notification",
"that",
"this",
"message",
"has",
"been",
"locked",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/items/AIMessageItem.java#L403-L428 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/websphere/servlet/filter/ChainedResponse.java | ChainedResponse.getChainedRequest | @SuppressWarnings("unchecked")
public HttpServletRequest getChainedRequest() throws IOException, ServletException{
if (super.containsError())
{
throw super.getError();
}
ChainedRequest req = new ChainedRequest(this, _req);
//transfer any auto transfer headers
Hashtable headers = getAutoTransferringHeaders();
Enumeration names = headers.keys();
while (names.hasMoreElements())
{
String name = (String)names.nextElement();
String value = (String)headers.get(name);
req.setHeader(name, value);
}
//get headers from response and add to request
Iterable<String> headerNames = getHeaderNames();
for (String name:headerNames)
{
String value = (String)getHeader(name);
req.setHeader(name, value);
}
return req;
} | java | @SuppressWarnings("unchecked")
public HttpServletRequest getChainedRequest() throws IOException, ServletException{
if (super.containsError())
{
throw super.getError();
}
ChainedRequest req = new ChainedRequest(this, _req);
//transfer any auto transfer headers
Hashtable headers = getAutoTransferringHeaders();
Enumeration names = headers.keys();
while (names.hasMoreElements())
{
String name = (String)names.nextElement();
String value = (String)headers.get(name);
req.setHeader(name, value);
}
//get headers from response and add to request
Iterable<String> headerNames = getHeaderNames();
for (String name:headerNames)
{
String value = (String)getHeader(name);
req.setHeader(name, value);
}
return req;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"HttpServletRequest",
"getChainedRequest",
"(",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"if",
"(",
"super",
".",
"containsError",
"(",
")",
")",
"{",
"throw",
"super",
".",
"getError",
"(",
")",
";",
"}",
"ChainedRequest",
"req",
"=",
"new",
"ChainedRequest",
"(",
"this",
",",
"_req",
")",
";",
"//transfer any auto transfer headers",
"Hashtable",
"headers",
"=",
"getAutoTransferringHeaders",
"(",
")",
";",
"Enumeration",
"names",
"=",
"headers",
".",
"keys",
"(",
")",
";",
"while",
"(",
"names",
".",
"hasMoreElements",
"(",
")",
")",
"{",
"String",
"name",
"=",
"(",
"String",
")",
"names",
".",
"nextElement",
"(",
")",
";",
"String",
"value",
"=",
"(",
"String",
")",
"headers",
".",
"get",
"(",
"name",
")",
";",
"req",
".",
"setHeader",
"(",
"name",
",",
"value",
")",
";",
"}",
"//get headers from response and add to request",
"Iterable",
"<",
"String",
">",
"headerNames",
"=",
"getHeaderNames",
"(",
")",
";",
"for",
"(",
"String",
"name",
":",
"headerNames",
")",
"{",
"String",
"value",
"=",
"(",
"String",
")",
"getHeader",
"(",
"name",
")",
";",
"req",
".",
"setHeader",
"(",
"name",
",",
"value",
")",
";",
"}",
"return",
"req",
";",
"}"
] | Returns a chained request that contains the data that was written to this response. | [
"Returns",
"a",
"chained",
"request",
"that",
"contains",
"the",
"data",
"that",
"was",
"written",
"to",
"this",
"response",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/websphere/servlet/filter/ChainedResponse.java#L66-L93 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/websphere/servlet/filter/ChainedResponse.java | ChainedResponse.setAutoTransferringHeader | @SuppressWarnings("unchecked")
public void setAutoTransferringHeader(String name, String value)
{
Hashtable headers = getAutoTransferringHeaders();
headers.put(name, value);
// setHeader(name, value);
} | java | @SuppressWarnings("unchecked")
public void setAutoTransferringHeader(String name, String value)
{
Hashtable headers = getAutoTransferringHeaders();
headers.put(name, value);
// setHeader(name, value);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"void",
"setAutoTransferringHeader",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"Hashtable",
"headers",
"=",
"getAutoTransferringHeaders",
"(",
")",
";",
"headers",
".",
"put",
"(",
"name",
",",
"value",
")",
";",
"// setHeader(name, value);",
"}"
] | Set a header that should be automatically transferred to all requests
in a chain. These headers will be backed up in a request attribute that
will automatically read and transferred by all ChainedResponses. This method
is useful for transparently transferring the original headers sent by the client
without forcing servlets to be specially written to transfer these headers. | [
"Set",
"a",
"header",
"that",
"should",
"be",
"automatically",
"transferred",
"to",
"all",
"requests",
"in",
"a",
"chain",
".",
"These",
"headers",
"will",
"be",
"backed",
"up",
"in",
"a",
"request",
"attribute",
"that",
"will",
"automatically",
"read",
"and",
"transferred",
"by",
"all",
"ChainedResponses",
".",
"This",
"method",
"is",
"useful",
"for",
"transparently",
"transferring",
"the",
"original",
"headers",
"sent",
"by",
"the",
"client",
"without",
"forcing",
"servlets",
"to",
"be",
"specially",
"written",
"to",
"transfer",
"these",
"headers",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/websphere/servlet/filter/ChainedResponse.java#L123-L129 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/websphere/servlet/filter/ChainedResponse.java | ChainedResponse.getAutoTransferringHeaders | @SuppressWarnings("unchecked")
private Hashtable getAutoTransferringHeaders()
{
Hashtable headers = (Hashtable)_req.getAttribute(AUTO_XFER_HEADERS_ATTR);
if (headers == null)
{
headers = new Hashtable();
_req.setAttribute(AUTO_XFER_HEADERS_ATTR, headers);
}
return headers;
} | java | @SuppressWarnings("unchecked")
private Hashtable getAutoTransferringHeaders()
{
Hashtable headers = (Hashtable)_req.getAttribute(AUTO_XFER_HEADERS_ATTR);
if (headers == null)
{
headers = new Hashtable();
_req.setAttribute(AUTO_XFER_HEADERS_ATTR, headers);
}
return headers;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"Hashtable",
"getAutoTransferringHeaders",
"(",
")",
"{",
"Hashtable",
"headers",
"=",
"(",
"Hashtable",
")",
"_req",
".",
"getAttribute",
"(",
"AUTO_XFER_HEADERS_ATTR",
")",
";",
"if",
"(",
"headers",
"==",
"null",
")",
"{",
"headers",
"=",
"new",
"Hashtable",
"(",
")",
";",
"_req",
".",
"setAttribute",
"(",
"AUTO_XFER_HEADERS_ATTR",
",",
"headers",
")",
";",
"}",
"return",
"headers",
";",
"}"
] | Get the headers that are designated as auto-transfer. | [
"Get",
"the",
"headers",
"that",
"are",
"designated",
"as",
"auto",
"-",
"transfer",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/websphere/servlet/filter/ChainedResponse.java#L139-L149 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/FrameworkManager.java | FrameworkManager.registerInstrumentationService | protected void registerInstrumentationService(BundleContext systemContext) {
Instrumentation inst = config.getInstrumentation();
if (inst != null) {
// Register a wrapper so we can trace callers.
inst = (Instrumentation) Proxy.newProxyInstance(TraceInstrumentation.class.getClassLoader(),
new Class[] { Instrumentation.class },
new TraceInstrumentation(inst));
Hashtable<String, String> svcProps = new Hashtable<String, String>();
systemContext.registerService(Instrumentation.class.getName(), inst, svcProps);
}
} | java | protected void registerInstrumentationService(BundleContext systemContext) {
Instrumentation inst = config.getInstrumentation();
if (inst != null) {
// Register a wrapper so we can trace callers.
inst = (Instrumentation) Proxy.newProxyInstance(TraceInstrumentation.class.getClassLoader(),
new Class[] { Instrumentation.class },
new TraceInstrumentation(inst));
Hashtable<String, String> svcProps = new Hashtable<String, String>();
systemContext.registerService(Instrumentation.class.getName(), inst, svcProps);
}
} | [
"protected",
"void",
"registerInstrumentationService",
"(",
"BundleContext",
"systemContext",
")",
"{",
"Instrumentation",
"inst",
"=",
"config",
".",
"getInstrumentation",
"(",
")",
";",
"if",
"(",
"inst",
"!=",
"null",
")",
"{",
"// Register a wrapper so we can trace callers.",
"inst",
"=",
"(",
"Instrumentation",
")",
"Proxy",
".",
"newProxyInstance",
"(",
"TraceInstrumentation",
".",
"class",
".",
"getClassLoader",
"(",
")",
",",
"new",
"Class",
"[",
"]",
"{",
"Instrumentation",
".",
"class",
"}",
",",
"new",
"TraceInstrumentation",
"(",
"inst",
")",
")",
";",
"Hashtable",
"<",
"String",
",",
"String",
">",
"svcProps",
"=",
"new",
"Hashtable",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"systemContext",
".",
"registerService",
"(",
"Instrumentation",
".",
"class",
".",
"getName",
"(",
")",
",",
"inst",
",",
"svcProps",
")",
";",
"}",
"}"
] | Register the instrumentation class as a service in the OSGi registry
@param systemBundleCtx
The framework system bundle context | [
"Register",
"the",
"instrumentation",
"class",
"as",
"a",
"service",
"in",
"the",
"OSGi",
"registry"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/FrameworkManager.java#L487-L497 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/FrameworkManager.java | FrameworkManager.registerPauseableComponentController | protected void registerPauseableComponentController(BundleContext systemContext) {
PauseableComponentControllerImpl pauseableComponentController = new PauseableComponentControllerImpl(systemContext);
if (pauseableComponentController != null) {
Hashtable<String, String> svcProps = new Hashtable<String, String>();
systemContext.registerService(PauseableComponentController.class.getName(), pauseableComponentController, svcProps);
}
} | java | protected void registerPauseableComponentController(BundleContext systemContext) {
PauseableComponentControllerImpl pauseableComponentController = new PauseableComponentControllerImpl(systemContext);
if (pauseableComponentController != null) {
Hashtable<String, String> svcProps = new Hashtable<String, String>();
systemContext.registerService(PauseableComponentController.class.getName(), pauseableComponentController, svcProps);
}
} | [
"protected",
"void",
"registerPauseableComponentController",
"(",
"BundleContext",
"systemContext",
")",
"{",
"PauseableComponentControllerImpl",
"pauseableComponentController",
"=",
"new",
"PauseableComponentControllerImpl",
"(",
"systemContext",
")",
";",
"if",
"(",
"pauseableComponentController",
"!=",
"null",
")",
"{",
"Hashtable",
"<",
"String",
",",
"String",
">",
"svcProps",
"=",
"new",
"Hashtable",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"systemContext",
".",
"registerService",
"(",
"PauseableComponentController",
".",
"class",
".",
"getName",
"(",
")",
",",
"pauseableComponentController",
",",
"svcProps",
")",
";",
"}",
"}"
] | Register the PauseableComponentController class as a service in the OSGi registry
@param systemBundleCtx
The framework system bundle context | [
"Register",
"the",
"PauseableComponentController",
"class",
"as",
"a",
"service",
"in",
"the",
"OSGi",
"registry"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/FrameworkManager.java#L505-L511 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/FrameworkManager.java | FrameworkManager.preRegisterMBeanServerPipelineService | private void preRegisterMBeanServerPipelineService(final BundleContext systemContext) {
PlatformMBeanServerBuilder.addPlatformMBeanServerBuilderListener(new PlatformMBeanServerBuilderListener() {
@Override
@FFDCIgnore(IllegalStateException.class)
public void platformMBeanServerCreated(final MBeanServerPipeline pipeline) {
if (pipeline != null) {
final Hashtable<String, String> svcProps = new Hashtable<String, String>();
try {
AccessController.doPrivileged(new PrivilegedAction<Void>() {
@Override
public Void run() {
systemContext.registerService(MBeanServerPipeline.class.getName(), pipeline, svcProps);
return null;
}
});
} catch (IllegalStateException ise) { /* This instance of the system bundle is no longer valid. Ignore it. */
}
}
}
});
} | java | private void preRegisterMBeanServerPipelineService(final BundleContext systemContext) {
PlatformMBeanServerBuilder.addPlatformMBeanServerBuilderListener(new PlatformMBeanServerBuilderListener() {
@Override
@FFDCIgnore(IllegalStateException.class)
public void platformMBeanServerCreated(final MBeanServerPipeline pipeline) {
if (pipeline != null) {
final Hashtable<String, String> svcProps = new Hashtable<String, String>();
try {
AccessController.doPrivileged(new PrivilegedAction<Void>() {
@Override
public Void run() {
systemContext.registerService(MBeanServerPipeline.class.getName(), pipeline, svcProps);
return null;
}
});
} catch (IllegalStateException ise) { /* This instance of the system bundle is no longer valid. Ignore it. */
}
}
}
});
} | [
"private",
"void",
"preRegisterMBeanServerPipelineService",
"(",
"final",
"BundleContext",
"systemContext",
")",
"{",
"PlatformMBeanServerBuilder",
".",
"addPlatformMBeanServerBuilderListener",
"(",
"new",
"PlatformMBeanServerBuilderListener",
"(",
")",
"{",
"@",
"Override",
"@",
"FFDCIgnore",
"(",
"IllegalStateException",
".",
"class",
")",
"public",
"void",
"platformMBeanServerCreated",
"(",
"final",
"MBeanServerPipeline",
"pipeline",
")",
"{",
"if",
"(",
"pipeline",
"!=",
"null",
")",
"{",
"final",
"Hashtable",
"<",
"String",
",",
"String",
">",
"svcProps",
"=",
"new",
"Hashtable",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"try",
"{",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedAction",
"<",
"Void",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Void",
"run",
"(",
")",
"{",
"systemContext",
".",
"registerService",
"(",
"MBeanServerPipeline",
".",
"class",
".",
"getName",
"(",
")",
",",
"pipeline",
",",
"svcProps",
")",
";",
"return",
"null",
";",
"}",
"}",
")",
";",
"}",
"catch",
"(",
"IllegalStateException",
"ise",
")",
"{",
"/* This instance of the system bundle is no longer valid. Ignore it. */",
"}",
"}",
"}",
"}",
")",
";",
"}"
] | Delayed registration of the platform MBeanServerPipeline in the OSGi registry.
@param systemContext The framework system bundle context | [
"Delayed",
"registration",
"of",
"the",
"platform",
"MBeanServerPipeline",
"in",
"the",
"OSGi",
"registry",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/FrameworkManager.java#L518-L538 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/FrameworkManager.java | FrameworkManager.startFramework | protected Framework startFramework(BootstrapConfig config) throws BundleException {
// Set the default startlevel of the framework. We want the framework to
// start at our bootstrap level (i.e. Framework bundle itself will start, and
// it will pre-load and re-start any previously known bundles in the
// bootstrap start level).
config.put(org.osgi.framework.Constants.FRAMEWORK_BEGINNING_STARTLEVEL,
Integer.toString(KernelStartLevel.OSGI_INIT.getLevel()));
fwkClassloader = config.getFrameworkClassloader();
FrameworkFactory fwkFactory = FrameworkConfigurator.getFrameworkFactory(fwkClassloader);
// Initialize the framework to create a valid system bundle context
// Start the shutdown monitor (before we start any bundles)
// This exception will have a translated message stating that an unknown exception occurred.
// This is so bizarre a case that it should never happen.
try {
Framework fwk = fwkFactory.newFramework(config.getFrameworkProperties());
if (fwk == null)
return null;
fwk.start();
return fwk;
} catch (BundleException ex) {
throw ex;
} catch (RuntimeException ex) {
// Try to diagnose this exception. If it's something we know about, we will log an error and
// return null here (which will result in a general "Failed to start the framework" error message
// higher up.) Otherwise, just throw the exception
if (!handleEquinoxRuntimeException(ex))
throw ex;
return null;
}
} | java | protected Framework startFramework(BootstrapConfig config) throws BundleException {
// Set the default startlevel of the framework. We want the framework to
// start at our bootstrap level (i.e. Framework bundle itself will start, and
// it will pre-load and re-start any previously known bundles in the
// bootstrap start level).
config.put(org.osgi.framework.Constants.FRAMEWORK_BEGINNING_STARTLEVEL,
Integer.toString(KernelStartLevel.OSGI_INIT.getLevel()));
fwkClassloader = config.getFrameworkClassloader();
FrameworkFactory fwkFactory = FrameworkConfigurator.getFrameworkFactory(fwkClassloader);
// Initialize the framework to create a valid system bundle context
// Start the shutdown monitor (before we start any bundles)
// This exception will have a translated message stating that an unknown exception occurred.
// This is so bizarre a case that it should never happen.
try {
Framework fwk = fwkFactory.newFramework(config.getFrameworkProperties());
if (fwk == null)
return null;
fwk.start();
return fwk;
} catch (BundleException ex) {
throw ex;
} catch (RuntimeException ex) {
// Try to diagnose this exception. If it's something we know about, we will log an error and
// return null here (which will result in a general "Failed to start the framework" error message
// higher up.) Otherwise, just throw the exception
if (!handleEquinoxRuntimeException(ex))
throw ex;
return null;
}
} | [
"protected",
"Framework",
"startFramework",
"(",
"BootstrapConfig",
"config",
")",
"throws",
"BundleException",
"{",
"// Set the default startlevel of the framework. We want the framework to",
"// start at our bootstrap level (i.e. Framework bundle itself will start, and",
"// it will pre-load and re-start any previously known bundles in the",
"// bootstrap start level).",
"config",
".",
"put",
"(",
"org",
".",
"osgi",
".",
"framework",
".",
"Constants",
".",
"FRAMEWORK_BEGINNING_STARTLEVEL",
",",
"Integer",
".",
"toString",
"(",
"KernelStartLevel",
".",
"OSGI_INIT",
".",
"getLevel",
"(",
")",
")",
")",
";",
"fwkClassloader",
"=",
"config",
".",
"getFrameworkClassloader",
"(",
")",
";",
"FrameworkFactory",
"fwkFactory",
"=",
"FrameworkConfigurator",
".",
"getFrameworkFactory",
"(",
"fwkClassloader",
")",
";",
"// Initialize the framework to create a valid system bundle context",
"// Start the shutdown monitor (before we start any bundles)",
"// This exception will have a translated message stating that an unknown exception occurred.",
"// This is so bizarre a case that it should never happen.",
"try",
"{",
"Framework",
"fwk",
"=",
"fwkFactory",
".",
"newFramework",
"(",
"config",
".",
"getFrameworkProperties",
"(",
")",
")",
";",
"if",
"(",
"fwk",
"==",
"null",
")",
"return",
"null",
";",
"fwk",
".",
"start",
"(",
")",
";",
"return",
"fwk",
";",
"}",
"catch",
"(",
"BundleException",
"ex",
")",
"{",
"throw",
"ex",
";",
"}",
"catch",
"(",
"RuntimeException",
"ex",
")",
"{",
"// Try to diagnose this exception. If it's something we know about, we will log an error and",
"// return null here (which will result in a general \"Failed to start the framework\" error message",
"// higher up.) Otherwise, just throw the exception",
"if",
"(",
"!",
"handleEquinoxRuntimeException",
"(",
"ex",
")",
")",
"throw",
"ex",
";",
"return",
"null",
";",
"}",
"}"
] | Create and start a new instance of an OSGi framework using the provided
properties as framework properties. | [
"Create",
"and",
"start",
"a",
"new",
"instance",
"of",
"an",
"OSGi",
"framework",
"using",
"the",
"provided",
"properties",
"as",
"framework",
"properties",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/FrameworkManager.java#L544-L575 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/FrameworkManager.java | FrameworkManager.handleEquinoxRuntimeException | private boolean handleEquinoxRuntimeException(RuntimeException ex) {
Throwable cause = ex.getCause();
if (cause != null) {
if (cause instanceof IOException) {
// Check common causes for IOExceptions
File osgiDir = config.getWorkareaFile(OSGI_DIR_NAME);
if (!osgiDir.exists() || !osgiDir.isDirectory() || !osgiDir.canWrite()) {
Tr.error(tc, "error.serverDirPermission", osgiDir.getAbsolutePath());
return true;
}
File managerDir = new File(osgiDir, MANAGER_DIR_NAME);
if (!managerDir.exists() || !managerDir.isDirectory() || !managerDir.canWrite()) {
Tr.error(tc, "error.serverDirPermission", managerDir.getAbsolutePath());
return true;
}
}
}
return false;
} | java | private boolean handleEquinoxRuntimeException(RuntimeException ex) {
Throwable cause = ex.getCause();
if (cause != null) {
if (cause instanceof IOException) {
// Check common causes for IOExceptions
File osgiDir = config.getWorkareaFile(OSGI_DIR_NAME);
if (!osgiDir.exists() || !osgiDir.isDirectory() || !osgiDir.canWrite()) {
Tr.error(tc, "error.serverDirPermission", osgiDir.getAbsolutePath());
return true;
}
File managerDir = new File(osgiDir, MANAGER_DIR_NAME);
if (!managerDir.exists() || !managerDir.isDirectory() || !managerDir.canWrite()) {
Tr.error(tc, "error.serverDirPermission", managerDir.getAbsolutePath());
return true;
}
}
}
return false;
} | [
"private",
"boolean",
"handleEquinoxRuntimeException",
"(",
"RuntimeException",
"ex",
")",
"{",
"Throwable",
"cause",
"=",
"ex",
".",
"getCause",
"(",
")",
";",
"if",
"(",
"cause",
"!=",
"null",
")",
"{",
"if",
"(",
"cause",
"instanceof",
"IOException",
")",
"{",
"// Check common causes for IOExceptions",
"File",
"osgiDir",
"=",
"config",
".",
"getWorkareaFile",
"(",
"OSGI_DIR_NAME",
")",
";",
"if",
"(",
"!",
"osgiDir",
".",
"exists",
"(",
")",
"||",
"!",
"osgiDir",
".",
"isDirectory",
"(",
")",
"||",
"!",
"osgiDir",
".",
"canWrite",
"(",
")",
")",
"{",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"error.serverDirPermission\"",
",",
"osgiDir",
".",
"getAbsolutePath",
"(",
")",
")",
";",
"return",
"true",
";",
"}",
"File",
"managerDir",
"=",
"new",
"File",
"(",
"osgiDir",
",",
"MANAGER_DIR_NAME",
")",
";",
"if",
"(",
"!",
"managerDir",
".",
"exists",
"(",
")",
"||",
"!",
"managerDir",
".",
"isDirectory",
"(",
")",
"||",
"!",
"managerDir",
".",
"canWrite",
"(",
")",
")",
"{",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"error.serverDirPermission\"",
",",
"managerDir",
".",
"getAbsolutePath",
"(",
")",
")",
";",
"return",
"true",
";",
"}",
"}",
"}",
"return",
"false",
";",
"}"
] | Attempt to diagnose Equinox exceptions and issue a sane error message rather than a massive equinox stack
@param ex The RuntimeException thrown by Equinox
@return true if we understand the exception and issued an error message, false otherwise | [
"Attempt",
"to",
"diagnose",
"Equinox",
"exceptions",
"and",
"issue",
"a",
"sane",
"error",
"message",
"rather",
"than",
"a",
"massive",
"equinox",
"stack"
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/FrameworkManager.java#L586-L607 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/FrameworkManager.java | FrameworkManager.waitForReady | public boolean waitForReady() throws InterruptedException {
// wait for the framework to be set.
if (waitForFramework() == null) {
return false;
}
frameworkLaunched.await();
if (!frameworkLaunchSuccess) {
return false;
}
// Now look for the FrameworkReady service in the service registry
Collection<ServiceReference<FrameworkReady>> readyServiceRefs;
try {
readyServiceRefs = systemBundleCtx.getServiceReferences(FrameworkReady.class, null);
} catch (InvalidSyntaxException e) {
throw new IllegalStateException(e); // unlikely.
} catch (IllegalStateException ex) {
// The framework might have been stopped before we finished starting
if (framework.getState() != Bundle.ACTIVE) {
waitForFrameworkStop();
return false;
} else {
throw ex;
}
}
// If we have any, we will wait for them...
if (readyServiceRefs != null) {
for (ServiceReference<FrameworkReady> readyServiceRef : readyServiceRefs) {
FrameworkReady ready = systemBundleCtx.getService(readyServiceRef);
if (ready != null) {
ready.waitForFrameworkReady();
}
}
}
// Check if some component declared a fatal start error by initiating
// framework stop before we were fully started. If so, wait for the
// framework to finish stopping, then report an error.
if (framework.getState() != Bundle.ACTIVE) {
waitForFrameworkStop();
return false;
}
return true;
} | java | public boolean waitForReady() throws InterruptedException {
// wait for the framework to be set.
if (waitForFramework() == null) {
return false;
}
frameworkLaunched.await();
if (!frameworkLaunchSuccess) {
return false;
}
// Now look for the FrameworkReady service in the service registry
Collection<ServiceReference<FrameworkReady>> readyServiceRefs;
try {
readyServiceRefs = systemBundleCtx.getServiceReferences(FrameworkReady.class, null);
} catch (InvalidSyntaxException e) {
throw new IllegalStateException(e); // unlikely.
} catch (IllegalStateException ex) {
// The framework might have been stopped before we finished starting
if (framework.getState() != Bundle.ACTIVE) {
waitForFrameworkStop();
return false;
} else {
throw ex;
}
}
// If we have any, we will wait for them...
if (readyServiceRefs != null) {
for (ServiceReference<FrameworkReady> readyServiceRef : readyServiceRefs) {
FrameworkReady ready = systemBundleCtx.getService(readyServiceRef);
if (ready != null) {
ready.waitForFrameworkReady();
}
}
}
// Check if some component declared a fatal start error by initiating
// framework stop before we were fully started. If so, wait for the
// framework to finish stopping, then report an error.
if (framework.getState() != Bundle.ACTIVE) {
waitForFrameworkStop();
return false;
}
return true;
} | [
"public",
"boolean",
"waitForReady",
"(",
")",
"throws",
"InterruptedException",
"{",
"// wait for the framework to be set.",
"if",
"(",
"waitForFramework",
"(",
")",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"frameworkLaunched",
".",
"await",
"(",
")",
";",
"if",
"(",
"!",
"frameworkLaunchSuccess",
")",
"{",
"return",
"false",
";",
"}",
"// Now look for the FrameworkReady service in the service registry",
"Collection",
"<",
"ServiceReference",
"<",
"FrameworkReady",
">",
">",
"readyServiceRefs",
";",
"try",
"{",
"readyServiceRefs",
"=",
"systemBundleCtx",
".",
"getServiceReferences",
"(",
"FrameworkReady",
".",
"class",
",",
"null",
")",
";",
"}",
"catch",
"(",
"InvalidSyntaxException",
"e",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"e",
")",
";",
"// unlikely.",
"}",
"catch",
"(",
"IllegalStateException",
"ex",
")",
"{",
"// The framework might have been stopped before we finished starting",
"if",
"(",
"framework",
".",
"getState",
"(",
")",
"!=",
"Bundle",
".",
"ACTIVE",
")",
"{",
"waitForFrameworkStop",
"(",
")",
";",
"return",
"false",
";",
"}",
"else",
"{",
"throw",
"ex",
";",
"}",
"}",
"// If we have any, we will wait for them...",
"if",
"(",
"readyServiceRefs",
"!=",
"null",
")",
"{",
"for",
"(",
"ServiceReference",
"<",
"FrameworkReady",
">",
"readyServiceRef",
":",
"readyServiceRefs",
")",
"{",
"FrameworkReady",
"ready",
"=",
"systemBundleCtx",
".",
"getService",
"(",
"readyServiceRef",
")",
";",
"if",
"(",
"ready",
"!=",
"null",
")",
"{",
"ready",
".",
"waitForFrameworkReady",
"(",
")",
";",
"}",
"}",
"}",
"// Check if some component declared a fatal start error by initiating",
"// framework stop before we were fully started. If so, wait for the",
"// framework to finish stopping, then report an error.",
"if",
"(",
"framework",
".",
"getState",
"(",
")",
"!=",
"Bundle",
".",
"ACTIVE",
")",
"{",
"waitForFrameworkStop",
"(",
")",
";",
"return",
"false",
";",
"}",
"return",
"true",
";",
"}"
] | Waits for the server to become ready.
@return true if the server is ready, or false if an error occurred
@throws InterruptedException | [
"Waits",
"for",
"the",
"server",
"to",
"become",
"ready",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/FrameworkManager.java#L621-L666 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/FrameworkManager.java | FrameworkManager.addShutdownHook | private void addShutdownHook(boolean isClient) {
if (shutdownHook == null) {
shutdownHook = new ShutdownHook(isClient);
Runtime.getRuntime().addShutdownHook(shutdownHook);
}
} | java | private void addShutdownHook(boolean isClient) {
if (shutdownHook == null) {
shutdownHook = new ShutdownHook(isClient);
Runtime.getRuntime().addShutdownHook(shutdownHook);
}
} | [
"private",
"void",
"addShutdownHook",
"(",
"boolean",
"isClient",
")",
"{",
"if",
"(",
"shutdownHook",
"==",
"null",
")",
"{",
"shutdownHook",
"=",
"new",
"ShutdownHook",
"(",
"isClient",
")",
";",
"Runtime",
".",
"getRuntime",
"(",
")",
".",
"addShutdownHook",
"(",
"shutdownHook",
")",
";",
"}",
"}"
] | Attach a shutdown hook to make sure that the framework is shutdown nicely
in most cases. There are ways of shutting a JVM down that don't use the
shutdown hook, but this catches most cases. | [
"Attach",
"a",
"shutdown",
"hook",
"to",
"make",
"sure",
"that",
"the",
"framework",
"is",
"shutdown",
"nicely",
"in",
"most",
"cases",
".",
"There",
"are",
"ways",
"of",
"shutting",
"a",
"JVM",
"down",
"that",
"don",
"t",
"use",
"the",
"shutdown",
"hook",
"but",
"this",
"catches",
"most",
"cases",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/FrameworkManager.java#L731-L736 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/FrameworkManager.java | FrameworkManager.introspectFramework | public void introspectFramework(String timestamp, Set<JavaDumpAction> javaDumpActions) {
Tr.audit(tc, "info.introspect.request.received");
File dumpDir = config.getOutputFile(BootstrapConstants.SERVER_DUMP_FOLDER_PREFIX + timestamp + "/");
if (!dumpDir.exists()) {
throw new IllegalStateException("dump directory does not exist.");
}
// generate java dumps if needed, and move them to the dump directory.
if (javaDumpActions != null) {
File javaDumpLocations = new File(dumpDir, BootstrapConstants.SERVER_DUMPED_FILE_LOCATIONS);
dumpJava(javaDumpActions, javaDumpLocations);
}
IntrospectionContext introspectionCtx = new IntrospectionContext(systemBundleCtx, dumpDir);
introspectionCtx.introspectAll();
// create dumped flag file
File dumpedFlag = new File(dumpDir, BootstrapConstants.SERVER_DUMPED_FLAG_FILE_NAME);
try {
dumpedFlag.createNewFile();
} catch (IOException e) {
Tr.warning(tc, "warn.unableWriteFile", dumpedFlag, e.getMessage());
}
} | java | public void introspectFramework(String timestamp, Set<JavaDumpAction> javaDumpActions) {
Tr.audit(tc, "info.introspect.request.received");
File dumpDir = config.getOutputFile(BootstrapConstants.SERVER_DUMP_FOLDER_PREFIX + timestamp + "/");
if (!dumpDir.exists()) {
throw new IllegalStateException("dump directory does not exist.");
}
// generate java dumps if needed, and move them to the dump directory.
if (javaDumpActions != null) {
File javaDumpLocations = new File(dumpDir, BootstrapConstants.SERVER_DUMPED_FILE_LOCATIONS);
dumpJava(javaDumpActions, javaDumpLocations);
}
IntrospectionContext introspectionCtx = new IntrospectionContext(systemBundleCtx, dumpDir);
introspectionCtx.introspectAll();
// create dumped flag file
File dumpedFlag = new File(dumpDir, BootstrapConstants.SERVER_DUMPED_FLAG_FILE_NAME);
try {
dumpedFlag.createNewFile();
} catch (IOException e) {
Tr.warning(tc, "warn.unableWriteFile", dumpedFlag, e.getMessage());
}
} | [
"public",
"void",
"introspectFramework",
"(",
"String",
"timestamp",
",",
"Set",
"<",
"JavaDumpAction",
">",
"javaDumpActions",
")",
"{",
"Tr",
".",
"audit",
"(",
"tc",
",",
"\"info.introspect.request.received\"",
")",
";",
"File",
"dumpDir",
"=",
"config",
".",
"getOutputFile",
"(",
"BootstrapConstants",
".",
"SERVER_DUMP_FOLDER_PREFIX",
"+",
"timestamp",
"+",
"\"/\"",
")",
";",
"if",
"(",
"!",
"dumpDir",
".",
"exists",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"dump directory does not exist.\"",
")",
";",
"}",
"// generate java dumps if needed, and move them to the dump directory.",
"if",
"(",
"javaDumpActions",
"!=",
"null",
")",
"{",
"File",
"javaDumpLocations",
"=",
"new",
"File",
"(",
"dumpDir",
",",
"BootstrapConstants",
".",
"SERVER_DUMPED_FILE_LOCATIONS",
")",
";",
"dumpJava",
"(",
"javaDumpActions",
",",
"javaDumpLocations",
")",
";",
"}",
"IntrospectionContext",
"introspectionCtx",
"=",
"new",
"IntrospectionContext",
"(",
"systemBundleCtx",
",",
"dumpDir",
")",
";",
"introspectionCtx",
".",
"introspectAll",
"(",
")",
";",
"// create dumped flag file",
"File",
"dumpedFlag",
"=",
"new",
"File",
"(",
"dumpDir",
",",
"BootstrapConstants",
".",
"SERVER_DUMPED_FLAG_FILE_NAME",
")",
";",
"try",
"{",
"dumpedFlag",
".",
"createNewFile",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"Tr",
".",
"warning",
"(",
"tc",
",",
"\"warn.unableWriteFile\"",
",",
"dumpedFlag",
",",
"e",
".",
"getMessage",
"(",
")",
")",
";",
"}",
"}"
] | Introspect the framework
Get all IntrospectableService from OSGi bundle context, and dump a running
server status from them.
@param timestamp
Create a unique dump folder based on the time stamp string.
@param javaDumpActions
The java dumps to create, or null for the default set. | [
"Introspect",
"the",
"framework",
"Get",
"all",
"IntrospectableService",
"from",
"OSGi",
"bundle",
"context",
"and",
"dump",
"a",
"running",
"server",
"status",
"from",
"them",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.nested/src/com/ibm/ws/kernel/launch/internal/FrameworkManager.java#L1061-L1085 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/trm/TrmFirstContactMessageType.java | TrmFirstContactMessageType.getTrmFirstContactMessageType | public final static TrmFirstContactMessageType getTrmFirstContactMessageType(int aValue) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc,"Value = " + aValue);
return set[aValue];
} | java | public final static TrmFirstContactMessageType getTrmFirstContactMessageType(int aValue) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc,"Value = " + aValue);
return set[aValue];
} | [
"public",
"final",
"static",
"TrmFirstContactMessageType",
"getTrmFirstContactMessageType",
"(",
"int",
"aValue",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"SibTr",
".",
"debug",
"(",
"tc",
",",
"\"Value = \"",
"+",
"aValue",
")",
";",
"return",
"set",
"[",
"aValue",
"]",
";",
"}"
] | Returns the corresponding TrmFirstContactMessageType for a given integer.
This method should NOT be called by any code outside the MFP component.
It is only public so that it can be accessed by sub-packages.
@param aValue The integer for which an TrmFirstContactMessageType is required.
@return The corresponding TrmFirstContactMessageType | [
"Returns",
"the",
"corresponding",
"TrmFirstContactMessageType",
"for",
"a",
"given",
"integer",
".",
"This",
"method",
"should",
"NOT",
"be",
"called",
"by",
"any",
"code",
"outside",
"the",
"MFP",
"component",
".",
"It",
"is",
"only",
"public",
"so",
"that",
"it",
"can",
"be",
"accessed",
"by",
"sub",
"-",
"packages",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/trm/TrmFirstContactMessageType.java#L98-L101 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/security/config/ssl/yoko/SocketFactory.java | SocketFactory.createSocket | @Override
public Socket createSocket(String host, int port) throws IOException {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "SocketFactory attempting to create socket for host: " + host + " port: " + port);
// check for SSL addresses
if (Util.isEncodedHost(host, HOST_PROTOCOL)) {
String sslConfigName = Util.decodeHostInfo(host);
host = Util.decodeHost(host);
return createSSLSocket(host, (char) port, sslConfigName);
} else {
return createPlainSocket(host, port);
}
} | java | @Override
public Socket createSocket(String host, int port) throws IOException {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "SocketFactory attempting to create socket for host: " + host + " port: " + port);
// check for SSL addresses
if (Util.isEncodedHost(host, HOST_PROTOCOL)) {
String sslConfigName = Util.decodeHostInfo(host);
host = Util.decodeHost(host);
return createSSLSocket(host, (char) port, sslConfigName);
} else {
return createPlainSocket(host, port);
}
} | [
"@",
"Override",
"public",
"Socket",
"createSocket",
"(",
"String",
"host",
",",
"int",
"port",
")",
"throws",
"IOException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"SocketFactory attempting to create socket for host: \"",
"+",
"host",
"+",
"\" port: \"",
"+",
"port",
")",
";",
"// check for SSL addresses",
"if",
"(",
"Util",
".",
"isEncodedHost",
"(",
"host",
",",
"HOST_PROTOCOL",
")",
")",
"{",
"String",
"sslConfigName",
"=",
"Util",
".",
"decodeHostInfo",
"(",
"host",
")",
";",
"host",
"=",
"Util",
".",
"decodeHost",
"(",
"host",
")",
";",
"return",
"createSSLSocket",
"(",
"host",
",",
"(",
"char",
")",
"port",
",",
"sslConfigName",
")",
";",
"}",
"else",
"{",
"return",
"createPlainSocket",
"(",
"host",
",",
"port",
")",
";",
"}",
"}"
] | Create a client socket of the appropriate
type using the provided address and port information.
@return A Socket (either plain or SSL) configured for connection
to the target. | [
"Create",
"a",
"client",
"socket",
"of",
"the",
"appropriate",
"type",
"using",
"the",
"provided",
"address",
"and",
"port",
"information",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/security/config/ssl/yoko/SocketFactory.java#L114-L127 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/security/config/ssl/yoko/SocketFactory.java | SocketFactory.createSelfConnection | @Override
@FFDCIgnore(IOException.class)
public Socket createSelfConnection(InetAddress address, int port) throws IOException {
try {
SocketInfo info = null;
for (SocketInfo test : socketInfos) {
if (test.port == port && test.addr.equals(address)) {
info = test;
}
}
if (info == null) {
throw new IOException("No inbound socket matching address " + address + " and port " + port);
}
OptionsKey key = info.key;
// the requires information tells us whether we created a plain or SSL listener. We need to create one
// of the matching type.
if ((NoProtection.value & key.requires) == NoProtection.value) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
Tr.debug(tc, "Created plain endpoint to " + address.getHostName() + ":" + port);
return new Socket(address, port);
} else {
return createSSLSocket(address.getHostName(), port, info.sslConfigName);
}
} catch (IOException ex) {
Tr.error(tc, "Exception creating a client socket to " + address.getHostName() + ":" + port, ex);
throw ex;
}
} | java | @Override
@FFDCIgnore(IOException.class)
public Socket createSelfConnection(InetAddress address, int port) throws IOException {
try {
SocketInfo info = null;
for (SocketInfo test : socketInfos) {
if (test.port == port && test.addr.equals(address)) {
info = test;
}
}
if (info == null) {
throw new IOException("No inbound socket matching address " + address + " and port " + port);
}
OptionsKey key = info.key;
// the requires information tells us whether we created a plain or SSL listener. We need to create one
// of the matching type.
if ((NoProtection.value & key.requires) == NoProtection.value) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
Tr.debug(tc, "Created plain endpoint to " + address.getHostName() + ":" + port);
return new Socket(address, port);
} else {
return createSSLSocket(address.getHostName(), port, info.sslConfigName);
}
} catch (IOException ex) {
Tr.error(tc, "Exception creating a client socket to " + address.getHostName() + ":" + port, ex);
throw ex;
}
} | [
"@",
"Override",
"@",
"FFDCIgnore",
"(",
"IOException",
".",
"class",
")",
"public",
"Socket",
"createSelfConnection",
"(",
"InetAddress",
"address",
",",
"int",
"port",
")",
"throws",
"IOException",
"{",
"try",
"{",
"SocketInfo",
"info",
"=",
"null",
";",
"for",
"(",
"SocketInfo",
"test",
":",
"socketInfos",
")",
"{",
"if",
"(",
"test",
".",
"port",
"==",
"port",
"&&",
"test",
".",
"addr",
".",
"equals",
"(",
"address",
")",
")",
"{",
"info",
"=",
"test",
";",
"}",
"}",
"if",
"(",
"info",
"==",
"null",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"No inbound socket matching address \"",
"+",
"address",
"+",
"\" and port \"",
"+",
"port",
")",
";",
"}",
"OptionsKey",
"key",
"=",
"info",
".",
"key",
";",
"// the requires information tells us whether we created a plain or SSL listener. We need to create one",
"// of the matching type.",
"if",
"(",
"(",
"NoProtection",
".",
"value",
"&",
"key",
".",
"requires",
")",
"==",
"NoProtection",
".",
"value",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Created plain endpoint to \"",
"+",
"address",
".",
"getHostName",
"(",
")",
"+",
"\":\"",
"+",
"port",
")",
";",
"return",
"new",
"Socket",
"(",
"address",
",",
"port",
")",
";",
"}",
"else",
"{",
"return",
"createSSLSocket",
"(",
"address",
".",
"getHostName",
"(",
")",
",",
"port",
",",
"info",
".",
"sslConfigName",
")",
";",
"}",
"}",
"catch",
"(",
"IOException",
"ex",
")",
"{",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"Exception creating a client socket to \"",
"+",
"address",
".",
"getHostName",
"(",
")",
"+",
"\":\"",
"+",
"port",
",",
"ex",
")",
";",
"throw",
"ex",
";",
"}",
"}"
] | Create a loopback connection to the hosting
ORB.
@param address The address information for the server.
@param port The target port.
@return An appropriately configured socket based on the
listener characteristics.
@exception IOException
@exception ConnectException | [
"Create",
"a",
"loopback",
"connection",
"to",
"the",
"hosting",
"ORB",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/security/config/ssl/yoko/SocketFactory.java#L166-L194 | train |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/security/config/ssl/yoko/SocketFactory.java | SocketFactory.createServerSocket | @Override
public ServerSocket createServerSocket(int port, int backlog, InetAddress address, String[] params) throws IOException {
try {
ServerSocket socket;
String sslConfigName = null;
boolean soReuseAddr = true;
for (int i = 0; i < params.length - 1; i++) {
String param = params[i];
if ("--sslConfigName".equals(param)) {
sslConfigName = params[++i];
}
if ("--soReuseAddr".equals(param)) {
soReuseAddr = Boolean.parseBoolean(params[++i]);
}
}
OptionsKey options = sslConfig.getAssociationOptions(sslConfigName);
// if no protection is required, just create a plain socket.
if ((NoProtection.value & options.requires) == NoProtection.value) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
Tr.debug(tc, "Created plain server socket for port " + port);
socket = new ServerSocket();
} else {
// SSL is required. Create one from the SSLServerFactory retrieved from the config. This will
// require additional QOS configuration after creation.
SSLServerSocketFactory serverSocketFactory = getServerSocketFactory(sslConfigName);
SSLServerSocket serverSocket = (SSLServerSocket) serverSocketFactory.createServerSocket();
configureServerSocket(serverSocket, serverSocketFactory, sslConfigName, options);
socket = serverSocket;
}
// there is a situation that yoko closes and opens a server socket quickly upon updating
// the configuration, and occasionally, the openSocket is invoked while closeSocket is processing.
// To avoid the issue, try binding the socket a few times. Since this is the error scenario,
// it is less impact for the performance.
IOException bindError = null;
for (int i=0; i < 3; i++) {
bindError = openSocket(port, backlog, address, socket, soReuseAddr);
if (bindError == null) {
break;
}
try {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
Tr.debug(tc, "bind error, retry binding... count : " + i);
Thread.sleep(500L);
} catch (Exception e) {
Tr.debug(tc, "An exception is caught while retrying binding. the error message is " + e.getMessage());
}
}
if (bindError == null) {
// listen port can be different than config port if configed port is '0'
int listenPort = socket.getLocalPort();
SocketInfo info = new SocketInfo(address, listenPort, options, sslConfigName);
socketInfos.add(info);
} else {
Tr.error(tc, "SOCKET_BIND_ERROR", address.getHostName(), port, bindError.getLocalizedMessage());
throw bindError;
}
return socket;
} catch (SSLException e) {
throw new IOException("Could not retrieve association options from ssl configuration", e);
}
} | java | @Override
public ServerSocket createServerSocket(int port, int backlog, InetAddress address, String[] params) throws IOException {
try {
ServerSocket socket;
String sslConfigName = null;
boolean soReuseAddr = true;
for (int i = 0; i < params.length - 1; i++) {
String param = params[i];
if ("--sslConfigName".equals(param)) {
sslConfigName = params[++i];
}
if ("--soReuseAddr".equals(param)) {
soReuseAddr = Boolean.parseBoolean(params[++i]);
}
}
OptionsKey options = sslConfig.getAssociationOptions(sslConfigName);
// if no protection is required, just create a plain socket.
if ((NoProtection.value & options.requires) == NoProtection.value) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
Tr.debug(tc, "Created plain server socket for port " + port);
socket = new ServerSocket();
} else {
// SSL is required. Create one from the SSLServerFactory retrieved from the config. This will
// require additional QOS configuration after creation.
SSLServerSocketFactory serverSocketFactory = getServerSocketFactory(sslConfigName);
SSLServerSocket serverSocket = (SSLServerSocket) serverSocketFactory.createServerSocket();
configureServerSocket(serverSocket, serverSocketFactory, sslConfigName, options);
socket = serverSocket;
}
// there is a situation that yoko closes and opens a server socket quickly upon updating
// the configuration, and occasionally, the openSocket is invoked while closeSocket is processing.
// To avoid the issue, try binding the socket a few times. Since this is the error scenario,
// it is less impact for the performance.
IOException bindError = null;
for (int i=0; i < 3; i++) {
bindError = openSocket(port, backlog, address, socket, soReuseAddr);
if (bindError == null) {
break;
}
try {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
Tr.debug(tc, "bind error, retry binding... count : " + i);
Thread.sleep(500L);
} catch (Exception e) {
Tr.debug(tc, "An exception is caught while retrying binding. the error message is " + e.getMessage());
}
}
if (bindError == null) {
// listen port can be different than config port if configed port is '0'
int listenPort = socket.getLocalPort();
SocketInfo info = new SocketInfo(address, listenPort, options, sslConfigName);
socketInfos.add(info);
} else {
Tr.error(tc, "SOCKET_BIND_ERROR", address.getHostName(), port, bindError.getLocalizedMessage());
throw bindError;
}
return socket;
} catch (SSLException e) {
throw new IOException("Could not retrieve association options from ssl configuration", e);
}
} | [
"@",
"Override",
"public",
"ServerSocket",
"createServerSocket",
"(",
"int",
"port",
",",
"int",
"backlog",
",",
"InetAddress",
"address",
",",
"String",
"[",
"]",
"params",
")",
"throws",
"IOException",
"{",
"try",
"{",
"ServerSocket",
"socket",
";",
"String",
"sslConfigName",
"=",
"null",
";",
"boolean",
"soReuseAddr",
"=",
"true",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"params",
".",
"length",
"-",
"1",
";",
"i",
"++",
")",
"{",
"String",
"param",
"=",
"params",
"[",
"i",
"]",
";",
"if",
"(",
"\"--sslConfigName\"",
".",
"equals",
"(",
"param",
")",
")",
"{",
"sslConfigName",
"=",
"params",
"[",
"++",
"i",
"]",
";",
"}",
"if",
"(",
"\"--soReuseAddr\"",
".",
"equals",
"(",
"param",
")",
")",
"{",
"soReuseAddr",
"=",
"Boolean",
".",
"parseBoolean",
"(",
"params",
"[",
"++",
"i",
"]",
")",
";",
"}",
"}",
"OptionsKey",
"options",
"=",
"sslConfig",
".",
"getAssociationOptions",
"(",
"sslConfigName",
")",
";",
"// if no protection is required, just create a plain socket.",
"if",
"(",
"(",
"NoProtection",
".",
"value",
"&",
"options",
".",
"requires",
")",
"==",
"NoProtection",
".",
"value",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"Created plain server socket for port \"",
"+",
"port",
")",
";",
"socket",
"=",
"new",
"ServerSocket",
"(",
")",
";",
"}",
"else",
"{",
"// SSL is required. Create one from the SSLServerFactory retrieved from the config. This will",
"// require additional QOS configuration after creation.",
"SSLServerSocketFactory",
"serverSocketFactory",
"=",
"getServerSocketFactory",
"(",
"sslConfigName",
")",
";",
"SSLServerSocket",
"serverSocket",
"=",
"(",
"SSLServerSocket",
")",
"serverSocketFactory",
".",
"createServerSocket",
"(",
")",
";",
"configureServerSocket",
"(",
"serverSocket",
",",
"serverSocketFactory",
",",
"sslConfigName",
",",
"options",
")",
";",
"socket",
"=",
"serverSocket",
";",
"}",
"// there is a situation that yoko closes and opens a server socket quickly upon updating",
"// the configuration, and occasionally, the openSocket is invoked while closeSocket is processing.",
"// To avoid the issue, try binding the socket a few times. Since this is the error scenario, ",
"// it is less impact for the performance.",
"IOException",
"bindError",
"=",
"null",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"3",
";",
"i",
"++",
")",
"{",
"bindError",
"=",
"openSocket",
"(",
"port",
",",
"backlog",
",",
"address",
",",
"socket",
",",
"soReuseAddr",
")",
";",
"if",
"(",
"bindError",
"==",
"null",
")",
"{",
"break",
";",
"}",
"try",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEventEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"bind error, retry binding... count : \"",
"+",
"i",
")",
";",
"Thread",
".",
"sleep",
"(",
"500L",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"Tr",
".",
"debug",
"(",
"tc",
",",
"\"An exception is caught while retrying binding. the error message is \"",
"+",
"e",
".",
"getMessage",
"(",
")",
")",
";",
"}",
"}",
"if",
"(",
"bindError",
"==",
"null",
")",
"{",
"// listen port can be different than config port if configed port is '0'",
"int",
"listenPort",
"=",
"socket",
".",
"getLocalPort",
"(",
")",
";",
"SocketInfo",
"info",
"=",
"new",
"SocketInfo",
"(",
"address",
",",
"listenPort",
",",
"options",
",",
"sslConfigName",
")",
";",
"socketInfos",
".",
"add",
"(",
"info",
")",
";",
"}",
"else",
"{",
"Tr",
".",
"error",
"(",
"tc",
",",
"\"SOCKET_BIND_ERROR\"",
",",
"address",
".",
"getHostName",
"(",
")",
",",
"port",
",",
"bindError",
".",
"getLocalizedMessage",
"(",
")",
")",
";",
"throw",
"bindError",
";",
"}",
"return",
"socket",
";",
"}",
"catch",
"(",
"SSLException",
"e",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"Could not retrieve association options from ssl configuration\"",
",",
"e",
")",
";",
"}",
"}"
] | Create a server socket for this connection.
@param port The target listener port.
@param backlog The requested backlog value for the connection.
@param address The host address information we're publishing under.
@return An appropriately configured ServerSocket for this
connection.
@exception IOException
@exception ConnectException | [
"Create",
"a",
"server",
"socket",
"for",
"this",
"connection",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.csiv2.common/src/com/ibm/ws/transport/iiop/security/config/ssl/yoko/SocketFactory.java#L223-L284 | train |
Subsets and Splits