repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
sequence
docstring
stringlengths
3
16k
docstring_tokens
sequence
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
OpenLiberty/open-liberty
dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/TagHandlerUtils.java
TagHandlerUtils.findFirstNextByType
public static <T> T findFirstNextByType(FaceletHandler nextHandler, Class<T> type) { if (type.isAssignableFrom(nextHandler.getClass())) { return (T)nextHandler; } else if (nextHandler instanceof javax.faces.view.facelets.CompositeFaceletHandler) { for (FaceletHandler handler : ((javax.faces.view.facelets.CompositeFaceletHandler)nextHandler).getHandlers()) { if (type.isAssignableFrom(handler.getClass())) { return (T)handler; } } } return null; }
java
public static <T> T findFirstNextByType(FaceletHandler nextHandler, Class<T> type) { if (type.isAssignableFrom(nextHandler.getClass())) { return (T)nextHandler; } else if (nextHandler instanceof javax.faces.view.facelets.CompositeFaceletHandler) { for (FaceletHandler handler : ((javax.faces.view.facelets.CompositeFaceletHandler)nextHandler).getHandlers()) { if (type.isAssignableFrom(handler.getClass())) { return (T)handler; } } } return null; }
[ "public", "static", "<", "T", ">", "T", "findFirstNextByType", "(", "FaceletHandler", "nextHandler", ",", "Class", "<", "T", ">", "type", ")", "{", "if", "(", "type", ".", "isAssignableFrom", "(", "nextHandler", ".", "getClass", "(", ")", ")", ")", "{", "return", "(", "T", ")", "nextHandler", ";", "}", "else", "if", "(", "nextHandler", "instanceof", "javax", ".", "faces", ".", "view", ".", "facelets", ".", "CompositeFaceletHandler", ")", "{", "for", "(", "FaceletHandler", "handler", ":", "(", "(", "javax", ".", "faces", ".", "view", ".", "facelets", ".", "CompositeFaceletHandler", ")", "nextHandler", ")", ".", "getHandlers", "(", ")", ")", "{", "if", "(", "type", ".", "isAssignableFrom", "(", "handler", ".", "getClass", "(", ")", ")", ")", "{", "return", "(", "T", ")", "handler", ";", "}", "}", "}", "return", "null", ";", "}" ]
Find the first occurence of a tag handler that is instanceof T @since 2.0.1 @param <T> @param nextHandler @param type @return
[ "Find", "the", "first", "occurence", "of", "a", "tag", "handler", "that", "is", "instanceof", "T" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/TagHandlerUtils.java#L49-L67
train
OpenLiberty/open-liberty
dev/com.ibm.ws.kernel.service/src/com/ibm/wsspi/kernel/service/utils/FileUtils.java
FileUtils.tryToClose
public static boolean tryToClose(Closeable closeable) { Object token = ThreadIdentityManager.runAsServer(); try { if (closeable != null) { try { closeable.close(); return true; } catch (IOException e) { // ignore } } } finally { ThreadIdentityManager.reset(token); } return false; }
java
public static boolean tryToClose(Closeable closeable) { Object token = ThreadIdentityManager.runAsServer(); try { if (closeable != null) { try { closeable.close(); return true; } catch (IOException e) { // ignore } } } finally { ThreadIdentityManager.reset(token); } return false; }
[ "public", "static", "boolean", "tryToClose", "(", "Closeable", "closeable", ")", "{", "Object", "token", "=", "ThreadIdentityManager", ".", "runAsServer", "(", ")", ";", "try", "{", "if", "(", "closeable", "!=", "null", ")", "{", "try", "{", "closeable", ".", "close", "(", ")", ";", "return", "true", ";", "}", "catch", "(", "IOException", "e", ")", "{", "// ignore", "}", "}", "}", "finally", "{", "ThreadIdentityManager", ".", "reset", "(", "token", ")", ";", "}", "return", "false", ";", "}" ]
Close the closeable object @param closeable
[ "Close", "the", "closeable", "object" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.service/src/com/ibm/wsspi/kernel/service/utils/FileUtils.java#L328-L343
train
OpenLiberty/open-liberty
dev/com.ibm.ws.security.openidconnect.clients.common/src/com/ibm/ws/security/openidconnect/common/ConfigUtils.java
ConfigUtils.setDefaultDiscoveryProperties
private static void setDefaultDiscoveryProperties() { defaultDiscoveryProperties.put(KEY_OIDC_RESPONSE_TYPES_SUPP, new String[] { "code", "token", "id_token token" }); defaultDiscoveryProperties.put(KEY_OIDC_SUB_TYPES_SUPP, new String[] { "public" }); defaultDiscoveryProperties.put(KEY_OIDC_ID_TOKEN_SIGNING_ALG_VAL_SUPP, new String[] { "HS256" }); defaultDiscoveryProperties.put(KEY_OIDC_SCOPES_SUPP, new String[] { "openid", "general", "profile", "email", "address", "phone" }); defaultDiscoveryProperties.put(KEY_OIDC_CLAIMS_SUPP, new String[] { "sub", "groupIds", "name", "preferred_username", "picture", "locale", "email", "profile" }); defaultDiscoveryProperties.put(KEY_OIDC_RESP_MODES_SUPP, new String[] { "query", "fragment", "form_post" }); defaultDiscoveryProperties.put(KEY_OIDC_GRANT_TYPES_SUPP, new String[] { "authorization_code", "implicit", "refresh_token", "client_credentials", "password", "urn:ietf:params:oauth:grant-type:jwt-bearer" }); defaultDiscoveryProperties.put(KEY_OIDC_TOKEN_EP_AUTH_METHODS_SUPP, new String[] { "client_secret_post", "client_secret_basic" }); defaultDiscoveryProperties.put(KEY_OIDC_DISPLAY_VAL_SUPP, new String[] { "page" }); defaultDiscoveryProperties.put(KEY_OIDC_CLAIM_TYPES_SUPP, new String[] { "normal" }); defaultDiscoveryClaimsParmSupp = false; defaultDiscoveryRequestParmSupp = false; defaultDiscoveryRequestUriParmSupp = false; defaultDiscoveryRequireRequestUriRegistrationSupp = false; }
java
private static void setDefaultDiscoveryProperties() { defaultDiscoveryProperties.put(KEY_OIDC_RESPONSE_TYPES_SUPP, new String[] { "code", "token", "id_token token" }); defaultDiscoveryProperties.put(KEY_OIDC_SUB_TYPES_SUPP, new String[] { "public" }); defaultDiscoveryProperties.put(KEY_OIDC_ID_TOKEN_SIGNING_ALG_VAL_SUPP, new String[] { "HS256" }); defaultDiscoveryProperties.put(KEY_OIDC_SCOPES_SUPP, new String[] { "openid", "general", "profile", "email", "address", "phone" }); defaultDiscoveryProperties.put(KEY_OIDC_CLAIMS_SUPP, new String[] { "sub", "groupIds", "name", "preferred_username", "picture", "locale", "email", "profile" }); defaultDiscoveryProperties.put(KEY_OIDC_RESP_MODES_SUPP, new String[] { "query", "fragment", "form_post" }); defaultDiscoveryProperties.put(KEY_OIDC_GRANT_TYPES_SUPP, new String[] { "authorization_code", "implicit", "refresh_token", "client_credentials", "password", "urn:ietf:params:oauth:grant-type:jwt-bearer" }); defaultDiscoveryProperties.put(KEY_OIDC_TOKEN_EP_AUTH_METHODS_SUPP, new String[] { "client_secret_post", "client_secret_basic" }); defaultDiscoveryProperties.put(KEY_OIDC_DISPLAY_VAL_SUPP, new String[] { "page" }); defaultDiscoveryProperties.put(KEY_OIDC_CLAIM_TYPES_SUPP, new String[] { "normal" }); defaultDiscoveryClaimsParmSupp = false; defaultDiscoveryRequestParmSupp = false; defaultDiscoveryRequestUriParmSupp = false; defaultDiscoveryRequireRequestUriRegistrationSupp = false; }
[ "private", "static", "void", "setDefaultDiscoveryProperties", "(", ")", "{", "defaultDiscoveryProperties", ".", "put", "(", "KEY_OIDC_RESPONSE_TYPES_SUPP", ",", "new", "String", "[", "]", "{", "\"code\"", ",", "\"token\"", ",", "\"id_token token\"", "}", ")", ";", "defaultDiscoveryProperties", ".", "put", "(", "KEY_OIDC_SUB_TYPES_SUPP", ",", "new", "String", "[", "]", "{", "\"public\"", "}", ")", ";", "defaultDiscoveryProperties", ".", "put", "(", "KEY_OIDC_ID_TOKEN_SIGNING_ALG_VAL_SUPP", ",", "new", "String", "[", "]", "{", "\"HS256\"", "}", ")", ";", "defaultDiscoveryProperties", ".", "put", "(", "KEY_OIDC_SCOPES_SUPP", ",", "new", "String", "[", "]", "{", "\"openid\"", ",", "\"general\"", ",", "\"profile\"", ",", "\"email\"", ",", "\"address\"", ",", "\"phone\"", "}", ")", ";", "defaultDiscoveryProperties", ".", "put", "(", "KEY_OIDC_CLAIMS_SUPP", ",", "new", "String", "[", "]", "{", "\"sub\"", ",", "\"groupIds\"", ",", "\"name\"", ",", "\"preferred_username\"", ",", "\"picture\"", ",", "\"locale\"", ",", "\"email\"", ",", "\"profile\"", "}", ")", ";", "defaultDiscoveryProperties", ".", "put", "(", "KEY_OIDC_RESP_MODES_SUPP", ",", "new", "String", "[", "]", "{", "\"query\"", ",", "\"fragment\"", ",", "\"form_post\"", "}", ")", ";", "defaultDiscoveryProperties", ".", "put", "(", "KEY_OIDC_GRANT_TYPES_SUPP", ",", "new", "String", "[", "]", "{", "\"authorization_code\"", ",", "\"implicit\"", ",", "\"refresh_token\"", ",", "\"client_credentials\"", ",", "\"password\"", ",", "\"urn:ietf:params:oauth:grant-type:jwt-bearer\"", "}", ")", ";", "defaultDiscoveryProperties", ".", "put", "(", "KEY_OIDC_TOKEN_EP_AUTH_METHODS_SUPP", ",", "new", "String", "[", "]", "{", "\"client_secret_post\"", ",", "\"client_secret_basic\"", "}", ")", ";", "defaultDiscoveryProperties", ".", "put", "(", "KEY_OIDC_DISPLAY_VAL_SUPP", ",", "new", "String", "[", "]", "{", "\"page\"", "}", ")", ";", "defaultDiscoveryProperties", ".", "put", "(", "KEY_OIDC_CLAIM_TYPES_SUPP", ",", "new", "String", "[", "]", "{", "\"normal\"", "}", ")", ";", "defaultDiscoveryClaimsParmSupp", "=", "false", ";", "defaultDiscoveryRequestParmSupp", "=", "false", ";", "defaultDiscoveryRequestUriParmSupp", "=", "false", ";", "defaultDiscoveryRequireRequestUriRegistrationSupp", "=", "false", ";", "}" ]
Should model what is set as default in the oidc.server metatype.xml
[ "Should", "model", "what", "is", "set", "as", "default", "in", "the", "oidc", ".", "server", "metatype", ".", "xml" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.openidconnect.clients.common/src/com/ibm/ws/security/openidconnect/common/ConfigUtils.java#L134-L151
train
OpenLiberty/open-liberty
dev/com.ibm.ws.security.openidconnect.clients.common/src/com/ibm/ws/security/openidconnect/common/ConfigUtils.java
ConfigUtils.populateCustomRequestParameterMap
public void populateCustomRequestParameterMap(ConfigurationAdmin configAdmin, HashMap<String, String> paramMapToPopulate, String[] configuredCustomRequestParams, String configAttrName, String configAttrValue) { if (configuredCustomRequestParams == null) { return; } for (String configuredParameter : configuredCustomRequestParams) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Configured custom request param [" + configuredParameter + "]"); } Configuration config = getConfigurationFromConfigAdmin(configAdmin, configuredParameter); if (config != null) { addCustomRequestParameterValueToMap(config, paramMapToPopulate, configAttrName, configAttrValue); } } }
java
public void populateCustomRequestParameterMap(ConfigurationAdmin configAdmin, HashMap<String, String> paramMapToPopulate, String[] configuredCustomRequestParams, String configAttrName, String configAttrValue) { if (configuredCustomRequestParams == null) { return; } for (String configuredParameter : configuredCustomRequestParams) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Configured custom request param [" + configuredParameter + "]"); } Configuration config = getConfigurationFromConfigAdmin(configAdmin, configuredParameter); if (config != null) { addCustomRequestParameterValueToMap(config, paramMapToPopulate, configAttrName, configAttrValue); } } }
[ "public", "void", "populateCustomRequestParameterMap", "(", "ConfigurationAdmin", "configAdmin", ",", "HashMap", "<", "String", ",", "String", ">", "paramMapToPopulate", ",", "String", "[", "]", "configuredCustomRequestParams", ",", "String", "configAttrName", ",", "String", "configAttrValue", ")", "{", "if", "(", "configuredCustomRequestParams", "==", "null", ")", "{", "return", ";", "}", "for", "(", "String", "configuredParameter", ":", "configuredCustomRequestParams", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"Configured custom request param [\"", "+", "configuredParameter", "+", "\"]\"", ")", ";", "}", "Configuration", "config", "=", "getConfigurationFromConfigAdmin", "(", "configAdmin", ",", "configuredParameter", ")", ";", "if", "(", "config", "!=", "null", ")", "{", "addCustomRequestParameterValueToMap", "(", "config", ",", "paramMapToPopulate", ",", "configAttrName", ",", "configAttrValue", ")", ";", "}", "}", "}" ]
Populates a map of custom request parameter names and values to add to a certain OpenID Connect request type. @param configAdmin Config admin that has access to the necessary server configuration properties. @param paramMapToPopulate Request-specific map of custom parameters to populate (for example, a map of parameters to add to authorization requests). @param configuredCustomRequestParams List of configured custom parameter elements for a particular request type. @param configAttrName Name of the config attribute that specifies the parameter name. @param configAttrValue Name of the config attribute that specifies the parameter value.
[ "Populates", "a", "map", "of", "custom", "request", "parameter", "names", "and", "values", "to", "add", "to", "a", "certain", "OpenID", "Connect", "request", "type", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.openidconnect.clients.common/src/com/ibm/ws/security/openidconnect/common/ConfigUtils.java#L408-L421
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java
AbstractEJBRuntime.stopModule
public void stopModule(EJBModuleMetaDataImpl mmd) { try { //210058 uninstall(mmd, false); } catch (Throwable t) { //210058 FFDCFilter.processException(t, CLASS_NAME + ".stop", "3059", this); throw new ContainerEJBException("Failed to stop - caught Throwable", t); } }
java
public void stopModule(EJBModuleMetaDataImpl mmd) { try { //210058 uninstall(mmd, false); } catch (Throwable t) { //210058 FFDCFilter.processException(t, CLASS_NAME + ".stop", "3059", this); throw new ContainerEJBException("Failed to stop - caught Throwable", t); } }
[ "public", "void", "stopModule", "(", "EJBModuleMetaDataImpl", "mmd", ")", "{", "try", "{", "//210058", "uninstall", "(", "mmd", ",", "false", ")", ";", "}", "catch", "(", "Throwable", "t", ")", "{", "//210058", "FFDCFilter", ".", "processException", "(", "t", ",", "CLASS_NAME", "+", "\".stop\"", ",", "\"3059\"", ",", "this", ")", ";", "throw", "new", "ContainerEJBException", "(", "\"Failed to stop - caught Throwable\"", ",", "t", ")", ";", "}", "}" ]
Stops an EJB module. @param mmd the module metadata
[ "Stops", "an", "EJB", "module", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java#L662-L669
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java
AbstractEJBRuntime.bindInterfaces
protected void bindInterfaces(NameSpaceBinder<?> binder, BeanMetaData bmd) throws Exception { HomeWrapperSet homeSet = null; EJSHome home = bmd.homeRecord.getHome(); if (home != null) { homeSet = home.getWrapperSet(); } int numRemoteInterfaces = countInterfaces(bmd, false); int numLocalInterfaces = countInterfaces(bmd, true); boolean singleGlobalInterface = (numRemoteInterfaces + numLocalInterfaces) == 1; bindInterfaces(binder, bmd, homeSet, false, numRemoteInterfaces, singleGlobalInterface); bindInterfaces(binder, bmd, homeSet, true, numLocalInterfaces, singleGlobalInterface); }
java
protected void bindInterfaces(NameSpaceBinder<?> binder, BeanMetaData bmd) throws Exception { HomeWrapperSet homeSet = null; EJSHome home = bmd.homeRecord.getHome(); if (home != null) { homeSet = home.getWrapperSet(); } int numRemoteInterfaces = countInterfaces(bmd, false); int numLocalInterfaces = countInterfaces(bmd, true); boolean singleGlobalInterface = (numRemoteInterfaces + numLocalInterfaces) == 1; bindInterfaces(binder, bmd, homeSet, false, numRemoteInterfaces, singleGlobalInterface); bindInterfaces(binder, bmd, homeSet, true, numLocalInterfaces, singleGlobalInterface); }
[ "protected", "void", "bindInterfaces", "(", "NameSpaceBinder", "<", "?", ">", "binder", ",", "BeanMetaData", "bmd", ")", "throws", "Exception", "{", "HomeWrapperSet", "homeSet", "=", "null", ";", "EJSHome", "home", "=", "bmd", ".", "homeRecord", ".", "getHome", "(", ")", ";", "if", "(", "home", "!=", "null", ")", "{", "homeSet", "=", "home", ".", "getWrapperSet", "(", ")", ";", "}", "int", "numRemoteInterfaces", "=", "countInterfaces", "(", "bmd", ",", "false", ")", ";", "int", "numLocalInterfaces", "=", "countInterfaces", "(", "bmd", ",", "true", ")", ";", "boolean", "singleGlobalInterface", "=", "(", "numRemoteInterfaces", "+", "numLocalInterfaces", ")", "==", "1", ";", "bindInterfaces", "(", "binder", ",", "bmd", ",", "homeSet", ",", "false", ",", "numRemoteInterfaces", ",", "singleGlobalInterface", ")", ";", "bindInterfaces", "(", "binder", ",", "bmd", ",", "homeSet", ",", "true", ",", "numLocalInterfaces", ",", "singleGlobalInterface", ")", ";", "}" ]
Bind all local and remote interfaces for a bean to all binding locations. @param binder the namespace binder @param bmd the bean @param homeSet the remote and local home wrappers, or <tt>null</tt> if deferred initialization bindings should be used
[ "Bind", "all", "local", "and", "remote", "interfaces", "for", "a", "bean", "to", "all", "binding", "locations", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java#L851-L864
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java
AbstractEJBRuntime.countInterfaces
private int countInterfaces(BeanMetaData bmd, boolean local) // F743-23167 { // Note that these variables must be kept in sync with bindInterfaces. String homeInterfaceClassName = local ? bmd.localHomeInterfaceClassName : bmd.homeInterfaceClassName; boolean hasLocalBean = local && bmd.ivLocalBean; String[] businessInterfaceNames = local ? bmd.ivBusinessLocalInterfaceClassNames : bmd.ivBusinessRemoteInterfaceClassNames; int result = (homeInterfaceClassName == null ? 0 : 1) + (hasLocalBean ? 1 : 0) + (businessInterfaceNames == null ? 0 : businessInterfaceNames.length); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "countInterfaces: " + bmd.j2eeName + ", local=" + local + ", result=" + result); return result; }
java
private int countInterfaces(BeanMetaData bmd, boolean local) // F743-23167 { // Note that these variables must be kept in sync with bindInterfaces. String homeInterfaceClassName = local ? bmd.localHomeInterfaceClassName : bmd.homeInterfaceClassName; boolean hasLocalBean = local && bmd.ivLocalBean; String[] businessInterfaceNames = local ? bmd.ivBusinessLocalInterfaceClassNames : bmd.ivBusinessRemoteInterfaceClassNames; int result = (homeInterfaceClassName == null ? 0 : 1) + (hasLocalBean ? 1 : 0) + (businessInterfaceNames == null ? 0 : businessInterfaceNames.length); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "countInterfaces: " + bmd.j2eeName + ", local=" + local + ", result=" + result); return result; }
[ "private", "int", "countInterfaces", "(", "BeanMetaData", "bmd", ",", "boolean", "local", ")", "// F743-23167", "{", "// Note that these variables must be kept in sync with bindInterfaces.", "String", "homeInterfaceClassName", "=", "local", "?", "bmd", ".", "localHomeInterfaceClassName", ":", "bmd", ".", "homeInterfaceClassName", ";", "boolean", "hasLocalBean", "=", "local", "&&", "bmd", ".", "ivLocalBean", ";", "String", "[", "]", "businessInterfaceNames", "=", "local", "?", "bmd", ".", "ivBusinessLocalInterfaceClassNames", ":", "bmd", ".", "ivBusinessRemoteInterfaceClassNames", ";", "int", "result", "=", "(", "homeInterfaceClassName", "==", "null", "?", "0", ":", "1", ")", "+", "(", "hasLocalBean", "?", "1", ":", "0", ")", "+", "(", "businessInterfaceNames", "==", "null", "?", "0", ":", "businessInterfaceNames", ".", "length", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"countInterfaces: \"", "+", "bmd", ".", "j2eeName", "+", "\", local=\"", "+", "local", "+", "\", result=\"", "+", "result", ")", ";", "return", "result", ";", "}" ]
Determine the number of remote or local interfaces exposed by a bean. @param bmd the bean @param local <tt>true</tt> if local interfaces should be counted, or <tt>false</tt> if remote interfaces should be counted @return the number of remote or local interfaces
[ "Determine", "the", "number", "of", "remote", "or", "local", "interfaces", "exposed", "by", "a", "bean", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java#L874-L888
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java
AbstractEJBRuntime.bindInterfaces
private void bindInterfaces(NameSpaceBinder<?> binder, BeanMetaData bmd, HomeWrapperSet homeSet, boolean local, int numInterfaces, boolean singleGlobalInterface) // F743-23167 throws NamingException, RemoteException, CreateException { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "bindInterfaces: " + bmd.j2eeName + ", deferred=" + (homeSet == null) + ", local=" + local); // Note that these variables must be kept in sync with countInterfaces. String homeInterfaceClassName = local ? bmd.localHomeInterfaceClassName : bmd.homeInterfaceClassName; boolean hasLocalBean = local && bmd.ivLocalBean; String[] businessInterfaceNames = local ? bmd.ivBusinessLocalInterfaceClassNames : bmd.ivBusinessRemoteInterfaceClassNames; // If we have multiple interfaces (e.g., a home and one business // interface, or multiple business interfaces), and simple binding name // was specified, then issue a warning message that simple binding name // is misused. if (numInterfaces > 1 && bmd.simpleJndiBindingName != null) { Tr.warning(tc, "SIMPLE_BINDING_NAME_MISSUSED_CNTR0168W", new Object[] { bmd.enterpriseBeanName, bmd._moduleMetaData.ivName, bmd._moduleMetaData.ivAppName }); } HomeRecord hr = bmd.homeRecord; // Bind the home interface, if any. if (homeInterfaceClassName != null) { bindInterface(binder, hr, homeSet, numInterfaces, singleGlobalInterface, homeInterfaceClassName, -1, local); } // Bind the no-interface view, if any. int interfaceIndex = 0; if (hasLocalBean) { bindInterface(binder, hr, homeSet, numInterfaces, singleGlobalInterface, bmd.enterpriseBeanClassName, interfaceIndex, local); interfaceIndex++; } // Bind business interfaces, if any. if (businessInterfaceNames != null) { for (String businessInterfaceName : businessInterfaceNames) { bindInterface(binder, hr, homeSet, numInterfaces, singleGlobalInterface, businessInterfaceName, interfaceIndex, local); interfaceIndex++; } } if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "bindInterfaces"); }
java
private void bindInterfaces(NameSpaceBinder<?> binder, BeanMetaData bmd, HomeWrapperSet homeSet, boolean local, int numInterfaces, boolean singleGlobalInterface) // F743-23167 throws NamingException, RemoteException, CreateException { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "bindInterfaces: " + bmd.j2eeName + ", deferred=" + (homeSet == null) + ", local=" + local); // Note that these variables must be kept in sync with countInterfaces. String homeInterfaceClassName = local ? bmd.localHomeInterfaceClassName : bmd.homeInterfaceClassName; boolean hasLocalBean = local && bmd.ivLocalBean; String[] businessInterfaceNames = local ? bmd.ivBusinessLocalInterfaceClassNames : bmd.ivBusinessRemoteInterfaceClassNames; // If we have multiple interfaces (e.g., a home and one business // interface, or multiple business interfaces), and simple binding name // was specified, then issue a warning message that simple binding name // is misused. if (numInterfaces > 1 && bmd.simpleJndiBindingName != null) { Tr.warning(tc, "SIMPLE_BINDING_NAME_MISSUSED_CNTR0168W", new Object[] { bmd.enterpriseBeanName, bmd._moduleMetaData.ivName, bmd._moduleMetaData.ivAppName }); } HomeRecord hr = bmd.homeRecord; // Bind the home interface, if any. if (homeInterfaceClassName != null) { bindInterface(binder, hr, homeSet, numInterfaces, singleGlobalInterface, homeInterfaceClassName, -1, local); } // Bind the no-interface view, if any. int interfaceIndex = 0; if (hasLocalBean) { bindInterface(binder, hr, homeSet, numInterfaces, singleGlobalInterface, bmd.enterpriseBeanClassName, interfaceIndex, local); interfaceIndex++; } // Bind business interfaces, if any. if (businessInterfaceNames != null) { for (String businessInterfaceName : businessInterfaceNames) { bindInterface(binder, hr, homeSet, numInterfaces, singleGlobalInterface, businessInterfaceName, interfaceIndex, local); interfaceIndex++; } } if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "bindInterfaces"); }
[ "private", "void", "bindInterfaces", "(", "NameSpaceBinder", "<", "?", ">", "binder", ",", "BeanMetaData", "bmd", ",", "HomeWrapperSet", "homeSet", ",", "boolean", "local", ",", "int", "numInterfaces", ",", "boolean", "singleGlobalInterface", ")", "// F743-23167", "throws", "NamingException", ",", "RemoteException", ",", "CreateException", "{", "final", "boolean", "isTraceOn", "=", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", ";", "if", "(", "isTraceOn", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"bindInterfaces: \"", "+", "bmd", ".", "j2eeName", "+", "\", deferred=\"", "+", "(", "homeSet", "==", "null", ")", "+", "\", local=\"", "+", "local", ")", ";", "// Note that these variables must be kept in sync with countInterfaces.", "String", "homeInterfaceClassName", "=", "local", "?", "bmd", ".", "localHomeInterfaceClassName", ":", "bmd", ".", "homeInterfaceClassName", ";", "boolean", "hasLocalBean", "=", "local", "&&", "bmd", ".", "ivLocalBean", ";", "String", "[", "]", "businessInterfaceNames", "=", "local", "?", "bmd", ".", "ivBusinessLocalInterfaceClassNames", ":", "bmd", ".", "ivBusinessRemoteInterfaceClassNames", ";", "// If we have multiple interfaces (e.g., a home and one business", "// interface, or multiple business interfaces), and simple binding name", "// was specified, then issue a warning message that simple binding name", "// is misused.", "if", "(", "numInterfaces", ">", "1", "&&", "bmd", ".", "simpleJndiBindingName", "!=", "null", ")", "{", "Tr", ".", "warning", "(", "tc", ",", "\"SIMPLE_BINDING_NAME_MISSUSED_CNTR0168W\"", ",", "new", "Object", "[", "]", "{", "bmd", ".", "enterpriseBeanName", ",", "bmd", ".", "_moduleMetaData", ".", "ivName", ",", "bmd", ".", "_moduleMetaData", ".", "ivAppName", "}", ")", ";", "}", "HomeRecord", "hr", "=", "bmd", ".", "homeRecord", ";", "// Bind the home interface, if any.", "if", "(", "homeInterfaceClassName", "!=", "null", ")", "{", "bindInterface", "(", "binder", ",", "hr", ",", "homeSet", ",", "numInterfaces", ",", "singleGlobalInterface", ",", "homeInterfaceClassName", ",", "-", "1", ",", "local", ")", ";", "}", "// Bind the no-interface view, if any.", "int", "interfaceIndex", "=", "0", ";", "if", "(", "hasLocalBean", ")", "{", "bindInterface", "(", "binder", ",", "hr", ",", "homeSet", ",", "numInterfaces", ",", "singleGlobalInterface", ",", "bmd", ".", "enterpriseBeanClassName", ",", "interfaceIndex", ",", "local", ")", ";", "interfaceIndex", "++", ";", "}", "// Bind business interfaces, if any.", "if", "(", "businessInterfaceNames", "!=", "null", ")", "{", "for", "(", "String", "businessInterfaceName", ":", "businessInterfaceNames", ")", "{", "bindInterface", "(", "binder", ",", "hr", ",", "homeSet", ",", "numInterfaces", ",", "singleGlobalInterface", ",", "businessInterfaceName", ",", "interfaceIndex", ",", "local", ")", ";", "interfaceIndex", "++", ";", "}", "}", "if", "(", "isTraceOn", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "tc", ",", "\"bindInterfaces\"", ")", ";", "}" ]
Bind all interfaces for a bean to all binding locations. @param binder the namespace binder @param bmd the bean @param homeSet the remote and local home wrappers, or <tt>null</tt> if deferred initialization bindings should be used @param local <tt>true</tt> if local interfaces should be bound, or <tt>false</tt> if remote interfaces should be bound @param numInterfaces the number of local or remote interfaces; the result of passing bmd and local to {@link #countInterfaces} @param singleGlobalInterface <tt>true</tt> if this bean has only one total interface (counting local and remote together)
[ "Bind", "all", "interfaces", "for", "a", "bean", "to", "all", "binding", "locations", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java#L904-L958
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java
AbstractEJBRuntime.bindInterface
private <T> void bindInterface(NameSpaceBinder<T> binder, HomeRecord hr, HomeWrapperSet homeSet, int numInterfaces, boolean singleGlobalInterface, String interfaceName, int interfaceIndex, boolean local) throws NamingException, RemoteException, CreateException { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "bindInterface: " + hr.getJ2EEName() + ", " + interfaceIndex + ", " + interfaceName + ", local=" + local); // Create the object to be bound. T bindingObject = binder.createBindingObject(hr, homeSet, interfaceName, interfaceIndex, local); // Bind the object to configured locations. boolean deferred = homeSet == null; if (hr.bindToContextRoot()) // F743-34301 { binder.bindBindings(bindingObject, // F69147.2 hr, numInterfaces, singleGlobalInterface, interfaceIndex, interfaceName, local, deferred); } // Bind session and managed bean objects to java:global/app/module. if (hr.bindToJavaNameSpaces()) // F743-34301, d660700 { T javaBindingObject = binder.createJavaBindingObject(hr, homeSet, interfaceName, interfaceIndex, local, bindingObject); // F69147.2 bindObjectToJavaNameSpaces(binder, javaBindingObject, hr, singleGlobalInterface, interfaceName, interfaceIndex, local); } if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "bindInterface"); }
java
private <T> void bindInterface(NameSpaceBinder<T> binder, HomeRecord hr, HomeWrapperSet homeSet, int numInterfaces, boolean singleGlobalInterface, String interfaceName, int interfaceIndex, boolean local) throws NamingException, RemoteException, CreateException { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "bindInterface: " + hr.getJ2EEName() + ", " + interfaceIndex + ", " + interfaceName + ", local=" + local); // Create the object to be bound. T bindingObject = binder.createBindingObject(hr, homeSet, interfaceName, interfaceIndex, local); // Bind the object to configured locations. boolean deferred = homeSet == null; if (hr.bindToContextRoot()) // F743-34301 { binder.bindBindings(bindingObject, // F69147.2 hr, numInterfaces, singleGlobalInterface, interfaceIndex, interfaceName, local, deferred); } // Bind session and managed bean objects to java:global/app/module. if (hr.bindToJavaNameSpaces()) // F743-34301, d660700 { T javaBindingObject = binder.createJavaBindingObject(hr, homeSet, interfaceName, interfaceIndex, local, bindingObject); // F69147.2 bindObjectToJavaNameSpaces(binder, javaBindingObject, hr, singleGlobalInterface, interfaceName, interfaceIndex, local); } if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "bindInterface"); }
[ "private", "<", "T", ">", "void", "bindInterface", "(", "NameSpaceBinder", "<", "T", ">", "binder", ",", "HomeRecord", "hr", ",", "HomeWrapperSet", "homeSet", ",", "int", "numInterfaces", ",", "boolean", "singleGlobalInterface", ",", "String", "interfaceName", ",", "int", "interfaceIndex", ",", "boolean", "local", ")", "throws", "NamingException", ",", "RemoteException", ",", "CreateException", "{", "final", "boolean", "isTraceOn", "=", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", ";", "if", "(", "isTraceOn", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"bindInterface: \"", "+", "hr", ".", "getJ2EEName", "(", ")", "+", "\", \"", "+", "interfaceIndex", "+", "\", \"", "+", "interfaceName", "+", "\", local=\"", "+", "local", ")", ";", "// Create the object to be bound.", "T", "bindingObject", "=", "binder", ".", "createBindingObject", "(", "hr", ",", "homeSet", ",", "interfaceName", ",", "interfaceIndex", ",", "local", ")", ";", "// Bind the object to configured locations.", "boolean", "deferred", "=", "homeSet", "==", "null", ";", "if", "(", "hr", ".", "bindToContextRoot", "(", ")", ")", "// F743-34301", "{", "binder", ".", "bindBindings", "(", "bindingObject", ",", "// F69147.2", "hr", ",", "numInterfaces", ",", "singleGlobalInterface", ",", "interfaceIndex", ",", "interfaceName", ",", "local", ",", "deferred", ")", ";", "}", "// Bind session and managed bean objects to java:global/app/module.", "if", "(", "hr", ".", "bindToJavaNameSpaces", "(", ")", ")", "// F743-34301, d660700", "{", "T", "javaBindingObject", "=", "binder", ".", "createJavaBindingObject", "(", "hr", ",", "homeSet", ",", "interfaceName", ",", "interfaceIndex", ",", "local", ",", "bindingObject", ")", ";", "// F69147.2", "bindObjectToJavaNameSpaces", "(", "binder", ",", "javaBindingObject", ",", "hr", ",", "singleGlobalInterface", ",", "interfaceName", ",", "interfaceIndex", ",", "local", ")", ";", "}", "if", "(", "isTraceOn", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "tc", ",", "\"bindInterface\"", ")", ";", "}" ]
Bind a single interface to all binding locations. @param binder the namespace binder @param hr the bean home record @param homeSet the remote and local home wrappers, or <tt>null</tt> if deferred initialization bindings should be used @pram numInterfaces the number of remote or local interfaces @param singleGlobalInterface <tt>true</tt> if this bean has only one total interface (counting local and remote together) @param interfaceName the interface name to bind @param interfaceIndex the interface index, or -1 for a home interface @param local <tt>true</tt> if the interface to bind is a local interface @param isHome <tt>true</tt> if the interface is a home interface
[ "Bind", "a", "single", "interface", "to", "all", "binding", "locations", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java#L975-L1011
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java
AbstractEJBRuntime.bindAllRemoteInterfacesToContextRoot
protected void bindAllRemoteInterfacesToContextRoot() { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "bindAllRemoteInterfacesToContextRoot"); Map<EJBModuleMetaDataImpl, NameSpaceBinder<?>> binders = new HashMap<EJBModuleMetaDataImpl, NameSpaceBinder<?>>(); // Start with the list of all HomeRecords. Not all of these beans may have // started, but this is the complete set of everything that would have been // bound into some naming context. The container may not be available yet // if the EJB feature is just starting, but then there is nothing to do. HomeOfHomes homeOfHomes = (ivContainer != null) ? ivContainer.getHomeOfHomes() : null; if (homeOfHomes != null) { List<HomeRecord> hrs = ivContainer.getHomeOfHomes().getAllHomeRecords(); for (HomeRecord hr : hrs) { if (hr.bindToContextRoot()) { BeanMetaData bmd = hr.getBeanMetaData(); if (isTraceOn && tc.isDebugEnabled()) Tr.debug(tc, "processing bindings for " + bmd.j2eeName); if (bmd.homeInterfaceClassName != null) { bindRemoteInterfaceToContextRoot(binders, hr, bmd.homeInterfaceClassName, -1); } if (bmd.ivBusinessRemoteInterfaceClassNames != null) { int interfaceIndex = 0; for (String remoteInterfaceName : bmd.ivBusinessRemoteInterfaceClassNames) { bindRemoteInterfaceToContextRoot(binders, hr, remoteInterfaceName, interfaceIndex++); } } } } } if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "bindAllRemoteInterfacesToContextRoot"); }
java
protected void bindAllRemoteInterfacesToContextRoot() { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "bindAllRemoteInterfacesToContextRoot"); Map<EJBModuleMetaDataImpl, NameSpaceBinder<?>> binders = new HashMap<EJBModuleMetaDataImpl, NameSpaceBinder<?>>(); // Start with the list of all HomeRecords. Not all of these beans may have // started, but this is the complete set of everything that would have been // bound into some naming context. The container may not be available yet // if the EJB feature is just starting, but then there is nothing to do. HomeOfHomes homeOfHomes = (ivContainer != null) ? ivContainer.getHomeOfHomes() : null; if (homeOfHomes != null) { List<HomeRecord> hrs = ivContainer.getHomeOfHomes().getAllHomeRecords(); for (HomeRecord hr : hrs) { if (hr.bindToContextRoot()) { BeanMetaData bmd = hr.getBeanMetaData(); if (isTraceOn && tc.isDebugEnabled()) Tr.debug(tc, "processing bindings for " + bmd.j2eeName); if (bmd.homeInterfaceClassName != null) { bindRemoteInterfaceToContextRoot(binders, hr, bmd.homeInterfaceClassName, -1); } if (bmd.ivBusinessRemoteInterfaceClassNames != null) { int interfaceIndex = 0; for (String remoteInterfaceName : bmd.ivBusinessRemoteInterfaceClassNames) { bindRemoteInterfaceToContextRoot(binders, hr, remoteInterfaceName, interfaceIndex++); } } } } } if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "bindAllRemoteInterfacesToContextRoot"); }
[ "protected", "void", "bindAllRemoteInterfacesToContextRoot", "(", ")", "{", "final", "boolean", "isTraceOn", "=", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", ";", "if", "(", "isTraceOn", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"bindAllRemoteInterfacesToContextRoot\"", ")", ";", "Map", "<", "EJBModuleMetaDataImpl", ",", "NameSpaceBinder", "<", "?", ">", ">", "binders", "=", "new", "HashMap", "<", "EJBModuleMetaDataImpl", ",", "NameSpaceBinder", "<", "?", ">", ">", "(", ")", ";", "// Start with the list of all HomeRecords. Not all of these beans may have", "// started, but this is the complete set of everything that would have been", "// bound into some naming context. The container may not be available yet", "// if the EJB feature is just starting, but then there is nothing to do.", "HomeOfHomes", "homeOfHomes", "=", "(", "ivContainer", "!=", "null", ")", "?", "ivContainer", ".", "getHomeOfHomes", "(", ")", ":", "null", ";", "if", "(", "homeOfHomes", "!=", "null", ")", "{", "List", "<", "HomeRecord", ">", "hrs", "=", "ivContainer", ".", "getHomeOfHomes", "(", ")", ".", "getAllHomeRecords", "(", ")", ";", "for", "(", "HomeRecord", "hr", ":", "hrs", ")", "{", "if", "(", "hr", ".", "bindToContextRoot", "(", ")", ")", "{", "BeanMetaData", "bmd", "=", "hr", ".", "getBeanMetaData", "(", ")", ";", "if", "(", "isTraceOn", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"processing bindings for \"", "+", "bmd", ".", "j2eeName", ")", ";", "if", "(", "bmd", ".", "homeInterfaceClassName", "!=", "null", ")", "{", "bindRemoteInterfaceToContextRoot", "(", "binders", ",", "hr", ",", "bmd", ".", "homeInterfaceClassName", ",", "-", "1", ")", ";", "}", "if", "(", "bmd", ".", "ivBusinessRemoteInterfaceClassNames", "!=", "null", ")", "{", "int", "interfaceIndex", "=", "0", ";", "for", "(", "String", "remoteInterfaceName", ":", "bmd", ".", "ivBusinessRemoteInterfaceClassNames", ")", "{", "bindRemoteInterfaceToContextRoot", "(", "binders", ",", "hr", ",", "remoteInterfaceName", ",", "interfaceIndex", "++", ")", ";", "}", "}", "}", "}", "}", "if", "(", "isTraceOn", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "tc", ",", "\"bindAllRemoteInterfacesToContextRoot\"", ")", ";", "}" ]
Bind the remote interfaces for all beans known to the container. Intended to be used to restore EJB bindings when the ORB is restarted.
[ "Bind", "the", "remote", "interfaces", "for", "all", "beans", "known", "to", "the", "container", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java#L1018-L1055
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java
AbstractEJBRuntime.addHome
protected void addHome(BeanMetaData bmd) throws ContainerException { try { EJSContainer.homeOfHomes.addHome(bmd); //d200714 d429866.2 F743-26072 } catch (Throwable ex) { ContainerException ex2 = new ContainerException(ex); Tr.error(tc, "CAUGHT_EXCEPTION_THROWING_NEW_EXCEPTION_CNTR0035E", new Object[] { ex, ex2.toString() }); throw ex2; } }
java
protected void addHome(BeanMetaData bmd) throws ContainerException { try { EJSContainer.homeOfHomes.addHome(bmd); //d200714 d429866.2 F743-26072 } catch (Throwable ex) { ContainerException ex2 = new ContainerException(ex); Tr.error(tc, "CAUGHT_EXCEPTION_THROWING_NEW_EXCEPTION_CNTR0035E", new Object[] { ex, ex2.toString() }); throw ex2; } }
[ "protected", "void", "addHome", "(", "BeanMetaData", "bmd", ")", "throws", "ContainerException", "{", "try", "{", "EJSContainer", ".", "homeOfHomes", ".", "addHome", "(", "bmd", ")", ";", "//d200714 d429866.2 F743-26072", "}", "catch", "(", "Throwable", "ex", ")", "{", "ContainerException", "ex2", "=", "new", "ContainerException", "(", "ex", ")", ";", "Tr", ".", "error", "(", "tc", ",", "\"CAUGHT_EXCEPTION_THROWING_NEW_EXCEPTION_CNTR0035E\"", ",", "new", "Object", "[", "]", "{", "ex", ",", "ex2", ".", "toString", "(", ")", "}", ")", ";", "throw", "ex2", ";", "}", "}" ]
Adds a home to make it externally accessible. @param bmd the bean
[ "Adds", "a", "home", "to", "make", "it", "externally", "accessible", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java#L1272-L1281
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java
AbstractEJBRuntime.initializeDeferredEJBImpl
protected EJSHome initializeDeferredEJBImpl(HomeRecord hr) throws ContainerException, EJBConfigurationException { BeanMetaData bmd = hr.getBeanMetaData(); Object originalLoader = ThreadContextAccessor.UNCHANGED; try { if (!bmd.fullyInitialized) // d664917.1 { // The server class loader must be used during metadata processing // for XML parsing classes. d200714, PM57099 originalLoader = svThreadContextAccessor.pushContextClassLoader(getServerClassLoader()); // d278756, d334557, PK83186, d640395.1 //------------------------------------------------------------------------ // WARNING: We MUST reload WCCM object pointers here in case the module was // unloaded. The WAS runtime code has an alarm thread which unloads // the module after a fixed time. In the case of deferred EJB init // processing it is up to us to "touch" the DeployedModule which will // cause WCCM to completely reload a new set of WCCM objects for us. //------------------------------------------------------------------------ bmd.wccm.reload(); // F743-18775 finishBMDInit(bmd); //497153 } //d200714 start // We must ensure that the application classloader is in force prior to starting // the home. originalLoader = svThreadContextAccessor.repushContextClassLoader(originalLoader, hr.getClassLoader()); //d200714 end return fireMetaDataCreatedAndStartBean(bmd); // d648522, d739043 } finally { svThreadContextAccessor.popContextClassLoader(originalLoader); // d659020 - If an error occurs while initializing, then the wccm // field will not be cleared, so we need to unload its references. // The next attempt to initialize the bean will reload them again. if (bmd.wccm != null) { bmd.wccm.unload(); } } }
java
protected EJSHome initializeDeferredEJBImpl(HomeRecord hr) throws ContainerException, EJBConfigurationException { BeanMetaData bmd = hr.getBeanMetaData(); Object originalLoader = ThreadContextAccessor.UNCHANGED; try { if (!bmd.fullyInitialized) // d664917.1 { // The server class loader must be used during metadata processing // for XML parsing classes. d200714, PM57099 originalLoader = svThreadContextAccessor.pushContextClassLoader(getServerClassLoader()); // d278756, d334557, PK83186, d640395.1 //------------------------------------------------------------------------ // WARNING: We MUST reload WCCM object pointers here in case the module was // unloaded. The WAS runtime code has an alarm thread which unloads // the module after a fixed time. In the case of deferred EJB init // processing it is up to us to "touch" the DeployedModule which will // cause WCCM to completely reload a new set of WCCM objects for us. //------------------------------------------------------------------------ bmd.wccm.reload(); // F743-18775 finishBMDInit(bmd); //497153 } //d200714 start // We must ensure that the application classloader is in force prior to starting // the home. originalLoader = svThreadContextAccessor.repushContextClassLoader(originalLoader, hr.getClassLoader()); //d200714 end return fireMetaDataCreatedAndStartBean(bmd); // d648522, d739043 } finally { svThreadContextAccessor.popContextClassLoader(originalLoader); // d659020 - If an error occurs while initializing, then the wccm // field will not be cleared, so we need to unload its references. // The next attempt to initialize the bean will reload them again. if (bmd.wccm != null) { bmd.wccm.unload(); } } }
[ "protected", "EJSHome", "initializeDeferredEJBImpl", "(", "HomeRecord", "hr", ")", "throws", "ContainerException", ",", "EJBConfigurationException", "{", "BeanMetaData", "bmd", "=", "hr", ".", "getBeanMetaData", "(", ")", ";", "Object", "originalLoader", "=", "ThreadContextAccessor", ".", "UNCHANGED", ";", "try", "{", "if", "(", "!", "bmd", ".", "fullyInitialized", ")", "// d664917.1", "{", "// The server class loader must be used during metadata processing", "// for XML parsing classes. d200714, PM57099", "originalLoader", "=", "svThreadContextAccessor", ".", "pushContextClassLoader", "(", "getServerClassLoader", "(", ")", ")", ";", "// d278756, d334557, PK83186, d640395.1", "//------------------------------------------------------------------------", "// WARNING: We MUST reload WCCM object pointers here in case the module was", "// unloaded. The WAS runtime code has an alarm thread which unloads", "// the module after a fixed time. In the case of deferred EJB init", "// processing it is up to us to \"touch\" the DeployedModule which will", "// cause WCCM to completely reload a new set of WCCM objects for us.", "//------------------------------------------------------------------------", "bmd", ".", "wccm", ".", "reload", "(", ")", ";", "// F743-18775", "finishBMDInit", "(", "bmd", ")", ";", "//497153", "}", "//d200714 start", "// We must ensure that the application classloader is in force prior to starting", "// the home.", "originalLoader", "=", "svThreadContextAccessor", ".", "repushContextClassLoader", "(", "originalLoader", ",", "hr", ".", "getClassLoader", "(", ")", ")", ";", "//d200714 end", "return", "fireMetaDataCreatedAndStartBean", "(", "bmd", ")", ";", "// d648522, d739043", "}", "finally", "{", "svThreadContextAccessor", ".", "popContextClassLoader", "(", "originalLoader", ")", ";", "// d659020 - If an error occurs while initializing, then the wccm", "// field will not be cleared, so we need to unload its references.", "// The next attempt to initialize the bean will reload them again.", "if", "(", "bmd", ".", "wccm", "!=", "null", ")", "{", "bmd", ".", "wccm", ".", "unload", "(", ")", ";", "}", "}", "}" ]
Actually initializes the deferred EJB. Assumes that a "runtime thread context" has already been established. @param hr @return
[ "Actually", "initializes", "the", "deferred", "EJB", ".", "Assumes", "that", "a", "runtime", "thread", "context", "has", "already", "been", "established", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java#L1412-L1452
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java
AbstractEJBRuntime.createReferenceContext
protected ReferenceContext createReferenceContext(BeanMetaData bmd) // F743-29417 { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "createReferenceContext: " + bmd.j2eeName); if (bmd.ivReferenceContext == null) { bmd.ivReferenceContext = getInjectionEngine().createReferenceContext(); bmd.ivReferenceContext.add(new ComponentNameSpaceConfigurationProviderImpl(bmd, this)); // F85115 } if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "createReferenceContext", bmd.ivReferenceContext); return bmd.ivReferenceContext; }
java
protected ReferenceContext createReferenceContext(BeanMetaData bmd) // F743-29417 { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "createReferenceContext: " + bmd.j2eeName); if (bmd.ivReferenceContext == null) { bmd.ivReferenceContext = getInjectionEngine().createReferenceContext(); bmd.ivReferenceContext.add(new ComponentNameSpaceConfigurationProviderImpl(bmd, this)); // F85115 } if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "createReferenceContext", bmd.ivReferenceContext); return bmd.ivReferenceContext; }
[ "protected", "ReferenceContext", "createReferenceContext", "(", "BeanMetaData", "bmd", ")", "// F743-29417", "{", "final", "boolean", "isTraceOn", "=", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", ";", "if", "(", "isTraceOn", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"createReferenceContext: \"", "+", "bmd", ".", "j2eeName", ")", ";", "if", "(", "bmd", ".", "ivReferenceContext", "==", "null", ")", "{", "bmd", ".", "ivReferenceContext", "=", "getInjectionEngine", "(", ")", ".", "createReferenceContext", "(", ")", ";", "bmd", ".", "ivReferenceContext", ".", "add", "(", "new", "ComponentNameSpaceConfigurationProviderImpl", "(", "bmd", ",", "this", ")", ")", ";", "// F85115", "}", "if", "(", "isTraceOn", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "tc", ",", "\"createReferenceContext\"", ",", "bmd", ".", "ivReferenceContext", ")", ";", "return", "bmd", ".", "ivReferenceContext", ";", "}" ]
Creates the reference context for this EJB.
[ "Creates", "the", "reference", "context", "for", "this", "EJB", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java#L1457-L1471
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java
AbstractEJBRuntime.finishBMDInit
private void finishBMDInit(BeanMetaData bmd) throws ContainerException, EJBConfigurationException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "finishBMDInit: " + bmd.j2eeName); // d640935.1 // First, create the reference context for the bean if we haven't already // done so. createReferenceContext(bmd); // F743-29417 ivEJBMDOrchestrator.finishBMDInitWithReferenceContext(bmd); // Free resources in EJBModuleMetaData if all beans have been initialized. bmd._moduleMetaData.freeResourcesAfterAllBeansInitialized(bmd); //d462512 if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "finishBMDInit"); }
java
private void finishBMDInit(BeanMetaData bmd) throws ContainerException, EJBConfigurationException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "finishBMDInit: " + bmd.j2eeName); // d640935.1 // First, create the reference context for the bean if we haven't already // done so. createReferenceContext(bmd); // F743-29417 ivEJBMDOrchestrator.finishBMDInitWithReferenceContext(bmd); // Free resources in EJBModuleMetaData if all beans have been initialized. bmd._moduleMetaData.freeResourcesAfterAllBeansInitialized(bmd); //d462512 if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "finishBMDInit"); }
[ "private", "void", "finishBMDInit", "(", "BeanMetaData", "bmd", ")", "throws", "ContainerException", ",", "EJBConfigurationException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"finishBMDInit: \"", "+", "bmd", ".", "j2eeName", ")", ";", "// d640935.1", "// First, create the reference context for the bean if we haven't already", "// done so.", "createReferenceContext", "(", "bmd", ")", ";", "// F743-29417", "ivEJBMDOrchestrator", ".", "finishBMDInitWithReferenceContext", "(", "bmd", ")", ";", "// Free resources in EJBModuleMetaData if all beans have been initialized.", "bmd", ".", "_moduleMetaData", ".", "freeResourcesAfterAllBeansInitialized", "(", "bmd", ")", ";", "//d462512", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "tc", ",", "\"finishBMDInit\"", ")", ";", "}" ]
Fully initialize the BeanMetaData. When this method completes successfully, bmd.fullyInitialized will be true; this method must not be called if this field is already true. The context class loader must be the runtime class loader when calling this method.
[ "Fully", "initialize", "the", "BeanMetaData", ".", "When", "this", "method", "completes", "successfully", "bmd", ".", "fullyInitialized", "will", "be", "true", ";", "this", "method", "must", "not", "be", "called", "if", "this", "field", "is", "already", "true", ".", "The", "context", "class", "loader", "must", "be", "the", "runtime", "class", "loader", "when", "calling", "this", "method", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java#L1501-L1516
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java
AbstractEJBRuntime.finishBMDInitForReferenceContext
public ComponentNameSpaceConfiguration finishBMDInitForReferenceContext(BeanMetaData bmd) throws EJBConfigurationException, ContainerException { return ivEJBMDOrchestrator.finishBMDInitForReferenceContext(bmd, ivDefaultDataSourceJNDIName, ivWebServicesHandlerResolver); }
java
public ComponentNameSpaceConfiguration finishBMDInitForReferenceContext(BeanMetaData bmd) throws EJBConfigurationException, ContainerException { return ivEJBMDOrchestrator.finishBMDInitForReferenceContext(bmd, ivDefaultDataSourceJNDIName, ivWebServicesHandlerResolver); }
[ "public", "ComponentNameSpaceConfiguration", "finishBMDInitForReferenceContext", "(", "BeanMetaData", "bmd", ")", "throws", "EJBConfigurationException", ",", "ContainerException", "{", "return", "ivEJBMDOrchestrator", ".", "finishBMDInitForReferenceContext", "(", "bmd", ",", "ivDefaultDataSourceJNDIName", ",", "ivWebServicesHandlerResolver", ")", ";", "}" ]
Finish filling out enough of the bean metadata to be able to create the component namespace configuration for the bean. The context class loader must be the runtime class loader when calling this method. @return the component namespace configuration
[ "Finish", "filling", "out", "enough", "of", "the", "bean", "metadata", "to", "be", "able", "to", "create", "the", "component", "namespace", "configuration", "for", "the", "bean", ".", "The", "context", "class", "loader", "must", "be", "the", "runtime", "class", "loader", "when", "calling", "this", "method", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java#L1525-L1529
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java
AbstractEJBRuntime.fireMetaDataCreatedAndStartBean
private EJSHome fireMetaDataCreatedAndStartBean(BeanMetaData bmd) // d648522 throws ContainerException { if (!bmd.isManagedBean()) // F743-34301.1 { try { // Fire the ComponentMetaData event to the listeners // (ie. we have loaded a new bean folks... ) if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "startBean: Fire Component Metadata created event to listeners for: " + bmd.j2eeName); bmd.ivMetaDataDestroyRequired = true; //d505055 fireMetaDataCreated(bmd); } catch (Throwable t) //197547 { FFDCFilter.processException(t, CLASS_NAME + "startBean", "445", this); throw new ContainerException("Failed to start " + bmd.j2eeName, t); } } return startBean(bmd); // d739043 }
java
private EJSHome fireMetaDataCreatedAndStartBean(BeanMetaData bmd) // d648522 throws ContainerException { if (!bmd.isManagedBean()) // F743-34301.1 { try { // Fire the ComponentMetaData event to the listeners // (ie. we have loaded a new bean folks... ) if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "startBean: Fire Component Metadata created event to listeners for: " + bmd.j2eeName); bmd.ivMetaDataDestroyRequired = true; //d505055 fireMetaDataCreated(bmd); } catch (Throwable t) //197547 { FFDCFilter.processException(t, CLASS_NAME + "startBean", "445", this); throw new ContainerException("Failed to start " + bmd.j2eeName, t); } } return startBean(bmd); // d739043 }
[ "private", "EJSHome", "fireMetaDataCreatedAndStartBean", "(", "BeanMetaData", "bmd", ")", "// d648522", "throws", "ContainerException", "{", "if", "(", "!", "bmd", ".", "isManagedBean", "(", ")", ")", "// F743-34301.1", "{", "try", "{", "// Fire the ComponentMetaData event to the listeners", "// (ie. we have loaded a new bean folks... )", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"startBean: Fire Component Metadata created event to listeners for: \"", "+", "bmd", ".", "j2eeName", ")", ";", "bmd", ".", "ivMetaDataDestroyRequired", "=", "true", ";", "//d505055", "fireMetaDataCreated", "(", "bmd", ")", ";", "}", "catch", "(", "Throwable", "t", ")", "//197547", "{", "FFDCFilter", ".", "processException", "(", "t", ",", "CLASS_NAME", "+", "\"startBean\"", ",", "\"445\"", ",", "this", ")", ";", "throw", "new", "ContainerException", "(", "\"Failed to start \"", "+", "bmd", ".", "j2eeName", ",", "t", ")", ";", "}", "}", "return", "startBean", "(", "bmd", ")", ";", "// d739043", "}" ]
Starts the bean by creating a home instance via the container. When this method completes successfully, bmd.homeRecord.homeInternal will be set to indicate that this home is started; this method must not be called if this field is already set. The context class loader must be the bean class loader when calling this method. @param bmd the bean metadata @return the home
[ "Starts", "the", "bean", "by", "creating", "a", "home", "instance", "via", "the", "container", ".", "When", "this", "method", "completes", "successfully", "bmd", ".", "homeRecord", ".", "homeInternal", "will", "be", "set", "to", "indicate", "that", "this", "home", "is", "started", ";", "this", "method", "must", "not", "be", "called", "if", "this", "field", "is", "already", "set", ".", "The", "context", "class", "loader", "must", "be", "the", "bean", "class", "loader", "when", "calling", "this", "method", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java#L1541-L1561
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java
AbstractEJBRuntime.createNonPersistentAutomaticTimers
protected int createNonPersistentAutomaticTimers(String appName, String moduleName, List<AutomaticTimerBean> timerBeans) { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "createNonPersistentAutomaticTimers: " + moduleName); int numCreated = 0; for (AutomaticTimerBean timerBean : timerBeans) { if (timerBean.getNumNonPersistentTimers() != 0) { for (TimerMethodData timerMethod : timerBean.getMethods()) { for (TimerMethodData.AutomaticTimer timer : timerMethod.getAutomaticTimers()) { if (!timer.isPersistent()) { if (isTraceOn && tc.isDebugEnabled()) Tr.debug(tc, "creating non-persistent automatic timer " + timer); createNonPersistentAutomaticTimer(timerBean, timer, timerMethod); numCreated++; } } } } } if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "createNonPersistentAutomaticTimers: " + numCreated); return numCreated; }
java
protected int createNonPersistentAutomaticTimers(String appName, String moduleName, List<AutomaticTimerBean> timerBeans) { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "createNonPersistentAutomaticTimers: " + moduleName); int numCreated = 0; for (AutomaticTimerBean timerBean : timerBeans) { if (timerBean.getNumNonPersistentTimers() != 0) { for (TimerMethodData timerMethod : timerBean.getMethods()) { for (TimerMethodData.AutomaticTimer timer : timerMethod.getAutomaticTimers()) { if (!timer.isPersistent()) { if (isTraceOn && tc.isDebugEnabled()) Tr.debug(tc, "creating non-persistent automatic timer " + timer); createNonPersistentAutomaticTimer(timerBean, timer, timerMethod); numCreated++; } } } } } if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "createNonPersistentAutomaticTimers: " + numCreated); return numCreated; }
[ "protected", "int", "createNonPersistentAutomaticTimers", "(", "String", "appName", ",", "String", "moduleName", ",", "List", "<", "AutomaticTimerBean", ">", "timerBeans", ")", "{", "final", "boolean", "isTraceOn", "=", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", ";", "if", "(", "isTraceOn", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"createNonPersistentAutomaticTimers: \"", "+", "moduleName", ")", ";", "int", "numCreated", "=", "0", ";", "for", "(", "AutomaticTimerBean", "timerBean", ":", "timerBeans", ")", "{", "if", "(", "timerBean", ".", "getNumNonPersistentTimers", "(", ")", "!=", "0", ")", "{", "for", "(", "TimerMethodData", "timerMethod", ":", "timerBean", ".", "getMethods", "(", ")", ")", "{", "for", "(", "TimerMethodData", ".", "AutomaticTimer", "timer", ":", "timerMethod", ".", "getAutomaticTimers", "(", ")", ")", "{", "if", "(", "!", "timer", ".", "isPersistent", "(", ")", ")", "{", "if", "(", "isTraceOn", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"creating non-persistent automatic timer \"", "+", "timer", ")", ";", "createNonPersistentAutomaticTimer", "(", "timerBean", ",", "timer", ",", "timerMethod", ")", ";", "numCreated", "++", ";", "}", "}", "}", "}", "}", "if", "(", "isTraceOn", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "tc", ",", "\"createNonPersistentAutomaticTimers: \"", "+", "numCreated", ")", ";", "return", "numCreated", ";", "}" ]
F743-506 RTC109678
[ "F743", "-", "506", "RTC109678" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java#L1723-L1749
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java
AbstractEJBRuntime.createNonPersistentCalendarTimer
protected Timer createNonPersistentCalendarTimer(BeanO beanO, ParsedScheduleExpression parsedExpr, Serializable info) { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled(); if (isTraceOn && tc.isDebugEnabled()) Tr.entry(tc, "createNonPersistentCalendarTimer : " + beanO); // create the non-persistent Timer TimerNpImpl timer = new TimerNpImpl(beanO.getId(), parsedExpr, info); // queue timer to start (or start immediately if not in a global tran) queueOrStartNpTimer(beanO, timer); if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "createNonPersistentCalendarTimer : " + timer); return timer; }
java
protected Timer createNonPersistentCalendarTimer(BeanO beanO, ParsedScheduleExpression parsedExpr, Serializable info) { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled(); if (isTraceOn && tc.isDebugEnabled()) Tr.entry(tc, "createNonPersistentCalendarTimer : " + beanO); // create the non-persistent Timer TimerNpImpl timer = new TimerNpImpl(beanO.getId(), parsedExpr, info); // queue timer to start (or start immediately if not in a global tran) queueOrStartNpTimer(beanO, timer); if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "createNonPersistentCalendarTimer : " + timer); return timer; }
[ "protected", "Timer", "createNonPersistentCalendarTimer", "(", "BeanO", "beanO", ",", "ParsedScheduleExpression", "parsedExpr", ",", "Serializable", "info", ")", "{", "final", "boolean", "isTraceOn", "=", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ";", "if", "(", "isTraceOn", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"createNonPersistentCalendarTimer : \"", "+", "beanO", ")", ";", "// create the non-persistent Timer", "TimerNpImpl", "timer", "=", "new", "TimerNpImpl", "(", "beanO", ".", "getId", "(", ")", ",", "parsedExpr", ",", "info", ")", ";", "// queue timer to start (or start immediately if not in a global tran)", "queueOrStartNpTimer", "(", "beanO", ",", "timer", ")", ";", "if", "(", "isTraceOn", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "tc", ",", "\"createNonPersistentCalendarTimer : \"", "+", "timer", ")", ";", "return", "timer", ";", "}" ]
Creates a non-persistent calendar based EJB timer. @param beanId the bean Id for which the timer is being created @param parsedExpr the parsed values of the schedule for a calendar-based timer @param info application information to be delivered to the timeout method, or null
[ "Creates", "a", "non", "-", "persistent", "calendar", "based", "EJB", "timer", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/ejbcontainer/runtime/AbstractEJBRuntime.java#L1893-L1908
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java
AbstractItemLink._declareDiscardable
private synchronized final boolean _declareDiscardable() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "_declareDiscardable"); boolean linkHasBecomeReleasable = false; // Only discardable if storage managed (items and item references only). // Putting this check in here liberates the logic which changes the state of the // items from knowing about storage management if (_isStorageManaged) { if (!_itemIsDiscardableIfPersistentRepresentationStable) { // if we have become non-discardable, and we were // releasable (stable) then we must notify the cache linkHasBecomeReleasable = _persistentRepresentationIsStable; // 274012 if (linkHasBecomeReleasable) { // Defect 601995 _strongReferenceToItem = NULL_STRONG_REF; } // This flag must not be set if the item is not storage managed. // Otherwise, we could inadvertently start discarding and restoring // streams. _itemIsDiscardableIfPersistentRepresentationStable = true; } } else { // Just to make sure :-) _itemIsDiscardableIfPersistentRepresentationStable = false; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "_declareDiscardable", Boolean.valueOf(linkHasBecomeReleasable)); return linkHasBecomeReleasable; }
java
private synchronized final boolean _declareDiscardable() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "_declareDiscardable"); boolean linkHasBecomeReleasable = false; // Only discardable if storage managed (items and item references only). // Putting this check in here liberates the logic which changes the state of the // items from knowing about storage management if (_isStorageManaged) { if (!_itemIsDiscardableIfPersistentRepresentationStable) { // if we have become non-discardable, and we were // releasable (stable) then we must notify the cache linkHasBecomeReleasable = _persistentRepresentationIsStable; // 274012 if (linkHasBecomeReleasable) { // Defect 601995 _strongReferenceToItem = NULL_STRONG_REF; } // This flag must not be set if the item is not storage managed. // Otherwise, we could inadvertently start discarding and restoring // streams. _itemIsDiscardableIfPersistentRepresentationStable = true; } } else { // Just to make sure :-) _itemIsDiscardableIfPersistentRepresentationStable = false; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "_declareDiscardable", Boolean.valueOf(linkHasBecomeReleasable)); return linkHasBecomeReleasable; }
[ "private", "synchronized", "final", "boolean", "_declareDiscardable", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"_declareDiscardable\"", ")", ";", "boolean", "linkHasBecomeReleasable", "=", "false", ";", "// Only discardable if storage managed (items and item references only).", "// Putting this check in here liberates the logic which changes the state of the", "// items from knowing about storage management", "if", "(", "_isStorageManaged", ")", "{", "if", "(", "!", "_itemIsDiscardableIfPersistentRepresentationStable", ")", "{", "// if we have become non-discardable, and we were", "// releasable (stable) then we must notify the cache", "linkHasBecomeReleasable", "=", "_persistentRepresentationIsStable", ";", "// 274012", "if", "(", "linkHasBecomeReleasable", ")", "{", "// Defect 601995", "_strongReferenceToItem", "=", "NULL_STRONG_REF", ";", "}", "// This flag must not be set if the item is not storage managed.", "// Otherwise, we could inadvertently start discarding and restoring", "// streams.", "_itemIsDiscardableIfPersistentRepresentationStable", "=", "true", ";", "}", "}", "else", "{", "// Just to make sure :-)", "_itemIsDiscardableIfPersistentRepresentationStable", "=", "false", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"_declareDiscardable\"", ",", "Boolean", ".", "valueOf", "(", "linkHasBecomeReleasable", ")", ")", ";", "return", "linkHasBecomeReleasable", ";", "}" ]
The state has changed so that the item could be discarded if it has a stable persistent representation. Change the flags that control the discard, and return true if this call has resulted in a change to the releasable state. @return
[ "The", "state", "has", "changed", "so", "that", "the", "item", "could", "be", "discarded", "if", "it", "has", "a", "stable", "persistent", "representation", ".", "Change", "the", "flags", "that", "control", "the", "discard", "and", "return", "true", "if", "this", "call", "has", "resulted", "in", "a", "change", "to", "the", "releasable", "state", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java#L446-L484
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java
AbstractItemLink._declareNotDiscardable
private synchronized final boolean _declareNotDiscardable(AbstractItem item) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "_declareNotDiscardable"); boolean notifyRequired = false; // we are going to need the item in memory, so we make sure that // we pin it with a hard reference _strongReferenceToItem = item; if (_itemIsDiscardableIfPersistentRepresentationStable) { // if we have become discardable, and we were // releasable (stable) then we must notify the cache notifyRequired = _persistentRepresentationIsStable; _itemIsDiscardableIfPersistentRepresentationStable = false; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "_declareNotDiscardable", Boolean.valueOf(notifyRequired)); return notifyRequired; }
java
private synchronized final boolean _declareNotDiscardable(AbstractItem item) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "_declareNotDiscardable"); boolean notifyRequired = false; // we are going to need the item in memory, so we make sure that // we pin it with a hard reference _strongReferenceToItem = item; if (_itemIsDiscardableIfPersistentRepresentationStable) { // if we have become discardable, and we were // releasable (stable) then we must notify the cache notifyRequired = _persistentRepresentationIsStable; _itemIsDiscardableIfPersistentRepresentationStable = false; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "_declareNotDiscardable", Boolean.valueOf(notifyRequired)); return notifyRequired; }
[ "private", "synchronized", "final", "boolean", "_declareNotDiscardable", "(", "AbstractItem", "item", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"_declareNotDiscardable\"", ")", ";", "boolean", "notifyRequired", "=", "false", ";", "// we are going to need the item in memory, so we make sure that", "// we pin it with a hard reference", "_strongReferenceToItem", "=", "item", ";", "if", "(", "_itemIsDiscardableIfPersistentRepresentationStable", ")", "{", "// if we have become discardable, and we were", "// releasable (stable) then we must notify the cache", "notifyRequired", "=", "_persistentRepresentationIsStable", ";", "_itemIsDiscardableIfPersistentRepresentationStable", "=", "false", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"_declareNotDiscardable\"", ",", "Boolean", ".", "valueOf", "(", "notifyRequired", ")", ")", ";", "return", "notifyRequired", ";", "}" ]
The state has changed so that the item must not be discarded regardless of whether it has a stable persistent representation. Change the flags that control the discard, and return true if this call has resulted in a change to the releasable state. @return
[ "The", "state", "has", "changed", "so", "that", "the", "item", "must", "not", "be", "discarded", "regardless", "of", "whether", "it", "has", "a", "stable", "persistent", "representation", ".", "Change", "the", "flags", "that", "control", "the", "discard", "and", "return", "true", "if", "this", "call", "has", "resulted", "in", "a", "change", "to", "the", "releasable", "state", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java#L494-L515
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java
AbstractItemLink._getAndAssertItem
private final AbstractItem _getAndAssertItem() throws SevereMessageStoreException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "_getAndAssertItem"); AbstractItem item = null; synchronized (this) { item = _strongReferenceToItem; } // Defect 601995 if (item == NULL_STRONG_REF) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "_getAndAssertItem"); throw new SevereMessageStoreException("_getAndAssertItem"); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "_getAndAssertItem", item); return item; }
java
private final AbstractItem _getAndAssertItem() throws SevereMessageStoreException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "_getAndAssertItem"); AbstractItem item = null; synchronized (this) { item = _strongReferenceToItem; } // Defect 601995 if (item == NULL_STRONG_REF) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "_getAndAssertItem"); throw new SevereMessageStoreException("_getAndAssertItem"); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "_getAndAssertItem", item); return item; }
[ "private", "final", "AbstractItem", "_getAndAssertItem", "(", ")", "throws", "SevereMessageStoreException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"_getAndAssertItem\"", ")", ";", "AbstractItem", "item", "=", "null", ";", "synchronized", "(", "this", ")", "{", "item", "=", "_strongReferenceToItem", ";", "}", "// Defect 601995", "if", "(", "item", "==", "NULL_STRONG_REF", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"_getAndAssertItem\"", ")", ";", "throw", "new", "SevereMessageStoreException", "(", "\"_getAndAssertItem\"", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"_getAndAssertItem\"", ",", "item", ")", ";", "return", "item", ";", "}" ]
Gets a reference to the item, which is asserted to be obtained from the strong reference. We use this when we know that the state of the item tells us that there is a strong reference. @throws SevereMessageStoreException
[ "Gets", "a", "reference", "to", "the", "item", "which", "is", "asserted", "to", "be", "obtained", "from", "the", "strong", "reference", ".", "We", "use", "this", "when", "we", "know", "that", "the", "state", "of", "the", "item", "tells", "us", "that", "there", "is", "a", "strong", "reference", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java#L567-L589
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java
AbstractItemLink.persistRedeliveredCount
@Override public final void persistRedeliveredCount(int redeliveredCount) throws SevereMessageStoreException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "persistRedeliveredCount"); PersistentTransaction msTran = (PersistentTransaction) getMessageStore().getTransactionFactory().createAutoCommitTransaction(); // Set the value in the Persistable Persistable perTuple = getTuple(); perTuple.setRedeliveredCount(redeliveredCount); // Create the persist task final Task persistTask = new PersistRedeliveredCount(this); // Add the task to worklist. Since this is an auto-commit transaction, // the task is run immediately and value is persisted. try { msTran.addWork(persistTask); } catch (Exception e) { FFDCFilter.processException(e, "com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.persistRedeliveredCount", "1:1198:1.241", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Exception caught persisting redelivery count!", e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "persistRedeliveredCount"); }
java
@Override public final void persistRedeliveredCount(int redeliveredCount) throws SevereMessageStoreException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "persistRedeliveredCount"); PersistentTransaction msTran = (PersistentTransaction) getMessageStore().getTransactionFactory().createAutoCommitTransaction(); // Set the value in the Persistable Persistable perTuple = getTuple(); perTuple.setRedeliveredCount(redeliveredCount); // Create the persist task final Task persistTask = new PersistRedeliveredCount(this); // Add the task to worklist. Since this is an auto-commit transaction, // the task is run immediately and value is persisted. try { msTran.addWork(persistTask); } catch (Exception e) { FFDCFilter.processException(e, "com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.persistRedeliveredCount", "1:1198:1.241", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Exception caught persisting redelivery count!", e); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "persistRedeliveredCount"); }
[ "@", "Override", "public", "final", "void", "persistRedeliveredCount", "(", "int", "redeliveredCount", ")", "throws", "SevereMessageStoreException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"persistRedeliveredCount\"", ")", ";", "PersistentTransaction", "msTran", "=", "(", "PersistentTransaction", ")", "getMessageStore", "(", ")", ".", "getTransactionFactory", "(", ")", ".", "createAutoCommitTransaction", "(", ")", ";", "// Set the value in the Persistable", "Persistable", "perTuple", "=", "getTuple", "(", ")", ";", "perTuple", ".", "setRedeliveredCount", "(", "redeliveredCount", ")", ";", "// Create the persist task", "final", "Task", "persistTask", "=", "new", "PersistRedeliveredCount", "(", "this", ")", ";", "// Add the task to worklist. Since this is an auto-commit transaction,", "// the task is run immediately and value is persisted.", "try", "{", "msTran", ".", "addWork", "(", "persistTask", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "FFDCFilter", ".", "processException", "(", "e", ",", "\"com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.persistRedeliveredCount\"", ",", "\"1:1198:1.241\"", ",", "this", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEventEnabled", "(", ")", ")", "SibTr", ".", "event", "(", "this", ",", "tc", ",", "\"Exception caught persisting redelivery count!\"", ",", "e", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"persistRedeliveredCount\"", ")", ";", "}" ]
Use this to persist redelivered count. Invoke indirectly by the API. This method uses auto-commit transaction to perform the task of persisting the redelivered count. This does not involve any external participants. Therefore, this operation does not require maintaining transaction states. @param redeliveredCount @throws SevereMessageStoreException
[ "Use", "this", "to", "persist", "redelivered", "count", ".", "Invoke", "indirectly", "by", "the", "API", ".", "This", "method", "uses", "auto", "-", "commit", "transaction", "to", "perform", "the", "task", "of", "persisting", "the", "redelivered", "count", ".", "This", "does", "not", "involve", "any", "external", "participants", ".", "Therefore", "this", "operation", "does", "not", "require", "maintaining", "transaction", "states", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java#L1200-L1226
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java
AbstractItemLink.cmdAdd
final void cmdAdd(final LinkOwner stream, long lockID, final PersistentTransaction transaction) throws StreamIsFull, ProtocolException, TransactionException, SevereMessageStoreException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "cmdAdd", new Object[] { "Item Link: " + this, "Stream Link: " + stream, formatLockId(lockID), "Transaction: " + transaction }); synchronized (this) { if (ItemLinkState.STATE_NOT_STORED == _itemLinkState) { ListStatistics stats = getParentStatistics(); stream._assertCanAddChild(transaction, stats); // Defect 510343.1 stats.incrementAdding(_inMemoryItemSize); _lockID = lockID; _transactionId = transaction.getPersistentTranId(); if (NO_LOCK_ID == lockID) { _itemLinkState = ItemLinkState.STATE_ADDING_UNLOCKED; } else { _itemLinkState = ItemLinkState.STATE_ADDING_LOCKED; } } else { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Invalid Item state: " + _itemLinkState); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "cmdAdd"); throw new StateException(_itemLinkState.toString()); } } final Task task = new AddTask(this); transaction.addWork(task); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "cmdAdd"); }
java
final void cmdAdd(final LinkOwner stream, long lockID, final PersistentTransaction transaction) throws StreamIsFull, ProtocolException, TransactionException, SevereMessageStoreException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "cmdAdd", new Object[] { "Item Link: " + this, "Stream Link: " + stream, formatLockId(lockID), "Transaction: " + transaction }); synchronized (this) { if (ItemLinkState.STATE_NOT_STORED == _itemLinkState) { ListStatistics stats = getParentStatistics(); stream._assertCanAddChild(transaction, stats); // Defect 510343.1 stats.incrementAdding(_inMemoryItemSize); _lockID = lockID; _transactionId = transaction.getPersistentTranId(); if (NO_LOCK_ID == lockID) { _itemLinkState = ItemLinkState.STATE_ADDING_UNLOCKED; } else { _itemLinkState = ItemLinkState.STATE_ADDING_LOCKED; } } else { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Invalid Item state: " + _itemLinkState); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "cmdAdd"); throw new StateException(_itemLinkState.toString()); } } final Task task = new AddTask(this); transaction.addWork(task); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "cmdAdd"); }
[ "final", "void", "cmdAdd", "(", "final", "LinkOwner", "stream", ",", "long", "lockID", ",", "final", "PersistentTransaction", "transaction", ")", "throws", "StreamIsFull", ",", "ProtocolException", ",", "TransactionException", ",", "SevereMessageStoreException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"cmdAdd\"", ",", "new", "Object", "[", "]", "{", "\"Item Link: \"", "+", "this", ",", "\"Stream Link: \"", "+", "stream", ",", "formatLockId", "(", "lockID", ")", ",", "\"Transaction: \"", "+", "transaction", "}", ")", ";", "synchronized", "(", "this", ")", "{", "if", "(", "ItemLinkState", ".", "STATE_NOT_STORED", "==", "_itemLinkState", ")", "{", "ListStatistics", "stats", "=", "getParentStatistics", "(", ")", ";", "stream", ".", "_assertCanAddChild", "(", "transaction", ",", "stats", ")", ";", "// Defect 510343.1", "stats", ".", "incrementAdding", "(", "_inMemoryItemSize", ")", ";", "_lockID", "=", "lockID", ";", "_transactionId", "=", "transaction", ".", "getPersistentTranId", "(", ")", ";", "if", "(", "NO_LOCK_ID", "==", "lockID", ")", "{", "_itemLinkState", "=", "ItemLinkState", ".", "STATE_ADDING_UNLOCKED", ";", "}", "else", "{", "_itemLinkState", "=", "ItemLinkState", ".", "STATE_ADDING_LOCKED", ";", "}", "}", "else", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEventEnabled", "(", ")", ")", "SibTr", ".", "event", "(", "this", ",", "tc", ",", "\"Invalid Item state: \"", "+", "_itemLinkState", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"cmdAdd\"", ")", ";", "throw", "new", "StateException", "(", "_itemLinkState", ".", "toString", "(", ")", ")", ";", "}", "}", "final", "Task", "task", "=", "new", "AddTask", "(", "this", ")", ";", "transaction", ".", "addWork", "(", "task", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"cmdAdd\"", ")", ";", "}" ]
Set the state to adding @param stream stream to which add is being made @param lockID @param transaction @throws StreamIsFull if the size of the stream would exceed the maximum permissable size if an add were performed. @throws ProtocolException @throws TransactionException @throws SevereMessageStoreException
[ "Set", "the", "state", "to", "adding" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java#L1409-L1450
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java
AbstractItemLink.cmdRemoveExpiring
final void cmdRemoveExpiring(final long lockId, final PersistentTransaction transaction) throws ProtocolException, TransactionException, SevereMessageStoreException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "cmdRemoveExpiring", new Object[] { "Item Link: " + this, "Stream Link: " + _owningStreamLink, formatLockId(lockId), "Transaction: " + transaction }); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "expiring item " + _tuple.getUniqueId()); synchronized (this) { if (ItemLinkState.STATE_LOCKED_FOR_EXPIRY == _itemLinkState) { if (_lockID != lockId) { throw new LockIdMismatch(_lockID, lockId); } ListStatistics stats = getParentStatistics(); synchronized (stats) { stats.decrementExpiring(); stats.incrementRemoving(); } _transactionId = transaction.getPersistentTranId(); _itemLinkState = ItemLinkState.STATE_REMOVING_EXPIRING; } else { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Invalid Item state: " + _itemLinkState); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "cmdRemoveExpiring"); throw new StateException(_itemLinkState.toString()); } } final Task task = new RemoveLockedTask(this); transaction.addWork(task); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "cmdRemoveExpiring"); }
java
final void cmdRemoveExpiring(final long lockId, final PersistentTransaction transaction) throws ProtocolException, TransactionException, SevereMessageStoreException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "cmdRemoveExpiring", new Object[] { "Item Link: " + this, "Stream Link: " + _owningStreamLink, formatLockId(lockId), "Transaction: " + transaction }); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "expiring item " + _tuple.getUniqueId()); synchronized (this) { if (ItemLinkState.STATE_LOCKED_FOR_EXPIRY == _itemLinkState) { if (_lockID != lockId) { throw new LockIdMismatch(_lockID, lockId); } ListStatistics stats = getParentStatistics(); synchronized (stats) { stats.decrementExpiring(); stats.incrementRemoving(); } _transactionId = transaction.getPersistentTranId(); _itemLinkState = ItemLinkState.STATE_REMOVING_EXPIRING; } else { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Invalid Item state: " + _itemLinkState); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "cmdRemoveExpiring"); throw new StateException(_itemLinkState.toString()); } } final Task task = new RemoveLockedTask(this); transaction.addWork(task); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "cmdRemoveExpiring"); }
[ "final", "void", "cmdRemoveExpiring", "(", "final", "long", "lockId", ",", "final", "PersistentTransaction", "transaction", ")", "throws", "ProtocolException", ",", "TransactionException", ",", "SevereMessageStoreException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"cmdRemoveExpiring\"", ",", "new", "Object", "[", "]", "{", "\"Item Link: \"", "+", "this", ",", "\"Stream Link: \"", "+", "_owningStreamLink", ",", "formatLockId", "(", "lockId", ")", ",", "\"Transaction: \"", "+", "transaction", "}", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "this", ",", "tc", ",", "\"expiring item \"", "+", "_tuple", ".", "getUniqueId", "(", ")", ")", ";", "synchronized", "(", "this", ")", "{", "if", "(", "ItemLinkState", ".", "STATE_LOCKED_FOR_EXPIRY", "==", "_itemLinkState", ")", "{", "if", "(", "_lockID", "!=", "lockId", ")", "{", "throw", "new", "LockIdMismatch", "(", "_lockID", ",", "lockId", ")", ";", "}", "ListStatistics", "stats", "=", "getParentStatistics", "(", ")", ";", "synchronized", "(", "stats", ")", "{", "stats", ".", "decrementExpiring", "(", ")", ";", "stats", ".", "incrementRemoving", "(", ")", ";", "}", "_transactionId", "=", "transaction", ".", "getPersistentTranId", "(", ")", ";", "_itemLinkState", "=", "ItemLinkState", ".", "STATE_REMOVING_EXPIRING", ";", "}", "else", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEventEnabled", "(", ")", ")", "SibTr", ".", "event", "(", "this", ",", "tc", ",", "\"Invalid Item state: \"", "+", "_itemLinkState", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"cmdRemoveExpiring\"", ")", ";", "throw", "new", "StateException", "(", "_itemLinkState", ".", "toString", "(", ")", ")", ";", "}", "}", "final", "Task", "task", "=", "new", "RemoveLockedTask", "(", "this", ")", ";", "transaction", ".", "addWork", "(", "task", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"cmdRemoveExpiring\"", ")", ";", "}" ]
Remove while locked for expiry @param lockId @param transaction @throws ProtocolException @throws TransactionException @throws SevereMessageStoreException
[ "Remove", "while", "locked", "for", "expiry" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java#L1673-L1715
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java
AbstractItemLink.isStateLocked
private synchronized final boolean isStateLocked() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(this, tc, "isStateLocked"); SibTr.exit(this, tc, "isStateLocked", _itemLinkState); } if (_itemLinkState == ItemLinkState.STATE_LOCKED) { return true; } else { return false; } }
java
private synchronized final boolean isStateLocked() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(this, tc, "isStateLocked"); SibTr.exit(this, tc, "isStateLocked", _itemLinkState); } if (_itemLinkState == ItemLinkState.STATE_LOCKED) { return true; } else { return false; } }
[ "private", "synchronized", "final", "boolean", "isStateLocked", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"isStateLocked\"", ")", ";", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"isStateLocked\"", ",", "_itemLinkState", ")", ";", "}", "if", "(", "_itemLinkState", "==", "ItemLinkState", ".", "STATE_LOCKED", ")", "{", "return", "true", ";", "}", "else", "{", "return", "false", ";", "}", "}" ]
Simple function to check if the item link state is in ItemLinkState.STATE_LOCKED.Seperate function is created to acquire the lock @return
[ "Simple", "function", "to", "check", "if", "the", "item", "link", "state", "is", "in", "ItemLinkState", ".", "STATE_LOCKED", ".", "Seperate", "function", "is", "created", "to", "acquire", "the", "lock" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java#L2469-L2484
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java
AbstractItemLink.getItem
public final AbstractItem getItem() throws SevereMessageStoreException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getItem"); AbstractItem item = _getItemNoRestore(); synchronized (this) { if (isExpired()) { item = null; } else { // if we did not have a reference to the item then we try to recreate if (null == item) { try { item = _restoreItem(); } catch (SevereMessageStoreException e) { // No FFDC Code Needed. // PK54812 Ensure we dump a suitable FFDC containing all of the message store // information required in order to identify the rows etc. related to this entry. try { StringWriter stringWriter = new StringWriter(); FormattedWriter writer = new FormattedWriter(stringWriter); this.xmlWriteOn(writer); FFDCFilter.processException(e, "com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.getItem", "1:2252:1.241", this, new Object[] { stringWriter }); writer.close(); } catch (IOException ioe) { FFDCFilter.processException(ioe, "com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.getItem", "1:2257:1.241", this); } if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "RuntimeException caught restoring Item!", e); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getItem"); throw e; } catch (RuntimeException re) { // No FFDC Code Needed. // PK54812 Ensure we dump a suitable FFDC containing all of the message store // information required in order to identify the rows etc. related to this entry. try { StringWriter stringWriter = new StringWriter(); FormattedWriter writer = new FormattedWriter(stringWriter); this.xmlWriteOn(writer); FFDCFilter.processException(re, "com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.getItem", "1:2274:1.241", this, new Object[] { stringWriter }); writer.close(); } catch (IOException ioe) { FFDCFilter.processException(ioe, "com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.getItem", "1:2279:1.241", this); } if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "RuntimeException caught restoring Item!", re); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getItem"); throw re; } } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getItem", item); } return item; }
java
public final AbstractItem getItem() throws SevereMessageStoreException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getItem"); AbstractItem item = _getItemNoRestore(); synchronized (this) { if (isExpired()) { item = null; } else { // if we did not have a reference to the item then we try to recreate if (null == item) { try { item = _restoreItem(); } catch (SevereMessageStoreException e) { // No FFDC Code Needed. // PK54812 Ensure we dump a suitable FFDC containing all of the message store // information required in order to identify the rows etc. related to this entry. try { StringWriter stringWriter = new StringWriter(); FormattedWriter writer = new FormattedWriter(stringWriter); this.xmlWriteOn(writer); FFDCFilter.processException(e, "com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.getItem", "1:2252:1.241", this, new Object[] { stringWriter }); writer.close(); } catch (IOException ioe) { FFDCFilter.processException(ioe, "com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.getItem", "1:2257:1.241", this); } if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "RuntimeException caught restoring Item!", e); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getItem"); throw e; } catch (RuntimeException re) { // No FFDC Code Needed. // PK54812 Ensure we dump a suitable FFDC containing all of the message store // information required in order to identify the rows etc. related to this entry. try { StringWriter stringWriter = new StringWriter(); FormattedWriter writer = new FormattedWriter(stringWriter); this.xmlWriteOn(writer); FFDCFilter.processException(re, "com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.getItem", "1:2274:1.241", this, new Object[] { stringWriter }); writer.close(); } catch (IOException ioe) { FFDCFilter.processException(ioe, "com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.getItem", "1:2279:1.241", this); } if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "RuntimeException caught restoring Item!", re); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getItem"); throw re; } } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getItem", item); } return item; }
[ "public", "final", "AbstractItem", "getItem", "(", ")", "throws", "SevereMessageStoreException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"getItem\"", ")", ";", "AbstractItem", "item", "=", "_getItemNoRestore", "(", ")", ";", "synchronized", "(", "this", ")", "{", "if", "(", "isExpired", "(", ")", ")", "{", "item", "=", "null", ";", "}", "else", "{", "// if we did not have a reference to the item then we try to recreate", "if", "(", "null", "==", "item", ")", "{", "try", "{", "item", "=", "_restoreItem", "(", ")", ";", "}", "catch", "(", "SevereMessageStoreException", "e", ")", "{", "// No FFDC Code Needed.", "// PK54812 Ensure we dump a suitable FFDC containing all of the message store", "// information required in order to identify the rows etc. related to this entry.", "try", "{", "StringWriter", "stringWriter", "=", "new", "StringWriter", "(", ")", ";", "FormattedWriter", "writer", "=", "new", "FormattedWriter", "(", "stringWriter", ")", ";", "this", ".", "xmlWriteOn", "(", "writer", ")", ";", "FFDCFilter", ".", "processException", "(", "e", ",", "\"com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.getItem\"", ",", "\"1:2252:1.241\"", ",", "this", ",", "new", "Object", "[", "]", "{", "stringWriter", "}", ")", ";", "writer", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "ioe", ")", "{", "FFDCFilter", ".", "processException", "(", "ioe", ",", "\"com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.getItem\"", ",", "\"1:2257:1.241\"", ",", "this", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEventEnabled", "(", ")", ")", "SibTr", ".", "event", "(", "this", ",", "tc", ",", "\"RuntimeException caught restoring Item!\"", ",", "e", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"getItem\"", ")", ";", "throw", "e", ";", "}", "catch", "(", "RuntimeException", "re", ")", "{", "// No FFDC Code Needed.", "// PK54812 Ensure we dump a suitable FFDC containing all of the message store", "// information required in order to identify the rows etc. related to this entry.", "try", "{", "StringWriter", "stringWriter", "=", "new", "StringWriter", "(", ")", ";", "FormattedWriter", "writer", "=", "new", "FormattedWriter", "(", "stringWriter", ")", ";", "this", ".", "xmlWriteOn", "(", "writer", ")", ";", "FFDCFilter", ".", "processException", "(", "re", ",", "\"com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.getItem\"", ",", "\"1:2274:1.241\"", ",", "this", ",", "new", "Object", "[", "]", "{", "stringWriter", "}", ")", ";", "writer", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "ioe", ")", "{", "FFDCFilter", ".", "processException", "(", "ioe", ",", "\"com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.getItem\"", ",", "\"1:2279:1.241\"", ",", "this", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEventEnabled", "(", ")", ")", "SibTr", ".", "event", "(", "this", ",", "tc", ",", "\"RuntimeException caught restoring Item!\"", ",", "re", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"getItem\"", ")", ";", "throw", "re", ";", "}", "}", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"getItem\"", ",", "item", ")", ";", "}", "return", "item", ";", "}" ]
When the item is required, the hard and soft references are examined to detect an existing item in memory. If there is one then this item is used. If the item does not have a hard or soft reference, but does have a persistent representation, then we attempt to restore the item from its persistent representation. If we have no persistent representation, or fail to recreate from the persistent representation, then we unlink the link. @return the item. @throws SevereMessageStoreException
[ "When", "the", "item", "is", "required", "the", "hard", "and", "soft", "references", "are", "examined", "to", "detect", "an", "existing", "item", "in", "memory", ".", "If", "there", "is", "one", "then", "this", "item", "is", "used", ".", "If", "the", "item", "does", "not", "have", "a", "hard", "or", "soft", "reference", "but", "does", "have", "a", "persistent", "representation", "then", "we", "attempt", "to", "restore", "the", "item", "from", "its", "persistent", "representation", ".", "If", "we", "have", "no", "persistent", "representation", "or", "fail", "to", "recreate", "from", "the", "persistent", "representation", "then", "we", "unlink", "the", "link", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java#L2580-L2652
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java
AbstractItemLink.setInMemoryItemSize
private final void setInMemoryItemSize(AbstractItem item) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setInMemoryItemSize", item); // If we have an Item, we can ask it for its estimated size. if (item != null) { _inMemoryItemSize = item.getInMemoryDataSize(); } // Otherwise, we just use its persisted size & our standard multiplier. else { _inMemoryItemSize = _tuple.getPersistentSize() * MEMORY_SIZE_MULTIPLIER; } // Set the value on the Tuple. _tuple.setInMemoryByteSize(_inMemoryItemSize); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setInMemoryItemSize", _inMemoryItemSize); }
java
private final void setInMemoryItemSize(AbstractItem item) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "setInMemoryItemSize", item); // If we have an Item, we can ask it for its estimated size. if (item != null) { _inMemoryItemSize = item.getInMemoryDataSize(); } // Otherwise, we just use its persisted size & our standard multiplier. else { _inMemoryItemSize = _tuple.getPersistentSize() * MEMORY_SIZE_MULTIPLIER; } // Set the value on the Tuple. _tuple.setInMemoryByteSize(_inMemoryItemSize); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "setInMemoryItemSize", _inMemoryItemSize); }
[ "private", "final", "void", "setInMemoryItemSize", "(", "AbstractItem", "item", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"setInMemoryItemSize\"", ",", "item", ")", ";", "// If we have an Item, we can ask it for its estimated size.", "if", "(", "item", "!=", "null", ")", "{", "_inMemoryItemSize", "=", "item", ".", "getInMemoryDataSize", "(", ")", ";", "}", "// Otherwise, we just use its persisted size & our standard multiplier.", "else", "{", "_inMemoryItemSize", "=", "_tuple", ".", "getPersistentSize", "(", ")", "*", "MEMORY_SIZE_MULTIPLIER", ";", "}", "// Set the value on the Tuple.", "_tuple", ".", "setInMemoryByteSize", "(", "_inMemoryItemSize", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"setInMemoryItemSize\"", ",", "_inMemoryItemSize", ")", ";", "}" ]
setInMemoryItemSize Set the _inMemoryItemSize from the Item itself, if we have one, or from what we can find out from the Tuple. Also set the corresponding value in the Tuple.
[ "setInMemoryItemSize", "Set", "the", "_inMemoryItemSize", "from", "the", "Item", "itself", "if", "we", "have", "one", "or", "from", "what", "we", "can", "find", "out", "from", "the", "Tuple", ".", "Also", "set", "the", "corresponding", "value", "in", "the", "Tuple", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java#L2800-L2816
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java
AbstractItemLink.isExpired
final boolean isExpired() throws SevereMessageStoreException { // 182086 if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "isExpired"); if (isAvailable() && internalCanExpire()) { // we can only expire if we are available long expiryTime = _tuple.getExpiryTime(); if (expiryTime != 0 && expiryTime <= Expirer.timeNow()) { // we are due to expire boolean hasBecomeNonReleasable = false; synchronized (this) { if (ItemLinkState.STATE_AVAILABLE == _itemLinkState) { // force item to be present AbstractItem item = _getItemNoRestore(); if (null == item) { item = _restoreItem(); } ListStatistics stats = getParentStatistics(); synchronized (stats) { stats.incrementExpiring(); stats.decrementAvailable(); } _lockID = AbstractItemLink.EXPIRY_LOCK_ID; hasBecomeNonReleasable = _declareNotDiscardable(item); _itemLinkState = ItemLinkState.STATE_LOCKED_FOR_EXPIRY; } } if (hasBecomeNonReleasable) { _declareNotReleasable(); } } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "isExpired", Boolean.valueOf(isExpiring())); return isExpiring(); }
java
final boolean isExpired() throws SevereMessageStoreException { // 182086 if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "isExpired"); if (isAvailable() && internalCanExpire()) { // we can only expire if we are available long expiryTime = _tuple.getExpiryTime(); if (expiryTime != 0 && expiryTime <= Expirer.timeNow()) { // we are due to expire boolean hasBecomeNonReleasable = false; synchronized (this) { if (ItemLinkState.STATE_AVAILABLE == _itemLinkState) { // force item to be present AbstractItem item = _getItemNoRestore(); if (null == item) { item = _restoreItem(); } ListStatistics stats = getParentStatistics(); synchronized (stats) { stats.incrementExpiring(); stats.decrementAvailable(); } _lockID = AbstractItemLink.EXPIRY_LOCK_ID; hasBecomeNonReleasable = _declareNotDiscardable(item); _itemLinkState = ItemLinkState.STATE_LOCKED_FOR_EXPIRY; } } if (hasBecomeNonReleasable) { _declareNotReleasable(); } } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "isExpired", Boolean.valueOf(isExpiring())); return isExpiring(); }
[ "final", "boolean", "isExpired", "(", ")", "throws", "SevereMessageStoreException", "{", "// 182086", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"isExpired\"", ")", ";", "if", "(", "isAvailable", "(", ")", "&&", "internalCanExpire", "(", ")", ")", "{", "// we can only expire if we are available", "long", "expiryTime", "=", "_tuple", ".", "getExpiryTime", "(", ")", ";", "if", "(", "expiryTime", "!=", "0", "&&", "expiryTime", "<=", "Expirer", ".", "timeNow", "(", ")", ")", "{", "// we are due to expire", "boolean", "hasBecomeNonReleasable", "=", "false", ";", "synchronized", "(", "this", ")", "{", "if", "(", "ItemLinkState", ".", "STATE_AVAILABLE", "==", "_itemLinkState", ")", "{", "// force item to be present", "AbstractItem", "item", "=", "_getItemNoRestore", "(", ")", ";", "if", "(", "null", "==", "item", ")", "{", "item", "=", "_restoreItem", "(", ")", ";", "}", "ListStatistics", "stats", "=", "getParentStatistics", "(", ")", ";", "synchronized", "(", "stats", ")", "{", "stats", ".", "incrementExpiring", "(", ")", ";", "stats", ".", "decrementAvailable", "(", ")", ";", "}", "_lockID", "=", "AbstractItemLink", ".", "EXPIRY_LOCK_ID", ";", "hasBecomeNonReleasable", "=", "_declareNotDiscardable", "(", "item", ")", ";", "_itemLinkState", "=", "ItemLinkState", ".", "STATE_LOCKED_FOR_EXPIRY", ";", "}", "}", "if", "(", "hasBecomeNonReleasable", ")", "{", "_declareNotReleasable", "(", ")", ";", "}", "}", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"isExpired\"", ",", "Boolean", ".", "valueOf", "(", "isExpiring", "(", ")", ")", ")", ";", "return", "isExpiring", "(", ")", ";", "}" ]
Establish whether the item has reached its expiry time and if so, query it to see if it is willing to expire. If so, set the state accordingly and lock the item for expiry. @return true if the item has already expired or if it has now been found to have reached its expiry time and is ready to be expired. Returns true if the receiver is in the 'lockedForExpiry' state at the end of the method. @throws SevereMessageStoreException
[ "Establish", "whether", "the", "item", "has", "reached", "its", "expiry", "time", "and", "if", "so", "query", "it", "to", "see", "if", "it", "is", "willing", "to", "expire", ".", "If", "so", "set", "the", "state", "accordingly", "and", "lock", "the", "item", "for", "expiry", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java#L2940-L2986
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java
AbstractItemLink.matches
public final AbstractItem matches(final Filter filter, boolean allowUnavailable) throws SevereMessageStoreException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "matches", new Object[] { filter, Boolean.valueOf(allowUnavailable) }); AbstractItem foundItem = null; if (allowUnavailable || isAvailable()) { if (!isExpired()) { AbstractItem item = getItem(); if (null == item) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "item does not exist"); } else { try { if (null == filter || filter.filterMatches(item)) { foundItem = item; } } catch (Exception e) { //No FFDC Code Needed. // assume exception is false return } } } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "matches", foundItem); return foundItem; }
java
public final AbstractItem matches(final Filter filter, boolean allowUnavailable) throws SevereMessageStoreException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "matches", new Object[] { filter, Boolean.valueOf(allowUnavailable) }); AbstractItem foundItem = null; if (allowUnavailable || isAvailable()) { if (!isExpired()) { AbstractItem item = getItem(); if (null == item) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "item does not exist"); } else { try { if (null == filter || filter.filterMatches(item)) { foundItem = item; } } catch (Exception e) { //No FFDC Code Needed. // assume exception is false return } } } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "matches", foundItem); return foundItem; }
[ "public", "final", "AbstractItem", "matches", "(", "final", "Filter", "filter", ",", "boolean", "allowUnavailable", ")", "throws", "SevereMessageStoreException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"matches\"", ",", "new", "Object", "[", "]", "{", "filter", ",", "Boolean", ".", "valueOf", "(", "allowUnavailable", ")", "}", ")", ";", "AbstractItem", "foundItem", "=", "null", ";", "if", "(", "allowUnavailable", "||", "isAvailable", "(", ")", ")", "{", "if", "(", "!", "isExpired", "(", ")", ")", "{", "AbstractItem", "item", "=", "getItem", "(", ")", ";", "if", "(", "null", "==", "item", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "this", ",", "tc", ",", "\"item does not exist\"", ")", ";", "}", "else", "{", "try", "{", "if", "(", "null", "==", "filter", "||", "filter", ".", "filterMatches", "(", "item", ")", ")", "{", "foundItem", "=", "item", ";", "}", "}", "catch", "(", "Exception", "e", ")", "{", "//No FFDC Code Needed.", "// assume exception is false return", "}", "}", "}", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"matches\"", ",", "foundItem", ")", ";", "return", "foundItem", ";", "}" ]
Version used by browse cursor as it can be set to allow matching unavailable items to be seen. @param filter @param allowUnavailable @throws SevereMessageStoreException
[ "Version", "used", "by", "browse", "cursor", "as", "it", "can", "be", "set", "to", "allow", "matching", "unavailable", "items", "to", "be", "seen", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java#L3480-L3516
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java
AbstractItemLink.persistLock
@Override public final void persistLock(final Transaction transaction) throws ProtocolException, TransactionException, SevereMessageStoreException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "persistLock", transaction); if (null != transaction) { PersistentTransaction mstran = (PersistentTransaction) transaction; cmdPersistLock(mstran); getTuple().setLockID(getLockID()); final Task task = new PersistLock(this); mstran.addWork(task); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "persistLock"); }
java
@Override public final void persistLock(final Transaction transaction) throws ProtocolException, TransactionException, SevereMessageStoreException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "persistLock", transaction); if (null != transaction) { PersistentTransaction mstran = (PersistentTransaction) transaction; cmdPersistLock(mstran); getTuple().setLockID(getLockID()); final Task task = new PersistLock(this); mstran.addWork(task); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "persistLock"); }
[ "@", "Override", "public", "final", "void", "persistLock", "(", "final", "Transaction", "transaction", ")", "throws", "ProtocolException", ",", "TransactionException", ",", "SevereMessageStoreException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"persistLock\"", ",", "transaction", ")", ";", "if", "(", "null", "!=", "transaction", ")", "{", "PersistentTransaction", "mstran", "=", "(", "PersistentTransaction", ")", "transaction", ";", "cmdPersistLock", "(", "mstran", ")", ";", "getTuple", "(", ")", ".", "setLockID", "(", "getLockID", "(", ")", ")", ";", "final", "Task", "task", "=", "new", "PersistLock", "(", "this", ")", ";", "mstran", ".", "addWork", "(", "task", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"persistLock\"", ")", ";", "}" ]
Use this to lock persistently. Invoke indirectly by the API. @param transaction @exception ProtocolException Thrown if an add is attempted when the transaction cannot allow any further work to be added i.e. after completion of the transaction. @exception TransactionException Thrown if an unexpected error occurs. @throws SevereMessageStoreException
[ "Use", "this", "to", "lock", "persistently", ".", "Invoke", "indirectly", "by", "the", "API", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java#L3636-L3653
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java
AbstractItemLink.readDataFromPersistence
@Override public final List<DataSlice> readDataFromPersistence() throws SevereMessageStoreException { List<DataSlice> dataSlices; // lazy restoration only needed if the item was stored. There is // no point trying to restore if there is no data. PersistentMessageStore pm = getMessageStoreImpl().getPersistentMessageStore(); try { dataSlices = pm.readDataOnly(getTuple()); } catch (PersistenceException pe) { com.ibm.ws.ffdc.FFDCFilter.processException(pe, "com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.readDataFromPersistence", "1:3271:1.241", this); throw new SevereMessageStoreException(pe); } return dataSlices; }
java
@Override public final List<DataSlice> readDataFromPersistence() throws SevereMessageStoreException { List<DataSlice> dataSlices; // lazy restoration only needed if the item was stored. There is // no point trying to restore if there is no data. PersistentMessageStore pm = getMessageStoreImpl().getPersistentMessageStore(); try { dataSlices = pm.readDataOnly(getTuple()); } catch (PersistenceException pe) { com.ibm.ws.ffdc.FFDCFilter.processException(pe, "com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.readDataFromPersistence", "1:3271:1.241", this); throw new SevereMessageStoreException(pe); } return dataSlices; }
[ "@", "Override", "public", "final", "List", "<", "DataSlice", ">", "readDataFromPersistence", "(", ")", "throws", "SevereMessageStoreException", "{", "List", "<", "DataSlice", ">", "dataSlices", ";", "// lazy restoration only needed if the item was stored. There is", "// no point trying to restore if there is no data.", "PersistentMessageStore", "pm", "=", "getMessageStoreImpl", "(", ")", ".", "getPersistentMessageStore", "(", ")", ";", "try", "{", "dataSlices", "=", "pm", ".", "readDataOnly", "(", "getTuple", "(", ")", ")", ";", "}", "catch", "(", "PersistenceException", "pe", ")", "{", "com", ".", "ibm", ".", "ws", ".", "ffdc", ".", "FFDCFilter", ".", "processException", "(", "pe", ",", "\"com.ibm.ws.sib.msgstore.cache.links.AbstractItemLink.readDataFromPersistence\"", ",", "\"1:3271:1.241\"", ",", "this", ")", ";", "throw", "new", "SevereMessageStoreException", "(", "pe", ")", ";", "}", "return", "dataSlices", ";", "}" ]
Feature SIB0112le.ms.1
[ "Feature", "SIB0112le", ".", "ms", ".", "1" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java#L3773-L3790
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java
AbstractItemLink.releaseItem
public final void releaseItem() throws SevereMessageStoreException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "releaseItem"); synchronized (this) { _strongReferenceToItem = NULL_STRONG_REF; } if (_softReferenceToItem != null) { _softReferenceToItem.clear(); } // Defect 601995 if (_isStorageManaged && (_itemCacheManagedReference != NULL_CACHE_REF)) { _itemCache.unmanage(this); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { SibTr.debug(this, tc, "release item(" + getID() + ":" + _inMemoryItemSize + ") new cacheSize = " + _itemCache.getCurrentSize()); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "releaseItem"); }
java
public final void releaseItem() throws SevereMessageStoreException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "releaseItem"); synchronized (this) { _strongReferenceToItem = NULL_STRONG_REF; } if (_softReferenceToItem != null) { _softReferenceToItem.clear(); } // Defect 601995 if (_isStorageManaged && (_itemCacheManagedReference != NULL_CACHE_REF)) { _itemCache.unmanage(this); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { SibTr.debug(this, tc, "release item(" + getID() + ":" + _inMemoryItemSize + ") new cacheSize = " + _itemCache.getCurrentSize()); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "releaseItem"); }
[ "public", "final", "void", "releaseItem", "(", ")", "throws", "SevereMessageStoreException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"releaseItem\"", ")", ";", "synchronized", "(", "this", ")", "{", "_strongReferenceToItem", "=", "NULL_STRONG_REF", ";", "}", "if", "(", "_softReferenceToItem", "!=", "null", ")", "{", "_softReferenceToItem", ".", "clear", "(", ")", ";", "}", "// Defect 601995", "if", "(", "_isStorageManaged", "&&", "(", "_itemCacheManagedReference", "!=", "NULL_CACHE_REF", ")", ")", "{", "_itemCache", ".", "unmanage", "(", "this", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "SibTr", ".", "debug", "(", "this", ",", "tc", ",", "\"release item(\"", "+", "getID", "(", ")", "+", "\":\"", "+", "_inMemoryItemSize", "+", "\") new cacheSize = \"", "+", "_itemCache", ".", "getCurrentSize", "(", ")", ")", ";", "}", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"releaseItem\"", ")", ";", "}" ]
Releases all references to the item as a result of the final removal of the item from the MS @throws SevereMessageStoreException
[ "Releases", "all", "references", "to", "the", "item", "as", "a", "result", "of", "the", "final", "removal", "of", "the", "item", "from", "the", "MS" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java#L3833-L3860
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java
AbstractItemLink.releaseIfDiscardable
@Override public final void releaseIfDiscardable() throws SevereMessageStoreException { boolean unlink = false; // flag so we can unlink outside sync block if (isStoreNever()) { synchronized (this) { if (ItemLinkState.STATE_AVAILABLE == _itemLinkState) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "removing STORE_NEVER item as a result of discard"); ListStatistics stats = getParentStatistics(); synchronized (stats) { stats.decrementAvailable(); stats.decrementTotal(_inMemoryItemSize); } _itemLinkState = ItemLinkState.STATE_NOT_STORED; unlink = true; } } } if (unlink) { getMessageStoreImpl().unregister(this); unlink(); } }
java
@Override public final void releaseIfDiscardable() throws SevereMessageStoreException { boolean unlink = false; // flag so we can unlink outside sync block if (isStoreNever()) { synchronized (this) { if (ItemLinkState.STATE_AVAILABLE == _itemLinkState) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "removing STORE_NEVER item as a result of discard"); ListStatistics stats = getParentStatistics(); synchronized (stats) { stats.decrementAvailable(); stats.decrementTotal(_inMemoryItemSize); } _itemLinkState = ItemLinkState.STATE_NOT_STORED; unlink = true; } } } if (unlink) { getMessageStoreImpl().unregister(this); unlink(); } }
[ "@", "Override", "public", "final", "void", "releaseIfDiscardable", "(", ")", "throws", "SevereMessageStoreException", "{", "boolean", "unlink", "=", "false", ";", "// flag so we can unlink outside sync block", "if", "(", "isStoreNever", "(", ")", ")", "{", "synchronized", "(", "this", ")", "{", "if", "(", "ItemLinkState", ".", "STATE_AVAILABLE", "==", "_itemLinkState", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "this", ",", "tc", ",", "\"removing STORE_NEVER item as a result of discard\"", ")", ";", "ListStatistics", "stats", "=", "getParentStatistics", "(", ")", ";", "synchronized", "(", "stats", ")", "{", "stats", ".", "decrementAvailable", "(", ")", ";", "stats", ".", "decrementTotal", "(", "_inMemoryItemSize", ")", ";", "}", "_itemLinkState", "=", "ItemLinkState", ".", "STATE_NOT_STORED", ";", "unlink", "=", "true", ";", "}", "}", "}", "if", "(", "unlink", ")", "{", "getMessageStoreImpl", "(", ")", ".", "unregister", "(", "this", ")", ";", "unlink", "(", ")", ";", "}", "}" ]
This is the callback from the item cache to indicate that the discardable item should be freed. It's only used to remove STORE_NEVER items from the MS when the cache of these items is full. @throws SevereMessageStoreException
[ "This", "is", "the", "callback", "from", "the", "item", "cache", "to", "indicate", "that", "the", "discardable", "item", "should", "be", "freed", ".", "It", "s", "only", "used", "to", "remove", "STORE_NEVER", "items", "from", "the", "MS", "when", "the", "cache", "of", "these", "items", "is", "full", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java#L3869-L3900
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java
AbstractItemLink.removeIfMatches
public final AbstractItem removeIfMatches(final Filter filter, PersistentTransaction transaction) throws ProtocolException, TransactionException, SevereMessageStoreException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "removeIfMatches", new Object[] { filter, transaction }); AbstractItem foundItem = cmdRemoveIfMatches(filter, transaction); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "removeIfMatches", foundItem); return foundItem; }
java
public final AbstractItem removeIfMatches(final Filter filter, PersistentTransaction transaction) throws ProtocolException, TransactionException, SevereMessageStoreException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "removeIfMatches", new Object[] { filter, transaction }); AbstractItem foundItem = cmdRemoveIfMatches(filter, transaction); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "removeIfMatches", foundItem); return foundItem; }
[ "public", "final", "AbstractItem", "removeIfMatches", "(", "final", "Filter", "filter", ",", "PersistentTransaction", "transaction", ")", "throws", "ProtocolException", ",", "TransactionException", ",", "SevereMessageStoreException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"removeIfMatches\"", ",", "new", "Object", "[", "]", "{", "filter", ",", "transaction", "}", ")", ";", "AbstractItem", "foundItem", "=", "cmdRemoveIfMatches", "(", "filter", ",", "transaction", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"removeIfMatches\"", ",", "foundItem", ")", ";", "return", "foundItem", ";", "}" ]
remove the item if it matches and is available @param filter @param transaction @return item if locked @throws ProtocolException Thrown if an add is attempted when the transaction cannot allow any further work to be added i.e. after completion of the transaction. @throws TransactionException Thrown if an unexpected error occurs. @throws SevereMessageStoreException
[ "remove", "the", "item", "if", "it", "matches", "and", "is", "available" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/cache/links/AbstractItemLink.java#L3916-L3926
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/lifecycle/RestoreViewExecutor.java
RestoreViewExecutor._getLifecycle
private Lifecycle _getLifecycle(FacesContext facesContext) { LifecycleFactory factory = (LifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY); String id = facesContext.getExternalContext().getInitParameter(FacesServlet.LIFECYCLE_ID_ATTR); if (id == null) { id = LifecycleFactory.DEFAULT_LIFECYCLE; } return factory.getLifecycle(id); }
java
private Lifecycle _getLifecycle(FacesContext facesContext) { LifecycleFactory factory = (LifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY); String id = facesContext.getExternalContext().getInitParameter(FacesServlet.LIFECYCLE_ID_ATTR); if (id == null) { id = LifecycleFactory.DEFAULT_LIFECYCLE; } return factory.getLifecycle(id); }
[ "private", "Lifecycle", "_getLifecycle", "(", "FacesContext", "facesContext", ")", "{", "LifecycleFactory", "factory", "=", "(", "LifecycleFactory", ")", "FactoryFinder", ".", "getFactory", "(", "FactoryFinder", ".", "LIFECYCLE_FACTORY", ")", ";", "String", "id", "=", "facesContext", ".", "getExternalContext", "(", ")", ".", "getInitParameter", "(", "FacesServlet", ".", "LIFECYCLE_ID_ATTR", ")", ";", "if", "(", "id", "==", "null", ")", "{", "id", "=", "LifecycleFactory", ".", "DEFAULT_LIFECYCLE", ";", "}", "return", "factory", ".", "getLifecycle", "(", "id", ")", ";", "}" ]
Gets the current Lifecycle instance from the LifecycleFactory @param facesContext @return
[ "Gets", "the", "current", "Lifecycle", "instance", "from", "the", "LifecycleFactory" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/lifecycle/RestoreViewExecutor.java#L551-L560
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java
WSKeyStore.locationInOutputDir
private boolean locationInOutputDir(String location) { String expandedOutputLocation = cfgSvc.resolveString(LibertyConstants.DEFAULT_OUTPUT_LOCATION); return location.startsWith(LibertyConstants.DEFAULT_OUTPUT_LOCATION) || location.startsWith(expandedOutputLocation); }
java
private boolean locationInOutputDir(String location) { String expandedOutputLocation = cfgSvc.resolveString(LibertyConstants.DEFAULT_OUTPUT_LOCATION); return location.startsWith(LibertyConstants.DEFAULT_OUTPUT_LOCATION) || location.startsWith(expandedOutputLocation); }
[ "private", "boolean", "locationInOutputDir", "(", "String", "location", ")", "{", "String", "expandedOutputLocation", "=", "cfgSvc", ".", "resolveString", "(", "LibertyConstants", ".", "DEFAULT_OUTPUT_LOCATION", ")", ";", "return", "location", ".", "startsWith", "(", "LibertyConstants", ".", "DEFAULT_OUTPUT_LOCATION", ")", "||", "location", ".", "startsWith", "(", "expandedOutputLocation", ")", ";", "}" ]
Determines if the location is rooted in the server's output location. @param location @return true if the location is under the server's output location; false otherwise.
[ "Determines", "if", "the", "location", "is", "rooted", "in", "the", "server", "s", "output", "location", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java#L347-L352
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java
WSKeyStore.setLocation
private void setLocation(String _location) { String res = null; File resFile = null; boolean relativePath = true; boolean defaultPath = false; // try as "absolute" resource (contains symbol, or absolute path) try { res = cfgSvc.resolveString(_location); resFile = new File(res); relativePath = !resFile.isAbsolute(); } catch (IllegalStateException e) { // ignore } if (resFile == null || (!resFile.isFile() && relativePath)) { // look for resource in server config location try { res = cfgSvc.resolveString(LibertyConstants.DEFAULT_CONFIG_LOCATION + _location); resFile = new File(res); } catch (IllegalStateException e) { // ignore } if (resFile == null || !resFile.isFile()) { // fall back to creating for resource in shared output location try { res = cfgSvc.resolveString(LibertyConstants.DEFAULT_OUTPUT_LOCATION + _location); resFile = new File(res); defaultPath = true; } catch (IllegalStateException e) { // ignore } } } // Work against the symbol in the original location // The original location may be been if (isDefault && (defaultPath || locationInOutputDir(_location))) { this.initializeAtStartup = true; } // reset location w/ resolved value // isDefault tested because the default path's file may not exists (and that's OK) if ((res != null && resFile.isFile()) || isDefault) { this.location = res; if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Found store under [" + location + "]"); } } else { // If it wasn't found then it's likely going to trigger // the load.error later. Issue a warning to explain the file // could not be found. Tr.warning(tc, "ssl.keystore.not.found.warning", res, name); } }
java
private void setLocation(String _location) { String res = null; File resFile = null; boolean relativePath = true; boolean defaultPath = false; // try as "absolute" resource (contains symbol, or absolute path) try { res = cfgSvc.resolveString(_location); resFile = new File(res); relativePath = !resFile.isAbsolute(); } catch (IllegalStateException e) { // ignore } if (resFile == null || (!resFile.isFile() && relativePath)) { // look for resource in server config location try { res = cfgSvc.resolveString(LibertyConstants.DEFAULT_CONFIG_LOCATION + _location); resFile = new File(res); } catch (IllegalStateException e) { // ignore } if (resFile == null || !resFile.isFile()) { // fall back to creating for resource in shared output location try { res = cfgSvc.resolveString(LibertyConstants.DEFAULT_OUTPUT_LOCATION + _location); resFile = new File(res); defaultPath = true; } catch (IllegalStateException e) { // ignore } } } // Work against the symbol in the original location // The original location may be been if (isDefault && (defaultPath || locationInOutputDir(_location))) { this.initializeAtStartup = true; } // reset location w/ resolved value // isDefault tested because the default path's file may not exists (and that's OK) if ((res != null && resFile.isFile()) || isDefault) { this.location = res; if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Found store under [" + location + "]"); } } else { // If it wasn't found then it's likely going to trigger // the load.error later. Issue a warning to explain the file // could not be found. Tr.warning(tc, "ssl.keystore.not.found.warning", res, name); } }
[ "private", "void", "setLocation", "(", "String", "_location", ")", "{", "String", "res", "=", "null", ";", "File", "resFile", "=", "null", ";", "boolean", "relativePath", "=", "true", ";", "boolean", "defaultPath", "=", "false", ";", "// try as \"absolute\" resource (contains symbol, or absolute path)", "try", "{", "res", "=", "cfgSvc", ".", "resolveString", "(", "_location", ")", ";", "resFile", "=", "new", "File", "(", "res", ")", ";", "relativePath", "=", "!", "resFile", ".", "isAbsolute", "(", ")", ";", "}", "catch", "(", "IllegalStateException", "e", ")", "{", "// ignore", "}", "if", "(", "resFile", "==", "null", "||", "(", "!", "resFile", ".", "isFile", "(", ")", "&&", "relativePath", ")", ")", "{", "// look for resource in server config location", "try", "{", "res", "=", "cfgSvc", ".", "resolveString", "(", "LibertyConstants", ".", "DEFAULT_CONFIG_LOCATION", "+", "_location", ")", ";", "resFile", "=", "new", "File", "(", "res", ")", ";", "}", "catch", "(", "IllegalStateException", "e", ")", "{", "// ignore", "}", "if", "(", "resFile", "==", "null", "||", "!", "resFile", ".", "isFile", "(", ")", ")", "{", "// fall back to creating for resource in shared output location", "try", "{", "res", "=", "cfgSvc", ".", "resolveString", "(", "LibertyConstants", ".", "DEFAULT_OUTPUT_LOCATION", "+", "_location", ")", ";", "resFile", "=", "new", "File", "(", "res", ")", ";", "defaultPath", "=", "true", ";", "}", "catch", "(", "IllegalStateException", "e", ")", "{", "// ignore", "}", "}", "}", "// Work against the symbol in the original location", "// The original location may be been", "if", "(", "isDefault", "&&", "(", "defaultPath", "||", "locationInOutputDir", "(", "_location", ")", ")", ")", "{", "this", ".", "initializeAtStartup", "=", "true", ";", "}", "// reset location w/ resolved value", "// isDefault tested because the default path's file may not exists (and that's OK)", "if", "(", "(", "res", "!=", "null", "&&", "resFile", ".", "isFile", "(", ")", ")", "||", "isDefault", ")", "{", "this", ".", "location", "=", "res", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"Found store under [\"", "+", "location", "+", "\"]\"", ")", ";", "}", "}", "else", "{", "// If it wasn't found then it's likely going to trigger", "// the load.error later. Issue a warning to explain the file", "// could not be found.", "Tr", ".", "warning", "(", "tc", ",", "\"ssl.keystore.not.found.warning\"", ",", "res", ",", "name", ")", ";", "}", "}" ]
Set the physical location of this store to the input value. This method will resolve all symbolic names in the location. If location is just a file name, then we assume its location is the LibertyConstants.DEFAULT_CONFIG_LOCATION. @param _location
[ "Set", "the", "physical", "location", "of", "this", "store", "to", "the", "input", "value", ".", "This", "method", "will", "resolve", "all", "symbolic", "names", "in", "the", "location", ".", "If", "location", "is", "just", "a", "file", "name", "then", "we", "assume", "its", "location", "is", "the", "LibertyConstants", ".", "DEFAULT_CONFIG_LOCATION", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java#L362-L419
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java
WSKeyStore.setFileBased
private void setFileBased(Boolean flag) { this.fileBased = flag; setProperty(Constants.SSLPROP_KEY_STORE_FILE_BASED, flag.toString()); }
java
private void setFileBased(Boolean flag) { this.fileBased = flag; setProperty(Constants.SSLPROP_KEY_STORE_FILE_BASED, flag.toString()); }
[ "private", "void", "setFileBased", "(", "Boolean", "flag", ")", "{", "this", ".", "fileBased", "=", "flag", ";", "setProperty", "(", "Constants", ".", "SSLPROP_KEY_STORE_FILE_BASED", ",", "flag", ".", "toString", "(", ")", ")", ";", "}" ]
Set the flag on whether this keystore is filebased or not to the input value. @param flag
[ "Set", "the", "flag", "on", "whether", "this", "keystore", "is", "filebased", "or", "not", "to", "the", "input", "value", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java#L535-L538
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java
WSKeyStore.setReadOnly
private void setReadOnly(Boolean flag) { this.readOnly = flag; setProperty(Constants.SSLPROP_KEY_STORE_READ_ONLY, flag.toString()); }
java
private void setReadOnly(Boolean flag) { this.readOnly = flag; setProperty(Constants.SSLPROP_KEY_STORE_READ_ONLY, flag.toString()); }
[ "private", "void", "setReadOnly", "(", "Boolean", "flag", ")", "{", "this", ".", "readOnly", "=", "flag", ";", "setProperty", "(", "Constants", ".", "SSLPROP_KEY_STORE_READ_ONLY", ",", "flag", ".", "toString", "(", ")", ")", ";", "}" ]
Set the flag on whether this keystore is read only to the input flag. @param flag
[ "Set", "the", "flag", "on", "whether", "this", "keystore", "is", "read", "only", "to", "the", "input", "flag", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java#L545-L548
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java
WSKeyStore.setInitializeAtStartup
private void setInitializeAtStartup(Boolean flag) { this.initializeAtStartup = flag; setProperty(Constants.SSLPROP_KEY_STORE_INITIALIZE_AT_STARTUP, flag.toString()); }
java
private void setInitializeAtStartup(Boolean flag) { this.initializeAtStartup = flag; setProperty(Constants.SSLPROP_KEY_STORE_INITIALIZE_AT_STARTUP, flag.toString()); }
[ "private", "void", "setInitializeAtStartup", "(", "Boolean", "flag", ")", "{", "this", ".", "initializeAtStartup", "=", "flag", ";", "setProperty", "(", "Constants", ".", "SSLPROP_KEY_STORE_INITIALIZE_AT_STARTUP", ",", "flag", ".", "toString", "(", ")", ")", ";", "}" ]
Set the flag on whether this keystore should initialize at startup. @param flag
[ "Set", "the", "flag", "on", "whether", "this", "keystore", "should", "initialize", "at", "startup", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java#L555-L558
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java
WSKeyStore.getLocation
public String getLocation() { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "getLocation -> " + location); } return this.location; }
java
public String getLocation() { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "getLocation -> " + location); } return this.location; }
[ "public", "String", "getLocation", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"getLocation -> \"", "+", "location", ")", ";", "}", "return", "this", ".", "location", ";", "}" ]
Query the location of this keystore. @return String
[ "Query", "the", "location", "of", "this", "keystore", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java#L574-L579
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java
WSKeyStore.getPollingRate
public long getPollingRate() { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "getPollingRate returning " + pollingRate); return this.pollingRate; }
java
public long getPollingRate() { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "getPollingRate returning " + pollingRate); return this.pollingRate; }
[ "public", "long", "getPollingRate", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"getPollingRate returning \"", "+", "pollingRate", ")", ";", "return", "this", ".", "pollingRate", ";", "}" ]
Query the monitor interval @return Boolean
[ "Query", "the", "monitor", "interval" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java#L649-L653
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java
WSKeyStore.getTrigger
public String getTrigger() { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "getTrigger returning " + trigger); return this.trigger; }
java
public String getTrigger() { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "getTrigger returning " + trigger); return this.trigger; }
[ "public", "String", "getTrigger", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"getTrigger returning \"", "+", "trigger", ")", ";", "return", "this", ".", "trigger", ";", "}" ]
Query the file monitoring trigger @return Boolean
[ "Query", "the", "file", "monitoring", "trigger" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java#L660-L664
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java
WSKeyStore.getKeyStore
public KeyStore getKeyStore(boolean reinitialize, boolean createIfNotPresent) throws Exception { if (myKeyStore == null || reinitialize) { myKeyStore = do_getKeyStore(reinitialize, createIfNotPresent); } return myKeyStore; }
java
public KeyStore getKeyStore(boolean reinitialize, boolean createIfNotPresent) throws Exception { if (myKeyStore == null || reinitialize) { myKeyStore = do_getKeyStore(reinitialize, createIfNotPresent); } return myKeyStore; }
[ "public", "KeyStore", "getKeyStore", "(", "boolean", "reinitialize", ",", "boolean", "createIfNotPresent", ")", "throws", "Exception", "{", "if", "(", "myKeyStore", "==", "null", "||", "reinitialize", ")", "{", "myKeyStore", "=", "do_getKeyStore", "(", "reinitialize", ",", "createIfNotPresent", ")", ";", "}", "return", "myKeyStore", ";", "}" ]
Get the key store wrapped by this object. @param reinitialize @param createIfNotPresent @return KeyStore @throws Exception
[ "Get", "the", "key", "store", "wrapped", "by", "this", "object", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java#L909-L915
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java
WSKeyStore.store
public void store() throws Exception { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "store"); try { String name = getProperty(Constants.SSLPROP_KEY_STORE_NAME); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "Storing KeyStore " + name); String SSLKeyFile = getProperty(Constants.SSLPROP_KEY_STORE); String SSLKeyPassword = decodePassword(getProperty(Constants.SSLPROP_KEY_STORE_PASSWORD)); String SSLKeyStoreType = getProperty(Constants.SSLPROP_KEY_STORE_TYPE); boolean readOnly = Boolean.parseBoolean(getProperty(Constants.SSLPROP_KEY_STORE_READ_ONLY)); boolean fileBased = Boolean.parseBoolean(getProperty(Constants.SSLPROP_KEY_STORE_FILE_BASED)); String SSLKeyStoreStash = getProperty(Constants.SSLPROP_KEY_STORE_CREATE_CMS_STASH); KeyStore ks = getKeyStore(false, false); if (ks != null && !readOnly) { if (fileBased) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "Storing filebased keystore type " + SSLKeyStoreType); String keyStoreLocation = SSLKeyFile; String keyStorePassword = SSLKeyPassword; final FileOutputStream fos = new FileOutputStream(keyStoreLocation); try { ks.store(fos, keyStorePassword.toCharArray()); } finally { fos.close(); } } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "Storing non-filebased keystore type " + SSLKeyStoreType); String keyStoreLocation = SSLKeyFile; String keyStorePassword = SSLKeyPassword; URL ring = new URL(keyStoreLocation); URLConnection ringConnect = ring.openConnection(); final OutputStream fos = ringConnect.getOutputStream(); try { ks.store(fos, keyStorePassword.toCharArray()); } finally { fos.close(); } } } // we will likely have to store other types too } catch (Exception e) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "Exception storing KeyStore; " + e); FFDCFilter.processException(e, getClass().getName(), "store", this); throw e; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "store"); }
java
public void store() throws Exception { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "store"); try { String name = getProperty(Constants.SSLPROP_KEY_STORE_NAME); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "Storing KeyStore " + name); String SSLKeyFile = getProperty(Constants.SSLPROP_KEY_STORE); String SSLKeyPassword = decodePassword(getProperty(Constants.SSLPROP_KEY_STORE_PASSWORD)); String SSLKeyStoreType = getProperty(Constants.SSLPROP_KEY_STORE_TYPE); boolean readOnly = Boolean.parseBoolean(getProperty(Constants.SSLPROP_KEY_STORE_READ_ONLY)); boolean fileBased = Boolean.parseBoolean(getProperty(Constants.SSLPROP_KEY_STORE_FILE_BASED)); String SSLKeyStoreStash = getProperty(Constants.SSLPROP_KEY_STORE_CREATE_CMS_STASH); KeyStore ks = getKeyStore(false, false); if (ks != null && !readOnly) { if (fileBased) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "Storing filebased keystore type " + SSLKeyStoreType); String keyStoreLocation = SSLKeyFile; String keyStorePassword = SSLKeyPassword; final FileOutputStream fos = new FileOutputStream(keyStoreLocation); try { ks.store(fos, keyStorePassword.toCharArray()); } finally { fos.close(); } } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "Storing non-filebased keystore type " + SSLKeyStoreType); String keyStoreLocation = SSLKeyFile; String keyStorePassword = SSLKeyPassword; URL ring = new URL(keyStoreLocation); URLConnection ringConnect = ring.openConnection(); final OutputStream fos = ringConnect.getOutputStream(); try { ks.store(fos, keyStorePassword.toCharArray()); } finally { fos.close(); } } } // we will likely have to store other types too } catch (Exception e) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "Exception storing KeyStore; " + e); FFDCFilter.processException(e, getClass().getName(), "store", this); throw e; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "store"); }
[ "public", "void", "store", "(", ")", "throws", "Exception", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"store\"", ")", ";", "try", "{", "String", "name", "=", "getProperty", "(", "Constants", ".", "SSLPROP_KEY_STORE_NAME", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"Storing KeyStore \"", "+", "name", ")", ";", "String", "SSLKeyFile", "=", "getProperty", "(", "Constants", ".", "SSLPROP_KEY_STORE", ")", ";", "String", "SSLKeyPassword", "=", "decodePassword", "(", "getProperty", "(", "Constants", ".", "SSLPROP_KEY_STORE_PASSWORD", ")", ")", ";", "String", "SSLKeyStoreType", "=", "getProperty", "(", "Constants", ".", "SSLPROP_KEY_STORE_TYPE", ")", ";", "boolean", "readOnly", "=", "Boolean", ".", "parseBoolean", "(", "getProperty", "(", "Constants", ".", "SSLPROP_KEY_STORE_READ_ONLY", ")", ")", ";", "boolean", "fileBased", "=", "Boolean", ".", "parseBoolean", "(", "getProperty", "(", "Constants", ".", "SSLPROP_KEY_STORE_FILE_BASED", ")", ")", ";", "String", "SSLKeyStoreStash", "=", "getProperty", "(", "Constants", ".", "SSLPROP_KEY_STORE_CREATE_CMS_STASH", ")", ";", "KeyStore", "ks", "=", "getKeyStore", "(", "false", ",", "false", ")", ";", "if", "(", "ks", "!=", "null", "&&", "!", "readOnly", ")", "{", "if", "(", "fileBased", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"Storing filebased keystore type \"", "+", "SSLKeyStoreType", ")", ";", "String", "keyStoreLocation", "=", "SSLKeyFile", ";", "String", "keyStorePassword", "=", "SSLKeyPassword", ";", "final", "FileOutputStream", "fos", "=", "new", "FileOutputStream", "(", "keyStoreLocation", ")", ";", "try", "{", "ks", ".", "store", "(", "fos", ",", "keyStorePassword", ".", "toCharArray", "(", ")", ")", ";", "}", "finally", "{", "fos", ".", "close", "(", ")", ";", "}", "}", "else", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"Storing non-filebased keystore type \"", "+", "SSLKeyStoreType", ")", ";", "String", "keyStoreLocation", "=", "SSLKeyFile", ";", "String", "keyStorePassword", "=", "SSLKeyPassword", ";", "URL", "ring", "=", "new", "URL", "(", "keyStoreLocation", ")", ";", "URLConnection", "ringConnect", "=", "ring", ".", "openConnection", "(", ")", ";", "final", "OutputStream", "fos", "=", "ringConnect", ".", "getOutputStream", "(", ")", ";", "try", "{", "ks", ".", "store", "(", "fos", ",", "keyStorePassword", ".", "toCharArray", "(", ")", ")", ";", "}", "finally", "{", "fos", ".", "close", "(", ")", ";", "}", "}", "}", "// we will likely have to store other types too", "}", "catch", "(", "Exception", "e", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"Exception storing KeyStore; \"", "+", "e", ")", ";", "FFDCFilter", ".", "processException", "(", "e", ",", "getClass", "(", ")", ".", "getName", "(", ")", ",", "\"store\"", ",", "this", ")", ";", "throw", "e", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "tc", ",", "\"store\"", ")", ";", "}" ]
Store the current information into the wrapped keystore. @throws Exception
[ "Store", "the", "current", "information", "into", "the", "wrapped", "keystore", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java#L922-L979
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java
WSKeyStore.initializeKeyStore
public void initializeKeyStore(boolean reinitialize) throws Exception { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "initializeKeyStore"); try { String initAtStartup = getProperty(Constants.SSLPROP_KEY_STORE_INITIALIZE_AT_STARTUP); boolean createIfMissing = LibertyConstants.DEFAULT_KEYSTORE_REF_ID.equals(getProperty("id")); if (Boolean.parseBoolean(initAtStartup) || reinitialize) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "Initializing keystore at startup."); getKeyStore(reinitialize, createIfMissing); } } catch (Exception e) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "Exception initializing KeyStore; " + e); throw e; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "initializeKeyStore"); }
java
public void initializeKeyStore(boolean reinitialize) throws Exception { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "initializeKeyStore"); try { String initAtStartup = getProperty(Constants.SSLPROP_KEY_STORE_INITIALIZE_AT_STARTUP); boolean createIfMissing = LibertyConstants.DEFAULT_KEYSTORE_REF_ID.equals(getProperty("id")); if (Boolean.parseBoolean(initAtStartup) || reinitialize) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "Initializing keystore at startup."); getKeyStore(reinitialize, createIfMissing); } } catch (Exception e) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "Exception initializing KeyStore; " + e); throw e; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "initializeKeyStore"); }
[ "public", "void", "initializeKeyStore", "(", "boolean", "reinitialize", ")", "throws", "Exception", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"initializeKeyStore\"", ")", ";", "try", "{", "String", "initAtStartup", "=", "getProperty", "(", "Constants", ".", "SSLPROP_KEY_STORE_INITIALIZE_AT_STARTUP", ")", ";", "boolean", "createIfMissing", "=", "LibertyConstants", ".", "DEFAULT_KEYSTORE_REF_ID", ".", "equals", "(", "getProperty", "(", "\"id\"", ")", ")", ";", "if", "(", "Boolean", ".", "parseBoolean", "(", "initAtStartup", ")", "||", "reinitialize", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"Initializing keystore at startup.\"", ")", ";", "getKeyStore", "(", "reinitialize", ",", "createIfMissing", ")", ";", "}", "}", "catch", "(", "Exception", "e", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"Exception initializing KeyStore; \"", "+", "e", ")", ";", "throw", "e", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "tc", ",", "\"initializeKeyStore\"", ")", ";", "}" ]
Initialize the wrapped keystore. @param reinitialize @throws Exception
[ "Initialize", "the", "wrapped", "keystore", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java#L987-L1008
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java
WSKeyStore.provideExpirationWarnings
public void provideExpirationWarnings(int daysBeforeExpireWarning, String keyStoreName) throws Exception { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "provideExpirationWarnings", Integer.valueOf(daysBeforeExpireWarning)); KeyStore keystore = getKeyStore(false, false); if (keystore != null) { try { Enumeration<String> e = keystore.aliases(); if (e != null) { for (; e.hasMoreElements();) { String alias = e.nextElement(); if (null == alias) continue; Certificate[] cert_chain = keystore.getCertificateChain(alias); if (null == cert_chain) continue; for (int i = 0; i < cert_chain.length; i++) { printWarning(daysBeforeExpireWarning, keyStoreName, alias, (X509Certificate) cert_chain[i]); } } } } catch (Exception e) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "Exception validating KeyStore expirations; " + e); FFDCFilter.processException(e, getClass().getName(), "provideExpirationWarnings", this); throw e; } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "provideExpirationWarnings"); }
java
public void provideExpirationWarnings(int daysBeforeExpireWarning, String keyStoreName) throws Exception { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "provideExpirationWarnings", Integer.valueOf(daysBeforeExpireWarning)); KeyStore keystore = getKeyStore(false, false); if (keystore != null) { try { Enumeration<String> e = keystore.aliases(); if (e != null) { for (; e.hasMoreElements();) { String alias = e.nextElement(); if (null == alias) continue; Certificate[] cert_chain = keystore.getCertificateChain(alias); if (null == cert_chain) continue; for (int i = 0; i < cert_chain.length; i++) { printWarning(daysBeforeExpireWarning, keyStoreName, alias, (X509Certificate) cert_chain[i]); } } } } catch (Exception e) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "Exception validating KeyStore expirations; " + e); FFDCFilter.processException(e, getClass().getName(), "provideExpirationWarnings", this); throw e; } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "provideExpirationWarnings"); }
[ "public", "void", "provideExpirationWarnings", "(", "int", "daysBeforeExpireWarning", ",", "String", "keyStoreName", ")", "throws", "Exception", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"provideExpirationWarnings\"", ",", "Integer", ".", "valueOf", "(", "daysBeforeExpireWarning", ")", ")", ";", "KeyStore", "keystore", "=", "getKeyStore", "(", "false", ",", "false", ")", ";", "if", "(", "keystore", "!=", "null", ")", "{", "try", "{", "Enumeration", "<", "String", ">", "e", "=", "keystore", ".", "aliases", "(", ")", ";", "if", "(", "e", "!=", "null", ")", "{", "for", "(", ";", "e", ".", "hasMoreElements", "(", ")", ";", ")", "{", "String", "alias", "=", "e", ".", "nextElement", "(", ")", ";", "if", "(", "null", "==", "alias", ")", "continue", ";", "Certificate", "[", "]", "cert_chain", "=", "keystore", ".", "getCertificateChain", "(", "alias", ")", ";", "if", "(", "null", "==", "cert_chain", ")", "continue", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "cert_chain", ".", "length", ";", "i", "++", ")", "{", "printWarning", "(", "daysBeforeExpireWarning", ",", "keyStoreName", ",", "alias", ",", "(", "X509Certificate", ")", "cert_chain", "[", "i", "]", ")", ";", "}", "}", "}", "}", "catch", "(", "Exception", "e", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"Exception validating KeyStore expirations; \"", "+", "e", ")", ";", "FFDCFilter", ".", "processException", "(", "e", ",", "getClass", "(", ")", ".", "getName", "(", ")", ",", "\"provideExpirationWarnings\"", ",", "this", ")", ";", "throw", "e", ";", "}", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "tc", ",", "\"provideExpirationWarnings\"", ")", ";", "}" ]
Cycle through the keystore looking for expired certificates. Print a warning for any certificates that are expired or will expire during the input interval. @param daysBeforeExpireWarning @param keyStoreName @throws Exception
[ "Cycle", "through", "the", "keystore", "looking", "for", "expired", "certificates", ".", "Print", "a", "warning", "for", "any", "certificates", "that", "are", "expired", "or", "will", "expire", "during", "the", "input", "interval", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java#L1019-L1051
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java
WSKeyStore.printWarning
public void printWarning(int daysBeforeExpireWarning, String keyStoreName, String alias, X509Certificate cert) { try { long millisDelta = ((((daysBeforeExpireWarning * 24L) * 60L) * 60L) * 1000L); long millisBeforeExpiration = cert.getNotAfter().getTime() - System.currentTimeMillis(); long daysLeft = ((((millisBeforeExpiration / 1000L) / 60L) / 60L) / 24L); // cert is already expired if (millisBeforeExpiration < 0) { Tr.error(tc, "ssl.expiration.expired.CWPKI0017E", new Object[] { alias, keyStoreName }); } else if (millisBeforeExpiration < millisDelta) { Tr.warning(tc, "ssl.expiration.warning.CWPKI0016W", new Object[] { alias, keyStoreName, Long.valueOf(daysLeft) }); } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "The certificate with alias " + alias + " from keyStore " + keyStoreName + " has " + daysLeft + " days left before expiring."); } } catch (Exception e) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "Exception reading KeyStore certificates during expiration check; " + e); FFDCFilter.processException(e, getClass().getName(), "printWarning", this); } }
java
public void printWarning(int daysBeforeExpireWarning, String keyStoreName, String alias, X509Certificate cert) { try { long millisDelta = ((((daysBeforeExpireWarning * 24L) * 60L) * 60L) * 1000L); long millisBeforeExpiration = cert.getNotAfter().getTime() - System.currentTimeMillis(); long daysLeft = ((((millisBeforeExpiration / 1000L) / 60L) / 60L) / 24L); // cert is already expired if (millisBeforeExpiration < 0) { Tr.error(tc, "ssl.expiration.expired.CWPKI0017E", new Object[] { alias, keyStoreName }); } else if (millisBeforeExpiration < millisDelta) { Tr.warning(tc, "ssl.expiration.warning.CWPKI0016W", new Object[] { alias, keyStoreName, Long.valueOf(daysLeft) }); } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "The certificate with alias " + alias + " from keyStore " + keyStoreName + " has " + daysLeft + " days left before expiring."); } } catch (Exception e) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "Exception reading KeyStore certificates during expiration check; " + e); FFDCFilter.processException(e, getClass().getName(), "printWarning", this); } }
[ "public", "void", "printWarning", "(", "int", "daysBeforeExpireWarning", ",", "String", "keyStoreName", ",", "String", "alias", ",", "X509Certificate", "cert", ")", "{", "try", "{", "long", "millisDelta", "=", "(", "(", "(", "(", "daysBeforeExpireWarning", "*", "24L", ")", "*", "60L", ")", "*", "60L", ")", "*", "1000L", ")", ";", "long", "millisBeforeExpiration", "=", "cert", ".", "getNotAfter", "(", ")", ".", "getTime", "(", ")", "-", "System", ".", "currentTimeMillis", "(", ")", ";", "long", "daysLeft", "=", "(", "(", "(", "(", "millisBeforeExpiration", "/", "1000L", ")", "/", "60L", ")", "/", "60L", ")", "/", "24L", ")", ";", "// cert is already expired", "if", "(", "millisBeforeExpiration", "<", "0", ")", "{", "Tr", ".", "error", "(", "tc", ",", "\"ssl.expiration.expired.CWPKI0017E\"", ",", "new", "Object", "[", "]", "{", "alias", ",", "keyStoreName", "}", ")", ";", "}", "else", "if", "(", "millisBeforeExpiration", "<", "millisDelta", ")", "{", "Tr", ".", "warning", "(", "tc", ",", "\"ssl.expiration.warning.CWPKI0016W\"", ",", "new", "Object", "[", "]", "{", "alias", ",", "keyStoreName", ",", "Long", ".", "valueOf", "(", "daysLeft", ")", "}", ")", ";", "}", "else", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"The certificate with alias \"", "+", "alias", "+", "\" from keyStore \"", "+", "keyStoreName", "+", "\" has \"", "+", "daysLeft", "+", "\" days left before expiring.\"", ")", ";", "}", "}", "catch", "(", "Exception", "e", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"Exception reading KeyStore certificates during expiration check; \"", "+", "e", ")", ";", "FFDCFilter", ".", "processException", "(", "e", ",", "getClass", "(", ")", ".", "getName", "(", ")", ",", "\"printWarning\"", ",", "this", ")", ";", "}", "}" ]
Print a warning about a certificate being expired or soon to be expired in the keystore. @param daysBeforeExpireWarning @param keyStoreName @param alias @param cert
[ "Print", "a", "warning", "about", "a", "certificate", "being", "expired", "or", "soon", "to", "be", "expired", "in", "the", "keystore", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java#L1062-L1082
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java
WSKeyStore.openKeyStore
public static InputStream openKeyStore(String fileName) throws MalformedURLException, IOException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "openKeyStore: " + fileName); URL urlFile = null; // Check if the filename exists as a File. File kfile = new File(fileName); if (kfile.exists() && kfile.length() == 0) { throw new IOException("Keystore file exists, but is empty: " + fileName); } else if (!kfile.exists()) { urlFile = new URL(fileName); } else { // kfile exists urlFile = new URL("file:" + kfile.getCanonicalPath()); } // Finally open the file. InputStream fis = urlFile.openStream(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "openKeyStore: " + (null != fis)); return fis; }
java
public static InputStream openKeyStore(String fileName) throws MalformedURLException, IOException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.entry(tc, "openKeyStore: " + fileName); URL urlFile = null; // Check if the filename exists as a File. File kfile = new File(fileName); if (kfile.exists() && kfile.length() == 0) { throw new IOException("Keystore file exists, but is empty: " + fileName); } else if (!kfile.exists()) { urlFile = new URL(fileName); } else { // kfile exists urlFile = new URL("file:" + kfile.getCanonicalPath()); } // Finally open the file. InputStream fis = urlFile.openStream(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) Tr.exit(tc, "openKeyStore: " + (null != fis)); return fis; }
[ "public", "static", "InputStream", "openKeyStore", "(", "String", "fileName", ")", "throws", "MalformedURLException", ",", "IOException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"openKeyStore: \"", "+", "fileName", ")", ";", "URL", "urlFile", "=", "null", ";", "// Check if the filename exists as a File.", "File", "kfile", "=", "new", "File", "(", "fileName", ")", ";", "if", "(", "kfile", ".", "exists", "(", ")", "&&", "kfile", ".", "length", "(", ")", "==", "0", ")", "{", "throw", "new", "IOException", "(", "\"Keystore file exists, but is empty: \"", "+", "fileName", ")", ";", "}", "else", "if", "(", "!", "kfile", ".", "exists", "(", ")", ")", "{", "urlFile", "=", "new", "URL", "(", "fileName", ")", ";", "}", "else", "{", "// kfile exists", "urlFile", "=", "new", "URL", "(", "\"file:\"", "+", "kfile", ".", "getCanonicalPath", "(", ")", ")", ";", "}", "// Finally open the file.", "InputStream", "fis", "=", "urlFile", ".", "openStream", "(", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "tc", ",", "\"openKeyStore: \"", "+", "(", "null", "!=", "fis", ")", ")", ";", "return", "fis", ";", "}" ]
The purpose of this method is to open the passed in file which represents the key store. @param fileName @return InputStream @throws MalformedURLException @throws IOException
[ "The", "purpose", "of", "this", "method", "is", "to", "open", "the", "passed", "in", "file", "which", "represents", "the", "key", "store", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java#L1126-L1150
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java
WSKeyStore.setCertificateEntry
public void setCertificateEntry(String alias, Certificate cert) throws KeyStoreException, KeyException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(this, tc, "setCertificateEntry", new Object[] { alias, cert }); } if (Boolean.parseBoolean(getProperty(Constants.SSLPROP_KEY_STORE_READ_ONLY))) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(this, tc, "Unable to update readonly store"); } throw new KeyStoreException("Unable to add to read-only store"); } final KeyStoreManager mgr = KeyStoreManager.getInstance(); try { KeyStore jKeyStore = getKeyStore(false, false); if (null == jKeyStore) { final String keyStoreLocation = getProperty(Constants.SSLPROP_KEY_STORE); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Cannot load the Java keystore at location \"" + keyStoreLocation + "\""); } throw new KeyStoreException("Cannot load the Java keystore at location \"" + keyStoreLocation + "\""); } // store the cert... errors are thrown if conflicts or errors occur jKeyStore.setCertificateEntry(alias, cert); try { store(); } catch (IOException e) { // Note: debug + ffdc in store() itself // on z/OS we have an issue where the certificate may be stored but the // alias // already exists in RACF so the keystore API will through an // IOException // we need to catch this condition on z/OS and if the certs is in the // keystore // prior after adding the certificate then we know the cert was actually // added and its not // a true failure. If the cert was not added then we need to rethrow the // exception. final String ksType = getProperty(Constants.SSLPROP_KEY_STORE_TYPE); if ((ksType.equals(Constants.KEYSTORE_TYPE_JCERACFKS) || ksType.equals(Constants.KEYSTORE_TYPE_JCECCARACFKS) || ksType.equals(Constants.KEYSTORE_TYPE_JCEHYBRIDRACFKS))) { KeyStore ks = getKeyStore(true, false); if (mgr.checkIfSignerAlreadyExistsInTrustStore((X509Certificate) cert, ks)) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Certificate already exists in RACF: " + e.getMessage()); } } else { throw new KeyException(e.getMessage(), e); } } else { throw new KeyException(e.getMessage(), e); } } } catch (KeyStoreException kse) { throw kse; } catch (KeyException ke) { throw ke; } catch (Exception e) { throw new KeyException(e.getMessage(), e); } // after adding the certificate, clear the keystore and SSL caches so it // reloads it. AbstractJSSEProvider.clearSSLContextCache(); mgr.clearJavaKeyStoresFromKeyStoreMap(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.exit(this, tc, "setCertificateEntry"); } }
java
public void setCertificateEntry(String alias, Certificate cert) throws KeyStoreException, KeyException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(this, tc, "setCertificateEntry", new Object[] { alias, cert }); } if (Boolean.parseBoolean(getProperty(Constants.SSLPROP_KEY_STORE_READ_ONLY))) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(this, tc, "Unable to update readonly store"); } throw new KeyStoreException("Unable to add to read-only store"); } final KeyStoreManager mgr = KeyStoreManager.getInstance(); try { KeyStore jKeyStore = getKeyStore(false, false); if (null == jKeyStore) { final String keyStoreLocation = getProperty(Constants.SSLPROP_KEY_STORE); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Cannot load the Java keystore at location \"" + keyStoreLocation + "\""); } throw new KeyStoreException("Cannot load the Java keystore at location \"" + keyStoreLocation + "\""); } // store the cert... errors are thrown if conflicts or errors occur jKeyStore.setCertificateEntry(alias, cert); try { store(); } catch (IOException e) { // Note: debug + ffdc in store() itself // on z/OS we have an issue where the certificate may be stored but the // alias // already exists in RACF so the keystore API will through an // IOException // we need to catch this condition on z/OS and if the certs is in the // keystore // prior after adding the certificate then we know the cert was actually // added and its not // a true failure. If the cert was not added then we need to rethrow the // exception. final String ksType = getProperty(Constants.SSLPROP_KEY_STORE_TYPE); if ((ksType.equals(Constants.KEYSTORE_TYPE_JCERACFKS) || ksType.equals(Constants.KEYSTORE_TYPE_JCECCARACFKS) || ksType.equals(Constants.KEYSTORE_TYPE_JCEHYBRIDRACFKS))) { KeyStore ks = getKeyStore(true, false); if (mgr.checkIfSignerAlreadyExistsInTrustStore((X509Certificate) cert, ks)) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Certificate already exists in RACF: " + e.getMessage()); } } else { throw new KeyException(e.getMessage(), e); } } else { throw new KeyException(e.getMessage(), e); } } } catch (KeyStoreException kse) { throw kse; } catch (KeyException ke) { throw ke; } catch (Exception e) { throw new KeyException(e.getMessage(), e); } // after adding the certificate, clear the keystore and SSL caches so it // reloads it. AbstractJSSEProvider.clearSSLContextCache(); mgr.clearJavaKeyStoresFromKeyStoreMap(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.exit(this, tc, "setCertificateEntry"); } }
[ "public", "void", "setCertificateEntry", "(", "String", "alias", ",", "Certificate", "cert", ")", "throws", "KeyStoreException", ",", "KeyException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "Tr", ".", "entry", "(", "this", ",", "tc", ",", "\"setCertificateEntry\"", ",", "new", "Object", "[", "]", "{", "alias", ",", "cert", "}", ")", ";", "}", "if", "(", "Boolean", ".", "parseBoolean", "(", "getProperty", "(", "Constants", ".", "SSLPROP_KEY_STORE_READ_ONLY", ")", ")", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "this", ",", "tc", ",", "\"Unable to update readonly store\"", ")", ";", "}", "throw", "new", "KeyStoreException", "(", "\"Unable to add to read-only store\"", ")", ";", "}", "final", "KeyStoreManager", "mgr", "=", "KeyStoreManager", ".", "getInstance", "(", ")", ";", "try", "{", "KeyStore", "jKeyStore", "=", "getKeyStore", "(", "false", ",", "false", ")", ";", "if", "(", "null", "==", "jKeyStore", ")", "{", "final", "String", "keyStoreLocation", "=", "getProperty", "(", "Constants", ".", "SSLPROP_KEY_STORE", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"Cannot load the Java keystore at location \\\"\"", "+", "keyStoreLocation", "+", "\"\\\"\"", ")", ";", "}", "throw", "new", "KeyStoreException", "(", "\"Cannot load the Java keystore at location \\\"\"", "+", "keyStoreLocation", "+", "\"\\\"\"", ")", ";", "}", "// store the cert... errors are thrown if conflicts or errors occur", "jKeyStore", ".", "setCertificateEntry", "(", "alias", ",", "cert", ")", ";", "try", "{", "store", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "// Note: debug + ffdc in store() itself", "// on z/OS we have an issue where the certificate may be stored but the", "// alias", "// already exists in RACF so the keystore API will through an", "// IOException", "// we need to catch this condition on z/OS and if the certs is in the", "// keystore", "// prior after adding the certificate then we know the cert was actually", "// added and its not", "// a true failure. If the cert was not added then we need to rethrow the", "// exception.", "final", "String", "ksType", "=", "getProperty", "(", "Constants", ".", "SSLPROP_KEY_STORE_TYPE", ")", ";", "if", "(", "(", "ksType", ".", "equals", "(", "Constants", ".", "KEYSTORE_TYPE_JCERACFKS", ")", "||", "ksType", ".", "equals", "(", "Constants", ".", "KEYSTORE_TYPE_JCECCARACFKS", ")", "||", "ksType", ".", "equals", "(", "Constants", ".", "KEYSTORE_TYPE_JCEHYBRIDRACFKS", ")", ")", ")", "{", "KeyStore", "ks", "=", "getKeyStore", "(", "true", ",", "false", ")", ";", "if", "(", "mgr", ".", "checkIfSignerAlreadyExistsInTrustStore", "(", "(", "X509Certificate", ")", "cert", ",", "ks", ")", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"Certificate already exists in RACF: \"", "+", "e", ".", "getMessage", "(", ")", ")", ";", "}", "}", "else", "{", "throw", "new", "KeyException", "(", "e", ".", "getMessage", "(", ")", ",", "e", ")", ";", "}", "}", "else", "{", "throw", "new", "KeyException", "(", "e", ".", "getMessage", "(", ")", ",", "e", ")", ";", "}", "}", "}", "catch", "(", "KeyStoreException", "kse", ")", "{", "throw", "kse", ";", "}", "catch", "(", "KeyException", "ke", ")", "{", "throw", "ke", ";", "}", "catch", "(", "Exception", "e", ")", "{", "throw", "new", "KeyException", "(", "e", ".", "getMessage", "(", ")", ",", "e", ")", ";", "}", "// after adding the certificate, clear the keystore and SSL caches so it", "// reloads it.", "AbstractJSSEProvider", ".", "clearSSLContextCache", "(", ")", ";", "mgr", ".", "clearJavaKeyStoresFromKeyStoreMap", "(", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "Tr", ".", "exit", "(", "this", ",", "tc", ",", "\"setCertificateEntry\"", ")", ";", "}", "}" ]
Set a new certificate into the keystore and save the updated store. @param alias @param cert @throws KeyStoreException - if the store is read only or not found @throws KeyException - if an error happens updating the store with the cert
[ "Set", "a", "new", "certificate", "into", "the", "keystore", "and", "save", "the", "updated", "store", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java#L1188-L1260
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java
WSKeyStore.getKeyPassword
private SerializableProtectedString getKeyPassword(String alias) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "getKeyPassword " + alias); SerializableProtectedString keyPass = certAliasInfo.get(alias); if (keyPass != null) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "getKeyPassword entry found."); } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "getKeyPassword -> null"); } return keyPass; }
java
private SerializableProtectedString getKeyPassword(String alias) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "getKeyPassword " + alias); SerializableProtectedString keyPass = certAliasInfo.get(alias); if (keyPass != null) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "getKeyPassword entry found."); } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(tc, "getKeyPassword -> null"); } return keyPass; }
[ "private", "SerializableProtectedString", "getKeyPassword", "(", "String", "alias", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"getKeyPassword \"", "+", "alias", ")", ";", "SerializableProtectedString", "keyPass", "=", "certAliasInfo", ".", "get", "(", "alias", ")", ";", "if", "(", "keyPass", "!=", "null", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"getKeyPassword entry found.\"", ")", ";", "}", "else", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"getKeyPassword -> null\"", ")", ";", "}", "return", "keyPass", ";", "}" ]
Query the password of a key entry in this keystore. @param alias @return
[ "Query", "the", "password", "of", "a", "key", "entry", "in", "this", "keystore", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ssl/src/com/ibm/ws/ssl/config/WSKeyStore.java#L1354-L1367
train
OpenLiberty/open-liberty
dev/com.ibm.ws.microprofile.openapi/src/com/ibm/ws/microprofile/openapi/impl/validation/ServerValidator.java
ServerValidator.validateServerVariables
private void validateServerVariables(ValidationHelper helper, Context context, Set<String> variables, Server t) { ServerVariables serverVariables = t.getVariables(); for (String variable : variables) { if (serverVariables == null || !serverVariables.containsKey(variable)) { final String message = Tr.formatMessage(tc, "serverVariableNotDefined", variable); helper.addValidationEvent(new ValidationEvent(ValidationEvent.Severity.ERROR, context.getLocation("variables"), message)); } } }
java
private void validateServerVariables(ValidationHelper helper, Context context, Set<String> variables, Server t) { ServerVariables serverVariables = t.getVariables(); for (String variable : variables) { if (serverVariables == null || !serverVariables.containsKey(variable)) { final String message = Tr.formatMessage(tc, "serverVariableNotDefined", variable); helper.addValidationEvent(new ValidationEvent(ValidationEvent.Severity.ERROR, context.getLocation("variables"), message)); } } }
[ "private", "void", "validateServerVariables", "(", "ValidationHelper", "helper", ",", "Context", "context", ",", "Set", "<", "String", ">", "variables", ",", "Server", "t", ")", "{", "ServerVariables", "serverVariables", "=", "t", ".", "getVariables", "(", ")", ";", "for", "(", "String", "variable", ":", "variables", ")", "{", "if", "(", "serverVariables", "==", "null", "||", "!", "serverVariables", ".", "containsKey", "(", "variable", ")", ")", "{", "final", "String", "message", "=", "Tr", ".", "formatMessage", "(", "tc", ",", "\"serverVariableNotDefined\"", ",", "variable", ")", ";", "helper", ".", "addValidationEvent", "(", "new", "ValidationEvent", "(", "ValidationEvent", ".", "Severity", ".", "ERROR", ",", "context", ".", "getLocation", "(", "\"variables\"", ")", ",", "message", ")", ")", ";", "}", "}", "}" ]
Ensures that all the serverVariables are defined @param helper the helper to send validation messages @param variables the set of variables to validate
[ "Ensures", "that", "all", "the", "serverVariables", "are", "defined" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.openapi/src/com/ibm/ws/microprofile/openapi/impl/validation/ServerValidator.java#L61-L70
train
OpenLiberty/open-liberty
dev/com.ibm.ws.microprofile.openapi/src/com/ibm/ws/microprofile/openapi/impl/validation/ServerValidator.java
ServerValidator.validateURL
private Set<String> validateURL(ValidationHelper helper, Context context, String url) { String pathToCheck = url; Set<String> serverVariables = new HashSet<String>(); while (pathToCheck.contains("{")) { if (!pathToCheck.contains("}")) { final String message = Tr.formatMessage(tc, "serverInvalidURL", pathToCheck); helper.addValidationEvent(new ValidationEvent(ValidationEvent.Severity.ERROR, context.getLocation("url"), message)); return serverVariables; } int firstIndex = pathToCheck.indexOf("{"); int lastIndex = pathToCheck.indexOf("}"); if (firstIndex > lastIndex) { final String message = Tr.formatMessage(tc, "serverInvalidURL", pathToCheck); helper.addValidationEvent(new ValidationEvent(ValidationEvent.Severity.ERROR, context.getLocation("url"), message)); return serverVariables; } String variable = pathToCheck.substring(firstIndex + 1, lastIndex); if (variable.isEmpty() || variable.contains("{") || variable.contains("/")) { final String message = Tr.formatMessage(tc, "serverInvalidURL", pathToCheck); helper.addValidationEvent(new ValidationEvent(ValidationEvent.Severity.ERROR, context.getLocation("url"), message)); return serverVariables; } serverVariables.add(variable); pathToCheck = pathToCheck.substring(lastIndex + 1); } if (pathToCheck.contains("}")) { final String message = Tr.formatMessage(tc, "serverInvalidURL", pathToCheck); helper.addValidationEvent(new ValidationEvent(ValidationEvent.Severity.ERROR, context.getLocation("url"), message)); return serverVariables; } return serverVariables; }
java
private Set<String> validateURL(ValidationHelper helper, Context context, String url) { String pathToCheck = url; Set<String> serverVariables = new HashSet<String>(); while (pathToCheck.contains("{")) { if (!pathToCheck.contains("}")) { final String message = Tr.formatMessage(tc, "serverInvalidURL", pathToCheck); helper.addValidationEvent(new ValidationEvent(ValidationEvent.Severity.ERROR, context.getLocation("url"), message)); return serverVariables; } int firstIndex = pathToCheck.indexOf("{"); int lastIndex = pathToCheck.indexOf("}"); if (firstIndex > lastIndex) { final String message = Tr.formatMessage(tc, "serverInvalidURL", pathToCheck); helper.addValidationEvent(new ValidationEvent(ValidationEvent.Severity.ERROR, context.getLocation("url"), message)); return serverVariables; } String variable = pathToCheck.substring(firstIndex + 1, lastIndex); if (variable.isEmpty() || variable.contains("{") || variable.contains("/")) { final String message = Tr.formatMessage(tc, "serverInvalidURL", pathToCheck); helper.addValidationEvent(new ValidationEvent(ValidationEvent.Severity.ERROR, context.getLocation("url"), message)); return serverVariables; } serverVariables.add(variable); pathToCheck = pathToCheck.substring(lastIndex + 1); } if (pathToCheck.contains("}")) { final String message = Tr.formatMessage(tc, "serverInvalidURL", pathToCheck); helper.addValidationEvent(new ValidationEvent(ValidationEvent.Severity.ERROR, context.getLocation("url"), message)); return serverVariables; } return serverVariables; }
[ "private", "Set", "<", "String", ">", "validateURL", "(", "ValidationHelper", "helper", ",", "Context", "context", ",", "String", "url", ")", "{", "String", "pathToCheck", "=", "url", ";", "Set", "<", "String", ">", "serverVariables", "=", "new", "HashSet", "<", "String", ">", "(", ")", ";", "while", "(", "pathToCheck", ".", "contains", "(", "\"{\"", ")", ")", "{", "if", "(", "!", "pathToCheck", ".", "contains", "(", "\"}\"", ")", ")", "{", "final", "String", "message", "=", "Tr", ".", "formatMessage", "(", "tc", ",", "\"serverInvalidURL\"", ",", "pathToCheck", ")", ";", "helper", ".", "addValidationEvent", "(", "new", "ValidationEvent", "(", "ValidationEvent", ".", "Severity", ".", "ERROR", ",", "context", ".", "getLocation", "(", "\"url\"", ")", ",", "message", ")", ")", ";", "return", "serverVariables", ";", "}", "int", "firstIndex", "=", "pathToCheck", ".", "indexOf", "(", "\"{\"", ")", ";", "int", "lastIndex", "=", "pathToCheck", ".", "indexOf", "(", "\"}\"", ")", ";", "if", "(", "firstIndex", ">", "lastIndex", ")", "{", "final", "String", "message", "=", "Tr", ".", "formatMessage", "(", "tc", ",", "\"serverInvalidURL\"", ",", "pathToCheck", ")", ";", "helper", ".", "addValidationEvent", "(", "new", "ValidationEvent", "(", "ValidationEvent", ".", "Severity", ".", "ERROR", ",", "context", ".", "getLocation", "(", "\"url\"", ")", ",", "message", ")", ")", ";", "return", "serverVariables", ";", "}", "String", "variable", "=", "pathToCheck", ".", "substring", "(", "firstIndex", "+", "1", ",", "lastIndex", ")", ";", "if", "(", "variable", ".", "isEmpty", "(", ")", "||", "variable", ".", "contains", "(", "\"{\"", ")", "||", "variable", ".", "contains", "(", "\"/\"", ")", ")", "{", "final", "String", "message", "=", "Tr", ".", "formatMessage", "(", "tc", ",", "\"serverInvalidURL\"", ",", "pathToCheck", ")", ";", "helper", ".", "addValidationEvent", "(", "new", "ValidationEvent", "(", "ValidationEvent", ".", "Severity", ".", "ERROR", ",", "context", ".", "getLocation", "(", "\"url\"", ")", ",", "message", ")", ")", ";", "return", "serverVariables", ";", "}", "serverVariables", ".", "add", "(", "variable", ")", ";", "pathToCheck", "=", "pathToCheck", ".", "substring", "(", "lastIndex", "+", "1", ")", ";", "}", "if", "(", "pathToCheck", ".", "contains", "(", "\"}\"", ")", ")", "{", "final", "String", "message", "=", "Tr", ".", "formatMessage", "(", "tc", ",", "\"serverInvalidURL\"", ",", "pathToCheck", ")", ";", "helper", ".", "addValidationEvent", "(", "new", "ValidationEvent", "(", "ValidationEvent", ".", "Severity", ".", "ERROR", ",", "context", ".", "getLocation", "(", "\"url\"", ")", ",", "message", ")", ")", ";", "return", "serverVariables", ";", "}", "return", "serverVariables", ";", "}" ]
Validate the url and extract server variables parameters
[ "Validate", "the", "url", "and", "extract", "server", "variables", "parameters" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.openapi/src/com/ibm/ws/microprofile/openapi/impl/validation/ServerValidator.java#L75-L113
train
OpenLiberty/open-liberty
dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/BinaryLogRecordSerializerVersion2Impl.java
BinaryLogRecordSerializerVersion2Impl.findFirstEyeCatcher
public int findFirstEyeCatcher(byte[] buffer, int off, int len) { if (off < 0 || off >= buffer.length) { throw new IllegalArgumentException("Offset should be in the buffer boundaries"); } if (off + len > buffer.length) { len = buffer.length - off; } // i - pointer in eyeCatcher, p - in the buffer. int p = off + EYE_CATCHER.length - 1; for (int i=EYE_CATCHER.length-1; i>=0; i--, p--) { if (p >= off + len) { return -1; } byte b = buffer[p]; if (b != EYE_CATCHER[i]) { if (i == EYE_CATCHER.length-1) { // Check if the byte is from the middle of the EYE_CATCHER for (i--; i>=0; i--) { if (b == EYE_CATCHER[i]) { break; } } // shift buffer to have the byte in i-th position p += EYE_CATCHER.length - i; } else { // the whole buffer should be shifted due to the assumption. p += EYE_CATCHER.length * 2 - i; } i = EYE_CATCHER.length; } } return p+1; }
java
public int findFirstEyeCatcher(byte[] buffer, int off, int len) { if (off < 0 || off >= buffer.length) { throw new IllegalArgumentException("Offset should be in the buffer boundaries"); } if (off + len > buffer.length) { len = buffer.length - off; } // i - pointer in eyeCatcher, p - in the buffer. int p = off + EYE_CATCHER.length - 1; for (int i=EYE_CATCHER.length-1; i>=0; i--, p--) { if (p >= off + len) { return -1; } byte b = buffer[p]; if (b != EYE_CATCHER[i]) { if (i == EYE_CATCHER.length-1) { // Check if the byte is from the middle of the EYE_CATCHER for (i--; i>=0; i--) { if (b == EYE_CATCHER[i]) { break; } } // shift buffer to have the byte in i-th position p += EYE_CATCHER.length - i; } else { // the whole buffer should be shifted due to the assumption. p += EYE_CATCHER.length * 2 - i; } i = EYE_CATCHER.length; } } return p+1; }
[ "public", "int", "findFirstEyeCatcher", "(", "byte", "[", "]", "buffer", ",", "int", "off", ",", "int", "len", ")", "{", "if", "(", "off", "<", "0", "||", "off", ">=", "buffer", ".", "length", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Offset should be in the buffer boundaries\"", ")", ";", "}", "if", "(", "off", "+", "len", ">", "buffer", ".", "length", ")", "{", "len", "=", "buffer", ".", "length", "-", "off", ";", "}", "// i - pointer in eyeCatcher, p - in the buffer.", "int", "p", "=", "off", "+", "EYE_CATCHER", ".", "length", "-", "1", ";", "for", "(", "int", "i", "=", "EYE_CATCHER", ".", "length", "-", "1", ";", "i", ">=", "0", ";", "i", "--", ",", "p", "--", ")", "{", "if", "(", "p", ">=", "off", "+", "len", ")", "{", "return", "-", "1", ";", "}", "byte", "b", "=", "buffer", "[", "p", "]", ";", "if", "(", "b", "!=", "EYE_CATCHER", "[", "i", "]", ")", "{", "if", "(", "i", "==", "EYE_CATCHER", ".", "length", "-", "1", ")", "{", "// Check if the byte is from the middle of the EYE_CATCHER", "for", "(", "i", "--", ";", "i", ">=", "0", ";", "i", "--", ")", "{", "if", "(", "b", "==", "EYE_CATCHER", "[", "i", "]", ")", "{", "break", ";", "}", "}", "// shift buffer to have the byte in i-th position", "p", "+=", "EYE_CATCHER", ".", "length", "-", "i", ";", "}", "else", "{", "// the whole buffer should be shifted due to the assumption.", "p", "+=", "EYE_CATCHER", ".", "length", "*", "2", "-", "i", ";", "}", "i", "=", "EYE_CATCHER", ".", "length", ";", "}", "}", "return", "p", "+", "1", ";", "}" ]
assumption that the EYE_CATCHER does not have repeatable bytes.
[ "assumption", "that", "the", "EYE_CATCHER", "does", "not", "have", "repeatable", "bytes", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ws/logging/hpel/impl/BinaryLogRecordSerializerVersion2Impl.java#L598-L630
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java
StreamSet.initialize
private void initialize() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "initialize"); subsets = new ReliabilitySubset[maxReliabilityIndex + 1]; subsetIDs = new long[maxReliabilityIndex + 1]; for(int i=0;i<subsetIDs.length;i++) { subsetIDs[i] = NO_ID; } createControlAdapter(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "initialize"); }
java
private void initialize() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "initialize"); subsets = new ReliabilitySubset[maxReliabilityIndex + 1]; subsetIDs = new long[maxReliabilityIndex + 1]; for(int i=0;i<subsetIDs.length;i++) { subsetIDs[i] = NO_ID; } createControlAdapter(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "initialize"); }
[ "private", "void", "initialize", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"initialize\"", ")", ";", "subsets", "=", "new", "ReliabilitySubset", "[", "maxReliabilityIndex", "+", "1", "]", ";", "subsetIDs", "=", "new", "long", "[", "maxReliabilityIndex", "+", "1", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "subsetIDs", ".", "length", ";", "i", "++", ")", "{", "subsetIDs", "[", "i", "]", "=", "NO_ID", ";", "}", "createControlAdapter", "(", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"initialize\"", ")", ";", "}" ]
Initialize some arrays
[ "Initialize", "some", "arrays" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java#L252-L268
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java
StreamSet.setStream
protected void setStream( int priority, Reliability reliability, Stream stream) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry( tc, "setStream", new Object[] { new Integer(priority), reliability, stream }); ReliabilitySubset subset = getSubset(reliability); subset.setStream(priority, stream); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "setStream"); }
java
protected void setStream( int priority, Reliability reliability, Stream stream) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry( tc, "setStream", new Object[] { new Integer(priority), reliability, stream }); ReliabilitySubset subset = getSubset(reliability); subset.setStream(priority, stream); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "setStream"); }
[ "protected", "void", "setStream", "(", "int", "priority", ",", "Reliability", "reliability", ",", "Stream", "stream", ")", "throws", "SIResourceException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"setStream\"", ",", "new", "Object", "[", "]", "{", "new", "Integer", "(", "priority", ")", ",", "reliability", ",", "stream", "}", ")", ";", "ReliabilitySubset", "subset", "=", "getSubset", "(", "reliability", ")", ";", "subset", ".", "setStream", "(", "priority", ",", "stream", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"setStream\"", ")", ";", "}" ]
Set an element in the stream array @param priority @param reliability @param stream @throws SIResourceException
[ "Set", "an", "element", "in", "the", "stream", "array" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java#L290-L306
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java
StreamSet.updateCellule
public void updateCellule( SIBUuid8 newRemoteMEUuid) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "updateCellule", newRemoteMEUuid); this.remoteMEUuid = newRemoteMEUuid; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "updateCellule"); }
java
public void updateCellule( SIBUuid8 newRemoteMEUuid) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "updateCellule", newRemoteMEUuid); this.remoteMEUuid = newRemoteMEUuid; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "updateCellule"); }
[ "public", "void", "updateCellule", "(", "SIBUuid8", "newRemoteMEUuid", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"updateCellule\"", ",", "newRemoteMEUuid", ")", ";", "this", ".", "remoteMEUuid", "=", "newRemoteMEUuid", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"updateCellule\"", ")", ";", "}" ]
This method should only be called when the streamSet was created with an unknown targetCellule and WLM has now told us correct targetCellule. This can only happen when the SourceStreamManager is owned by a PtoPOuptuHandler within a LinkHandler
[ "This", "method", "should", "only", "be", "called", "when", "the", "streamSet", "was", "created", "with", "an", "unknown", "targetCellule", "and", "WLM", "has", "now", "told", "us", "correct", "targetCellule", ".", "This", "can", "only", "happen", "when", "the", "SourceStreamManager", "is", "owned", "by", "a", "PtoPOuptuHandler", "within", "a", "LinkHandler" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java#L314-L323
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java
StreamSet.createPersistentSubset
private ReliabilitySubset createPersistentSubset(Reliability reliability, TransactionCommon tran) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "createPersistentSubset", new Object[] { reliability }); ReliabilitySubset subset = new ReliabilitySubset(reliability, initialData); subsets[getIndex(reliability)] = subset; if(reliability.compareTo(Reliability.BEST_EFFORT_NONPERSISTENT) > 0) { try { Transaction msTran = txManager.resolveAndEnlistMsgStoreTransaction(tran); itemStream.addItem(subset, msTran); subsetIDs[getIndex(reliability)] = subset.getID(); } catch (MessageStoreException e) { // FFDC FFDCFilter.processException( e, "com.ibm.ws.sib.processor.gd.StreamSet.createPersistentSubset", "1:398:1.67", this); //not sure if this default is needed but better safe than sorry subsetIDs[getIndex(reliability)] = NO_ID; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.exception(tc, e); SibTr.exit(tc, "createPersistentSubset", e); } } } else { subsetIDs[getIndex(reliability)] = NO_ID; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createPersistentSubset", subset); return subset; }
java
private ReliabilitySubset createPersistentSubset(Reliability reliability, TransactionCommon tran) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "createPersistentSubset", new Object[] { reliability }); ReliabilitySubset subset = new ReliabilitySubset(reliability, initialData); subsets[getIndex(reliability)] = subset; if(reliability.compareTo(Reliability.BEST_EFFORT_NONPERSISTENT) > 0) { try { Transaction msTran = txManager.resolveAndEnlistMsgStoreTransaction(tran); itemStream.addItem(subset, msTran); subsetIDs[getIndex(reliability)] = subset.getID(); } catch (MessageStoreException e) { // FFDC FFDCFilter.processException( e, "com.ibm.ws.sib.processor.gd.StreamSet.createPersistentSubset", "1:398:1.67", this); //not sure if this default is needed but better safe than sorry subsetIDs[getIndex(reliability)] = NO_ID; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.exception(tc, e); SibTr.exit(tc, "createPersistentSubset", e); } } } else { subsetIDs[getIndex(reliability)] = NO_ID; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createPersistentSubset", subset); return subset; }
[ "private", "ReliabilitySubset", "createPersistentSubset", "(", "Reliability", "reliability", ",", "TransactionCommon", "tran", ")", "throws", "SIResourceException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"createPersistentSubset\"", ",", "new", "Object", "[", "]", "{", "reliability", "}", ")", ";", "ReliabilitySubset", "subset", "=", "new", "ReliabilitySubset", "(", "reliability", ",", "initialData", ")", ";", "subsets", "[", "getIndex", "(", "reliability", ")", "]", "=", "subset", ";", "if", "(", "reliability", ".", "compareTo", "(", "Reliability", ".", "BEST_EFFORT_NONPERSISTENT", ")", ">", "0", ")", "{", "try", "{", "Transaction", "msTran", "=", "txManager", ".", "resolveAndEnlistMsgStoreTransaction", "(", "tran", ")", ";", "itemStream", ".", "addItem", "(", "subset", ",", "msTran", ")", ";", "subsetIDs", "[", "getIndex", "(", "reliability", ")", "]", "=", "subset", ".", "getID", "(", ")", ";", "}", "catch", "(", "MessageStoreException", "e", ")", "{", "// FFDC", "FFDCFilter", ".", "processException", "(", "e", ",", "\"com.ibm.ws.sib.processor.gd.StreamSet.createPersistentSubset\"", ",", "\"1:398:1.67\"", ",", "this", ")", ";", "//not sure if this default is needed but better safe than sorry", "subsetIDs", "[", "getIndex", "(", "reliability", ")", "]", "=", "NO_ID", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "exception", "(", "tc", ",", "e", ")", ";", "SibTr", ".", "exit", "(", "tc", ",", "\"createPersistentSubset\"", ",", "e", ")", ";", "}", "}", "}", "else", "{", "subsetIDs", "[", "getIndex", "(", "reliability", ")", "]", "=", "NO_ID", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"createPersistentSubset\"", ",", "subset", ")", ";", "return", "subset", ";", "}" ]
Create a new ReliabilitySubset for the given reliability. If it is not express, store it in the message store and record the message store ID. @param reliability @throws SIResourceException @throws SIStoreException
[ "Create", "a", "new", "ReliabilitySubset", "for", "the", "given", "reliability", ".", "If", "it", "is", "not", "express", "store", "it", "in", "the", "message", "store", "and", "record", "the", "message", "store", "ID", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java#L373-L415
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java
StreamSet.createNonPersistentSubsets
private void createNonPersistentSubsets() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "createNonPersistentSubsets"); for(int i=0; i<subsets.length; i++) { createNonPersistentSubset(getReliability(i)); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNonPersistentSubsets"); }
java
private void createNonPersistentSubsets() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "createNonPersistentSubsets"); for(int i=0; i<subsets.length; i++) { createNonPersistentSubset(getReliability(i)); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNonPersistentSubsets"); }
[ "private", "void", "createNonPersistentSubsets", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"createNonPersistentSubsets\"", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "subsets", ".", "length", ";", "i", "++", ")", "{", "createNonPersistentSubset", "(", "getReliability", "(", "i", ")", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"createNonPersistentSubsets\"", ")", ";", "}" ]
Create all the ReliabilitySubsets non persistently.
[ "Create", "all", "the", "ReliabilitySubsets", "non", "persistently", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java#L420-L432
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java
StreamSet.createNonPersistentSubset
private ReliabilitySubset createNonPersistentSubset(Reliability reliability) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry( tc, "createNonPersistentSubset", new Object[] { reliability }); ReliabilitySubset subset = new ReliabilitySubset(reliability, initialData); subsets[getIndex(reliability)] = subset; subsetIDs[getIndex(reliability)] = NO_ID; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNonPersistentSubset", subset); return subset; }
java
private ReliabilitySubset createNonPersistentSubset(Reliability reliability) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry( tc, "createNonPersistentSubset", new Object[] { reliability }); ReliabilitySubset subset = new ReliabilitySubset(reliability, initialData); subsets[getIndex(reliability)] = subset; subsetIDs[getIndex(reliability)] = NO_ID; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createNonPersistentSubset", subset); return subset; }
[ "private", "ReliabilitySubset", "createNonPersistentSubset", "(", "Reliability", "reliability", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"createNonPersistentSubset\"", ",", "new", "Object", "[", "]", "{", "reliability", "}", ")", ";", "ReliabilitySubset", "subset", "=", "new", "ReliabilitySubset", "(", "reliability", ",", "initialData", ")", ";", "subsets", "[", "getIndex", "(", "reliability", ")", "]", "=", "subset", ";", "subsetIDs", "[", "getIndex", "(", "reliability", ")", "]", "=", "NO_ID", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"createNonPersistentSubset\"", ",", "subset", ")", ";", "return", "subset", ";", "}" ]
Create a new ReliabilitySubset for the given Reliability but do not persist it. @param reliability
[ "Create", "a", "new", "ReliabilitySubset", "for", "the", "given", "Reliability", "but", "do", "not", "persist", "it", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java#L440-L456
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java
StreamSet.getStream
public Stream getStream(int priority, Reliability reliability) throws SIResourceException { return getSubset(reliability).getStream(priority); }
java
public Stream getStream(int priority, Reliability reliability) throws SIResourceException { return getSubset(reliability).getStream(priority); }
[ "public", "Stream", "getStream", "(", "int", "priority", ",", "Reliability", "reliability", ")", "throws", "SIResourceException", "{", "return", "getSubset", "(", "reliability", ")", ".", "getStream", "(", "priority", ")", ";", "}" ]
Get a specific stream based on priority and reliability @param priority @param reliability @throws SIResourceException
[ "Get", "a", "specific", "stream", "based", "on", "priority", "and", "reliability" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java#L465-L468
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java
StreamSet.getDestUuid
public SIBUuid12 getDestUuid() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(this, tc, "getDestUuid"); SibTr.exit(tc, "getDestUuid", destID); } return destID; }
java
public SIBUuid12 getDestUuid() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(this, tc, "getDestUuid"); SibTr.exit(tc, "getDestUuid", destID); } return destID; }
[ "public", "SIBUuid12", "getDestUuid", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"getDestUuid\"", ")", ";", "SibTr", ".", "exit", "(", "tc", ",", "\"getDestUuid\"", ",", "destID", ")", ";", "}", "return", "destID", ";", "}" ]
Get the destination Uuid @return The destination Uuid
[ "Get", "the", "destination", "Uuid" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java#L751-L760
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java
StreamSet.setDestUuid
protected void setDestUuid(SIBUuid12 destID) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "setDestUuid", destID); this.destID = destID; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "setDestUuid"); }
java
protected void setDestUuid(SIBUuid12 destID) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "setDestUuid", destID); this.destID = destID; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "setDestUuid"); }
[ "protected", "void", "setDestUuid", "(", "SIBUuid12", "destID", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"setDestUuid\"", ",", "destID", ")", ";", "this", ".", "destID", "=", "destID", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"setDestUuid\"", ")", ";", "}" ]
Set the destination Uuid @return The destination Uuid
[ "Set", "the", "destination", "Uuid" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java#L767-L776
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java
StreamSet.getBusUuid
public SIBUuid8 getBusUuid() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(this, tc, "getBusUuid"); SibTr.exit(tc, "getBusUuid", busID); } return busID; }
java
public SIBUuid8 getBusUuid() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(this, tc, "getBusUuid"); SibTr.exit(tc, "getBusUuid", busID); } return busID; }
[ "public", "SIBUuid8", "getBusUuid", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"getBusUuid\"", ")", ";", "SibTr", ".", "exit", "(", "tc", ",", "\"getBusUuid\"", ",", "busID", ")", ";", "}", "return", "busID", ";", "}" ]
Get the bus Uuid @return The bus Uuid
[ "Get", "the", "bus", "Uuid" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java#L783-L792
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java
StreamSet.isPersistent
public boolean isPersistent() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(this, tc, "isPersistent"); SibTr.exit(tc, "isPersistent", Boolean.valueOf(persistent)); } return persistent; }
java
public boolean isPersistent() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(this, tc, "isPersistent"); SibTr.exit(tc, "isPersistent", Boolean.valueOf(persistent)); } return persistent; }
[ "public", "boolean", "isPersistent", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"isPersistent\"", ")", ";", "SibTr", ".", "exit", "(", "tc", ",", "\"isPersistent\"", ",", "Boolean", ".", "valueOf", "(", "persistent", ")", ")", ";", "}", "return", "persistent", ";", "}" ]
Get the persistence of this StreamSet @return true if this StreamSet is persistent
[ "Get", "the", "persistence", "of", "this", "StreamSet" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java#L817-L825
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java
StreamSet.getStreamID
public SIBUuid12 getStreamID() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(this, tc, "getStreamID"); SibTr.exit(tc, "getStreamID", streamID); } return streamID; }
java
public SIBUuid12 getStreamID() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(this, tc, "getStreamID"); SibTr.exit(tc, "getStreamID", streamID); } return streamID; }
[ "public", "SIBUuid12", "getStreamID", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"getStreamID\"", ")", ";", "SibTr", ".", "exit", "(", "tc", ",", "\"getStreamID\"", ",", "streamID", ")", ";", "}", "return", "streamID", ";", "}" ]
Get the stream ID for this protocol item. @return An instance of SIBUuid12.
[ "Get", "the", "stream", "ID", "for", "this", "protocol", "item", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java#L832-L841
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java
StreamSet.setPersistentData
protected void setPersistentData(int priority, Reliability reliability, long completedPrefix) throws SIResourceException { getSubset(reliability).setPersistentData(priority, completedPrefix); }
java
protected void setPersistentData(int priority, Reliability reliability, long completedPrefix) throws SIResourceException { getSubset(reliability).setPersistentData(priority, completedPrefix); }
[ "protected", "void", "setPersistentData", "(", "int", "priority", ",", "Reliability", "reliability", ",", "long", "completedPrefix", ")", "throws", "SIResourceException", "{", "getSubset", "(", "reliability", ")", ".", "setPersistentData", "(", "priority", ",", "completedPrefix", ")", ";", "}" ]
Set the persistent data for a specific stream @param priority @param reliability @param completedPrefix @throws SIResourceException
[ "Set", "the", "persistent", "data", "for", "a", "specific", "stream" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java#L868-L873
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java
StreamSet.getPersistentData
protected long getPersistentData(int priority, Reliability reliability) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry( tc, "getPersistentData", new Object[] { new Integer(priority), reliability }); long prefix = getSubset(reliability).getPersistentData(priority); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getPersistentData", new Long(prefix)); return prefix; }
java
protected long getPersistentData(int priority, Reliability reliability) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry( tc, "getPersistentData", new Object[] { new Integer(priority), reliability }); long prefix = getSubset(reliability).getPersistentData(priority); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getPersistentData", new Long(prefix)); return prefix; }
[ "protected", "long", "getPersistentData", "(", "int", "priority", ",", "Reliability", "reliability", ")", "throws", "SIResourceException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"getPersistentData\"", ",", "new", "Object", "[", "]", "{", "new", "Integer", "(", "priority", ")", ",", "reliability", "}", ")", ";", "long", "prefix", "=", "getSubset", "(", "reliability", ")", ".", "getPersistentData", "(", "priority", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"getPersistentData\"", ",", "new", "Long", "(", "prefix", ")", ")", ";", "return", "prefix", ";", "}" ]
Get the persistent data for a specific stream @param priority @param reliability @throws SIResourceException
[ "Get", "the", "persistent", "data", "for", "a", "specific", "stream" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/StreamSet.java#L882-L896
train
OpenLiberty/open-liberty
dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/logging/internal/LoggerOnThread.java
LoggerOnThread.isOverFileLimit
private boolean isOverFileLimit(int addition) { if (LogFile.UNLIMITED == getMaximumSize()) { return false; } // Note: to do this properly, we need to know if the admin updates the // file externally, i.e. 'cat /dev/null > file' to clear it out. Windows // JDK filechannel.size() was a buffered value (AIX was not), but the // file.length() call on each checked the real value each time. This is // a slight performance hit but it's the only 100% guarentee of being // accurate. long newlen = this.myFile.length() + addition; return (newlen > getMaximumSize() || 0 > newlen); }
java
private boolean isOverFileLimit(int addition) { if (LogFile.UNLIMITED == getMaximumSize()) { return false; } // Note: to do this properly, we need to know if the admin updates the // file externally, i.e. 'cat /dev/null > file' to clear it out. Windows // JDK filechannel.size() was a buffered value (AIX was not), but the // file.length() call on each checked the real value each time. This is // a slight performance hit but it's the only 100% guarentee of being // accurate. long newlen = this.myFile.length() + addition; return (newlen > getMaximumSize() || 0 > newlen); }
[ "private", "boolean", "isOverFileLimit", "(", "int", "addition", ")", "{", "if", "(", "LogFile", ".", "UNLIMITED", "==", "getMaximumSize", "(", ")", ")", "{", "return", "false", ";", "}", "// Note: to do this properly, we need to know if the admin updates the", "// file externally, i.e. 'cat /dev/null > file' to clear it out. Windows", "// JDK filechannel.size() was a buffered value (AIX was not), but the", "// file.length() call on each checked the real value each time. This is", "// a slight performance hit but it's the only 100% guarentee of being", "// accurate.", "long", "newlen", "=", "this", ".", "myFile", ".", "length", "(", ")", "+", "addition", ";", "return", "(", "newlen", ">", "getMaximumSize", "(", ")", "||", "0", ">", "newlen", ")", ";", "}" ]
Query whether the input amount will push the log file over the maximum allowed size. @param addition @return boolean
[ "Query", "whether", "the", "input", "amount", "will", "push", "the", "log", "file", "over", "the", "maximum", "allowed", "size", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/logging/internal/LoggerOnThread.java#L300-L312
train
OpenLiberty/open-liberty
dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/logging/internal/LoggerOnThread.java
LoggerOnThread.renameFile
private void renameFile(File source, File target) { if (!source.exists()) { // don't do anything if the source file doesn't exist return; } if (target.exists()) { target.delete(); } boolean rc = source.renameTo(target); if (!rc) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, getFileName() + ": Unable to rename " + source + " to " + target); } } }
java
private void renameFile(File source, File target) { if (!source.exists()) { // don't do anything if the source file doesn't exist return; } if (target.exists()) { target.delete(); } boolean rc = source.renameTo(target); if (!rc) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, getFileName() + ": Unable to rename " + source + " to " + target); } } }
[ "private", "void", "renameFile", "(", "File", "source", ",", "File", "target", ")", "{", "if", "(", "!", "source", ".", "exists", "(", ")", ")", "{", "// don't do anything if the source file doesn't exist", "return", ";", "}", "if", "(", "target", ".", "exists", "(", ")", ")", "{", "target", ".", "delete", "(", ")", ";", "}", "boolean", "rc", "=", "source", ".", "renameTo", "(", "target", ")", ";", "if", "(", "!", "rc", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "getFileName", "(", ")", "+", "\": Unable to rename \"", "+", "source", "+", "\" to \"", "+", "target", ")", ";", "}", "}", "}" ]
Rename the source file into the target file, deleting the target if necessary. @param source @param target
[ "Rename", "the", "source", "file", "into", "the", "target", "file", "deleting", "the", "target", "if", "necessary", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/logging/internal/LoggerOnThread.java#L347-L361
train
OpenLiberty/open-liberty
dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/logging/internal/LoggerOnThread.java
LoggerOnThread.addBackup
private void addBackup() { // move the current log file to the newly formatted backup name String newname = this.fileinfo + this.myFormat.format(new Date(HttpDispatcher.getApproxTime())) + this.extensioninfo; File newFile = new File(newname); renameFile(this.myFile, newFile); // now see if we need to delete an existing backup to make room if (this.backups.size() == getMaximumBackupFiles()) { File oldest = this.backups.removeLast(); if (null != oldest && oldest.exists()) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, getFileName() + ": Purging oldest backup-> " + oldest.getName()); } oldest.delete(); } } this.backups.addFirst(newFile); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, getFileName() + ": number of backup files-> " + this.backups.size()); } }
java
private void addBackup() { // move the current log file to the newly formatted backup name String newname = this.fileinfo + this.myFormat.format(new Date(HttpDispatcher.getApproxTime())) + this.extensioninfo; File newFile = new File(newname); renameFile(this.myFile, newFile); // now see if we need to delete an existing backup to make room if (this.backups.size() == getMaximumBackupFiles()) { File oldest = this.backups.removeLast(); if (null != oldest && oldest.exists()) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, getFileName() + ": Purging oldest backup-> " + oldest.getName()); } oldest.delete(); } } this.backups.addFirst(newFile); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, getFileName() + ": number of backup files-> " + this.backups.size()); } }
[ "private", "void", "addBackup", "(", ")", "{", "// move the current log file to the newly formatted backup name", "String", "newname", "=", "this", ".", "fileinfo", "+", "this", ".", "myFormat", ".", "format", "(", "new", "Date", "(", "HttpDispatcher", ".", "getApproxTime", "(", ")", ")", ")", "+", "this", ".", "extensioninfo", ";", "File", "newFile", "=", "new", "File", "(", "newname", ")", ";", "renameFile", "(", "this", ".", "myFile", ",", "newFile", ")", ";", "// now see if we need to delete an existing backup to make room", "if", "(", "this", ".", "backups", ".", "size", "(", ")", "==", "getMaximumBackupFiles", "(", ")", ")", "{", "File", "oldest", "=", "this", ".", "backups", ".", "removeLast", "(", ")", ";", "if", "(", "null", "!=", "oldest", "&&", "oldest", ".", "exists", "(", ")", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "getFileName", "(", ")", "+", "\": Purging oldest backup-> \"", "+", "oldest", ".", "getName", "(", ")", ")", ";", "}", "oldest", ".", "delete", "(", ")", ";", "}", "}", "this", ".", "backups", ".", "addFirst", "(", "newFile", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "getFileName", "(", ")", "+", "\": number of backup files-> \"", "+", "this", ".", "backups", ".", "size", "(", ")", ")", ";", "}", "}" ]
Move the current logfile to a backup name, taking care of any existing backup files according to the configured limit.
[ "Move", "the", "current", "logfile", "to", "a", "backup", "name", "taking", "care", "of", "any", "existing", "backup", "files", "according", "to", "the", "configured", "limit", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/logging/internal/LoggerOnThread.java#L367-L386
train
OpenLiberty/open-liberty
dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/logging/internal/LoggerOnThread.java
LoggerOnThread.rotate
private void rotate() { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, getFileName() + ": Rotating output log"); } try { this.myChannel.close(); } catch (IOException ioe) { FFDCFilter.processException(ioe, getClass().getName() + ".rotate", "424", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, getFileName() + ": Failed to close the output file; " + ioe); } } try { if (0 < getMaximumBackupFiles()) { // add the new backup file to the stored list addBackup(); } this.myChannel = new FileOutputStream(this.myFile, true).getChannel(); } catch (SecurityException se) { FFDCFilter.processException(se, getClass().getName() + ".rotate", "436", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, getFileName() + ": security error in rotate; " + se); } } catch (Throwable t) { FFDCFilter.processException(t, getClass().getName() + ".rotate", "441", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, getFileName() + ": error in rotate; " + t); } } }
java
private void rotate() { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, getFileName() + ": Rotating output log"); } try { this.myChannel.close(); } catch (IOException ioe) { FFDCFilter.processException(ioe, getClass().getName() + ".rotate", "424", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, getFileName() + ": Failed to close the output file; " + ioe); } } try { if (0 < getMaximumBackupFiles()) { // add the new backup file to the stored list addBackup(); } this.myChannel = new FileOutputStream(this.myFile, true).getChannel(); } catch (SecurityException se) { FFDCFilter.processException(se, getClass().getName() + ".rotate", "436", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, getFileName() + ": security error in rotate; " + se); } } catch (Throwable t) { FFDCFilter.processException(t, getClass().getName() + ".rotate", "441", this); if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, getFileName() + ": error in rotate; " + t); } } }
[ "private", "void", "rotate", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "getFileName", "(", ")", "+", "\": Rotating output log\"", ")", ";", "}", "try", "{", "this", ".", "myChannel", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "ioe", ")", "{", "FFDCFilter", ".", "processException", "(", "ioe", ",", "getClass", "(", ")", ".", "getName", "(", ")", "+", "\".rotate\"", ",", "\"424\"", ",", "this", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEventEnabled", "(", ")", ")", "{", "Tr", ".", "event", "(", "tc", ",", "getFileName", "(", ")", "+", "\": Failed to close the output file; \"", "+", "ioe", ")", ";", "}", "}", "try", "{", "if", "(", "0", "<", "getMaximumBackupFiles", "(", ")", ")", "{", "// add the new backup file to the stored list", "addBackup", "(", ")", ";", "}", "this", ".", "myChannel", "=", "new", "FileOutputStream", "(", "this", ".", "myFile", ",", "true", ")", ".", "getChannel", "(", ")", ";", "}", "catch", "(", "SecurityException", "se", ")", "{", "FFDCFilter", ".", "processException", "(", "se", ",", "getClass", "(", ")", ".", "getName", "(", ")", "+", "\".rotate\"", ",", "\"436\"", ",", "this", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEventEnabled", "(", ")", ")", "{", "Tr", ".", "event", "(", "tc", ",", "getFileName", "(", ")", "+", "\": security error in rotate; \"", "+", "se", ")", ";", "}", "}", "catch", "(", "Throwable", "t", ")", "{", "FFDCFilter", ".", "processException", "(", "t", ",", "getClass", "(", ")", ".", "getName", "(", ")", "+", "\".rotate\"", ",", "\"441\"", ",", "this", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEventEnabled", "(", ")", ")", "{", "Tr", ".", "event", "(", "tc", ",", "getFileName", "(", ")", "+", "\": error in rotate; \"", "+", "t", ")", ";", "}", "}", "}" ]
When the output file has reached it's maximum size, this code will rotate the current log to a backup and get ready to start logging with a new file.
[ "When", "the", "output", "file", "has", "reached", "it", "s", "maximum", "size", "this", "code", "will", "rotate", "the", "current", "log", "to", "a", "backup", "and", "get", "ready", "to", "start", "logging", "with", "a", "new", "file", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/logging/internal/LoggerOnThread.java#L394-L423
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/HexString.java
HexString.binToHex
public static void binToHex(byte[] bin, int start, int length, StringBuffer hex) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "binToHex", new Object[]{bin, Integer.valueOf(start), Integer.valueOf(length), hex}); /* Constant for binary to Hex conversion */ final char BIN2HEX[] = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'}; int binByte; for (int i=start; i<start+length; i++) { binByte = bin[i]; /* SibTreat the byte as unsigned */ if (binByte < 0) binByte += 256; /* Convert and append each digit */ hex.append(BIN2HEX[binByte/16]); hex.append(BIN2HEX[binByte%16]); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "binToHex", hex); }
java
public static void binToHex(byte[] bin, int start, int length, StringBuffer hex) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "binToHex", new Object[]{bin, Integer.valueOf(start), Integer.valueOf(length), hex}); /* Constant for binary to Hex conversion */ final char BIN2HEX[] = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'}; int binByte; for (int i=start; i<start+length; i++) { binByte = bin[i]; /* SibTreat the byte as unsigned */ if (binByte < 0) binByte += 256; /* Convert and append each digit */ hex.append(BIN2HEX[binByte/16]); hex.append(BIN2HEX[binByte%16]); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "binToHex", hex); }
[ "public", "static", "void", "binToHex", "(", "byte", "[", "]", "bin", ",", "int", "start", ",", "int", "length", ",", "StringBuffer", "hex", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"binToHex\"", ",", "new", "Object", "[", "]", "{", "bin", ",", "Integer", ".", "valueOf", "(", "start", ")", ",", "Integer", ".", "valueOf", "(", "length", ")", ",", "hex", "}", ")", ";", "/* Constant for binary to Hex conversion */", "final", "char", "BIN2HEX", "[", "]", "=", "{", "'", "'", ",", "'", "'", ",", "'", "'", ",", "'", "'", ",", "'", "'", ",", "'", "'", ",", "'", "'", ",", "'", "'", ",", "'", "'", ",", "'", "'", ",", "'", "'", ",", "'", "'", ",", "'", "'", ",", "'", "'", ",", "'", "'", ",", "'", "'", "}", ";", "int", "binByte", ";", "for", "(", "int", "i", "=", "start", ";", "i", "<", "start", "+", "length", ";", "i", "++", ")", "{", "binByte", "=", "bin", "[", "i", "]", ";", "/* SibTreat the byte as unsigned */", "if", "(", "binByte", "<", "0", ")", "binByte", "+=", "256", ";", "/* Convert and append each digit */", "hex", ".", "append", "(", "BIN2HEX", "[", "binByte", "/", "16", "]", ")", ";", "hex", ".", "append", "(", "BIN2HEX", "[", "binByte", "%", "16", "]", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"binToHex\"", ",", "hex", ")", ";", "}" ]
Converts a binary value held in a byte array into a hex string, in the given StringBuffer, using exactly two characters per byte of input. @param bin The byte array containing the binary value. @param start The offset into the byte array for conversion to start.. @param length The number of bytes to convert. @param hex The StringBuffer to contain the hex string.
[ "Converts", "a", "binary", "value", "held", "in", "a", "byte", "array", "into", "a", "hex", "string", "in", "the", "given", "StringBuffer", "using", "exactly", "two", "characters", "per", "byte", "of", "input", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/HexString.java#L38-L61
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/HexString.java
HexString.binToHex
public static String binToHex(byte[] bin) { StringBuffer hex = new StringBuffer(); binToHex(bin,0,bin.length,hex); return hex.toString(); }
java
public static String binToHex(byte[] bin) { StringBuffer hex = new StringBuffer(); binToHex(bin,0,bin.length,hex); return hex.toString(); }
[ "public", "static", "String", "binToHex", "(", "byte", "[", "]", "bin", ")", "{", "StringBuffer", "hex", "=", "new", "StringBuffer", "(", ")", ";", "binToHex", "(", "bin", ",", "0", ",", "bin", ".", "length", ",", "hex", ")", ";", "return", "hex", ".", "toString", "(", ")", ";", "}" ]
Converts a binary value held in a byte array into a hex string. @param bin The byte array containing the binary value. @return String The hex string
[ "Converts", "a", "binary", "value", "held", "in", "a", "byte", "array", "into", "a", "hex", "string", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/HexString.java#L69-L74
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/HexString.java
HexString.hexToBin
public static byte[] hexToBin(String hex, int start) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "hexToBin", new Object[]{hex, Integer.valueOf(start)}); int digit1, digit2; int length = (hex.length() - start); // no of characters to be processed // Handle the special case when there is no data if (length == 0) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "hexToBin"); return new byte[0]; } // It's an error if we have an odd number of hex characters if ((length < 0) || ((length % 2) != 0)) { String nlsMsg = nls.getFormattedMessage("BAD_HEX_STRING_CWSIU0200" ,new Object[]{hex} ,"The hexadecimal string " + hex + " is incorrectly formatted." ); IllegalArgumentException e = new IllegalArgumentException(nlsMsg); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "hexToBin", e); throw e; } // Change length from number of characters to number of bytes to be produced length /= 2; // Allocate a buffer to hold the result byte[] retval = new byte[length]; // Convert from HexString to a byte array for (int i = 0; i < length; i++) { digit1 = (Character.digit(hex.charAt(2 * i + start), 16)) << 4; digit2 = Character.digit(hex.charAt(2 * i + start + 1), 16); // The Character.digit() method signals an error by returning -1, so we have // to test for it here if ((digit1 < 0) || (digit2 < 0)) { String nlsMsg = nls.getFormattedMessage("BAD_HEX_STRING_CWSIF0200" ,new Object[]{hex} ,"The hexadecimal string " + hex + " is incorrectly formatted." ); IllegalArgumentException e = new IllegalArgumentException(nlsMsg); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "hexToBin", e); throw e; } retval[i] = (byte) (digit1 + digit2); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "hexToBin"); return retval; }
java
public static byte[] hexToBin(String hex, int start) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "hexToBin", new Object[]{hex, Integer.valueOf(start)}); int digit1, digit2; int length = (hex.length() - start); // no of characters to be processed // Handle the special case when there is no data if (length == 0) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "hexToBin"); return new byte[0]; } // It's an error if we have an odd number of hex characters if ((length < 0) || ((length % 2) != 0)) { String nlsMsg = nls.getFormattedMessage("BAD_HEX_STRING_CWSIU0200" ,new Object[]{hex} ,"The hexadecimal string " + hex + " is incorrectly formatted." ); IllegalArgumentException e = new IllegalArgumentException(nlsMsg); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "hexToBin", e); throw e; } // Change length from number of characters to number of bytes to be produced length /= 2; // Allocate a buffer to hold the result byte[] retval = new byte[length]; // Convert from HexString to a byte array for (int i = 0; i < length; i++) { digit1 = (Character.digit(hex.charAt(2 * i + start), 16)) << 4; digit2 = Character.digit(hex.charAt(2 * i + start + 1), 16); // The Character.digit() method signals an error by returning -1, so we have // to test for it here if ((digit1 < 0) || (digit2 < 0)) { String nlsMsg = nls.getFormattedMessage("BAD_HEX_STRING_CWSIF0200" ,new Object[]{hex} ,"The hexadecimal string " + hex + " is incorrectly formatted." ); IllegalArgumentException e = new IllegalArgumentException(nlsMsg); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "hexToBin", e); throw e; } retval[i] = (byte) (digit1 + digit2); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "hexToBin"); return retval; }
[ "public", "static", "byte", "[", "]", "hexToBin", "(", "String", "hex", ",", "int", "start", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"hexToBin\"", ",", "new", "Object", "[", "]", "{", "hex", ",", "Integer", ".", "valueOf", "(", "start", ")", "}", ")", ";", "int", "digit1", ",", "digit2", ";", "int", "length", "=", "(", "hex", ".", "length", "(", ")", "-", "start", ")", ";", "// no of characters to be processed", "// Handle the special case when there is no data", "if", "(", "length", "==", "0", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"hexToBin\"", ")", ";", "return", "new", "byte", "[", "0", "]", ";", "}", "// It's an error if we have an odd number of hex characters", "if", "(", "(", "length", "<", "0", ")", "||", "(", "(", "length", "%", "2", ")", "!=", "0", ")", ")", "{", "String", "nlsMsg", "=", "nls", ".", "getFormattedMessage", "(", "\"BAD_HEX_STRING_CWSIU0200\"", ",", "new", "Object", "[", "]", "{", "hex", "}", ",", "\"The hexadecimal string \"", "+", "hex", "+", "\" is incorrectly formatted.\"", ")", ";", "IllegalArgumentException", "e", "=", "new", "IllegalArgumentException", "(", "nlsMsg", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"hexToBin\"", ",", "e", ")", ";", "throw", "e", ";", "}", "// Change length from number of characters to number of bytes to be produced", "length", "/=", "2", ";", "// Allocate a buffer to hold the result", "byte", "[", "]", "retval", "=", "new", "byte", "[", "length", "]", ";", "// Convert from HexString to a byte array", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "digit1", "=", "(", "Character", ".", "digit", "(", "hex", ".", "charAt", "(", "2", "*", "i", "+", "start", ")", ",", "16", ")", ")", "<<", "4", ";", "digit2", "=", "Character", ".", "digit", "(", "hex", ".", "charAt", "(", "2", "*", "i", "+", "start", "+", "1", ")", ",", "16", ")", ";", "// The Character.digit() method signals an error by returning -1, so we have", "// to test for it here", "if", "(", "(", "digit1", "<", "0", ")", "||", "(", "digit2", "<", "0", ")", ")", "{", "String", "nlsMsg", "=", "nls", ".", "getFormattedMessage", "(", "\"BAD_HEX_STRING_CWSIF0200\"", ",", "new", "Object", "[", "]", "{", "hex", "}", ",", "\"The hexadecimal string \"", "+", "hex", "+", "\" is incorrectly formatted.\"", ")", ";", "IllegalArgumentException", "e", "=", "new", "IllegalArgumentException", "(", "nlsMsg", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"hexToBin\"", ",", "e", ")", ";", "throw", "e", ";", "}", "retval", "[", "i", "]", "=", "(", "byte", ")", "(", "digit1", "+", "digit2", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"hexToBin\"", ")", ";", "return", "retval", ";", "}" ]
Converts a hex string into a byte array holding the binary value. This code is reused from MA88. @param hex The String containing the hex data (2 characters per byte) @param start The int offset into the string (in characters) where the hex data starts @return The resulting byte array. @throws IllegalArgumentException if the specified characters don't form a valid hex string.
[ "Converts", "a", "hex", "string", "into", "a", "byte", "array", "holding", "the", "binary", "value", ".", "This", "code", "is", "reused", "from", "MA88", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.utils/src/com/ibm/ws/sib/utils/HexString.java#L88-L139
train
OpenLiberty/open-liberty
dev/com.ibm.ws.channelfw/src/com/ibm/ws/tcpchannel/internal/FilterCell.java
FilterCell.findNextCell
public FilterCell findNextCell(int nextValue) { if (nextCell == null) { return null; } return (FilterCell) (nextCell.get(nextValue)); }
java
public FilterCell findNextCell(int nextValue) { if (nextCell == null) { return null; } return (FilterCell) (nextCell.get(nextValue)); }
[ "public", "FilterCell", "findNextCell", "(", "int", "nextValue", ")", "{", "if", "(", "nextCell", "==", "null", ")", "{", "return", "null", ";", "}", "return", "(", "FilterCell", ")", "(", "nextCell", ".", "get", "(", "nextValue", ")", ")", ";", "}" ]
Find the next cell, for a given number, which may come after this cell in the address tree. @param nextValue The next value in the IPv6 Address that is to be tested for inclusion in the address tree @return null if the the nextValue does not have another cell connected to this cell in the tree. Otherwise return the next cell in the tree that is represented by the nextValue.
[ "Find", "the", "next", "cell", "for", "a", "given", "number", "which", "may", "come", "after", "this", "cell", "in", "the", "address", "tree", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/tcpchannel/internal/FilterCell.java#L44-L49
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/StaticCATProducer.java
StaticCATProducer.rcvCloseProducerSess
static void rcvCloseProducerSess(CommsByteBuffer request, Conversation conversation, int requestNumber, boolean allocatedFromBufferPool, boolean partOfExchange) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "rcvCloseProducerSess", new Object[] { request, conversation, "" + requestNumber, "" + allocatedFromBufferPool, "" + partOfExchange }); ConversationState convState = (ConversationState) conversation.getAttachment(); short connectionObjectID = request.getShort(); // BIT16 ConnectionObjectId short producerObjectID = request.getShort(); // BIT16 SyncProducerSessionId if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { SibTr.debug(tc, "connectionObjectID", connectionObjectID); SibTr.debug(tc, "producerObjectID", producerObjectID); } ProducerSession producerSession = ((ProducerSession) convState.getObject(producerObjectID)); try { producerSession.close(); convState.removeObject(producerObjectID); try { conversation.send(poolManager.allocate(), JFapChannelConstants.SEG_CLOSE_PRODUCER_SESS_R, requestNumber, JFapChannelConstants.PRIORITY_MEDIUM, true, ThrottlingPolicy.BLOCK_THREAD, null); } catch (SIException e) { FFDCFilter.processException(e, CLASS_NAME + ".rcvCloseProducerSess", CommsConstants.STATICCATPRODUCER_CLOSE_01); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, e.getMessage(), e); SibTr.error(tc, "COMMUNICATION_ERROR_SICO2024", e); } } catch (SIException e) { //No FFDC code needed - processor will have already FFDC'ed any interesting ones.... if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, e.getMessage(), e); StaticCATHelper.sendExceptionToClient(e, CommsConstants.STATICCATPRODUCER_CLOSE_02, // d186970 conversation, requestNumber); // f172297 } request.release(allocatedFromBufferPool); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "rcvCloseProducerSess"); }
java
static void rcvCloseProducerSess(CommsByteBuffer request, Conversation conversation, int requestNumber, boolean allocatedFromBufferPool, boolean partOfExchange) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "rcvCloseProducerSess", new Object[] { request, conversation, "" + requestNumber, "" + allocatedFromBufferPool, "" + partOfExchange }); ConversationState convState = (ConversationState) conversation.getAttachment(); short connectionObjectID = request.getShort(); // BIT16 ConnectionObjectId short producerObjectID = request.getShort(); // BIT16 SyncProducerSessionId if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { SibTr.debug(tc, "connectionObjectID", connectionObjectID); SibTr.debug(tc, "producerObjectID", producerObjectID); } ProducerSession producerSession = ((ProducerSession) convState.getObject(producerObjectID)); try { producerSession.close(); convState.removeObject(producerObjectID); try { conversation.send(poolManager.allocate(), JFapChannelConstants.SEG_CLOSE_PRODUCER_SESS_R, requestNumber, JFapChannelConstants.PRIORITY_MEDIUM, true, ThrottlingPolicy.BLOCK_THREAD, null); } catch (SIException e) { FFDCFilter.processException(e, CLASS_NAME + ".rcvCloseProducerSess", CommsConstants.STATICCATPRODUCER_CLOSE_01); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, e.getMessage(), e); SibTr.error(tc, "COMMUNICATION_ERROR_SICO2024", e); } } catch (SIException e) { //No FFDC code needed - processor will have already FFDC'ed any interesting ones.... if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, e.getMessage(), e); StaticCATHelper.sendExceptionToClient(e, CommsConstants.STATICCATPRODUCER_CLOSE_02, // d186970 conversation, requestNumber); // f172297 } request.release(allocatedFromBufferPool); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "rcvCloseProducerSess"); }
[ "static", "void", "rcvCloseProducerSess", "(", "CommsByteBuffer", "request", ",", "Conversation", "conversation", ",", "int", "requestNumber", ",", "boolean", "allocatedFromBufferPool", ",", "boolean", "partOfExchange", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"rcvCloseProducerSess\"", ",", "new", "Object", "[", "]", "{", "request", ",", "conversation", ",", "\"\"", "+", "requestNumber", ",", "\"\"", "+", "allocatedFromBufferPool", ",", "\"\"", "+", "partOfExchange", "}", ")", ";", "ConversationState", "convState", "=", "(", "ConversationState", ")", "conversation", ".", "getAttachment", "(", ")", ";", "short", "connectionObjectID", "=", "request", ".", "getShort", "(", ")", ";", "// BIT16 ConnectionObjectId", "short", "producerObjectID", "=", "request", ".", "getShort", "(", ")", ";", "// BIT16 SyncProducerSessionId", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "SibTr", ".", "debug", "(", "tc", ",", "\"connectionObjectID\"", ",", "connectionObjectID", ")", ";", "SibTr", ".", "debug", "(", "tc", ",", "\"producerObjectID\"", ",", "producerObjectID", ")", ";", "}", "ProducerSession", "producerSession", "=", "(", "(", "ProducerSession", ")", "convState", ".", "getObject", "(", "producerObjectID", ")", ")", ";", "try", "{", "producerSession", ".", "close", "(", ")", ";", "convState", ".", "removeObject", "(", "producerObjectID", ")", ";", "try", "{", "conversation", ".", "send", "(", "poolManager", ".", "allocate", "(", ")", ",", "JFapChannelConstants", ".", "SEG_CLOSE_PRODUCER_SESS_R", ",", "requestNumber", ",", "JFapChannelConstants", ".", "PRIORITY_MEDIUM", ",", "true", ",", "ThrottlingPolicy", ".", "BLOCK_THREAD", ",", "null", ")", ";", "}", "catch", "(", "SIException", "e", ")", "{", "FFDCFilter", ".", "processException", "(", "e", ",", "CLASS_NAME", "+", "\".rcvCloseProducerSess\"", ",", "CommsConstants", ".", "STATICCATPRODUCER_CLOSE_01", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "tc", ",", "e", ".", "getMessage", "(", ")", ",", "e", ")", ";", "SibTr", ".", "error", "(", "tc", ",", "\"COMMUNICATION_ERROR_SICO2024\"", ",", "e", ")", ";", "}", "}", "catch", "(", "SIException", "e", ")", "{", "//No FFDC code needed - processor will have already FFDC'ed any interesting ones....", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "tc", ",", "e", ".", "getMessage", "(", ")", ",", "e", ")", ";", "StaticCATHelper", ".", "sendExceptionToClient", "(", "e", ",", "CommsConstants", ".", "STATICCATPRODUCER_CLOSE_02", ",", "// d186970", "conversation", ",", "requestNumber", ")", ";", "// f172297", "}", "request", ".", "release", "(", "allocatedFromBufferPool", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"rcvCloseProducerSess\"", ")", ";", "}" ]
Close the Synchronous Producer Session provided by the client. Fields: BIT16 ConnectionObjectId BIT16 ProducerSessionId @param request @param conversation @param requestNumber @param allocatedFromBufferPool @param partOfExchange
[ "Close", "the", "Synchronous", "Producer", "Session", "provided", "by", "the", "client", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/StaticCATProducer.java#L263-L331
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/StaticCATProducer.java
StaticCATProducer.rcvSendSessMsg
static void rcvSendSessMsg(CommsServerByteBuffer request, Conversation conversation, int requestNumber, boolean allocatedFromBufferPool, boolean partOfExchange) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "rcvSendSessMsg"); final boolean optimizedTx = CommsUtils.requiresOptimizedTransaction(conversation); sendSessMsg(request, conversation, requestNumber, partOfExchange, allocatedFromBufferPool, true, optimizedTx); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "rcvSendSessMsg"); }
java
static void rcvSendSessMsg(CommsServerByteBuffer request, Conversation conversation, int requestNumber, boolean allocatedFromBufferPool, boolean partOfExchange) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "rcvSendSessMsg"); final boolean optimizedTx = CommsUtils.requiresOptimizedTransaction(conversation); sendSessMsg(request, conversation, requestNumber, partOfExchange, allocatedFromBufferPool, true, optimizedTx); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "rcvSendSessMsg"); }
[ "static", "void", "rcvSendSessMsg", "(", "CommsServerByteBuffer", "request", ",", "Conversation", "conversation", ",", "int", "requestNumber", ",", "boolean", "allocatedFromBufferPool", ",", "boolean", "partOfExchange", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"rcvSendSessMsg\"", ")", ";", "final", "boolean", "optimizedTx", "=", "CommsUtils", ".", "requiresOptimizedTransaction", "(", "conversation", ")", ";", "sendSessMsg", "(", "request", ",", "conversation", ",", "requestNumber", ",", "partOfExchange", ",", "allocatedFromBufferPool", ",", "true", ",", "optimizedTx", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"rcvSendSessMsg\"", ")", ";", "}" ]
Calls the internal send method that will send a message and inform the client as to the outcome. @param request @param conversation @param requestNumber @param allocatedFromBufferPool @param partOfExchange
[ "Calls", "the", "internal", "send", "method", "that", "will", "send", "a", "message", "and", "inform", "the", "client", "as", "to", "the", "outcome", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/StaticCATProducer.java#L343-L358
train
OpenLiberty/open-liberty
dev/com.ibm.ws.config/src/com/ibm/ws/config/xml/internal/MetaTypeRegistry.java
MetaTypeRegistry.getRegistryEntry
RegistryEntry getRegistryEntry(String pid) { if (pid == null) { return null; } return entryMap.get(pid); }
java
RegistryEntry getRegistryEntry(String pid) { if (pid == null) { return null; } return entryMap.get(pid); }
[ "RegistryEntry", "getRegistryEntry", "(", "String", "pid", ")", "{", "if", "(", "pid", "==", "null", ")", "{", "return", "null", ";", "}", "return", "entryMap", ".", "get", "(", "pid", ")", ";", "}" ]
get the registry entry, if any, for the supplied pid, which may be null @param pid pid of desired registry entry, or null @return entry for the pid, or null.
[ "get", "the", "registry", "entry", "if", "any", "for", "the", "supplied", "pid", "which", "may", "be", "null" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.config/src/com/ibm/ws/config/xml/internal/MetaTypeRegistry.java#L151-L156
train
OpenLiberty/open-liberty
dev/com.ibm.ws.config/src/com/ibm/ws/config/xml/internal/MetaTypeRegistry.java
MetaTypeRegistry.processReferencedTypes
private void processReferencedTypes(RegistryEntry pidEntry) { //parent first, AD has a reference pid for (ExtendedAttributeDefinition ad : pidEntry.getAttributeMap().values()) { if (ad.getType() == MetaTypeFactory.PID_TYPE) { if (ad.getReferencePid() != null) { RegistryEntry other = getRegistryEntry(ad.getReferencePid()); if (other != null) { PidReference ref = new PidReference(other, pidEntry, ad.getID(), true); other.addReferencingEntry(ref); pidEntry.addReferencedEntry(ref); } } else if (ad.getService() != null) { addServiceUse(ad.getService(), pidEntry); } else { // Error.. should always be caught by metatype validation.. warn anyway? } } } //child first, child has a parentPid if (pidEntry.getObjectClassDefinition().getParentPID() != null) { RegistryEntry other = getRegistryEntry(pidEntry.getObjectClassDefinition().getParentPID()); if (other != null) { pidEntry.addReferencingEntry(new PidReference(pidEntry, other, pidEntry.getChildAlias(), false)); } //else.... this should go into invalidParentEntryMap } //see if anyone is referencing us. for (RegistryEntry other : entryMap.values()) { if (pidEntry.getPid().equals(other.getObjectClassDefinition().getParentPID())) { other.addReferencingEntry(new PidReference(other, pidEntry, other.getChildAlias(), false)); } for (ExtendedAttributeDefinition ad : other.getAttributeMap().values()) { if (ad.getType() == MetaTypeFactory.PID_TYPE) { if (pidEntry.getPid().equals(ad.getReferencePid())) { pidEntry.addReferencingEntry(new PidReference(pidEntry, other, ad.getID(), true)); //TODO deal with service/objectclass here? } } } } }
java
private void processReferencedTypes(RegistryEntry pidEntry) { //parent first, AD has a reference pid for (ExtendedAttributeDefinition ad : pidEntry.getAttributeMap().values()) { if (ad.getType() == MetaTypeFactory.PID_TYPE) { if (ad.getReferencePid() != null) { RegistryEntry other = getRegistryEntry(ad.getReferencePid()); if (other != null) { PidReference ref = new PidReference(other, pidEntry, ad.getID(), true); other.addReferencingEntry(ref); pidEntry.addReferencedEntry(ref); } } else if (ad.getService() != null) { addServiceUse(ad.getService(), pidEntry); } else { // Error.. should always be caught by metatype validation.. warn anyway? } } } //child first, child has a parentPid if (pidEntry.getObjectClassDefinition().getParentPID() != null) { RegistryEntry other = getRegistryEntry(pidEntry.getObjectClassDefinition().getParentPID()); if (other != null) { pidEntry.addReferencingEntry(new PidReference(pidEntry, other, pidEntry.getChildAlias(), false)); } //else.... this should go into invalidParentEntryMap } //see if anyone is referencing us. for (RegistryEntry other : entryMap.values()) { if (pidEntry.getPid().equals(other.getObjectClassDefinition().getParentPID())) { other.addReferencingEntry(new PidReference(other, pidEntry, other.getChildAlias(), false)); } for (ExtendedAttributeDefinition ad : other.getAttributeMap().values()) { if (ad.getType() == MetaTypeFactory.PID_TYPE) { if (pidEntry.getPid().equals(ad.getReferencePid())) { pidEntry.addReferencingEntry(new PidReference(pidEntry, other, ad.getID(), true)); //TODO deal with service/objectclass here? } } } } }
[ "private", "void", "processReferencedTypes", "(", "RegistryEntry", "pidEntry", ")", "{", "//parent first, AD has a reference pid", "for", "(", "ExtendedAttributeDefinition", "ad", ":", "pidEntry", ".", "getAttributeMap", "(", ")", ".", "values", "(", ")", ")", "{", "if", "(", "ad", ".", "getType", "(", ")", "==", "MetaTypeFactory", ".", "PID_TYPE", ")", "{", "if", "(", "ad", ".", "getReferencePid", "(", ")", "!=", "null", ")", "{", "RegistryEntry", "other", "=", "getRegistryEntry", "(", "ad", ".", "getReferencePid", "(", ")", ")", ";", "if", "(", "other", "!=", "null", ")", "{", "PidReference", "ref", "=", "new", "PidReference", "(", "other", ",", "pidEntry", ",", "ad", ".", "getID", "(", ")", ",", "true", ")", ";", "other", ".", "addReferencingEntry", "(", "ref", ")", ";", "pidEntry", ".", "addReferencedEntry", "(", "ref", ")", ";", "}", "}", "else", "if", "(", "ad", ".", "getService", "(", ")", "!=", "null", ")", "{", "addServiceUse", "(", "ad", ".", "getService", "(", ")", ",", "pidEntry", ")", ";", "}", "else", "{", "// Error.. should always be caught by metatype validation.. warn anyway?", "}", "}", "}", "//child first, child has a parentPid", "if", "(", "pidEntry", ".", "getObjectClassDefinition", "(", ")", ".", "getParentPID", "(", ")", "!=", "null", ")", "{", "RegistryEntry", "other", "=", "getRegistryEntry", "(", "pidEntry", ".", "getObjectClassDefinition", "(", ")", ".", "getParentPID", "(", ")", ")", ";", "if", "(", "other", "!=", "null", ")", "{", "pidEntry", ".", "addReferencingEntry", "(", "new", "PidReference", "(", "pidEntry", ",", "other", ",", "pidEntry", ".", "getChildAlias", "(", ")", ",", "false", ")", ")", ";", "}", "//else.... this should go into invalidParentEntryMap", "}", "//see if anyone is referencing us.", "for", "(", "RegistryEntry", "other", ":", "entryMap", ".", "values", "(", ")", ")", "{", "if", "(", "pidEntry", ".", "getPid", "(", ")", ".", "equals", "(", "other", ".", "getObjectClassDefinition", "(", ")", ".", "getParentPID", "(", ")", ")", ")", "{", "other", ".", "addReferencingEntry", "(", "new", "PidReference", "(", "other", ",", "pidEntry", ",", "other", ".", "getChildAlias", "(", ")", ",", "false", ")", ")", ";", "}", "for", "(", "ExtendedAttributeDefinition", "ad", ":", "other", ".", "getAttributeMap", "(", ")", ".", "values", "(", ")", ")", "{", "if", "(", "ad", ".", "getType", "(", ")", "==", "MetaTypeFactory", ".", "PID_TYPE", ")", "{", "if", "(", "pidEntry", ".", "getPid", "(", ")", ".", "equals", "(", "ad", ".", "getReferencePid", "(", ")", ")", ")", "{", "pidEntry", ".", "addReferencingEntry", "(", "new", "PidReference", "(", "pidEntry", ",", "other", ",", "ad", ".", "getID", "(", ")", ",", "true", ")", ")", ";", "//TODO deal with service/objectclass here?", "}", "}", "}", "}", "}" ]
Keeps track of which OCDs are referenced by a PID type attribute in another OCD @param pidEntry
[ "Keeps", "track", "of", "which", "OCDs", "are", "referenced", "by", "a", "PID", "type", "attribute", "in", "another", "OCD" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.config/src/com/ibm/ws/config/xml/internal/MetaTypeRegistry.java#L367-L409
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/TransactionLock.java
TransactionLock.unLock
protected final void unLock(ObjectManagerState objectManagerState) { synchronized (objectManagerState.transactionUnlockSequenceLock) { unlockSequence = objectManagerState.getNewGlobalTransactionUnlockSequence(); lockingTransaction = null; } // synchronized. }
java
protected final void unLock(ObjectManagerState objectManagerState) { synchronized (objectManagerState.transactionUnlockSequenceLock) { unlockSequence = objectManagerState.getNewGlobalTransactionUnlockSequence(); lockingTransaction = null; } // synchronized. }
[ "protected", "final", "void", "unLock", "(", "ObjectManagerState", "objectManagerState", ")", "{", "synchronized", "(", "objectManagerState", ".", "transactionUnlockSequenceLock", ")", "{", "unlockSequence", "=", "objectManagerState", ".", "getNewGlobalTransactionUnlockSequence", "(", ")", ";", "lockingTransaction", "=", "null", ";", "}", "// synchronized.", "}" ]
Releases the lock on the transaction. @param objectManagerState within which the transaction is unlocked.
[ "Releases", "the", "lock", "on", "the", "transaction", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/TransactionLock.java#L36-L42
train
OpenLiberty/open-liberty
dev/com.ibm.ws.security.wim.registry/src/com/ibm/ws/security/wim/registry/util/BridgeUtils.java
BridgeUtils.validateCertificate
protected void validateCertificate(X509Certificate[] chain) throws com.ibm.wsspi.security.wim.exception.CertificateMapFailedException { // validate the certificate array if (chain == null || chain.length == 0) { throw new com.ibm.wsspi.security.wim.exception.CertificateMapFailedException(); } for (X509Certificate cert : chain) { if (cert == null) { throw new com.ibm.wsspi.security.wim.exception.CertificateMapFailedException(); } } }
java
protected void validateCertificate(X509Certificate[] chain) throws com.ibm.wsspi.security.wim.exception.CertificateMapFailedException { // validate the certificate array if (chain == null || chain.length == 0) { throw new com.ibm.wsspi.security.wim.exception.CertificateMapFailedException(); } for (X509Certificate cert : chain) { if (cert == null) { throw new com.ibm.wsspi.security.wim.exception.CertificateMapFailedException(); } } }
[ "protected", "void", "validateCertificate", "(", "X509Certificate", "[", "]", "chain", ")", "throws", "com", ".", "ibm", ".", "wsspi", ".", "security", ".", "wim", ".", "exception", ".", "CertificateMapFailedException", "{", "// validate the certificate array", "if", "(", "chain", "==", "null", "||", "chain", ".", "length", "==", "0", ")", "{", "throw", "new", "com", ".", "ibm", ".", "wsspi", ".", "security", ".", "wim", ".", "exception", ".", "CertificateMapFailedException", "(", ")", ";", "}", "for", "(", "X509Certificate", "cert", ":", "chain", ")", "{", "if", "(", "cert", "==", "null", ")", "{", "throw", "new", "com", ".", "ibm", ".", "wsspi", ".", "security", ".", "wim", ".", "exception", ".", "CertificateMapFailedException", "(", ")", ";", "}", "}", "}" ]
Validate an X509 certificate array. @param chain Certificate chain to validate. @throws com.ibm.wsspi.security.wim.exception.CertificateMapFailedException The certificate array is invalid because it is null, empty or contains an null certificate.
[ "Validate", "an", "X509", "certificate", "array", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.registry/src/com/ibm/ws/security/wim/registry/util/BridgeUtils.java#L169-L180
train
OpenLiberty/open-liberty
dev/com.ibm.ws.security.wim.registry/src/com/ibm/ws/security/wim/registry/util/BridgeUtils.java
BridgeUtils.separateIDAndRealm
protected IDAndRealm separateIDAndRealm(String inputString) throws WIMException { // initialize the method name String methodName = "seperateIDAndRealm"; if (tc.isDebugEnabled()) { Tr.debug(tc, methodName + " " + "inputString = \"" + inputString + "\""); } String defaultRealm = getDefaultRealmName(); if (tc.isDebugEnabled()) { Tr.debug(tc, methodName + " " + "Default realm name = \"" + defaultRealm + "\""); } String defaultRealmDelimiter = getCoreConfiguration().getDefaultDelimiter(); Set<String> virtualRealms = getCoreConfiguration().getRealmNames(); //will not be null since set will always be returned Map<String, String> virtualRealmsDelimiter = new HashMap<String, String>(); for (Iterator<String> itr = virtualRealms.iterator(); itr.hasNext();) { String virtualRealm = itr.next(); String delimiter = getCoreConfiguration().getDelimiter(virtualRealm); virtualRealmsDelimiter.put(virtualRealm, delimiter); } //add default/UR realm to the list of realms to handle no VMM realm scenorio if (virtualRealms.size() == 0) { virtualRealms = new HashSet(); //if empty it will be a abstract set.So need to initialize, else will fail while adding element to it. virtualRealms.add(defaultRealm); virtualRealmsDelimiter.put(defaultRealm, defaultRealmDelimiter); } return seperateIDAndRealm(inputString, defaultRealm, defaultRealmDelimiter, virtualRealms, virtualRealmsDelimiter); }
java
protected IDAndRealm separateIDAndRealm(String inputString) throws WIMException { // initialize the method name String methodName = "seperateIDAndRealm"; if (tc.isDebugEnabled()) { Tr.debug(tc, methodName + " " + "inputString = \"" + inputString + "\""); } String defaultRealm = getDefaultRealmName(); if (tc.isDebugEnabled()) { Tr.debug(tc, methodName + " " + "Default realm name = \"" + defaultRealm + "\""); } String defaultRealmDelimiter = getCoreConfiguration().getDefaultDelimiter(); Set<String> virtualRealms = getCoreConfiguration().getRealmNames(); //will not be null since set will always be returned Map<String, String> virtualRealmsDelimiter = new HashMap<String, String>(); for (Iterator<String> itr = virtualRealms.iterator(); itr.hasNext();) { String virtualRealm = itr.next(); String delimiter = getCoreConfiguration().getDelimiter(virtualRealm); virtualRealmsDelimiter.put(virtualRealm, delimiter); } //add default/UR realm to the list of realms to handle no VMM realm scenorio if (virtualRealms.size() == 0) { virtualRealms = new HashSet(); //if empty it will be a abstract set.So need to initialize, else will fail while adding element to it. virtualRealms.add(defaultRealm); virtualRealmsDelimiter.put(defaultRealm, defaultRealmDelimiter); } return seperateIDAndRealm(inputString, defaultRealm, defaultRealmDelimiter, virtualRealms, virtualRealmsDelimiter); }
[ "protected", "IDAndRealm", "separateIDAndRealm", "(", "String", "inputString", ")", "throws", "WIMException", "{", "// initialize the method name", "String", "methodName", "=", "\"seperateIDAndRealm\"", ";", "if", "(", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "methodName", "+", "\" \"", "+", "\"inputString = \\\"\"", "+", "inputString", "+", "\"\\\"\"", ")", ";", "}", "String", "defaultRealm", "=", "getDefaultRealmName", "(", ")", ";", "if", "(", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "methodName", "+", "\" \"", "+", "\"Default realm name = \\\"\"", "+", "defaultRealm", "+", "\"\\\"\"", ")", ";", "}", "String", "defaultRealmDelimiter", "=", "getCoreConfiguration", "(", ")", ".", "getDefaultDelimiter", "(", ")", ";", "Set", "<", "String", ">", "virtualRealms", "=", "getCoreConfiguration", "(", ")", ".", "getRealmNames", "(", ")", ";", "//will not be null since set will always be returned", "Map", "<", "String", ",", "String", ">", "virtualRealmsDelimiter", "=", "new", "HashMap", "<", "String", ",", "String", ">", "(", ")", ";", "for", "(", "Iterator", "<", "String", ">", "itr", "=", "virtualRealms", ".", "iterator", "(", ")", ";", "itr", ".", "hasNext", "(", ")", ";", ")", "{", "String", "virtualRealm", "=", "itr", ".", "next", "(", ")", ";", "String", "delimiter", "=", "getCoreConfiguration", "(", ")", ".", "getDelimiter", "(", "virtualRealm", ")", ";", "virtualRealmsDelimiter", ".", "put", "(", "virtualRealm", ",", "delimiter", ")", ";", "}", "//add default/UR realm to the list of realms to handle no VMM realm scenorio", "if", "(", "virtualRealms", ".", "size", "(", ")", "==", "0", ")", "{", "virtualRealms", "=", "new", "HashSet", "(", ")", ";", "//if empty it will be a abstract set.So need to initialize, else will fail while adding element to it.", "virtualRealms", ".", "add", "(", "defaultRealm", ")", ";", "virtualRealmsDelimiter", ".", "put", "(", "defaultRealm", ",", "defaultRealmDelimiter", ")", ";", "}", "return", "seperateIDAndRealm", "(", "inputString", ",", "defaultRealm", ",", "defaultRealmDelimiter", ",", "virtualRealms", ",", "virtualRealmsDelimiter", ")", ";", "}" ]
Separate the ID and realm from an input String. @param inputString String containing the ID and realm. @return WIMUserRegistryID with the ID and realm separated. @throws WIMException The default realm could not be found. @pre inputString != null @post $return != null @post $return.getId() != null @post $return.getRealm() != null
[ "Separate", "the", "ID", "and", "realm", "from", "an", "input", "String", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.registry/src/com/ibm/ws/security/wim/registry/util/BridgeUtils.java#L197-L224
train
OpenLiberty/open-liberty
dev/com.ibm.ws.security.wim.registry/src/com/ibm/ws/security/wim/registry/util/BridgeUtils.java
BridgeUtils.isIdentifierTypeProperty
public boolean isIdentifierTypeProperty(String inputProperty) { // initialize the return value boolean returnValue = false; // test the property if ((inputProperty != null) && ((inputProperty.equals(Service.PROP_UNIQUE_ID)) || (inputProperty.equals(Service.PROP_UNIQUE_NAME)) || (inputProperty.equals(Service.PROP_EXTERNAL_ID)) || (inputProperty.equals(Service.PROP_EXTERNAL_NAME)))) { returnValue = true; } return returnValue; }
java
public boolean isIdentifierTypeProperty(String inputProperty) { // initialize the return value boolean returnValue = false; // test the property if ((inputProperty != null) && ((inputProperty.equals(Service.PROP_UNIQUE_ID)) || (inputProperty.equals(Service.PROP_UNIQUE_NAME)) || (inputProperty.equals(Service.PROP_EXTERNAL_ID)) || (inputProperty.equals(Service.PROP_EXTERNAL_NAME)))) { returnValue = true; } return returnValue; }
[ "public", "boolean", "isIdentifierTypeProperty", "(", "String", "inputProperty", ")", "{", "// initialize the return value", "boolean", "returnValue", "=", "false", ";", "// test the property", "if", "(", "(", "inputProperty", "!=", "null", ")", "&&", "(", "(", "inputProperty", ".", "equals", "(", "Service", ".", "PROP_UNIQUE_ID", ")", ")", "||", "(", "inputProperty", ".", "equals", "(", "Service", ".", "PROP_UNIQUE_NAME", ")", ")", "||", "(", "inputProperty", ".", "equals", "(", "Service", ".", "PROP_EXTERNAL_ID", ")", ")", "||", "(", "inputProperty", ".", "equals", "(", "Service", ".", "PROP_EXTERNAL_NAME", ")", ")", ")", ")", "{", "returnValue", "=", "true", ";", "}", "return", "returnValue", ";", "}" ]
Test to see if a property is an IdentifierType property. @param inputProperty Property to test. @return true if the property is an IdentifierType property, false otherwise. @pre inputProperty != null
[ "Test", "to", "see", "if", "a", "property", "is", "an", "IdentifierType", "property", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.registry/src/com/ibm/ws/security/wim/registry/util/BridgeUtils.java#L325-L335
train
OpenLiberty/open-liberty
dev/com.ibm.ws.security.wim.registry/src/com/ibm/ws/security/wim/registry/util/BridgeUtils.java
BridgeUtils.createRealmDataObject
protected void createRealmDataObject(Root inputRootObject, String inputRealm) { // use the root DataGraph to create a Context DataGraph List<Context> contexts = inputRootObject.getContexts(); if (contexts != null) { Context ctx = new Context(); // set "WIM.Realm" in the Context DataGraph to the realm ctx.setKey(Service.VALUE_CONTEXT_REALM_KEY); ctx.setValue(inputRealm); contexts.add(ctx); } }
java
protected void createRealmDataObject(Root inputRootObject, String inputRealm) { // use the root DataGraph to create a Context DataGraph List<Context> contexts = inputRootObject.getContexts(); if (contexts != null) { Context ctx = new Context(); // set "WIM.Realm" in the Context DataGraph to the realm ctx.setKey(Service.VALUE_CONTEXT_REALM_KEY); ctx.setValue(inputRealm); contexts.add(ctx); } }
[ "protected", "void", "createRealmDataObject", "(", "Root", "inputRootObject", ",", "String", "inputRealm", ")", "{", "// use the root DataGraph to create a Context DataGraph", "List", "<", "Context", ">", "contexts", "=", "inputRootObject", ".", "getContexts", "(", ")", ";", "if", "(", "contexts", "!=", "null", ")", "{", "Context", "ctx", "=", "new", "Context", "(", ")", ";", "// set \"WIM.Realm\" in the Context DataGraph to the realm", "ctx", ".", "setKey", "(", "Service", ".", "VALUE_CONTEXT_REALM_KEY", ")", ";", "ctx", ".", "setValue", "(", "inputRealm", ")", ";", "contexts", ".", "add", "(", "ctx", ")", ";", "}", "}" ]
Create a DataObject for the realm context. @param inputRootDataObject The root DataObject. @param inputRealm The realm. @pre inputRootDataObject != null @pre inputRealm != null @pre inputRealm != ""
[ "Create", "a", "DataObject", "for", "the", "realm", "context", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.registry/src/com/ibm/ws/security/wim/registry/util/BridgeUtils.java#L347-L358
train
OpenLiberty/open-liberty
dev/com.ibm.ws.security.wim.registry/src/com/ibm/ws/security/wim/registry/util/BridgeUtils.java
BridgeUtils.createPropertyControlDataObject
protected void createPropertyControlDataObject(Root inputRootDataObject, String inputProperty) { // use the root DataGraph to create a PropertyControl DataGraph List<Control> propertyControls = inputRootDataObject.getControls(); PropertyControl propCtrl = null; if (propertyControls != null) { propCtrl = new PropertyControl(); propertyControls.add(propCtrl); } // add the requested property to the return list of properties if (propCtrl != null) { propCtrl.getProperties().add(inputProperty); } }
java
protected void createPropertyControlDataObject(Root inputRootDataObject, String inputProperty) { // use the root DataGraph to create a PropertyControl DataGraph List<Control> propertyControls = inputRootDataObject.getControls(); PropertyControl propCtrl = null; if (propertyControls != null) { propCtrl = new PropertyControl(); propertyControls.add(propCtrl); } // add the requested property to the return list of properties if (propCtrl != null) { propCtrl.getProperties().add(inputProperty); } }
[ "protected", "void", "createPropertyControlDataObject", "(", "Root", "inputRootDataObject", ",", "String", "inputProperty", ")", "{", "// use the root DataGraph to create a PropertyControl DataGraph", "List", "<", "Control", ">", "propertyControls", "=", "inputRootDataObject", ".", "getControls", "(", ")", ";", "PropertyControl", "propCtrl", "=", "null", ";", "if", "(", "propertyControls", "!=", "null", ")", "{", "propCtrl", "=", "new", "PropertyControl", "(", ")", ";", "propertyControls", ".", "add", "(", "propCtrl", ")", ";", "}", "// add the requested property to the return list of properties", "if", "(", "propCtrl", "!=", "null", ")", "{", "propCtrl", ".", "getProperties", "(", ")", ".", "add", "(", "inputProperty", ")", ";", "}", "}" ]
Create a DataObject for the property request. @param inputRootDataObject The root DataObject. @param inputProperty The property to request @pre inputRootDataObject != null @pre inputProperty != null @pre inputProperty != ""
[ "Create", "a", "DataObject", "for", "the", "property", "request", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.registry/src/com/ibm/ws/security/wim/registry/util/BridgeUtils.java#L370-L382
train
OpenLiberty/open-liberty
dev/com.ibm.ws.security.wim.registry/src/com/ibm/ws/security/wim/registry/util/BridgeUtils.java
BridgeUtils.getRealInputAttrName
protected String getRealInputAttrName(String inputAttrName, String id, boolean isUser) { boolean isInputAttrValueDN = UniqueNameHelper.isDN(id) != null; boolean isInputAttrIdentifier = isIdentifierTypeProperty(inputAttrName); if (!isInputAttrIdentifier && isInputAttrValueDN) { // To suppress the below message from coming in trace.log due to defect 94474 /* * if (tc.isWarningEnabled()) { * //Tr.warning(tc, "the propertyForInput " + inputAttrName + " doesn't match the format of input value " + id + ", switch to uniqueName"); * Tr.warning(tc, WIMMessageKey.INVALID_PROPERTY_VALUE_FORMAT, inputAttrName); * } */ inputAttrName = "uniqueName"; //take it as uniqueName because we don't know if it's externalName or uniqueName value } else if (isInputAttrIdentifier && !isInputAttrValueDN) { // if dealing with LoginAccount or Group if (isUser) { // To suppress the below message from coming in trace.log due to defect 94474 /* * if (tc.isWarningEnabled()) { * //Tr.warning(tc, "the propertyForInput " + inputAttrName + " doesn't match the format of input value " + id + ", switch to principalName"); * Tr.warning(tc, WIMMessageKey.INVALID_PROPERTY_VALUE_FORMAT, inputAttrName); * } */ inputAttrName = "principalName"; // loginaccounts } //OR else { // To suppress the below message from coming in trace.log due to defect 94474 /* * if (tc.isWarningEnabled()) { * //Tr.warning(tc, "the propertyForInput " + inputAttrName + " doesn't match the format of input value " + id + ", swith to cn"); * Tr.warning(tc, WIMMessageKey.INVALID_PROPERTY_VALUE_FORMAT, inputAttrName); * } */ inputAttrName = "cn"; // groups } } return inputAttrName; }
java
protected String getRealInputAttrName(String inputAttrName, String id, boolean isUser) { boolean isInputAttrValueDN = UniqueNameHelper.isDN(id) != null; boolean isInputAttrIdentifier = isIdentifierTypeProperty(inputAttrName); if (!isInputAttrIdentifier && isInputAttrValueDN) { // To suppress the below message from coming in trace.log due to defect 94474 /* * if (tc.isWarningEnabled()) { * //Tr.warning(tc, "the propertyForInput " + inputAttrName + " doesn't match the format of input value " + id + ", switch to uniqueName"); * Tr.warning(tc, WIMMessageKey.INVALID_PROPERTY_VALUE_FORMAT, inputAttrName); * } */ inputAttrName = "uniqueName"; //take it as uniqueName because we don't know if it's externalName or uniqueName value } else if (isInputAttrIdentifier && !isInputAttrValueDN) { // if dealing with LoginAccount or Group if (isUser) { // To suppress the below message from coming in trace.log due to defect 94474 /* * if (tc.isWarningEnabled()) { * //Tr.warning(tc, "the propertyForInput " + inputAttrName + " doesn't match the format of input value " + id + ", switch to principalName"); * Tr.warning(tc, WIMMessageKey.INVALID_PROPERTY_VALUE_FORMAT, inputAttrName); * } */ inputAttrName = "principalName"; // loginaccounts } //OR else { // To suppress the below message from coming in trace.log due to defect 94474 /* * if (tc.isWarningEnabled()) { * //Tr.warning(tc, "the propertyForInput " + inputAttrName + " doesn't match the format of input value " + id + ", swith to cn"); * Tr.warning(tc, WIMMessageKey.INVALID_PROPERTY_VALUE_FORMAT, inputAttrName); * } */ inputAttrName = "cn"; // groups } } return inputAttrName; }
[ "protected", "String", "getRealInputAttrName", "(", "String", "inputAttrName", ",", "String", "id", ",", "boolean", "isUser", ")", "{", "boolean", "isInputAttrValueDN", "=", "UniqueNameHelper", ".", "isDN", "(", "id", ")", "!=", "null", ";", "boolean", "isInputAttrIdentifier", "=", "isIdentifierTypeProperty", "(", "inputAttrName", ")", ";", "if", "(", "!", "isInputAttrIdentifier", "&&", "isInputAttrValueDN", ")", "{", "// To suppress the below message from coming in trace.log due to defect 94474", "/*\n * if (tc.isWarningEnabled()) {\n * //Tr.warning(tc, \"the propertyForInput \" + inputAttrName + \" doesn't match the format of input value \" + id + \", switch to uniqueName\");\n * Tr.warning(tc, WIMMessageKey.INVALID_PROPERTY_VALUE_FORMAT, inputAttrName);\n * }\n */", "inputAttrName", "=", "\"uniqueName\"", ";", "//take it as uniqueName because we don't know if it's externalName or uniqueName value", "}", "else", "if", "(", "isInputAttrIdentifier", "&&", "!", "isInputAttrValueDN", ")", "{", "// if dealing with LoginAccount or Group", "if", "(", "isUser", ")", "{", "// To suppress the below message from coming in trace.log due to defect 94474", "/*\n * if (tc.isWarningEnabled()) {\n * //Tr.warning(tc, \"the propertyForInput \" + inputAttrName + \" doesn't match the format of input value \" + id + \", switch to principalName\");\n * Tr.warning(tc, WIMMessageKey.INVALID_PROPERTY_VALUE_FORMAT, inputAttrName);\n * }\n */", "inputAttrName", "=", "\"principalName\"", ";", "// loginaccounts", "}", "//OR", "else", "{", "// To suppress the below message from coming in trace.log due to defect 94474", "/*\n * if (tc.isWarningEnabled()) {\n * //Tr.warning(tc, \"the propertyForInput \" + inputAttrName + \" doesn't match the format of input value \" + id + \", swith to cn\");\n * Tr.warning(tc, WIMMessageKey.INVALID_PROPERTY_VALUE_FORMAT, inputAttrName);\n * }\n */", "inputAttrName", "=", "\"cn\"", ";", "// groups", "}", "}", "return", "inputAttrName", ";", "}" ]
get input securityName. @param input security attribute defined in the realm. @param input security name value. @param loginAccount or Group. @return uniqueName if the property is an IdentifierType property, principalName otherwise.
[ "get", "input", "securityName", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.registry/src/com/ibm/ws/security/wim/registry/util/BridgeUtils.java#L488-L527
train
OpenLiberty/open-liberty
dev/com.ibm.ws.security.wim.registry/src/com/ibm/ws/security/wim/registry/util/BridgeUtils.java
BridgeUtils.getDefaultRealmName
public String getDefaultRealmName() { String returnRealm = getCoreConfiguration().getDefaultRealmName(); if (returnRealm == null) { returnRealm = urRealmName; } return returnRealm; }
java
public String getDefaultRealmName() { String returnRealm = getCoreConfiguration().getDefaultRealmName(); if (returnRealm == null) { returnRealm = urRealmName; } return returnRealm; }
[ "public", "String", "getDefaultRealmName", "(", ")", "{", "String", "returnRealm", "=", "getCoreConfiguration", "(", ")", ".", "getDefaultRealmName", "(", ")", ";", "if", "(", "returnRealm", "==", "null", ")", "{", "returnRealm", "=", "urRealmName", ";", "}", "return", "returnRealm", ";", "}" ]
Method to return the default realm @return default realm Name
[ "Method", "to", "return", "the", "default", "realm" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.registry/src/com/ibm/ws/security/wim/registry/util/BridgeUtils.java#L534-L541
train
OpenLiberty/open-liberty
dev/com.ibm.ws.security.token.ltpa/src/com/ibm/ws/security/token/ltpa/internal/LTPAKeyInfoManager.java
LTPAKeyInfoManager.loadPropertiesFile
private final Properties loadPropertiesFile(WsResource res) throws IOException { Properties props = new Properties(); InputStream is = res.get(); try { props.load(is); } catch (IOException e) { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(this, tc, "Error loading properties; " + e); } throw e; } finally { if (is != null) try { is.close(); } catch (IOException e) { } } return props; }
java
private final Properties loadPropertiesFile(WsResource res) throws IOException { Properties props = new Properties(); InputStream is = res.get(); try { props.load(is); } catch (IOException e) { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(this, tc, "Error loading properties; " + e); } throw e; } finally { if (is != null) try { is.close(); } catch (IOException e) { } } return props; }
[ "private", "final", "Properties", "loadPropertiesFile", "(", "WsResource", "res", ")", "throws", "IOException", "{", "Properties", "props", "=", "new", "Properties", "(", ")", ";", "InputStream", "is", "=", "res", ".", "get", "(", ")", ";", "try", "{", "props", ".", "load", "(", "is", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEventEnabled", "(", ")", ")", "{", "Tr", ".", "event", "(", "this", ",", "tc", ",", "\"Error loading properties; \"", "+", "e", ")", ";", "}", "throw", "e", ";", "}", "finally", "{", "if", "(", "is", "!=", "null", ")", "try", "{", "is", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "}", "}", "return", "props", ";", "}" ]
Load the contents of the properties file. @param res The WsResource of the key import file. @return The properties @throws TokenException
[ "Load", "the", "contents", "of", "the", "properties", "file", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.token.ltpa/src/com/ibm/ws/security/token/ltpa/internal/LTPAKeyInfoManager.java#L69-L88
train
OpenLiberty/open-liberty
dev/com.ibm.ws.security.token.ltpa/src/com/ibm/ws/security/token/ltpa/internal/LTPAKeyInfoManager.java
LTPAKeyInfoManager.getLTPAKeyFileResource
final WsResource getLTPAKeyFileResource(WsLocationAdmin locService, String ltpaKeyFile) { WsResource ltpaFile = locService.resolveResource(ltpaKeyFile); if (ltpaFile != null && ltpaFile.exists()) { return ltpaFile; } else { // The file does not exist so return null return null; } }
java
final WsResource getLTPAKeyFileResource(WsLocationAdmin locService, String ltpaKeyFile) { WsResource ltpaFile = locService.resolveResource(ltpaKeyFile); if (ltpaFile != null && ltpaFile.exists()) { return ltpaFile; } else { // The file does not exist so return null return null; } }
[ "final", "WsResource", "getLTPAKeyFileResource", "(", "WsLocationAdmin", "locService", ",", "String", "ltpaKeyFile", ")", "{", "WsResource", "ltpaFile", "=", "locService", ".", "resolveResource", "(", "ltpaKeyFile", ")", ";", "if", "(", "ltpaFile", "!=", "null", "&&", "ltpaFile", ".", "exists", "(", ")", ")", "{", "return", "ltpaFile", ";", "}", "else", "{", "// The file does not exist so return null", "return", "null", ";", "}", "}" ]
Given the path to the LTPA key file return the WsResource for the file if the file exists. @param ltpaKeyFile @return WsResource if the file exist, null if it does not.
[ "Given", "the", "path", "to", "the", "LTPA", "key", "file", "return", "the", "WsResource", "for", "the", "file", "if", "the", "file", "exists", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.token.ltpa/src/com/ibm/ws/security/token/ltpa/internal/LTPAKeyInfoManager.java#L187-L195
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSBoxManager.java
JSBoxManager.cleanupBoxedCache
void cleanupBoxedCache(int boxedAccessor) { for (int i = 0; i < boxedCache.length; i++) if (boxed[i][0] == boxedAccessor) boxedCache[i] = null; }
java
void cleanupBoxedCache(int boxedAccessor) { for (int i = 0; i < boxedCache.length; i++) if (boxed[i][0] == boxedAccessor) boxedCache[i] = null; }
[ "void", "cleanupBoxedCache", "(", "int", "boxedAccessor", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "boxedCache", ".", "length", ";", "i", "++", ")", "if", "(", "boxed", "[", "i", "]", "[", "0", "]", "==", "boxedAccessor", ")", "boxedCache", "[", "i", "]", "=", "null", ";", "}" ]
Remove entries from the boxedCache after removing the entry from the main cache that they depend upon. @param boxedAccessor the accessor of the entry that was removed from the main cache
[ "Remove", "entries", "from", "the", "boxedCache", "after", "removing", "the", "entry", "from", "the", "main", "cache", "that", "they", "depend", "upon", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSBoxManager.java#L57-L61
train
OpenLiberty/open-liberty
dev/com.ibm.ws.microprofile.health/src/com/ibm/ws/microprofile/health/internal/HealthCheckHttpResponseBuilder.java
HealthCheckHttpResponseBuilder.getJSON
private JSON getJSON() throws JSONMarshallException { if (json == null) { JSONSettings settings = new JSONSettings(Include.NON_NULL); json = JSONFactory.newInstance(settings); } return json; }
java
private JSON getJSON() throws JSONMarshallException { if (json == null) { JSONSettings settings = new JSONSettings(Include.NON_NULL); json = JSONFactory.newInstance(settings); } return json; }
[ "private", "JSON", "getJSON", "(", ")", "throws", "JSONMarshallException", "{", "if", "(", "json", "==", "null", ")", "{", "JSONSettings", "settings", "=", "new", "JSONSettings", "(", "Include", ".", "NON_NULL", ")", ";", "json", "=", "JSONFactory", ".", "newInstance", "(", "settings", ")", ";", "}", "return", "json", ";", "}" ]
Utility that returns a JSON object from a factory @return the JSON object providing POJO-JSON serialization and deserialization @throws JSONMarshallException if there are problems configuring serialization inclusion
[ "Utility", "that", "returns", "a", "JSON", "object", "from", "a", "factory" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.microprofile.health/src/com/ibm/ws/microprofile/health/internal/HealthCheckHttpResponseBuilder.java#L146-L152
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/filters/SubscriptionStateFilter.java
SubscriptionStateFilter.setSubscriptionIDFilter
public void setSubscriptionIDFilter(String subscriptionId) { if (tc.isEntryEnabled()) SibTr.entry(tc, "setSubscriptionIDFilter", subscriptionId); this._subscriptionId = subscriptionId; this._destination = null; this._consumerDispatcherState = null; if (tc.isEntryEnabled()) SibTr.exit(tc, "setSubscriptionIDFilter"); }
java
public void setSubscriptionIDFilter(String subscriptionId) { if (tc.isEntryEnabled()) SibTr.entry(tc, "setSubscriptionIDFilter", subscriptionId); this._subscriptionId = subscriptionId; this._destination = null; this._consumerDispatcherState = null; if (tc.isEntryEnabled()) SibTr.exit(tc, "setSubscriptionIDFilter"); }
[ "public", "void", "setSubscriptionIDFilter", "(", "String", "subscriptionId", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"setSubscriptionIDFilter\"", ",", "subscriptionId", ")", ";", "this", ".", "_subscriptionId", "=", "subscriptionId", ";", "this", ".", "_destination", "=", "null", ";", "this", ".", "_consumerDispatcherState", "=", "null", ";", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"setSubscriptionIDFilter\"", ")", ";", "}" ]
setter to create a filter based on subscriptionId @param subscriptionId
[ "setter", "to", "create", "a", "filter", "based", "on", "subscriptionId" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/filters/SubscriptionStateFilter.java#L64-L75
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/filters/SubscriptionStateFilter.java
SubscriptionStateFilter.setDestinationFilter
public void setDestinationFilter(SIBUuid12 destination) { if (tc.isEntryEnabled()) SibTr.entry(tc, "setDestinationFilter", destination); this._destination = destination; this._subscriptionId = null; this._consumerDispatcherState = null; if (tc.isEntryEnabled()) SibTr.exit(tc, "setDestinationFilter"); }
java
public void setDestinationFilter(SIBUuid12 destination) { if (tc.isEntryEnabled()) SibTr.entry(tc, "setDestinationFilter", destination); this._destination = destination; this._subscriptionId = null; this._consumerDispatcherState = null; if (tc.isEntryEnabled()) SibTr.exit(tc, "setDestinationFilter"); }
[ "public", "void", "setDestinationFilter", "(", "SIBUuid12", "destination", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"setDestinationFilter\"", ",", "destination", ")", ";", "this", ".", "_destination", "=", "destination", ";", "this", ".", "_subscriptionId", "=", "null", ";", "this", ".", "_consumerDispatcherState", "=", "null", ";", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"setDestinationFilter\"", ")", ";", "}" ]
setter to create a filter based on destination name @param destination The destination uuid
[ "setter", "to", "create", "a", "filter", "based", "on", "destination", "name" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/filters/SubscriptionStateFilter.java#L83-L94
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/filters/SubscriptionStateFilter.java
SubscriptionStateFilter.setConsumerDispatcherStateFilter
public void setConsumerDispatcherStateFilter(ConsumerDispatcherState consumerDispatcherState) { if (tc.isEntryEnabled()) SibTr.entry(tc, "setConsumerDispatcherStateFilter", consumerDispatcherState); this._consumerDispatcherState = consumerDispatcherState; this._subscriptionId = null; this._destination = null; if (tc.isEntryEnabled()) SibTr.exit(tc, "setConsumerDispatcherStateFilter"); }
java
public void setConsumerDispatcherStateFilter(ConsumerDispatcherState consumerDispatcherState) { if (tc.isEntryEnabled()) SibTr.entry(tc, "setConsumerDispatcherStateFilter", consumerDispatcherState); this._consumerDispatcherState = consumerDispatcherState; this._subscriptionId = null; this._destination = null; if (tc.isEntryEnabled()) SibTr.exit(tc, "setConsumerDispatcherStateFilter"); }
[ "public", "void", "setConsumerDispatcherStateFilter", "(", "ConsumerDispatcherState", "consumerDispatcherState", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"setConsumerDispatcherStateFilter\"", ",", "consumerDispatcherState", ")", ";", "this", ".", "_consumerDispatcherState", "=", "consumerDispatcherState", ";", "this", ".", "_subscriptionId", "=", "null", ";", "this", ".", "_destination", "=", "null", ";", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"setConsumerDispatcherStateFilter\"", ")", ";", "}" ]
setter to create a filter based on a specific consumer dispatcher state object @param consumerDispatcherState
[ "setter", "to", "create", "a", "filter", "based", "on", "a", "specific", "consumer", "dispatcher", "state", "object" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/filters/SubscriptionStateFilter.java#L102-L113
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/filters/SubscriptionStateFilter.java
SubscriptionStateFilter.filterMatches
public boolean filterMatches(AbstractItem item) { if (tc.isEntryEnabled()) SibTr.entry(tc, "filterMatches", item); /* Cast the incoming item to a subscriptionState object. if it is not, an * exception will be thrown and the match will fail */ ConsumerDispatcherState subState = null; if (item instanceof DurableSubscriptionItemStream) { try { subState = ((DurableSubscriptionItemStream) item).getConsumerDispatcherState(); } catch (Exception e) { FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.store.filters.SubscriptionStateFilter.filterMatches", "1:180:1.33.1.1", this); SibTr.exception(tc, e); if (tc.isEntryEnabled()) SibTr.exit(tc, "filterMatches", e); return false; } /* If this filter is a subscriptionId filter, check for a match */ if (_subscriptionId != null) { boolean retval = (subState.getSubscriberID().equals(_subscriptionId)); if (tc.isEntryEnabled()) SibTr.exit(tc, "filterMatches", Boolean.valueOf(retval)); return retval; } /* If this filter is a destination name filter, check for a match */ if (_destination != null) { boolean retval = (subState.getTopicSpaceUuid().equals(_destination)); if (tc.isEntryEnabled()) SibTr.exit(tc, "filterMatches", Boolean.valueOf(retval)); return retval; } /* If this filter is for a specific consumer dispatcher state object, check for a match */ if (_consumerDispatcherState != null) { boolean retval = (subState == _consumerDispatcherState); if (tc.isEntryEnabled()) SibTr.exit(tc, "filterMatches", Boolean.valueOf(retval)); return retval; } //The match succeeds if its a durable subscription and no specific matching is requested if ((_destination == null) && (_subscriptionId == null) && (_consumerDispatcherState == null)) { if (tc.isEntryEnabled()) SibTr.exit(tc, "filterMatches", Boolean.TRUE); return true; } } /* If filter type has not been set, the match fails */ if (tc.isEntryEnabled()) SibTr.exit(tc, "filterMatches", Boolean.FALSE); return false; }
java
public boolean filterMatches(AbstractItem item) { if (tc.isEntryEnabled()) SibTr.entry(tc, "filterMatches", item); /* Cast the incoming item to a subscriptionState object. if it is not, an * exception will be thrown and the match will fail */ ConsumerDispatcherState subState = null; if (item instanceof DurableSubscriptionItemStream) { try { subState = ((DurableSubscriptionItemStream) item).getConsumerDispatcherState(); } catch (Exception e) { FFDCFilter.processException( e, "com.ibm.ws.sib.processor.impl.store.filters.SubscriptionStateFilter.filterMatches", "1:180:1.33.1.1", this); SibTr.exception(tc, e); if (tc.isEntryEnabled()) SibTr.exit(tc, "filterMatches", e); return false; } /* If this filter is a subscriptionId filter, check for a match */ if (_subscriptionId != null) { boolean retval = (subState.getSubscriberID().equals(_subscriptionId)); if (tc.isEntryEnabled()) SibTr.exit(tc, "filterMatches", Boolean.valueOf(retval)); return retval; } /* If this filter is a destination name filter, check for a match */ if (_destination != null) { boolean retval = (subState.getTopicSpaceUuid().equals(_destination)); if (tc.isEntryEnabled()) SibTr.exit(tc, "filterMatches", Boolean.valueOf(retval)); return retval; } /* If this filter is for a specific consumer dispatcher state object, check for a match */ if (_consumerDispatcherState != null) { boolean retval = (subState == _consumerDispatcherState); if (tc.isEntryEnabled()) SibTr.exit(tc, "filterMatches", Boolean.valueOf(retval)); return retval; } //The match succeeds if its a durable subscription and no specific matching is requested if ((_destination == null) && (_subscriptionId == null) && (_consumerDispatcherState == null)) { if (tc.isEntryEnabled()) SibTr.exit(tc, "filterMatches", Boolean.TRUE); return true; } } /* If filter type has not been set, the match fails */ if (tc.isEntryEnabled()) SibTr.exit(tc, "filterMatches", Boolean.FALSE); return false; }
[ "public", "boolean", "filterMatches", "(", "AbstractItem", "item", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"filterMatches\"", ",", "item", ")", ";", "/* Cast the incoming item to a subscriptionState object. if it is not, an\n\t\t * exception will be thrown and the match will fail */", "ConsumerDispatcherState", "subState", "=", "null", ";", "if", "(", "item", "instanceof", "DurableSubscriptionItemStream", ")", "{", "try", "{", "subState", "=", "(", "(", "DurableSubscriptionItemStream", ")", "item", ")", ".", "getConsumerDispatcherState", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "FFDCFilter", ".", "processException", "(", "e", ",", "\"com.ibm.ws.sib.processor.impl.store.filters.SubscriptionStateFilter.filterMatches\"", ",", "\"1:180:1.33.1.1\"", ",", "this", ")", ";", "SibTr", ".", "exception", "(", "tc", ",", "e", ")", ";", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"filterMatches\"", ",", "e", ")", ";", "return", "false", ";", "}", "/* If this filter is a subscriptionId filter, check for a match */", "if", "(", "_subscriptionId", "!=", "null", ")", "{", "boolean", "retval", "=", "(", "subState", ".", "getSubscriberID", "(", ")", ".", "equals", "(", "_subscriptionId", ")", ")", ";", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"filterMatches\"", ",", "Boolean", ".", "valueOf", "(", "retval", ")", ")", ";", "return", "retval", ";", "}", "/* If this filter is a destination name filter, check for a match */", "if", "(", "_destination", "!=", "null", ")", "{", "boolean", "retval", "=", "(", "subState", ".", "getTopicSpaceUuid", "(", ")", ".", "equals", "(", "_destination", ")", ")", ";", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"filterMatches\"", ",", "Boolean", ".", "valueOf", "(", "retval", ")", ")", ";", "return", "retval", ";", "}", "/* If this filter is for a specific consumer dispatcher state object, check for a match */", "if", "(", "_consumerDispatcherState", "!=", "null", ")", "{", "boolean", "retval", "=", "(", "subState", "==", "_consumerDispatcherState", ")", ";", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"filterMatches\"", ",", "Boolean", ".", "valueOf", "(", "retval", ")", ")", ";", "return", "retval", ";", "}", "//The match succeeds if its a durable subscription and no specific matching is requested", "if", "(", "(", "_destination", "==", "null", ")", "&&", "(", "_subscriptionId", "==", "null", ")", "&&", "(", "_consumerDispatcherState", "==", "null", ")", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"filterMatches\"", ",", "Boolean", ".", "TRUE", ")", ";", "return", "true", ";", "}", "}", "/* If filter type has not been set, the match fails */", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"filterMatches\"", ",", "Boolean", ".", "FALSE", ")", ";", "return", "false", ";", "}" ]
Callback method from messagestore @param item to test for match
[ "Callback", "method", "from", "messagestore" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/store/filters/SubscriptionStateFilter.java#L121-L198
train
OpenLiberty/open-liberty
dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/internal/LibertyVersion.java
LibertyVersion.matchesToMicros
public boolean matchesToMicros(LibertyVersion other) { if (other == null) { return true; } return this.major == other.major && this.minor == other.minor && this.micro == other.micro; }
java
public boolean matchesToMicros(LibertyVersion other) { if (other == null) { return true; } return this.major == other.major && this.minor == other.minor && this.micro == other.micro; }
[ "public", "boolean", "matchesToMicros", "(", "LibertyVersion", "other", ")", "{", "if", "(", "other", "==", "null", ")", "{", "return", "true", ";", "}", "return", "this", ".", "major", "==", "other", ".", "major", "&&", "this", ".", "minor", "==", "other", ".", "minor", "&&", "this", ".", "micro", "==", "other", ".", "micro", ";", "}" ]
Matches the major, minor and micro parts of this version to the other version @param other The other version, can be <code>null</code> in which case this returns true. @return
[ "Matches", "the", "major", "minor", "and", "micro", "parts", "of", "this", "version", "to", "the", "other", "version" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/internal/LibertyVersion.java#L82-L87
train
OpenLiberty/open-liberty
dev/com.ibm.ws.org.apache.cxf.cxf.rt.frontend.jaxrs.3.2/src/com/ibm/ws/jaxrs20/metadata/ProviderResourceInfo.java
ProviderResourceInfo.putCustomizedProperty
public void putCustomizedProperty(String key, Object obj) { if (key == null || obj == null) return; customizedProperties.put(key, obj); }
java
public void putCustomizedProperty(String key, Object obj) { if (key == null || obj == null) return; customizedProperties.put(key, obj); }
[ "public", "void", "putCustomizedProperty", "(", "String", "key", ",", "Object", "obj", ")", "{", "if", "(", "key", "==", "null", "||", "obj", "==", "null", ")", "return", ";", "customizedProperties", ".", "put", "(", "key", ",", "obj", ")", ";", "}" ]
put anything here, such as J2EEName @param key @param obj
[ "put", "anything", "here", "such", "as", "J2EEName" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.org.apache.cxf.cxf.rt.frontend.jaxrs.3.2/src/com/ibm/ws/jaxrs20/metadata/ProviderResourceInfo.java#L117-L122
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/PartialMatch.java
PartialMatch.newPartialMatch
PartialMatch newPartialMatch(char[] key, PartialMatch pm) { if (tc.isEntryEnabled()) tc.entry(this,cclass, "newPartialMatch", "key: "+new String(key)+", pm:"+pm); PartialMatch ans = new PartialMatch(key, pm, owner); if (tc.isEntryEnabled()) tc.exit(this,cclass, "newPartialMatch", ans); return ans; }
java
PartialMatch newPartialMatch(char[] key, PartialMatch pm) { if (tc.isEntryEnabled()) tc.entry(this,cclass, "newPartialMatch", "key: "+new String(key)+", pm:"+pm); PartialMatch ans = new PartialMatch(key, pm, owner); if (tc.isEntryEnabled()) tc.exit(this,cclass, "newPartialMatch", ans); return ans; }
[ "PartialMatch", "newPartialMatch", "(", "char", "[", "]", "key", ",", "PartialMatch", "pm", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "tc", ".", "entry", "(", "this", ",", "cclass", ",", "\"newPartialMatch\"", ",", "\"key: \"", "+", "new", "String", "(", "key", ")", "+", "\", pm:\"", "+", "pm", ")", ";", "PartialMatch", "ans", "=", "new", "PartialMatch", "(", "key", ",", "pm", ",", "owner", ")", ";", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "tc", ".", "exit", "(", "this", ",", "cclass", ",", "\"newPartialMatch\"", ",", "ans", ")", ";", "return", "ans", ";", "}" ]
An overrideable wrapper for the internal constructor
[ "An", "overrideable", "wrapper", "for", "the", "internal", "constructor" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/PartialMatch.java#L163-L170
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/PartialMatch.java
PartialMatch.put
void put(PatternWrapper pattern, Conjunction selector, MatchTarget object, InternTable subExpr) throws MatchingException { if (tc.isEntryEnabled()) tc.entry(this,cclass, "put", new Object[]{pattern,selector,object,subExpr}); switch (pattern.getState()) { case PatternWrapper.FINAL_EXACT: exactChild = owner.nextMatcher(selector, exactChild); exactChild.put(selector, object, subExpr); break; case PatternWrapper.FINAL_MANY: if(hasMidClauses(pattern)) { // We have multiple multi-level wildcarding and need to work with the // matchManyChildren list ContentMatcher next = null; MatchManyWrapper wrapper= findMatchManyWrapper(pattern); if(wrapper != null) next = wrapper.matcher; ContentMatcher newNext = owner.nextMatcher(selector, next); if (newNext != next) { if (matchManyChildren == null) matchManyChildren = new ArrayList(3); // 3 is somewhat arbitrary MatchManyWrapper matchManyElement = new MatchManyWrapper(pattern, newNext); matchManyChildren.add(matchManyElement); } newNext.put(selector, object, subExpr); } else { // Simpler case where there is a single multi-level wildcard singleMatchManyChild = owner.nextMatcher(selector, singleMatchManyChild); singleMatchManyChild.put(selector, object, subExpr); } break; case PatternWrapper.PREFIX_CHARS: case PatternWrapper.SUFFIX_CHARS: PartialMatch pm = findOrCreate(pattern.getChars()); pm.put(pattern, selector, object, subExpr); break; case PatternWrapper.SKIP_ONE_PREFIX: case PatternWrapper.SKIP_ONE_SUFFIX: if (matchOneChild == null) matchOneChild = newPartialMatch(); pattern.advance(); matchOneChild.put(pattern, selector, object, subExpr); break; case PatternWrapper.SWITCH_TO_SUFFIX: if (suffix == null) suffix = newPartialMatch(); pattern.advance(); suffix.put(pattern, selector, object, subExpr); break; } if (tc.isEntryEnabled()) tc.exit(this,cclass, "put"); }
java
void put(PatternWrapper pattern, Conjunction selector, MatchTarget object, InternTable subExpr) throws MatchingException { if (tc.isEntryEnabled()) tc.entry(this,cclass, "put", new Object[]{pattern,selector,object,subExpr}); switch (pattern.getState()) { case PatternWrapper.FINAL_EXACT: exactChild = owner.nextMatcher(selector, exactChild); exactChild.put(selector, object, subExpr); break; case PatternWrapper.FINAL_MANY: if(hasMidClauses(pattern)) { // We have multiple multi-level wildcarding and need to work with the // matchManyChildren list ContentMatcher next = null; MatchManyWrapper wrapper= findMatchManyWrapper(pattern); if(wrapper != null) next = wrapper.matcher; ContentMatcher newNext = owner.nextMatcher(selector, next); if (newNext != next) { if (matchManyChildren == null) matchManyChildren = new ArrayList(3); // 3 is somewhat arbitrary MatchManyWrapper matchManyElement = new MatchManyWrapper(pattern, newNext); matchManyChildren.add(matchManyElement); } newNext.put(selector, object, subExpr); } else { // Simpler case where there is a single multi-level wildcard singleMatchManyChild = owner.nextMatcher(selector, singleMatchManyChild); singleMatchManyChild.put(selector, object, subExpr); } break; case PatternWrapper.PREFIX_CHARS: case PatternWrapper.SUFFIX_CHARS: PartialMatch pm = findOrCreate(pattern.getChars()); pm.put(pattern, selector, object, subExpr); break; case PatternWrapper.SKIP_ONE_PREFIX: case PatternWrapper.SKIP_ONE_SUFFIX: if (matchOneChild == null) matchOneChild = newPartialMatch(); pattern.advance(); matchOneChild.put(pattern, selector, object, subExpr); break; case PatternWrapper.SWITCH_TO_SUFFIX: if (suffix == null) suffix = newPartialMatch(); pattern.advance(); suffix.put(pattern, selector, object, subExpr); break; } if (tc.isEntryEnabled()) tc.exit(this,cclass, "put"); }
[ "void", "put", "(", "PatternWrapper", "pattern", ",", "Conjunction", "selector", ",", "MatchTarget", "object", ",", "InternTable", "subExpr", ")", "throws", "MatchingException", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "tc", ".", "entry", "(", "this", ",", "cclass", ",", "\"put\"", ",", "new", "Object", "[", "]", "{", "pattern", ",", "selector", ",", "object", ",", "subExpr", "}", ")", ";", "switch", "(", "pattern", ".", "getState", "(", ")", ")", "{", "case", "PatternWrapper", ".", "FINAL_EXACT", ":", "exactChild", "=", "owner", ".", "nextMatcher", "(", "selector", ",", "exactChild", ")", ";", "exactChild", ".", "put", "(", "selector", ",", "object", ",", "subExpr", ")", ";", "break", ";", "case", "PatternWrapper", ".", "FINAL_MANY", ":", "if", "(", "hasMidClauses", "(", "pattern", ")", ")", "{", "// We have multiple multi-level wildcarding and need to work with the", "// matchManyChildren list", "ContentMatcher", "next", "=", "null", ";", "MatchManyWrapper", "wrapper", "=", "findMatchManyWrapper", "(", "pattern", ")", ";", "if", "(", "wrapper", "!=", "null", ")", "next", "=", "wrapper", ".", "matcher", ";", "ContentMatcher", "newNext", "=", "owner", ".", "nextMatcher", "(", "selector", ",", "next", ")", ";", "if", "(", "newNext", "!=", "next", ")", "{", "if", "(", "matchManyChildren", "==", "null", ")", "matchManyChildren", "=", "new", "ArrayList", "(", "3", ")", ";", "// 3 is somewhat arbitrary", "MatchManyWrapper", "matchManyElement", "=", "new", "MatchManyWrapper", "(", "pattern", ",", "newNext", ")", ";", "matchManyChildren", ".", "add", "(", "matchManyElement", ")", ";", "}", "newNext", ".", "put", "(", "selector", ",", "object", ",", "subExpr", ")", ";", "}", "else", "{", "// Simpler case where there is a single multi-level wildcard", "singleMatchManyChild", "=", "owner", ".", "nextMatcher", "(", "selector", ",", "singleMatchManyChild", ")", ";", "singleMatchManyChild", ".", "put", "(", "selector", ",", "object", ",", "subExpr", ")", ";", "}", "break", ";", "case", "PatternWrapper", ".", "PREFIX_CHARS", ":", "case", "PatternWrapper", ".", "SUFFIX_CHARS", ":", "PartialMatch", "pm", "=", "findOrCreate", "(", "pattern", ".", "getChars", "(", ")", ")", ";", "pm", ".", "put", "(", "pattern", ",", "selector", ",", "object", ",", "subExpr", ")", ";", "break", ";", "case", "PatternWrapper", ".", "SKIP_ONE_PREFIX", ":", "case", "PatternWrapper", ".", "SKIP_ONE_SUFFIX", ":", "if", "(", "matchOneChild", "==", "null", ")", "matchOneChild", "=", "newPartialMatch", "(", ")", ";", "pattern", ".", "advance", "(", ")", ";", "matchOneChild", ".", "put", "(", "pattern", ",", "selector", ",", "object", ",", "subExpr", ")", ";", "break", ";", "case", "PatternWrapper", ".", "SWITCH_TO_SUFFIX", ":", "if", "(", "suffix", "==", "null", ")", "suffix", "=", "newPartialMatch", "(", ")", ";", "pattern", ".", "advance", "(", ")", ";", "suffix", ".", "put", "(", "pattern", ",", "selector", ",", "object", ",", "subExpr", ")", ";", "break", ";", "}", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "tc", ".", "exit", "(", "this", ",", "cclass", ",", "\"put\"", ")", ";", "}" ]
Put a new Pattern or part thereof into this PartialMatch or its down-chain peers @param pattern the pattern being considered, wrapped in a PatternWrapper @param selector the Conjunction from the original ContentMatcher.put @param object the MatchTarget from the original ContentMatcher.put @param subExpr the InternTable from the original ContentMatcher.put
[ "Put", "a", "new", "Pattern", "or", "part", "thereof", "into", "this", "PartialMatch", "or", "its", "down", "-", "chain", "peers" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/PartialMatch.java#L256-L313
train