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
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
OpenLiberty/open-liberty
dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/jdbc/WSJdbcPreparedStatement.java
WSJdbcPreparedStatement.executeBatch
private Object executeBatch(Object implObject, Method method, Object[] args) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, SQLException { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "executeBatch", new Object[] { this, args[0] }); if (childWrapper != null) { closeAndRemoveResultSet(); } if (childWrappers != null && !childWrappers.isEmpty()) { closeAndRemoveResultSets(); } enforceStatementProperties(); Object results = method.invoke(implObject, args); if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "executeBatch", results instanceof int[] ? Arrays.toString((int[]) results) : results); return results; }
java
private Object executeBatch(Object implObject, Method method, Object[] args) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, SQLException { final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); if (isTraceOn && tc.isEntryEnabled()) Tr.entry(tc, "executeBatch", new Object[] { this, args[0] }); if (childWrapper != null) { closeAndRemoveResultSet(); } if (childWrappers != null && !childWrappers.isEmpty()) { closeAndRemoveResultSets(); } enforceStatementProperties(); Object results = method.invoke(implObject, args); if (isTraceOn && tc.isEntryEnabled()) Tr.exit(tc, "executeBatch", results instanceof int[] ? Arrays.toString((int[]) results) : results); return results; }
[ "private", "Object", "executeBatch", "(", "Object", "implObject", ",", "Method", "method", ",", "Object", "[", "]", "args", ")", "throws", "IllegalAccessException", ",", "IllegalArgumentException", ",", "InvocationTargetException", ",", "SQLException", "{", "final", "boolean", "isTraceOn", "=", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", ";", "if", "(", "isTraceOn", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"executeBatch\"", ",", "new", "Object", "[", "]", "{", "this", ",", "args", "[", "0", "]", "}", ")", ";", "if", "(", "childWrapper", "!=", "null", ")", "{", "closeAndRemoveResultSet", "(", ")", ";", "}", "if", "(", "childWrappers", "!=", "null", "&&", "!", "childWrappers", ".", "isEmpty", "(", ")", ")", "{", "closeAndRemoveResultSets", "(", ")", ";", "}", "enforceStatementProperties", "(", ")", ";", "Object", "results", "=", "method", ".", "invoke", "(", "implObject", ",", "args", ")", ";", "if", "(", "isTraceOn", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "tc", ",", "\"executeBatch\"", ",", "results", "instanceof", "int", "[", "]", "?", "Arrays", ".", "toString", "(", "(", "int", "[", "]", ")", "results", ")", ":", "results", ")", ";", "return", "results", ";", "}" ]
Invokes executeBatch and after closing any previous result sets and ensuring statement properties are up-to-date. @param implObject the instance on which the operation is invoked. @param method the method that is invoked. @param args the parameters to the method. @throws IllegalAccessException if the method is inaccessible. @throws IllegalArgumentException if the instance does not have the method or if the method arguments are not appropriate. @throws InvocationTargetException if the method raises a checked exception. @throws SQLException if unable to invoke the method for other reasons. @return the result of invoking the method.
[ "Invokes", "executeBatch", "and", "after", "closing", "any", "previous", "result", "sets", "and", "ensuring", "statement", "properties", "are", "up", "-", "to", "-", "date", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/jdbc/WSJdbcPreparedStatement.java#L430-L453
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/jdbc/WSJdbcPreparedStatement.java
WSJdbcPreparedStatement.getReturnResultSet
private Object getReturnResultSet(Object implObject, Method method) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, SQLException { final boolean trace = TraceComponent.isAnyTracingEnabled(); if (trace && tc.isEntryEnabled()) Tr.entry(tc, "getReturnResultSet", this); WSJdbcResultSet rsetWrapper = null; ResultSet rsetImpl = (ResultSet) method.invoke(implObject); if (rsetImpl != null) { // If the childWrapper is null, and the childWrappers is null or // empty, set the result set to childWrapper; // Otherwise, add the result set to childWrappers if (childWrapper == null && (childWrappers == null || childWrappers.isEmpty())) { childWrapper = rsetWrapper = mcf.jdbcRuntime.newResultSet(rsetImpl, this); if (trace && tc.isDebugEnabled()) Tr.debug(tc, "Set the result set to child wrapper"); } else { if (childWrappers == null) childWrappers = new ArrayList<Wrapper>(5); rsetWrapper = mcf.jdbcRuntime.newResultSet(rsetImpl, this); childWrappers.add(rsetWrapper); if (trace && tc.isDebugEnabled()) Tr.debug(tc, "Add the result set to child wrappers list."); } } if (trace && tc.isEntryEnabled()) Tr.exit(tc, "getReturnResultSet", rsetWrapper); return rsetWrapper; }
java
private Object getReturnResultSet(Object implObject, Method method) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, SQLException { final boolean trace = TraceComponent.isAnyTracingEnabled(); if (trace && tc.isEntryEnabled()) Tr.entry(tc, "getReturnResultSet", this); WSJdbcResultSet rsetWrapper = null; ResultSet rsetImpl = (ResultSet) method.invoke(implObject); if (rsetImpl != null) { // If the childWrapper is null, and the childWrappers is null or // empty, set the result set to childWrapper; // Otherwise, add the result set to childWrappers if (childWrapper == null && (childWrappers == null || childWrappers.isEmpty())) { childWrapper = rsetWrapper = mcf.jdbcRuntime.newResultSet(rsetImpl, this); if (trace && tc.isDebugEnabled()) Tr.debug(tc, "Set the result set to child wrapper"); } else { if (childWrappers == null) childWrappers = new ArrayList<Wrapper>(5); rsetWrapper = mcf.jdbcRuntime.newResultSet(rsetImpl, this); childWrappers.add(rsetWrapper); if (trace && tc.isDebugEnabled()) Tr.debug(tc, "Add the result set to child wrappers list."); } } if (trace && tc.isEntryEnabled()) Tr.exit(tc, "getReturnResultSet", rsetWrapper); return rsetWrapper; }
[ "private", "Object", "getReturnResultSet", "(", "Object", "implObject", ",", "Method", "method", ")", "throws", "IllegalAccessException", ",", "IllegalArgumentException", ",", "InvocationTargetException", ",", "SQLException", "{", "final", "boolean", "trace", "=", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", ";", "if", "(", "trace", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"getReturnResultSet\"", ",", "this", ")", ";", "WSJdbcResultSet", "rsetWrapper", "=", "null", ";", "ResultSet", "rsetImpl", "=", "(", "ResultSet", ")", "method", ".", "invoke", "(", "implObject", ")", ";", "if", "(", "rsetImpl", "!=", "null", ")", "{", "// If the childWrapper is null, and the childWrappers is null or ", "// empty, set the result set to childWrapper;", "// Otherwise, add the result set to childWrappers", "if", "(", "childWrapper", "==", "null", "&&", "(", "childWrappers", "==", "null", "||", "childWrappers", ".", "isEmpty", "(", ")", ")", ")", "{", "childWrapper", "=", "rsetWrapper", "=", "mcf", ".", "jdbcRuntime", ".", "newResultSet", "(", "rsetImpl", ",", "this", ")", ";", "if", "(", "trace", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"Set the result set to child wrapper\"", ")", ";", "}", "else", "{", "if", "(", "childWrappers", "==", "null", ")", "childWrappers", "=", "new", "ArrayList", "<", "Wrapper", ">", "(", "5", ")", ";", "rsetWrapper", "=", "mcf", ".", "jdbcRuntime", ".", "newResultSet", "(", "rsetImpl", ",", "this", ")", ";", "childWrappers", ".", "add", "(", "rsetWrapper", ")", ";", "if", "(", "trace", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "tc", ",", "\"Add the result set to child wrappers list.\"", ")", ";", "}", "}", "if", "(", "trace", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "tc", ",", "\"getReturnResultSet\"", ",", "rsetWrapper", ")", ";", "return", "rsetWrapper", ";", "}" ]
Invokes getReturnResultSet and wraps the result set. @param implObject the instance on which the operation is invoked. @param method the method that is invoked. @throws IllegalAccessException if the method is inaccessible. @throws IllegalArgumentException if the instance does not have the method or if the method arguments are not appropriate. @throws InvocationTargetException if the method raises a checked exception. @throws SQLException if unable to invoke the method for other reasons. @return the result of invoking the method.
[ "Invokes", "getReturnResultSet", "and", "wraps", "the", "result", "set", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/jdbc/WSJdbcPreparedStatement.java#L589-L619
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/jdbc/WSJdbcPreparedStatement.java
WSJdbcPreparedStatement.invoke
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if (!haveStatementPropertiesChanged && VENDOR_PROPERTY_SETTERS.contains(method.getName())) { haveStatementPropertiesChanged = true; } // The SQLJ programming model indicates that getSection should be callable on a // closed PreparedStatement. Therefore we manually cache the section and return it if(sqljSection != null && "getSection".equals(method.getName())) { return sqljSection; } return super.invoke(proxy, method, args); }
java
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if (!haveStatementPropertiesChanged && VENDOR_PROPERTY_SETTERS.contains(method.getName())) { haveStatementPropertiesChanged = true; } // The SQLJ programming model indicates that getSection should be callable on a // closed PreparedStatement. Therefore we manually cache the section and return it if(sqljSection != null && "getSection".equals(method.getName())) { return sqljSection; } return super.invoke(proxy, method, args); }
[ "public", "Object", "invoke", "(", "Object", "proxy", ",", "Method", "method", ",", "Object", "[", "]", "args", ")", "throws", "Throwable", "{", "if", "(", "!", "haveStatementPropertiesChanged", "&&", "VENDOR_PROPERTY_SETTERS", ".", "contains", "(", "method", ".", "getName", "(", ")", ")", ")", "{", "haveStatementPropertiesChanged", "=", "true", ";", "}", "// The SQLJ programming model indicates that getSection should be callable on a", "// closed PreparedStatement. Therefore we manually cache the section and return it", "if", "(", "sqljSection", "!=", "null", "&&", "\"getSection\"", ".", "equals", "(", "method", ".", "getName", "(", ")", ")", ")", "{", "return", "sqljSection", ";", "}", "return", "super", ".", "invoke", "(", "proxy", ",", "method", ",", "args", ")", ";", "}" ]
Intercept the proxy handler to detect changes to statement properties that must be reset on cached statements. @param proxy the dynamic proxy. @param method the method being invoked. @param args the parameters to the method. @return the result of invoking the operation on the underlying object. @throws Throwable if something goes wrong.
[ "Intercept", "the", "proxy", "handler", "to", "detect", "changes", "to", "statement", "properties", "that", "must", "be", "reset", "on", "cached", "statements", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/jdbc/WSJdbcPreparedStatement.java#L709-L721
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/persistence/objectManager/UniqueKeyGeneratorImpl.java
UniqueKeyGeneratorImpl.nextRangeMaximumAvailable
public void nextRangeMaximumAvailable() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "nextRangeMaximumAvailable"); synchronized (_globalUniqueLock) { _globalUniqueThreshold = _globalUniqueLimit + _midrange; _globalUniqueLimit = _globalUniqueLimit + _range; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "nextRangeMaximumAvailable"); }
java
public void nextRangeMaximumAvailable() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "nextRangeMaximumAvailable"); synchronized (_globalUniqueLock) { _globalUniqueThreshold = _globalUniqueLimit + _midrange; _globalUniqueLimit = _globalUniqueLimit + _range; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "nextRangeMaximumAvailable"); }
[ "public", "void", "nextRangeMaximumAvailable", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"nextRangeMaximumAvailable\"", ")", ";", "synchronized", "(", "_globalUniqueLock", ")", "{", "_globalUniqueThreshold", "=", "_globalUniqueLimit", "+", "_midrange", ";", "_globalUniqueLimit", "=", "_globalUniqueLimit", "+", "_range", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"nextRangeMaximumAvailable\"", ")", ";", "}" ]
Callback to inform the generator that the current range of available unique keys has now grown.
[ "Callback", "to", "inform", "the", "generator", "that", "the", "current", "range", "of", "available", "unique", "keys", "has", "now", "grown", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/persistence/objectManager/UniqueKeyGeneratorImpl.java#L142-L153
train
OpenLiberty/open-liberty
dev/com.ibm.ws.ras.instrument/src/com/ibm/ws/ras/instrument/internal/main/DynamicTraceInstrumentation.java
Transformer.transform
public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException { // Don't modify our own package if (className.startsWith(Transformer.class.getPackage().getName().replaceAll("\\.", "/"))) { return null; } // Don't modify the java.util.logging classes if (className.startsWith("java/util/logging/")) { return null; } boolean include = false; for (String s : includesList) { if (className.startsWith(s) || s.equals("/")) { include = true; break; } } for (String s : excludesList) { if (className.startsWith(s) || s.equals("/")) { include = false; break; } } if (include == false) { return null; } String internalPackageName = className.replaceAll("/[^/]+$", ""); PackageInfo packageInfo = getPackageInfo(internalPackageName); if (packageInfo == null && loader != null) { String packageInfoResourceName = internalPackageName + "/package-info.class"; InputStream is = loader.getResourceAsStream(packageInfoResourceName); packageInfo = processPackageInfo(is); addPackageInfo(packageInfo); } try { return transform(new ByteArrayInputStream(classfileBuffer)); } catch (Throwable t) { t.printStackTrace(); return null; } }
java
public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws IllegalClassFormatException { // Don't modify our own package if (className.startsWith(Transformer.class.getPackage().getName().replaceAll("\\.", "/"))) { return null; } // Don't modify the java.util.logging classes if (className.startsWith("java/util/logging/")) { return null; } boolean include = false; for (String s : includesList) { if (className.startsWith(s) || s.equals("/")) { include = true; break; } } for (String s : excludesList) { if (className.startsWith(s) || s.equals("/")) { include = false; break; } } if (include == false) { return null; } String internalPackageName = className.replaceAll("/[^/]+$", ""); PackageInfo packageInfo = getPackageInfo(internalPackageName); if (packageInfo == null && loader != null) { String packageInfoResourceName = internalPackageName + "/package-info.class"; InputStream is = loader.getResourceAsStream(packageInfoResourceName); packageInfo = processPackageInfo(is); addPackageInfo(packageInfo); } try { return transform(new ByteArrayInputStream(classfileBuffer)); } catch (Throwable t) { t.printStackTrace(); return null; } }
[ "public", "byte", "[", "]", "transform", "(", "ClassLoader", "loader", ",", "String", "className", ",", "Class", "<", "?", ">", "classBeingRedefined", ",", "ProtectionDomain", "protectionDomain", ",", "byte", "[", "]", "classfileBuffer", ")", "throws", "IllegalClassFormatException", "{", "// Don't modify our own package", "if", "(", "className", ".", "startsWith", "(", "Transformer", ".", "class", ".", "getPackage", "(", ")", ".", "getName", "(", ")", ".", "replaceAll", "(", "\"\\\\.\"", ",", "\"/\"", ")", ")", ")", "{", "return", "null", ";", "}", "// Don't modify the java.util.logging classes", "if", "(", "className", ".", "startsWith", "(", "\"java/util/logging/\"", ")", ")", "{", "return", "null", ";", "}", "boolean", "include", "=", "false", ";", "for", "(", "String", "s", ":", "includesList", ")", "{", "if", "(", "className", ".", "startsWith", "(", "s", ")", "||", "s", ".", "equals", "(", "\"/\"", ")", ")", "{", "include", "=", "true", ";", "break", ";", "}", "}", "for", "(", "String", "s", ":", "excludesList", ")", "{", "if", "(", "className", ".", "startsWith", "(", "s", ")", "||", "s", ".", "equals", "(", "\"/\"", ")", ")", "{", "include", "=", "false", ";", "break", ";", "}", "}", "if", "(", "include", "==", "false", ")", "{", "return", "null", ";", "}", "String", "internalPackageName", "=", "className", ".", "replaceAll", "(", "\"/[^/]+$\"", ",", "\"\"", ")", ";", "PackageInfo", "packageInfo", "=", "getPackageInfo", "(", "internalPackageName", ")", ";", "if", "(", "packageInfo", "==", "null", "&&", "loader", "!=", "null", ")", "{", "String", "packageInfoResourceName", "=", "internalPackageName", "+", "\"/package-info.class\"", ";", "InputStream", "is", "=", "loader", ".", "getResourceAsStream", "(", "packageInfoResourceName", ")", ";", "packageInfo", "=", "processPackageInfo", "(", "is", ")", ";", "addPackageInfo", "(", "packageInfo", ")", ";", "}", "try", "{", "return", "transform", "(", "new", "ByteArrayInputStream", "(", "classfileBuffer", ")", ")", ";", "}", "catch", "(", "Throwable", "t", ")", "{", "t", ".", "printStackTrace", "(", ")", ";", "return", "null", ";", "}", "}" ]
Instrument the classes.
[ "Instrument", "the", "classes", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ras.instrument/src/com/ibm/ws/ras/instrument/internal/main/DynamicTraceInstrumentation.java#L154-L204
train
OpenLiberty/open-liberty
dev/com.ibm.ws.config/src/com/ibm/ws/config/xml/internal/EvaluationContext.java
EvaluationContext.resolveString
public String resolveString(String value, boolean ignoreWarnings) throws ConfigEvaluatorException { value = variableEvaluator.resolveVariables(value, this, ignoreWarnings); return value; }
java
public String resolveString(String value, boolean ignoreWarnings) throws ConfigEvaluatorException { value = variableEvaluator.resolveVariables(value, this, ignoreWarnings); return value; }
[ "public", "String", "resolveString", "(", "String", "value", ",", "boolean", "ignoreWarnings", ")", "throws", "ConfigEvaluatorException", "{", "value", "=", "variableEvaluator", ".", "resolveVariables", "(", "value", ",", "this", ",", "ignoreWarnings", ")", ";", "return", "value", ";", "}" ]
Tries to resolve variables. @throws ConfigEvaluatorException
[ "Tries", "to", "resolve", "variables", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.config/src/com/ibm/ws/config/xml/internal/EvaluationContext.java#L231-L234
train
OpenLiberty/open-liberty
dev/com.ibm.ws.webcontainer/src/com/ibm/websphere/servlet/filter/ChainerServlet.java
ChainerServlet.init
@SuppressWarnings("unchecked") public void init() throws ServletException { // Method re-written for PQ47469 String servlets = getRequiredInitParameter(PARAM_SERVLET_PATHS); StringTokenizer sTokenizer = new StringTokenizer(servlets); Vector servletChainPath = new Vector(); while (sTokenizer.hasMoreTokens() == true) { String path = sTokenizer.nextToken().trim(); if (path.length() > 0) { servletChainPath.addElement(path); } } int chainLength = servletChainPath.size(); if (chainLength > 0) { this.chainPath = new String[chainLength]; for (int index = 0; index < chainLength; ++index) { this.chainPath[index] = (String)servletChainPath.elementAt(index); } } }
java
@SuppressWarnings("unchecked") public void init() throws ServletException { // Method re-written for PQ47469 String servlets = getRequiredInitParameter(PARAM_SERVLET_PATHS); StringTokenizer sTokenizer = new StringTokenizer(servlets); Vector servletChainPath = new Vector(); while (sTokenizer.hasMoreTokens() == true) { String path = sTokenizer.nextToken().trim(); if (path.length() > 0) { servletChainPath.addElement(path); } } int chainLength = servletChainPath.size(); if (chainLength > 0) { this.chainPath = new String[chainLength]; for (int index = 0; index < chainLength; ++index) { this.chainPath[index] = (String)servletChainPath.elementAt(index); } } }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "void", "init", "(", ")", "throws", "ServletException", "{", "// Method re-written for PQ47469", "String", "servlets", "=", "getRequiredInitParameter", "(", "PARAM_SERVLET_PATHS", ")", ";", "StringTokenizer", "sTokenizer", "=", "new", "StringTokenizer", "(", "servlets", ")", ";", "Vector", "servletChainPath", "=", "new", "Vector", "(", ")", ";", "while", "(", "sTokenizer", ".", "hasMoreTokens", "(", ")", "==", "true", ")", "{", "String", "path", "=", "sTokenizer", ".", "nextToken", "(", ")", ".", "trim", "(", ")", ";", "if", "(", "path", ".", "length", "(", ")", ">", "0", ")", "{", "servletChainPath", ".", "addElement", "(", "path", ")", ";", "}", "}", "int", "chainLength", "=", "servletChainPath", ".", "size", "(", ")", ";", "if", "(", "chainLength", ">", "0", ")", "{", "this", ".", "chainPath", "=", "new", "String", "[", "chainLength", "]", ";", "for", "(", "int", "index", "=", "0", ";", "index", "<", "chainLength", ";", "++", "index", ")", "{", "this", ".", "chainPath", "[", "index", "]", "=", "(", "String", ")", "servletChainPath", ".", "elementAt", "(", "index", ")", ";", "}", "}", "}" ]
Initialize the servlet chainer.
[ "Initialize", "the", "servlet", "chainer", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/websphere/servlet/filter/ChainerServlet.java#L89-L114
train
OpenLiberty/open-liberty
dev/com.ibm.ws.webcontainer/src/com/ibm/websphere/servlet/filter/ChainerServlet.java
ChainerServlet.service
public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // Method re-written for PQ47469 ServletChain chain = new ServletChain(); try { String path = null; for (int index = 0; index < this.chainPath.length; ++index) { path = this.chainPath[index]; RequestDispatcher rDispatcher = getServletContext().getRequestDispatcher(path); chain.addRequestDispatcher(rDispatcher); } chain.forward(new HttpServletRequestWrapper(request), new HttpServletResponseWrapper(response)); } finally { if (chain != null) { chain.clear(); } } }
java
public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // Method re-written for PQ47469 ServletChain chain = new ServletChain(); try { String path = null; for (int index = 0; index < this.chainPath.length; ++index) { path = this.chainPath[index]; RequestDispatcher rDispatcher = getServletContext().getRequestDispatcher(path); chain.addRequestDispatcher(rDispatcher); } chain.forward(new HttpServletRequestWrapper(request), new HttpServletResponseWrapper(response)); } finally { if (chain != null) { chain.clear(); } } }
[ "public", "void", "service", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ")", "throws", "ServletException", ",", "IOException", "{", "// Method re-written for PQ47469", "ServletChain", "chain", "=", "new", "ServletChain", "(", ")", ";", "try", "{", "String", "path", "=", "null", ";", "for", "(", "int", "index", "=", "0", ";", "index", "<", "this", ".", "chainPath", ".", "length", ";", "++", "index", ")", "{", "path", "=", "this", ".", "chainPath", "[", "index", "]", ";", "RequestDispatcher", "rDispatcher", "=", "getServletContext", "(", ")", ".", "getRequestDispatcher", "(", "path", ")", ";", "chain", ".", "addRequestDispatcher", "(", "rDispatcher", ")", ";", "}", "chain", ".", "forward", "(", "new", "HttpServletRequestWrapper", "(", "request", ")", ",", "new", "HttpServletResponseWrapper", "(", "response", ")", ")", ";", "}", "finally", "{", "if", "(", "chain", "!=", "null", ")", "{", "chain", ".", "clear", "(", ")", ";", "}", "}", "}" ]
Handle a servlet request by chaining the configured list of servlets. Only the final response in the chain will be sent back to the client. This servlet does not actual generate any content. This servlet only constructs and processes the servlet chain. @param req HttpServletRequest @param resp HttpServletResponse @exception javax.servlet.ServletException @exception java.io.IOException
[ "Handle", "a", "servlet", "request", "by", "chaining", "the", "configured", "list", "of", "servlets", ".", "Only", "the", "final", "response", "in", "the", "chain", "will", "be", "sent", "back", "to", "the", "client", ".", "This", "servlet", "does", "not", "actual", "generate", "any", "content", ".", "This", "servlet", "only", "constructs", "and", "processes", "the", "servlet", "chain", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/websphere/servlet/filter/ChainerServlet.java#L127-L146
train
OpenLiberty/open-liberty
dev/com.ibm.ws.webcontainer/src/com/ibm/websphere/servlet/filter/ChainerServlet.java
ChainerServlet.getRequiredInitParameter
String getRequiredInitParameter(String name) throws ServletException { String value = getInitParameter(name); if (value == null) { throw new ServletException(MessageFormat.format(nls.getString("Missing.required.initialization.parameter","Missing required initialization parameter: {0}"), new Object[]{name})); } return value; }
java
String getRequiredInitParameter(String name) throws ServletException { String value = getInitParameter(name); if (value == null) { throw new ServletException(MessageFormat.format(nls.getString("Missing.required.initialization.parameter","Missing required initialization parameter: {0}"), new Object[]{name})); } return value; }
[ "String", "getRequiredInitParameter", "(", "String", "name", ")", "throws", "ServletException", "{", "String", "value", "=", "getInitParameter", "(", "name", ")", ";", "if", "(", "value", "==", "null", ")", "{", "throw", "new", "ServletException", "(", "MessageFormat", ".", "format", "(", "nls", ".", "getString", "(", "\"Missing.required.initialization.parameter\"", ",", "\"Missing required initialization parameter: {0}\"", ")", ",", "new", "Object", "[", "]", "{", "name", "}", ")", ")", ";", "}", "return", "value", ";", "}" ]
Retrieve a required init parameter by name. @exception javax.servlet.ServletException thrown if the required parameter is not present.
[ "Retrieve", "a", "required", "init", "parameter", "by", "name", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/websphere/servlet/filter/ChainerServlet.java#L153-L160
train
OpenLiberty/open-liberty
dev/com.ibm.ws.classloading/src/com/ibm/ws/classloading/java2sec/PermissionManager.java
PermissionManager.initializePermissions
private void initializePermissions() { // Set the default restrictable permissions int count = 0; if (tc.isDebugEnabled()) { if (isServer) { Tr.debug(tc, "running on server "); } else { Tr.debug(tc, "running on client "); } } if (isServer) { count = DEFAULT_SERVER_RESTRICTABLE_PERMISSIONS.length; originationFile = SERVER_XML; } else { count = DEFAULT_CLIENT_RESTRICTABLE_PERMISSIONS.length; originationFile = CLIENT_XML; } for (int i = 0; i < count; i++) { if (isServer) { restrictablePermissions.add(DEFAULT_SERVER_RESTRICTABLE_PERMISSIONS[i]); } else { restrictablePermissions.add(DEFAULT_CLIENT_RESTRICTABLE_PERMISSIONS[i]); } } // Iterate through the configured Permissions. if (permissions != null && !permissions.isEmpty()) { Iterable<JavaPermissionsConfiguration> javaPermissions = permissions.services(); if (javaPermissions != null) { for (JavaPermissionsConfiguration permission : javaPermissions) { String permissionClass = String.valueOf(permission.get(JavaPermissionsConfiguration.PERMISSION)); String target = String.valueOf(permission.get(JavaPermissionsConfiguration.TARGET_NAME)); String action = String.valueOf(permission.get(JavaPermissionsConfiguration.ACTIONS)); String credential = String.valueOf(permission.get(JavaPermissionsConfiguration.SIGNED_BY)); String principalType = String.valueOf(permission.get(JavaPermissionsConfiguration.PRINCIPAL_TYPE)); String principalName = String.valueOf(permission.get(JavaPermissionsConfiguration.PRINCIPAL_NAME)); String codebase = normalize(String.valueOf(permission.get(JavaPermissionsConfiguration.CODE_BASE))); // Create the permission object Permission perm = createPermissionObject(permissionClass, target, action, credential, principalType, principalName, originationFile); boolean isRestriction = false; // Is this a restriciton or a grant? if (permission.get(JavaPermissionsConfiguration.RESTRICTION) != null) { isRestriction = ((Boolean) permission.get(JavaPermissionsConfiguration.RESTRICTION)).booleanValue(); } if (isRestriction) { // If this is a restriction if (perm != null) { restrictablePermissions.add(perm); } } else { // If this is not a restriction, then set is a grant if (perm != null) { // if codebase is present, then set the permission on the shared lib classloader if (codebase != null && !codebase.equalsIgnoreCase("null")) { setCodeBasePermission(codebase, perm); } else { grantedPermissions.add(perm); } } } } if (tc.isDebugEnabled()) { Tr.debug(tc, "restrictablePermissions : " + restrictablePermissions); Tr.debug(tc, "grantedPermissions : " + grantedPermissions); } } } setSharedLibraryPermission(); }
java
private void initializePermissions() { // Set the default restrictable permissions int count = 0; if (tc.isDebugEnabled()) { if (isServer) { Tr.debug(tc, "running on server "); } else { Tr.debug(tc, "running on client "); } } if (isServer) { count = DEFAULT_SERVER_RESTRICTABLE_PERMISSIONS.length; originationFile = SERVER_XML; } else { count = DEFAULT_CLIENT_RESTRICTABLE_PERMISSIONS.length; originationFile = CLIENT_XML; } for (int i = 0; i < count; i++) { if (isServer) { restrictablePermissions.add(DEFAULT_SERVER_RESTRICTABLE_PERMISSIONS[i]); } else { restrictablePermissions.add(DEFAULT_CLIENT_RESTRICTABLE_PERMISSIONS[i]); } } // Iterate through the configured Permissions. if (permissions != null && !permissions.isEmpty()) { Iterable<JavaPermissionsConfiguration> javaPermissions = permissions.services(); if (javaPermissions != null) { for (JavaPermissionsConfiguration permission : javaPermissions) { String permissionClass = String.valueOf(permission.get(JavaPermissionsConfiguration.PERMISSION)); String target = String.valueOf(permission.get(JavaPermissionsConfiguration.TARGET_NAME)); String action = String.valueOf(permission.get(JavaPermissionsConfiguration.ACTIONS)); String credential = String.valueOf(permission.get(JavaPermissionsConfiguration.SIGNED_BY)); String principalType = String.valueOf(permission.get(JavaPermissionsConfiguration.PRINCIPAL_TYPE)); String principalName = String.valueOf(permission.get(JavaPermissionsConfiguration.PRINCIPAL_NAME)); String codebase = normalize(String.valueOf(permission.get(JavaPermissionsConfiguration.CODE_BASE))); // Create the permission object Permission perm = createPermissionObject(permissionClass, target, action, credential, principalType, principalName, originationFile); boolean isRestriction = false; // Is this a restriciton or a grant? if (permission.get(JavaPermissionsConfiguration.RESTRICTION) != null) { isRestriction = ((Boolean) permission.get(JavaPermissionsConfiguration.RESTRICTION)).booleanValue(); } if (isRestriction) { // If this is a restriction if (perm != null) { restrictablePermissions.add(perm); } } else { // If this is not a restriction, then set is a grant if (perm != null) { // if codebase is present, then set the permission on the shared lib classloader if (codebase != null && !codebase.equalsIgnoreCase("null")) { setCodeBasePermission(codebase, perm); } else { grantedPermissions.add(perm); } } } } if (tc.isDebugEnabled()) { Tr.debug(tc, "restrictablePermissions : " + restrictablePermissions); Tr.debug(tc, "grantedPermissions : " + grantedPermissions); } } } setSharedLibraryPermission(); }
[ "private", "void", "initializePermissions", "(", ")", "{", "// Set the default restrictable permissions", "int", "count", "=", "0", ";", "if", "(", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "if", "(", "isServer", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"running on server \"", ")", ";", "}", "else", "{", "Tr", ".", "debug", "(", "tc", ",", "\"running on client \"", ")", ";", "}", "}", "if", "(", "isServer", ")", "{", "count", "=", "DEFAULT_SERVER_RESTRICTABLE_PERMISSIONS", ".", "length", ";", "originationFile", "=", "SERVER_XML", ";", "}", "else", "{", "count", "=", "DEFAULT_CLIENT_RESTRICTABLE_PERMISSIONS", ".", "length", ";", "originationFile", "=", "CLIENT_XML", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "count", ";", "i", "++", ")", "{", "if", "(", "isServer", ")", "{", "restrictablePermissions", ".", "add", "(", "DEFAULT_SERVER_RESTRICTABLE_PERMISSIONS", "[", "i", "]", ")", ";", "}", "else", "{", "restrictablePermissions", ".", "add", "(", "DEFAULT_CLIENT_RESTRICTABLE_PERMISSIONS", "[", "i", "]", ")", ";", "}", "}", "// Iterate through the configured Permissions.", "if", "(", "permissions", "!=", "null", "&&", "!", "permissions", ".", "isEmpty", "(", ")", ")", "{", "Iterable", "<", "JavaPermissionsConfiguration", ">", "javaPermissions", "=", "permissions", ".", "services", "(", ")", ";", "if", "(", "javaPermissions", "!=", "null", ")", "{", "for", "(", "JavaPermissionsConfiguration", "permission", ":", "javaPermissions", ")", "{", "String", "permissionClass", "=", "String", ".", "valueOf", "(", "permission", ".", "get", "(", "JavaPermissionsConfiguration", ".", "PERMISSION", ")", ")", ";", "String", "target", "=", "String", ".", "valueOf", "(", "permission", ".", "get", "(", "JavaPermissionsConfiguration", ".", "TARGET_NAME", ")", ")", ";", "String", "action", "=", "String", ".", "valueOf", "(", "permission", ".", "get", "(", "JavaPermissionsConfiguration", ".", "ACTIONS", ")", ")", ";", "String", "credential", "=", "String", ".", "valueOf", "(", "permission", ".", "get", "(", "JavaPermissionsConfiguration", ".", "SIGNED_BY", ")", ")", ";", "String", "principalType", "=", "String", ".", "valueOf", "(", "permission", ".", "get", "(", "JavaPermissionsConfiguration", ".", "PRINCIPAL_TYPE", ")", ")", ";", "String", "principalName", "=", "String", ".", "valueOf", "(", "permission", ".", "get", "(", "JavaPermissionsConfiguration", ".", "PRINCIPAL_NAME", ")", ")", ";", "String", "codebase", "=", "normalize", "(", "String", ".", "valueOf", "(", "permission", ".", "get", "(", "JavaPermissionsConfiguration", ".", "CODE_BASE", ")", ")", ")", ";", "// Create the permission object", "Permission", "perm", "=", "createPermissionObject", "(", "permissionClass", ",", "target", ",", "action", ",", "credential", ",", "principalType", ",", "principalName", ",", "originationFile", ")", ";", "boolean", "isRestriction", "=", "false", ";", "// Is this a restriciton or a grant?", "if", "(", "permission", ".", "get", "(", "JavaPermissionsConfiguration", ".", "RESTRICTION", ")", "!=", "null", ")", "{", "isRestriction", "=", "(", "(", "Boolean", ")", "permission", ".", "get", "(", "JavaPermissionsConfiguration", ".", "RESTRICTION", ")", ")", ".", "booleanValue", "(", ")", ";", "}", "if", "(", "isRestriction", ")", "{", "// If this is a restriction", "if", "(", "perm", "!=", "null", ")", "{", "restrictablePermissions", ".", "add", "(", "perm", ")", ";", "}", "}", "else", "{", "// If this is not a restriction, then set is a grant", "if", "(", "perm", "!=", "null", ")", "{", "// if codebase is present, then set the permission on the shared lib classloader", "if", "(", "codebase", "!=", "null", "&&", "!", "codebase", ".", "equalsIgnoreCase", "(", "\"null\"", ")", ")", "{", "setCodeBasePermission", "(", "codebase", ",", "perm", ")", ";", "}", "else", "{", "grantedPermissions", ".", "add", "(", "perm", ")", ";", "}", "}", "}", "}", "if", "(", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"restrictablePermissions : \"", "+", "restrictablePermissions", ")", ";", "Tr", ".", "debug", "(", "tc", ",", "\"grantedPermissions : \"", "+", "grantedPermissions", ")", ";", "}", "}", "}", "setSharedLibraryPermission", "(", ")", ";", "}" ]
InvocationTargetException.class, NoSuchMethodException.class, SecurityException.class})
[ "InvocationTargetException", ".", "class", "NoSuchMethodException", ".", "class", "SecurityException", ".", "class", "}", ")" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.classloading/src/com/ibm/ws/classloading/java2sec/PermissionManager.java#L211-L286
train
OpenLiberty/open-liberty
dev/com.ibm.ws.classloading/src/com/ibm/ws/classloading/java2sec/PermissionManager.java
PermissionManager.getCombinedPermissions
@Override public PermissionCollection getCombinedPermissions(PermissionCollection staticPolicyPermissionCollection, CodeSource codesource) { Permissions effectivePermissions = new Permissions(); List<Permission> staticPolicyPermissions = Collections.list(staticPolicyPermissionCollection.elements()); String codeBase = codesource.getLocation().getPath(); // TODO: This should be using the CodeSource itself to compare with existing code sources ArrayList<Permission> permissions = getEffectivePermissions(staticPolicyPermissions, codeBase); for (Permission permission : permissions) { effectivePermissions.add(permission); } return effectivePermissions; }
java
@Override public PermissionCollection getCombinedPermissions(PermissionCollection staticPolicyPermissionCollection, CodeSource codesource) { Permissions effectivePermissions = new Permissions(); List<Permission> staticPolicyPermissions = Collections.list(staticPolicyPermissionCollection.elements()); String codeBase = codesource.getLocation().getPath(); // TODO: This should be using the CodeSource itself to compare with existing code sources ArrayList<Permission> permissions = getEffectivePermissions(staticPolicyPermissions, codeBase); for (Permission permission : permissions) { effectivePermissions.add(permission); } return effectivePermissions; }
[ "@", "Override", "public", "PermissionCollection", "getCombinedPermissions", "(", "PermissionCollection", "staticPolicyPermissionCollection", ",", "CodeSource", "codesource", ")", "{", "Permissions", "effectivePermissions", "=", "new", "Permissions", "(", ")", ";", "List", "<", "Permission", ">", "staticPolicyPermissions", "=", "Collections", ".", "list", "(", "staticPolicyPermissionCollection", ".", "elements", "(", ")", ")", ";", "String", "codeBase", "=", "codesource", ".", "getLocation", "(", ")", ".", "getPath", "(", ")", ";", "// TODO: This should be using the CodeSource itself to compare with existing code sources", "ArrayList", "<", "Permission", ">", "permissions", "=", "getEffectivePermissions", "(", "staticPolicyPermissions", ",", "codeBase", ")", ";", "for", "(", "Permission", "permission", ":", "permissions", ")", "{", "effectivePermissions", ".", "add", "(", "permission", ")", ";", "}", "return", "effectivePermissions", ";", "}" ]
Combine the static permissions with the server.xml and permissions.xml permissions, removing any restricted permission. This is called back from the dynamic policy to obtain the permissions for the JSP classes.
[ "Combine", "the", "static", "permissions", "with", "the", "server", ".", "xml", "and", "permissions", ".", "xml", "permissions", "removing", "any", "restricted", "permission", ".", "This", "is", "called", "back", "from", "the", "dynamic", "policy", "to", "obtain", "the", "permissions", "for", "the", "JSP", "classes", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.classloading/src/com/ibm/ws/classloading/java2sec/PermissionManager.java#L573-L585
train
OpenLiberty/open-liberty
dev/com.ibm.ws.classloading/src/com/ibm/ws/classloading/java2sec/PermissionManager.java
PermissionManager.isRestricted
private boolean isRestricted(Permission permission) { for (Permission restrictedPermission : restrictablePermissions) { if (restrictedPermission.implies(permission)) { return true; } } return false; }
java
private boolean isRestricted(Permission permission) { for (Permission restrictedPermission : restrictablePermissions) { if (restrictedPermission.implies(permission)) { return true; } } return false; }
[ "private", "boolean", "isRestricted", "(", "Permission", "permission", ")", "{", "for", "(", "Permission", "restrictedPermission", ":", "restrictablePermissions", ")", "{", "if", "(", "restrictedPermission", ".", "implies", "(", "permission", ")", ")", "{", "return", "true", ";", "}", "}", "return", "false", ";", "}" ]
Check if this is a restricted permission. @param permission @return <code>true</code> if the permission is restricted
[ "Check", "if", "this", "is", "a", "restricted", "permission", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.classloading/src/com/ibm/ws/classloading/java2sec/PermissionManager.java#L593-L600
train
OpenLiberty/open-liberty
dev/com.ibm.ws.classloading/src/com/ibm/ws/classloading/java2sec/PermissionManager.java
PermissionManager.addPermissionsXMLPermission
public void addPermissionsXMLPermission(CodeSource codeSource, Permission permission) { ArrayList<Permission> permissions = null; String codeBase = codeSource.getLocation().getPath(); if (!isRestricted(permission)) { if (permissionXMLPermissionMap.containsKey(codeBase)) { permissions = permissionXMLPermissionMap.get(codeBase); permissions.add(permission); } else { permissions = new ArrayList<Permission>(); permissions.add(permission); permissionXMLPermissionMap.put(codeBase, permissions); } } }
java
public void addPermissionsXMLPermission(CodeSource codeSource, Permission permission) { ArrayList<Permission> permissions = null; String codeBase = codeSource.getLocation().getPath(); if (!isRestricted(permission)) { if (permissionXMLPermissionMap.containsKey(codeBase)) { permissions = permissionXMLPermissionMap.get(codeBase); permissions.add(permission); } else { permissions = new ArrayList<Permission>(); permissions.add(permission); permissionXMLPermissionMap.put(codeBase, permissions); } } }
[ "public", "void", "addPermissionsXMLPermission", "(", "CodeSource", "codeSource", ",", "Permission", "permission", ")", "{", "ArrayList", "<", "Permission", ">", "permissions", "=", "null", ";", "String", "codeBase", "=", "codeSource", ".", "getLocation", "(", ")", ".", "getPath", "(", ")", ";", "if", "(", "!", "isRestricted", "(", "permission", ")", ")", "{", "if", "(", "permissionXMLPermissionMap", ".", "containsKey", "(", "codeBase", ")", ")", "{", "permissions", "=", "permissionXMLPermissionMap", ".", "get", "(", "codeBase", ")", ";", "permissions", ".", "add", "(", "permission", ")", ";", "}", "else", "{", "permissions", "=", "new", "ArrayList", "<", "Permission", ">", "(", ")", ";", "permissions", ".", "add", "(", "permission", ")", ";", "permissionXMLPermissionMap", ".", "put", "(", "codeBase", ",", "permissions", ")", ";", "}", "}", "}" ]
Adds a permission from the permissions.xml file for the given CodeSource. @param codeSource - The CodeSource of the code the specified permission was granted to. @param permissions - The permissions granted in the permissions.xml of the application. @return the effective granted permissions
[ "Adds", "a", "permission", "from", "the", "permissions", ".", "xml", "file", "for", "the", "given", "CodeSource", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.classloading/src/com/ibm/ws/classloading/java2sec/PermissionManager.java#L618-L632
train
OpenLiberty/open-liberty
dev/com.ibm.ws.anno/src/com/ibm/ws/anno/info/internal/DelayedClassInfo.java
DelayedClassInfo.getClassInfo
public NonDelayedClassInfo getClassInfo() { String useName = getName(); NonDelayedClassInfo useClassInfo = this.classInfo; if (useClassInfo != null) { if (!useClassInfo.isJavaClass() && !(useClassInfo.isAnnotationPresent() || useClassInfo.isFieldAnnotationPresent() || useClassInfo.isMethodAnnotationPresent())) { getInfoStore().recordAccess(useClassInfo); } return useClassInfo; } useClassInfo = getInfoStore().resolveClassInfo(useName); String[] useLogParms = getLogParms(); if (useLogParms != null) { useLogParms[EXTRA_DATA_OFFSET_0] = useName; } if (useClassInfo == null) { // defect 84235: If an error caused this, the warning was reported at a lower level. Since this is // going to be 'handled', we should not generate another warning message. //Tr.warning(tc, "ANNO_CLASSINFO_CLASS_NOTFOUND", getHashText(), useName); // CWWKC0025W if (useLogParms != null) { Tr.debug(tc, MessageFormat.format("[ {0} ] - Class not found [ {1} ]", (Object[]) useLogParms)); } useClassInfo = new NonDelayedClassInfo(useName, getInfoStore()); this.isArtificial = true; // START: TFB: Defect 59284: More required updates: // // The newly created class info was not properly added as a class info, // leading to an NPE in the cache list management (in ClassInfoCache.makeFirst). getInfoStore().getClassInfoCache().addClassInfo(useClassInfo); // END: TFB: Defect 59284: More required updates: } // START: TFB: Defect 59284: Don't throw an exception for a failed load. // // Tracing enablement for defect 59284 showed an error of the sequence // of assigning the result class info hash text into the logging parameters. // // Prior to the assignment steps, 'this.classInfo' is null. // // A NullPointerException results, respective only of trace enablement // and irrespective of the d59284 changes. // // Move the logging code to after the 'this.classInfo' assignment. // if (useLogParms != null) { // useLogParms[EXTRA_DATA_OFFSET_1] = this.classInfo.getHashText(); // } useClassInfo.setDelayedClassInfo(this); this.classInfo = useClassInfo; if (useLogParms != null) { useLogParms[EXTRA_DATA_OFFSET_1] = this.classInfo.getHashText(); // D59284 if (this.isArtificial) { Tr.debug(tc, MessageFormat.format("[ {0} ] RETURN [ {1} ] as [ {2} ] ** ARTFICIAL **", (Object[]) useLogParms)); } else { Tr.debug(tc, MessageFormat.format("[ {0} ] RETURN [ {1} ] as [ {2} ] ", (Object[]) useLogParms)); } } // END: TFB: Defect 59284: Don't throw an exception for a failed load. return useClassInfo; }
java
public NonDelayedClassInfo getClassInfo() { String useName = getName(); NonDelayedClassInfo useClassInfo = this.classInfo; if (useClassInfo != null) { if (!useClassInfo.isJavaClass() && !(useClassInfo.isAnnotationPresent() || useClassInfo.isFieldAnnotationPresent() || useClassInfo.isMethodAnnotationPresent())) { getInfoStore().recordAccess(useClassInfo); } return useClassInfo; } useClassInfo = getInfoStore().resolveClassInfo(useName); String[] useLogParms = getLogParms(); if (useLogParms != null) { useLogParms[EXTRA_DATA_OFFSET_0] = useName; } if (useClassInfo == null) { // defect 84235: If an error caused this, the warning was reported at a lower level. Since this is // going to be 'handled', we should not generate another warning message. //Tr.warning(tc, "ANNO_CLASSINFO_CLASS_NOTFOUND", getHashText(), useName); // CWWKC0025W if (useLogParms != null) { Tr.debug(tc, MessageFormat.format("[ {0} ] - Class not found [ {1} ]", (Object[]) useLogParms)); } useClassInfo = new NonDelayedClassInfo(useName, getInfoStore()); this.isArtificial = true; // START: TFB: Defect 59284: More required updates: // // The newly created class info was not properly added as a class info, // leading to an NPE in the cache list management (in ClassInfoCache.makeFirst). getInfoStore().getClassInfoCache().addClassInfo(useClassInfo); // END: TFB: Defect 59284: More required updates: } // START: TFB: Defect 59284: Don't throw an exception for a failed load. // // Tracing enablement for defect 59284 showed an error of the sequence // of assigning the result class info hash text into the logging parameters. // // Prior to the assignment steps, 'this.classInfo' is null. // // A NullPointerException results, respective only of trace enablement // and irrespective of the d59284 changes. // // Move the logging code to after the 'this.classInfo' assignment. // if (useLogParms != null) { // useLogParms[EXTRA_DATA_OFFSET_1] = this.classInfo.getHashText(); // } useClassInfo.setDelayedClassInfo(this); this.classInfo = useClassInfo; if (useLogParms != null) { useLogParms[EXTRA_DATA_OFFSET_1] = this.classInfo.getHashText(); // D59284 if (this.isArtificial) { Tr.debug(tc, MessageFormat.format("[ {0} ] RETURN [ {1} ] as [ {2} ] ** ARTFICIAL **", (Object[]) useLogParms)); } else { Tr.debug(tc, MessageFormat.format("[ {0} ] RETURN [ {1} ] as [ {2} ] ", (Object[]) useLogParms)); } } // END: TFB: Defect 59284: Don't throw an exception for a failed load. return useClassInfo; }
[ "public", "NonDelayedClassInfo", "getClassInfo", "(", ")", "{", "String", "useName", "=", "getName", "(", ")", ";", "NonDelayedClassInfo", "useClassInfo", "=", "this", ".", "classInfo", ";", "if", "(", "useClassInfo", "!=", "null", ")", "{", "if", "(", "!", "useClassInfo", ".", "isJavaClass", "(", ")", "&&", "!", "(", "useClassInfo", ".", "isAnnotationPresent", "(", ")", "||", "useClassInfo", ".", "isFieldAnnotationPresent", "(", ")", "||", "useClassInfo", ".", "isMethodAnnotationPresent", "(", ")", ")", ")", "{", "getInfoStore", "(", ")", ".", "recordAccess", "(", "useClassInfo", ")", ";", "}", "return", "useClassInfo", ";", "}", "useClassInfo", "=", "getInfoStore", "(", ")", ".", "resolveClassInfo", "(", "useName", ")", ";", "String", "[", "]", "useLogParms", "=", "getLogParms", "(", ")", ";", "if", "(", "useLogParms", "!=", "null", ")", "{", "useLogParms", "[", "EXTRA_DATA_OFFSET_0", "]", "=", "useName", ";", "}", "if", "(", "useClassInfo", "==", "null", ")", "{", "// defect 84235: If an error caused this, the warning was reported at a lower level. Since this is ", "// going to be 'handled', we should not generate another warning message.", "//Tr.warning(tc, \"ANNO_CLASSINFO_CLASS_NOTFOUND\", getHashText(), useName); // CWWKC0025W", "if", "(", "useLogParms", "!=", "null", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "MessageFormat", ".", "format", "(", "\"[ {0} ] - Class not found [ {1} ]\"", ",", "(", "Object", "[", "]", ")", "useLogParms", ")", ")", ";", "}", "useClassInfo", "=", "new", "NonDelayedClassInfo", "(", "useName", ",", "getInfoStore", "(", ")", ")", ";", "this", ".", "isArtificial", "=", "true", ";", "// START: TFB: Defect 59284: More required updates:", "//", "// The newly created class info was not properly added as a class info,", "// leading to an NPE in the cache list management (in ClassInfoCache.makeFirst).", "getInfoStore", "(", ")", ".", "getClassInfoCache", "(", ")", ".", "addClassInfo", "(", "useClassInfo", ")", ";", "// END: TFB: Defect 59284: More required updates:", "}", "// START: TFB: Defect 59284: Don't throw an exception for a failed load.", "//", "// Tracing enablement for defect 59284 showed an error of the sequence", "// of assigning the result class info hash text into the logging parameters.", "//", "// Prior to the assignment steps, 'this.classInfo' is null.", "//", "// A NullPointerException results, respective only of trace enablement", "// and irrespective of the d59284 changes.", "//", "// Move the logging code to after the 'this.classInfo' assignment.", "// if (useLogParms != null) {", "// useLogParms[EXTRA_DATA_OFFSET_1] = this.classInfo.getHashText();", "// }", "useClassInfo", ".", "setDelayedClassInfo", "(", "this", ")", ";", "this", ".", "classInfo", "=", "useClassInfo", ";", "if", "(", "useLogParms", "!=", "null", ")", "{", "useLogParms", "[", "EXTRA_DATA_OFFSET_1", "]", "=", "this", ".", "classInfo", ".", "getHashText", "(", ")", ";", "// D59284", "if", "(", "this", ".", "isArtificial", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "MessageFormat", ".", "format", "(", "\"[ {0} ] RETURN [ {1} ] as [ {2} ] ** ARTFICIAL **\"", ",", "(", "Object", "[", "]", ")", "useLogParms", ")", ")", ";", "}", "else", "{", "Tr", ".", "debug", "(", "tc", ",", "MessageFormat", ".", "format", "(", "\"[ {0} ] RETURN [ {1} ] as [ {2} ] \"", ",", "(", "Object", "[", "]", ")", "useLogParms", ")", ")", ";", "}", "}", "// END: TFB: Defect 59284: Don't throw an exception for a failed load.", "return", "useClassInfo", ";", "}" ]
Assignments to the extra data of the log parms may not be held across other method calls.
[ "Assignments", "to", "the", "extra", "data", "of", "the", "log", "parms", "may", "not", "be", "held", "across", "other", "method", "calls", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.anno/src/com/ibm/ws/anno/info/internal/DelayedClassInfo.java#L113-L194
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java
Neighbour.intialiseNonPersistent
protected void intialiseNonPersistent(MultiMEProxyHandler proxyHandler, Neighbours neighbours) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "intialiseNonPersistent"); iProxyHandler = proxyHandler; iNeighbours = neighbours; iDestinationManager = iProxyHandler.getMessageProcessor().getDestinationManager(); iRemoteQueue = SIMPUtils.createJsSystemDestinationAddress( SIMPConstants.PROXY_SYSTEM_DESTINATION_PREFIX, iMEUuid, iBusId); if (iMEUuid == null) iMEUuid = iRemoteQueue.getME(); iProxies = new Hashtable(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "intialiseNonPersistent"); }
java
protected void intialiseNonPersistent(MultiMEProxyHandler proxyHandler, Neighbours neighbours) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "intialiseNonPersistent"); iProxyHandler = proxyHandler; iNeighbours = neighbours; iDestinationManager = iProxyHandler.getMessageProcessor().getDestinationManager(); iRemoteQueue = SIMPUtils.createJsSystemDestinationAddress( SIMPConstants.PROXY_SYSTEM_DESTINATION_PREFIX, iMEUuid, iBusId); if (iMEUuid == null) iMEUuid = iRemoteQueue.getME(); iProxies = new Hashtable(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "intialiseNonPersistent"); }
[ "protected", "void", "intialiseNonPersistent", "(", "MultiMEProxyHandler", "proxyHandler", ",", "Neighbours", "neighbours", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"intialiseNonPersistent\"", ")", ";", "iProxyHandler", "=", "proxyHandler", ";", "iNeighbours", "=", "neighbours", ";", "iDestinationManager", "=", "iProxyHandler", ".", "getMessageProcessor", "(", ")", ".", "getDestinationManager", "(", ")", ";", "iRemoteQueue", "=", "SIMPUtils", ".", "createJsSystemDestinationAddress", "(", "SIMPConstants", ".", "PROXY_SYSTEM_DESTINATION_PREFIX", ",", "iMEUuid", ",", "iBusId", ")", ";", "if", "(", "iMEUuid", "==", "null", ")", "iMEUuid", "=", "iRemoteQueue", ".", "getME", "(", ")", ";", "iProxies", "=", "new", "Hashtable", "(", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"intialiseNonPersistent\"", ")", ";", "}" ]
Setup the non persistent state. @param proxyHandler The proxy handler instance. @param neighbours The neighbours instance
[ "Setup", "the", "non", "persistent", "state", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java#L186-L205
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java
Neighbour.getUUID
public final SIBUuid8 getUUID() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, "getUUID"); SibTr.exit(tc, "getUUID", iMEUuid); } return iMEUuid; }
java
public final SIBUuid8 getUUID() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, "getUUID"); SibTr.exit(tc, "getUUID", iMEUuid); } return iMEUuid; }
[ "public", "final", "SIBUuid8", "getUUID", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "entry", "(", "tc", ",", "\"getUUID\"", ")", ";", "SibTr", ".", "exit", "(", "tc", ",", "\"getUUID\"", ",", "iMEUuid", ")", ";", "}", "return", "iMEUuid", ";", "}" ]
Gets the UUID for this Neighbour @return SIBUuid
[ "Gets", "the", "UUID", "for", "this", "Neighbour" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java#L211-L219
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java
Neighbour.getBusId
public final String getBusId() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, "getBusId"); SibTr.exit(tc, "getBusId", iBusId); } return iBusId; }
java
public final String getBusId() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, "getBusId"); SibTr.exit(tc, "getBusId", iBusId); } return iBusId; }
[ "public", "final", "String", "getBusId", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "entry", "(", "tc", ",", "\"getBusId\"", ")", ";", "SibTr", ".", "exit", "(", "tc", ",", "\"getBusId\"", ",", "iBusId", ")", ";", "}", "return", "iBusId", ";", "}" ]
Get the Bus name for this Neighbour @return String The Bus of this Neighbour
[ "Get", "the", "Bus", "name", "for", "this", "Neighbour" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java#L226-L235
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java
Neighbour.getBus
BusGroup getBus() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, "getBus"); SibTr.exit(tc, "getBus", iBusGroup); } return iBusGroup; }
java
BusGroup getBus() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, "getBus"); SibTr.exit(tc, "getBus", iBusGroup); } return iBusGroup; }
[ "BusGroup", "getBus", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "entry", "(", "tc", ",", "\"getBus\"", ")", ";", "SibTr", ".", "exit", "(", "tc", ",", "\"getBus\"", ",", "iBusGroup", ")", ";", "}", "return", "iBusGroup", ";", "}" ]
Gets the Bus for this Neighbour @return BusGroup The Bus that this Neighbour belongs to
[ "Gets", "the", "Bus", "for", "this", "Neighbour" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java#L243-L252
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java
Neighbour.setBus
void setBus(BusGroup busGroup) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "setBus"); iBusGroup = busGroup; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "setBus"); }
java
void setBus(BusGroup busGroup) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "setBus"); iBusGroup = busGroup; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "setBus"); }
[ "void", "setBus", "(", "BusGroup", "busGroup", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"setBus\"", ")", ";", "iBusGroup", "=", "busGroup", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"setBus\"", ")", ";", "}" ]
Sets the Bus for this Neighbour @param BusGroup The group that this Neighbour belongs to
[ "Sets", "the", "Bus", "for", "this", "Neighbour" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java#L269-L278
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java
Neighbour.createProducerSession
private synchronized void createProducerSession() throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createProducerSession"); if (iProducerSession == null) { try { iProducerSession = (ProducerSessionImpl) iProxyHandler .getMessageProcessor() .getSystemConnection() .createSystemProducerSession(iRemoteQueue, null, null, null, null); } catch (SIException e) { // No exceptions should occur as the destination should always exists // as it is created at start time. FFDCFilter.processException( e, "com.ibm.ws.sib.processor.proxyhandler.Neighbour.createProducerSession", "1:434:1.107", this); SibTr.exception(tc, e); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createProducerSession", "SIResourceException"); // this is already NLS'd //175907 throw new SIResourceException(e); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createProducerSession"); }
java
private synchronized void createProducerSession() throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createProducerSession"); if (iProducerSession == null) { try { iProducerSession = (ProducerSessionImpl) iProxyHandler .getMessageProcessor() .getSystemConnection() .createSystemProducerSession(iRemoteQueue, null, null, null, null); } catch (SIException e) { // No exceptions should occur as the destination should always exists // as it is created at start time. FFDCFilter.processException( e, "com.ibm.ws.sib.processor.proxyhandler.Neighbour.createProducerSession", "1:434:1.107", this); SibTr.exception(tc, e); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createProducerSession", "SIResourceException"); // this is already NLS'd //175907 throw new SIResourceException(e); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createProducerSession"); }
[ "private", "synchronized", "void", "createProducerSession", "(", ")", "throws", "SIResourceException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"createProducerSession\"", ")", ";", "if", "(", "iProducerSession", "==", "null", ")", "{", "try", "{", "iProducerSession", "=", "(", "ProducerSessionImpl", ")", "iProxyHandler", ".", "getMessageProcessor", "(", ")", ".", "getSystemConnection", "(", ")", ".", "createSystemProducerSession", "(", "iRemoteQueue", ",", "null", ",", "null", ",", "null", ",", "null", ")", ";", "}", "catch", "(", "SIException", "e", ")", "{", "// No exceptions should occur as the destination should always exists", "// as it is created at start time.", "FFDCFilter", ".", "processException", "(", "e", ",", "\"com.ibm.ws.sib.processor.proxyhandler.Neighbour.createProducerSession\"", ",", "\"1:434:1.107\"", ",", "this", ")", ";", "SibTr", ".", "exception", "(", "tc", ",", "e", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"createProducerSession\"", ",", "\"SIResourceException\"", ")", ";", "// this is already NLS'd //175907", "throw", "new", "SIResourceException", "(", "e", ")", ";", "}", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"createProducerSession\"", ")", ";", "}" ]
Creates a producer session for sending the proxy messages to the Neighbours Opens the producer on the Neighbours remote Queue for sending to that Neighbour @exception SIResourceException Thrown if the producer can not be created.
[ "Creates", "a", "producer", "session", "for", "sending", "the", "proxy", "messages", "to", "the", "Neighbours" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java#L379-L420
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java
Neighbour.proxyRegistered
MESubscription proxyRegistered(SIBUuid12 topicSpaceUuid, String localTopicSpaceName, String topic, String foreignTSName, Transaction transaction, boolean foreignSecuredProxy, String MESubUserId) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "proxyRegistered", new Object[] { topicSpaceUuid, localTopicSpaceName, topic, foreignTSName, transaction, new Boolean(foreignSecuredProxy), MESubUserId}); // Generate a key for the topicSpace/topic final String key = BusGroup.subscriptionKey(topicSpaceUuid, topic); // Get the subscription from the Hashtable. MESubscription sub = (MESubscription) iProxies.get(key); if (sub != null) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Unmarking subscription " + sub); // unmark the subscription as it has been found sub.unmark(); // Check whether we need to update the recovered subscription boolean attrChanged = checkForeignSecurityAttributesChanged(sub, foreignSecuredProxy, MESubUserId); // If the attributes have changed then we need to persist the update if(attrChanged) { try { sub.requestUpdate(transaction); } catch (MessageStoreException e) { FFDCFilter.processException( e, "com.ibm.ws.sib.processor.proxyhandler.Neighbour.proxyRegistered", "1:522:1.107", this); SibTr.exception(tc, e); SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.proxyhandler.Neighbour", "1:529:1.107", e }); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "proxyRegistered", "SIResourceException"); throw new SIResourceException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.proxyhandler.Neighbour", "1:539:1.107", e }, null), e); } } // Set the subscription to null to indicate that this // is an old subscription sub = null; } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Subscription being created"); // Create a new MESubscription as one wasn't found sub = new MESubscription(topicSpaceUuid, localTopicSpaceName, topic, foreignTSName, foreignSecuredProxy, MESubUserId); // Add this subscription to the item Stream try { addItem(sub, transaction); } catch (MessageStoreException e) { FFDCFilter.processException( e, "com.ibm.ws.sib.processor.proxyhandler.Neighbour.proxyRegistered", "1:574:1.107", this); SibTr.exception(tc, e); SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.proxyhandler.Neighbour", "1:581:1.107", e }); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "proxyRegistered", "SIResourceException"); throw new SIResourceException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.proxyhandler.Neighbour", "1:591:1.107", e }, null), e); } // Put the subscription in the hashtable. iProxies.put(key, sub); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "proxyRegistered", sub); return sub; }
java
MESubscription proxyRegistered(SIBUuid12 topicSpaceUuid, String localTopicSpaceName, String topic, String foreignTSName, Transaction transaction, boolean foreignSecuredProxy, String MESubUserId) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "proxyRegistered", new Object[] { topicSpaceUuid, localTopicSpaceName, topic, foreignTSName, transaction, new Boolean(foreignSecuredProxy), MESubUserId}); // Generate a key for the topicSpace/topic final String key = BusGroup.subscriptionKey(topicSpaceUuid, topic); // Get the subscription from the Hashtable. MESubscription sub = (MESubscription) iProxies.get(key); if (sub != null) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Unmarking subscription " + sub); // unmark the subscription as it has been found sub.unmark(); // Check whether we need to update the recovered subscription boolean attrChanged = checkForeignSecurityAttributesChanged(sub, foreignSecuredProxy, MESubUserId); // If the attributes have changed then we need to persist the update if(attrChanged) { try { sub.requestUpdate(transaction); } catch (MessageStoreException e) { FFDCFilter.processException( e, "com.ibm.ws.sib.processor.proxyhandler.Neighbour.proxyRegistered", "1:522:1.107", this); SibTr.exception(tc, e); SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.proxyhandler.Neighbour", "1:529:1.107", e }); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "proxyRegistered", "SIResourceException"); throw new SIResourceException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.proxyhandler.Neighbour", "1:539:1.107", e }, null), e); } } // Set the subscription to null to indicate that this // is an old subscription sub = null; } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Subscription being created"); // Create a new MESubscription as one wasn't found sub = new MESubscription(topicSpaceUuid, localTopicSpaceName, topic, foreignTSName, foreignSecuredProxy, MESubUserId); // Add this subscription to the item Stream try { addItem(sub, transaction); } catch (MessageStoreException e) { FFDCFilter.processException( e, "com.ibm.ws.sib.processor.proxyhandler.Neighbour.proxyRegistered", "1:574:1.107", this); SibTr.exception(tc, e); SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.proxyhandler.Neighbour", "1:581:1.107", e }); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "proxyRegistered", "SIResourceException"); throw new SIResourceException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.proxyhandler.Neighbour", "1:591:1.107", e }, null), e); } // Put the subscription in the hashtable. iProxies.put(key, sub); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "proxyRegistered", sub); return sub; }
[ "MESubscription", "proxyRegistered", "(", "SIBUuid12", "topicSpaceUuid", ",", "String", "localTopicSpaceName", ",", "String", "topic", ",", "String", "foreignTSName", ",", "Transaction", "transaction", ",", "boolean", "foreignSecuredProxy", ",", "String", "MESubUserId", ")", "throws", "SIResourceException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"proxyRegistered\"", ",", "new", "Object", "[", "]", "{", "topicSpaceUuid", ",", "localTopicSpaceName", ",", "topic", ",", "foreignTSName", ",", "transaction", ",", "new", "Boolean", "(", "foreignSecuredProxy", ")", ",", "MESubUserId", "}", ")", ";", "// Generate a key for the topicSpace/topic", "final", "String", "key", "=", "BusGroup", ".", "subscriptionKey", "(", "topicSpaceUuid", ",", "topic", ")", ";", "// Get the subscription from the Hashtable.", "MESubscription", "sub", "=", "(", "MESubscription", ")", "iProxies", ".", "get", "(", "key", ")", ";", "if", "(", "sub", "!=", "null", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "tc", ",", "\"Unmarking subscription \"", "+", "sub", ")", ";", "// unmark the subscription as it has been found", "sub", ".", "unmark", "(", ")", ";", "// Check whether we need to update the recovered subscription", "boolean", "attrChanged", "=", "checkForeignSecurityAttributesChanged", "(", "sub", ",", "foreignSecuredProxy", ",", "MESubUserId", ")", ";", "// If the attributes have changed then we need to persist the update", "if", "(", "attrChanged", ")", "{", "try", "{", "sub", ".", "requestUpdate", "(", "transaction", ")", ";", "}", "catch", "(", "MessageStoreException", "e", ")", "{", "FFDCFilter", ".", "processException", "(", "e", ",", "\"com.ibm.ws.sib.processor.proxyhandler.Neighbour.proxyRegistered\"", ",", "\"1:522:1.107\"", ",", "this", ")", ";", "SibTr", ".", "exception", "(", "tc", ",", "e", ")", ";", "SibTr", ".", "error", "(", "tc", ",", "\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"", ",", "new", "Object", "[", "]", "{", "\"com.ibm.ws.sib.processor.proxyhandler.Neighbour\"", ",", "\"1:529:1.107\"", ",", "e", "}", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"proxyRegistered\"", ",", "\"SIResourceException\"", ")", ";", "throw", "new", "SIResourceException", "(", "nls", ".", "getFormattedMessage", "(", "\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"", ",", "new", "Object", "[", "]", "{", "\"com.ibm.ws.sib.processor.proxyhandler.Neighbour\"", ",", "\"1:539:1.107\"", ",", "e", "}", ",", "null", ")", ",", "e", ")", ";", "}", "}", "// Set the subscription to null to indicate that this", "// is an old subscription", "sub", "=", "null", ";", "}", "else", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "tc", ",", "\"Subscription being created\"", ")", ";", "// Create a new MESubscription as one wasn't found", "sub", "=", "new", "MESubscription", "(", "topicSpaceUuid", ",", "localTopicSpaceName", ",", "topic", ",", "foreignTSName", ",", "foreignSecuredProxy", ",", "MESubUserId", ")", ";", "// Add this subscription to the item Stream", "try", "{", "addItem", "(", "sub", ",", "transaction", ")", ";", "}", "catch", "(", "MessageStoreException", "e", ")", "{", "FFDCFilter", ".", "processException", "(", "e", ",", "\"com.ibm.ws.sib.processor.proxyhandler.Neighbour.proxyRegistered\"", ",", "\"1:574:1.107\"", ",", "this", ")", ";", "SibTr", ".", "exception", "(", "tc", ",", "e", ")", ";", "SibTr", ".", "error", "(", "tc", ",", "\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"", ",", "new", "Object", "[", "]", "{", "\"com.ibm.ws.sib.processor.proxyhandler.Neighbour\"", ",", "\"1:581:1.107\"", ",", "e", "}", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"proxyRegistered\"", ",", "\"SIResourceException\"", ")", ";", "throw", "new", "SIResourceException", "(", "nls", ".", "getFormattedMessage", "(", "\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"", ",", "new", "Object", "[", "]", "{", "\"com.ibm.ws.sib.processor.proxyhandler.Neighbour\"", ",", "\"1:591:1.107\"", ",", "e", "}", ",", "null", ")", ",", "e", ")", ";", "}", "// Put the subscription in the hashtable.", "iProxies", ".", "put", "(", "key", ",", "sub", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"proxyRegistered\"", ",", "sub", ")", ";", "return", "sub", ";", "}" ]
proxyRegistered is called on this Neighbour object when a proxy subscription is received from a Neighbour. A reference to that subscription is either created, or the reference to that subscription is unMarked @param topicSpace The topicSpace for the subscription. @param localTopicSpaceName The name for the topic space on this messaging engine. @param topic The topic for the proxy @param foreignTSName The foreign TS mapping @param transaction The transaction from which to create the proxy @param foreignSecuredProxy Flag to indicate whether a proxy sub originated from a foreign bus where the home bus is secured. @param MESubUserId Userid to be stored when securing foreign proxy subs @return An MESubscription if a new Subscription is created.
[ "proxyRegistered", "is", "called", "on", "this", "Neighbour", "object", "when", "a", "proxy", "subscription", "is", "received", "from", "a", "Neighbour", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java#L442-L575
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java
Neighbour.removeSubscription
protected void removeSubscription(SIBUuid12 topicSpace, String topic) { // Generate a key for the topicSpace/topic final String key = BusGroup.subscriptionKey(topicSpace, topic); iProxies.remove(key); }
java
protected void removeSubscription(SIBUuid12 topicSpace, String topic) { // Generate a key for the topicSpace/topic final String key = BusGroup.subscriptionKey(topicSpace, topic); iProxies.remove(key); }
[ "protected", "void", "removeSubscription", "(", "SIBUuid12", "topicSpace", ",", "String", "topic", ")", "{", "// Generate a key for the topicSpace/topic", "final", "String", "key", "=", "BusGroup", ".", "subscriptionKey", "(", "topicSpace", ",", "topic", ")", ";", "iProxies", ".", "remove", "(", "key", ")", ";", "}" ]
Remove the subscription in the case of a rollback @param topicSpace @param topic
[ "Remove", "the", "subscription", "in", "the", "case", "of", "a", "rollback" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java#L582-L589
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java
Neighbour.proxyDeregistered
MESubscription proxyDeregistered(SIBUuid12 topicSpace, String topic, Transaction transaction) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "proxyDeregistered", new Object[] { topicSpace, topic, transaction }); // Generate a key for the topicSpace/topic final String key = BusGroup.subscriptionKey(topicSpace, topic); // Get the subscrition from the Hashtable. final MESubscription sub = (MESubscription) iProxies.get(key); if (sub != null) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug( tc, "Subscription " + sub + " being removed"); // Remove the subscription from the Neighbour item Stream. try { sub.remove(transaction, sub.getLockID()); } catch (MessageStoreException e) { FFDCFilter.processException( e, "com.ibm.ws.sib.processor.proxyhandler.Neighbour.proxyDeregistered", "1:669:1.107", this); SibTr.exception(tc, e); SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.proxyhandler.Neighbour", "1:676:1.107", e }); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "proxyDeregistered", "SIResourceException"); throw new SIResourceException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.proxyhandler.Neighbour", "1:686:1.107", e }, null), e); } // Remove the proxy from the list iProxies.remove(key); } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "No Subscription to be removed"); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "proxyDeregistered", sub); return sub; }
java
MESubscription proxyDeregistered(SIBUuid12 topicSpace, String topic, Transaction transaction) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "proxyDeregistered", new Object[] { topicSpace, topic, transaction }); // Generate a key for the topicSpace/topic final String key = BusGroup.subscriptionKey(topicSpace, topic); // Get the subscrition from the Hashtable. final MESubscription sub = (MESubscription) iProxies.get(key); if (sub != null) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug( tc, "Subscription " + sub + " being removed"); // Remove the subscription from the Neighbour item Stream. try { sub.remove(transaction, sub.getLockID()); } catch (MessageStoreException e) { FFDCFilter.processException( e, "com.ibm.ws.sib.processor.proxyhandler.Neighbour.proxyDeregistered", "1:669:1.107", this); SibTr.exception(tc, e); SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.proxyhandler.Neighbour", "1:676:1.107", e }); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "proxyDeregistered", "SIResourceException"); throw new SIResourceException( nls.getFormattedMessage( "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.proxyhandler.Neighbour", "1:686:1.107", e }, null), e); } // Remove the proxy from the list iProxies.remove(key); } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "No Subscription to be removed"); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "proxyDeregistered", sub); return sub; }
[ "MESubscription", "proxyDeregistered", "(", "SIBUuid12", "topicSpace", ",", "String", "topic", ",", "Transaction", "transaction", ")", "throws", "SIResourceException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"proxyDeregistered\"", ",", "new", "Object", "[", "]", "{", "topicSpace", ",", "topic", ",", "transaction", "}", ")", ";", "// Generate a key for the topicSpace/topic", "final", "String", "key", "=", "BusGroup", ".", "subscriptionKey", "(", "topicSpace", ",", "topic", ")", ";", "// Get the subscrition from the Hashtable.", "final", "MESubscription", "sub", "=", "(", "MESubscription", ")", "iProxies", ".", "get", "(", "key", ")", ";", "if", "(", "sub", "!=", "null", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "tc", ",", "\"Subscription \"", "+", "sub", "+", "\" being removed\"", ")", ";", "// Remove the subscription from the Neighbour item Stream.", "try", "{", "sub", ".", "remove", "(", "transaction", ",", "sub", ".", "getLockID", "(", ")", ")", ";", "}", "catch", "(", "MessageStoreException", "e", ")", "{", "FFDCFilter", ".", "processException", "(", "e", ",", "\"com.ibm.ws.sib.processor.proxyhandler.Neighbour.proxyDeregistered\"", ",", "\"1:669:1.107\"", ",", "this", ")", ";", "SibTr", ".", "exception", "(", "tc", ",", "e", ")", ";", "SibTr", ".", "error", "(", "tc", ",", "\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"", ",", "new", "Object", "[", "]", "{", "\"com.ibm.ws.sib.processor.proxyhandler.Neighbour\"", ",", "\"1:676:1.107\"", ",", "e", "}", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"proxyDeregistered\"", ",", "\"SIResourceException\"", ")", ";", "throw", "new", "SIResourceException", "(", "nls", ".", "getFormattedMessage", "(", "\"INTERNAL_MESSAGING_ERROR_CWSIP0002\"", ",", "new", "Object", "[", "]", "{", "\"com.ibm.ws.sib.processor.proxyhandler.Neighbour\"", ",", "\"1:686:1.107\"", ",", "e", "}", ",", "null", ")", ",", "e", ")", ";", "}", "// Remove the proxy from the list", "iProxies", ".", "remove", "(", "key", ")", ";", "}", "else", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "tc", ",", "\"No Subscription to be removed\"", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"proxyDeregistered\"", ",", "sub", ")", ";", "return", "sub", ";", "}" ]
proxyDeregistered is called on this Neighbour object when a delete proxy subscription is received from a Neighbour. A reference to that subscription is either deleted, or nothing happens. @param topic The topic for the proxy @param topicSpace The topicSpace for the subscription. @param transaction The transaction object to do the remove. @return MESubscription null if the proxy wasn't removed. @exception SIResourceException If the MESubscription can't be removed.
[ "proxyDeregistered", "is", "called", "on", "this", "Neighbour", "object", "when", "a", "delete", "proxy", "subscription", "is", "received", "from", "a", "Neighbour", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java#L606-L675
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java
Neighbour.addSubscription
protected void addSubscription(SIBUuid12 topicSpace, String topic, MESubscription subscription) { // Generate a key for the topicSpace/topic final String key = BusGroup.subscriptionKey(topicSpace, topic); iProxies.put(key, subscription); }
java
protected void addSubscription(SIBUuid12 topicSpace, String topic, MESubscription subscription) { // Generate a key for the topicSpace/topic final String key = BusGroup.subscriptionKey(topicSpace, topic); iProxies.put(key, subscription); }
[ "protected", "void", "addSubscription", "(", "SIBUuid12", "topicSpace", ",", "String", "topic", ",", "MESubscription", "subscription", ")", "{", "// Generate a key for the topicSpace/topic", "final", "String", "key", "=", "BusGroup", ".", "subscriptionKey", "(", "topicSpace", ",", "topic", ")", ";", "iProxies", ".", "put", "(", "key", ",", "subscription", ")", ";", "}" ]
Adds the rolled back subscription to the list. @param topicSpace @param topic
[ "Adds", "the", "rolled", "back", "subscription", "to", "the", "list", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java#L683-L689
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java
Neighbour.getSubscription
protected MESubscription getSubscription(SIBUuid12 topicSpace, String topic) { return (MESubscription)iProxies.get(BusGroup.subscriptionKey(topicSpace, topic)); }
java
protected MESubscription getSubscription(SIBUuid12 topicSpace, String topic) { return (MESubscription)iProxies.get(BusGroup.subscriptionKey(topicSpace, topic)); }
[ "protected", "MESubscription", "getSubscription", "(", "SIBUuid12", "topicSpace", ",", "String", "topic", ")", "{", "return", "(", "MESubscription", ")", "iProxies", ".", "get", "(", "BusGroup", ".", "subscriptionKey", "(", "topicSpace", ",", "topic", ")", ")", ";", "}" ]
Gets the MESubscription represented from this topicSpace and topic @param topicSpace @param topic @return MESubscription representing this topicSpace/topic
[ "Gets", "the", "MESubscription", "represented", "from", "this", "topicSpace", "and", "topic" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java#L699-L702
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java
Neighbour.markAllProxies
void markAllProxies() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "markAllProxies"); final Enumeration enu = iProxies.elements(); // Cycle through each of the proxies while (enu.hasMoreElements()) { final MESubscription sub = (MESubscription) enu.nextElement(); // Mark the subscription. sub.mark(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "markAllProxies"); }
java
void markAllProxies() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "markAllProxies"); final Enumeration enu = iProxies.elements(); // Cycle through each of the proxies while (enu.hasMoreElements()) { final MESubscription sub = (MESubscription) enu.nextElement(); // Mark the subscription. sub.mark(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "markAllProxies"); }
[ "void", "markAllProxies", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"markAllProxies\"", ")", ";", "final", "Enumeration", "enu", "=", "iProxies", ".", "elements", "(", ")", ";", "// Cycle through each of the proxies", "while", "(", "enu", ".", "hasMoreElements", "(", ")", ")", "{", "final", "MESubscription", "sub", "=", "(", "MESubscription", ")", "enu", ".", "nextElement", "(", ")", ";", "// Mark the subscription.", "sub", ".", "mark", "(", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"markAllProxies\"", ")", ";", "}" ]
Marks all the proxies from this Neighbour. This is used for resynching the state between what this ME has registered and what the ME has sent.
[ "Marks", "all", "the", "proxies", "from", "this", "Neighbour", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java#L710-L728
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java
Neighbour.sweepMarkedProxies
void sweepMarkedProxies( List topicSpaces, List topics, Transaction transaction, boolean okToForward) throws SIResourceException, SIException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry( tc, "sweepMarkedProxies", new Object[] { topicSpaces, topics, transaction, new Boolean(okToForward)}); // Get the list of proxies for this Neighbour final Enumeration enu = iProxies.elements(); // Cycle through each of the proxies while (enu.hasMoreElements()) { final MESubscription sub = (MESubscription) enu.nextElement(); // If the subscription is marked, then remove it if (sub.isMarked()) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug( tc, "Subscription " + sub + " being removed"); // Remove the proxy from the list. proxyDeregistered(sub.getTopicSpaceUuid(), sub.getTopic(), transaction); // Remove this Subscription from the // match space and the item stream on which they are // stored. final boolean proxyDeleted = iNeighbours.deleteProxy( iDestinationManager.getDestinationInternal(sub.getTopicSpaceUuid(), false), sub, this, sub.getTopicSpaceUuid(), sub.getTopic(), true, false); // Generate the key to remove the subscription from. final String key = BusGroup.subscriptionKey(sub.getTopicSpaceUuid(), sub.getTopic()); // Remove the proxy from the list iProxies.remove(key); // Add the details to the list of topics/topicSpaces to be deleted if (okToForward && proxyDeleted) { topics.add(sub.getTopic()); topicSpaces.add(sub.getTopicSpaceUuid()); } } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "sweepMarkedProxies"); }
java
void sweepMarkedProxies( List topicSpaces, List topics, Transaction transaction, boolean okToForward) throws SIResourceException, SIException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry( tc, "sweepMarkedProxies", new Object[] { topicSpaces, topics, transaction, new Boolean(okToForward)}); // Get the list of proxies for this Neighbour final Enumeration enu = iProxies.elements(); // Cycle through each of the proxies while (enu.hasMoreElements()) { final MESubscription sub = (MESubscription) enu.nextElement(); // If the subscription is marked, then remove it if (sub.isMarked()) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug( tc, "Subscription " + sub + " being removed"); // Remove the proxy from the list. proxyDeregistered(sub.getTopicSpaceUuid(), sub.getTopic(), transaction); // Remove this Subscription from the // match space and the item stream on which they are // stored. final boolean proxyDeleted = iNeighbours.deleteProxy( iDestinationManager.getDestinationInternal(sub.getTopicSpaceUuid(), false), sub, this, sub.getTopicSpaceUuid(), sub.getTopic(), true, false); // Generate the key to remove the subscription from. final String key = BusGroup.subscriptionKey(sub.getTopicSpaceUuid(), sub.getTopic()); // Remove the proxy from the list iProxies.remove(key); // Add the details to the list of topics/topicSpaces to be deleted if (okToForward && proxyDeleted) { topics.add(sub.getTopic()); topicSpaces.add(sub.getTopicSpaceUuid()); } } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "sweepMarkedProxies"); }
[ "void", "sweepMarkedProxies", "(", "List", "topicSpaces", ",", "List", "topics", ",", "Transaction", "transaction", ",", "boolean", "okToForward", ")", "throws", "SIResourceException", ",", "SIException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"sweepMarkedProxies\"", ",", "new", "Object", "[", "]", "{", "topicSpaces", ",", "topics", ",", "transaction", ",", "new", "Boolean", "(", "okToForward", ")", "}", ")", ";", "// Get the list of proxies for this Neighbour", "final", "Enumeration", "enu", "=", "iProxies", ".", "elements", "(", ")", ";", "// Cycle through each of the proxies", "while", "(", "enu", ".", "hasMoreElements", "(", ")", ")", "{", "final", "MESubscription", "sub", "=", "(", "MESubscription", ")", "enu", ".", "nextElement", "(", ")", ";", "// If the subscription is marked, then remove it", "if", "(", "sub", ".", "isMarked", "(", ")", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "tc", ",", "\"Subscription \"", "+", "sub", "+", "\" being removed\"", ")", ";", "// Remove the proxy from the list.", "proxyDeregistered", "(", "sub", ".", "getTopicSpaceUuid", "(", ")", ",", "sub", ".", "getTopic", "(", ")", ",", "transaction", ")", ";", "// Remove this Subscription from the", "// match space and the item stream on which they are", "// stored.", "final", "boolean", "proxyDeleted", "=", "iNeighbours", ".", "deleteProxy", "(", "iDestinationManager", ".", "getDestinationInternal", "(", "sub", ".", "getTopicSpaceUuid", "(", ")", ",", "false", ")", ",", "sub", ",", "this", ",", "sub", ".", "getTopicSpaceUuid", "(", ")", ",", "sub", ".", "getTopic", "(", ")", ",", "true", ",", "false", ")", ";", "// Generate the key to remove the subscription from.", "final", "String", "key", "=", "BusGroup", ".", "subscriptionKey", "(", "sub", ".", "getTopicSpaceUuid", "(", ")", ",", "sub", ".", "getTopic", "(", ")", ")", ";", "// Remove the proxy from the list", "iProxies", ".", "remove", "(", "key", ")", ";", "// Add the details to the list of topics/topicSpaces to be deleted", "if", "(", "okToForward", "&&", "proxyDeleted", ")", "{", "topics", ".", "add", "(", "sub", ".", "getTopic", "(", ")", ")", ";", "topicSpaces", ".", "add", "(", "sub", ".", "getTopicSpaceUuid", "(", ")", ")", ";", "}", "}", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"sweepMarkedProxies\"", ")", ";", "}" ]
Removes all Subscriptions that are no longer registered Loops through all the ME Subscriptions for this Neighbour and finds the ones that still contain the reset mark and removes them. @param topicSpaces The list of topicSpaces to add the deletes to @param topics The list of topics to add the deletes to @param okToForward Whether to add the topics to the lists or not.
[ "Removes", "all", "Subscriptions", "that", "are", "no", "longer", "registered" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java#L742-L808
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java
Neighbour.sendToNeighbour
void sendToNeighbour(JsMessage message, Transaction transaction) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "sendToNeighbour", new Object[] { message, transaction }); if (iProducerSession == null) createProducerSession(); try { iProducerSession.send((SIBusMessage) message, (SITransaction) transaction); } catch (SIException e) { // No FFDC code needed SibTr.exception(tc, e); SibTr.warning(tc, "PUBSUB_CONSISTENCY_ERROR_CWSIP0383", new Object[]{JsAdminUtils.getMENameByUuidForMessage(iMEUuid.toString()), e}); SIResourceException ee = null; if (! (e instanceof SIResourceException)) ee = new SIResourceException(e); else ee = (SIResourceException)e; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "sendToNeighbour", ee); throw ee; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "sendToNeighbour"); }
java
void sendToNeighbour(JsMessage message, Transaction transaction) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "sendToNeighbour", new Object[] { message, transaction }); if (iProducerSession == null) createProducerSession(); try { iProducerSession.send((SIBusMessage) message, (SITransaction) transaction); } catch (SIException e) { // No FFDC code needed SibTr.exception(tc, e); SibTr.warning(tc, "PUBSUB_CONSISTENCY_ERROR_CWSIP0383", new Object[]{JsAdminUtils.getMENameByUuidForMessage(iMEUuid.toString()), e}); SIResourceException ee = null; if (! (e instanceof SIResourceException)) ee = new SIResourceException(e); else ee = (SIResourceException)e; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "sendToNeighbour", ee); throw ee; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "sendToNeighbour"); }
[ "void", "sendToNeighbour", "(", "JsMessage", "message", ",", "Transaction", "transaction", ")", "throws", "SIResourceException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"sendToNeighbour\"", ",", "new", "Object", "[", "]", "{", "message", ",", "transaction", "}", ")", ";", "if", "(", "iProducerSession", "==", "null", ")", "createProducerSession", "(", ")", ";", "try", "{", "iProducerSession", ".", "send", "(", "(", "SIBusMessage", ")", "message", ",", "(", "SITransaction", ")", "transaction", ")", ";", "}", "catch", "(", "SIException", "e", ")", "{", "// No FFDC code needed", "SibTr", ".", "exception", "(", "tc", ",", "e", ")", ";", "SibTr", ".", "warning", "(", "tc", ",", "\"PUBSUB_CONSISTENCY_ERROR_CWSIP0383\"", ",", "new", "Object", "[", "]", "{", "JsAdminUtils", ".", "getMENameByUuidForMessage", "(", "iMEUuid", ".", "toString", "(", ")", ")", ",", "e", "}", ")", ";", "SIResourceException", "ee", "=", "null", ";", "if", "(", "!", "(", "e", "instanceof", "SIResourceException", ")", ")", "ee", "=", "new", "SIResourceException", "(", "e", ")", ";", "else", "ee", "=", "(", "SIResourceException", ")", "e", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"sendToNeighbour\"", ",", "ee", ")", ";", "throw", "ee", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"sendToNeighbour\"", ")", ";", "}" ]
Forwards the message given onto this Neighbours Queue. This could be a create/change or delete message. @param message The JsMessage to be sent. @param transaction The transaction to send the message under.
[ "Forwards", "the", "message", "given", "onto", "this", "Neighbours", "Queue", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java#L818-L855
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java
Neighbour.recoverSubscriptions
protected void recoverSubscriptions(MultiMEProxyHandler proxyHandler) throws MessageStoreException, SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "recoverSubscriptions", proxyHandler); iProxyHandler = proxyHandler; iProxies = new Hashtable(); NonLockingCursor cursor = null; try { cursor = newNonLockingItemCursor(new ClassEqualsFilter(MESubscription.class)); AbstractItem item = null; while ((item = cursor.next()) != null) { MESubscription sub = null; sub = (MESubscription)item; // Generate a key for the topicSpace/topic final String key = BusGroup.subscriptionKey(sub.getTopicSpaceUuid(), sub.getTopic()); // Add the Neighbour into the list of recovered Neighbours iProxies.put(key, sub); // Having created the Proxy, need to readd the proxy to the matchspace or just reference it. iNeighbours.createProxy(this, iDestinationManager.getDestinationInternal(sub.getTopicSpaceUuid(), false), sub, sub.getTopicSpaceUuid(), sub.getTopic(), true); // When recovering subscriptions, we need to call the event post commit // code to either add a reference, or put in the MatchSpace. sub.eventPostCommitAdd(null); } } finally { if (cursor != null) cursor.finished(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "recoverSubscriptions"); }
java
protected void recoverSubscriptions(MultiMEProxyHandler proxyHandler) throws MessageStoreException, SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "recoverSubscriptions", proxyHandler); iProxyHandler = proxyHandler; iProxies = new Hashtable(); NonLockingCursor cursor = null; try { cursor = newNonLockingItemCursor(new ClassEqualsFilter(MESubscription.class)); AbstractItem item = null; while ((item = cursor.next()) != null) { MESubscription sub = null; sub = (MESubscription)item; // Generate a key for the topicSpace/topic final String key = BusGroup.subscriptionKey(sub.getTopicSpaceUuid(), sub.getTopic()); // Add the Neighbour into the list of recovered Neighbours iProxies.put(key, sub); // Having created the Proxy, need to readd the proxy to the matchspace or just reference it. iNeighbours.createProxy(this, iDestinationManager.getDestinationInternal(sub.getTopicSpaceUuid(), false), sub, sub.getTopicSpaceUuid(), sub.getTopic(), true); // When recovering subscriptions, we need to call the event post commit // code to either add a reference, or put in the MatchSpace. sub.eventPostCommitAdd(null); } } finally { if (cursor != null) cursor.finished(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "recoverSubscriptions"); }
[ "protected", "void", "recoverSubscriptions", "(", "MultiMEProxyHandler", "proxyHandler", ")", "throws", "MessageStoreException", ",", "SIResourceException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"recoverSubscriptions\"", ",", "proxyHandler", ")", ";", "iProxyHandler", "=", "proxyHandler", ";", "iProxies", "=", "new", "Hashtable", "(", ")", ";", "NonLockingCursor", "cursor", "=", "null", ";", "try", "{", "cursor", "=", "newNonLockingItemCursor", "(", "new", "ClassEqualsFilter", "(", "MESubscription", ".", "class", ")", ")", ";", "AbstractItem", "item", "=", "null", ";", "while", "(", "(", "item", "=", "cursor", ".", "next", "(", ")", ")", "!=", "null", ")", "{", "MESubscription", "sub", "=", "null", ";", "sub", "=", "(", "MESubscription", ")", "item", ";", "// Generate a key for the topicSpace/topic", "final", "String", "key", "=", "BusGroup", ".", "subscriptionKey", "(", "sub", ".", "getTopicSpaceUuid", "(", ")", ",", "sub", ".", "getTopic", "(", ")", ")", ";", "// Add the Neighbour into the list of recovered Neighbours", "iProxies", ".", "put", "(", "key", ",", "sub", ")", ";", "// Having created the Proxy, need to readd the proxy to the matchspace or just reference it.", "iNeighbours", ".", "createProxy", "(", "this", ",", "iDestinationManager", ".", "getDestinationInternal", "(", "sub", ".", "getTopicSpaceUuid", "(", ")", ",", "false", ")", ",", "sub", ",", "sub", ".", "getTopicSpaceUuid", "(", ")", ",", "sub", ".", "getTopic", "(", ")", ",", "true", ")", ";", "// When recovering subscriptions, we need to call the event post commit", "// code to either add a reference, or put in the MatchSpace.", "sub", ".", "eventPostCommitAdd", "(", "null", ")", ";", "}", "}", "finally", "{", "if", "(", "cursor", "!=", "null", ")", "cursor", ".", "finished", "(", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"recoverSubscriptions\"", ")", ";", "}" ]
Recovers the Neighbours subscriptions that it had registered. @param proxyHandler the ProxyHandler instance
[ "Recovers", "the", "Neighbours", "subscriptions", "that", "it", "had", "registered", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java#L862-L911
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java
Neighbour.deleteDestination
protected void deleteDestination() throws SIConnectionLostException, SIResourceException, SIErrorException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "deleteDestination"); // If the producer session hasn't been closed, close it now synchronized(this) { if (iProducerSession != null) iProducerSession.close(); } if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Removing destination " + iRemoteQueue.getDestinationName()); try { iDestinationManager.deleteSystemDestination(iRemoteQueue); } catch (SINotPossibleInCurrentConfigurationException e) { // No FFDC code needed if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Destination " + iRemoteQueue + " already deleted"); } // If the alarm hasn't been cancelled, do it now. synchronized (this) { if (!iAlarmCancelled) { if (iAlarm != null) iAlarm.cancel(); iAlarmCancelled = true; } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "deleteDestination"); }
java
protected void deleteDestination() throws SIConnectionLostException, SIResourceException, SIErrorException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "deleteDestination"); // If the producer session hasn't been closed, close it now synchronized(this) { if (iProducerSession != null) iProducerSession.close(); } if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Removing destination " + iRemoteQueue.getDestinationName()); try { iDestinationManager.deleteSystemDestination(iRemoteQueue); } catch (SINotPossibleInCurrentConfigurationException e) { // No FFDC code needed if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Destination " + iRemoteQueue + " already deleted"); } // If the alarm hasn't been cancelled, do it now. synchronized (this) { if (!iAlarmCancelled) { if (iAlarm != null) iAlarm.cancel(); iAlarmCancelled = true; } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "deleteDestination"); }
[ "protected", "void", "deleteDestination", "(", ")", "throws", "SIConnectionLostException", ",", "SIResourceException", ",", "SIErrorException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"deleteDestination\"", ")", ";", "// If the producer session hasn't been closed, close it now", "synchronized", "(", "this", ")", "{", "if", "(", "iProducerSession", "!=", "null", ")", "iProducerSession", ".", "close", "(", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "tc", ",", "\"Removing destination \"", "+", "iRemoteQueue", ".", "getDestinationName", "(", ")", ")", ";", "try", "{", "iDestinationManager", ".", "deleteSystemDestination", "(", "iRemoteQueue", ")", ";", "}", "catch", "(", "SINotPossibleInCurrentConfigurationException", "e", ")", "{", "// No FFDC code needed", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "tc", ",", "\"Destination \"", "+", "iRemoteQueue", "+", "\" already deleted\"", ")", ";", "}", "// If the alarm hasn't been cancelled, do it now.", "synchronized", "(", "this", ")", "{", "if", "(", "!", "iAlarmCancelled", ")", "{", "if", "(", "iAlarm", "!=", "null", ")", "iAlarm", ".", "cancel", "(", ")", ";", "iAlarmCancelled", "=", "true", ";", "}", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"deleteDestination\"", ")", ";", "}" ]
Deletes the Queue that would be used for sending proxy update messages to this remote ME. This will only be called when the remote ME is to be deleted. This method also cancels any alarm that may have been set so it doesn't fire at some point in the future. @throws SICoreException
[ "Deletes", "the", "Queue", "that", "would", "be", "used", "for", "sending", "proxy", "update", "messages", "to", "this", "remote", "ME", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java#L923-L963
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java
Neighbour.addPubSubOutputHandler
protected void addPubSubOutputHandler(PubSubOutputHandler handler) { if (iPubSubOutputHandlers == null) iPubSubOutputHandlers = new HashSet(); // Add the PubSubOutputHandler to the list that this neighbour // knows about. This is so a recovered neighbour can add the list of // output handlers back into the matchspace. iPubSubOutputHandlers.add(handler); }
java
protected void addPubSubOutputHandler(PubSubOutputHandler handler) { if (iPubSubOutputHandlers == null) iPubSubOutputHandlers = new HashSet(); // Add the PubSubOutputHandler to the list that this neighbour // knows about. This is so a recovered neighbour can add the list of // output handlers back into the matchspace. iPubSubOutputHandlers.add(handler); }
[ "protected", "void", "addPubSubOutputHandler", "(", "PubSubOutputHandler", "handler", ")", "{", "if", "(", "iPubSubOutputHandlers", "==", "null", ")", "iPubSubOutputHandlers", "=", "new", "HashSet", "(", ")", ";", "// Add the PubSubOutputHandler to the list that this neighbour", "// knows about. This is so a recovered neighbour can add the list of", "// output handlers back into the matchspace.", "iPubSubOutputHandlers", ".", "add", "(", "handler", ")", ";", "}" ]
Add a PubSubOutputHandler to the list of PubSubOutputHandlers that this neighbour knows about.
[ "Add", "a", "PubSubOutputHandler", "to", "the", "list", "of", "PubSubOutputHandlers", "that", "this", "neighbour", "knows", "about", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java#L1141-L1150
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java
Neighbour.setRequestedProxySubscriptions
void setRequestedProxySubscriptions() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "setRequestedProxySubscriptions"); MPAlarmManager manager = iProxyHandler.getMessageProcessor().getAlarmManager(); iAlarm = manager.create(REQUEST_TIMER, this); synchronized (this) { iRequestSent = true; iAlarmCancelled = false; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "setRequestedProxySubscriptions"); }
java
void setRequestedProxySubscriptions() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "setRequestedProxySubscriptions"); MPAlarmManager manager = iProxyHandler.getMessageProcessor().getAlarmManager(); iAlarm = manager.create(REQUEST_TIMER, this); synchronized (this) { iRequestSent = true; iAlarmCancelled = false; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "setRequestedProxySubscriptions"); }
[ "void", "setRequestedProxySubscriptions", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"setRequestedProxySubscriptions\"", ")", ";", "MPAlarmManager", "manager", "=", "iProxyHandler", ".", "getMessageProcessor", "(", ")", ".", "getAlarmManager", "(", ")", ";", "iAlarm", "=", "manager", ".", "create", "(", "REQUEST_TIMER", ",", "this", ")", ";", "synchronized", "(", "this", ")", "{", "iRequestSent", "=", "true", ";", "iAlarmCancelled", "=", "false", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"setRequestedProxySubscriptions\"", ")", ";", "}" ]
Indicate that we have sent a request message to this neighbour. This will mean that a timer is created for 5 seconds waiting for a response. If no response is received, then the timer will pop and log a console message to indicate that the pubsub topology will not be consistent. To remove the Timer, this neighbour must receive either a RESET, REPLY or a REQUEST SubscriptionMessageType.
[ "Indicate", "that", "we", "have", "sent", "a", "request", "message", "to", "this", "neighbour", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java#L1176-L1192
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java
Neighbour.setRequestedProxySubscriptionsResponded
void setRequestedProxySubscriptionsResponded() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "setRequestedProxySubscriptionsResponded"); synchronized (this) { iRequestSent = false; if (!iAlarmCancelled) iAlarm.cancel(); iAlarmCancelled = true; } String meName = JsAdminUtils.getMENameByUuidForMessage(iMEUuid.toString()); if (meName == null) meName = iMEUuid.toString(); SibTr.push(iProxyHandler.getMessageProcessor().getMessagingEngine()); SibTr.info(tc, "NEIGHBOUR_REPLY_RECIEVED_INFO_CWSIP0382", new Object[]{meName}); SibTr.pop(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "setRequestedProxySubscriptionsResponded"); }
java
void setRequestedProxySubscriptionsResponded() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "setRequestedProxySubscriptionsResponded"); synchronized (this) { iRequestSent = false; if (!iAlarmCancelled) iAlarm.cancel(); iAlarmCancelled = true; } String meName = JsAdminUtils.getMENameByUuidForMessage(iMEUuid.toString()); if (meName == null) meName = iMEUuid.toString(); SibTr.push(iProxyHandler.getMessageProcessor().getMessagingEngine()); SibTr.info(tc, "NEIGHBOUR_REPLY_RECIEVED_INFO_CWSIP0382", new Object[]{meName}); SibTr.pop(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "setRequestedProxySubscriptionsResponded"); }
[ "void", "setRequestedProxySubscriptionsResponded", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"setRequestedProxySubscriptionsResponded\"", ")", ";", "synchronized", "(", "this", ")", "{", "iRequestSent", "=", "false", ";", "if", "(", "!", "iAlarmCancelled", ")", "iAlarm", ".", "cancel", "(", ")", ";", "iAlarmCancelled", "=", "true", ";", "}", "String", "meName", "=", "JsAdminUtils", ".", "getMENameByUuidForMessage", "(", "iMEUuid", ".", "toString", "(", ")", ")", ";", "if", "(", "meName", "==", "null", ")", "meName", "=", "iMEUuid", ".", "toString", "(", ")", ";", "SibTr", ".", "push", "(", "iProxyHandler", ".", "getMessageProcessor", "(", ")", ".", "getMessagingEngine", "(", ")", ")", ";", "SibTr", ".", "info", "(", "tc", ",", "\"NEIGHBOUR_REPLY_RECIEVED_INFO_CWSIP0382\"", ",", "new", "Object", "[", "]", "{", "meName", "}", ")", ";", "SibTr", ".", "pop", "(", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"setRequestedProxySubscriptionsResponded\"", ")", ";", "}" ]
The request for proxy subscriptions was responded to. Cancels the Alarm that was created. Updates the underlying object to indicate that a response was received. @param transaction the transaction to do the update under
[ "The", "request", "for", "proxy", "subscriptions", "was", "responded", "to", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java#L1202-L1229
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java
Neighbour.wasProxyRequestSent
boolean wasProxyRequestSent() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, "wasProxyRequestSent"); SibTr.exit(tc, "wasProxyRequestSent", new Boolean(iRequestSent)); } return iRequestSent; }
java
boolean wasProxyRequestSent() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, "wasProxyRequestSent"); SibTr.exit(tc, "wasProxyRequestSent", new Boolean(iRequestSent)); } return iRequestSent; }
[ "boolean", "wasProxyRequestSent", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", "entry", "(", "tc", ",", "\"wasProxyRequestSent\"", ")", ";", "SibTr", ".", "exit", "(", "tc", ",", "\"wasProxyRequestSent\"", ",", "new", "Boolean", "(", "iRequestSent", ")", ")", ";", "}", "return", "iRequestSent", ";", "}" ]
If a request message was sent to this neighbour for the proxy subscriptions @return true if a request was sent.
[ "If", "a", "request", "message", "was", "sent", "to", "this", "neighbour", "for", "the", "proxy", "subscriptions" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java#L1237-L1245
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java
Neighbour.deleteSystemDestinations
protected void deleteSystemDestinations() throws SIConnectionLostException, SIResourceException, SIErrorException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "deleteSystemDestinations"); // If the producer session hasn't been closed, close it now synchronized(this) { if (iProducerSession != null) iProducerSession.close(); } //Get all the system destinations tht need to be deleted List systemDestinations = iDestinationManager.getAllSystemDestinations(iMEUuid); Iterator itr = systemDestinations.iterator(); while (itr.hasNext() ) { JsDestinationAddress destAddress = (JsDestinationAddress)itr.next(); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Removing destination " + destAddress.getDestinationName()); try { iDestinationManager.deleteSystemDestination(destAddress); } catch (SINotPossibleInCurrentConfigurationException e) { // No FFDC code needed if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Destination " + destAddress + " already deleted"); } } // If the alarm hasn't been cancelled, do it now. synchronized (this) { if (!iAlarmCancelled) { if (iAlarm != null) iAlarm.cancel(); iAlarmCancelled = true; } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "deleteSystemDestinations"); }
java
protected void deleteSystemDestinations() throws SIConnectionLostException, SIResourceException, SIErrorException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "deleteSystemDestinations"); // If the producer session hasn't been closed, close it now synchronized(this) { if (iProducerSession != null) iProducerSession.close(); } //Get all the system destinations tht need to be deleted List systemDestinations = iDestinationManager.getAllSystemDestinations(iMEUuid); Iterator itr = systemDestinations.iterator(); while (itr.hasNext() ) { JsDestinationAddress destAddress = (JsDestinationAddress)itr.next(); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Removing destination " + destAddress.getDestinationName()); try { iDestinationManager.deleteSystemDestination(destAddress); } catch (SINotPossibleInCurrentConfigurationException e) { // No FFDC code needed if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Destination " + destAddress + " already deleted"); } } // If the alarm hasn't been cancelled, do it now. synchronized (this) { if (!iAlarmCancelled) { if (iAlarm != null) iAlarm.cancel(); iAlarmCancelled = true; } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "deleteSystemDestinations"); }
[ "protected", "void", "deleteSystemDestinations", "(", ")", "throws", "SIConnectionLostException", ",", "SIResourceException", ",", "SIErrorException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"deleteSystemDestinations\"", ")", ";", "// If the producer session hasn't been closed, close it now", "synchronized", "(", "this", ")", "{", "if", "(", "iProducerSession", "!=", "null", ")", "iProducerSession", ".", "close", "(", ")", ";", "}", "//Get all the system destinations tht need to be deleted", "List", "systemDestinations", "=", "iDestinationManager", ".", "getAllSystemDestinations", "(", "iMEUuid", ")", ";", "Iterator", "itr", "=", "systemDestinations", ".", "iterator", "(", ")", ";", "while", "(", "itr", ".", "hasNext", "(", ")", ")", "{", "JsDestinationAddress", "destAddress", "=", "(", "JsDestinationAddress", ")", "itr", ".", "next", "(", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "tc", ",", "\"Removing destination \"", "+", "destAddress", ".", "getDestinationName", "(", ")", ")", ";", "try", "{", "iDestinationManager", ".", "deleteSystemDestination", "(", "destAddress", ")", ";", "}", "catch", "(", "SINotPossibleInCurrentConfigurationException", "e", ")", "{", "// No FFDC code needed", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "tc", ",", "\"Destination \"", "+", "destAddress", "+", "\" already deleted\"", ")", ";", "}", "}", "// If the alarm hasn't been cancelled, do it now.", "synchronized", "(", "this", ")", "{", "if", "(", "!", "iAlarmCancelled", ")", "{", "if", "(", "iAlarm", "!=", "null", ")", "iAlarm", ".", "cancel", "(", ")", ";", "iAlarmCancelled", "=", "true", ";", "}", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"deleteSystemDestinations\"", ")", ";", "}" ]
Deletes all remote system destinations that are on referencing the me that this neighbour is referenced too. This will only be called when the remote ME is to be deleted. This method also cancels any alarm that may have been set so it doesn't fire at some point in the future. @throws SICoreException
[ "Deletes", "all", "remote", "system", "destinations", "that", "are", "on", "referencing", "the", "me", "that", "this", "neighbour", "is", "referenced", "too", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java#L1322-L1370
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java
Neighbour.checkForeignSecurityAttributesChanged
private boolean checkForeignSecurityAttributesChanged(MESubscription sub, boolean foreignSecuredProxy, String MESubUserId) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "checkForeignSecurityAttributesChanged", new Object[] { sub, new Boolean(foreignSecuredProxy), MESubUserId }); boolean attrChanged = false; if(foreignSecuredProxy) { if(sub.isForeignSecuredProxy()) { // Need to check the userids if(MESubUserId != null) { if(sub.getMESubUserId() != null) { // Neither string is null, check whether they // are equal if(!MESubUserId.equals(sub.getMESubUserId())) { sub.setMESubUserId(MESubUserId); attrChanged = true; } } else { // Stored subscription was null sub.setMESubUserId(MESubUserId); attrChanged = true; } } else // MESubUserid is null { if(sub.getMESubUserId() != null) { sub.setMESubUserId(null); attrChanged = true; } } } else { // The stored subscription was not foreign secured sub.setForeignSecuredProxy(true); sub.setMESubUserId(MESubUserId); attrChanged = true; } } else // the new proxy sub is not foreign secured { if(sub.isForeignSecuredProxy()) { // The stored subscription was foreign secured sub.setForeignSecuredProxy(false); sub.setMESubUserId(null); attrChanged = true; } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "checkForeignSecurityAttributesChanged", new Boolean(attrChanged)); return attrChanged; }
java
private boolean checkForeignSecurityAttributesChanged(MESubscription sub, boolean foreignSecuredProxy, String MESubUserId) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "checkForeignSecurityAttributesChanged", new Object[] { sub, new Boolean(foreignSecuredProxy), MESubUserId }); boolean attrChanged = false; if(foreignSecuredProxy) { if(sub.isForeignSecuredProxy()) { // Need to check the userids if(MESubUserId != null) { if(sub.getMESubUserId() != null) { // Neither string is null, check whether they // are equal if(!MESubUserId.equals(sub.getMESubUserId())) { sub.setMESubUserId(MESubUserId); attrChanged = true; } } else { // Stored subscription was null sub.setMESubUserId(MESubUserId); attrChanged = true; } } else // MESubUserid is null { if(sub.getMESubUserId() != null) { sub.setMESubUserId(null); attrChanged = true; } } } else { // The stored subscription was not foreign secured sub.setForeignSecuredProxy(true); sub.setMESubUserId(MESubUserId); attrChanged = true; } } else // the new proxy sub is not foreign secured { if(sub.isForeignSecuredProxy()) { // The stored subscription was foreign secured sub.setForeignSecuredProxy(false); sub.setMESubUserId(null); attrChanged = true; } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "checkForeignSecurityAttributesChanged", new Boolean(attrChanged)); return attrChanged; }
[ "private", "boolean", "checkForeignSecurityAttributesChanged", "(", "MESubscription", "sub", ",", "boolean", "foreignSecuredProxy", ",", "String", "MESubUserId", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"checkForeignSecurityAttributesChanged\"", ",", "new", "Object", "[", "]", "{", "sub", ",", "new", "Boolean", "(", "foreignSecuredProxy", ")", ",", "MESubUserId", "}", ")", ";", "boolean", "attrChanged", "=", "false", ";", "if", "(", "foreignSecuredProxy", ")", "{", "if", "(", "sub", ".", "isForeignSecuredProxy", "(", ")", ")", "{", "// Need to check the userids", "if", "(", "MESubUserId", "!=", "null", ")", "{", "if", "(", "sub", ".", "getMESubUserId", "(", ")", "!=", "null", ")", "{", "// Neither string is null, check whether they", "// are equal", "if", "(", "!", "MESubUserId", ".", "equals", "(", "sub", ".", "getMESubUserId", "(", ")", ")", ")", "{", "sub", ".", "setMESubUserId", "(", "MESubUserId", ")", ";", "attrChanged", "=", "true", ";", "}", "}", "else", "{", "// Stored subscription was null", "sub", ".", "setMESubUserId", "(", "MESubUserId", ")", ";", "attrChanged", "=", "true", ";", "}", "}", "else", "// MESubUserid is null", "{", "if", "(", "sub", ".", "getMESubUserId", "(", ")", "!=", "null", ")", "{", "sub", ".", "setMESubUserId", "(", "null", ")", ";", "attrChanged", "=", "true", ";", "}", "}", "}", "else", "{", "// The stored subscription was not foreign secured", "sub", ".", "setForeignSecuredProxy", "(", "true", ")", ";", "sub", ".", "setMESubUserId", "(", "MESubUserId", ")", ";", "attrChanged", "=", "true", ";", "}", "}", "else", "// the new proxy sub is not foreign secured", "{", "if", "(", "sub", ".", "isForeignSecuredProxy", "(", ")", ")", "{", "// The stored subscription was foreign secured", "sub", ".", "setForeignSecuredProxy", "(", "false", ")", ";", "sub", ".", "setMESubUserId", "(", "null", ")", ";", "attrChanged", "=", "true", ";", "}", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"checkForeignSecurityAttributesChanged\"", ",", "new", "Boolean", "(", "attrChanged", ")", ")", ";", "return", "attrChanged", ";", "}" ]
checkForeignSecurityAttributesChanged is called in order to determine whether security attributes have changed. @param sub The stored subscription @param foreignSecuredProxy Flag to indicate whether the new proxy sub originated from a foreign bus where the home bus is secured. @param MESubUserId Userid to be stored when securing foreign proxy subs @return An MESubscription if a new Subscription is created.
[ "checkForeignSecurityAttributesChanged", "is", "called", "in", "order", "to", "determine", "whether", "security", "attributes", "have", "changed", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java#L1384-L1451
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java
Neighbour.resetListFailed
synchronized void resetListFailed() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "resetListFailed"); iRequestFailed = true; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "resetListFailed"); }
java
synchronized void resetListFailed() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "resetListFailed"); iRequestFailed = true; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "resetListFailed"); }
[ "synchronized", "void", "resetListFailed", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"resetListFailed\"", ")", ";", "iRequestFailed", "=", "true", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"resetListFailed\"", ")", ";", "}" ]
Method indicates that the reset list failed - update the alarm to indicate that this failed.
[ "Method", "indicates", "that", "the", "reset", "list", "failed", "-", "update", "the", "alarm", "to", "indicate", "that", "this", "failed", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java#L1456-L1465
train
OpenLiberty/open-liberty
dev/com.ibm.ws.anno/src/com/ibm/ws/anno/info/internal/InfoImpl.java
InfoImpl.isDeclaredAnnotationWithin
@Override public boolean isDeclaredAnnotationWithin(Collection<String> annotationNames) { if (declaredAnnotations != null) { for (AnnotationInfo annotation : declaredAnnotations) { if (annotationNames.contains(annotation.getAnnotationClassName())) { return true; } } } return false; }
java
@Override public boolean isDeclaredAnnotationWithin(Collection<String> annotationNames) { if (declaredAnnotations != null) { for (AnnotationInfo annotation : declaredAnnotations) { if (annotationNames.contains(annotation.getAnnotationClassName())) { return true; } } } return false; }
[ "@", "Override", "public", "boolean", "isDeclaredAnnotationWithin", "(", "Collection", "<", "String", ">", "annotationNames", ")", "{", "if", "(", "declaredAnnotations", "!=", "null", ")", "{", "for", "(", "AnnotationInfo", "annotation", ":", "declaredAnnotations", ")", "{", "if", "(", "annotationNames", ".", "contains", "(", "annotation", ".", "getAnnotationClassName", "(", ")", ")", ")", "{", "return", "true", ";", "}", "}", "}", "return", "false", ";", "}" ]
Optimized to iterate across the declared annotations first.
[ "Optimized", "to", "iterate", "across", "the", "declared", "annotations", "first", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.anno/src/com/ibm/ws/anno/info/internal/InfoImpl.java#L194-L205
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/RAWrapperEECImpl.java
RAWrapperEECImpl.readObject
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { ObjectInputStream.GetField getField = s.readFields(); version = getField.get("version", 1); resourceAdapterKey = (String) getField.get("resourceAdapterKey", null); }
java
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException { ObjectInputStream.GetField getField = s.readFields(); version = getField.get("version", 1); resourceAdapterKey = (String) getField.get("resourceAdapterKey", null); }
[ "private", "void", "readObject", "(", "ObjectInputStream", "s", ")", "throws", "IOException", ",", "ClassNotFoundException", "{", "ObjectInputStream", ".", "GetField", "getField", "=", "s", ".", "readFields", "(", ")", ";", "version", "=", "getField", ".", "get", "(", "\"version\"", ",", "1", ")", ";", "resourceAdapterKey", "=", "(", "String", ")", "getField", ".", "get", "(", "\"resourceAdapterKey\"", ",", "null", ")", ";", "}" ]
Overrides the default deserialization.
[ "Overrides", "the", "default", "deserialization", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/RAWrapperEECImpl.java#L135-L140
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/RAWrapperEECImpl.java
RAWrapperEECImpl.writeObject
private void writeObject(ObjectOutputStream s) throws IOException { ObjectOutputStream.PutField putField = s.putFields(); putField.put("version", version); putField.put("resourceAdapterKey", resourceAdapterKey); s.writeFields(); }
java
private void writeObject(ObjectOutputStream s) throws IOException { ObjectOutputStream.PutField putField = s.putFields(); putField.put("version", version); putField.put("resourceAdapterKey", resourceAdapterKey); s.writeFields(); }
[ "private", "void", "writeObject", "(", "ObjectOutputStream", "s", ")", "throws", "IOException", "{", "ObjectOutputStream", ".", "PutField", "putField", "=", "s", ".", "putFields", "(", ")", ";", "putField", ".", "put", "(", "\"version\"", ",", "version", ")", ";", "putField", ".", "put", "(", "\"resourceAdapterKey\"", ",", "resourceAdapterKey", ")", ";", "s", ".", "writeFields", "(", ")", ";", "}" ]
Overrides the default serialization.
[ "Overrides", "the", "default", "serialization", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/RAWrapperEECImpl.java#L161-L166
train
OpenLiberty/open-liberty
dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/RLSControllerImpl.java
RLSControllerImpl.notifyTimeout
static void notifyTimeout() { if (tc.isEntryEnabled()) Tr.entry(tc, "notifyTimeout"); synchronized(SUSPEND_LOCK) { // Check if there are any outstanding suspends if (_tokenManager.isResumable()) { if (tc.isEventEnabled()) Tr.event(tc, "Resuming recovery log service following a suspension timeout"); _isSuspended = false; Tr.info(tc, "CWRLS0023_RESUME_RLS"); // Notify all waiting threads that // normal service is resumed SUSPEND_LOCK.notifyAll(); } } if (tc.isEntryEnabled()) Tr.exit(tc, "notifyTimeout"); }
java
static void notifyTimeout() { if (tc.isEntryEnabled()) Tr.entry(tc, "notifyTimeout"); synchronized(SUSPEND_LOCK) { // Check if there are any outstanding suspends if (_tokenManager.isResumable()) { if (tc.isEventEnabled()) Tr.event(tc, "Resuming recovery log service following a suspension timeout"); _isSuspended = false; Tr.info(tc, "CWRLS0023_RESUME_RLS"); // Notify all waiting threads that // normal service is resumed SUSPEND_LOCK.notifyAll(); } } if (tc.isEntryEnabled()) Tr.exit(tc, "notifyTimeout"); }
[ "static", "void", "notifyTimeout", "(", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"notifyTimeout\"", ")", ";", "synchronized", "(", "SUSPEND_LOCK", ")", "{", "// Check if there are any outstanding suspends", "if", "(", "_tokenManager", ".", "isResumable", "(", ")", ")", "{", "if", "(", "tc", ".", "isEventEnabled", "(", ")", ")", "Tr", ".", "event", "(", "tc", ",", "\"Resuming recovery log service following a suspension timeout\"", ")", ";", "_isSuspended", "=", "false", ";", "Tr", ".", "info", "(", "tc", ",", "\"CWRLS0023_RESUME_RLS\"", ")", ";", "// Notify all waiting threads that", "// normal service is resumed", "SUSPEND_LOCK", ".", "notifyAll", "(", ")", ";", "}", "}", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "exit", "(", "tc", ",", "\"notifyTimeout\"", ")", ";", "}" ]
Called by the RLSSuspendTokenManager in the event of a suspension timeout occurring We need to check, if as a result of a suspension timing out, whether we should resume the RLS. We will resume only if there are no other outstanding active suspensions @return boolean isSuspended
[ "Called", "by", "the", "RLSSuspendTokenManager", "in", "the", "event", "of", "a", "suspension", "timeout", "occurring" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.recoverylog/src/com/ibm/ws/recoverylog/spi/RLSControllerImpl.java#L258-L281
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/InternalTransaction.java
InternalTransaction.getExternalTransaction
protected synchronized final Transaction getExternalTransaction() { final String methodName = "getExternalTransaction"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName); Transaction transaction = null; // For return. if (transactionReference != null) transaction = (Transaction) transactionReference.get(); if (transaction == null) { transaction = new Transaction(this); // Make a WeakReference that becomes Enqueued as a result of the external Transaction becoming unreferenced. transactionReference = new TransactionReference(this, transaction); } // if (transaction == null). if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName, new Object[] { transaction }); return transaction; }
java
protected synchronized final Transaction getExternalTransaction() { final String methodName = "getExternalTransaction"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName); Transaction transaction = null; // For return. if (transactionReference != null) transaction = (Transaction) transactionReference.get(); if (transaction == null) { transaction = new Transaction(this); // Make a WeakReference that becomes Enqueued as a result of the external Transaction becoming unreferenced. transactionReference = new TransactionReference(this, transaction); } // if (transaction == null). if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName, new Object[] { transaction }); return transaction; }
[ "protected", "synchronized", "final", "Transaction", "getExternalTransaction", "(", ")", "{", "final", "String", "methodName", "=", "\"getExternalTransaction\"", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "methodName", ")", ";", "Transaction", "transaction", "=", "null", ";", "// For return.", "if", "(", "transactionReference", "!=", "null", ")", "transaction", "=", "(", "Transaction", ")", "transactionReference", ".", "get", "(", ")", ";", "if", "(", "transaction", "==", "null", ")", "{", "transaction", "=", "new", "Transaction", "(", "this", ")", ";", "// Make a WeakReference that becomes Enqueued as a result of the external Transaction becoming unreferenced.", "transactionReference", "=", "new", "TransactionReference", "(", "this", ",", "transaction", ")", ";", "}", "// if (transaction == null).", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "methodName", ",", "new", "Object", "[", "]", "{", "transaction", "}", ")", ";", "return", "transaction", ";", "}" ]
Create the extrnal transaction for use by the public interface from this InternalTransaction. To detect orphaned Transactions, ie. Transactions not referenced elsewhere in the JVM, we will keep a reference to the internalTransaction and make a weak reference to the container we pass to the application. When the container Transaction appears on the orphanTransactionsQueue we know the calling application has lost all references to it. At this point we can attempt to reuse it. @return transaction the new transaction.
[ "Create", "the", "extrnal", "transaction", "for", "use", "by", "the", "public", "interface", "from", "this", "InternalTransaction", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/InternalTransaction.java#L463-L487
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/InternalTransaction.java
InternalTransaction.requestCallback
protected synchronized void requestCallback(Token token, Transaction transaction) throws ObjectManagerException { final String methodName = "requestCallback"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName, new Object[] { token, transaction }); // To defend against two application threads completing the same transaction and trying to // continue with it at the same time we check that the Transaction still refers to this one, // now that we are synchronized on the InternalTransaction. if (transaction.internalTransaction != this) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName, new Object[] { "via InvalidTransactionException", transaction.internalTransaction }); // Same behaviour as if the transaction was completed and replaced by // objectManagerState.dummyInternalTransaction. throw new InvalidStateException(this, InternalTransaction.stateTerminated, InternalTransaction.stateNames[InternalTransaction.stateTerminated]); } // if (transaction.internalTransaction != this) // Make the state change, to see if we can accept requestCallBack requests. // We only accept the request if we will make a callback. setState(nextStateForRequestCallback); // The object is now listed for prePrepare etc. callback. callbackTokens.add(token); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName); }
java
protected synchronized void requestCallback(Token token, Transaction transaction) throws ObjectManagerException { final String methodName = "requestCallback"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName, new Object[] { token, transaction }); // To defend against two application threads completing the same transaction and trying to // continue with it at the same time we check that the Transaction still refers to this one, // now that we are synchronized on the InternalTransaction. if (transaction.internalTransaction != this) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName, new Object[] { "via InvalidTransactionException", transaction.internalTransaction }); // Same behaviour as if the transaction was completed and replaced by // objectManagerState.dummyInternalTransaction. throw new InvalidStateException(this, InternalTransaction.stateTerminated, InternalTransaction.stateNames[InternalTransaction.stateTerminated]); } // if (transaction.internalTransaction != this) // Make the state change, to see if we can accept requestCallBack requests. // We only accept the request if we will make a callback. setState(nextStateForRequestCallback); // The object is now listed for prePrepare etc. callback. callbackTokens.add(token); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName); }
[ "protected", "synchronized", "void", "requestCallback", "(", "Token", "token", ",", "Transaction", "transaction", ")", "throws", "ObjectManagerException", "{", "final", "String", "methodName", "=", "\"requestCallback\"", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "methodName", ",", "new", "Object", "[", "]", "{", "token", ",", "transaction", "}", ")", ";", "// To defend against two application threads completing the same transaction and trying to", "// continue with it at the same time we check that the Transaction still refers to this one,", "// now that we are synchronized on the InternalTransaction.", "if", "(", "transaction", ".", "internalTransaction", "!=", "this", ")", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "methodName", ",", "new", "Object", "[", "]", "{", "\"via InvalidTransactionException\"", ",", "transaction", ".", "internalTransaction", "}", ")", ";", "// Same behaviour as if the transaction was completed and replaced by", "// objectManagerState.dummyInternalTransaction.", "throw", "new", "InvalidStateException", "(", "this", ",", "InternalTransaction", ".", "stateTerminated", ",", "InternalTransaction", ".", "stateNames", "[", "InternalTransaction", ".", "stateTerminated", "]", ")", ";", "}", "// if (transaction.internalTransaction != this)", "// Make the state change, to see if we can accept requestCallBack requests.", "// We only accept the request if we will make a callback.", "setState", "(", "nextStateForRequestCallback", ")", ";", "// The object is now listed for prePrepare etc. callback.", "callbackTokens", ".", "add", "(", "token", ")", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "methodName", ")", ";", "}" ]
Note a request for the Token in the transaction to be called at prePrepare, preCommit, preBackout, postCommit and postBackout. @param token who's ManagedObject is to be called back. @param transaction the external transaction. @throws ObjectManagerException @throws InvalidStateException if the tansaction has started its prepare processing.
[ "Note", "a", "request", "for", "the", "Token", "in", "the", "transaction", "to", "be", "called", "at", "prePrepare", "preCommit", "preBackout", "postCommit", "and", "postBackout", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/InternalTransaction.java#L615-L654
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/InternalTransaction.java
InternalTransaction.addFromCheckpoint
protected synchronized void addFromCheckpoint(ManagedObject managedObject, Transaction transaction) throws ObjectManagerException { final String methodName = "addFromCheckpoint"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName, new Object[] { managedObject, transaction }); // Make the ManagedObject ready for an addition. // Nothing went wrong during forward processing! managedObject.preAdd(transaction); // Only persistent objects are recovered from a checkpoint. setState(nextStateForInvolvePersistentObjectFromCheckpoint); // The object is now included in the transaction. includedManagedObjects.put(managedObject.owningToken, managedObject); // The ManagedObject was read from the ObjectStore, give it a low log // and ManagedObject sequence number so that any later operation will supercede this one. // The loggedSerialisedBytes will be unchanged, possibly null for this Token. // If there already a logSequenceNumber known for this token it must have been put // there after the checkpoint start and has already been superceded. if (!logSequenceNumbers.containsKey(managedObject.owningToken)) { logSequenceNumbers.put(managedObject.owningToken, new Long(0)); managedObjectSequenceNumbers.put(managedObject.owningToken, new Long(0)); } // if (!logSequenceNumbers.containsKey(managedObject.owningToken)). // Redrive the postAdd method for the object. managedObject.postAdd(transaction, true); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName); }
java
protected synchronized void addFromCheckpoint(ManagedObject managedObject, Transaction transaction) throws ObjectManagerException { final String methodName = "addFromCheckpoint"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName, new Object[] { managedObject, transaction }); // Make the ManagedObject ready for an addition. // Nothing went wrong during forward processing! managedObject.preAdd(transaction); // Only persistent objects are recovered from a checkpoint. setState(nextStateForInvolvePersistentObjectFromCheckpoint); // The object is now included in the transaction. includedManagedObjects.put(managedObject.owningToken, managedObject); // The ManagedObject was read from the ObjectStore, give it a low log // and ManagedObject sequence number so that any later operation will supercede this one. // The loggedSerialisedBytes will be unchanged, possibly null for this Token. // If there already a logSequenceNumber known for this token it must have been put // there after the checkpoint start and has already been superceded. if (!logSequenceNumbers.containsKey(managedObject.owningToken)) { logSequenceNumbers.put(managedObject.owningToken, new Long(0)); managedObjectSequenceNumbers.put(managedObject.owningToken, new Long(0)); } // if (!logSequenceNumbers.containsKey(managedObject.owningToken)). // Redrive the postAdd method for the object. managedObject.postAdd(transaction, true); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName); }
[ "protected", "synchronized", "void", "addFromCheckpoint", "(", "ManagedObject", "managedObject", ",", "Transaction", "transaction", ")", "throws", "ObjectManagerException", "{", "final", "String", "methodName", "=", "\"addFromCheckpoint\"", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "methodName", ",", "new", "Object", "[", "]", "{", "managedObject", ",", "transaction", "}", ")", ";", "// Make the ManagedObject ready for an addition.", "// Nothing went wrong during forward processing!", "managedObject", ".", "preAdd", "(", "transaction", ")", ";", "// Only persistent objects are recovered from a checkpoint.", "setState", "(", "nextStateForInvolvePersistentObjectFromCheckpoint", ")", ";", "// The object is now included in the transaction.", "includedManagedObjects", ".", "put", "(", "managedObject", ".", "owningToken", ",", "managedObject", ")", ";", "// The ManagedObject was read from the ObjectStore, give it a low log", "// and ManagedObject sequence number so that any later operation will supercede this one.", "// The loggedSerialisedBytes will be unchanged, possibly null for this Token.", "// If there already a logSequenceNumber known for this token it must have been put", "// there after the checkpoint start and has already been superceded.", "if", "(", "!", "logSequenceNumbers", ".", "containsKey", "(", "managedObject", ".", "owningToken", ")", ")", "{", "logSequenceNumbers", ".", "put", "(", "managedObject", ".", "owningToken", ",", "new", "Long", "(", "0", ")", ")", ";", "managedObjectSequenceNumbers", ".", "put", "(", "managedObject", ".", "owningToken", ",", "new", "Long", "(", "0", ")", ")", ";", "}", "// if (!logSequenceNumbers.containsKey(managedObject.owningToken)).", "// Redrive the postAdd method for the object.", "managedObject", ".", "postAdd", "(", "transaction", ",", "true", ")", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "methodName", ")", ";", "}" ]
Recover an Add operation from a checkpoint. @param managedObject being added. @param transaction the external Transaction. @throws ObjectManagerException
[ "Recover", "an", "Add", "operation", "from", "a", "checkpoint", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/InternalTransaction.java#L874-L908
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/InternalTransaction.java
InternalTransaction.replaceFromCheckpoint
protected synchronized void replaceFromCheckpoint(ManagedObject managedObject, byte[] serializedBytes, Transaction transaction) throws ObjectManagerException { final String methodName = "replaceFromCheckpoint"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName, new Object[] { managedObject, new Integer(serializedBytes.length), transaction }); // Make the ManagedObject ready for a replace operation. // Nothing went wrong during forward processing! managedObject.preReplace(transaction); // Only persistent objects are recovered from a checkpoint. setState(nextStateForInvolvePersistentObjectFromCheckpoint); // The object is now included in the transaction. includedManagedObjects.put(managedObject.owningToken, managedObject); // The ManagedObject was read from the log, give it a low log // and ManagedObject sequence number so that any later operation will supercede this one. // The loggedSerialisedBytes will be unchanged, possibly null for this Token. // If there already a logSequenceNumber known for this token it must have been put // there after the checkpoint start and has already been superceded. if (!logSequenceNumbers.containsKey(managedObject.owningToken)) { logSequenceNumbers.put(managedObject.owningToken, new Long(0)); managedObjectSequenceNumbers.put(managedObject.owningToken, new Long(0)); // Remember what we originally logged in case we commit this version of the ManagedObject. // Replacements are not written to the ObjectStore for a checkpoint becauise that would // remove any before image which we would need if the object backed out. loggedSerializedBytes.put(managedObject.owningToken , serializedBytes ); } // if (!logSequenceNumbers.containsKey(token)). // Redrive the postReplace method for the object. managedObject.postReplace(transaction, true); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName); }
java
protected synchronized void replaceFromCheckpoint(ManagedObject managedObject, byte[] serializedBytes, Transaction transaction) throws ObjectManagerException { final String methodName = "replaceFromCheckpoint"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName, new Object[] { managedObject, new Integer(serializedBytes.length), transaction }); // Make the ManagedObject ready for a replace operation. // Nothing went wrong during forward processing! managedObject.preReplace(transaction); // Only persistent objects are recovered from a checkpoint. setState(nextStateForInvolvePersistentObjectFromCheckpoint); // The object is now included in the transaction. includedManagedObjects.put(managedObject.owningToken, managedObject); // The ManagedObject was read from the log, give it a low log // and ManagedObject sequence number so that any later operation will supercede this one. // The loggedSerialisedBytes will be unchanged, possibly null for this Token. // If there already a logSequenceNumber known for this token it must have been put // there after the checkpoint start and has already been superceded. if (!logSequenceNumbers.containsKey(managedObject.owningToken)) { logSequenceNumbers.put(managedObject.owningToken, new Long(0)); managedObjectSequenceNumbers.put(managedObject.owningToken, new Long(0)); // Remember what we originally logged in case we commit this version of the ManagedObject. // Replacements are not written to the ObjectStore for a checkpoint becauise that would // remove any before image which we would need if the object backed out. loggedSerializedBytes.put(managedObject.owningToken , serializedBytes ); } // if (!logSequenceNumbers.containsKey(token)). // Redrive the postReplace method for the object. managedObject.postReplace(transaction, true); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName); }
[ "protected", "synchronized", "void", "replaceFromCheckpoint", "(", "ManagedObject", "managedObject", ",", "byte", "[", "]", "serializedBytes", ",", "Transaction", "transaction", ")", "throws", "ObjectManagerException", "{", "final", "String", "methodName", "=", "\"replaceFromCheckpoint\"", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "methodName", ",", "new", "Object", "[", "]", "{", "managedObject", ",", "new", "Integer", "(", "serializedBytes", ".", "length", ")", ",", "transaction", "}", ")", ";", "// Make the ManagedObject ready for a replace operation.", "// Nothing went wrong during forward processing!", "managedObject", ".", "preReplace", "(", "transaction", ")", ";", "// Only persistent objects are recovered from a checkpoint.", "setState", "(", "nextStateForInvolvePersistentObjectFromCheckpoint", ")", ";", "// The object is now included in the transaction.", "includedManagedObjects", ".", "put", "(", "managedObject", ".", "owningToken", ",", "managedObject", ")", ";", "// The ManagedObject was read from the log, give it a low log", "// and ManagedObject sequence number so that any later operation will supercede this one.", "// The loggedSerialisedBytes will be unchanged, possibly null for this Token.", "// If there already a logSequenceNumber known for this token it must have been put", "// there after the checkpoint start and has already been superceded.", "if", "(", "!", "logSequenceNumbers", ".", "containsKey", "(", "managedObject", ".", "owningToken", ")", ")", "{", "logSequenceNumbers", ".", "put", "(", "managedObject", ".", "owningToken", ",", "new", "Long", "(", "0", ")", ")", ";", "managedObjectSequenceNumbers", ".", "put", "(", "managedObject", ".", "owningToken", ",", "new", "Long", "(", "0", ")", ")", ";", "// Remember what we originally logged in case we commit this version of the ManagedObject.", "// Replacements are not written to the ObjectStore for a checkpoint becauise that would", "// remove any before image which we would need if the object backed out.", "loggedSerializedBytes", ".", "put", "(", "managedObject", ".", "owningToken", ",", "serializedBytes", ")", ";", "}", "// if (!logSequenceNumbers.containsKey(token)).", "// Redrive the postReplace method for the object.", "managedObject", ".", "postReplace", "(", "transaction", ",", "true", ")", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "methodName", ")", ";", "}" ]
Recover a Replace operation from a checkpoint. @param managedObject recovered from a checkpoint. @param serializedBytes representing the serialized form of the ManagedObject originally logged. @param transaction the external Transaction. @throws ObjectManagerException
[ "Recover", "a", "Replace", "operation", "from", "a", "checkpoint", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/InternalTransaction.java#L1078-L1120
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/InternalTransaction.java
InternalTransaction.prepare
protected synchronized void prepare(Transaction transaction) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "prepare" , "transaction=" + transaction + "(Trasnaction)" ); // To defend against two application threads completing the same transaction and trying to // continue with it at the same time we check that the Transaction still refers to this one, // now that we are synchronized on the InternalTransaction. if (transaction.internalTransaction != this) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, "prepare", new Object[] { "via InvalidTransactionException", transaction.internalTransaction } ); // Same behaviour as if the transaction was completed and replaced by // objectManagerState.dummyInternalTransaction. throw new InvalidStateException(this, InternalTransaction.stateTerminated, InternalTransaction.stateNames[InternalTransaction.stateTerminated]); } // if (transaction.internalTransaction != this). prePrepare(transaction); // Give ManagedObjects a chance to get ready. // Is there any logging to do? if (state == statePrePreparedPersistent) { // Logging work to do. TransactionPrepareLogRecord transactionPrepareLogRecord = new TransactionPrepareLogRecord(this); objectManagerState.logOutput.writeNext(transactionPrepareLogRecord , 0 , true , true); } // If logging work to do. // ManagedObjects do nothing at prepare time. // // Drive prepare method of objects included in this transaction. // for (java.util.Iterator managedObjectIterator = includedManagedObjects.iterator(); // managedObjectIterator.hasNext(); // ) { // ManagedObject managedObject = (ManagedObject)managedObjectIterator.next(); // managedObject.prepare(transaction); // } // for... includedManagedObjects. setState(nextStateForPrepare); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "prepare" ); }
java
protected synchronized void prepare(Transaction transaction) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "prepare" , "transaction=" + transaction + "(Trasnaction)" ); // To defend against two application threads completing the same transaction and trying to // continue with it at the same time we check that the Transaction still refers to this one, // now that we are synchronized on the InternalTransaction. if (transaction.internalTransaction != this) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, "prepare", new Object[] { "via InvalidTransactionException", transaction.internalTransaction } ); // Same behaviour as if the transaction was completed and replaced by // objectManagerState.dummyInternalTransaction. throw new InvalidStateException(this, InternalTransaction.stateTerminated, InternalTransaction.stateNames[InternalTransaction.stateTerminated]); } // if (transaction.internalTransaction != this). prePrepare(transaction); // Give ManagedObjects a chance to get ready. // Is there any logging to do? if (state == statePrePreparedPersistent) { // Logging work to do. TransactionPrepareLogRecord transactionPrepareLogRecord = new TransactionPrepareLogRecord(this); objectManagerState.logOutput.writeNext(transactionPrepareLogRecord , 0 , true , true); } // If logging work to do. // ManagedObjects do nothing at prepare time. // // Drive prepare method of objects included in this transaction. // for (java.util.Iterator managedObjectIterator = includedManagedObjects.iterator(); // managedObjectIterator.hasNext(); // ) { // ManagedObject managedObject = (ManagedObject)managedObjectIterator.next(); // managedObject.prepare(transaction); // } // for... includedManagedObjects. setState(nextStateForPrepare); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "prepare" ); }
[ "protected", "synchronized", "void", "prepare", "(", "Transaction", "transaction", ")", "throws", "ObjectManagerException", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "\"prepare\"", ",", "\"transaction=\"", "+", "transaction", "+", "\"(Trasnaction)\"", ")", ";", "// To defend against two application threads completing the same transaction and trying to", "// continue with it at the same time we check that the Transaction still refers to this one,", "// now that we are synchronized on the InternalTransaction.", "if", "(", "transaction", ".", "internalTransaction", "!=", "this", ")", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"prepare\"", ",", "new", "Object", "[", "]", "{", "\"via InvalidTransactionException\"", ",", "transaction", ".", "internalTransaction", "}", ")", ";", "// Same behaviour as if the transaction was completed and replaced by", "// objectManagerState.dummyInternalTransaction.", "throw", "new", "InvalidStateException", "(", "this", ",", "InternalTransaction", ".", "stateTerminated", ",", "InternalTransaction", ".", "stateNames", "[", "InternalTransaction", ".", "stateTerminated", "]", ")", ";", "}", "// if (transaction.internalTransaction != this).", "prePrepare", "(", "transaction", ")", ";", "// Give ManagedObjects a chance to get ready.", "// Is there any logging to do?", "if", "(", "state", "==", "statePrePreparedPersistent", ")", "{", "// Logging work to do.", "TransactionPrepareLogRecord", "transactionPrepareLogRecord", "=", "new", "TransactionPrepareLogRecord", "(", "this", ")", ";", "objectManagerState", ".", "logOutput", ".", "writeNext", "(", "transactionPrepareLogRecord", ",", "0", ",", "true", ",", "true", ")", ";", "}", "// If logging work to do.", "// ManagedObjects do nothing at prepare time.", "// // Drive prepare method of objects included in this transaction.", "// for (java.util.Iterator managedObjectIterator = includedManagedObjects.iterator();", "// managedObjectIterator.hasNext();", "// ) {", "// ManagedObject managedObject = (ManagedObject)managedObjectIterator.next();", "// managedObject.prepare(transaction);", "// } // for... includedManagedObjects.", "setState", "(", "nextStateForPrepare", ")", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"prepare\"", ")", ";", "}" ]
Prepare the transaction. After execution of this method the users of this transaction shall not perform any further work as part of the logical unit of work, or modify any of the objects that are referenced by the transaction. We have already spooled the add and delete log records for persistent objects. Since we are performing a two phase commit we force a prepare record. The Objects already have space reserved in the object store. @param transaction the external Transaction.
[ "Prepare", "the", "transaction", ".", "After", "execution", "of", "this", "method", "the", "users", "of", "this", "transaction", "shall", "not", "perform", "any", "further", "work", "as", "part", "of", "the", "logical", "unit", "of", "work", "or", "modify", "any", "of", "the", "objects", "that", "are", "referenced", "by", "the", "transaction", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/InternalTransaction.java#L1759-L1812
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/InternalTransaction.java
InternalTransaction.commit
protected void commit(boolean reUse, Transaction transaction) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "commit" , new Object[] { new Boolean(reUse), transaction } ); boolean persistentWorkDone = false; ManagedObject[] lockedManagedObjects; int numberOfLockedManagedObjects = 0; synchronized (this) { // To defend against two application threads completing the same transaction and trying to // continue with it at the same time we check that the Transaction still refers to this one, // now that we are synchronized on the InternalTransaction. if (transaction.internalTransaction != this) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, "commit", new Object[] { "via InvalidTransactionException", transaction.internalTransaction } ); // Same behaviour as if the transaction was completed and replaced by // objectManagerState.dummyInternalTransaction. throw new InvalidStateException(this, InternalTransaction.stateTerminated, InternalTransaction.stateNames[InternalTransaction.stateTerminated]); } // if (transaction.internalTransaction != this). if (state == stateInactive || state == stateActiveNonPersistent || state == stateActivePersistent) { // Only call prePrepare if we have not already prepared the transaction. prePrepare(transaction); } // If already prepared. testState(nextStateForStartCommit); setState(nextStateForStartCommit); preCommit(transaction); // Tell ManagedObjects the outcome. // Is there any logging to do? We only need to write log records if the // transaction involves persistent objects. if (state == stateCommitingPersistent) { persistentWorkDone = true; TransactionCommitLogRecord transactionCommitLogRecord = new TransactionCommitLogRecord(this); objectManagerState.logOutput.writeNext(transactionCommitLogRecord, -logSpaceReserved, true, true); logSpaceReserved = 0; } // If logging work to do. // Drive the commit method for the included objects. // The synchronized block prevents us from taking a checkpoint until all of the // ManagedObjects have had their opportunity to update the ObjecStore. If a // checkpoint is currently active we will update the current checkpoint set in // the ObjecStore, if not we will update the next set of updates. lockedManagedObjects = new ManagedObject[includedManagedObjects.size()]; boolean requiresCurrentPersistentCheckpoint = requiresPersistentCheckpoint || (objectManagerState.checkpointStarting == ObjectManagerState.CHECKPOINT_STARTING_PERSISTENT); for (java.util.Iterator managedObjectIterator = includedManagedObjects.values() .iterator(); managedObjectIterator.hasNext();) { ManagedObject managedObject = (ManagedObject) managedObjectIterator.next(); // The logged serializedBytes will be null if the ManagedObject was deleted by this transaction // or if it was added from a transactionCheckpointLogRecord at restart, because the // Object Store will already have copy of this ManagedObject. ObjectManagerByteArrayOutputStream serializedBytes = (ObjectManagerByteArrayOutputStream) loggedSerializedBytes.get(managedObject.owningToken); long managedObjectSequenceNumber = ((Long) managedObjectSequenceNumbers.get(managedObject.owningToken)).longValue(); // If the Object was not locked by this transaction it must have been an optimistic update. if (managedObject.lockedBy(transaction)) { managedObject.commit(transaction, serializedBytes, managedObjectSequenceNumber, requiresCurrentPersistentCheckpoint); lockedManagedObjects[numberOfLockedManagedObjects++] = managedObject; } else { managedObject.optimisticReplaceCommit(transaction, serializedBytes, managedObjectSequenceNumber, requiresCurrentPersistentCheckpoint); } } // for... includedManagedObjects. setState(nextStateForCommit); transactionLock.unLock(objectManagerState); postCommit(transaction); // Tell ManagedObjects the outcome is complete. // Tidy up the transaction. complete(reUse, transaction); } // synchronized (this). // We don't want to clear the transaction lock held by the managedObject otherwise // ManagedObject.wasLocked() will not be able to give the past locked state. The // Unlock point wa noted above so now notify the ManagedObject and give a new // waiter a chance to acquire the lock. If a new transaction acquires the lock then // ManagedObject.wasLocked will return its result for the new transaction and // wasLocked() will then be true for an even later time. Do this after we have release the // synchronize lock on InternalTransaction so that we avoid deadlock with ManagedObjects // that invoke synchronized InternalTransaction methods. for (int i = 0; i < numberOfLockedManagedObjects; i++) { synchronized (lockedManagedObjects[i]) { lockedManagedObjects[i].notify(); } // synchronized (lockedManagedObjects[i]). } // for... lockedManagedObjects. // Tell the ObjectManager that we are done, once the transaction is unlocked // in case it is needed for checkpoint. objectManagerState.transactionCompleted(this, persistentWorkDone); // See if we need to delay while a checkpoint completes. Applications amy ask to reUSe // the same transaction, if so we introduce the delay here. Internal transactions are never // reUsed so we don't need to wory about blocking them. This call must be made when we // are not synchronized on the transaction because it might block waiting for a checkpoint // to complete if the log is full. if (reUse) objectManagerState.transactionPacing(); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "commit" ); }
java
protected void commit(boolean reUse, Transaction transaction) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "commit" , new Object[] { new Boolean(reUse), transaction } ); boolean persistentWorkDone = false; ManagedObject[] lockedManagedObjects; int numberOfLockedManagedObjects = 0; synchronized (this) { // To defend against two application threads completing the same transaction and trying to // continue with it at the same time we check that the Transaction still refers to this one, // now that we are synchronized on the InternalTransaction. if (transaction.internalTransaction != this) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, "commit", new Object[] { "via InvalidTransactionException", transaction.internalTransaction } ); // Same behaviour as if the transaction was completed and replaced by // objectManagerState.dummyInternalTransaction. throw new InvalidStateException(this, InternalTransaction.stateTerminated, InternalTransaction.stateNames[InternalTransaction.stateTerminated]); } // if (transaction.internalTransaction != this). if (state == stateInactive || state == stateActiveNonPersistent || state == stateActivePersistent) { // Only call prePrepare if we have not already prepared the transaction. prePrepare(transaction); } // If already prepared. testState(nextStateForStartCommit); setState(nextStateForStartCommit); preCommit(transaction); // Tell ManagedObjects the outcome. // Is there any logging to do? We only need to write log records if the // transaction involves persistent objects. if (state == stateCommitingPersistent) { persistentWorkDone = true; TransactionCommitLogRecord transactionCommitLogRecord = new TransactionCommitLogRecord(this); objectManagerState.logOutput.writeNext(transactionCommitLogRecord, -logSpaceReserved, true, true); logSpaceReserved = 0; } // If logging work to do. // Drive the commit method for the included objects. // The synchronized block prevents us from taking a checkpoint until all of the // ManagedObjects have had their opportunity to update the ObjecStore. If a // checkpoint is currently active we will update the current checkpoint set in // the ObjecStore, if not we will update the next set of updates. lockedManagedObjects = new ManagedObject[includedManagedObjects.size()]; boolean requiresCurrentPersistentCheckpoint = requiresPersistentCheckpoint || (objectManagerState.checkpointStarting == ObjectManagerState.CHECKPOINT_STARTING_PERSISTENT); for (java.util.Iterator managedObjectIterator = includedManagedObjects.values() .iterator(); managedObjectIterator.hasNext();) { ManagedObject managedObject = (ManagedObject) managedObjectIterator.next(); // The logged serializedBytes will be null if the ManagedObject was deleted by this transaction // or if it was added from a transactionCheckpointLogRecord at restart, because the // Object Store will already have copy of this ManagedObject. ObjectManagerByteArrayOutputStream serializedBytes = (ObjectManagerByteArrayOutputStream) loggedSerializedBytes.get(managedObject.owningToken); long managedObjectSequenceNumber = ((Long) managedObjectSequenceNumbers.get(managedObject.owningToken)).longValue(); // If the Object was not locked by this transaction it must have been an optimistic update. if (managedObject.lockedBy(transaction)) { managedObject.commit(transaction, serializedBytes, managedObjectSequenceNumber, requiresCurrentPersistentCheckpoint); lockedManagedObjects[numberOfLockedManagedObjects++] = managedObject; } else { managedObject.optimisticReplaceCommit(transaction, serializedBytes, managedObjectSequenceNumber, requiresCurrentPersistentCheckpoint); } } // for... includedManagedObjects. setState(nextStateForCommit); transactionLock.unLock(objectManagerState); postCommit(transaction); // Tell ManagedObjects the outcome is complete. // Tidy up the transaction. complete(reUse, transaction); } // synchronized (this). // We don't want to clear the transaction lock held by the managedObject otherwise // ManagedObject.wasLocked() will not be able to give the past locked state. The // Unlock point wa noted above so now notify the ManagedObject and give a new // waiter a chance to acquire the lock. If a new transaction acquires the lock then // ManagedObject.wasLocked will return its result for the new transaction and // wasLocked() will then be true for an even later time. Do this after we have release the // synchronize lock on InternalTransaction so that we avoid deadlock with ManagedObjects // that invoke synchronized InternalTransaction methods. for (int i = 0; i < numberOfLockedManagedObjects; i++) { synchronized (lockedManagedObjects[i]) { lockedManagedObjects[i].notify(); } // synchronized (lockedManagedObjects[i]). } // for... lockedManagedObjects. // Tell the ObjectManager that we are done, once the transaction is unlocked // in case it is needed for checkpoint. objectManagerState.transactionCompleted(this, persistentWorkDone); // See if we need to delay while a checkpoint completes. Applications amy ask to reUSe // the same transaction, if so we introduce the delay here. Internal transactions are never // reUsed so we don't need to wory about blocking them. This call must be made when we // are not synchronized on the transaction because it might block waiting for a checkpoint // to complete if the log is full. if (reUse) objectManagerState.transactionPacing(); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "commit" ); }
[ "protected", "void", "commit", "(", "boolean", "reUse", ",", "Transaction", "transaction", ")", "throws", "ObjectManagerException", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "\"commit\"", ",", "new", "Object", "[", "]", "{", "new", "Boolean", "(", "reUse", ")", ",", "transaction", "}", ")", ";", "boolean", "persistentWorkDone", "=", "false", ";", "ManagedObject", "[", "]", "lockedManagedObjects", ";", "int", "numberOfLockedManagedObjects", "=", "0", ";", "synchronized", "(", "this", ")", "{", "// To defend against two application threads completing the same transaction and trying to", "// continue with it at the same time we check that the Transaction still refers to this one,", "// now that we are synchronized on the InternalTransaction.", "if", "(", "transaction", ".", "internalTransaction", "!=", "this", ")", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"commit\"", ",", "new", "Object", "[", "]", "{", "\"via InvalidTransactionException\"", ",", "transaction", ".", "internalTransaction", "}", ")", ";", "// Same behaviour as if the transaction was completed and replaced by", "// objectManagerState.dummyInternalTransaction.", "throw", "new", "InvalidStateException", "(", "this", ",", "InternalTransaction", ".", "stateTerminated", ",", "InternalTransaction", ".", "stateNames", "[", "InternalTransaction", ".", "stateTerminated", "]", ")", ";", "}", "// if (transaction.internalTransaction != this).", "if", "(", "state", "==", "stateInactive", "||", "state", "==", "stateActiveNonPersistent", "||", "state", "==", "stateActivePersistent", ")", "{", "// Only call prePrepare if we have not already prepared the transaction.", "prePrepare", "(", "transaction", ")", ";", "}", "// If already prepared.", "testState", "(", "nextStateForStartCommit", ")", ";", "setState", "(", "nextStateForStartCommit", ")", ";", "preCommit", "(", "transaction", ")", ";", "// Tell ManagedObjects the outcome.", "// Is there any logging to do? We only need to write log records if the", "// transaction involves persistent objects.", "if", "(", "state", "==", "stateCommitingPersistent", ")", "{", "persistentWorkDone", "=", "true", ";", "TransactionCommitLogRecord", "transactionCommitLogRecord", "=", "new", "TransactionCommitLogRecord", "(", "this", ")", ";", "objectManagerState", ".", "logOutput", ".", "writeNext", "(", "transactionCommitLogRecord", ",", "-", "logSpaceReserved", ",", "true", ",", "true", ")", ";", "logSpaceReserved", "=", "0", ";", "}", "// If logging work to do.", "// Drive the commit method for the included objects.", "// The synchronized block prevents us from taking a checkpoint until all of the", "// ManagedObjects have had their opportunity to update the ObjecStore. If a", "// checkpoint is currently active we will update the current checkpoint set in", "// the ObjecStore, if not we will update the next set of updates.", "lockedManagedObjects", "=", "new", "ManagedObject", "[", "includedManagedObjects", ".", "size", "(", ")", "]", ";", "boolean", "requiresCurrentPersistentCheckpoint", "=", "requiresPersistentCheckpoint", "||", "(", "objectManagerState", ".", "checkpointStarting", "==", "ObjectManagerState", ".", "CHECKPOINT_STARTING_PERSISTENT", ")", ";", "for", "(", "java", ".", "util", ".", "Iterator", "managedObjectIterator", "=", "includedManagedObjects", ".", "values", "(", ")", ".", "iterator", "(", ")", ";", "managedObjectIterator", ".", "hasNext", "(", ")", ";", ")", "{", "ManagedObject", "managedObject", "=", "(", "ManagedObject", ")", "managedObjectIterator", ".", "next", "(", ")", ";", "// The logged serializedBytes will be null if the ManagedObject was deleted by this transaction", "// or if it was added from a transactionCheckpointLogRecord at restart, because the", "// Object Store will already have copy of this ManagedObject.", "ObjectManagerByteArrayOutputStream", "serializedBytes", "=", "(", "ObjectManagerByteArrayOutputStream", ")", "loggedSerializedBytes", ".", "get", "(", "managedObject", ".", "owningToken", ")", ";", "long", "managedObjectSequenceNumber", "=", "(", "(", "Long", ")", "managedObjectSequenceNumbers", ".", "get", "(", "managedObject", ".", "owningToken", ")", ")", ".", "longValue", "(", ")", ";", "// If the Object was not locked by this transaction it must have been an optimistic update.", "if", "(", "managedObject", ".", "lockedBy", "(", "transaction", ")", ")", "{", "managedObject", ".", "commit", "(", "transaction", ",", "serializedBytes", ",", "managedObjectSequenceNumber", ",", "requiresCurrentPersistentCheckpoint", ")", ";", "lockedManagedObjects", "[", "numberOfLockedManagedObjects", "++", "]", "=", "managedObject", ";", "}", "else", "{", "managedObject", ".", "optimisticReplaceCommit", "(", "transaction", ",", "serializedBytes", ",", "managedObjectSequenceNumber", ",", "requiresCurrentPersistentCheckpoint", ")", ";", "}", "}", "// for... includedManagedObjects.", "setState", "(", "nextStateForCommit", ")", ";", "transactionLock", ".", "unLock", "(", "objectManagerState", ")", ";", "postCommit", "(", "transaction", ")", ";", "// Tell ManagedObjects the outcome is complete.", "// Tidy up the transaction.", "complete", "(", "reUse", ",", "transaction", ")", ";", "}", "// synchronized (this).", "// We don't want to clear the transaction lock held by the managedObject otherwise", "// ManagedObject.wasLocked() will not be able to give the past locked state. The", "// Unlock point wa noted above so now notify the ManagedObject and give a new", "// waiter a chance to acquire the lock. If a new transaction acquires the lock then", "// ManagedObject.wasLocked will return its result for the new transaction and", "// wasLocked() will then be true for an even later time. Do this after we have release the", "// synchronize lock on InternalTransaction so that we avoid deadlock with ManagedObjects", "// that invoke synchronized InternalTransaction methods.", "for", "(", "int", "i", "=", "0", ";", "i", "<", "numberOfLockedManagedObjects", ";", "i", "++", ")", "{", "synchronized", "(", "lockedManagedObjects", "[", "i", "]", ")", "{", "lockedManagedObjects", "[", "i", "]", ".", "notify", "(", ")", ";", "}", "// synchronized (lockedManagedObjects[i]).", "}", "// for... lockedManagedObjects.", "// Tell the ObjectManager that we are done, once the transaction is unlocked", "// in case it is needed for checkpoint.", "objectManagerState", ".", "transactionCompleted", "(", "this", ",", "persistentWorkDone", ")", ";", "// See if we need to delay while a checkpoint completes. Applications amy ask to reUSe", "// the same transaction, if so we introduce the delay here. Internal transactions are never", "// reUsed so we don't need to wory about blocking them. This call must be made when we", "// are not synchronized on the transaction because it might block waiting for a checkpoint", "// to complete if the log is full.", "if", "(", "reUse", ")", "objectManagerState", ".", "transactionPacing", "(", ")", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"commit\"", ")", ";", "}" ]
Commit the transaction. Fore write a commit record to the log. Unlock the objects that are part of this logical unit of work. @param reUse true indicates that the transaction is terminated and then reused with another logical unit of work. @param transaction the external Transaction. @throws ObjectManagerException
[ "Commit", "the", "transaction", ".", "Fore", "write", "a", "commit", "record", "to", "the", "log", ".", "Unlock", "the", "objects", "that", "are", "part", "of", "this", "logical", "unit", "of", "work", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/InternalTransaction.java#L1857-L1986
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/InternalTransaction.java
InternalTransaction.backout
protected void backout(boolean reUse, Transaction transaction) throws ObjectManagerException { final String methodName = "backout"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName, new Object[] { new Boolean(reUse), transaction }); boolean persistentWorkDone = false; ManagedObject[] lockedManagedObjects; int numberOfLockedManagedObjects = 0; synchronized (this) { // To defend against two application threads completing the same transaction and trying to // continue with it at the same time we check that the Transaction still refers to this one, // now that we are synchronized on the InternalTransaction. if (transaction.internalTransaction != this) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName, new Object[] { "via InvalidTransactionException", transaction.internalTransaction } ); // Same behaviour as if the transaction was completed and replaced by // objectManagerState.dummyInternalTransaction. throw new InvalidStateException(this, InternalTransaction.stateTerminated, InternalTransaction.stateNames[InternalTransaction.stateTerminated]); } // if (transaction.internalTransaction != this). // Only call prePrepare if we have not already prepared the transaction. if (state == stateInactive || state == stateActiveNonPersistent || state == stateActivePersistent) { prePrepare(transaction); } // If already prepared. testState(nextStateForStartBackout); setState(nextStateForStartBackout); preBackout(transaction); // Tell ManagedObjects the outcome. // Is there any logging to do? if (state == stateBackingOutPersistent) { persistentWorkDone = true; TransactionBackoutLogRecord transactionBackoutLogRecord = new TransactionBackoutLogRecord(this); objectManagerState.logOutput.writeNext(transactionBackoutLogRecord, -logSpaceReserved, true, true); logSpaceReserved = 0; } // If logging work to do. // Drive the backout method for the included objects. // The synchronized block prevents us from taking a checkpoint until all of the // ManagedObjects have had their opportunity to update the ObjectStore. If a // checkpoint is currently active we will update the current checkpoint set in // the ObjectStore, if not we will update the next set of updates. lockedManagedObjects = new ManagedObject[includedManagedObjects.size()]; boolean requiresCurrentPersistentCheckpoint = requiresPersistentCheckpoint || (objectManagerState.checkpointStarting == ObjectManagerState.CHECKPOINT_STARTING_PERSISTENT); for (java.util.Iterator managedObjectIterator = includedManagedObjects.values().iterator(); managedObjectIterator.hasNext();) { ManagedObject managedObject = (ManagedObject) managedObjectIterator.next(); long managedObjectSequenceNumber = ((Long) managedObjectSequenceNumbers.get(managedObject.owningToken)).longValue(); if (managedObject.lockedBy(transaction)) { managedObject.backout(transaction, managedObjectSequenceNumber, requiresCurrentPersistentCheckpoint); lockedManagedObjects[numberOfLockedManagedObjects++] = managedObject; } else { ObjectManagerByteArrayOutputStream serializedBytes = (ObjectManagerByteArrayOutputStream) loggedSerializedBytes.get(managedObject.owningToken); managedObject.optimisticReplaceBackout(transaction, serializedBytes, managedObjectSequenceNumber, requiresCurrentPersistentCheckpoint); } // if(managedObject.lockedBy(transaction)). } // for... includedManagedObjects. setState(nextStateForBackout); transactionLock.unLock(objectManagerState); postBackout(transaction); // Tell ManagedObjects the outcome is complete. // Tidy up the transaction. complete(reUse, transaction); } // synchronized (this). // We don't want to clear the transaction lock held by the managedObject otherwise // ManagedObject.wasLocked() will not be able to give the past locked state. The // Unlock point wa noted above so now notify the ManagedObject and give a new // waiter a chance to acquire the lock. If a new transaction acquires the lock then // ManagedObject.wasLocked will return its result for the new transaction and // wasLocked() will then be true for an even later time. Do this after we have release the // synchronize lock on InternalTransaction so that we avoid deadlock with ManagedObjects // that invoke synchronized InternalTransaction methods. for (int i = 0; i < numberOfLockedManagedObjects; i++) { synchronized (lockedManagedObjects[i]) { lockedManagedObjects[i].notify(); } // synchronized (lockedManagedObjects[i]). } // for... lockedManagedObjects. // Tell the ObjectManager that we are done, once the transaction is unlocked // in case it is needed for checkpoint. objectManagerState.transactionCompleted(this, persistentWorkDone); // See if we need to delay while a checkpoint completes. Applications amy ask to reUSe // the same transaction, if so we introduce the delay here. Internal transactions are never // reUsed so we don't need to wory about blocking them. This call must be made when we // are not synchronized on the transaction because it might block waiting for a checkpoint // to complete if the log is full. if (reUse) objectManagerState.transactionPacing(); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName); }
java
protected void backout(boolean reUse, Transaction transaction) throws ObjectManagerException { final String methodName = "backout"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName, new Object[] { new Boolean(reUse), transaction }); boolean persistentWorkDone = false; ManagedObject[] lockedManagedObjects; int numberOfLockedManagedObjects = 0; synchronized (this) { // To defend against two application threads completing the same transaction and trying to // continue with it at the same time we check that the Transaction still refers to this one, // now that we are synchronized on the InternalTransaction. if (transaction.internalTransaction != this) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName, new Object[] { "via InvalidTransactionException", transaction.internalTransaction } ); // Same behaviour as if the transaction was completed and replaced by // objectManagerState.dummyInternalTransaction. throw new InvalidStateException(this, InternalTransaction.stateTerminated, InternalTransaction.stateNames[InternalTransaction.stateTerminated]); } // if (transaction.internalTransaction != this). // Only call prePrepare if we have not already prepared the transaction. if (state == stateInactive || state == stateActiveNonPersistent || state == stateActivePersistent) { prePrepare(transaction); } // If already prepared. testState(nextStateForStartBackout); setState(nextStateForStartBackout); preBackout(transaction); // Tell ManagedObjects the outcome. // Is there any logging to do? if (state == stateBackingOutPersistent) { persistentWorkDone = true; TransactionBackoutLogRecord transactionBackoutLogRecord = new TransactionBackoutLogRecord(this); objectManagerState.logOutput.writeNext(transactionBackoutLogRecord, -logSpaceReserved, true, true); logSpaceReserved = 0; } // If logging work to do. // Drive the backout method for the included objects. // The synchronized block prevents us from taking a checkpoint until all of the // ManagedObjects have had their opportunity to update the ObjectStore. If a // checkpoint is currently active we will update the current checkpoint set in // the ObjectStore, if not we will update the next set of updates. lockedManagedObjects = new ManagedObject[includedManagedObjects.size()]; boolean requiresCurrentPersistentCheckpoint = requiresPersistentCheckpoint || (objectManagerState.checkpointStarting == ObjectManagerState.CHECKPOINT_STARTING_PERSISTENT); for (java.util.Iterator managedObjectIterator = includedManagedObjects.values().iterator(); managedObjectIterator.hasNext();) { ManagedObject managedObject = (ManagedObject) managedObjectIterator.next(); long managedObjectSequenceNumber = ((Long) managedObjectSequenceNumbers.get(managedObject.owningToken)).longValue(); if (managedObject.lockedBy(transaction)) { managedObject.backout(transaction, managedObjectSequenceNumber, requiresCurrentPersistentCheckpoint); lockedManagedObjects[numberOfLockedManagedObjects++] = managedObject; } else { ObjectManagerByteArrayOutputStream serializedBytes = (ObjectManagerByteArrayOutputStream) loggedSerializedBytes.get(managedObject.owningToken); managedObject.optimisticReplaceBackout(transaction, serializedBytes, managedObjectSequenceNumber, requiresCurrentPersistentCheckpoint); } // if(managedObject.lockedBy(transaction)). } // for... includedManagedObjects. setState(nextStateForBackout); transactionLock.unLock(objectManagerState); postBackout(transaction); // Tell ManagedObjects the outcome is complete. // Tidy up the transaction. complete(reUse, transaction); } // synchronized (this). // We don't want to clear the transaction lock held by the managedObject otherwise // ManagedObject.wasLocked() will not be able to give the past locked state. The // Unlock point wa noted above so now notify the ManagedObject and give a new // waiter a chance to acquire the lock. If a new transaction acquires the lock then // ManagedObject.wasLocked will return its result for the new transaction and // wasLocked() will then be true for an even later time. Do this after we have release the // synchronize lock on InternalTransaction so that we avoid deadlock with ManagedObjects // that invoke synchronized InternalTransaction methods. for (int i = 0; i < numberOfLockedManagedObjects; i++) { synchronized (lockedManagedObjects[i]) { lockedManagedObjects[i].notify(); } // synchronized (lockedManagedObjects[i]). } // for... lockedManagedObjects. // Tell the ObjectManager that we are done, once the transaction is unlocked // in case it is needed for checkpoint. objectManagerState.transactionCompleted(this, persistentWorkDone); // See if we need to delay while a checkpoint completes. Applications amy ask to reUSe // the same transaction, if so we introduce the delay here. Internal transactions are never // reUsed so we don't need to wory about blocking them. This call must be made when we // are not synchronized on the transaction because it might block waiting for a checkpoint // to complete if the log is full. if (reUse) objectManagerState.transactionPacing(); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName); }
[ "protected", "void", "backout", "(", "boolean", "reUse", ",", "Transaction", "transaction", ")", "throws", "ObjectManagerException", "{", "final", "String", "methodName", "=", "\"backout\"", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "methodName", ",", "new", "Object", "[", "]", "{", "new", "Boolean", "(", "reUse", ")", ",", "transaction", "}", ")", ";", "boolean", "persistentWorkDone", "=", "false", ";", "ManagedObject", "[", "]", "lockedManagedObjects", ";", "int", "numberOfLockedManagedObjects", "=", "0", ";", "synchronized", "(", "this", ")", "{", "// To defend against two application threads completing the same transaction and trying to", "// continue with it at the same time we check that the Transaction still refers to this one,", "// now that we are synchronized on the InternalTransaction.", "if", "(", "transaction", ".", "internalTransaction", "!=", "this", ")", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "methodName", ",", "new", "Object", "[", "]", "{", "\"via InvalidTransactionException\"", ",", "transaction", ".", "internalTransaction", "}", ")", ";", "// Same behaviour as if the transaction was completed and replaced by", "// objectManagerState.dummyInternalTransaction.", "throw", "new", "InvalidStateException", "(", "this", ",", "InternalTransaction", ".", "stateTerminated", ",", "InternalTransaction", ".", "stateNames", "[", "InternalTransaction", ".", "stateTerminated", "]", ")", ";", "}", "// if (transaction.internalTransaction != this).", "// Only call prePrepare if we have not already prepared the transaction.", "if", "(", "state", "==", "stateInactive", "||", "state", "==", "stateActiveNonPersistent", "||", "state", "==", "stateActivePersistent", ")", "{", "prePrepare", "(", "transaction", ")", ";", "}", "// If already prepared.", "testState", "(", "nextStateForStartBackout", ")", ";", "setState", "(", "nextStateForStartBackout", ")", ";", "preBackout", "(", "transaction", ")", ";", "// Tell ManagedObjects the outcome.", "// Is there any logging to do?", "if", "(", "state", "==", "stateBackingOutPersistent", ")", "{", "persistentWorkDone", "=", "true", ";", "TransactionBackoutLogRecord", "transactionBackoutLogRecord", "=", "new", "TransactionBackoutLogRecord", "(", "this", ")", ";", "objectManagerState", ".", "logOutput", ".", "writeNext", "(", "transactionBackoutLogRecord", ",", "-", "logSpaceReserved", ",", "true", ",", "true", ")", ";", "logSpaceReserved", "=", "0", ";", "}", "// If logging work to do.", "// Drive the backout method for the included objects.", "// The synchronized block prevents us from taking a checkpoint until all of the", "// ManagedObjects have had their opportunity to update the ObjectStore. If a", "// checkpoint is currently active we will update the current checkpoint set in", "// the ObjectStore, if not we will update the next set of updates.", "lockedManagedObjects", "=", "new", "ManagedObject", "[", "includedManagedObjects", ".", "size", "(", ")", "]", ";", "boolean", "requiresCurrentPersistentCheckpoint", "=", "requiresPersistentCheckpoint", "||", "(", "objectManagerState", ".", "checkpointStarting", "==", "ObjectManagerState", ".", "CHECKPOINT_STARTING_PERSISTENT", ")", ";", "for", "(", "java", ".", "util", ".", "Iterator", "managedObjectIterator", "=", "includedManagedObjects", ".", "values", "(", ")", ".", "iterator", "(", ")", ";", "managedObjectIterator", ".", "hasNext", "(", ")", ";", ")", "{", "ManagedObject", "managedObject", "=", "(", "ManagedObject", ")", "managedObjectIterator", ".", "next", "(", ")", ";", "long", "managedObjectSequenceNumber", "=", "(", "(", "Long", ")", "managedObjectSequenceNumbers", ".", "get", "(", "managedObject", ".", "owningToken", ")", ")", ".", "longValue", "(", ")", ";", "if", "(", "managedObject", ".", "lockedBy", "(", "transaction", ")", ")", "{", "managedObject", ".", "backout", "(", "transaction", ",", "managedObjectSequenceNumber", ",", "requiresCurrentPersistentCheckpoint", ")", ";", "lockedManagedObjects", "[", "numberOfLockedManagedObjects", "++", "]", "=", "managedObject", ";", "}", "else", "{", "ObjectManagerByteArrayOutputStream", "serializedBytes", "=", "(", "ObjectManagerByteArrayOutputStream", ")", "loggedSerializedBytes", ".", "get", "(", "managedObject", ".", "owningToken", ")", ";", "managedObject", ".", "optimisticReplaceBackout", "(", "transaction", ",", "serializedBytes", ",", "managedObjectSequenceNumber", ",", "requiresCurrentPersistentCheckpoint", ")", ";", "}", "// if(managedObject.lockedBy(transaction)).", "}", "// for... includedManagedObjects.", "setState", "(", "nextStateForBackout", ")", ";", "transactionLock", ".", "unLock", "(", "objectManagerState", ")", ";", "postBackout", "(", "transaction", ")", ";", "// Tell ManagedObjects the outcome is complete.", "// Tidy up the transaction.", "complete", "(", "reUse", ",", "transaction", ")", ";", "}", "// synchronized (this).", "// We don't want to clear the transaction lock held by the managedObject otherwise", "// ManagedObject.wasLocked() will not be able to give the past locked state. The", "// Unlock point wa noted above so now notify the ManagedObject and give a new", "// waiter a chance to acquire the lock. If a new transaction acquires the lock then", "// ManagedObject.wasLocked will return its result for the new transaction and", "// wasLocked() will then be true for an even later time. Do this after we have release the", "// synchronize lock on InternalTransaction so that we avoid deadlock with ManagedObjects", "// that invoke synchronized InternalTransaction methods.", "for", "(", "int", "i", "=", "0", ";", "i", "<", "numberOfLockedManagedObjects", ";", "i", "++", ")", "{", "synchronized", "(", "lockedManagedObjects", "[", "i", "]", ")", "{", "lockedManagedObjects", "[", "i", "]", ".", "notify", "(", ")", ";", "}", "// synchronized (lockedManagedObjects[i]).", "}", "// for... lockedManagedObjects.", "// Tell the ObjectManager that we are done, once the transaction is unlocked", "// in case it is needed for checkpoint.", "objectManagerState", ".", "transactionCompleted", "(", "this", ",", "persistentWorkDone", ")", ";", "// See if we need to delay while a checkpoint completes. Applications amy ask to reUSe", "// the same transaction, if so we introduce the delay here. Internal transactions are never", "// reUsed so we don't need to wory about blocking them. This call must be made when we", "// are not synchronized on the transaction because it might block waiting for a checkpoint", "// to complete if the log is full.", "if", "(", "reUse", ")", "objectManagerState", ".", "transactionPacing", "(", ")", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "methodName", ")", ";", "}" ]
Rollback the transacion. Force a backout record to the log. @param reUse Indicates whether the transaction is terminated or can be reused for another logical unit of work. @param transaction the external Transaction. @throws ObjectManagerException
[ "Rollback", "the", "transacion", ".", "Force", "a", "backout", "record", "to", "the", "log", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/InternalTransaction.java#L2055-L2174
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/InternalTransaction.java
InternalTransaction.preBackout
void preBackout(Transaction transaction) throws ObjectManagerException { final String methodName = "preBackout"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName, new Object[] { transaction }); // Allow any last minute changes before we backout. for (java.util.Iterator tokenIterator = callbackTokens.iterator(); tokenIterator.hasNext();) { Token token = (Token) tokenIterator.next(); ManagedObject managedObject = token.getManagedObject(); // Drive the preBackout method for the object. managedObject.preBackout(transaction); } // for... callbackTokens. if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName); }
java
void preBackout(Transaction transaction) throws ObjectManagerException { final String methodName = "preBackout"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName, new Object[] { transaction }); // Allow any last minute changes before we backout. for (java.util.Iterator tokenIterator = callbackTokens.iterator(); tokenIterator.hasNext();) { Token token = (Token) tokenIterator.next(); ManagedObject managedObject = token.getManagedObject(); // Drive the preBackout method for the object. managedObject.preBackout(transaction); } // for... callbackTokens. if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName); }
[ "void", "preBackout", "(", "Transaction", "transaction", ")", "throws", "ObjectManagerException", "{", "final", "String", "methodName", "=", "\"preBackout\"", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "methodName", ",", "new", "Object", "[", "]", "{", "transaction", "}", ")", ";", "// Allow any last minute changes before we backout.", "for", "(", "java", ".", "util", ".", "Iterator", "tokenIterator", "=", "callbackTokens", ".", "iterator", "(", ")", ";", "tokenIterator", ".", "hasNext", "(", ")", ";", ")", "{", "Token", "token", "=", "(", "Token", ")", "tokenIterator", ".", "next", "(", ")", ";", "ManagedObject", "managedObject", "=", "token", ".", "getManagedObject", "(", ")", ";", "// Drive the preBackout method for the object.", "managedObject", ".", "preBackout", "(", "transaction", ")", ";", "}", "// for... callbackTokens.", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "methodName", ")", ";", "}" ]
Before the transaction is backed out, give the ManagedObjects a chance to adjust their transient state to reflect the final outcome. It is too late for them to adjust persistent state as that is already written to the log assuming an outcome of Commit. @param transaction the external Transaction. @throws ObjectManagerException
[ "Before", "the", "transaction", "is", "backed", "out", "give", "the", "ManagedObjects", "a", "chance", "to", "adjust", "their", "transient", "state", "to", "reflect", "the", "final", "outcome", ".", "It", "is", "too", "late", "for", "them", "to", "adjust", "persistent", "state", "as", "that", "is", "already", "written", "to", "the", "log", "assuming", "an", "outcome", "of", "Commit", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/InternalTransaction.java#L2184-L2201
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/InternalTransaction.java
InternalTransaction.complete
private final void complete(boolean reUse, Transaction transaction) throws ObjectManagerException { final String methodName = "complete"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName, new Object[] { new Boolean(reUse), transaction }); // No longer any need to include this transaction in a Checkpoint. requiresPersistentCheckpoint = false; // Clear any remaining state. logicalUnitOfWork.XID = null; transactionLock = new TransactionLock(this); includedManagedObjects.clear(); callbackTokens.clear(); allPersistentTokensToNotify.clear(); loggedSerializedBytes.clear(); logSequenceNumbers.clear(); managedObjectSequenceNumbers.clear(); useCount++; if (reUse) { // Reset the transaction for further use. // Note that we do not clear the transactionReference because the caller is still holding it. // If the caller releases his reference then the reference will be found by ObjectManagerState // and this InternalTransaction may be reused for another external Transaction. } else { // Do not chain. // Make sure the external Transaction cannot reach this internal one. transaction.internalTransaction = objectManagerState.dummyInternalTransaction; // This may not be sufficient to prevent its being used if the external Transaction already has passed // the point where it has picked up the referenece to the Internaltransaction. Hence we terminate the // InternalTransaction if it is preemptively backed out. See ObjectManagerstate.performCheckpoint() // where transactions are backed out without holding the internal transaction synchronize lock. if (transactionReference != null) transactionReference.clear(); // Inhibt an enqueue of the transactionReference. // If a reference is enqueued we are already in inactive state for this // transactionReferenceSequence so no action will occur. // Tell the ObjectManager that we no longer exist as an active transaction. objectManagerState.deRegisterTransaction(this); } // if (reUse). if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName); }
java
private final void complete(boolean reUse, Transaction transaction) throws ObjectManagerException { final String methodName = "complete"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName, new Object[] { new Boolean(reUse), transaction }); // No longer any need to include this transaction in a Checkpoint. requiresPersistentCheckpoint = false; // Clear any remaining state. logicalUnitOfWork.XID = null; transactionLock = new TransactionLock(this); includedManagedObjects.clear(); callbackTokens.clear(); allPersistentTokensToNotify.clear(); loggedSerializedBytes.clear(); logSequenceNumbers.clear(); managedObjectSequenceNumbers.clear(); useCount++; if (reUse) { // Reset the transaction for further use. // Note that we do not clear the transactionReference because the caller is still holding it. // If the caller releases his reference then the reference will be found by ObjectManagerState // and this InternalTransaction may be reused for another external Transaction. } else { // Do not chain. // Make sure the external Transaction cannot reach this internal one. transaction.internalTransaction = objectManagerState.dummyInternalTransaction; // This may not be sufficient to prevent its being used if the external Transaction already has passed // the point where it has picked up the referenece to the Internaltransaction. Hence we terminate the // InternalTransaction if it is preemptively backed out. See ObjectManagerstate.performCheckpoint() // where transactions are backed out without holding the internal transaction synchronize lock. if (transactionReference != null) transactionReference.clear(); // Inhibt an enqueue of the transactionReference. // If a reference is enqueued we are already in inactive state for this // transactionReferenceSequence so no action will occur. // Tell the ObjectManager that we no longer exist as an active transaction. objectManagerState.deRegisterTransaction(this); } // if (reUse). if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName); }
[ "private", "final", "void", "complete", "(", "boolean", "reUse", ",", "Transaction", "transaction", ")", "throws", "ObjectManagerException", "{", "final", "String", "methodName", "=", "\"complete\"", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "methodName", ",", "new", "Object", "[", "]", "{", "new", "Boolean", "(", "reUse", ")", ",", "transaction", "}", ")", ";", "// No longer any need to include this transaction in a Checkpoint.", "requiresPersistentCheckpoint", "=", "false", ";", "// Clear any remaining state.", "logicalUnitOfWork", ".", "XID", "=", "null", ";", "transactionLock", "=", "new", "TransactionLock", "(", "this", ")", ";", "includedManagedObjects", ".", "clear", "(", ")", ";", "callbackTokens", ".", "clear", "(", ")", ";", "allPersistentTokensToNotify", ".", "clear", "(", ")", ";", "loggedSerializedBytes", ".", "clear", "(", ")", ";", "logSequenceNumbers", ".", "clear", "(", ")", ";", "managedObjectSequenceNumbers", ".", "clear", "(", ")", ";", "useCount", "++", ";", "if", "(", "reUse", ")", "{", "// Reset the transaction for further use.", "// Note that we do not clear the transactionReference because the caller is still holding it.", "// If the caller releases his reference then the reference will be found by ObjectManagerState", "// and this InternalTransaction may be reused for another external Transaction.", "}", "else", "{", "// Do not chain.", "// Make sure the external Transaction cannot reach this internal one.", "transaction", ".", "internalTransaction", "=", "objectManagerState", ".", "dummyInternalTransaction", ";", "// This may not be sufficient to prevent its being used if the external Transaction already has passed", "// the point where it has picked up the referenece to the Internaltransaction. Hence we terminate the", "// InternalTransaction if it is preemptively backed out. See ObjectManagerstate.performCheckpoint()", "// where transactions are backed out without holding the internal transaction synchronize lock.", "if", "(", "transactionReference", "!=", "null", ")", "transactionReference", ".", "clear", "(", ")", ";", "// Inhibt an enqueue of the transactionReference.", "// If a reference is enqueued we are already in inactive state for this", "// transactionReferenceSequence so no action will occur.", "// Tell the ObjectManager that we no longer exist as an active transaction.", "objectManagerState", ".", "deRegisterTransaction", "(", "this", ")", ";", "}", "// if (reUse).", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "methodName", ")", ";", "}" ]
Tidy up after Commit or Backout have finished all work for this InternalTransaction. @param reUse true if the trandsaction is to be reused. @param transaction the external Transaction completing. @throws ObjectManagerException
[ "Tidy", "up", "after", "Commit", "or", "Backout", "have", "finished", "all", "work", "for", "this", "InternalTransaction", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/InternalTransaction.java#L2242-L2287
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/InternalTransaction.java
InternalTransaction.terminate
protected synchronized void terminate(int reason) throws ObjectManagerException { final String methodName = "terminate"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName, new Object[] { new Integer(reason) }); if (transactionReference != null) { Transaction transaction = (Transaction) transactionReference.get(); /** * PM00131 - transaction is coming from a WeakReference, check it isn't null. * If we've lost the reference, there isn't any point making a new one * just to set a reason code on it. Nobody will have a reference to the * new object with which to retrieve the code. **/ if (transaction != null) transaction.setTerminationReason(reason); } setState(nextStateForTerminate); // Any attempt by any therad to do anything with this Transaction // from now on will result in a StateErrorException. if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName); }
java
protected synchronized void terminate(int reason) throws ObjectManagerException { final String methodName = "terminate"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName, new Object[] { new Integer(reason) }); if (transactionReference != null) { Transaction transaction = (Transaction) transactionReference.get(); /** * PM00131 - transaction is coming from a WeakReference, check it isn't null. * If we've lost the reference, there isn't any point making a new one * just to set a reason code on it. Nobody will have a reference to the * new object with which to retrieve the code. **/ if (transaction != null) transaction.setTerminationReason(reason); } setState(nextStateForTerminate); // Any attempt by any therad to do anything with this Transaction // from now on will result in a StateErrorException. if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName); }
[ "protected", "synchronized", "void", "terminate", "(", "int", "reason", ")", "throws", "ObjectManagerException", "{", "final", "String", "methodName", "=", "\"terminate\"", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "methodName", ",", "new", "Object", "[", "]", "{", "new", "Integer", "(", "reason", ")", "}", ")", ";", "if", "(", "transactionReference", "!=", "null", ")", "{", "Transaction", "transaction", "=", "(", "Transaction", ")", "transactionReference", ".", "get", "(", ")", ";", "/**\n * PM00131 - transaction is coming from a WeakReference, check it isn't null.\n * If we've lost the reference, there isn't any point making a new one\n * just to set a reason code on it. Nobody will have a reference to the\n * new object with which to retrieve the code.\n **/", "if", "(", "transaction", "!=", "null", ")", "transaction", ".", "setTerminationReason", "(", "reason", ")", ";", "}", "setState", "(", "nextStateForTerminate", ")", ";", "// Any attempt by any therad to do anything with this Transaction", "// from now on will result in a StateErrorException.", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "methodName", ")", ";", "}" ]
Permanently disable use of this transaction. reason the Transaction.terininatedXXX reason @throws ObjectManagerException
[ "Permanently", "disable", "use", "of", "this", "transaction", ".", "reason", "the", "Transaction", ".", "terininatedXXX", "reason" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/InternalTransaction.java#L2294-L2317
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/InternalTransaction.java
InternalTransaction.shutdown
protected synchronized void shutdown() throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "shutDown" ); setState(nextStateForShutdown); // Any attempt by any therad to do anything with this Transaction // from now on will result in a InvalidStateException. if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "shutdown" ); }
java
protected synchronized void shutdown() throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "shutDown" ); setState(nextStateForShutdown); // Any attempt by any therad to do anything with this Transaction // from now on will result in a InvalidStateException. if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "shutdown" ); }
[ "protected", "synchronized", "void", "shutdown", "(", ")", "throws", "ObjectManagerException", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "\"shutDown\"", ")", ";", "setState", "(", "nextStateForShutdown", ")", ";", "// Any attempt by any therad to do anything with this Transaction", "// from now on will result in a InvalidStateException.", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"shutdown\"", ")", ";", "}" ]
Run at shutdown of the ObjectManager to close activity. @throws ObjectManagerException
[ "Run", "at", "shutdown", "of", "the", "ObjectManager", "to", "close", "activity", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/InternalTransaction.java#L2324-L2340
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/InternalTransaction.java
InternalTransaction.setRequiresCheckpoint
protected final void setRequiresCheckpoint() { final String methodName = "setRequiresCheckpoint"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName, new Object[] { new Boolean(requiresPersistentCheckpoint) }); // The states for which a checkpoint log Record must be written to the log unless this transactions ends first. // Has any logging been done? If The transaction enters one of thse states after this // call then all of its state will be in the log after CheckpointStart. final boolean checkpointRequired[] = { false , false , false , true // ActivePersistent. , false , false , true // PrePreparedPersistent. , false , false , true // PreparedPersistent. , false , false , true // CommitingPersistent. Not needed because of synchronize in commit. , false , false , true // BackingOutPersistent. Not needed because of synchronize in commit. , false }; requiresPersistentCheckpoint = checkpointRequired[state]; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName, new Object[] { new Boolean(requiresPersistentCheckpoint) }); }
java
protected final void setRequiresCheckpoint() { final String methodName = "setRequiresCheckpoint"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName, new Object[] { new Boolean(requiresPersistentCheckpoint) }); // The states for which a checkpoint log Record must be written to the log unless this transactions ends first. // Has any logging been done? If The transaction enters one of thse states after this // call then all of its state will be in the log after CheckpointStart. final boolean checkpointRequired[] = { false , false , false , true // ActivePersistent. , false , false , true // PrePreparedPersistent. , false , false , true // PreparedPersistent. , false , false , true // CommitingPersistent. Not needed because of synchronize in commit. , false , false , true // BackingOutPersistent. Not needed because of synchronize in commit. , false }; requiresPersistentCheckpoint = checkpointRequired[state]; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName, new Object[] { new Boolean(requiresPersistentCheckpoint) }); }
[ "protected", "final", "void", "setRequiresCheckpoint", "(", ")", "{", "final", "String", "methodName", "=", "\"setRequiresCheckpoint\"", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "methodName", ",", "new", "Object", "[", "]", "{", "new", "Boolean", "(", "requiresPersistentCheckpoint", ")", "}", ")", ";", "// The states for which a checkpoint log Record must be written to the log unless this transactions ends first.", "// Has any logging been done? If The transaction enters one of thse states after this", "// call then all of its state will be in the log after CheckpointStart.", "final", "boolean", "checkpointRequired", "[", "]", "=", "{", "false", ",", "false", ",", "false", ",", "true", "// ActivePersistent.", ",", "false", ",", "false", ",", "true", "// PrePreparedPersistent.", ",", "false", ",", "false", ",", "true", "// PreparedPersistent.", ",", "false", ",", "false", ",", "true", "// CommitingPersistent. Not needed because of synchronize in commit.", ",", "false", ",", "false", ",", "true", "// BackingOutPersistent. Not needed because of synchronize in commit.", ",", "false", "}", ";", "requiresPersistentCheckpoint", "=", "checkpointRequired", "[", "state", "]", ";", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "methodName", ",", "new", "Object", "[", "]", "{", "new", "Boolean", "(", "requiresPersistentCheckpoint", ")", "}", ")", ";", "}" ]
Mark this InternalTransaction as requiring a Checkpoint in the current checkpoint cycle.
[ "Mark", "this", "InternalTransaction", "as", "requiring", "a", "Checkpoint", "in", "the", "current", "checkpoint", "cycle", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/InternalTransaction.java#L2345-L2383
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/InternalTransaction.java
InternalTransaction.checkpoint
protected synchronized void checkpoint(long forcedLogSequenceNumber) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "checkpoint" , new Object[] { new Long(forcedLogSequenceNumber), new Boolean(requiresPersistentCheckpoint) }); // TODO If we have a STRATEGY_SAVE_ON_CHECKPOINT store then these objects need to be included here. // TODO currently STRATEGY_KEEP_UNTIL_NEXT_OPEN are not saved during a checkpoint. // TODO We will also need to track, nonPersistent,Serialized,and Persistent state in order to figure // TODO out whether or not to include the transaction in the checkpoint. // Was data logging required when we started the checkpoint // and is it still needed for recovery? if (requiresPersistentCheckpoint) { // Build subset lists of persistent tokens to recover. java.util.List persistentTokensToAdd = new java.util.ArrayList(); java.util.List persistentTokensToReplace = new java.util.ArrayList(); java.util.List persistentSerializedBytesToReplace = new java.util.ArrayList(); java.util.List persistentTokensToOptimisticReplace = new java.util.ArrayList(); java.util.List persistentTokensToDelete = new java.util.ArrayList(); // Drive checkpoint for each included MangedObject. for (java.util.Iterator managedObjectIterator = includedManagedObjects.values().iterator(); managedObjectIterator.hasNext();) { ManagedObject managedObject = (ManagedObject) managedObjectIterator.next(); if (managedObject.owningToken.getObjectStore() .getPersistence()) { // Has the last logged update been Forced to disk? // If not the normal log record will be after the start of the chekpoint and it will // cause normal recovery for that ManagedObject. long logSequenceNumber = ((Long) logSequenceNumbers.get(managedObject.owningToken)).longValue(); if (forcedLogSequenceNumber >= logSequenceNumber) { // The loggedSerializedBytes we currently have will have had any corrections made at preBackoutTime // incorporated into them, so they are now the correct ones to write to the ObjectStore. ObjectManagerByteArrayOutputStream serializedBytes = (ObjectManagerByteArrayOutputStream) loggedSerializedBytes.get(managedObject.owningToken); long managedObjectSequenceNumber = ((Long) managedObjectSequenceNumbers.get(managedObject.owningToken)).longValue(); managedObject.checkpoint(this, serializedBytes, managedObjectSequenceNumber); // Build the lists of objects to log. if (managedObject.lockedBy(this)) { // Locking update? switch (managedObject.getState()) { case ManagedObject.stateAdded: persistentTokensToAdd.add(managedObject.owningToken); break; case ManagedObject.stateReplaced: persistentTokensToReplace.add(managedObject.owningToken); // We have to rewrite the replaced serialized bytes in the log as part of the checkpoint. persistentSerializedBytesToReplace.add(serializedBytes); break; case ManagedObject.stateToBeDeleted: persistentTokensToDelete.add(managedObject.owningToken); break; } // switch. } else { // OptimisticReplace update. // A bit pointless as we dont do anything at recovery time. persistentTokensToOptimisticReplace.add(managedObject.owningToken); } // if (lockedBy(transaction)). } // if (forcedLogSequenceNumber >= logSequenceNumber). } // if (managedObject.owningToken.getObjectStore().getPersistence()). } // for ... includedMansagedObjects. // The state indicates if the transaction is prepared, commiting or backing out. TransactionCheckpointLogRecord transactionCheckpointLogRecord = new TransactionCheckpointLogRecord(this, persistentTokensToAdd, persistentTokensToReplace, persistentSerializedBytesToReplace, persistentTokensToOptimisticReplace, persistentTokensToDelete, allPersistentTokensToNotify); // TODO Could correct any overestimate of the reserved log file space here. // We previously reserved some log space for this logRecord to be sure it will fit in the log. // We do not release it here because w reserved an extra page which we might not be able to get back after the // checkpoint has completed. Instead we just supress the check on the space used in the log. objectManagerState.logOutput.writeNext(transactionCheckpointLogRecord, 0, false , false); requiresPersistentCheckpoint = false; } // if (requiresPersistentCheckpoint). if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "checkpoint" ); }
java
protected synchronized void checkpoint(long forcedLogSequenceNumber) throws ObjectManagerException { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass , "checkpoint" , new Object[] { new Long(forcedLogSequenceNumber), new Boolean(requiresPersistentCheckpoint) }); // TODO If we have a STRATEGY_SAVE_ON_CHECKPOINT store then these objects need to be included here. // TODO currently STRATEGY_KEEP_UNTIL_NEXT_OPEN are not saved during a checkpoint. // TODO We will also need to track, nonPersistent,Serialized,and Persistent state in order to figure // TODO out whether or not to include the transaction in the checkpoint. // Was data logging required when we started the checkpoint // and is it still needed for recovery? if (requiresPersistentCheckpoint) { // Build subset lists of persistent tokens to recover. java.util.List persistentTokensToAdd = new java.util.ArrayList(); java.util.List persistentTokensToReplace = new java.util.ArrayList(); java.util.List persistentSerializedBytesToReplace = new java.util.ArrayList(); java.util.List persistentTokensToOptimisticReplace = new java.util.ArrayList(); java.util.List persistentTokensToDelete = new java.util.ArrayList(); // Drive checkpoint for each included MangedObject. for (java.util.Iterator managedObjectIterator = includedManagedObjects.values().iterator(); managedObjectIterator.hasNext();) { ManagedObject managedObject = (ManagedObject) managedObjectIterator.next(); if (managedObject.owningToken.getObjectStore() .getPersistence()) { // Has the last logged update been Forced to disk? // If not the normal log record will be after the start of the chekpoint and it will // cause normal recovery for that ManagedObject. long logSequenceNumber = ((Long) logSequenceNumbers.get(managedObject.owningToken)).longValue(); if (forcedLogSequenceNumber >= logSequenceNumber) { // The loggedSerializedBytes we currently have will have had any corrections made at preBackoutTime // incorporated into them, so they are now the correct ones to write to the ObjectStore. ObjectManagerByteArrayOutputStream serializedBytes = (ObjectManagerByteArrayOutputStream) loggedSerializedBytes.get(managedObject.owningToken); long managedObjectSequenceNumber = ((Long) managedObjectSequenceNumbers.get(managedObject.owningToken)).longValue(); managedObject.checkpoint(this, serializedBytes, managedObjectSequenceNumber); // Build the lists of objects to log. if (managedObject.lockedBy(this)) { // Locking update? switch (managedObject.getState()) { case ManagedObject.stateAdded: persistentTokensToAdd.add(managedObject.owningToken); break; case ManagedObject.stateReplaced: persistentTokensToReplace.add(managedObject.owningToken); // We have to rewrite the replaced serialized bytes in the log as part of the checkpoint. persistentSerializedBytesToReplace.add(serializedBytes); break; case ManagedObject.stateToBeDeleted: persistentTokensToDelete.add(managedObject.owningToken); break; } // switch. } else { // OptimisticReplace update. // A bit pointless as we dont do anything at recovery time. persistentTokensToOptimisticReplace.add(managedObject.owningToken); } // if (lockedBy(transaction)). } // if (forcedLogSequenceNumber >= logSequenceNumber). } // if (managedObject.owningToken.getObjectStore().getPersistence()). } // for ... includedMansagedObjects. // The state indicates if the transaction is prepared, commiting or backing out. TransactionCheckpointLogRecord transactionCheckpointLogRecord = new TransactionCheckpointLogRecord(this, persistentTokensToAdd, persistentTokensToReplace, persistentSerializedBytesToReplace, persistentTokensToOptimisticReplace, persistentTokensToDelete, allPersistentTokensToNotify); // TODO Could correct any overestimate of the reserved log file space here. // We previously reserved some log space for this logRecord to be sure it will fit in the log. // We do not release it here because w reserved an extra page which we might not be able to get back after the // checkpoint has completed. Instead we just supress the check on the space used in the log. objectManagerState.logOutput.writeNext(transactionCheckpointLogRecord, 0, false , false); requiresPersistentCheckpoint = false; } // if (requiresPersistentCheckpoint). if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass , "checkpoint" ); }
[ "protected", "synchronized", "void", "checkpoint", "(", "long", "forcedLogSequenceNumber", ")", "throws", "ObjectManagerException", "{", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "entry", "(", "this", ",", "cclass", ",", "\"checkpoint\"", ",", "new", "Object", "[", "]", "{", "new", "Long", "(", "forcedLogSequenceNumber", ")", ",", "new", "Boolean", "(", "requiresPersistentCheckpoint", ")", "}", ")", ";", "// TODO If we have a STRATEGY_SAVE_ON_CHECKPOINT store then these objects need to be included here.", "// TODO currently STRATEGY_KEEP_UNTIL_NEXT_OPEN are not saved during a checkpoint.", "// TODO We will also need to track, nonPersistent,Serialized,and Persistent state in order to figure", "// TODO out whether or not to include the transaction in the checkpoint.", "// Was data logging required when we started the checkpoint", "// and is it still needed for recovery?", "if", "(", "requiresPersistentCheckpoint", ")", "{", "// Build subset lists of persistent tokens to recover.", "java", ".", "util", ".", "List", "persistentTokensToAdd", "=", "new", "java", ".", "util", ".", "ArrayList", "(", ")", ";", "java", ".", "util", ".", "List", "persistentTokensToReplace", "=", "new", "java", ".", "util", ".", "ArrayList", "(", ")", ";", "java", ".", "util", ".", "List", "persistentSerializedBytesToReplace", "=", "new", "java", ".", "util", ".", "ArrayList", "(", ")", ";", "java", ".", "util", ".", "List", "persistentTokensToOptimisticReplace", "=", "new", "java", ".", "util", ".", "ArrayList", "(", ")", ";", "java", ".", "util", ".", "List", "persistentTokensToDelete", "=", "new", "java", ".", "util", ".", "ArrayList", "(", ")", ";", "// Drive checkpoint for each included MangedObject.", "for", "(", "java", ".", "util", ".", "Iterator", "managedObjectIterator", "=", "includedManagedObjects", ".", "values", "(", ")", ".", "iterator", "(", ")", ";", "managedObjectIterator", ".", "hasNext", "(", ")", ";", ")", "{", "ManagedObject", "managedObject", "=", "(", "ManagedObject", ")", "managedObjectIterator", ".", "next", "(", ")", ";", "if", "(", "managedObject", ".", "owningToken", ".", "getObjectStore", "(", ")", ".", "getPersistence", "(", ")", ")", "{", "// Has the last logged update been Forced to disk?", "// If not the normal log record will be after the start of the chekpoint and it will", "// cause normal recovery for that ManagedObject.", "long", "logSequenceNumber", "=", "(", "(", "Long", ")", "logSequenceNumbers", ".", "get", "(", "managedObject", ".", "owningToken", ")", ")", ".", "longValue", "(", ")", ";", "if", "(", "forcedLogSequenceNumber", ">=", "logSequenceNumber", ")", "{", "// The loggedSerializedBytes we currently have will have had any corrections made at preBackoutTime", "// incorporated into them, so they are now the correct ones to write to the ObjectStore.", "ObjectManagerByteArrayOutputStream", "serializedBytes", "=", "(", "ObjectManagerByteArrayOutputStream", ")", "loggedSerializedBytes", ".", "get", "(", "managedObject", ".", "owningToken", ")", ";", "long", "managedObjectSequenceNumber", "=", "(", "(", "Long", ")", "managedObjectSequenceNumbers", ".", "get", "(", "managedObject", ".", "owningToken", ")", ")", ".", "longValue", "(", ")", ";", "managedObject", ".", "checkpoint", "(", "this", ",", "serializedBytes", ",", "managedObjectSequenceNumber", ")", ";", "// Build the lists of objects to log.", "if", "(", "managedObject", ".", "lockedBy", "(", "this", ")", ")", "{", "// Locking update?", "switch", "(", "managedObject", ".", "getState", "(", ")", ")", "{", "case", "ManagedObject", ".", "stateAdded", ":", "persistentTokensToAdd", ".", "add", "(", "managedObject", ".", "owningToken", ")", ";", "break", ";", "case", "ManagedObject", ".", "stateReplaced", ":", "persistentTokensToReplace", ".", "add", "(", "managedObject", ".", "owningToken", ")", ";", "// We have to rewrite the replaced serialized bytes in the log as part of the checkpoint.", "persistentSerializedBytesToReplace", ".", "add", "(", "serializedBytes", ")", ";", "break", ";", "case", "ManagedObject", ".", "stateToBeDeleted", ":", "persistentTokensToDelete", ".", "add", "(", "managedObject", ".", "owningToken", ")", ";", "break", ";", "}", "// switch.", "}", "else", "{", "// OptimisticReplace update.", "// A bit pointless as we dont do anything at recovery time.", "persistentTokensToOptimisticReplace", ".", "add", "(", "managedObject", ".", "owningToken", ")", ";", "}", "// if (lockedBy(transaction)).", "}", "// if (forcedLogSequenceNumber >= logSequenceNumber).", "}", "// if (managedObject.owningToken.getObjectStore().getPersistence()).", "}", "// for ... includedMansagedObjects.", "// The state indicates if the transaction is prepared, commiting or backing out.", "TransactionCheckpointLogRecord", "transactionCheckpointLogRecord", "=", "new", "TransactionCheckpointLogRecord", "(", "this", ",", "persistentTokensToAdd", ",", "persistentTokensToReplace", ",", "persistentSerializedBytesToReplace", ",", "persistentTokensToOptimisticReplace", ",", "persistentTokensToDelete", ",", "allPersistentTokensToNotify", ")", ";", "// TODO Could correct any overestimate of the reserved log file space here.", "// We previously reserved some log space for this logRecord to be sure it will fit in the log.", "// We do not release it here because w reserved an extra page which we might not be able to get back after the", "// checkpoint has completed. Instead we just supress the check on the space used in the log.", "objectManagerState", ".", "logOutput", ".", "writeNext", "(", "transactionCheckpointLogRecord", ",", "0", ",", "false", ",", "false", ")", ";", "requiresPersistentCheckpoint", "=", "false", ";", "}", "// if (requiresPersistentCheckpoint).", "if", "(", "Tracing", ".", "isAnyTracingEnabled", "(", ")", "&&", "trace", ".", "isEntryEnabled", "(", ")", ")", "trace", ".", "exit", "(", "this", ",", "cclass", ",", "\"checkpoint\"", ")", ";", "}" ]
Called by the ObjectManager when it has written a checkpointStartLogRecord. The Transaction can assume that all log records up to and including logSequenceNumber are now safely hardened to disk. On this assumption it calls includedObjects so that they can write after images to the ObjectStores. @param forcedLogSequenceNumber the logSequenceNumber known to be forced to disk. @throws ObjectManagerException
[ "Called", "by", "the", "ObjectManager", "when", "it", "has", "written", "a", "checkpointStartLogRecord", ".", "The", "Transaction", "can", "assume", "that", "all", "log", "records", "up", "to", "and", "including", "logSequenceNumber", "are", "now", "safely", "hardened", "to", "disk", ".", "On", "this", "assumption", "it", "calls", "includedObjects", "so", "that", "they", "can", "write", "after", "images", "to", "the", "ObjectStores", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/objectManager/InternalTransaction.java#L2394-L2489
train
OpenLiberty/open-liberty
dev/com.ibm.ws.concurrent.persistent/src/com/ibm/ws/concurrent/persistent/internal/InvokerTask.java
InvokerTask.afterCompletion
@Override public void afterCompletion(int status) { if (status == Status.STATUS_COMMITTED) { Boolean previous = persistentExecutor.inMemoryTaskIds.put(taskId, Boolean.TRUE); if (previous == null) { long delay = expectedExecTime - new Date().getTime(); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(this, tc, "Schedule " + taskId + " for " + delay + "ms from now"); persistentExecutor.scheduledExecutor.schedule(this, delay, TimeUnit.MILLISECONDS); } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(this, tc, "Found task " + taskId + " already scheduled"); } } }
java
@Override public void afterCompletion(int status) { if (status == Status.STATUS_COMMITTED) { Boolean previous = persistentExecutor.inMemoryTaskIds.put(taskId, Boolean.TRUE); if (previous == null) { long delay = expectedExecTime - new Date().getTime(); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(this, tc, "Schedule " + taskId + " for " + delay + "ms from now"); persistentExecutor.scheduledExecutor.schedule(this, delay, TimeUnit.MILLISECONDS); } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) Tr.debug(this, tc, "Found task " + taskId + " already scheduled"); } } }
[ "@", "Override", "public", "void", "afterCompletion", "(", "int", "status", ")", "{", "if", "(", "status", "==", "Status", ".", "STATUS_COMMITTED", ")", "{", "Boolean", "previous", "=", "persistentExecutor", ".", "inMemoryTaskIds", ".", "put", "(", "taskId", ",", "Boolean", ".", "TRUE", ")", ";", "if", "(", "previous", "==", "null", ")", "{", "long", "delay", "=", "expectedExecTime", "-", "new", "Date", "(", ")", ".", "getTime", "(", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "this", ",", "tc", ",", "\"Schedule \"", "+", "taskId", "+", "\" for \"", "+", "delay", "+", "\"ms from now\"", ")", ";", "persistentExecutor", ".", "scheduledExecutor", ".", "schedule", "(", "this", ",", "delay", ",", "TimeUnit", ".", "MILLISECONDS", ")", ";", "}", "else", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "Tr", ".", "debug", "(", "this", ",", "tc", ",", "\"Found task \"", "+", "taskId", "+", "\" already scheduled\"", ")", ";", "}", "}", "}" ]
Upon successful transaction commit, automatically schedules a task for execution in the near future. @see javax.transaction.Synchronization#afterCompletion(int)
[ "Upon", "successful", "transaction", "commit", "automatically", "schedules", "a", "task", "for", "execution", "in", "the", "near", "future", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.concurrent.persistent/src/com/ibm/ws/concurrent/persistent/internal/InvokerTask.java#L78-L92
train
OpenLiberty/open-liberty
dev/com.ibm.ws.concurrent.persistent/src/com/ibm/ws/concurrent/persistent/internal/InvokerTask.java
InvokerTask.serializeResult
@FFDCIgnore(Throwable.class) @Sensitive private byte[] serializeResult(Object result, ClassLoader loader) throws IOException { try { return persistentExecutor.serialize(result); } catch (Throwable x) { return persistentExecutor.serialize(new TaskFailure(x, loader, persistentExecutor, TaskFailure.NONSER_RESULT, result.getClass().getName())); } }
java
@FFDCIgnore(Throwable.class) @Sensitive private byte[] serializeResult(Object result, ClassLoader loader) throws IOException { try { return persistentExecutor.serialize(result); } catch (Throwable x) { return persistentExecutor.serialize(new TaskFailure(x, loader, persistentExecutor, TaskFailure.NONSER_RESULT, result.getClass().getName())); } }
[ "@", "FFDCIgnore", "(", "Throwable", ".", "class", ")", "@", "Sensitive", "private", "byte", "[", "]", "serializeResult", "(", "Object", "result", ",", "ClassLoader", "loader", ")", "throws", "IOException", "{", "try", "{", "return", "persistentExecutor", ".", "serialize", "(", "result", ")", ";", "}", "catch", "(", "Throwable", "x", ")", "{", "return", "persistentExecutor", ".", "serialize", "(", "new", "TaskFailure", "(", "x", ",", "loader", ",", "persistentExecutor", ",", "TaskFailure", ".", "NONSER_RESULT", ",", "result", ".", "getClass", "(", ")", ".", "getName", "(", ")", ")", ")", ";", "}", "}" ]
Utility method that serializes a task result, or the failure that occurred when attempting to serialize the task result. @param result non-null task result @param loader class loader that can deserialize the task and result. @return serialized bytes
[ "Utility", "method", "that", "serializes", "a", "task", "result", "or", "the", "failure", "that", "occurred", "when", "attempting", "to", "serialize", "the", "task", "result", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.concurrent.persistent/src/com/ibm/ws/concurrent/persistent/internal/InvokerTask.java#L605-L613
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/jsf/core/ConvertNumberHandler.java
ConvertNumberHandler.createConverter
protected Converter createConverter(FaceletContext ctx) throws FacesException, ELException, FaceletException { return ctx.getFacesContext().getApplication().createConverter(NumberConverter.CONVERTER_ID); }
java
protected Converter createConverter(FaceletContext ctx) throws FacesException, ELException, FaceletException { return ctx.getFacesContext().getApplication().createConverter(NumberConverter.CONVERTER_ID); }
[ "protected", "Converter", "createConverter", "(", "FaceletContext", "ctx", ")", "throws", "FacesException", ",", "ELException", ",", "FaceletException", "{", "return", "ctx", ".", "getFacesContext", "(", ")", ".", "getApplication", "(", ")", ".", "createConverter", "(", "NumberConverter", ".", "CONVERTER_ID", ")", ";", "}" ]
Returns a new NumberConverter @see NumberConverter @see org.apache.myfaces.view.facelets.tag.jsf.ConverterHandler#createConverter(javax.faces.view.facelets.FaceletContext)
[ "Returns", "a", "new", "NumberConverter" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/jsf/core/ConvertNumberHandler.java#L67-L70
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/rldispatcher/ReceiveListenerDispatcher.java
ReceiveListenerDispatcher.queueDataReceivedInvocation
public void queueDataReceivedInvocation(Connection connection, ReceiveListener listener, WsByteBuffer data, int segmentType, int requestNumber, int priority, boolean allocatedFromBufferPool, boolean partOfExchange, Conversation conversation) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "queueDataReceivedInvocation", new Object[] {connection, listener, data, ""+segmentType, ""+requestNumber, ""+priority, ""+allocatedFromBufferPool, ""+partOfExchange, conversation}); int dataSize = 0; if (dispatcherEnabled) dataSize = data.position(); // D240062 AbstractInvocation invocation = allocateDataReceivedInvocation(connection, listener, data, dataSize, segmentType, requestNumber, priority, allocatedFromBufferPool, partOfExchange, conversation); queueInvocationCommon(invocation, (ConversationImpl)conversation); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "queueDataReceivedInvocation"); }
java
public void queueDataReceivedInvocation(Connection connection, ReceiveListener listener, WsByteBuffer data, int segmentType, int requestNumber, int priority, boolean allocatedFromBufferPool, boolean partOfExchange, Conversation conversation) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "queueDataReceivedInvocation", new Object[] {connection, listener, data, ""+segmentType, ""+requestNumber, ""+priority, ""+allocatedFromBufferPool, ""+partOfExchange, conversation}); int dataSize = 0; if (dispatcherEnabled) dataSize = data.position(); // D240062 AbstractInvocation invocation = allocateDataReceivedInvocation(connection, listener, data, dataSize, segmentType, requestNumber, priority, allocatedFromBufferPool, partOfExchange, conversation); queueInvocationCommon(invocation, (ConversationImpl)conversation); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "queueDataReceivedInvocation"); }
[ "public", "void", "queueDataReceivedInvocation", "(", "Connection", "connection", ",", "ReceiveListener", "listener", ",", "WsByteBuffer", "data", ",", "int", "segmentType", ",", "int", "requestNumber", ",", "int", "priority", ",", "boolean", "allocatedFromBufferPool", ",", "boolean", "partOfExchange", ",", "Conversation", "conversation", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"queueDataReceivedInvocation\"", ",", "new", "Object", "[", "]", "{", "connection", ",", "listener", ",", "data", ",", "\"\"", "+", "segmentType", ",", "\"\"", "+", "requestNumber", ",", "\"\"", "+", "priority", ",", "\"\"", "+", "allocatedFromBufferPool", ",", "\"\"", "+", "partOfExchange", ",", "conversation", "}", ")", ";", "int", "dataSize", "=", "0", ";", "if", "(", "dispatcherEnabled", ")", "dataSize", "=", "data", ".", "position", "(", ")", ";", "// D240062", "AbstractInvocation", "invocation", "=", "allocateDataReceivedInvocation", "(", "connection", ",", "listener", ",", "data", ",", "dataSize", ",", "segmentType", ",", "requestNumber", ",", "priority", ",", "allocatedFromBufferPool", ",", "partOfExchange", ",", "conversation", ")", ";", "queueInvocationCommon", "(", "invocation", ",", "(", "ConversationImpl", ")", "conversation", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"queueDataReceivedInvocation\"", ")", ";", "}" ]
Queues the invocation of a data received method into the dispatcher.
[ "Queues", "the", "invocation", "of", "a", "data", "received", "method", "into", "the", "dispatcher", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/rldispatcher/ReceiveListenerDispatcher.java#L574-L605
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/rldispatcher/ReceiveListenerDispatcher.java
ReceiveListenerDispatcher.getInstance
public static ReceiveListenerDispatcher getInstance(Conversation.ConversationType convType, boolean isOnClientSide) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getInstance", new Object[] {""+convType, ""+isOnClientSide}); ReceiveListenerDispatcher retInstance; // A conversation has type CLIENT if it is an Outbound or Inbound connection from a JetStream // client. The client side RLD is different from the server side RLD, so we need the // isOnClientSide flag to distinguish them. // A conversation has type ME if it is an Outbound or Inbound connection from another ME. if (convType == Conversation.CLIENT) { if (isOnClientSide) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Returning client instance"); synchronized(ReceiveListenerDispatcher.class) { if (clientInstance == null) { clientInstance = new ReceiveListenerDispatcher(true, true); // Client side of ME-Client conversation } } retInstance = clientInstance; } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Returning server instance"); synchronized(ReceiveListenerDispatcher.class) { if (serverInstance == null) { serverInstance = new ReceiveListenerDispatcher(false, true); // ME side of ME-Client conversation } } retInstance = serverInstance; } } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Returning ME-ME instance"); synchronized(ReceiveListenerDispatcher.class) { if (meInstance == null) { meInstance = new ReceiveListenerDispatcher(false, false); // ME-ME conversation } } retInstance = meInstance; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getInstance", retInstance); return retInstance; }
java
public static ReceiveListenerDispatcher getInstance(Conversation.ConversationType convType, boolean isOnClientSide) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getInstance", new Object[] {""+convType, ""+isOnClientSide}); ReceiveListenerDispatcher retInstance; // A conversation has type CLIENT if it is an Outbound or Inbound connection from a JetStream // client. The client side RLD is different from the server side RLD, so we need the // isOnClientSide flag to distinguish them. // A conversation has type ME if it is an Outbound or Inbound connection from another ME. if (convType == Conversation.CLIENT) { if (isOnClientSide) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Returning client instance"); synchronized(ReceiveListenerDispatcher.class) { if (clientInstance == null) { clientInstance = new ReceiveListenerDispatcher(true, true); // Client side of ME-Client conversation } } retInstance = clientInstance; } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Returning server instance"); synchronized(ReceiveListenerDispatcher.class) { if (serverInstance == null) { serverInstance = new ReceiveListenerDispatcher(false, true); // ME side of ME-Client conversation } } retInstance = serverInstance; } } else { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Returning ME-ME instance"); synchronized(ReceiveListenerDispatcher.class) { if (meInstance == null) { meInstance = new ReceiveListenerDispatcher(false, false); // ME-ME conversation } } retInstance = meInstance; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getInstance", retInstance); return retInstance; }
[ "public", "static", "ReceiveListenerDispatcher", "getInstance", "(", "Conversation", ".", "ConversationType", "convType", ",", "boolean", "isOnClientSide", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"getInstance\"", ",", "new", "Object", "[", "]", "{", "\"\"", "+", "convType", ",", "\"\"", "+", "isOnClientSide", "}", ")", ";", "ReceiveListenerDispatcher", "retInstance", ";", "// A conversation has type CLIENT if it is an Outbound or Inbound connection from a JetStream", "// client. The client side RLD is different from the server side RLD, so we need the", "// isOnClientSide flag to distinguish them.", "// A conversation has type ME if it is an Outbound or Inbound connection from another ME.", "if", "(", "convType", "==", "Conversation", ".", "CLIENT", ")", "{", "if", "(", "isOnClientSide", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "tc", ",", "\"Returning client instance\"", ")", ";", "synchronized", "(", "ReceiveListenerDispatcher", ".", "class", ")", "{", "if", "(", "clientInstance", "==", "null", ")", "{", "clientInstance", "=", "new", "ReceiveListenerDispatcher", "(", "true", ",", "true", ")", ";", "// Client side of ME-Client conversation", "}", "}", "retInstance", "=", "clientInstance", ";", "}", "else", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "tc", ",", "\"Returning server instance\"", ")", ";", "synchronized", "(", "ReceiveListenerDispatcher", ".", "class", ")", "{", "if", "(", "serverInstance", "==", "null", ")", "{", "serverInstance", "=", "new", "ReceiveListenerDispatcher", "(", "false", ",", "true", ")", ";", "// ME side of ME-Client conversation", "}", "}", "retInstance", "=", "serverInstance", ";", "}", "}", "else", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "tc", ",", "\"Returning ME-ME instance\"", ")", ";", "synchronized", "(", "ReceiveListenerDispatcher", ".", "class", ")", "{", "if", "(", "meInstance", "==", "null", ")", "{", "meInstance", "=", "new", "ReceiveListenerDispatcher", "(", "false", ",", "false", ")", ";", "// ME-ME conversation", "}", "}", "retInstance", "=", "meInstance", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"getInstance\"", ",", "retInstance", ")", ";", "return", "retInstance", ";", "}" ]
Return a reference to the instance of this class. Used to implement the singleton design pattern. @return ReceiveListenerDispatcher
[ "Return", "a", "reference", "to", "the", "instance", "of", "this", "class", ".", "Used", "to", "implement", "the", "singleton", "design", "pattern", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/rldispatcher/ReceiveListenerDispatcher.java#L739-L792
train
OpenLiberty/open-liberty
dev/com.ibm.ws.crypto.passwordutil/src/com/ibm/ws/crypto/util/custom/CustomUtils.java
CustomUtils.isCommandLine
public static boolean isCommandLine() { String output = AccessController.doPrivileged(new PrivilegedAction<String>() { @Override public String run() { return System.getProperty("wlp.process.type"); } }); boolean value = true; if (output != null && ("server".equals(output) || "client".equals(output))) { value = false; } if (logger.isLoggable(Level.FINE)) { logger.fine("value: " + value); } return value; }
java
public static boolean isCommandLine() { String output = AccessController.doPrivileged(new PrivilegedAction<String>() { @Override public String run() { return System.getProperty("wlp.process.type"); } }); boolean value = true; if (output != null && ("server".equals(output) || "client".equals(output))) { value = false; } if (logger.isLoggable(Level.FINE)) { logger.fine("value: " + value); } return value; }
[ "public", "static", "boolean", "isCommandLine", "(", ")", "{", "String", "output", "=", "AccessController", ".", "doPrivileged", "(", "new", "PrivilegedAction", "<", "String", ">", "(", ")", "{", "@", "Override", "public", "String", "run", "(", ")", "{", "return", "System", ".", "getProperty", "(", "\"wlp.process.type\"", ")", ";", "}", "}", ")", ";", "boolean", "value", "=", "true", ";", "if", "(", "output", "!=", "null", "&&", "(", "\"server\"", ".", "equals", "(", "output", ")", "||", "\"client\"", ".", "equals", "(", "output", ")", ")", ")", "{", "value", "=", "false", ";", "}", "if", "(", "logger", ".", "isLoggable", "(", "Level", ".", "FINE", ")", ")", "{", "logger", ".", "fine", "(", "\"value: \"", "+", "value", ")", ";", "}", "return", "value", ";", "}" ]
Returns true when the value of wlp.process.type is neither server nor client. false otherwise.
[ "Returns", "true", "when", "the", "value", "of", "wlp", ".", "process", ".", "type", "is", "neither", "server", "nor", "client", ".", "false", "otherwise", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.crypto.passwordutil/src/com/ibm/ws/crypto/util/custom/CustomUtils.java#L55-L70
train
OpenLiberty/open-liberty
dev/com.ibm.ws.crypto.passwordutil/src/com/ibm/ws/crypto/util/custom/CustomUtils.java
CustomUtils.getInstallRoot
public static String getInstallRoot() { return AccessController.doPrivileged(new PrivilegedAction<String>() { @Override public String run() { String output = System.getProperty("wlp.install.dir"); if (output == null) { output = System.getenv("WLP_INSTALL_DIR"); } if (output == null) { // if neither of these is set. use the location where the class is loaded. URL url = CLASS_NAME.getProtectionDomain().getCodeSource().getLocation(); try { output = new File(url.toString().substring("file:".length())).getParentFile().getParentFile().getCanonicalPath(); } catch (IOException e) { // this condition should not happen, but if that's the case, use current directory. output = "."; if (logger.isLoggable(Level.FINE)) { logger.fine("The install root was not detected. " + e.getMessage()); } } } if (logger.isLoggable(Level.FINE)) { logger.fine("The install root is " + output); } return output; } }); }
java
public static String getInstallRoot() { return AccessController.doPrivileged(new PrivilegedAction<String>() { @Override public String run() { String output = System.getProperty("wlp.install.dir"); if (output == null) { output = System.getenv("WLP_INSTALL_DIR"); } if (output == null) { // if neither of these is set. use the location where the class is loaded. URL url = CLASS_NAME.getProtectionDomain().getCodeSource().getLocation(); try { output = new File(url.toString().substring("file:".length())).getParentFile().getParentFile().getCanonicalPath(); } catch (IOException e) { // this condition should not happen, but if that's the case, use current directory. output = "."; if (logger.isLoggable(Level.FINE)) { logger.fine("The install root was not detected. " + e.getMessage()); } } } if (logger.isLoggable(Level.FINE)) { logger.fine("The install root is " + output); } return output; } }); }
[ "public", "static", "String", "getInstallRoot", "(", ")", "{", "return", "AccessController", ".", "doPrivileged", "(", "new", "PrivilegedAction", "<", "String", ">", "(", ")", "{", "@", "Override", "public", "String", "run", "(", ")", "{", "String", "output", "=", "System", ".", "getProperty", "(", "\"wlp.install.dir\"", ")", ";", "if", "(", "output", "==", "null", ")", "{", "output", "=", "System", ".", "getenv", "(", "\"WLP_INSTALL_DIR\"", ")", ";", "}", "if", "(", "output", "==", "null", ")", "{", "// if neither of these is set. use the location where the class is loaded.", "URL", "url", "=", "CLASS_NAME", ".", "getProtectionDomain", "(", ")", ".", "getCodeSource", "(", ")", ".", "getLocation", "(", ")", ";", "try", "{", "output", "=", "new", "File", "(", "url", ".", "toString", "(", ")", ".", "substring", "(", "\"file:\"", ".", "length", "(", ")", ")", ")", ".", "getParentFile", "(", ")", ".", "getParentFile", "(", ")", ".", "getCanonicalPath", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "// this condition should not happen, but if that's the case, use current directory.", "output", "=", "\".\"", ";", "if", "(", "logger", ".", "isLoggable", "(", "Level", ".", "FINE", ")", ")", "{", "logger", ".", "fine", "(", "\"The install root was not detected. \"", "+", "e", ".", "getMessage", "(", ")", ")", ";", "}", "}", "}", "if", "(", "logger", ".", "isLoggable", "(", "Level", ".", "FINE", ")", ")", "{", "logger", ".", "fine", "(", "\"The install root is \"", "+", "output", ")", ";", "}", "return", "output", ";", "}", "}", ")", ";", "}" ]
Returns the installation root. If it wasn't detected, use current directory.
[ "Returns", "the", "installation", "root", ".", "If", "it", "wasn", "t", "detected", "use", "current", "directory", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.crypto.passwordutil/src/com/ibm/ws/crypto/util/custom/CustomUtils.java#L120-L147
train
OpenLiberty/open-liberty
dev/com.ibm.ws.crypto.passwordutil/src/com/ibm/ws/crypto/util/custom/CustomUtils.java
CustomUtils.getResourceBundle
public static ResourceBundle getResourceBundle(File location, String name, Locale locale) { File[] files = new File[] { new File(location, name + "_" + locale.toString() + RESOURCE_FILE_EXT), new File(location, name + "_" + locale.getLanguage() + RESOURCE_FILE_EXT), new File(location, name + RESOURCE_FILE_EXT) }; for (File file : files) { if (exists(file)) { try { return new PropertyResourceBundle(new FileReader(file)); } catch (IOException e) { if (logger.isLoggable(Level.FINE)) { logger.fine("The resource file was not loaded. The exception is " + e.getMessage()); } } } } return null; }
java
public static ResourceBundle getResourceBundle(File location, String name, Locale locale) { File[] files = new File[] { new File(location, name + "_" + locale.toString() + RESOURCE_FILE_EXT), new File(location, name + "_" + locale.getLanguage() + RESOURCE_FILE_EXT), new File(location, name + RESOURCE_FILE_EXT) }; for (File file : files) { if (exists(file)) { try { return new PropertyResourceBundle(new FileReader(file)); } catch (IOException e) { if (logger.isLoggable(Level.FINE)) { logger.fine("The resource file was not loaded. The exception is " + e.getMessage()); } } } } return null; }
[ "public", "static", "ResourceBundle", "getResourceBundle", "(", "File", "location", ",", "String", "name", ",", "Locale", "locale", ")", "{", "File", "[", "]", "files", "=", "new", "File", "[", "]", "{", "new", "File", "(", "location", ",", "name", "+", "\"_\"", "+", "locale", ".", "toString", "(", ")", "+", "RESOURCE_FILE_EXT", ")", ",", "new", "File", "(", "location", ",", "name", "+", "\"_\"", "+", "locale", ".", "getLanguage", "(", ")", "+", "RESOURCE_FILE_EXT", ")", ",", "new", "File", "(", "location", ",", "name", "+", "RESOURCE_FILE_EXT", ")", "}", ";", "for", "(", "File", "file", ":", "files", ")", "{", "if", "(", "exists", "(", "file", ")", ")", "{", "try", "{", "return", "new", "PropertyResourceBundle", "(", "new", "FileReader", "(", "file", ")", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "if", "(", "logger", ".", "isLoggable", "(", "Level", ".", "FINE", ")", ")", "{", "logger", ".", "fine", "(", "\"The resource file was not loaded. The exception is \"", "+", "e", ".", "getMessage", "(", ")", ")", ";", "}", "}", "}", "}", "return", "null", ";", "}" ]
find the best matching resouce bundle of the specified resouce file name.
[ "find", "the", "best", "matching", "resouce", "bundle", "of", "the", "specified", "resouce", "file", "name", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.crypto.passwordutil/src/com/ibm/ws/crypto/util/custom/CustomUtils.java#L152-L168
train
OpenLiberty/open-liberty
dev/com.ibm.ws.crypto.passwordutil/src/com/ibm/ws/crypto/util/custom/CustomUtils.java
CustomUtils.findCustomEncryption
public static List<CustomManifest> findCustomEncryption(String extension) throws IOException { List<File> dirs = listRootAndExtensionDirectories(); return findCustomEncryption(dirs, TOOL_EXTENSION_DIR + extension); }
java
public static List<CustomManifest> findCustomEncryption(String extension) throws IOException { List<File> dirs = listRootAndExtensionDirectories(); return findCustomEncryption(dirs, TOOL_EXTENSION_DIR + extension); }
[ "public", "static", "List", "<", "CustomManifest", ">", "findCustomEncryption", "(", "String", "extension", ")", "throws", "IOException", "{", "List", "<", "File", ">", "dirs", "=", "listRootAndExtensionDirectories", "(", ")", ";", "return", "findCustomEncryption", "(", "dirs", ",", "TOOL_EXTENSION_DIR", "+", "extension", ")", ";", "}" ]
Find the URL of the jar file which includes specified class. If there is none, return empty array. @throws IOException
[ "Find", "the", "URL", "of", "the", "jar", "file", "which", "includes", "specified", "class", ".", "If", "there", "is", "none", "return", "empty", "array", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.crypto.passwordutil/src/com/ibm/ws/crypto/util/custom/CustomUtils.java#L176-L179
train
OpenLiberty/open-liberty
dev/com.ibm.ws.crypto.passwordutil/src/com/ibm/ws/crypto/util/custom/CustomUtils.java
CustomUtils.findCustomEncryption
protected static List<CustomManifest> findCustomEncryption(List<File> rootDirs, String path) throws IOException { List<CustomManifest> list = new ArrayList<CustomManifest>(); for (File dir : rootDirs) { dir = new File(dir, path); if (exists(dir)) { File[] files = listFiles(dir); if (files != null) { for (File file : files) { if (isFile(file) && file.getName().toLowerCase().endsWith(JAR_FILE_EXT)) { if (logger.isLoggable(Level.FINE)) { logger.fine("The extension manifest file : " + file); } try { CustomManifest cm = new CustomManifest(file); list.add(cm); } catch (IllegalArgumentException iae) { if (logger.isLoggable(Level.INFO)) { logger.info(MessageUtils.getMessage("PASSWORDUTIL_ERROR_IN_EXTENSION_MANIFEST_FILE", file, iae.getMessage())); } } } } } } } return list; }
java
protected static List<CustomManifest> findCustomEncryption(List<File> rootDirs, String path) throws IOException { List<CustomManifest> list = new ArrayList<CustomManifest>(); for (File dir : rootDirs) { dir = new File(dir, path); if (exists(dir)) { File[] files = listFiles(dir); if (files != null) { for (File file : files) { if (isFile(file) && file.getName().toLowerCase().endsWith(JAR_FILE_EXT)) { if (logger.isLoggable(Level.FINE)) { logger.fine("The extension manifest file : " + file); } try { CustomManifest cm = new CustomManifest(file); list.add(cm); } catch (IllegalArgumentException iae) { if (logger.isLoggable(Level.INFO)) { logger.info(MessageUtils.getMessage("PASSWORDUTIL_ERROR_IN_EXTENSION_MANIFEST_FILE", file, iae.getMessage())); } } } } } } } return list; }
[ "protected", "static", "List", "<", "CustomManifest", ">", "findCustomEncryption", "(", "List", "<", "File", ">", "rootDirs", ",", "String", "path", ")", "throws", "IOException", "{", "List", "<", "CustomManifest", ">", "list", "=", "new", "ArrayList", "<", "CustomManifest", ">", "(", ")", ";", "for", "(", "File", "dir", ":", "rootDirs", ")", "{", "dir", "=", "new", "File", "(", "dir", ",", "path", ")", ";", "if", "(", "exists", "(", "dir", ")", ")", "{", "File", "[", "]", "files", "=", "listFiles", "(", "dir", ")", ";", "if", "(", "files", "!=", "null", ")", "{", "for", "(", "File", "file", ":", "files", ")", "{", "if", "(", "isFile", "(", "file", ")", "&&", "file", ".", "getName", "(", ")", ".", "toLowerCase", "(", ")", ".", "endsWith", "(", "JAR_FILE_EXT", ")", ")", "{", "if", "(", "logger", ".", "isLoggable", "(", "Level", ".", "FINE", ")", ")", "{", "logger", ".", "fine", "(", "\"The extension manifest file : \"", "+", "file", ")", ";", "}", "try", "{", "CustomManifest", "cm", "=", "new", "CustomManifest", "(", "file", ")", ";", "list", ".", "add", "(", "cm", ")", ";", "}", "catch", "(", "IllegalArgumentException", "iae", ")", "{", "if", "(", "logger", ".", "isLoggable", "(", "Level", ".", "INFO", ")", ")", "{", "logger", ".", "info", "(", "MessageUtils", ".", "getMessage", "(", "\"PASSWORDUTIL_ERROR_IN_EXTENSION_MANIFEST_FILE\"", ",", "file", ",", "iae", ".", "getMessage", "(", ")", ")", ")", ";", "}", "}", "}", "}", "}", "}", "}", "return", "list", ";", "}" ]
Find the custom encryption manifest files from the specified list of root directories and path name. The reason why there are multiple root directories is that the product extensions which will allow to add the additional root directory anywhere. @throws IOException
[ "Find", "the", "custom", "encryption", "manifest", "files", "from", "the", "specified", "list", "of", "root", "directories", "and", "path", "name", ".", "The", "reason", "why", "there", "are", "multiple", "root", "directories", "is", "that", "the", "product", "extensions", "which", "will", "allow", "to", "add", "the", "additional", "root", "directory", "anywhere", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.crypto.passwordutil/src/com/ibm/ws/crypto/util/custom/CustomUtils.java#L188-L214
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/richclient/framework/impl/RichClientFramework.java
RichClientFramework.getNetworkTransportFactory
@Override public NetworkTransportFactory getNetworkTransportFactory() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getNetworkTransportFactory"); NetworkTransportFactory factory = new RichClientTransportFactory(framework); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getNetworkTransportFactory", factory); return factory; }
java
@Override public NetworkTransportFactory getNetworkTransportFactory() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getNetworkTransportFactory"); NetworkTransportFactory factory = new RichClientTransportFactory(framework); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getNetworkTransportFactory", factory); return factory; }
[ "@", "Override", "public", "NetworkTransportFactory", "getNetworkTransportFactory", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"getNetworkTransportFactory\"", ")", ";", "NetworkTransportFactory", "factory", "=", "new", "RichClientTransportFactory", "(", "framework", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"getNetworkTransportFactory\"", ",", "factory", ")", ";", "return", "factory", ";", "}" ]
This method is our entry point into the Channel Framework implementation of the JFap Framework interfaces. @see com.ibm.ws.sib.jfapchannel.framework.Framework#getNetworkTransportFactory()
[ "This", "method", "is", "our", "entry", "point", "into", "the", "Channel", "Framework", "implementation", "of", "the", "JFap", "Framework", "interfaces", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/richclient/framework/impl/RichClientFramework.java#L98-L107
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/richclient/framework/impl/RichClientFramework.java
RichClientFramework.getOutboundConnectionProperties
@Override public Map getOutboundConnectionProperties(String outboundTransportName) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getOutboundConnectionProperties", outboundTransportName); ChainData chainData = framework.getChain(outboundTransportName); // Obtain properties for outbound channel ChannelData[] channelList = chainData.getChannelList(); Map properties = null; if (channelList.length > 0) { properties = channelList[0].getPropertyBag(); } else { throw new SIErrorException( nls.getFormattedMessage("OUTCONNTRACKER_INTERNAL_SICJ0064", null, "OUTCONNTRACKER_INTERNAL_SICJ0064")); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getOutboundConnectionProperties", properties); return properties; }
java
@Override public Map getOutboundConnectionProperties(String outboundTransportName) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getOutboundConnectionProperties", outboundTransportName); ChainData chainData = framework.getChain(outboundTransportName); // Obtain properties for outbound channel ChannelData[] channelList = chainData.getChannelList(); Map properties = null; if (channelList.length > 0) { properties = channelList[0].getPropertyBag(); } else { throw new SIErrorException( nls.getFormattedMessage("OUTCONNTRACKER_INTERNAL_SICJ0064", null, "OUTCONNTRACKER_INTERNAL_SICJ0064")); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getOutboundConnectionProperties", properties); return properties; }
[ "@", "Override", "public", "Map", "getOutboundConnectionProperties", "(", "String", "outboundTransportName", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"getOutboundConnectionProperties\"", ",", "outboundTransportName", ")", ";", "ChainData", "chainData", "=", "framework", ".", "getChain", "(", "outboundTransportName", ")", ";", "// Obtain properties for outbound channel", "ChannelData", "[", "]", "channelList", "=", "chainData", ".", "getChannelList", "(", ")", ";", "Map", "properties", "=", "null", ";", "if", "(", "channelList", ".", "length", ">", "0", ")", "{", "properties", "=", "channelList", "[", "0", "]", ".", "getPropertyBag", "(", ")", ";", "}", "else", "{", "throw", "new", "SIErrorException", "(", "nls", ".", "getFormattedMessage", "(", "\"OUTCONNTRACKER_INTERNAL_SICJ0064\"", ",", "null", ",", "\"OUTCONNTRACKER_INTERNAL_SICJ0064\"", ")", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"getOutboundConnectionProperties\"", ",", "properties", ")", ";", "return", "properties", ";", "}" ]
This method will retrieve the property bag on the named chain so that it can be determined what properties have been set on it. @param outboundTransportName The chain name. @see com.ibm.ws.sib.jfapchannel.framework.Framework#getOutboundConnectionProperties(java.lang.String)
[ "This", "method", "will", "retrieve", "the", "property", "bag", "on", "the", "named", "chain", "so", "that", "it", "can", "be", "determined", "what", "properties", "have", "been", "set", "on", "it", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/richclient/framework/impl/RichClientFramework.java#L117-L144
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/richclient/framework/impl/RichClientFramework.java
RichClientFramework.getOutboundConnectionProperties
@Override public Map getOutboundConnectionProperties(Object ep) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getOutboundConnectionProperties", ep); Map properties = null; if (ep instanceof CFEndPoint) { OutboundChannelDefinition[] channelDefinitions = (OutboundChannelDefinition[]) ((CFEndPoint) ep).getOutboundChannelDefs().toArray(); if (channelDefinitions.length < 1) throw new SIErrorException(nls.getFormattedMessage("OUTCONNTRACKER_INTERNAL_SICJ0064", null, "OUTCONNTRACKER_INTERNAL_SICJ0064")); properties = channelDefinitions[0].getOutboundChannelProperties(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getOutboundConnectionProperties", properties); return properties; }
java
@Override public Map getOutboundConnectionProperties(Object ep) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getOutboundConnectionProperties", ep); Map properties = null; if (ep instanceof CFEndPoint) { OutboundChannelDefinition[] channelDefinitions = (OutboundChannelDefinition[]) ((CFEndPoint) ep).getOutboundChannelDefs().toArray(); if (channelDefinitions.length < 1) throw new SIErrorException(nls.getFormattedMessage("OUTCONNTRACKER_INTERNAL_SICJ0064", null, "OUTCONNTRACKER_INTERNAL_SICJ0064")); properties = channelDefinitions[0].getOutboundChannelProperties(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getOutboundConnectionProperties", properties); return properties; }
[ "@", "Override", "public", "Map", "getOutboundConnectionProperties", "(", "Object", "ep", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"getOutboundConnectionProperties\"", ",", "ep", ")", ";", "Map", "properties", "=", "null", ";", "if", "(", "ep", "instanceof", "CFEndPoint", ")", "{", "OutboundChannelDefinition", "[", "]", "channelDefinitions", "=", "(", "OutboundChannelDefinition", "[", "]", ")", "(", "(", "CFEndPoint", ")", "ep", ")", ".", "getOutboundChannelDefs", "(", ")", ".", "toArray", "(", ")", ";", "if", "(", "channelDefinitions", ".", "length", "<", "1", ")", "throw", "new", "SIErrorException", "(", "nls", ".", "getFormattedMessage", "(", "\"OUTCONNTRACKER_INTERNAL_SICJ0064\"", ",", "null", ",", "\"OUTCONNTRACKER_INTERNAL_SICJ0064\"", ")", ")", ";", "properties", "=", "channelDefinitions", "[", "0", "]", ".", "getOutboundChannelProperties", "(", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"getOutboundConnectionProperties\"", ",", "properties", ")", ";", "return", "properties", ";", "}" ]
This method will retrieve the property bag on the outbound chain that will be used by the specified end point. This method is only valid for CFEndPoints. @param ep The CFEndPoint @see com.ibm.ws.sib.jfapchannel.framework.Framework#getOutboundConnectionProperties(java.lang.Object)
[ "This", "method", "will", "retrieve", "the", "property", "bag", "on", "the", "outbound", "chain", "that", "will", "be", "used", "by", "the", "specified", "end", "point", ".", "This", "method", "is", "only", "valid", "for", "CFEndPoints", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/richclient/framework/impl/RichClientFramework.java#L154-L172
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/richclient/framework/impl/RichClientFramework.java
RichClientFramework.getHostAddress
@Override public InetAddress getHostAddress(Object endPoint) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getHostAddress", endPoint); InetAddress address = null; if (endPoint instanceof CFEndPoint) { address = ((CFEndPoint) endPoint).getAddress(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getHostAddress", address); return address; }
java
@Override public InetAddress getHostAddress(Object endPoint) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getHostAddress", endPoint); InetAddress address = null; if (endPoint instanceof CFEndPoint) { address = ((CFEndPoint) endPoint).getAddress(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getHostAddress", address); return address; }
[ "@", "Override", "public", "InetAddress", "getHostAddress", "(", "Object", "endPoint", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"getHostAddress\"", ",", "endPoint", ")", ";", "InetAddress", "address", "=", "null", ";", "if", "(", "endPoint", "instanceof", "CFEndPoint", ")", "{", "address", "=", "(", "(", "CFEndPoint", ")", "endPoint", ")", ".", "getAddress", "(", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"getHostAddress\"", ",", "address", ")", ";", "return", "address", ";", "}" ]
Retrieves the host address from the specified CFEndPoint. @see com.ibm.ws.sib.jfapchannel.framework.Framework#getHostAddress(java.lang.Object)
[ "Retrieves", "the", "host", "address", "from", "the", "specified", "CFEndPoint", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/richclient/framework/impl/RichClientFramework.java#L426-L441
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/richclient/framework/impl/RichClientFramework.java
RichClientFramework.getHostPort
@Override public int getHostPort(Object endPoint) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getHostPort", endPoint); int port = 0; if (endPoint instanceof CFEndPoint) { port = ((CFEndPoint) endPoint).getPort(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getHostPort", Integer.valueOf(port)); return port; }
java
@Override public int getHostPort(Object endPoint) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getHostPort", endPoint); int port = 0; if (endPoint instanceof CFEndPoint) { port = ((CFEndPoint) endPoint).getPort(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getHostPort", Integer.valueOf(port)); return port; }
[ "@", "Override", "public", "int", "getHostPort", "(", "Object", "endPoint", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"getHostPort\"", ",", "endPoint", ")", ";", "int", "port", "=", "0", ";", "if", "(", "endPoint", "instanceof", "CFEndPoint", ")", "{", "port", "=", "(", "(", "CFEndPoint", ")", "endPoint", ")", ".", "getPort", "(", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"getHostPort\"", ",", "Integer", ".", "valueOf", "(", "port", ")", ")", ";", "return", "port", ";", "}" ]
Retrieves the host port from the specified CFEndPoint. @see com.ibm.ws.sib.jfapchannel.framework.Framework#getHostPort(java.lang.Object)
[ "Retrieves", "the", "host", "port", "from", "the", "specified", "CFEndPoint", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/richclient/framework/impl/RichClientFramework.java#L448-L463
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/richclient/framework/impl/RichClientFramework.java
RichClientFramework.areEndPointsEqual
@Override public boolean areEndPointsEqual(Object ep1, Object ep2) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "areEndPointsEqual", new Object[] { ep1, ep2 }); boolean isEqual = false; if (ep1 instanceof CFEndPoint && ep2 instanceof CFEndPoint) { CFEndPoint cfEp1 = (CFEndPoint) ep1; CFEndPoint cfEp2 = (CFEndPoint) ep2; // The CFW does not provide an equals method for its endpoints. // We need to manually equals the important bits up isEqual = isEqual(cfEp1.getAddress(), cfEp2.getAddress()) && isEqual(cfEp1.getName(), cfEp2.getName()) && cfEp1.getPort() == cfEp2.getPort() && cfEp1.isLocal() == cfEp2.isLocal() && cfEp1.isSSLEnabled() == cfEp2.isSSLEnabled(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "areEndPointsEqual", Boolean.valueOf(isEqual)); return isEqual; }
java
@Override public boolean areEndPointsEqual(Object ep1, Object ep2) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "areEndPointsEqual", new Object[] { ep1, ep2 }); boolean isEqual = false; if (ep1 instanceof CFEndPoint && ep2 instanceof CFEndPoint) { CFEndPoint cfEp1 = (CFEndPoint) ep1; CFEndPoint cfEp2 = (CFEndPoint) ep2; // The CFW does not provide an equals method for its endpoints. // We need to manually equals the important bits up isEqual = isEqual(cfEp1.getAddress(), cfEp2.getAddress()) && isEqual(cfEp1.getName(), cfEp2.getName()) && cfEp1.getPort() == cfEp2.getPort() && cfEp1.isLocal() == cfEp2.isLocal() && cfEp1.isSSLEnabled() == cfEp2.isSSLEnabled(); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "areEndPointsEqual", Boolean.valueOf(isEqual)); return isEqual; }
[ "@", "Override", "public", "boolean", "areEndPointsEqual", "(", "Object", "ep1", ",", "Object", "ep2", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"areEndPointsEqual\"", ",", "new", "Object", "[", "]", "{", "ep1", ",", "ep2", "}", ")", ";", "boolean", "isEqual", "=", "false", ";", "if", "(", "ep1", "instanceof", "CFEndPoint", "&&", "ep2", "instanceof", "CFEndPoint", ")", "{", "CFEndPoint", "cfEp1", "=", "(", "CFEndPoint", ")", "ep1", ";", "CFEndPoint", "cfEp2", "=", "(", "CFEndPoint", ")", "ep2", ";", "// The CFW does not provide an equals method for its endpoints.", "// We need to manually equals the important bits up", "isEqual", "=", "isEqual", "(", "cfEp1", ".", "getAddress", "(", ")", ",", "cfEp2", ".", "getAddress", "(", ")", ")", "&&", "isEqual", "(", "cfEp1", ".", "getName", "(", ")", ",", "cfEp2", ".", "getName", "(", ")", ")", "&&", "cfEp1", ".", "getPort", "(", ")", "==", "cfEp2", ".", "getPort", "(", ")", "&&", "cfEp1", ".", "isLocal", "(", ")", "==", "cfEp2", ".", "isLocal", "(", ")", "&&", "cfEp1", ".", "isSSLEnabled", "(", ")", "==", "cfEp2", ".", "isSSLEnabled", "(", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"areEndPointsEqual\"", ",", "Boolean", ".", "valueOf", "(", "isEqual", ")", ")", ";", "return", "isEqual", ";", "}" ]
The channel framework EP's don't have their own equals method - so one is implemented here by comparing the various parts of the EP. @see com.ibm.ws.sib.jfapchannel.framework.Framework#areEndPointsEqual(java.lang.Object, java.lang.Object)
[ "The", "channel", "framework", "EP", "s", "don", "t", "have", "their", "own", "equals", "method", "-", "so", "one", "is", "implemented", "here", "by", "comparing", "the", "various", "parts", "of", "the", "EP", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/richclient/framework/impl/RichClientFramework.java#L572-L597
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/richclient/framework/impl/RichClientFramework.java
RichClientFramework.getEndPointHashCode
@Override public int getEndPointHashCode(Object ep) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getEndPointHashCode", ep); int hashCode = 0; if (ep instanceof CFEndPoint) { CFEndPoint cfEndPoint = (CFEndPoint) ep; if (cfEndPoint.getAddress() != null) hashCode = hashCode ^ cfEndPoint.getAddress().hashCode(); if (cfEndPoint.getName() != null) hashCode = hashCode ^ cfEndPoint.getName().hashCode(); } if (hashCode == 0) hashCode = hashCode ^ ep.hashCode(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getEndPointHashCode", Integer.valueOf(hashCode)); return hashCode; }
java
@Override public int getEndPointHashCode(Object ep) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getEndPointHashCode", ep); int hashCode = 0; if (ep instanceof CFEndPoint) { CFEndPoint cfEndPoint = (CFEndPoint) ep; if (cfEndPoint.getAddress() != null) hashCode = hashCode ^ cfEndPoint.getAddress().hashCode(); if (cfEndPoint.getName() != null) hashCode = hashCode ^ cfEndPoint.getName().hashCode(); } if (hashCode == 0) hashCode = hashCode ^ ep.hashCode(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "getEndPointHashCode", Integer.valueOf(hashCode)); return hashCode; }
[ "@", "Override", "public", "int", "getEndPointHashCode", "(", "Object", "ep", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"getEndPointHashCode\"", ",", "ep", ")", ";", "int", "hashCode", "=", "0", ";", "if", "(", "ep", "instanceof", "CFEndPoint", ")", "{", "CFEndPoint", "cfEndPoint", "=", "(", "CFEndPoint", ")", "ep", ";", "if", "(", "cfEndPoint", ".", "getAddress", "(", ")", "!=", "null", ")", "hashCode", "=", "hashCode", "^", "cfEndPoint", ".", "getAddress", "(", ")", ".", "hashCode", "(", ")", ";", "if", "(", "cfEndPoint", ".", "getName", "(", ")", "!=", "null", ")", "hashCode", "=", "hashCode", "^", "cfEndPoint", ".", "getName", "(", ")", ".", "hashCode", "(", ")", ";", "}", "if", "(", "hashCode", "==", "0", ")", "hashCode", "=", "hashCode", "^", "ep", ".", "hashCode", "(", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"getEndPointHashCode\"", ",", "Integer", ".", "valueOf", "(", "hashCode", ")", ")", ";", "return", "hashCode", ";", "}" ]
The channel framework EP's don't have their own hashCode method - so one is implemented here using the various parts of the EP. @see com.ibm.ws.sib.jfapchannel.framework.Framework#getEndPointHashCode(java.lang.Object)
[ "The", "channel", "framework", "EP", "s", "don", "t", "have", "their", "own", "hashCode", "method", "-", "so", "one", "is", "implemented", "here", "using", "the", "various", "parts", "of", "the", "EP", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/richclient/framework/impl/RichClientFramework.java#L605-L627
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/richclient/framework/impl/RichClientFramework.java
RichClientFramework.cloneEndpoint
private CFEndPoint cloneEndpoint(final CFEndPoint originalEndPoint) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "cloneEndpoint", originalEndPoint); CFEndPoint endPoint; ByteArrayOutputStream baos = null; ObjectOutputStream out = null; ObjectInputStream in = null; try { baos = new ByteArrayOutputStream(); out = new ObjectOutputStream(baos); out.writeObject(originalEndPoint); out.flush(); ClassLoader cl = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() { @Override public ClassLoader run() { return Thread.currentThread().getContextClassLoader(); } }); in = new DeserializationObjectInputStream(new ByteArrayInputStream(baos.toByteArray()), cl); endPoint = (CFEndPoint) in.readObject(); } catch (IOException e) { FFDCFilter.processException(e, CLASS_NAME + ".cloneEndpoint", JFapChannelConstants.RICHCLIENTFRAMEWORK_CLONE_01, this); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Caught IOException copying endpoint", e); //Use input parameter. endPoint = originalEndPoint; } catch (ClassNotFoundException e) { FFDCFilter.processException(e, CLASS_NAME + ".cloneEndpoint", JFapChannelConstants.RICHCLIENTFRAMEWORK_CLONE_02, this); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Caught ClassNotFoundException copying endpoint", e); //Use input parameter. endPoint = originalEndPoint; } finally { //Tidy up resources. try { if (out != null) { out.close(); } if (in != null) { in.close(); } } catch (IOException e) { //No FFDC code needed. //Absorb any exceptions as we no longer care. } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "cloneEndpoint", endPoint); return endPoint; }
java
private CFEndPoint cloneEndpoint(final CFEndPoint originalEndPoint) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "cloneEndpoint", originalEndPoint); CFEndPoint endPoint; ByteArrayOutputStream baos = null; ObjectOutputStream out = null; ObjectInputStream in = null; try { baos = new ByteArrayOutputStream(); out = new ObjectOutputStream(baos); out.writeObject(originalEndPoint); out.flush(); ClassLoader cl = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() { @Override public ClassLoader run() { return Thread.currentThread().getContextClassLoader(); } }); in = new DeserializationObjectInputStream(new ByteArrayInputStream(baos.toByteArray()), cl); endPoint = (CFEndPoint) in.readObject(); } catch (IOException e) { FFDCFilter.processException(e, CLASS_NAME + ".cloneEndpoint", JFapChannelConstants.RICHCLIENTFRAMEWORK_CLONE_01, this); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Caught IOException copying endpoint", e); //Use input parameter. endPoint = originalEndPoint; } catch (ClassNotFoundException e) { FFDCFilter.processException(e, CLASS_NAME + ".cloneEndpoint", JFapChannelConstants.RICHCLIENTFRAMEWORK_CLONE_02, this); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "Caught ClassNotFoundException copying endpoint", e); //Use input parameter. endPoint = originalEndPoint; } finally { //Tidy up resources. try { if (out != null) { out.close(); } if (in != null) { in.close(); } } catch (IOException e) { //No FFDC code needed. //Absorb any exceptions as we no longer care. } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "cloneEndpoint", endPoint); return endPoint; }
[ "private", "CFEndPoint", "cloneEndpoint", "(", "final", "CFEndPoint", "originalEndPoint", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"cloneEndpoint\"", ",", "originalEndPoint", ")", ";", "CFEndPoint", "endPoint", ";", "ByteArrayOutputStream", "baos", "=", "null", ";", "ObjectOutputStream", "out", "=", "null", ";", "ObjectInputStream", "in", "=", "null", ";", "try", "{", "baos", "=", "new", "ByteArrayOutputStream", "(", ")", ";", "out", "=", "new", "ObjectOutputStream", "(", "baos", ")", ";", "out", ".", "writeObject", "(", "originalEndPoint", ")", ";", "out", ".", "flush", "(", ")", ";", "ClassLoader", "cl", "=", "AccessController", ".", "doPrivileged", "(", "new", "PrivilegedAction", "<", "ClassLoader", ">", "(", ")", "{", "@", "Override", "public", "ClassLoader", "run", "(", ")", "{", "return", "Thread", ".", "currentThread", "(", ")", ".", "getContextClassLoader", "(", ")", ";", "}", "}", ")", ";", "in", "=", "new", "DeserializationObjectInputStream", "(", "new", "ByteArrayInputStream", "(", "baos", ".", "toByteArray", "(", ")", ")", ",", "cl", ")", ";", "endPoint", "=", "(", "CFEndPoint", ")", "in", ".", "readObject", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "FFDCFilter", ".", "processException", "(", "e", ",", "CLASS_NAME", "+", "\".cloneEndpoint\"", ",", "JFapChannelConstants", ".", "RICHCLIENTFRAMEWORK_CLONE_01", ",", "this", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "this", ",", "tc", ",", "\"Caught IOException copying endpoint\"", ",", "e", ")", ";", "//Use input parameter.", "endPoint", "=", "originalEndPoint", ";", "}", "catch", "(", "ClassNotFoundException", "e", ")", "{", "FFDCFilter", ".", "processException", "(", "e", ",", "CLASS_NAME", "+", "\".cloneEndpoint\"", ",", "JFapChannelConstants", ".", "RICHCLIENTFRAMEWORK_CLONE_02", ",", "this", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "this", ",", "tc", ",", "\"Caught ClassNotFoundException copying endpoint\"", ",", "e", ")", ";", "//Use input parameter.", "endPoint", "=", "originalEndPoint", ";", "}", "finally", "{", "//Tidy up resources.", "try", "{", "if", "(", "out", "!=", "null", ")", "{", "out", ".", "close", "(", ")", ";", "}", "if", "(", "in", "!=", "null", ")", "{", "in", ".", "close", "(", ")", ";", "}", "}", "catch", "(", "IOException", "e", ")", "{", "//No FFDC code needed.", "//Absorb any exceptions as we no longer care.", "}", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"cloneEndpoint\"", ",", "endPoint", ")", ";", "return", "endPoint", ";", "}" ]
Creates a copy of originalEndPoint. This is to prevent us causing problems when we change it. As there is no exposed way to do this we will use serialization. It may be a bit slow, but it is implementation safe as the implementation of CFEndPoint is designed to be serialized by WLM. Plus we only need to do this when creating the original connection so it is not main line code. @param originalEndPoint the CFEndPoint to be cloned @return a cloned CFEndPoint or the original one if the clone failed.
[ "Creates", "a", "copy", "of", "originalEndPoint", ".", "This", "is", "to", "prevent", "us", "causing", "problems", "when", "we", "change", "it", ".", "As", "there", "is", "no", "exposed", "way", "to", "do", "this", "we", "will", "use", "serialization", ".", "It", "may", "be", "a", "bit", "slow", "but", "it", "is", "implementation", "safe", "as", "the", "implementation", "of", "CFEndPoint", "is", "designed", "to", "be", "serialized", "by", "WLM", ".", "Plus", "we", "only", "need", "to", "do", "this", "when", "creating", "the", "original", "connection", "so", "it", "is", "not", "main", "line", "code", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/richclient/framework/impl/RichClientFramework.java#L665-L730
train
OpenLiberty/open-liberty
dev/com.ibm.ws.wsoc/src/com/ibm/ws/wsoc/LinkRead.java
LinkRead.getCause
private Throwable getCause(Throwable t) { Throwable cause = t.getCause(); if (t.getCause() != null) { return cause; } else { return t; } }
java
private Throwable getCause(Throwable t) { Throwable cause = t.getCause(); if (t.getCause() != null) { return cause; } else { return t; } }
[ "private", "Throwable", "getCause", "(", "Throwable", "t", ")", "{", "Throwable", "cause", "=", "t", ".", "getCause", "(", ")", ";", "if", "(", "t", ".", "getCause", "(", ")", "!=", "null", ")", "{", "return", "cause", ";", "}", "else", "{", "return", "t", ";", "}", "}" ]
get if 'cause' exists, else return the original exception
[ "get", "if", "cause", "exists", "else", "return", "the", "original", "exception" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.wsoc/src/com/ibm/ws/wsoc/LinkRead.java#L1143-L1150
train
OpenLiberty/open-liberty
dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/BaseTraceFormatter.java
BaseTraceFormatter.traceLogFormat
public String traceLogFormat(LogRecord logRecord, Object id, String formattedMsg, String formattedVerboseMsg) { final String txt; if (formattedVerboseMsg == null) { // If we don't already have a formatted message... (for Audit or Info or Warning.. ) // we have to build something instead (while avoiding a useless resource bundle lookup) txt = formatVerboseMessage(logRecord, formattedMsg, false); } else { txt = formattedVerboseMsg; } return createFormattedString(logRecord, id, txt); }
java
public String traceLogFormat(LogRecord logRecord, Object id, String formattedMsg, String formattedVerboseMsg) { final String txt; if (formattedVerboseMsg == null) { // If we don't already have a formatted message... (for Audit or Info or Warning.. ) // we have to build something instead (while avoiding a useless resource bundle lookup) txt = formatVerboseMessage(logRecord, formattedMsg, false); } else { txt = formattedVerboseMsg; } return createFormattedString(logRecord, id, txt); }
[ "public", "String", "traceLogFormat", "(", "LogRecord", "logRecord", ",", "Object", "id", ",", "String", "formattedMsg", ",", "String", "formattedVerboseMsg", ")", "{", "final", "String", "txt", ";", "if", "(", "formattedVerboseMsg", "==", "null", ")", "{", "// If we don't already have a formatted message... (for Audit or Info or Warning.. )", "// we have to build something instead (while avoiding a useless resource bundle lookup)", "txt", "=", "formatVerboseMessage", "(", "logRecord", ",", "formattedMsg", ",", "false", ")", ";", "}", "else", "{", "txt", "=", "formattedVerboseMsg", ";", "}", "return", "createFormattedString", "(", "logRecord", ",", "id", ",", "txt", ")", ";", "}" ]
Format a detailed record for trace.log. Previously formatted messages may be provided and may be reused if possible. @param logRecord @param id @param formattedMsg the result of {@link #formatMessage}, or null if that method was not previously called @param formattedVerboseMsg the result of {@link #formatVerboseMessage}, or null if that method was not previously called @return
[ "Format", "a", "detailed", "record", "for", "trace", ".", "log", ".", "Previously", "formatted", "messages", "may", "be", "provided", "and", "may", "be", "reused", "if", "possible", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/BaseTraceFormatter.java#L205-L216
train
OpenLiberty/open-liberty
dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/BaseTraceFormatter.java
BaseTraceFormatter.formatVerboseObj
private Object formatVerboseObj(Object obj) { // Make sure that we don't truncate any stack traces during verbose logging if (obj instanceof TruncatableThrowable) { TruncatableThrowable truncatable = (TruncatableThrowable) obj; final Throwable wrappedException = truncatable.getWrappedException(); return DataFormatHelper.throwableToString(wrappedException); } else if (obj instanceof Throwable) { return DataFormatHelper.throwableToString((Throwable) obj); } return null; }
java
private Object formatVerboseObj(Object obj) { // Make sure that we don't truncate any stack traces during verbose logging if (obj instanceof TruncatableThrowable) { TruncatableThrowable truncatable = (TruncatableThrowable) obj; final Throwable wrappedException = truncatable.getWrappedException(); return DataFormatHelper.throwableToString(wrappedException); } else if (obj instanceof Throwable) { return DataFormatHelper.throwableToString((Throwable) obj); } return null; }
[ "private", "Object", "formatVerboseObj", "(", "Object", "obj", ")", "{", "// Make sure that we don't truncate any stack traces during verbose logging", "if", "(", "obj", "instanceof", "TruncatableThrowable", ")", "{", "TruncatableThrowable", "truncatable", "=", "(", "TruncatableThrowable", ")", "obj", ";", "final", "Throwable", "wrappedException", "=", "truncatable", ".", "getWrappedException", "(", ")", ";", "return", "DataFormatHelper", ".", "throwableToString", "(", "wrappedException", ")", ";", "}", "else", "if", "(", "obj", "instanceof", "Throwable", ")", "{", "return", "DataFormatHelper", ".", "throwableToString", "(", "(", "Throwable", ")", "obj", ")", ";", "}", "return", "null", ";", "}" ]
Format an object for a verbose message. @param obj the non-null parameter object @return the reformatted object, or null if the object can be used as-is
[ "Format", "an", "object", "for", "a", "verbose", "message", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/BaseTraceFormatter.java#L373-L384
train
OpenLiberty/open-liberty
dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/BaseTraceFormatter.java
BaseTraceFormatter.formatStreamOutput
protected String formatStreamOutput(GenericData genData) { String txt = null; String loglevel = null; KeyValuePair kvp = null; KeyValuePair[] pairs = genData.getPairs(); for (KeyValuePair p : pairs) { if (p != null && !p.isList()) { kvp = p; if (kvp.getKey().equals("message")) { txt = kvp.getStringValue(); } else if (kvp.getKey().equals("loglevel")) { loglevel = kvp.getStringValue(); } } } String message = BaseTraceService.filterStackTraces(txt); if (message != null) { if (loglevel.equals("SystemErr")) { message = "[err] " + message; } } return message; }
java
protected String formatStreamOutput(GenericData genData) { String txt = null; String loglevel = null; KeyValuePair kvp = null; KeyValuePair[] pairs = genData.getPairs(); for (KeyValuePair p : pairs) { if (p != null && !p.isList()) { kvp = p; if (kvp.getKey().equals("message")) { txt = kvp.getStringValue(); } else if (kvp.getKey().equals("loglevel")) { loglevel = kvp.getStringValue(); } } } String message = BaseTraceService.filterStackTraces(txt); if (message != null) { if (loglevel.equals("SystemErr")) { message = "[err] " + message; } } return message; }
[ "protected", "String", "formatStreamOutput", "(", "GenericData", "genData", ")", "{", "String", "txt", "=", "null", ";", "String", "loglevel", "=", "null", ";", "KeyValuePair", "kvp", "=", "null", ";", "KeyValuePair", "[", "]", "pairs", "=", "genData", ".", "getPairs", "(", ")", ";", "for", "(", "KeyValuePair", "p", ":", "pairs", ")", "{", "if", "(", "p", "!=", "null", "&&", "!", "p", ".", "isList", "(", ")", ")", "{", "kvp", "=", "p", ";", "if", "(", "kvp", ".", "getKey", "(", ")", ".", "equals", "(", "\"message\"", ")", ")", "{", "txt", "=", "kvp", ".", "getStringValue", "(", ")", ";", "}", "else", "if", "(", "kvp", ".", "getKey", "(", ")", ".", "equals", "(", "\"loglevel\"", ")", ")", "{", "loglevel", "=", "kvp", ".", "getStringValue", "(", ")", ";", "}", "}", "}", "String", "message", "=", "BaseTraceService", ".", "filterStackTraces", "(", "txt", ")", ";", "if", "(", "message", "!=", "null", ")", "{", "if", "(", "loglevel", ".", "equals", "(", "\"SystemErr\"", ")", ")", "{", "message", "=", "\"[err] \"", "+", "message", ";", "}", "}", "return", "message", ";", "}" ]
Outputs filteredStream of genData @param genData object to filter @return filtered message of the genData
[ "Outputs", "filteredStream", "of", "genData" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging/src/com/ibm/ws/logging/internal/impl/BaseTraceFormatter.java#L1051-L1077
train
OpenLiberty/open-liberty
dev/com.ibm.ws.channelfw/src/com/ibm/io/async/AsyncSocketChannelHelper.java
AsyncSocketChannelHelper.createTimeout
private void createTimeout(IAbstractAsyncFuture future, long delay, boolean isRead) { if (AsyncProperties.disableTimeouts) { return; } // create the timeout time, while not holding the lock long timeoutTime = (System.currentTimeMillis() + delay + Timer.timeoutRoundup) & Timer.timeoutResolution; synchronized (future.getCompletedSemaphore()) { // make sure it didn't complete while we were getting here if (!future.isCompleted()) { timer.createTimeoutRequest(timeoutTime, this.callback, future); } } }
java
private void createTimeout(IAbstractAsyncFuture future, long delay, boolean isRead) { if (AsyncProperties.disableTimeouts) { return; } // create the timeout time, while not holding the lock long timeoutTime = (System.currentTimeMillis() + delay + Timer.timeoutRoundup) & Timer.timeoutResolution; synchronized (future.getCompletedSemaphore()) { // make sure it didn't complete while we were getting here if (!future.isCompleted()) { timer.createTimeoutRequest(timeoutTime, this.callback, future); } } }
[ "private", "void", "createTimeout", "(", "IAbstractAsyncFuture", "future", ",", "long", "delay", ",", "boolean", "isRead", ")", "{", "if", "(", "AsyncProperties", ".", "disableTimeouts", ")", "{", "return", ";", "}", "// create the timeout time, while not holding the lock", "long", "timeoutTime", "=", "(", "System", ".", "currentTimeMillis", "(", ")", "+", "delay", "+", "Timer", ".", "timeoutRoundup", ")", "&", "Timer", ".", "timeoutResolution", ";", "synchronized", "(", "future", ".", "getCompletedSemaphore", "(", ")", ")", "{", "// make sure it didn't complete while we were getting here", "if", "(", "!", "future", ".", "isCompleted", "(", ")", ")", "{", "timer", ".", "createTimeoutRequest", "(", "timeoutTime", ",", "this", ".", "callback", ",", "future", ")", ";", "}", "}", "}" ]
Create the delayed timeout work item for this request. @param future @param delay @param isRead
[ "Create", "the", "delayed", "timeout", "work", "item", "for", "this", "request", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/io/async/AsyncSocketChannelHelper.java#L574-L589
train
OpenLiberty/open-liberty
dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Product.java
Product.refresh
public void refresh() { this.productProperties = new Properties(); FileInputStream fis = null; try { fis = new FileInputStream(new File(this.installDir, PRODUCT_PROPERTIES_PATH)); this.productProperties.load(fis); } catch (Exception e) { } finally { InstallUtils.close(fis); } featureDefs = null; installFeatureDefs = null; mfp = null; }
java
public void refresh() { this.productProperties = new Properties(); FileInputStream fis = null; try { fis = new FileInputStream(new File(this.installDir, PRODUCT_PROPERTIES_PATH)); this.productProperties.load(fis); } catch (Exception e) { } finally { InstallUtils.close(fis); } featureDefs = null; installFeatureDefs = null; mfp = null; }
[ "public", "void", "refresh", "(", ")", "{", "this", ".", "productProperties", "=", "new", "Properties", "(", ")", ";", "FileInputStream", "fis", "=", "null", ";", "try", "{", "fis", "=", "new", "FileInputStream", "(", "new", "File", "(", "this", ".", "installDir", ",", "PRODUCT_PROPERTIES_PATH", ")", ")", ";", "this", ".", "productProperties", ".", "load", "(", "fis", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "}", "finally", "{", "InstallUtils", ".", "close", "(", "fis", ")", ";", "}", "featureDefs", "=", "null", ";", "installFeatureDefs", "=", "null", ";", "mfp", "=", "null", ";", "}" ]
Resets productProperties, featureDefs, installFeatureDefs, and mfp.
[ "Resets", "productProperties", "featureDefs", "installFeatureDefs", "and", "mfp", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Product.java#L67-L80
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jmx.request/src/com/ibm/ws/jmx/request/RequestContext.java
RequestContext.getRequestMetadata
public static RequestMetadata getRequestMetadata() { RequestMetadata metadata = threadLocal.get(); if (metadata == null) metadata = getNoMetadata(); return metadata; }
java
public static RequestMetadata getRequestMetadata() { RequestMetadata metadata = threadLocal.get(); if (metadata == null) metadata = getNoMetadata(); return metadata; }
[ "public", "static", "RequestMetadata", "getRequestMetadata", "(", ")", "{", "RequestMetadata", "metadata", "=", "threadLocal", ".", "get", "(", ")", ";", "if", "(", "metadata", "==", "null", ")", "metadata", "=", "getNoMetadata", "(", ")", ";", "return", "metadata", ";", "}" ]
Gets the metadata for the current request @return the request metadata
[ "Gets", "the", "metadata", "for", "the", "current", "request" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.request/src/com/ibm/ws/jmx/request/RequestContext.java#L41-L46
train
OpenLiberty/open-liberty
dev/com.ibm.ws.channelfw/src/com/ibm/ws/bytebuffer/internal/WsByteBufferPoolManagerImpl.java
WsByteBufferPoolManagerImpl.initialize
public void initialize(int[] bufferEntrySizes, int[] bufferEntryDepths) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(tc, "initialize"); } // order both lists from smallest to largest, based only on Entry Sizes int len = bufferEntrySizes.length; int[] bSizes = new int[len]; int[] bDepths = new int[len]; int sizeCompare; int depth; int sizeSort; int j; for (int i = 0; i < len; i++) { sizeCompare = bufferEntrySizes[i]; depth = bufferEntryDepths[i]; // go backwards, for speed, since first Array List is // probably already ordered small to large for (j = i - 1; j >= 0; j--) { sizeSort = bSizes[j]; if (sizeCompare > sizeSort) { // add the bigger one after the smaller one bSizes[j + 1] = sizeCompare; bDepths[j + 1] = depth; break; } // move current one down, since it is bigger bSizes[j + 1] = sizeSort; bDepths[j + 1] = bDepths[j]; } if (j < 0) { // smallest so far, add it at the front of the list bSizes[0] = sizeCompare; bDepths[0] = depth; } } boolean tracking = trackingBuffers(); this.pools = new WsByteBufferPool[len]; this.poolsDirect = new WsByteBufferPool[len]; this.poolSizes = new int[len]; for (int i = 0; i < len; i++) { // make backing pool 10 times larger than local pools this.pools[i] = new WsByteBufferPool(bSizes[i], bDepths[i] * 10, tracking, false); this.poolsDirect[i] = new WsByteBufferPool(bSizes[i], bDepths[i] * 10, tracking, true); this.poolSizes[i] = bSizes[i]; } if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Number of pools created: " + this.poolSizes.length); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.exit(tc, "initialize"); } }
java
public void initialize(int[] bufferEntrySizes, int[] bufferEntryDepths) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(tc, "initialize"); } // order both lists from smallest to largest, based only on Entry Sizes int len = bufferEntrySizes.length; int[] bSizes = new int[len]; int[] bDepths = new int[len]; int sizeCompare; int depth; int sizeSort; int j; for (int i = 0; i < len; i++) { sizeCompare = bufferEntrySizes[i]; depth = bufferEntryDepths[i]; // go backwards, for speed, since first Array List is // probably already ordered small to large for (j = i - 1; j >= 0; j--) { sizeSort = bSizes[j]; if (sizeCompare > sizeSort) { // add the bigger one after the smaller one bSizes[j + 1] = sizeCompare; bDepths[j + 1] = depth; break; } // move current one down, since it is bigger bSizes[j + 1] = sizeSort; bDepths[j + 1] = bDepths[j]; } if (j < 0) { // smallest so far, add it at the front of the list bSizes[0] = sizeCompare; bDepths[0] = depth; } } boolean tracking = trackingBuffers(); this.pools = new WsByteBufferPool[len]; this.poolsDirect = new WsByteBufferPool[len]; this.poolSizes = new int[len]; for (int i = 0; i < len; i++) { // make backing pool 10 times larger than local pools this.pools[i] = new WsByteBufferPool(bSizes[i], bDepths[i] * 10, tracking, false); this.poolsDirect[i] = new WsByteBufferPool(bSizes[i], bDepths[i] * 10, tracking, true); this.poolSizes[i] = bSizes[i]; } if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Number of pools created: " + this.poolSizes.length); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.exit(tc, "initialize"); } }
[ "public", "void", "initialize", "(", "int", "[", "]", "bufferEntrySizes", ",", "int", "[", "]", "bufferEntryDepths", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "Tr", ".", "entry", "(", "tc", ",", "\"initialize\"", ")", ";", "}", "// order both lists from smallest to largest, based only on Entry Sizes", "int", "len", "=", "bufferEntrySizes", ".", "length", ";", "int", "[", "]", "bSizes", "=", "new", "int", "[", "len", "]", ";", "int", "[", "]", "bDepths", "=", "new", "int", "[", "len", "]", ";", "int", "sizeCompare", ";", "int", "depth", ";", "int", "sizeSort", ";", "int", "j", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "len", ";", "i", "++", ")", "{", "sizeCompare", "=", "bufferEntrySizes", "[", "i", "]", ";", "depth", "=", "bufferEntryDepths", "[", "i", "]", ";", "// go backwards, for speed, since first Array List is", "// probably already ordered small to large", "for", "(", "j", "=", "i", "-", "1", ";", "j", ">=", "0", ";", "j", "--", ")", "{", "sizeSort", "=", "bSizes", "[", "j", "]", ";", "if", "(", "sizeCompare", ">", "sizeSort", ")", "{", "// add the bigger one after the smaller one", "bSizes", "[", "j", "+", "1", "]", "=", "sizeCompare", ";", "bDepths", "[", "j", "+", "1", "]", "=", "depth", ";", "break", ";", "}", "// move current one down, since it is bigger", "bSizes", "[", "j", "+", "1", "]", "=", "sizeSort", ";", "bDepths", "[", "j", "+", "1", "]", "=", "bDepths", "[", "j", "]", ";", "}", "if", "(", "j", "<", "0", ")", "{", "// smallest so far, add it at the front of the list", "bSizes", "[", "0", "]", "=", "sizeCompare", ";", "bDepths", "[", "0", "]", "=", "depth", ";", "}", "}", "boolean", "tracking", "=", "trackingBuffers", "(", ")", ";", "this", ".", "pools", "=", "new", "WsByteBufferPool", "[", "len", "]", ";", "this", ".", "poolsDirect", "=", "new", "WsByteBufferPool", "[", "len", "]", ";", "this", ".", "poolSizes", "=", "new", "int", "[", "len", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "len", ";", "i", "++", ")", "{", "// make backing pool 10 times larger than local pools", "this", ".", "pools", "[", "i", "]", "=", "new", "WsByteBufferPool", "(", "bSizes", "[", "i", "]", ",", "bDepths", "[", "i", "]", "*", "10", ",", "tracking", ",", "false", ")", ";", "this", ".", "poolsDirect", "[", "i", "]", "=", "new", "WsByteBufferPool", "(", "bSizes", "[", "i", "]", ",", "bDepths", "[", "i", "]", "*", "10", ",", "tracking", ",", "true", ")", ";", "this", ".", "poolSizes", "[", "i", "]", "=", "bSizes", "[", "i", "]", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"Number of pools created: \"", "+", "this", ".", "poolSizes", ".", "length", ")", ";", "}", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "{", "Tr", ".", "exit", "(", "tc", ",", "\"initialize\"", ")", ";", "}", "}" ]
Initialize the pool manager with the number of pools, the entry sizes for each pool, and the maximum depth of the free pool. @param bufferEntrySizes the memory sizes of each entry in the pools @param bufferEntryDepths the maximum number of entries in the free pool
[ "Initialize", "the", "pool", "manager", "with", "the", "number", "of", "pools", "the", "entry", "sizes", "for", "each", "pool", "and", "the", "maximum", "depth", "of", "the", "free", "pool", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/bytebuffer/internal/WsByteBufferPoolManagerImpl.java#L260-L316
train
OpenLiberty/open-liberty
dev/com.ibm.ws.channelfw/src/com/ibm/ws/bytebuffer/internal/WsByteBufferPoolManagerImpl.java
WsByteBufferPoolManagerImpl.setLeakDetectionSettings
public void setLeakDetectionSettings(int interval, String output) throws IOException { this.leakDetectionInterval = interval; this.leakDetectionOutput = TrConfigurator.getLogLocation() + File.separator + output; if ((interval > -1) && (output != null)) { // clear file FileWriter outFile = new FileWriter(this.leakDetectionOutput, false); outFile.close(); } }
java
public void setLeakDetectionSettings(int interval, String output) throws IOException { this.leakDetectionInterval = interval; this.leakDetectionOutput = TrConfigurator.getLogLocation() + File.separator + output; if ((interval > -1) && (output != null)) { // clear file FileWriter outFile = new FileWriter(this.leakDetectionOutput, false); outFile.close(); } }
[ "public", "void", "setLeakDetectionSettings", "(", "int", "interval", ",", "String", "output", ")", "throws", "IOException", "{", "this", ".", "leakDetectionInterval", "=", "interval", ";", "this", ".", "leakDetectionOutput", "=", "TrConfigurator", ".", "getLogLocation", "(", ")", "+", "File", ".", "separator", "+", "output", ";", "if", "(", "(", "interval", ">", "-", "1", ")", "&&", "(", "output", "!=", "null", ")", ")", "{", "// clear file", "FileWriter", "outFile", "=", "new", "FileWriter", "(", "this", ".", "leakDetectionOutput", ",", "false", ")", ";", "outFile", ".", "close", "(", ")", ";", "}", "}" ]
Set the memory leak detection parameters. If the interval is 0 or greater, then the detection code will enabled. @param interval the minimum amount of time between leak detection code will be ran. Also the minimum amount of time that a buffer can go without being accessed before it will be flagged as a possible memory leak. @param output The name of the output file where the memory leak information will be written. @throws IOException
[ "Set", "the", "memory", "leak", "detection", "parameters", ".", "If", "the", "interval", "is", "0", "or", "greater", "then", "the", "detection", "code", "will", "enabled", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/bytebuffer/internal/WsByteBufferPoolManagerImpl.java#L329-L338
train
OpenLiberty/open-liberty
dev/com.ibm.ws.channelfw/src/com/ibm/ws/bytebuffer/internal/WsByteBufferPoolManagerImpl.java
WsByteBufferPoolManagerImpl.allocateFileChannelBuffer
@Override public WsByteBuffer allocateFileChannelBuffer(FileChannel fc) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "allocateFileChannelBuffer"); } return new FCWsByteBufferImpl(fc); }
java
@Override public WsByteBuffer allocateFileChannelBuffer(FileChannel fc) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "allocateFileChannelBuffer"); } return new FCWsByteBufferImpl(fc); }
[ "@", "Override", "public", "WsByteBuffer", "allocateFileChannelBuffer", "(", "FileChannel", "fc", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isDebugEnabled", "(", ")", ")", "{", "Tr", ".", "debug", "(", "tc", ",", "\"allocateFileChannelBuffer\"", ")", ";", "}", "return", "new", "FCWsByteBufferImpl", "(", "fc", ")", ";", "}" ]
Allocate a buffer which will use tha FileChannel until the buffer needs to be used in a "non-FileChannel" way. @param fc FileChannel to use for this buffer @return FCWsByteBuffer buffer which can now be used.
[ "Allocate", "a", "buffer", "which", "will", "use", "tha", "FileChannel", "until", "the", "buffer", "needs", "to", "be", "used", "in", "a", "non", "-", "FileChannel", "way", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/bytebuffer/internal/WsByteBufferPoolManagerImpl.java#L396-L402
train
OpenLiberty/open-liberty
dev/com.ibm.ws.channelfw/src/com/ibm/ws/bytebuffer/internal/WsByteBufferPoolManagerImpl.java
WsByteBufferPoolManagerImpl.allocateBufferDirect
protected WsByteBufferImpl allocateBufferDirect(WsByteBufferImpl buffer, int size, boolean overrideRefCount) { DirectByteBufferHelper directByteBufferHelper = this.directByteBufferHelper.get(); ByteBuffer byteBuffer; if (directByteBufferHelper != null) { byteBuffer = directByteBufferHelper.allocateDirectByteBuffer(size); } else { byteBuffer = ByteBuffer.allocateDirect(size); } buffer.setByteBufferNonSafe(byteBuffer); return buffer; }
java
protected WsByteBufferImpl allocateBufferDirect(WsByteBufferImpl buffer, int size, boolean overrideRefCount) { DirectByteBufferHelper directByteBufferHelper = this.directByteBufferHelper.get(); ByteBuffer byteBuffer; if (directByteBufferHelper != null) { byteBuffer = directByteBufferHelper.allocateDirectByteBuffer(size); } else { byteBuffer = ByteBuffer.allocateDirect(size); } buffer.setByteBufferNonSafe(byteBuffer); return buffer; }
[ "protected", "WsByteBufferImpl", "allocateBufferDirect", "(", "WsByteBufferImpl", "buffer", ",", "int", "size", ",", "boolean", "overrideRefCount", ")", "{", "DirectByteBufferHelper", "directByteBufferHelper", "=", "this", ".", "directByteBufferHelper", ".", "get", "(", ")", ";", "ByteBuffer", "byteBuffer", ";", "if", "(", "directByteBufferHelper", "!=", "null", ")", "{", "byteBuffer", "=", "directByteBufferHelper", ".", "allocateDirectByteBuffer", "(", "size", ")", ";", "}", "else", "{", "byteBuffer", "=", "ByteBuffer", ".", "allocateDirect", "(", "size", ")", ";", "}", "buffer", ".", "setByteBufferNonSafe", "(", "byteBuffer", ")", ";", "return", "buffer", ";", "}" ]
Allocate the direct ByteBuffer that will be wrapped by the input WsByteBuffer object. @param buffer @param size @param overrideRefCount
[ "Allocate", "the", "direct", "ByteBuffer", "that", "will", "be", "wrapped", "by", "the", "input", "WsByteBuffer", "object", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/bytebuffer/internal/WsByteBufferPoolManagerImpl.java#L550-L561
train
OpenLiberty/open-liberty
dev/com.ibm.ws.channelfw/src/com/ibm/ws/bytebuffer/internal/WsByteBufferPoolManagerImpl.java
WsByteBufferPoolManagerImpl.releasing
protected void releasing(ByteBuffer buffer) { if (buffer != null && buffer.isDirect()) { DirectByteBufferHelper directByteBufferHelper = this.directByteBufferHelper.get(); if (directByteBufferHelper != null) { directByteBufferHelper.releaseDirectByteBuffer(buffer); } } }
java
protected void releasing(ByteBuffer buffer) { if (buffer != null && buffer.isDirect()) { DirectByteBufferHelper directByteBufferHelper = this.directByteBufferHelper.get(); if (directByteBufferHelper != null) { directByteBufferHelper.releaseDirectByteBuffer(buffer); } } }
[ "protected", "void", "releasing", "(", "ByteBuffer", "buffer", ")", "{", "if", "(", "buffer", "!=", "null", "&&", "buffer", ".", "isDirect", "(", ")", ")", "{", "DirectByteBufferHelper", "directByteBufferHelper", "=", "this", ".", "directByteBufferHelper", ".", "get", "(", ")", ";", "if", "(", "directByteBufferHelper", "!=", "null", ")", "{", "directByteBufferHelper", ".", "releaseDirectByteBuffer", "(", "buffer", ")", ";", "}", "}", "}" ]
Method called when a buffer is being destroyed to allow any additional cleanup that might be required. @param buffer
[ "Method", "called", "when", "a", "buffer", "is", "being", "destroyed", "to", "allow", "any", "additional", "cleanup", "that", "might", "be", "required", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/bytebuffer/internal/WsByteBufferPoolManagerImpl.java#L621-L628
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/ConsumerProperties.java
ConsumerProperties.debug
public String debug() { String data = null; StringBuffer sb = new StringBuffer(); sb.append("ConsumerProperties"); sb.append("\n"); sb.append("------------------"); sb.append("\n"); sb.append("Destination: "); sb.append(getJmsDestination()); sb.append("\n"); sb.append("DestType: "); sb.append(getDestinationType()); sb.append("\n"); sb.append("Selector: "); sb.append(getSelector()); sb.append("\n"); sb.append("NoLocal: "); sb.append(noLocal()); sb.append("\n"); sb.append("Reliablity: "); sb.append(getReliability()); sb.append("\n"); sb.append("ClientID: "); sb.append(getClientID()); sb.append("\n"); sb.append("SubName: "); sb.append(getSubName()); sb.append("\n"); sb.append("DurableSubHome: "); sb.append(getDurableSubscriptionHome()); sb.append("\n"); sb.append("ReadAhead: "); sb.append(readAhead()); sb.append("\n"); sb.append("UnrecoverableReliability: "); sb.append(getUnrecovReliability()); sb.append("\n"); sb.append("Supports Multiple: "); sb.append(supportsMultipleConsumers()); sb.append("\n"); if (dest instanceof Queue) { sb.append("GatherMessages: "); sb.append(isGatherMessages()); sb.append("\n"); } data = sb.toString(); return data; }
java
public String debug() { String data = null; StringBuffer sb = new StringBuffer(); sb.append("ConsumerProperties"); sb.append("\n"); sb.append("------------------"); sb.append("\n"); sb.append("Destination: "); sb.append(getJmsDestination()); sb.append("\n"); sb.append("DestType: "); sb.append(getDestinationType()); sb.append("\n"); sb.append("Selector: "); sb.append(getSelector()); sb.append("\n"); sb.append("NoLocal: "); sb.append(noLocal()); sb.append("\n"); sb.append("Reliablity: "); sb.append(getReliability()); sb.append("\n"); sb.append("ClientID: "); sb.append(getClientID()); sb.append("\n"); sb.append("SubName: "); sb.append(getSubName()); sb.append("\n"); sb.append("DurableSubHome: "); sb.append(getDurableSubscriptionHome()); sb.append("\n"); sb.append("ReadAhead: "); sb.append(readAhead()); sb.append("\n"); sb.append("UnrecoverableReliability: "); sb.append(getUnrecovReliability()); sb.append("\n"); sb.append("Supports Multiple: "); sb.append(supportsMultipleConsumers()); sb.append("\n"); if (dest instanceof Queue) { sb.append("GatherMessages: "); sb.append(isGatherMessages()); sb.append("\n"); } data = sb.toString(); return data; }
[ "public", "String", "debug", "(", ")", "{", "String", "data", "=", "null", ";", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", ")", ";", "sb", ".", "append", "(", "\"ConsumerProperties\"", ")", ";", "sb", ".", "append", "(", "\"\\n\"", ")", ";", "sb", ".", "append", "(", "\"------------------\"", ")", ";", "sb", ".", "append", "(", "\"\\n\"", ")", ";", "sb", ".", "append", "(", "\"Destination: \"", ")", ";", "sb", ".", "append", "(", "getJmsDestination", "(", ")", ")", ";", "sb", ".", "append", "(", "\"\\n\"", ")", ";", "sb", ".", "append", "(", "\"DestType: \"", ")", ";", "sb", ".", "append", "(", "getDestinationType", "(", ")", ")", ";", "sb", ".", "append", "(", "\"\\n\"", ")", ";", "sb", ".", "append", "(", "\"Selector: \"", ")", ";", "sb", ".", "append", "(", "getSelector", "(", ")", ")", ";", "sb", ".", "append", "(", "\"\\n\"", ")", ";", "sb", ".", "append", "(", "\"NoLocal: \"", ")", ";", "sb", ".", "append", "(", "noLocal", "(", ")", ")", ";", "sb", ".", "append", "(", "\"\\n\"", ")", ";", "sb", ".", "append", "(", "\"Reliablity: \"", ")", ";", "sb", ".", "append", "(", "getReliability", "(", ")", ")", ";", "sb", ".", "append", "(", "\"\\n\"", ")", ";", "sb", ".", "append", "(", "\"ClientID: \"", ")", ";", "sb", ".", "append", "(", "getClientID", "(", ")", ")", ";", "sb", ".", "append", "(", "\"\\n\"", ")", ";", "sb", ".", "append", "(", "\"SubName: \"", ")", ";", "sb", ".", "append", "(", "getSubName", "(", ")", ")", ";", "sb", ".", "append", "(", "\"\\n\"", ")", ";", "sb", ".", "append", "(", "\"DurableSubHome: \"", ")", ";", "sb", ".", "append", "(", "getDurableSubscriptionHome", "(", ")", ")", ";", "sb", ".", "append", "(", "\"\\n\"", ")", ";", "sb", ".", "append", "(", "\"ReadAhead: \"", ")", ";", "sb", ".", "append", "(", "readAhead", "(", ")", ")", ";", "sb", ".", "append", "(", "\"\\n\"", ")", ";", "sb", ".", "append", "(", "\"UnrecoverableReliability: \"", ")", ";", "sb", ".", "append", "(", "getUnrecovReliability", "(", ")", ")", ";", "sb", ".", "append", "(", "\"\\n\"", ")", ";", "sb", ".", "append", "(", "\"Supports Multiple: \"", ")", ";", "sb", ".", "append", "(", "supportsMultipleConsumers", "(", ")", ")", ";", "sb", ".", "append", "(", "\"\\n\"", ")", ";", "if", "(", "dest", "instanceof", "Queue", ")", "{", "sb", ".", "append", "(", "\"GatherMessages: \"", ")", ";", "sb", ".", "append", "(", "isGatherMessages", "(", ")", ")", ";", "sb", ".", "append", "(", "\"\\n\"", ")", ";", "}", "data", "=", "sb", ".", "toString", "(", ")", ";", "return", "data", ";", "}" ]
Returns a printable form of the information stored in this object. @return String
[ "Returns", "a", "printable", "form", "of", "the", "information", "stored", "in", "this", "object", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/ConsumerProperties.java#L198-L264
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/composite/CompositeResourceLibrary.java
CompositeResourceLibrary.loadAcceptPattern
private Pattern loadAcceptPattern(ExternalContext context) { assert context != null; String mappings = context.getInitParameter(ViewHandler.FACELETS_VIEW_MAPPINGS_PARAM_NAME); if (mappings == null) { return null; } // Make sure the mappings contain something mappings = mappings.trim(); if (mappings.length() == 0) { return null; } return Pattern.compile(toRegex(mappings)); }
java
private Pattern loadAcceptPattern(ExternalContext context) { assert context != null; String mappings = context.getInitParameter(ViewHandler.FACELETS_VIEW_MAPPINGS_PARAM_NAME); if (mappings == null) { return null; } // Make sure the mappings contain something mappings = mappings.trim(); if (mappings.length() == 0) { return null; } return Pattern.compile(toRegex(mappings)); }
[ "private", "Pattern", "loadAcceptPattern", "(", "ExternalContext", "context", ")", "{", "assert", "context", "!=", "null", ";", "String", "mappings", "=", "context", ".", "getInitParameter", "(", "ViewHandler", ".", "FACELETS_VIEW_MAPPINGS_PARAM_NAME", ")", ";", "if", "(", "mappings", "==", "null", ")", "{", "return", "null", ";", "}", "// Make sure the mappings contain something", "mappings", "=", "mappings", ".", "trim", "(", ")", ";", "if", "(", "mappings", ".", "length", "(", ")", "==", "0", ")", "{", "return", "null", ";", "}", "return", "Pattern", ".", "compile", "(", "toRegex", "(", "mappings", ")", ")", ";", "}" ]
Load and compile a regular expression pattern built from the Facelet view mapping parameters. @param context the application's external context @return the compiled regular expression
[ "Load", "and", "compile", "a", "regular", "expression", "pattern", "built", "from", "the", "Facelet", "view", "mapping", "parameters", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/composite/CompositeResourceLibrary.java#L101-L119
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/composite/CompositeResourceLibrary.java
CompositeResourceLibrary.toRegex
private String toRegex(String mappings) { assert mappings != null; // Get rid of spaces mappings = mappings.replaceAll("\\s", ""); // Escape '.' mappings = mappings.replaceAll("\\.", "\\\\."); // Change '*' to '.*' to represent any match mappings = mappings.replaceAll("\\*", ".*"); // Split the mappings by changing ';' to '|' mappings = mappings.replaceAll(";", "|"); return mappings; }
java
private String toRegex(String mappings) { assert mappings != null; // Get rid of spaces mappings = mappings.replaceAll("\\s", ""); // Escape '.' mappings = mappings.replaceAll("\\.", "\\\\."); // Change '*' to '.*' to represent any match mappings = mappings.replaceAll("\\*", ".*"); // Split the mappings by changing ';' to '|' mappings = mappings.replaceAll(";", "|"); return mappings; }
[ "private", "String", "toRegex", "(", "String", "mappings", ")", "{", "assert", "mappings", "!=", "null", ";", "// Get rid of spaces", "mappings", "=", "mappings", ".", "replaceAll", "(", "\"\\\\s\"", ",", "\"\"", ")", ";", "// Escape '.'", "mappings", "=", "mappings", ".", "replaceAll", "(", "\"\\\\.\"", ",", "\"\\\\\\\\.\"", ")", ";", "// Change '*' to '.*' to represent any match", "mappings", "=", "mappings", ".", "replaceAll", "(", "\"\\\\*\"", ",", "\".*\"", ")", ";", "// Split the mappings by changing ';' to '|'", "mappings", "=", "mappings", ".", "replaceAll", "(", "\";\"", ",", "\"|\"", ")", ";", "return", "mappings", ";", "}" ]
Convert the specified mapping string to an equivalent regular expression. @param mappings le mapping string @return an uncompiled regular expression representing the mappings
[ "Convert", "the", "specified", "mapping", "string", "to", "an", "equivalent", "regular", "expression", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/tag/composite/CompositeResourceLibrary.java#L150-L167
train
OpenLiberty/open-liberty
dev/com.ibm.ws.jaxrs.2.0.common/src/org/apache/cxf/jaxrs/client/AbstractClient.java
AbstractClient.prepareConduitSelector
protected void prepareConduitSelector(Message message, URI currentURI, boolean proxy) { try { cfg.prepareConduitSelector(message); } catch (Fault ex) { LOG.warning("Failure to prepare a message from conduit selector"); } message.getExchange().put(ConduitSelector.class, cfg.getConduitSelector()); message.getExchange().put(Service.class, cfg.getConduitSelector().getEndpoint().getService()); String address = (String) message.get(Message.ENDPOINT_ADDRESS); // custom conduits may override the initial/current address if (address.startsWith(HTTP_SCHEME) && !address.equals(currentURI.toString())) { URI baseAddress = URI.create(address); currentURI = calculateNewRequestURI(baseAddress, currentURI, proxy); message.put(Message.ENDPOINT_ADDRESS, currentURI.toString()); message.put(Message.REQUEST_URI, currentURI.toString()); } message.put(Message.BASE_PATH, getBaseURI().toString()); }
java
protected void prepareConduitSelector(Message message, URI currentURI, boolean proxy) { try { cfg.prepareConduitSelector(message); } catch (Fault ex) { LOG.warning("Failure to prepare a message from conduit selector"); } message.getExchange().put(ConduitSelector.class, cfg.getConduitSelector()); message.getExchange().put(Service.class, cfg.getConduitSelector().getEndpoint().getService()); String address = (String) message.get(Message.ENDPOINT_ADDRESS); // custom conduits may override the initial/current address if (address.startsWith(HTTP_SCHEME) && !address.equals(currentURI.toString())) { URI baseAddress = URI.create(address); currentURI = calculateNewRequestURI(baseAddress, currentURI, proxy); message.put(Message.ENDPOINT_ADDRESS, currentURI.toString()); message.put(Message.REQUEST_URI, currentURI.toString()); } message.put(Message.BASE_PATH, getBaseURI().toString()); }
[ "protected", "void", "prepareConduitSelector", "(", "Message", "message", ",", "URI", "currentURI", ",", "boolean", "proxy", ")", "{", "try", "{", "cfg", ".", "prepareConduitSelector", "(", "message", ")", ";", "}", "catch", "(", "Fault", "ex", ")", "{", "LOG", ".", "warning", "(", "\"Failure to prepare a message from conduit selector\"", ")", ";", "}", "message", ".", "getExchange", "(", ")", ".", "put", "(", "ConduitSelector", ".", "class", ",", "cfg", ".", "getConduitSelector", "(", ")", ")", ";", "message", ".", "getExchange", "(", ")", ".", "put", "(", "Service", ".", "class", ",", "cfg", ".", "getConduitSelector", "(", ")", ".", "getEndpoint", "(", ")", ".", "getService", "(", ")", ")", ";", "String", "address", "=", "(", "String", ")", "message", ".", "get", "(", "Message", ".", "ENDPOINT_ADDRESS", ")", ";", "// custom conduits may override the initial/current address", "if", "(", "address", ".", "startsWith", "(", "HTTP_SCHEME", ")", "&&", "!", "address", ".", "equals", "(", "currentURI", ".", "toString", "(", ")", ")", ")", "{", "URI", "baseAddress", "=", "URI", ".", "create", "(", "address", ")", ";", "currentURI", "=", "calculateNewRequestURI", "(", "baseAddress", ",", "currentURI", ",", "proxy", ")", ";", "message", ".", "put", "(", "Message", ".", "ENDPOINT_ADDRESS", ",", "currentURI", ".", "toString", "(", ")", ")", ";", "message", ".", "put", "(", "Message", ".", "REQUEST_URI", ",", "currentURI", ".", "toString", "(", ")", ")", ";", "}", "message", ".", "put", "(", "Message", ".", "BASE_PATH", ",", "getBaseURI", "(", ")", ".", "toString", "(", ")", ")", ";", "}" ]
or web client invocation has returned
[ "or", "web", "client", "invocation", "has", "returned" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxrs.2.0.common/src/org/apache/cxf/jaxrs/client/AbstractClient.java#L937-L956
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AbstractAliasDestinationHandler.java
AbstractAliasDestinationHandler.isCorruptOrIndoubt
@Override public boolean isCorruptOrIndoubt() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "isCorruptOrIndoubt"); boolean isCorruptOrIndoubt = _targetDestinationHandler.isCorruptOrIndoubt(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "isCorruptOrIndoubt", Boolean.valueOf(isCorruptOrIndoubt)); return isCorruptOrIndoubt; }
java
@Override public boolean isCorruptOrIndoubt() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "isCorruptOrIndoubt"); boolean isCorruptOrIndoubt = _targetDestinationHandler.isCorruptOrIndoubt(); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "isCorruptOrIndoubt", Boolean.valueOf(isCorruptOrIndoubt)); return isCorruptOrIndoubt; }
[ "@", "Override", "public", "boolean", "isCorruptOrIndoubt", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"isCorruptOrIndoubt\"", ")", ";", "boolean", "isCorruptOrIndoubt", "=", "_targetDestinationHandler", ".", "isCorruptOrIndoubt", "(", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"isCorruptOrIndoubt\"", ",", "Boolean", ".", "valueOf", "(", "isCorruptOrIndoubt", ")", ")", ";", "return", "isCorruptOrIndoubt", ";", "}" ]
Is a real target destination corrupt?
[ "Is", "a", "real", "target", "destination", "corrupt?" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AbstractAliasDestinationHandler.java#L951-L963
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AbstractAliasDestinationHandler.java
AbstractAliasDestinationHandler.delete
public void delete() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "delete"); //Tell the target of the alias to remove the backwards reference to it _targetDestinationHandler.removeTargettingAlias(this); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "delete"); }
java
public void delete() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "delete"); //Tell the target of the alias to remove the backwards reference to it _targetDestinationHandler.removeTargettingAlias(this); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "delete"); }
[ "public", "void", "delete", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"delete\"", ")", ";", "//Tell the target of the alias to remove the backwards reference to it", "_targetDestinationHandler", ".", "removeTargettingAlias", "(", "this", ")", ";", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "tc", ",", "\"delete\"", ")", ";", "}" ]
This destination handler is being deleted and should perform any processing required.
[ "This", "destination", "handler", "is", "being", "deleted", "and", "should", "perform", "any", "processing", "required", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/AbstractAliasDestinationHandler.java#L1143-L1151
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/TransmissionData.java
TransmissionData.setLayoutToPrimary
protected void setLayoutToPrimary(int segmentLength, int priority, boolean isPooled, boolean isExchange, int packetNumber, int segmentType, SendListener sendListener) { if (tc.isEntryEnabled()) SibTr.entry(this, tc, "setLayoutToPrimary", new Object[] {""+segmentLength, ""+priority, ""+isPooled, ""+isExchange, ""+packetNumber, ""+segmentType, sendListener}); primaryHeaderFields.segmentLength = segmentLength; primaryHeaderFields.priority = priority; primaryHeaderFields.isPooled = isPooled; primaryHeaderFields.isExchange = isExchange; primaryHeaderFields.packetNumber = packetNumber; primaryHeaderFields.segmentType = segmentType; this.sendListener = sendListener; transmissionRemaining = segmentLength; layout = JFapChannelConstants.XMIT_PRIMARY_ONLY; if (tc.isEntryEnabled()) SibTr.exit(this, tc, "setLayoutToPrimary"); }
java
protected void setLayoutToPrimary(int segmentLength, int priority, boolean isPooled, boolean isExchange, int packetNumber, int segmentType, SendListener sendListener) { if (tc.isEntryEnabled()) SibTr.entry(this, tc, "setLayoutToPrimary", new Object[] {""+segmentLength, ""+priority, ""+isPooled, ""+isExchange, ""+packetNumber, ""+segmentType, sendListener}); primaryHeaderFields.segmentLength = segmentLength; primaryHeaderFields.priority = priority; primaryHeaderFields.isPooled = isPooled; primaryHeaderFields.isExchange = isExchange; primaryHeaderFields.packetNumber = packetNumber; primaryHeaderFields.segmentType = segmentType; this.sendListener = sendListener; transmissionRemaining = segmentLength; layout = JFapChannelConstants.XMIT_PRIMARY_ONLY; if (tc.isEntryEnabled()) SibTr.exit(this, tc, "setLayoutToPrimary"); }
[ "protected", "void", "setLayoutToPrimary", "(", "int", "segmentLength", ",", "int", "priority", ",", "boolean", "isPooled", ",", "boolean", "isExchange", ",", "int", "packetNumber", ",", "int", "segmentType", ",", "SendListener", "sendListener", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"setLayoutToPrimary\"", ",", "new", "Object", "[", "]", "{", "\"\"", "+", "segmentLength", ",", "\"\"", "+", "priority", ",", "\"\"", "+", "isPooled", ",", "\"\"", "+", "isExchange", ",", "\"\"", "+", "packetNumber", ",", "\"\"", "+", "segmentType", ",", "sendListener", "}", ")", ";", "primaryHeaderFields", ".", "segmentLength", "=", "segmentLength", ";", "primaryHeaderFields", ".", "priority", "=", "priority", ";", "primaryHeaderFields", ".", "isPooled", "=", "isPooled", ";", "primaryHeaderFields", ".", "isExchange", "=", "isExchange", ";", "primaryHeaderFields", ".", "packetNumber", "=", "packetNumber", ";", "primaryHeaderFields", ".", "segmentType", "=", "segmentType", ";", "this", ".", "sendListener", "=", "sendListener", ";", "transmissionRemaining", "=", "segmentLength", ";", "layout", "=", "JFapChannelConstants", ".", "XMIT_PRIMARY_ONLY", ";", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"setLayoutToPrimary\"", ")", ";", "}" ]
Sets the layout to use for this transmission to be a primary header only. @param segmentLength @param priority @param isPooled @param isExchange @param packetNumber @param segmentType @param sendListener
[ "Sets", "the", "layout", "to", "use", "for", "this", "transmission", "to", "be", "a", "primary", "header", "only", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/TransmissionData.java#L193-L212
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/TransmissionData.java
TransmissionData.setLayoutToConversation
protected void setLayoutToConversation(int segmentLength, int priority, boolean isPooled, boolean isExchange, int packetNumber, int segmentType, int conversationId, int requestNumber, Conversation conversation, SendListener sendListener) { if (tc.isEntryEnabled()) SibTr.entry(this, tc, "setLayoutToConversation", new Object[]{""+segmentLength, ""+priority, ""+isPooled, ""+isExchange, ""+packetNumber, ""+segmentType, ""+conversationId, ""+requestNumber, conversation, sendListener}); setLayoutToPrimary(segmentLength, priority, isPooled, isExchange, packetNumber, segmentType, sendListener); conversationHeaderFields.conversationId = conversationId; conversationHeaderFields.requestNumber = requestNumber; this.conversation = conversation; transmissionRemaining = segmentLength; layout = JFapChannelConstants.XMIT_CONVERSATION; if (tc.isEntryEnabled()) SibTr.exit(this, tc, "setLayoutToConversation"); }
java
protected void setLayoutToConversation(int segmentLength, int priority, boolean isPooled, boolean isExchange, int packetNumber, int segmentType, int conversationId, int requestNumber, Conversation conversation, SendListener sendListener) { if (tc.isEntryEnabled()) SibTr.entry(this, tc, "setLayoutToConversation", new Object[]{""+segmentLength, ""+priority, ""+isPooled, ""+isExchange, ""+packetNumber, ""+segmentType, ""+conversationId, ""+requestNumber, conversation, sendListener}); setLayoutToPrimary(segmentLength, priority, isPooled, isExchange, packetNumber, segmentType, sendListener); conversationHeaderFields.conversationId = conversationId; conversationHeaderFields.requestNumber = requestNumber; this.conversation = conversation; transmissionRemaining = segmentLength; layout = JFapChannelConstants.XMIT_CONVERSATION; if (tc.isEntryEnabled()) SibTr.exit(this, tc, "setLayoutToConversation"); }
[ "protected", "void", "setLayoutToConversation", "(", "int", "segmentLength", ",", "int", "priority", ",", "boolean", "isPooled", ",", "boolean", "isExchange", ",", "int", "packetNumber", ",", "int", "segmentType", ",", "int", "conversationId", ",", "int", "requestNumber", ",", "Conversation", "conversation", ",", "SendListener", "sendListener", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"setLayoutToConversation\"", ",", "new", "Object", "[", "]", "{", "\"\"", "+", "segmentLength", ",", "\"\"", "+", "priority", ",", "\"\"", "+", "isPooled", ",", "\"\"", "+", "isExchange", ",", "\"\"", "+", "packetNumber", ",", "\"\"", "+", "segmentType", ",", "\"\"", "+", "conversationId", ",", "\"\"", "+", "requestNumber", ",", "conversation", ",", "sendListener", "}", ")", ";", "setLayoutToPrimary", "(", "segmentLength", ",", "priority", ",", "isPooled", ",", "isExchange", ",", "packetNumber", ",", "segmentType", ",", "sendListener", ")", ";", "conversationHeaderFields", ".", "conversationId", "=", "conversationId", ";", "conversationHeaderFields", ".", "requestNumber", "=", "requestNumber", ";", "this", ".", "conversation", "=", "conversation", ";", "transmissionRemaining", "=", "segmentLength", ";", "layout", "=", "JFapChannelConstants", ".", "XMIT_CONVERSATION", ";", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"setLayoutToConversation\"", ")", ";", "}" ]
Set layout for transmission to build to have a conversation header. @param segmentLength @param priority @param isPooled @param isExchange @param packetNumber @param segmentType @param conversationId @param requestNumber @param conversation @param sendListener
[ "Set", "layout", "for", "transmission", "to", "build", "to", "have", "a", "conversation", "header", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/TransmissionData.java#L246-L265
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/TransmissionData.java
TransmissionData.setLayoutToStartSegment
protected void setLayoutToStartSegment(int segmentLength, int priority, boolean isPooled, boolean isExchange, int packetNumber, int segmentType, int conversationId, int requestNumber, long totalLength) { if (tc.isEntryEnabled()) SibTr.entry(this, tc, "setLayoutToStartSegment", new Object[]{""+segmentLength, ""+priority, ""+isPooled, ""+isExchange, ""+packetNumber, ""+segmentType, ""+conversationId, ""+requestNumber, ""+totalLength}); setLayoutToConversation(segmentLength, priority, isPooled, isExchange, packetNumber, segmentType, conversationId, requestNumber, null, null); segmentedTransmissionHeaderFields.totalLength = totalLength; segmentedTransmissionHeaderFields.segmentType = segmentType; transmissionRemaining = segmentLength; primaryHeaderFields.segmentType = JFapChannelConstants.SEGMENT_SEGMENTED_FLOW_START; layout = JFapChannelConstants.XMIT_SEGMENT_START; if (tc.isEntryEnabled()) SibTr.exit(this, tc, "setLayoutToStartSegment"); }
java
protected void setLayoutToStartSegment(int segmentLength, int priority, boolean isPooled, boolean isExchange, int packetNumber, int segmentType, int conversationId, int requestNumber, long totalLength) { if (tc.isEntryEnabled()) SibTr.entry(this, tc, "setLayoutToStartSegment", new Object[]{""+segmentLength, ""+priority, ""+isPooled, ""+isExchange, ""+packetNumber, ""+segmentType, ""+conversationId, ""+requestNumber, ""+totalLength}); setLayoutToConversation(segmentLength, priority, isPooled, isExchange, packetNumber, segmentType, conversationId, requestNumber, null, null); segmentedTransmissionHeaderFields.totalLength = totalLength; segmentedTransmissionHeaderFields.segmentType = segmentType; transmissionRemaining = segmentLength; primaryHeaderFields.segmentType = JFapChannelConstants.SEGMENT_SEGMENTED_FLOW_START; layout = JFapChannelConstants.XMIT_SEGMENT_START; if (tc.isEntryEnabled()) SibTr.exit(this, tc, "setLayoutToStartSegment"); }
[ "protected", "void", "setLayoutToStartSegment", "(", "int", "segmentLength", ",", "int", "priority", ",", "boolean", "isPooled", ",", "boolean", "isExchange", ",", "int", "packetNumber", ",", "int", "segmentType", ",", "int", "conversationId", ",", "int", "requestNumber", ",", "long", "totalLength", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"setLayoutToStartSegment\"", ",", "new", "Object", "[", "]", "{", "\"\"", "+", "segmentLength", ",", "\"\"", "+", "priority", ",", "\"\"", "+", "isPooled", ",", "\"\"", "+", "isExchange", ",", "\"\"", "+", "packetNumber", ",", "\"\"", "+", "segmentType", ",", "\"\"", "+", "conversationId", ",", "\"\"", "+", "requestNumber", ",", "\"\"", "+", "totalLength", "}", ")", ";", "setLayoutToConversation", "(", "segmentLength", ",", "priority", ",", "isPooled", ",", "isExchange", ",", "packetNumber", ",", "segmentType", ",", "conversationId", ",", "requestNumber", ",", "null", ",", "null", ")", ";", "segmentedTransmissionHeaderFields", ".", "totalLength", "=", "totalLength", ";", "segmentedTransmissionHeaderFields", ".", "segmentType", "=", "segmentType", ";", "transmissionRemaining", "=", "segmentLength", ";", "primaryHeaderFields", ".", "segmentType", "=", "JFapChannelConstants", ".", "SEGMENT_SEGMENTED_FLOW_START", ";", "layout", "=", "JFapChannelConstants", ".", "XMIT_SEGMENT_START", ";", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"setLayoutToStartSegment\"", ")", ";", "}" ]
Set next transmission being built to have a segment start layout
[ "Set", "next", "transmission", "being", "built", "to", "have", "a", "segment", "start", "layout" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/TransmissionData.java#L289-L307
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/TransmissionData.java
TransmissionData.setLayoutToMiddleSegment
protected void setLayoutToMiddleSegment(int segmentLength, int priority, boolean isPooled, boolean isExchange, int packetNumber, int conversationId, int requestNumber) { if (tc.isEntryEnabled()) SibTr.entry(this, tc, "setLayoutToMiddleSegment", new Object[]{""+segmentLength, ""+priority, ""+isPooled, ""+isExchange, ""+packetNumber, ""+conversationId, ""+requestNumber}); setLayoutToConversation(segmentLength, priority, isPooled, isExchange, packetNumber, JFapChannelConstants.SEGMENT_SEGMENTED_FLOW_MIDDLE, conversationId, requestNumber, null, null); layout = JFapChannelConstants.XMIT_SEGMENT_MIDDLE; transmissionRemaining = segmentLength; if (tc.isEntryEnabled()) SibTr.exit(this, tc, "setLayoutToMiddleSegment"); }
java
protected void setLayoutToMiddleSegment(int segmentLength, int priority, boolean isPooled, boolean isExchange, int packetNumber, int conversationId, int requestNumber) { if (tc.isEntryEnabled()) SibTr.entry(this, tc, "setLayoutToMiddleSegment", new Object[]{""+segmentLength, ""+priority, ""+isPooled, ""+isExchange, ""+packetNumber, ""+conversationId, ""+requestNumber}); setLayoutToConversation(segmentLength, priority, isPooled, isExchange, packetNumber, JFapChannelConstants.SEGMENT_SEGMENTED_FLOW_MIDDLE, conversationId, requestNumber, null, null); layout = JFapChannelConstants.XMIT_SEGMENT_MIDDLE; transmissionRemaining = segmentLength; if (tc.isEntryEnabled()) SibTr.exit(this, tc, "setLayoutToMiddleSegment"); }
[ "protected", "void", "setLayoutToMiddleSegment", "(", "int", "segmentLength", ",", "int", "priority", ",", "boolean", "isPooled", ",", "boolean", "isExchange", ",", "int", "packetNumber", ",", "int", "conversationId", ",", "int", "requestNumber", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"setLayoutToMiddleSegment\"", ",", "new", "Object", "[", "]", "{", "\"\"", "+", "segmentLength", ",", "\"\"", "+", "priority", ",", "\"\"", "+", "isPooled", ",", "\"\"", "+", "isExchange", ",", "\"\"", "+", "packetNumber", ",", "\"\"", "+", "conversationId", ",", "\"\"", "+", "requestNumber", "}", ")", ";", "setLayoutToConversation", "(", "segmentLength", ",", "priority", ",", "isPooled", ",", "isExchange", ",", "packetNumber", ",", "JFapChannelConstants", ".", "SEGMENT_SEGMENTED_FLOW_MIDDLE", ",", "conversationId", ",", "requestNumber", ",", "null", ",", "null", ")", ";", "layout", "=", "JFapChannelConstants", ".", "XMIT_SEGMENT_MIDDLE", ";", "transmissionRemaining", "=", "segmentLength", ";", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"setLayoutToMiddleSegment\"", ")", ";", "}" ]
Set next transmission being built to have a segment middle layout
[ "Set", "next", "transmission", "being", "built", "to", "have", "a", "segment", "middle", "layout" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/TransmissionData.java#L310-L323
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/TransmissionData.java
TransmissionData.setLayoutToEndSegment
protected void setLayoutToEndSegment(int segmentLength, int priority, boolean isPooled, boolean isExchange, int packetNumber, int conversationId, int requestNumber, Conversation conversation, SendListener sendListener) { if (tc.isEntryEnabled()) SibTr.entry(this, tc, "setLayoutToSegmentEnd", new Object[]{""+segmentLength, ""+priority, ""+isPooled, ""+isExchange, ""+packetNumber, ""+conversationId, ""+requestNumber, conversation, sendListener}); setLayoutToConversation(segmentLength, priority, isPooled, isExchange, packetNumber, JFapChannelConstants.SEGMENT_SEGMENTED_FLOW_END, conversationId, requestNumber, conversation, sendListener); layout = JFapChannelConstants.XMIT_SEGMENT_END; transmissionRemaining = segmentLength; }
java
protected void setLayoutToEndSegment(int segmentLength, int priority, boolean isPooled, boolean isExchange, int packetNumber, int conversationId, int requestNumber, Conversation conversation, SendListener sendListener) { if (tc.isEntryEnabled()) SibTr.entry(this, tc, "setLayoutToSegmentEnd", new Object[]{""+segmentLength, ""+priority, ""+isPooled, ""+isExchange, ""+packetNumber, ""+conversationId, ""+requestNumber, conversation, sendListener}); setLayoutToConversation(segmentLength, priority, isPooled, isExchange, packetNumber, JFapChannelConstants.SEGMENT_SEGMENTED_FLOW_END, conversationId, requestNumber, conversation, sendListener); layout = JFapChannelConstants.XMIT_SEGMENT_END; transmissionRemaining = segmentLength; }
[ "protected", "void", "setLayoutToEndSegment", "(", "int", "segmentLength", ",", "int", "priority", ",", "boolean", "isPooled", ",", "boolean", "isExchange", ",", "int", "packetNumber", ",", "int", "conversationId", ",", "int", "requestNumber", ",", "Conversation", "conversation", ",", "SendListener", "sendListener", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"setLayoutToSegmentEnd\"", ",", "new", "Object", "[", "]", "{", "\"\"", "+", "segmentLength", ",", "\"\"", "+", "priority", ",", "\"\"", "+", "isPooled", ",", "\"\"", "+", "isExchange", ",", "\"\"", "+", "packetNumber", ",", "\"\"", "+", "conversationId", ",", "\"\"", "+", "requestNumber", ",", "conversation", ",", "sendListener", "}", ")", ";", "setLayoutToConversation", "(", "segmentLength", ",", "priority", ",", "isPooled", ",", "isExchange", ",", "packetNumber", ",", "JFapChannelConstants", ".", "SEGMENT_SEGMENTED_FLOW_END", ",", "conversationId", ",", "requestNumber", ",", "conversation", ",", "sendListener", ")", ";", "layout", "=", "JFapChannelConstants", ".", "XMIT_SEGMENT_END", ";", "transmissionRemaining", "=", "segmentLength", ";", "}" ]
Set next transmission being built to have a segment end layout
[ "Set", "next", "transmission", "being", "built", "to", "have", "a", "segment", "end", "layout" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/TransmissionData.java#L326-L340
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/TransmissionData.java
TransmissionData.isPooledBuffers
protected boolean isPooledBuffers() { if (tc.isEntryEnabled()) SibTr.entry(this, tc, "isPooledBuffers"); if (tc.isEntryEnabled()) SibTr.exit(this, tc, "isPooledBuffers", ""+primaryHeaderFields.isPooled); return primaryHeaderFields.isPooled; }
java
protected boolean isPooledBuffers() { if (tc.isEntryEnabled()) SibTr.entry(this, tc, "isPooledBuffers"); if (tc.isEntryEnabled()) SibTr.exit(this, tc, "isPooledBuffers", ""+primaryHeaderFields.isPooled); return primaryHeaderFields.isPooled; }
[ "protected", "boolean", "isPooledBuffers", "(", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"isPooledBuffers\"", ")", ";", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"isPooledBuffers\"", ",", "\"\"", "+", "primaryHeaderFields", ".", "isPooled", ")", ";", "return", "primaryHeaderFields", ".", "isPooled", ";", "}" ]
Returns true iff this transmission should be received into pooled buffers. @return Returns true iff this transmission should be received into pooled buffers.
[ "Returns", "true", "iff", "this", "transmission", "should", "be", "received", "into", "pooled", "buffers", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/TransmissionData.java#L448-L453
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/TransmissionData.java
TransmissionData.isUserRequest
protected boolean isUserRequest() { if (tc.isEntryEnabled()) SibTr.entry(this, tc, "isUserRequest"); if (tc.isEntryEnabled()) SibTr.exit(this, tc, "isUserRequest", ""+isUserRequest); return isUserRequest; }
java
protected boolean isUserRequest() { if (tc.isEntryEnabled()) SibTr.entry(this, tc, "isUserRequest"); if (tc.isEntryEnabled()) SibTr.exit(this, tc, "isUserRequest", ""+isUserRequest); return isUserRequest; }
[ "protected", "boolean", "isUserRequest", "(", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"isUserRequest\"", ")", ";", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"isUserRequest\"", ",", "\"\"", "+", "isUserRequest", ")", ";", "return", "isUserRequest", ";", "}" ]
Returns true iff this transmission is a user request. @return Returns true iff this transmission is a user request.
[ "Returns", "true", "iff", "this", "transmission", "is", "a", "user", "request", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/TransmissionData.java#L481-L486
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/TransmissionData.java
TransmissionData.isTerminal
protected boolean isTerminal() { if (tc.isEntryEnabled()) SibTr.entry(this, tc, "isTermainl"); if (tc.isEntryEnabled()) SibTr.exit(this, tc, "isTermainl", ""+isTerminal); return isTerminal; }
java
protected boolean isTerminal() { if (tc.isEntryEnabled()) SibTr.entry(this, tc, "isTermainl"); if (tc.isEntryEnabled()) SibTr.exit(this, tc, "isTermainl", ""+isTerminal); return isTerminal; }
[ "protected", "boolean", "isTerminal", "(", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"isTermainl\"", ")", ";", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"isTermainl\"", ",", "\"\"", "+", "isTerminal", ")", ";", "return", "isTerminal", ";", "}" ]
Returns true if this transmission should stop this connection from writing any more data to the socket. @return Returns true if this transmission should stop this connection from writing any more data to the socket.
[ "Returns", "true", "if", "this", "transmission", "should", "stop", "this", "connection", "from", "writing", "any", "more", "data", "to", "the", "socket", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/TransmissionData.java#L494-L499
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/TransmissionData.java
TransmissionData.buildHeader
private boolean buildHeader(HeaderFields headerFields, WsByteBuffer xmitBuffer) { if (tc.isEntryEnabled()) SibTr.entry(this, tc, "buildHeader", new Object[] {headerFields, xmitBuffer}); if (tc.isDebugEnabled()) JFapUtils.debugTraceWsByteBufferInfo(this, tc, xmitBuffer, "xmitBuffer"); boolean headerFinished = false; WsByteBuffer headerBuffer = null; if (headerScratchSpace.position() == 0) { if (tc.isDebugEnabled()) JFapUtils.debugTraceWsByteBufferInfo(this, tc, headerScratchSpace, "headerScratchSpace"); // No data in the scratch space buffer - so we must decide if we can // build this header in place. if (xmitBuffer.remaining() >= headerFields.sizeof()) { // Enough space in the transmission buffer to build the header in // place. headerBuffer = xmitBuffer; headerFields.writeToBuffer(xmitBuffer); headerFinished = true; } else { // Insufficient room in the transmission buffer to build the header // in place. headerBuffer = headerScratchSpace; headerFields.writeToBuffer(headerScratchSpace); headerScratchSpace.flip(); } // build header into buffer. } else { // We have already built a header into the scratch space and are // in the process of copying it into the transmission buffer. headerBuffer = headerScratchSpace; } if (!headerFinished) { // We have not finished on this header yet. Try copying it into // the transmission buffer. int headerLeftToCopy = headerBuffer.remaining(); int amountCopied = JFapUtils.copyWsByteBuffer(headerBuffer, xmitBuffer, headerLeftToCopy); headerFinished = amountCopied == headerLeftToCopy; } // If we finished the header - clean out anything we might have put // into the scratch space. if (headerFinished) { headerScratchSpace.clear(); transmissionRemaining -= headerFields.sizeof(); } else exhausedXmitBuffer = true; if (tc.isEntryEnabled()) SibTr.exit(this, tc, "buildHeader", ""+headerFinished); return headerFinished; }
java
private boolean buildHeader(HeaderFields headerFields, WsByteBuffer xmitBuffer) { if (tc.isEntryEnabled()) SibTr.entry(this, tc, "buildHeader", new Object[] {headerFields, xmitBuffer}); if (tc.isDebugEnabled()) JFapUtils.debugTraceWsByteBufferInfo(this, tc, xmitBuffer, "xmitBuffer"); boolean headerFinished = false; WsByteBuffer headerBuffer = null; if (headerScratchSpace.position() == 0) { if (tc.isDebugEnabled()) JFapUtils.debugTraceWsByteBufferInfo(this, tc, headerScratchSpace, "headerScratchSpace"); // No data in the scratch space buffer - so we must decide if we can // build this header in place. if (xmitBuffer.remaining() >= headerFields.sizeof()) { // Enough space in the transmission buffer to build the header in // place. headerBuffer = xmitBuffer; headerFields.writeToBuffer(xmitBuffer); headerFinished = true; } else { // Insufficient room in the transmission buffer to build the header // in place. headerBuffer = headerScratchSpace; headerFields.writeToBuffer(headerScratchSpace); headerScratchSpace.flip(); } // build header into buffer. } else { // We have already built a header into the scratch space and are // in the process of copying it into the transmission buffer. headerBuffer = headerScratchSpace; } if (!headerFinished) { // We have not finished on this header yet. Try copying it into // the transmission buffer. int headerLeftToCopy = headerBuffer.remaining(); int amountCopied = JFapUtils.copyWsByteBuffer(headerBuffer, xmitBuffer, headerLeftToCopy); headerFinished = amountCopied == headerLeftToCopy; } // If we finished the header - clean out anything we might have put // into the scratch space. if (headerFinished) { headerScratchSpace.clear(); transmissionRemaining -= headerFields.sizeof(); } else exhausedXmitBuffer = true; if (tc.isEntryEnabled()) SibTr.exit(this, tc, "buildHeader", ""+headerFinished); return headerFinished; }
[ "private", "boolean", "buildHeader", "(", "HeaderFields", "headerFields", ",", "WsByteBuffer", "xmitBuffer", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"buildHeader\"", ",", "new", "Object", "[", "]", "{", "headerFields", ",", "xmitBuffer", "}", ")", ";", "if", "(", "tc", ".", "isDebugEnabled", "(", ")", ")", "JFapUtils", ".", "debugTraceWsByteBufferInfo", "(", "this", ",", "tc", ",", "xmitBuffer", ",", "\"xmitBuffer\"", ")", ";", "boolean", "headerFinished", "=", "false", ";", "WsByteBuffer", "headerBuffer", "=", "null", ";", "if", "(", "headerScratchSpace", ".", "position", "(", ")", "==", "0", ")", "{", "if", "(", "tc", ".", "isDebugEnabled", "(", ")", ")", "JFapUtils", ".", "debugTraceWsByteBufferInfo", "(", "this", ",", "tc", ",", "headerScratchSpace", ",", "\"headerScratchSpace\"", ")", ";", "// No data in the scratch space buffer - so we must decide if we can", "// build this header in place.", "if", "(", "xmitBuffer", ".", "remaining", "(", ")", ">=", "headerFields", ".", "sizeof", "(", ")", ")", "{", "// Enough space in the transmission buffer to build the header in", "// place.", "headerBuffer", "=", "xmitBuffer", ";", "headerFields", ".", "writeToBuffer", "(", "xmitBuffer", ")", ";", "headerFinished", "=", "true", ";", "}", "else", "{", "// Insufficient room in the transmission buffer to build the header", "// in place.", "headerBuffer", "=", "headerScratchSpace", ";", "headerFields", ".", "writeToBuffer", "(", "headerScratchSpace", ")", ";", "headerScratchSpace", ".", "flip", "(", ")", ";", "}", "// build header into buffer.", "}", "else", "{", "// We have already built a header into the scratch space and are", "// in the process of copying it into the transmission buffer.", "headerBuffer", "=", "headerScratchSpace", ";", "}", "if", "(", "!", "headerFinished", ")", "{", "// We have not finished on this header yet. Try copying it into", "// the transmission buffer.", "int", "headerLeftToCopy", "=", "headerBuffer", ".", "remaining", "(", ")", ";", "int", "amountCopied", "=", "JFapUtils", ".", "copyWsByteBuffer", "(", "headerBuffer", ",", "xmitBuffer", ",", "headerLeftToCopy", ")", ";", "headerFinished", "=", "amountCopied", "==", "headerLeftToCopy", ";", "}", "// If we finished the header - clean out anything we might have put", "// into the scratch space.", "if", "(", "headerFinished", ")", "{", "headerScratchSpace", ".", "clear", "(", ")", ";", "transmissionRemaining", "-=", "headerFields", ".", "sizeof", "(", ")", ";", "}", "else", "exhausedXmitBuffer", "=", "true", ";", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"buildHeader\"", ",", "\"\"", "+", "headerFinished", ")", ";", "return", "headerFinished", ";", "}" ]
Builds a header from a description of the header fields. The header is incrementally built into the supplied transmission buffer. This may require use of a scratch space in the event that there is insufficient room in the transmission buffer on the first attempt. @param headerFields @param xmitBuffer @return True if the header was completely built.
[ "Builds", "a", "header", "from", "a", "description", "of", "the", "header", "fields", ".", "The", "header", "is", "incrementally", "built", "into", "the", "supplied", "transmission", "buffer", ".", "This", "may", "require", "use", "of", "a", "scratch", "space", "in", "the", "event", "that", "there", "is", "insufficient", "room", "in", "the", "transmission", "buffer", "on", "the", "first", "attempt", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/TransmissionData.java#L538-L600
train
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/TransmissionData.java
TransmissionData.buildPayload
private boolean buildPayload(WsByteBuffer xmitBuffer) { if (tc.isEntryEnabled()) SibTr.entry(this, tc, "buildPayload", xmitBuffer); if (tc.isDebugEnabled()) JFapUtils.debugTraceWsByteBufferInfo(this, tc, xmitBuffer, "xmitBuffer"); boolean payloadFinished = false; int amountCopied, amountToCopy; if (xmitDataBuffers.length == 0) { if (tc.isDebugEnabled()) SibTr.debug(this, tc, "payload finished"); payloadFinished = true; } else { do { amountToCopy = xmitDataBuffers[currentXmitDataBufferIndex].remaining(); if (amountToCopy > transmissionRemaining) amountToCopy = transmissionRemaining; amountCopied = JFapUtils.copyWsByteBuffer(xmitDataBuffers[currentXmitDataBufferIndex], xmitBuffer, amountToCopy); if (tc.isDebugEnabled()) SibTr.debug(this, tc, "amountToCopy="+amountToCopy+" amountCopied="+amountCopied+" currentXmitDataBufferIndex="+currentXmitDataBufferIndex); transmissionRemaining -= amountCopied; if (amountCopied == amountToCopy) { ++currentXmitDataBufferIndex; payloadFinished = (currentXmitDataBufferIndex == xmitDataBuffers.length); } if ((amountCopied < amountToCopy) || (transmissionRemaining < 1)) { exhausedXmitBuffer = true; } } while((amountCopied == amountToCopy) && (!payloadFinished) && (!exhausedXmitBuffer)); } if (tc.isEntryEnabled()) SibTr.exit(this, tc, "buildPayload", ""+payloadFinished); return payloadFinished; }
java
private boolean buildPayload(WsByteBuffer xmitBuffer) { if (tc.isEntryEnabled()) SibTr.entry(this, tc, "buildPayload", xmitBuffer); if (tc.isDebugEnabled()) JFapUtils.debugTraceWsByteBufferInfo(this, tc, xmitBuffer, "xmitBuffer"); boolean payloadFinished = false; int amountCopied, amountToCopy; if (xmitDataBuffers.length == 0) { if (tc.isDebugEnabled()) SibTr.debug(this, tc, "payload finished"); payloadFinished = true; } else { do { amountToCopy = xmitDataBuffers[currentXmitDataBufferIndex].remaining(); if (amountToCopy > transmissionRemaining) amountToCopy = transmissionRemaining; amountCopied = JFapUtils.copyWsByteBuffer(xmitDataBuffers[currentXmitDataBufferIndex], xmitBuffer, amountToCopy); if (tc.isDebugEnabled()) SibTr.debug(this, tc, "amountToCopy="+amountToCopy+" amountCopied="+amountCopied+" currentXmitDataBufferIndex="+currentXmitDataBufferIndex); transmissionRemaining -= amountCopied; if (amountCopied == amountToCopy) { ++currentXmitDataBufferIndex; payloadFinished = (currentXmitDataBufferIndex == xmitDataBuffers.length); } if ((amountCopied < amountToCopy) || (transmissionRemaining < 1)) { exhausedXmitBuffer = true; } } while((amountCopied == amountToCopy) && (!payloadFinished) && (!exhausedXmitBuffer)); } if (tc.isEntryEnabled()) SibTr.exit(this, tc, "buildPayload", ""+payloadFinished); return payloadFinished; }
[ "private", "boolean", "buildPayload", "(", "WsByteBuffer", "xmitBuffer", ")", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ",", "tc", ",", "\"buildPayload\"", ",", "xmitBuffer", ")", ";", "if", "(", "tc", ".", "isDebugEnabled", "(", ")", ")", "JFapUtils", ".", "debugTraceWsByteBufferInfo", "(", "this", ",", "tc", ",", "xmitBuffer", ",", "\"xmitBuffer\"", ")", ";", "boolean", "payloadFinished", "=", "false", ";", "int", "amountCopied", ",", "amountToCopy", ";", "if", "(", "xmitDataBuffers", ".", "length", "==", "0", ")", "{", "if", "(", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "this", ",", "tc", ",", "\"payload finished\"", ")", ";", "payloadFinished", "=", "true", ";", "}", "else", "{", "do", "{", "amountToCopy", "=", "xmitDataBuffers", "[", "currentXmitDataBufferIndex", "]", ".", "remaining", "(", ")", ";", "if", "(", "amountToCopy", ">", "transmissionRemaining", ")", "amountToCopy", "=", "transmissionRemaining", ";", "amountCopied", "=", "JFapUtils", ".", "copyWsByteBuffer", "(", "xmitDataBuffers", "[", "currentXmitDataBufferIndex", "]", ",", "xmitBuffer", ",", "amountToCopy", ")", ";", "if", "(", "tc", ".", "isDebugEnabled", "(", ")", ")", "SibTr", ".", "debug", "(", "this", ",", "tc", ",", "\"amountToCopy=\"", "+", "amountToCopy", "+", "\" amountCopied=\"", "+", "amountCopied", "+", "\" currentXmitDataBufferIndex=\"", "+", "currentXmitDataBufferIndex", ")", ";", "transmissionRemaining", "-=", "amountCopied", ";", "if", "(", "amountCopied", "==", "amountToCopy", ")", "{", "++", "currentXmitDataBufferIndex", ";", "payloadFinished", "=", "(", "currentXmitDataBufferIndex", "==", "xmitDataBuffers", ".", "length", ")", ";", "}", "if", "(", "(", "amountCopied", "<", "amountToCopy", ")", "||", "(", "transmissionRemaining", "<", "1", ")", ")", "{", "exhausedXmitBuffer", "=", "true", ";", "}", "}", "while", "(", "(", "amountCopied", "==", "amountToCopy", ")", "&&", "(", "!", "payloadFinished", ")", "&&", "(", "!", "exhausedXmitBuffer", ")", ")", ";", "}", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "exit", "(", "this", ",", "tc", ",", "\"buildPayload\"", ",", "\"\"", "+", "payloadFinished", ")", ";", "return", "payloadFinished", ";", "}" ]
Builds a transmission payload into the supplied buffer. This may be done incrementally by multiple invocations in the case that the supplied buffer is smaller than the payload being built. @param xmitBuffer @return True if the payload was completely built
[ "Builds", "a", "transmission", "payload", "into", "the", "supplied", "buffer", ".", "This", "may", "be", "done", "incrementally", "by", "multiple", "invocations", "in", "the", "case", "that", "the", "supplied", "buffer", "is", "smaller", "than", "the", "payload", "being", "built", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/impl/TransmissionData.java#L609-L648
train