id
int32
0
165k
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
40,600
tobykurien/Xtendroid
Xtendroid/src/asia/sonix/android/orm/AbatisService.java
AbatisService.toSqlString
public String toSqlString(Object value) { if (value == null) { return "null"; } String val = String.valueOf(value); if (value instanceof Integer || value instanceof Float || value instanceof Double || value instanceof Long) { return val; } else ...
java
public String toSqlString(Object value) { if (value == null) { return "null"; } String val = String.valueOf(value); if (value instanceof Integer || value instanceof Float || value instanceof Double || value instanceof Long) { return val; } else ...
[ "public", "String", "toSqlString", "(", "Object", "value", ")", "{", "if", "(", "value", "==", "null", ")", "{", "return", "\"null\"", ";", "}", "String", "val", "=", "String", ".", "valueOf", "(", "value", ")", ";", "if", "(", "value", "instanceof", ...
Convert value object to sanitized SQL string @param value - the value object @return a string for use in an SQL statement @author Toby Kurien
[ "Convert", "value", "object", "to", "sanitized", "SQL", "string" ]
758bf1d06f4cf3b64f9c10632fe9c6fb30bcebd4
https://github.com/tobykurien/Xtendroid/blob/758bf1d06f4cf3b64f9c10632fe9c6fb30bcebd4/Xtendroid/src/asia/sonix/android/orm/AbatisService.java#L713-L732
40,601
sap-production/xcode-maven-plugin
modules/xcode-maven-plugin/src/main/java/com/sap/prd/mobile/ios/mios/XCodePrepareBuildManager.java
XCodePrepareBuildManager.createDirectory
private static void createDirectory(final File directory) throws MojoExecutionException { try { com.sap.prd.mobile.ios.mios.FileUtils.deleteDirectory(directory); } catch (IOException ex) { throw new MojoExecutionException("", ex); } if (!directory.mkdirs()) throw new MojoExecut...
java
private static void createDirectory(final File directory) throws MojoExecutionException { try { com.sap.prd.mobile.ios.mios.FileUtils.deleteDirectory(directory); } catch (IOException ex) { throw new MojoExecutionException("", ex); } if (!directory.mkdirs()) throw new MojoExecut...
[ "private", "static", "void", "createDirectory", "(", "final", "File", "directory", ")", "throws", "MojoExecutionException", "{", "try", "{", "com", ".", "sap", ".", "prd", ".", "mobile", ".", "ios", ".", "mios", ".", "FileUtils", ".", "deleteDirectory", "(",...
Creates a directory. If the directory already exists the directory is deleted beforehand. @param directory @throws MojoExecutionException
[ "Creates", "a", "directory", ".", "If", "the", "directory", "already", "exists", "the", "directory", "is", "deleted", "beforehand", "." ]
3f8aa380f501a1d7602f33fef2f6348354e7eb7c
https://github.com/sap-production/xcode-maven-plugin/blob/3f8aa380f501a1d7602f33fef2f6348354e7eb7c/modules/xcode-maven-plugin/src/main/java/com/sap/prd/mobile/ios/mios/XCodePrepareBuildManager.java#L446-L458
40,602
zutnop/telekom-workflow-engine
telekom-workflow-engine/src/main/java/ee/telekom/workflow/api/WorkflowFactoryImpl.java
WorkflowFactoryImpl.downRight
private Tree<Row> downRight( Element token ){ return current = current.addChild( Tree.of( new Row( token ) ) ); }
java
private Tree<Row> downRight( Element token ){ return current = current.addChild( Tree.of( new Row( token ) ) ); }
[ "private", "Tree", "<", "Row", ">", "downRight", "(", "Element", "token", ")", "{", "return", "current", "=", "current", ".", "addChild", "(", "Tree", ".", "of", "(", "new", "Row", "(", "token", ")", ")", ")", ";", "}" ]
Starts a new row one indentation level to the right.
[ "Starts", "a", "new", "row", "one", "indentation", "level", "to", "the", "right", "." ]
f471f1f94013b3e2d56b4c9380e86e3a92c2ee29
https://github.com/zutnop/telekom-workflow-engine/blob/f471f1f94013b3e2d56b4c9380e86e3a92c2ee29/telekom-workflow-engine/src/main/java/ee/telekom/workflow/api/WorkflowFactoryImpl.java#L361-L363
40,603
zutnop/telekom-workflow-engine
telekom-workflow-engine/src/main/java/ee/telekom/workflow/api/WorkflowFactoryImpl.java
WorkflowFactoryImpl.downLeft
private Tree<Row> downLeft( Element token ){ return current = current.getParent().addSibling( Tree.of( new Row( token ) ) ); }
java
private Tree<Row> downLeft( Element token ){ return current = current.getParent().addSibling( Tree.of( new Row( token ) ) ); }
[ "private", "Tree", "<", "Row", ">", "downLeft", "(", "Element", "token", ")", "{", "return", "current", "=", "current", ".", "getParent", "(", ")", ".", "addSibling", "(", "Tree", ".", "of", "(", "new", "Row", "(", "token", ")", ")", ")", ";", "}" ...
Starts a new row one indentation level to the left.
[ "Starts", "a", "new", "row", "one", "indentation", "level", "to", "the", "left", "." ]
f471f1f94013b3e2d56b4c9380e86e3a92c2ee29
https://github.com/zutnop/telekom-workflow-engine/blob/f471f1f94013b3e2d56b4c9380e86e3a92c2ee29/telekom-workflow-engine/src/main/java/ee/telekom/workflow/api/WorkflowFactoryImpl.java#L369-L371
40,604
zutnop/telekom-workflow-engine
telekom-workflow-engine/src/main/java/ee/telekom/workflow/api/WorkflowFactoryImpl.java
WorkflowFactoryImpl.down
private Tree<Row> down( Element token ){ return current = current.addSibling( Tree.of( new Row( token ) ) ); }
java
private Tree<Row> down( Element token ){ return current = current.addSibling( Tree.of( new Row( token ) ) ); }
[ "private", "Tree", "<", "Row", ">", "down", "(", "Element", "token", ")", "{", "return", "current", "=", "current", ".", "addSibling", "(", "Tree", ".", "of", "(", "new", "Row", "(", "token", ")", ")", ")", ";", "}" ]
Starts a new row at the same level of indentation.
[ "Starts", "a", "new", "row", "at", "the", "same", "level", "of", "indentation", "." ]
f471f1f94013b3e2d56b4c9380e86e3a92c2ee29
https://github.com/zutnop/telekom-workflow-engine/blob/f471f1f94013b3e2d56b4c9380e86e3a92c2ee29/telekom-workflow-engine/src/main/java/ee/telekom/workflow/api/WorkflowFactoryImpl.java#L383-L385
40,605
zutnop/telekom-workflow-engine
telekom-workflow-engine/src/main/java/ee/telekom/workflow/api/WorkflowFactoryImpl.java
WorkflowFactoryImpl.here
private Tree<Row> here( Element token ){ current.getContent().addToken( token ); return current; }
java
private Tree<Row> here( Element token ){ current.getContent().addToken( token ); return current; }
[ "private", "Tree", "<", "Row", ">", "here", "(", "Element", "token", ")", "{", "current", ".", "getContent", "(", ")", ".", "addToken", "(", "token", ")", ";", "return", "current", ";", "}" ]
Adds element to the same row.
[ "Adds", "element", "to", "the", "same", "row", "." ]
f471f1f94013b3e2d56b4c9380e86e3a92c2ee29
https://github.com/zutnop/telekom-workflow-engine/blob/f471f1f94013b3e2d56b4c9380e86e3a92c2ee29/telekom-workflow-engine/src/main/java/ee/telekom/workflow/api/WorkflowFactoryImpl.java#L390-L393
40,606
seedstack/business
migrate/src/main/java/org/seedstack/business/finder/Result.java
Result.rangeResult
public static <I> Result<I> rangeResult(List<I> result, long offset, long fullRequestSize) { return new Result<>(result, offset, fullRequestSize); }
java
public static <I> Result<I> rangeResult(List<I> result, long offset, long fullRequestSize) { return new Result<>(result, offset, fullRequestSize); }
[ "public", "static", "<", "I", ">", "Result", "<", "I", ">", "rangeResult", "(", "List", "<", "I", ">", "result", ",", "long", "offset", ",", "long", "fullRequestSize", ")", "{", "return", "new", "Result", "<>", "(", "result", ",", "offset", ",", "ful...
Creates a new Result. @param result the list of item @param offset the offset @param fullRequestSize the number of item available @param <I> the item type @return the result range
[ "Creates", "a", "new", "Result", "." ]
55b3e861fe152e9b125ebc69daa91a682deeae8a
https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/migrate/src/main/java/org/seedstack/business/finder/Result.java#L50-L52
40,607
seedstack/business
migrate/src/main/java/org/seedstack/business/view/VirtualList.java
VirtualList.get
T get(long index) { checkRange(index); if (checkSubRange(index)) { // cannot exceed Integer.MAX_VALUE (checked by checkSubRange) return subList.get((int) (index - subListOffset)); } return null; }
java
T get(long index) { checkRange(index); if (checkSubRange(index)) { // cannot exceed Integer.MAX_VALUE (checked by checkSubRange) return subList.get((int) (index - subListOffset)); } return null; }
[ "T", "get", "(", "long", "index", ")", "{", "checkRange", "(", "index", ")", ";", "if", "(", "checkSubRange", "(", "index", ")", ")", "{", "// cannot exceed Integer.MAX_VALUE (checked by checkSubRange)", "return", "subList", ".", "get", "(", "(", "int", ")", ...
Gets the item at the index. @param index the request index @return the item
[ "Gets", "the", "item", "at", "the", "index", "." ]
55b3e861fe152e9b125ebc69daa91a682deeae8a
https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/migrate/src/main/java/org/seedstack/business/view/VirtualList.java#L44-L52
40,608
seedstack/business
migrate/src/main/java/org/seedstack/business/view/VirtualList.java
VirtualList.subList
List<T> subList(long from, long to) { if (fullListSize > 0 && to - from > 0) { checkRange(from); // subList takes a [from;to[ range checkRange(to - 1); // check if the data of the required sub list are available assertSubRange(from, to - 1); ...
java
List<T> subList(long from, long to) { if (fullListSize > 0 && to - from > 0) { checkRange(from); // subList takes a [from;to[ range checkRange(to - 1); // check if the data of the required sub list are available assertSubRange(from, to - 1); ...
[ "List", "<", "T", ">", "subList", "(", "long", "from", ",", "long", "to", ")", "{", "if", "(", "fullListSize", ">", "0", "&&", "to", "-", "from", ">", "0", ")", "{", "checkRange", "(", "from", ")", ";", "// subList takes a [from;to[ range", "checkRange...
Returns a portion of this list between the specified from, inclusive, and to, exclusive. @param from low endpoint (inclusive) of the subList @param to high endpoint (exclusive) of the subList @return the sub list of item
[ "Returns", "a", "portion", "of", "this", "list", "between", "the", "specified", "from", "inclusive", "and", "to", "exclusive", "." ]
55b3e861fe152e9b125ebc69daa91a682deeae8a
https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/migrate/src/main/java/org/seedstack/business/view/VirtualList.java#L61-L75
40,609
seedstack/business
migrate/src/main/java/org/seedstack/business/view/VirtualList.java
VirtualList.assertSubRange
private void assertSubRange(long from, long to) { if (!checkSubRange(from) || !checkSubRange(to)) { throw new IndexOutOfBoundsException("Required data for the sub list [" + from + "," + (to + 1) + "[ have " + "not been loaded in the virtual list."); } }
java
private void assertSubRange(long from, long to) { if (!checkSubRange(from) || !checkSubRange(to)) { throw new IndexOutOfBoundsException("Required data for the sub list [" + from + "," + (to + 1) + "[ have " + "not been loaded in the virtual list."); } }
[ "private", "void", "assertSubRange", "(", "long", "from", ",", "long", "to", ")", "{", "if", "(", "!", "checkSubRange", "(", "from", ")", "||", "!", "checkSubRange", "(", "to", ")", ")", "{", "throw", "new", "IndexOutOfBoundsException", "(", "\"Required da...
Asserts that the requested sub list is available in the virtual list. Otherwise it throws an IndexOutOfBoundsException. @param from the from index (inclusive) @param to the to index (inclusive)
[ "Asserts", "that", "the", "requested", "sub", "list", "is", "available", "in", "the", "virtual", "list", ".", "Otherwise", "it", "throws", "an", "IndexOutOfBoundsException", "." ]
55b3e861fe152e9b125ebc69daa91a682deeae8a
https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/migrate/src/main/java/org/seedstack/business/view/VirtualList.java#L116-L121
40,610
seedstack/business
core/src/main/java/org/seedstack/business/internal/utils/FieldUtils.java
FieldUtils.getFieldValue
public static Object getFieldValue(Object candidate, Field field) { try { return ReflectUtils.getValue(ReflectUtils.makeAccessible(field), candidate); } catch (Exception e) { throw BusinessException.wrap(e, BusinessErrorCode.ERROR_ACCESSING_FIELD) .put("classN...
java
public static Object getFieldValue(Object candidate, Field field) { try { return ReflectUtils.getValue(ReflectUtils.makeAccessible(field), candidate); } catch (Exception e) { throw BusinessException.wrap(e, BusinessErrorCode.ERROR_ACCESSING_FIELD) .put("classN...
[ "public", "static", "Object", "getFieldValue", "(", "Object", "candidate", ",", "Field", "field", ")", "{", "try", "{", "return", "ReflectUtils", ".", "getValue", "(", "ReflectUtils", ".", "makeAccessible", "(", "field", ")", ",", "candidate", ")", ";", "}",...
Return the value contained in the specified field of the candidate object. @param candidate the object to retrieve the value of. @param field the field. @return the value contained in the field of the candidate.
[ "Return", "the", "value", "contained", "in", "the", "specified", "field", "of", "the", "candidate", "object", "." ]
55b3e861fe152e9b125ebc69daa91a682deeae8a
https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/core/src/main/java/org/seedstack/business/internal/utils/FieldUtils.java#L43-L51
40,611
seedstack/business
core/src/main/java/org/seedstack/business/internal/utils/FieldUtils.java
FieldUtils.resolveField
public static Optional<Field> resolveField(Class<?> someClass, String fieldName) { return fieldCache.get(new FieldReference(someClass, fieldName)); }
java
public static Optional<Field> resolveField(Class<?> someClass, String fieldName) { return fieldCache.get(new FieldReference(someClass, fieldName)); }
[ "public", "static", "Optional", "<", "Field", ">", "resolveField", "(", "Class", "<", "?", ">", "someClass", ",", "String", "fieldName", ")", "{", "return", "fieldCache", ".", "get", "(", "new", "FieldReference", "(", "someClass", ",", "fieldName", ")", ")...
Returns the specified field found on the specified class and its ancestors. @param someClass the class to search the field on. @param fieldName the field name. @return the corresponding field object wrapped in an optional.
[ "Returns", "the", "specified", "field", "found", "on", "the", "specified", "class", "and", "its", "ancestors", "." ]
55b3e861fe152e9b125ebc69daa91a682deeae8a
https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/core/src/main/java/org/seedstack/business/internal/utils/FieldUtils.java#L60-L62
40,612
zutnop/telekom-workflow-engine
telekom-workflow-engine/src/main/java/ee/telekom/workflow/graph/el/ElUtil.java
ElUtil.removeBrackets
public static String removeBrackets( String condition ){ String value = StringUtils.strip( condition ); if( value != null && value.length() >= 3 ){ return value.substring( 2, value.length() - 1 ); } return value; }
java
public static String removeBrackets( String condition ){ String value = StringUtils.strip( condition ); if( value != null && value.length() >= 3 ){ return value.substring( 2, value.length() - 1 ); } return value; }
[ "public", "static", "String", "removeBrackets", "(", "String", "condition", ")", "{", "String", "value", "=", "StringUtils", ".", "strip", "(", "condition", ")", ";", "if", "(", "value", "!=", "null", "&&", "value", ".", "length", "(", ")", ">=", "3", ...
After trimming the input, removes two characters from the start and one from the end and returns the result.
[ "After", "trimming", "the", "input", "removes", "two", "characters", "from", "the", "start", "and", "one", "from", "the", "end", "and", "returns", "the", "result", "." ]
f471f1f94013b3e2d56b4c9380e86e3a92c2ee29
https://github.com/zutnop/telekom-workflow-engine/blob/f471f1f94013b3e2d56b4c9380e86e3a92c2ee29/telekom-workflow-engine/src/main/java/ee/telekom/workflow/graph/el/ElUtil.java#L29-L35
40,613
zutnop/telekom-workflow-engine
telekom-workflow-engine/src/main/java/ee/telekom/workflow/graph/el/ElUtil.java
ElUtil.isReservedVariable
public static boolean isReservedVariable( String variableName ){ return ReservedVariables.NOW.equalsIgnoreCase( variableName ) || ReservedVariables.WORKFLOW_INSTANCE_ID.equalsIgnoreCase( variableName ); }
java
public static boolean isReservedVariable( String variableName ){ return ReservedVariables.NOW.equalsIgnoreCase( variableName ) || ReservedVariables.WORKFLOW_INSTANCE_ID.equalsIgnoreCase( variableName ); }
[ "public", "static", "boolean", "isReservedVariable", "(", "String", "variableName", ")", "{", "return", "ReservedVariables", ".", "NOW", ".", "equalsIgnoreCase", "(", "variableName", ")", "||", "ReservedVariables", ".", "WORKFLOW_INSTANCE_ID", ".", "equalsIgnoreCase", ...
Checks if the given variable name is a reserved keyword and SHOULD NOT be used as a key for an Environment attribute.
[ "Checks", "if", "the", "given", "variable", "name", "is", "a", "reserved", "keyword", "and", "SHOULD", "NOT", "be", "used", "as", "a", "key", "for", "an", "Environment", "attribute", "." ]
f471f1f94013b3e2d56b4c9380e86e3a92c2ee29
https://github.com/zutnop/telekom-workflow-engine/blob/f471f1f94013b3e2d56b4c9380e86e3a92c2ee29/telekom-workflow-engine/src/main/java/ee/telekom/workflow/graph/el/ElUtil.java#L54-L56
40,614
zutnop/telekom-workflow-engine
telekom-workflow-engine/src/main/java/ee/telekom/workflow/api/TransitionBuilder.java
TransitionBuilder.findIf
private Tree<Row> findIf( Tree<Row> pointer ){ while( !Type.IF.equals( pointer.getContent().getType() ) ){ pointer = pointer.getPrevious(); } return pointer; }
java
private Tree<Row> findIf( Tree<Row> pointer ){ while( !Type.IF.equals( pointer.getContent().getType() ) ){ pointer = pointer.getPrevious(); } return pointer; }
[ "private", "Tree", "<", "Row", ">", "findIf", "(", "Tree", "<", "Row", ">", "pointer", ")", "{", "while", "(", "!", "Type", ".", "IF", ".", "equals", "(", "pointer", ".", "getContent", "(", ")", ".", "getType", "(", ")", ")", ")", "{", "pointer",...
Finds the associate IF for an ELSE_IF, ELSE or END_IF pointer.
[ "Finds", "the", "associate", "IF", "for", "an", "ELSE_IF", "ELSE", "or", "END_IF", "pointer", "." ]
f471f1f94013b3e2d56b4c9380e86e3a92c2ee29
https://github.com/zutnop/telekom-workflow-engine/blob/f471f1f94013b3e2d56b4c9380e86e3a92c2ee29/telekom-workflow-engine/src/main/java/ee/telekom/workflow/api/TransitionBuilder.java#L153-L158
40,615
zutnop/telekom-workflow-engine
telekom-workflow-engine/src/main/java/ee/telekom/workflow/api/TransitionBuilder.java
TransitionBuilder.findEndIf
private Tree<Row> findEndIf( Tree<Row> pointer ){ while( !Type.END_IF.equals( pointer.getContent().getType() ) ){ pointer = pointer.getNext(); } return pointer; }
java
private Tree<Row> findEndIf( Tree<Row> pointer ){ while( !Type.END_IF.equals( pointer.getContent().getType() ) ){ pointer = pointer.getNext(); } return pointer; }
[ "private", "Tree", "<", "Row", ">", "findEndIf", "(", "Tree", "<", "Row", ">", "pointer", ")", "{", "while", "(", "!", "Type", ".", "END_IF", ".", "equals", "(", "pointer", ".", "getContent", "(", ")", ".", "getType", "(", ")", ")", ")", "{", "po...
Finds the associate END_IF for an IF, ELSE_IF or ELSE pointer
[ "Finds", "the", "associate", "END_IF", "for", "an", "IF", "ELSE_IF", "or", "ELSE", "pointer" ]
f471f1f94013b3e2d56b4c9380e86e3a92c2ee29
https://github.com/zutnop/telekom-workflow-engine/blob/f471f1f94013b3e2d56b4c9380e86e3a92c2ee29/telekom-workflow-engine/src/main/java/ee/telekom/workflow/api/TransitionBuilder.java#L163-L168
40,616
zutnop/telekom-workflow-engine
telekom-workflow-engine/src/main/java/ee/telekom/workflow/api/TransitionBuilder.java
TransitionBuilder.findNext
private Tree<Row> findNext( Tree<Row> pointer ){ if( pointer.hasNext() ){ // The given tree-node is not the last in its block. if( Type.END.equals( pointer.getNext().getContent().getType() ) ){ return null; } else{ return pointer.ge...
java
private Tree<Row> findNext( Tree<Row> pointer ){ if( pointer.hasNext() ){ // The given tree-node is not the last in its block. if( Type.END.equals( pointer.getNext().getContent().getType() ) ){ return null; } else{ return pointer.ge...
[ "private", "Tree", "<", "Row", ">", "findNext", "(", "Tree", "<", "Row", ">", "pointer", ")", "{", "if", "(", "pointer", ".", "hasNext", "(", ")", ")", "{", "// The given tree-node is not the last in its block.", "if", "(", "Type", ".", "END", ".", "equals...
Finds the following node which to create a transition to. Supports tree-nodes that are not the last in their block and those which are last.
[ "Finds", "the", "following", "node", "which", "to", "create", "a", "transition", "to", ".", "Supports", "tree", "-", "nodes", "that", "are", "not", "the", "last", "in", "their", "block", "and", "those", "which", "are", "last", "." ]
f471f1f94013b3e2d56b4c9380e86e3a92c2ee29
https://github.com/zutnop/telekom-workflow-engine/blob/f471f1f94013b3e2d56b4c9380e86e3a92c2ee29/telekom-workflow-engine/src/main/java/ee/telekom/workflow/api/TransitionBuilder.java#L183-L215
40,617
seedstack/business
core/src/main/java/org/seedstack/business/internal/utils/MethodMatcher.java
MethodMatcher.findMatchingMethod
public static Method findMatchingMethod(Class<?> classToInspect, Class<?> returnType, Object... params) { Method[] methods = classToInspect.getMethods(); Method checkedMethod = null; for (Method method : methods) { Type[] parameterTypes = method.getParameterTypes(); // if...
java
public static Method findMatchingMethod(Class<?> classToInspect, Class<?> returnType, Object... params) { Method[] methods = classToInspect.getMethods(); Method checkedMethod = null; for (Method method : methods) { Type[] parameterTypes = method.getParameterTypes(); // if...
[ "public", "static", "Method", "findMatchingMethod", "(", "Class", "<", "?", ">", "classToInspect", ",", "Class", "<", "?", ">", "returnType", ",", "Object", "...", "params", ")", "{", "Method", "[", "]", "methods", "=", "classToInspect", ".", "getMethods", ...
Finds a method matching the given parameters and return type.
[ "Finds", "a", "method", "matching", "the", "given", "parameters", "and", "return", "type", "." ]
55b3e861fe152e9b125ebc69daa91a682deeae8a
https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/core/src/main/java/org/seedstack/business/internal/utils/MethodMatcher.java#L27-L48
40,618
seedstack/business
core/src/main/java/org/seedstack/business/internal/utils/MethodMatcher.java
MethodMatcher.findMatchingConstructor
@SuppressWarnings("unchecked") public static <T> Constructor<T> findMatchingConstructor(Class<T> classToInspect, Object... params) { Constructor<T> checkedConstructors = null; for (Constructor<?> constructor : classToInspect.getDeclaredConstructors()) { Type[] parameterTypes = constructo...
java
@SuppressWarnings("unchecked") public static <T> Constructor<T> findMatchingConstructor(Class<T> classToInspect, Object... params) { Constructor<T> checkedConstructors = null; for (Constructor<?> constructor : classToInspect.getDeclaredConstructors()) { Type[] parameterTypes = constructo...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "<", "T", ">", "Constructor", "<", "T", ">", "findMatchingConstructor", "(", "Class", "<", "T", ">", "classToInspect", ",", "Object", "...", "params", ")", "{", "Constructor", "<", "T", ...
Finds a constructor matching the given parameters.
[ "Finds", "a", "constructor", "matching", "the", "given", "parameters", "." ]
55b3e861fe152e9b125ebc69daa91a682deeae8a
https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/core/src/main/java/org/seedstack/business/internal/utils/MethodMatcher.java#L53-L71
40,619
seedstack/business
core/src/main/java/org/seedstack/business/spi/BaseDtoInfoResolver.java
BaseDtoInfoResolver.createFromFactory
protected <A extends AggregateRoot<?>> A createFromFactory(Class<A> aggregateClass, Object... parameters) { checkNotNull(aggregateClass); checkNotNull(parameters); Factory<A> factory = domainRegistry.getFactory(aggregateClass); // Find the method in the factory which match the signatur...
java
protected <A extends AggregateRoot<?>> A createFromFactory(Class<A> aggregateClass, Object... parameters) { checkNotNull(aggregateClass); checkNotNull(parameters); Factory<A> factory = domainRegistry.getFactory(aggregateClass); // Find the method in the factory which match the signatur...
[ "protected", "<", "A", "extends", "AggregateRoot", "<", "?", ">", ">", "A", "createFromFactory", "(", "Class", "<", "A", ">", "aggregateClass", ",", "Object", "...", "parameters", ")", "{", "checkNotNull", "(", "aggregateClass", ")", ";", "checkNotNull", "("...
Implements the logic to create an aggregate. @param aggregateClass the aggregate class. @param parameters the parameters to pass to the factory if any. @param <A> the type of the aggregate root. @return the aggregate root.
[ "Implements", "the", "logic", "to", "create", "an", "aggregate", "." ]
55b3e861fe152e9b125ebc69daa91a682deeae8a
https://github.com/seedstack/business/blob/55b3e861fe152e9b125ebc69daa91a682deeae8a/core/src/main/java/org/seedstack/business/spi/BaseDtoInfoResolver.java#L75-L117
40,620
sap-production/xcode-maven-plugin
modules/xcode-maven-plugin/src/main/java/com/sap/prd/mobile/ios/mios/DomUtils.java
DomUtils.serialize
static void serialize(final Document doc, final OutputStream os, final String encoding) throws TransformerFactoryConfigurationError, TransformerException, IOException { if (doc == null) throw new IllegalArgumentException("No document provided."); if (os == null) throw new IllegalArgumentE...
java
static void serialize(final Document doc, final OutputStream os, final String encoding) throws TransformerFactoryConfigurationError, TransformerException, IOException { if (doc == null) throw new IllegalArgumentException("No document provided."); if (os == null) throw new IllegalArgumentE...
[ "static", "void", "serialize", "(", "final", "Document", "doc", ",", "final", "OutputStream", "os", ",", "final", "String", "encoding", ")", "throws", "TransformerFactoryConfigurationError", ",", "TransformerException", ",", "IOException", "{", "if", "(", "doc", "...
Serializes a DOM. The OutputStream handed over to this method is not closed inside this method.
[ "Serializes", "a", "DOM", ".", "The", "OutputStream", "handed", "over", "to", "this", "method", "is", "not", "closed", "inside", "this", "method", "." ]
3f8aa380f501a1d7602f33fef2f6348354e7eb7c
https://github.com/sap-production/xcode-maven-plugin/blob/3f8aa380f501a1d7602f33fef2f6348354e7eb7c/modules/xcode-maven-plugin/src/main/java/com/sap/prd/mobile/ios/mios/DomUtils.java#L54-L78
40,621
reapzor/FiloFirmata
src/main/java/com/bortbort/arduino/FiloFirmata/Messages/TransmittableSysexMessage.java
TransmittableSysexMessage.toByteArray
@Override public byte[] toByteArray() { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(16); outputStream.write(commandByte); outputStream.write(sysexCommandByte); if (serialize(outputStream)) { outputStream.write(CommandBytes.END_SYSEX.getCommandByte());...
java
@Override public byte[] toByteArray() { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(16); outputStream.write(commandByte); outputStream.write(sysexCommandByte); if (serialize(outputStream)) { outputStream.write(CommandBytes.END_SYSEX.getCommandByte());...
[ "@", "Override", "public", "byte", "[", "]", "toByteArray", "(", ")", "{", "ByteArrayOutputStream", "outputStream", "=", "new", "ByteArrayOutputStream", "(", "16", ")", ";", "outputStream", ".", "write", "(", "commandByte", ")", ";", "outputStream", ".", "writ...
Combine the SysexCommandByte and the serialized sysex message packet together to form a Firmata supported sysex byte packet to be sent over the SerialPort. @return byte[] array representing the full Firmata sysex command packet to be sent to the Firmata device.
[ "Combine", "the", "SysexCommandByte", "and", "the", "serialized", "sysex", "message", "packet", "together", "to", "form", "a", "Firmata", "supported", "sysex", "byte", "packet", "to", "be", "sent", "over", "the", "SerialPort", "." ]
39c26c1a577b8fff8690245e105cb62e02284f16
https://github.com/reapzor/FiloFirmata/blob/39c26c1a577b8fff8690245e105cb62e02284f16/src/main/java/com/bortbort/arduino/FiloFirmata/Messages/TransmittableSysexMessage.java#L46-L59
40,622
yongjhih/SwitchPreferenceCompat
app/src/main/java/com/cgollner/unclouded/preferences/sample/SettingsActivity.java
SettingsActivity.isValidFragment
@Override protected boolean isValidFragment(String fragmentName) { Boolean knownFrag = false; for (Class<?> cls : INNER_CLASSES) { if ( cls.getName().equals(fragmentName) ){ knownFrag = true; break; } } return knownFrag; ...
java
@Override protected boolean isValidFragment(String fragmentName) { Boolean knownFrag = false; for (Class<?> cls : INNER_CLASSES) { if ( cls.getName().equals(fragmentName) ){ knownFrag = true; break; } } return knownFrag; ...
[ "@", "Override", "protected", "boolean", "isValidFragment", "(", "String", "fragmentName", ")", "{", "Boolean", "knownFrag", "=", "false", ";", "for", "(", "Class", "<", "?", ">", "cls", ":", "INNER_CLASSES", ")", "{", "if", "(", "cls", ".", "getName", "...
Google found a 'security vulnerability' and imposed this hack. Have to check this fragment was actually conceived by this activity.
[ "Google", "found", "a", "security", "vulnerability", "and", "imposed", "this", "hack", ".", "Have", "to", "check", "this", "fragment", "was", "actually", "conceived", "by", "this", "activity", "." ]
e7d4ff0d51b882b88c3d537ef7428ca9e4e3d492
https://github.com/yongjhih/SwitchPreferenceCompat/blob/e7d4ff0d51b882b88c3d537ef7428ca9e4e3d492/app/src/main/java/com/cgollner/unclouded/preferences/sample/SettingsActivity.java#L51-L67
40,623
reapzor/FiloFirmata
src/main/java/com/bortbort/arduino/FiloFirmata/Messages/TransmittableMessage.java
TransmittableMessage.toByteArray
public byte[] toByteArray() { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(32); outputStream.write(commandByte); if (serialize(outputStream)) { return outputStream.toByteArray(); } return null; }
java
public byte[] toByteArray() { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(32); outputStream.write(commandByte); if (serialize(outputStream)) { return outputStream.toByteArray(); } return null; }
[ "public", "byte", "[", "]", "toByteArray", "(", ")", "{", "ByteArrayOutputStream", "outputStream", "=", "new", "ByteArrayOutputStream", "(", "32", ")", ";", "outputStream", ".", "write", "(", "commandByte", ")", ";", "if", "(", "serialize", "(", "outputStream"...
Combine the CommandByte and the serialized message packet together to form a Firmata supported byte packet to be sent over the SerialPort. @return true if no errors building message
[ "Combine", "the", "CommandByte", "and", "the", "serialized", "message", "packet", "together", "to", "form", "a", "Firmata", "supported", "byte", "packet", "to", "be", "sent", "over", "the", "SerialPort", "." ]
39c26c1a577b8fff8690245e105cb62e02284f16
https://github.com/reapzor/FiloFirmata/blob/39c26c1a577b8fff8690245e105cb62e02284f16/src/main/java/com/bortbort/arduino/FiloFirmata/Messages/TransmittableMessage.java#L51-L61
40,624
reapzor/FiloFirmata
src/main/java/com/bortbort/arduino/FiloFirmata/PortAdapters/SerialPort.java
SerialPort.fireEvent
protected void fireEvent(SerialPortEventTypes eventType) { executor.submit(new Runnable() { @Override public void run() { for (SerialPortEventListener listener : eventListeners) { listener.serialEvent(new SerialPortEvent(eventType)); } ...
java
protected void fireEvent(SerialPortEventTypes eventType) { executor.submit(new Runnable() { @Override public void run() { for (SerialPortEventListener listener : eventListeners) { listener.serialEvent(new SerialPortEvent(eventType)); } ...
[ "protected", "void", "fireEvent", "(", "SerialPortEventTypes", "eventType", ")", "{", "executor", ".", "submit", "(", "new", "Runnable", "(", ")", "{", "@", "Override", "public", "void", "run", "(", ")", "{", "for", "(", "SerialPortEventListener", "listener", ...
Tell the client if there is data available, etc.
[ "Tell", "the", "client", "if", "there", "is", "data", "available", "etc", "." ]
39c26c1a577b8fff8690245e105cb62e02284f16
https://github.com/reapzor/FiloFirmata/blob/39c26c1a577b8fff8690245e105cb62e02284f16/src/main/java/com/bortbort/arduino/FiloFirmata/PortAdapters/SerialPort.java#L70-L80
40,625
reapzor/FiloFirmata
src/main/java/com/bortbort/arduino/FiloFirmata/Messages/SysexCapabilityMessage.java
SysexCapabilityMessage.getPinCapabilities
public ArrayList<PinCapability> getPinCapabilities(Integer pin) { if (pinCapabilities.size() >= pin) { return pinCapabilities.get(pin); } return null; }
java
public ArrayList<PinCapability> getPinCapabilities(Integer pin) { if (pinCapabilities.size() >= pin) { return pinCapabilities.get(pin); } return null; }
[ "public", "ArrayList", "<", "PinCapability", ">", "getPinCapabilities", "(", "Integer", "pin", ")", "{", "if", "(", "pinCapabilities", ".", "size", "(", ")", ">=", "pin", ")", "{", "return", "pinCapabilities", ".", "get", "(", "pin", ")", ";", "}", "retu...
Get Pin Capabilities Get a list of modes that a given pin supports. @param pin Integer value representing the Firmata pin that we want to know the supported capabilities of. @return ArrayList of PinCapability that the given pin index supports.\ Null if there is no pin at the given index.
[ "Get", "Pin", "Capabilities", "Get", "a", "list", "of", "modes", "that", "a", "given", "pin", "supports", "." ]
39c26c1a577b8fff8690245e105cb62e02284f16
https://github.com/reapzor/FiloFirmata/blob/39c26c1a577b8fff8690245e105cb62e02284f16/src/main/java/com/bortbort/arduino/FiloFirmata/Messages/SysexCapabilityMessage.java#L36-L41
40,626
reapzor/FiloFirmata
src/main/java/com/bortbort/arduino/FiloFirmata/Firmata.java
Firmata.addMessageListener
public void addMessageListener(Integer channel, MessageListener<? extends Message> messageListener) { addListener(channel, messageListener.getMessageType(), messageListener); }
java
public void addMessageListener(Integer channel, MessageListener<? extends Message> messageListener) { addListener(channel, messageListener.getMessageType(), messageListener); }
[ "public", "void", "addMessageListener", "(", "Integer", "channel", ",", "MessageListener", "<", "?", "extends", "Message", ">", "messageListener", ")", "{", "addListener", "(", "channel", ",", "messageListener", ".", "getMessageType", "(", ")", ",", "messageListen...
Add a messageListener to the Firmta object which will fire whenever a matching message is received over the SerialPort that corresponds to the given channel. @param channel Integer indicating the specific channel or pin to listen on @param messageListener MessageListener object to handle a received Message event over ...
[ "Add", "a", "messageListener", "to", "the", "Firmta", "object", "which", "will", "fire", "whenever", "a", "matching", "message", "is", "received", "over", "the", "SerialPort", "that", "corresponds", "to", "the", "given", "channel", "." ]
39c26c1a577b8fff8690245e105cb62e02284f16
https://github.com/reapzor/FiloFirmata/blob/39c26c1a577b8fff8690245e105cb62e02284f16/src/main/java/com/bortbort/arduino/FiloFirmata/Firmata.java#L174-L176
40,627
reapzor/FiloFirmata
src/main/java/com/bortbort/arduino/FiloFirmata/Firmata.java
Firmata.addMessageListener
public void addMessageListener(DigitalChannel channel, MessageListener<? extends Message> messageListener) { addListener(channel.getIdentifier(), messageListener.getMessageType(), messageListener); }
java
public void addMessageListener(DigitalChannel channel, MessageListener<? extends Message> messageListener) { addListener(channel.getIdentifier(), messageListener.getMessageType(), messageListener); }
[ "public", "void", "addMessageListener", "(", "DigitalChannel", "channel", ",", "MessageListener", "<", "?", "extends", "Message", ">", "messageListener", ")", "{", "addListener", "(", "channel", ".", "getIdentifier", "(", ")", ",", "messageListener", ".", "getMess...
Add a messageListener to the Firmata object which will fire whenever a matching message is received over the SerialPort that corresponds to the given DigitalChannel. @param channel DigitalChannel to listen on @param messageListener MessageListener object to handle a received Message event over the SerialPort.
[ "Add", "a", "messageListener", "to", "the", "Firmata", "object", "which", "will", "fire", "whenever", "a", "matching", "message", "is", "received", "over", "the", "SerialPort", "that", "corresponds", "to", "the", "given", "DigitalChannel", "." ]
39c26c1a577b8fff8690245e105cb62e02284f16
https://github.com/reapzor/FiloFirmata/blob/39c26c1a577b8fff8690245e105cb62e02284f16/src/main/java/com/bortbort/arduino/FiloFirmata/Firmata.java#L185-L187
40,628
reapzor/FiloFirmata
src/main/java/com/bortbort/arduino/FiloFirmata/Firmata.java
Firmata.addMessageListener
public void addMessageListener(Class<? extends Message> messageClass, MessageListener<Message> messageListener) { addMessageListener(messageListener.getChannelIdentifier(), messageClass, messageListener); }
java
public void addMessageListener(Class<? extends Message> messageClass, MessageListener<Message> messageListener) { addMessageListener(messageListener.getChannelIdentifier(), messageClass, messageListener); }
[ "public", "void", "addMessageListener", "(", "Class", "<", "?", "extends", "Message", ">", "messageClass", ",", "MessageListener", "<", "Message", ">", "messageListener", ")", "{", "addMessageListener", "(", "messageListener", ".", "getChannelIdentifier", "(", ")", ...
Add a generic message listener to listen for a specific type of message. Useful if you want to combine several or more message handlers into one bucket. @param messageClass Message class to listen to from the project board. @param messageListener (Generic)Listener that will fire whenever the message type is received.
[ "Add", "a", "generic", "message", "listener", "to", "listen", "for", "a", "specific", "type", "of", "message", ".", "Useful", "if", "you", "want", "to", "combine", "several", "or", "more", "message", "handlers", "into", "one", "bucket", "." ]
39c26c1a577b8fff8690245e105cb62e02284f16
https://github.com/reapzor/FiloFirmata/blob/39c26c1a577b8fff8690245e105cb62e02284f16/src/main/java/com/bortbort/arduino/FiloFirmata/Firmata.java#L195-L197
40,629
reapzor/FiloFirmata
src/main/java/com/bortbort/arduino/FiloFirmata/Firmata.java
Firmata.removeMessageListener
public void removeMessageListener(Class<? extends Message> messageClass, MessageListener<Message> messageListener) { removeMessageListener(messageListener.getChannelIdentifier(), messageClass, messageListener); }
java
public void removeMessageListener(Class<? extends Message> messageClass, MessageListener<Message> messageListener) { removeMessageListener(messageListener.getChannelIdentifier(), messageClass, messageListener); }
[ "public", "void", "removeMessageListener", "(", "Class", "<", "?", "extends", "Message", ">", "messageClass", ",", "MessageListener", "<", "Message", ">", "messageListener", ")", "{", "removeMessageListener", "(", "messageListener", ".", "getChannelIdentifier", "(", ...
Remove a generic message listener from listening to a specific type of message. @param messageClass Message class to stop listening to. @param messageListener (Generic)Listener to remove from the listener list for the given messageClass.
[ "Remove", "a", "generic", "message", "listener", "from", "listening", "to", "a", "specific", "type", "of", "message", "." ]
39c26c1a577b8fff8690245e105cb62e02284f16
https://github.com/reapzor/FiloFirmata/blob/39c26c1a577b8fff8690245e105cb62e02284f16/src/main/java/com/bortbort/arduino/FiloFirmata/Firmata.java#L268-L271
40,630
reapzor/FiloFirmata
src/main/java/com/bortbort/arduino/FiloFirmata/Firmata.java
Firmata.sendMessage
public synchronized Boolean sendMessage(TransmittableMessage message) { if (!start()) { log.error("Firmata library is not connected / started! Cannot send message {}", message.getClass().getSimpleName()); return false; } try { log.debug("T...
java
public synchronized Boolean sendMessage(TransmittableMessage message) { if (!start()) { log.error("Firmata library is not connected / started! Cannot send message {}", message.getClass().getSimpleName()); return false; } try { log.debug("T...
[ "public", "synchronized", "Boolean", "sendMessage", "(", "TransmittableMessage", "message", ")", "{", "if", "(", "!", "start", "(", ")", ")", "{", "log", ".", "error", "(", "\"Firmata library is not connected / started! Cannot send message {}\"", ",", "message", ".", ...
Send a Message over the serial port to a Firmata supported device. @param message TransmittableMessage object used to translate a series of bytes to the SerialPort. @return True if the Message sent. False if the Message was not sent.
[ "Send", "a", "Message", "over", "the", "serial", "port", "to", "a", "Firmata", "supported", "device", "." ]
39c26c1a577b8fff8690245e105cb62e02284f16
https://github.com/reapzor/FiloFirmata/blob/39c26c1a577b8fff8690245e105cb62e02284f16/src/main/java/com/bortbort/arduino/FiloFirmata/Firmata.java#L316-L334
40,631
reapzor/FiloFirmata
src/main/java/com/bortbort/arduino/FiloFirmata/Firmata.java
Firmata.sendRaw
public synchronized Boolean sendRaw(byte... rawBytes) { if (!start()) { log.error("Firmata library is not connected / started! Cannot send bytes {}", FirmataHelper.bytesToHexString(rawBytes)); return false; } try { serialPort.getOutputStre...
java
public synchronized Boolean sendRaw(byte... rawBytes) { if (!start()) { log.error("Firmata library is not connected / started! Cannot send bytes {}", FirmataHelper.bytesToHexString(rawBytes)); return false; } try { serialPort.getOutputStre...
[ "public", "synchronized", "Boolean", "sendRaw", "(", "byte", "...", "rawBytes", ")", "{", "if", "(", "!", "start", "(", ")", ")", "{", "log", ".", "error", "(", "\"Firmata library is not connected / started! Cannot send bytes {}\"", ",", "FirmataHelper", ".", "byt...
Send a series of raw bytes over the serial port to a Firmata supported device. @param rawBytes byte array to be sent over the SerialPort OutputStream. @return True if the bytes were sent. False if the bytes were not sent.
[ "Send", "a", "series", "of", "raw", "bytes", "over", "the", "serial", "port", "to", "a", "Firmata", "supported", "device", "." ]
39c26c1a577b8fff8690245e105cb62e02284f16
https://github.com/reapzor/FiloFirmata/blob/39c26c1a577b8fff8690245e105cb62e02284f16/src/main/java/com/bortbort/arduino/FiloFirmata/Firmata.java#L369-L386
40,632
reapzor/FiloFirmata
src/main/java/com/bortbort/arduino/FiloFirmata/Firmata.java
Firmata.start
public synchronized Boolean start() { if (started) { return true; } createSerialPort(); serialPort.addEventListener(this); if (!serialPort.connect()) { log.error("Failed to start Firmata Library. Cannot connect to Serial Port."); log.error("...
java
public synchronized Boolean start() { if (started) { return true; } createSerialPort(); serialPort.addEventListener(this); if (!serialPort.connect()) { log.error("Failed to start Firmata Library. Cannot connect to Serial Port."); log.error("...
[ "public", "synchronized", "Boolean", "start", "(", ")", "{", "if", "(", "started", ")", "{", "return", "true", ";", "}", "createSerialPort", "(", ")", ";", "serialPort", ".", "addEventListener", "(", "this", ")", ";", "if", "(", "!", "serialPort", ".", ...
Starts the firmata library. If the library is already started this will just return true. Starts the SerialPort and handlers, and ensures the attached device is able to communicate with our library. This will return an UnsupportedDevice exception if the attached device does not meet the library requirements. @return T...
[ "Starts", "the", "firmata", "library", ".", "If", "the", "library", "is", "already", "started", "this", "will", "just", "return", "true", ".", "Starts", "the", "SerialPort", "and", "handlers", "and", "ensures", "the", "attached", "device", "is", "able", "to"...
39c26c1a577b8fff8690245e105cb62e02284f16
https://github.com/reapzor/FiloFirmata/blob/39c26c1a577b8fff8690245e105cb62e02284f16/src/main/java/com/bortbort/arduino/FiloFirmata/Firmata.java#L398-L423
40,633
reapzor/FiloFirmata
src/main/java/com/bortbort/arduino/FiloFirmata/Firmata.java
Firmata.stop
public synchronized Boolean stop() { if (serialPort != null) { serialPort.removeEventListener(this); } if (!removeSerialPort()) { log.error("Failed to stop Firmata Library. Cannot close Serial Port."); log.error("Configuration is {}", configuration); ...
java
public synchronized Boolean stop() { if (serialPort != null) { serialPort.removeEventListener(this); } if (!removeSerialPort()) { log.error("Failed to stop Firmata Library. Cannot close Serial Port."); log.error("Configuration is {}", configuration); ...
[ "public", "synchronized", "Boolean", "stop", "(", ")", "{", "if", "(", "serialPort", "!=", "null", ")", "{", "serialPort", ".", "removeEventListener", "(", "this", ")", ";", "}", "if", "(", "!", "removeSerialPort", "(", ")", ")", "{", "log", ".", "erro...
Stops the Firmata library. If the library is already stopped, this will still attempt to stop anything that may still be lingering. Take note that many calls could eventually result in noticeable cpu usage. @return True if the library has stopped. False if there was an error stopping the library.
[ "Stops", "the", "Firmata", "library", ".", "If", "the", "library", "is", "already", "stopped", "this", "will", "still", "attempt", "to", "stop", "anything", "that", "may", "still", "be", "lingering", ".", "Take", "note", "that", "many", "calls", "could", "...
39c26c1a577b8fff8690245e105cb62e02284f16
https://github.com/reapzor/FiloFirmata/blob/39c26c1a577b8fff8690245e105cb62e02284f16/src/main/java/com/bortbort/arduino/FiloFirmata/Firmata.java#L431-L444
40,634
reapzor/FiloFirmata
src/main/java/com/bortbort/arduino/FiloFirmata/Firmata.java
Firmata.createSerialPort
private void createSerialPort() { Constructor<? extends SerialPort> constructor; try { constructor = configuration.getSerialPortAdapterClass().getDeclaredConstructor( String.class, Integer.class, SerialPortDataBits.class, SerialPortStopBits.class, Ser...
java
private void createSerialPort() { Constructor<? extends SerialPort> constructor; try { constructor = configuration.getSerialPortAdapterClass().getDeclaredConstructor( String.class, Integer.class, SerialPortDataBits.class, SerialPortStopBits.class, Ser...
[ "private", "void", "createSerialPort", "(", ")", "{", "Constructor", "<", "?", "extends", "SerialPort", ">", "constructor", ";", "try", "{", "constructor", "=", "configuration", ".", "getSerialPortAdapterClass", "(", ")", ".", "getDeclaredConstructor", "(", "Strin...
Generate the SerialPort object using the SerialPort adapter class provided in the FirmataConfiguration If there is any issue constructing this object, toss a RuntimeException, as this is a developer error in implementing the SerialPort adapter for this library.
[ "Generate", "the", "SerialPort", "object", "using", "the", "SerialPort", "adapter", "class", "provided", "in", "the", "FirmataConfiguration", "If", "there", "is", "any", "issue", "constructing", "this", "object", "toss", "a", "RuntimeException", "as", "this", "is"...
39c26c1a577b8fff8690245e105cb62e02284f16
https://github.com/reapzor/FiloFirmata/blob/39c26c1a577b8fff8690245e105cb62e02284f16/src/main/java/com/bortbort/arduino/FiloFirmata/Firmata.java#L499-L528
40,635
reapzor/FiloFirmata
src/main/java/com/bortbort/arduino/FiloFirmata/Firmata.java
Firmata.removeSerialPort
private Boolean removeSerialPort() { Boolean ret = true; if (serialPort != null) { ret = serialPort.disconnect(); serialPort = null; } return ret; }
java
private Boolean removeSerialPort() { Boolean ret = true; if (serialPort != null) { ret = serialPort.disconnect(); serialPort = null; } return ret; }
[ "private", "Boolean", "removeSerialPort", "(", ")", "{", "Boolean", "ret", "=", "true", ";", "if", "(", "serialPort", "!=", "null", ")", "{", "ret", "=", "serialPort", ".", "disconnect", "(", ")", ";", "serialPort", "=", "null", ";", "}", "return", "re...
Disconnect from the SerialPort object that we are communicating with over the Firmata protocol. @return True if the SerialPort was closed. False if the port failed to close.
[ "Disconnect", "from", "the", "SerialPort", "object", "that", "we", "are", "communicating", "with", "over", "the", "Firmata", "protocol", "." ]
39c26c1a577b8fff8690245e105cb62e02284f16
https://github.com/reapzor/FiloFirmata/blob/39c26c1a577b8fff8690245e105cb62e02284f16/src/main/java/com/bortbort/arduino/FiloFirmata/Firmata.java#L535-L544
40,636
reapzor/FiloFirmata
src/main/java/com/bortbort/arduino/FiloFirmata/Firmata.java
Firmata.handleDataAvailable
private void handleDataAvailable() { InputStream inputStream = serialPort.getInputStream(); try { while (inputStream.available() > 0) { byte inputByte = (byte) inputStream.read(); if (inputByte == -1) { log.error("Reached end of stream try...
java
private void handleDataAvailable() { InputStream inputStream = serialPort.getInputStream(); try { while (inputStream.available() > 0) { byte inputByte = (byte) inputStream.read(); if (inputByte == -1) { log.error("Reached end of stream try...
[ "private", "void", "handleDataAvailable", "(", ")", "{", "InputStream", "inputStream", "=", "serialPort", ".", "getInputStream", "(", ")", ";", "try", "{", "while", "(", "inputStream", ".", "available", "(", ")", ">", "0", ")", "{", "byte", "inputByte", "=...
Handles the SerialPort input stream and builds a message object if a detected CommandByte is discovered over the communications stream.
[ "Handles", "the", "SerialPort", "input", "stream", "and", "builds", "a", "message", "object", "if", "a", "detected", "CommandByte", "is", "discovered", "over", "the", "communications", "stream", "." ]
39c26c1a577b8fff8690245e105cb62e02284f16
https://github.com/reapzor/FiloFirmata/blob/39c26c1a577b8fff8690245e105cb62e02284f16/src/main/java/com/bortbort/arduino/FiloFirmata/Firmata.java#L564-L588
40,637
reapzor/FiloFirmata
src/main/java/com/bortbort/arduino/FiloFirmata/Firmata.java
Firmata.routeMessage
private void routeMessage(Message message) { Class messageClass = message.getClass(); // Dispatch message to all specific listeners for the message class type if (messageListenerMap.containsKey(messageClass)) { dispatchMessage(messageListenerMap.get(messageClass), message); ...
java
private void routeMessage(Message message) { Class messageClass = message.getClass(); // Dispatch message to all specific listeners for the message class type if (messageListenerMap.containsKey(messageClass)) { dispatchMessage(messageListenerMap.get(messageClass), message); ...
[ "private", "void", "routeMessage", "(", "Message", "message", ")", "{", "Class", "messageClass", "=", "message", ".", "getClass", "(", ")", ";", "// Dispatch message to all specific listeners for the message class type", "if", "(", "messageListenerMap", ".", "containsKey"...
Route a Message object built from data over the SerialPort communication line to a corresponding MessageListener array designed to handle and interpret the object for processing in the client code. @param message Firmata Message to be routed to the registered listeners.
[ "Route", "a", "Message", "object", "built", "from", "data", "over", "the", "SerialPort", "communication", "line", "to", "a", "corresponding", "MessageListener", "array", "designed", "to", "handle", "and", "interpret", "the", "object", "for", "processing", "in", ...
39c26c1a577b8fff8690245e105cb62e02284f16
https://github.com/reapzor/FiloFirmata/blob/39c26c1a577b8fff8690245e105cb62e02284f16/src/main/java/com/bortbort/arduino/FiloFirmata/Firmata.java#L596-L608
40,638
reapzor/FiloFirmata
src/main/java/com/bortbort/arduino/FiloFirmata/Firmata.java
Firmata.dispatchMessage
@SuppressWarnings("unchecked") private void dispatchMessage(ArrayListMultimap<Integer, MessageListener> listenerMap, Message message) { List<MessageListener> messageListeners; // If the message is a Channel Message, hit the channel based listeners first. if (message instanceof ChannelMessag...
java
@SuppressWarnings("unchecked") private void dispatchMessage(ArrayListMultimap<Integer, MessageListener> listenerMap, Message message) { List<MessageListener> messageListeners; // If the message is a Channel Message, hit the channel based listeners first. if (message instanceof ChannelMessag...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "void", "dispatchMessage", "(", "ArrayListMultimap", "<", "Integer", ",", "MessageListener", ">", "listenerMap", ",", "Message", "message", ")", "{", "List", "<", "MessageListener", ">", "messageListener...
Dispatch a message to the corresponding listener arrays in the listener map @param listenerMap ArrayListMultimap of listener arrays to dispatch the message to @param message Message to be dispatched to the listeners
[ "Dispatch", "a", "message", "to", "the", "corresponding", "listener", "arrays", "in", "the", "listener", "map" ]
39c26c1a577b8fff8690245e105cb62e02284f16
https://github.com/reapzor/FiloFirmata/blob/39c26c1a577b8fff8690245e105cb62e02284f16/src/main/java/com/bortbort/arduino/FiloFirmata/Firmata.java#L615-L637
40,639
reapzor/FiloFirmata
src/main/java/com/bortbort/arduino/FiloFirmata/Parser/CommandParser.java
CommandParser.handleInputStream
public Message handleInputStream(byte commandByte, InputStream inputStream) { // Firmata command bytes are limited to a 0xF0 mask, or bytes 0xF0-0xFF // The extra data in the byte is for routing the command to various 'midi channels' // or in our case Firmata device pins. byte firmat...
java
public Message handleInputStream(byte commandByte, InputStream inputStream) { // Firmata command bytes are limited to a 0xF0 mask, or bytes 0xF0-0xFF // The extra data in the byte is for routing the command to various 'midi channels' // or in our case Firmata device pins. byte firmat...
[ "public", "Message", "handleInputStream", "(", "byte", "commandByte", ",", "InputStream", "inputStream", ")", "{", "// Firmata command bytes are limited to a 0xF0 mask, or bytes 0xF0-0xFF", "// The extra data in the byte is for routing the command to various 'midi channels'", "// or in...
Attempts to identify the corresponding Firmata Message object that responds to the given commandByte If found, it will ask for the message to be built using given inputStream. The builder will take away any bytes necessary to build the message and then return. To attempt to identify the correct message we must mask the...
[ "Attempts", "to", "identify", "the", "corresponding", "Firmata", "Message", "object", "that", "responds", "to", "the", "given", "commandByte", "If", "found", "it", "will", "ask", "for", "the", "message", "to", "be", "built", "using", "given", "inputStream", "....
39c26c1a577b8fff8690245e105cb62e02284f16
https://github.com/reapzor/FiloFirmata/blob/39c26c1a577b8fff8690245e105cb62e02284f16/src/main/java/com/bortbort/arduino/FiloFirmata/Parser/CommandParser.java#L126-L147
40,640
reapzor/FiloFirmata
src/main/java/com/bortbort/arduino/FiloFirmata/SynchronousMessageListener.java
SynchronousMessageListener.messageReceived
@Override public void messageReceived(T message) { if (responseReceived != null) { if (responseReceived) { log.warn("Received more than one synchronous message reply!"); } else { log.warn("Received response message after timeout was hit!");...
java
@Override public void messageReceived(T message) { if (responseReceived != null) { if (responseReceived) { log.warn("Received more than one synchronous message reply!"); } else { log.warn("Received response message after timeout was hit!");...
[ "@", "Override", "public", "void", "messageReceived", "(", "T", "message", ")", "{", "if", "(", "responseReceived", "!=", "null", ")", "{", "if", "(", "responseReceived", ")", "{", "log", ".", "warn", "(", "\"Received more than one synchronous message reply!\"", ...
When we get our expected message response. Save the message object, and notify the waiting thread that the message is now available to be passed back. This method attempts to handle and warn against cases where multiple messages came in, or a message came in after the timeout period. @param message Message response fro...
[ "When", "we", "get", "our", "expected", "message", "response", ".", "Save", "the", "message", "object", "and", "notify", "the", "waiting", "thread", "that", "the", "message", "is", "now", "available", "to", "be", "passed", "back", ".", "This", "method", "a...
39c26c1a577b8fff8690245e105cb62e02284f16
https://github.com/reapzor/FiloFirmata/blob/39c26c1a577b8fff8690245e105cb62e02284f16/src/main/java/com/bortbort/arduino/FiloFirmata/SynchronousMessageListener.java#L35-L52
40,641
reapzor/FiloFirmata
src/main/java/com/bortbort/arduino/FiloFirmata/Parser/SysexCommandParser.java
SysexCommandParser.buildMessage
@Override public Message buildMessage(Byte channelByte, InputStream inputStream) { byte sysexCommandByte; try { sysexCommandByte = (byte) inputStream.read(); } catch (IOException e) { log.error("Error reading Sysex command byte."); return null; } ...
java
@Override public Message buildMessage(Byte channelByte, InputStream inputStream) { byte sysexCommandByte; try { sysexCommandByte = (byte) inputStream.read(); } catch (IOException e) { log.error("Error reading Sysex command byte."); return null; } ...
[ "@", "Override", "public", "Message", "buildMessage", "(", "Byte", "channelByte", ",", "InputStream", "inputStream", ")", "{", "byte", "sysexCommandByte", ";", "try", "{", "sysexCommandByte", "=", "(", "byte", ")", "inputStream", ".", "read", "(", ")", ";", ...
Attempts to identify the corresponding Firmata Sysex Message object that responds to the identified sysexCommandByte. If found, it will ask for the sysex message to be built using the identified bytes between the sysexCommandByte and the END_SYSEX commandByte later in the input stream. @param channelByte channelByte i...
[ "Attempts", "to", "identify", "the", "corresponding", "Firmata", "Sysex", "Message", "object", "that", "responds", "to", "the", "identified", "sysexCommandByte", ".", "If", "found", "it", "will", "ask", "for", "the", "sysex", "message", "to", "be", "built", "u...
39c26c1a577b8fff8690245e105cb62e02284f16
https://github.com/reapzor/FiloFirmata/blob/39c26c1a577b8fff8690245e105cb62e02284f16/src/main/java/com/bortbort/arduino/FiloFirmata/Parser/SysexCommandParser.java#L106-L148
40,642
StripesFramework/stripes-xss
src/main/java/com/samaxes/stripes/xss/SafeHtmlUtil.java
SafeHtmlUtil.sanitize
public static String sanitize(String raw) { return (raw == null || raw.length() == 0) ? raw : HTMLEntityEncode(canonicalize(raw)); }
java
public static String sanitize(String raw) { return (raw == null || raw.length() == 0) ? raw : HTMLEntityEncode(canonicalize(raw)); }
[ "public", "static", "String", "sanitize", "(", "String", "raw", ")", "{", "return", "(", "raw", "==", "null", "||", "raw", ".", "length", "(", ")", "==", "0", ")", "?", "raw", ":", "HTMLEntityEncode", "(", "canonicalize", "(", "raw", ")", ")", ";", ...
Sanitize user inputs. @param raw the input string to be sanitized @return the sanitized string
[ "Sanitize", "user", "inputs", "." ]
f78ba9eaa2a6cb4fc287dd3a250b9daaafc07ea6
https://github.com/StripesFramework/stripes-xss/blob/f78ba9eaa2a6cb4fc287dd3a250b9daaafc07ea6/src/main/java/com/samaxes/stripes/xss/SafeHtmlUtil.java#L40-L42
40,643
StripesFramework/stripes-xss
src/main/java/com/samaxes/stripes/xss/SafeHtmlUtil.java
SafeHtmlUtil.HTMLEntityEncode
public static String HTMLEntityEncode(String input) { String next = scriptPattern.matcher(input).replaceAll("&#x73;cript"); StringBuffer sb = new StringBuffer(); for (int i = 0; i < next.length(); ++i) { char ch = next.charAt(i); if (ch == '<') { sb.appe...
java
public static String HTMLEntityEncode(String input) { String next = scriptPattern.matcher(input).replaceAll("&#x73;cript"); StringBuffer sb = new StringBuffer(); for (int i = 0; i < next.length(); ++i) { char ch = next.charAt(i); if (ch == '<') { sb.appe...
[ "public", "static", "String", "HTMLEntityEncode", "(", "String", "input", ")", "{", "String", "next", "=", "scriptPattern", ".", "matcher", "(", "input", ")", ".", "replaceAll", "(", "\"&#x73;cript\"", ")", ";", "StringBuffer", "sb", "=", "new", "StringBuffer"...
Encode HTML entities. @param input the input string to be encoded @return the encoded string
[ "Encode", "HTML", "entities", "." ]
f78ba9eaa2a6cb4fc287dd3a250b9daaafc07ea6
https://github.com/StripesFramework/stripes-xss/blob/f78ba9eaa2a6cb4fc287dd3a250b9daaafc07ea6/src/main/java/com/samaxes/stripes/xss/SafeHtmlUtil.java#L50-L67
40,644
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/io/connection/impl/DefaultConnectionOutputBatch.java
DefaultConnectionOutputBatch.checkEnd
private void checkEnd() { if (ended && !closed && children == 0) { closed = true; connection.doBatchEnd(id, endArgs); if (endHandler != null) { endHandler.handle((Void) null); } } }
java
private void checkEnd() { if (ended && !closed && children == 0) { closed = true; connection.doBatchEnd(id, endArgs); if (endHandler != null) { endHandler.handle((Void) null); } } }
[ "private", "void", "checkEnd", "(", ")", "{", "if", "(", "ended", "&&", "!", "closed", "&&", "children", "==", "0", ")", "{", "closed", "=", "true", ";", "connection", ".", "doBatchEnd", "(", "id", ",", "endArgs", ")", ";", "if", "(", "endHandler", ...
Checks whether the batch is complete.
[ "Checks", "whether", "the", "batch", "is", "complete", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/io/connection/impl/DefaultConnectionOutputBatch.java#L127-L135
40,645
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/io/connection/impl/DefaultConnectionOutputBatch.java
DefaultConnectionOutputBatch.start
void start(Handler<ConnectionOutputBatch> startHandler) { connection.doBatchStart(id, args); this.startHandler = startHandler; }
java
void start(Handler<ConnectionOutputBatch> startHandler) { connection.doBatchStart(id, args); this.startHandler = startHandler; }
[ "void", "start", "(", "Handler", "<", "ConnectionOutputBatch", ">", "startHandler", ")", "{", "connection", ".", "doBatchStart", "(", "id", ",", "args", ")", ";", "this", ".", "startHandler", "=", "startHandler", ";", "}" ]
Starts the output batch.
[ "Starts", "the", "output", "batch", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/io/connection/impl/DefaultConnectionOutputBatch.java#L147-L150
40,646
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/platform/ModuleFields.java
ModuleFields.getInPorts
public List<String> getInPorts() { List<String> ports = new ArrayList<>(); JsonObject jsonPorts = config.getObject("ports"); if (jsonPorts == null) { return ports; } JsonArray jsonInPorts = jsonPorts.getArray("in"); if (jsonInPorts == null) { return ports; } for (Object jsonI...
java
public List<String> getInPorts() { List<String> ports = new ArrayList<>(); JsonObject jsonPorts = config.getObject("ports"); if (jsonPorts == null) { return ports; } JsonArray jsonInPorts = jsonPorts.getArray("in"); if (jsonInPorts == null) { return ports; } for (Object jsonI...
[ "public", "List", "<", "String", ">", "getInPorts", "(", ")", "{", "List", "<", "String", ">", "ports", "=", "new", "ArrayList", "<>", "(", ")", ";", "JsonObject", "jsonPorts", "=", "config", ".", "getObject", "(", "\"ports\"", ")", ";", "if", "(", "...
Returns a list of input ports defined by the module. @return A list of input ports defined by the module.
[ "Returns", "a", "list", "of", "input", "ports", "defined", "by", "the", "module", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/platform/ModuleFields.java#L52-L66
40,647
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/platform/ModuleFields.java
ModuleFields.getOutPorts
public List<String> getOutPorts() { List<String> ports = new ArrayList<>(); JsonObject jsonPorts = config.getObject("ports"); if (jsonPorts == null) { return ports; } JsonArray jsonOutPorts = jsonPorts.getArray("out"); if (jsonOutPorts == null) { return ports; } for(Object js...
java
public List<String> getOutPorts() { List<String> ports = new ArrayList<>(); JsonObject jsonPorts = config.getObject("ports"); if (jsonPorts == null) { return ports; } JsonArray jsonOutPorts = jsonPorts.getArray("out"); if (jsonOutPorts == null) { return ports; } for(Object js...
[ "public", "List", "<", "String", ">", "getOutPorts", "(", ")", "{", "List", "<", "String", ">", "ports", "=", "new", "ArrayList", "<>", "(", ")", ";", "JsonObject", "jsonPorts", "=", "config", ".", "getObject", "(", "\"ports\"", ")", ";", "if", "(", ...
Returns a list of output ports defined by the module. @return A list of output ports defined by the module.
[ "Returns", "a", "list", "of", "output", "ports", "defined", "by", "the", "module", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/platform/ModuleFields.java#L73-L87
40,648
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/util/CountingCompletionHandler.java
CountingCompletionHandler.fail
public void fail(Throwable t) { if (!failed) { if (doneHandler != null) { doneHandler.handle(new DefaultFutureResult<T>(t)); } else { cause = t; } failed = true; } }
java
public void fail(Throwable t) { if (!failed) { if (doneHandler != null) { doneHandler.handle(new DefaultFutureResult<T>(t)); } else { cause = t; } failed = true; } }
[ "public", "void", "fail", "(", "Throwable", "t", ")", "{", "if", "(", "!", "failed", ")", "{", "if", "(", "doneHandler", "!=", "null", ")", "{", "doneHandler", ".", "handle", "(", "new", "DefaultFutureResult", "<", "T", ">", "(", "t", ")", ")", ";"...
Indicates that a call failed. This will immediately fail the handler. @param t The cause of the failure.
[ "Indicates", "that", "a", "call", "failed", ".", "This", "will", "immediately", "fail", "the", "handler", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/util/CountingCompletionHandler.java#L61-L70
40,649
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/util/CountingCompletionHandler.java
CountingCompletionHandler.setHandler
public CountingCompletionHandler<T> setHandler(Handler<AsyncResult<T>> doneHandler) { this.doneHandler = doneHandler; checkDone(); return this; }
java
public CountingCompletionHandler<T> setHandler(Handler<AsyncResult<T>> doneHandler) { this.doneHandler = doneHandler; checkDone(); return this; }
[ "public", "CountingCompletionHandler", "<", "T", ">", "setHandler", "(", "Handler", "<", "AsyncResult", "<", "T", ">", ">", "doneHandler", ")", "{", "this", ".", "doneHandler", "=", "doneHandler", ";", "checkDone", "(", ")", ";", "return", "this", ";", "}"...
Sets the completion handler. @param doneHandler An asynchronous handler to be called once all calls have completed.
[ "Sets", "the", "completion", "handler", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/util/CountingCompletionHandler.java#L77-L81
40,650
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/util/CountingCompletionHandler.java
CountingCompletionHandler.checkDone
private void checkDone() { if (doneHandler != null) { if (cause != null) { doneHandler.handle(new DefaultFutureResult<T>(cause)); } else { if (count == required) { doneHandler.handle(new DefaultFutureResult<T>((T) null)); } } } }
java
private void checkDone() { if (doneHandler != null) { if (cause != null) { doneHandler.handle(new DefaultFutureResult<T>(cause)); } else { if (count == required) { doneHandler.handle(new DefaultFutureResult<T>((T) null)); } } } }
[ "private", "void", "checkDone", "(", ")", "{", "if", "(", "doneHandler", "!=", "null", ")", "{", "if", "(", "cause", "!=", "null", ")", "{", "doneHandler", ".", "handle", "(", "new", "DefaultFutureResult", "<", "T", ">", "(", "cause", ")", ")", ";", ...
Checks whether the handler should be called.
[ "Checks", "whether", "the", "handler", "should", "be", "called", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/util/CountingCompletionHandler.java#L86-L96
40,651
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/component/impl/DefaultComponent.java
DefaultComponent.setup
private void setup(final Handler<AsyncResult<Void>> doneHandler) { // Retrieve the component context from the coordinator (the current cluster). // If the context has changed due to a network configuration change, the // internal context and input/output connections will be automatically updated. log.de...
java
private void setup(final Handler<AsyncResult<Void>> doneHandler) { // Retrieve the component context from the coordinator (the current cluster). // If the context has changed due to a network configuration change, the // internal context and input/output connections will be automatically updated. log.de...
[ "private", "void", "setup", "(", "final", "Handler", "<", "AsyncResult", "<", "Void", ">", ">", "doneHandler", ")", "{", "// Retrieve the component context from the coordinator (the current cluster).", "// If the context has changed due to a network configuration change, the", "// ...
Sets up the component.
[ "Sets", "up", "the", "component", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/component/impl/DefaultComponent.java#L113-L186
40,652
kuujo/vertigo
util/src/main/java/net/kuujo/vertigo/io/Pump.java
Pump.start
public void start() { input.messageHandler(new Handler<Object>() { @Override public void handle(Object message) { output.send(message); pumped++; } }); }
java
public void start() { input.messageHandler(new Handler<Object>() { @Override public void handle(Object message) { output.send(message); pumped++; } }); }
[ "public", "void", "start", "(", ")", "{", "input", ".", "messageHandler", "(", "new", "Handler", "<", "Object", ">", "(", ")", "{", "@", "Override", "public", "void", "handle", "(", "Object", "message", ")", "{", "output", ".", "send", "(", "message", ...
Starts the pump.
[ "Starts", "the", "pump", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/util/src/main/java/net/kuujo/vertigo/io/Pump.java#L58-L66
40,653
kuujo/vertigo
util/src/main/java/net/kuujo/vertigo/io/Feeder.java
Feeder.createFeeder
public static <T extends Output<T>> Feeder<T> createFeeder(T output) { return new Feeder<T>(output); }
java
public static <T extends Output<T>> Feeder<T> createFeeder(T output) { return new Feeder<T>(output); }
[ "public", "static", "<", "T", "extends", "Output", "<", "T", ">", ">", "Feeder", "<", "T", ">", "createFeeder", "(", "T", "output", ")", "{", "return", "new", "Feeder", "<", "T", ">", "(", "output", ")", ";", "}" ]
Creates a new feeder. @param output The output to which to feed messages. @return A new feeder.
[ "Creates", "a", "new", "feeder", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/util/src/main/java/net/kuujo/vertigo/io/Feeder.java#L63-L65
40,654
kuujo/vertigo
util/src/main/java/net/kuujo/vertigo/io/Feeder.java
Feeder.doFeed
private void doFeed() { if (fed && !output.sendQueueFull()) { fed = false; vertx.runOnContext(feedRunner); } else { feedTimer = vertx.setTimer(feedDelay, recursiveRunner); } }
java
private void doFeed() { if (fed && !output.sendQueueFull()) { fed = false; vertx.runOnContext(feedRunner); } else { feedTimer = vertx.setTimer(feedDelay, recursiveRunner); } }
[ "private", "void", "doFeed", "(", ")", "{", "if", "(", "fed", "&&", "!", "output", ".", "sendQueueFull", "(", ")", ")", "{", "fed", "=", "false", ";", "vertx", ".", "runOnContext", "(", "feedRunner", ")", ";", "}", "else", "{", "feedTimer", "=", "v...
Feeds the next message.
[ "Feeds", "the", "next", "message", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/util/src/main/java/net/kuujo/vertigo/io/Feeder.java#L115-L122
40,655
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/util/Components.java
Components.createComponent
public static Component createComponent(Vertx vertx, Container container) { InstanceContext context = parseContext(container.config()); return new DefaultComponentFactory().setVertx(vertx).setContainer(container).createComponent(context, new DefaultCluster(context.component().network().cluster(), vertx, contain...
java
public static Component createComponent(Vertx vertx, Container container) { InstanceContext context = parseContext(container.config()); return new DefaultComponentFactory().setVertx(vertx).setContainer(container).createComponent(context, new DefaultCluster(context.component().network().cluster(), vertx, contain...
[ "public", "static", "Component", "createComponent", "(", "Vertx", "vertx", ",", "Container", "container", ")", "{", "InstanceContext", "context", "=", "parseContext", "(", "container", ".", "config", "(", ")", ")", ";", "return", "new", "DefaultComponentFactory", ...
Creates a component instance for the current Vert.x instance.
[ "Creates", "a", "component", "instance", "for", "the", "current", "Vert", ".", "x", "instance", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/util/Components.java#L74-L77
40,656
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/util/Components.java
Components.buildConfig
public static JsonObject buildConfig(InstanceContext context, Cluster cluster) { JsonObject config = context.component().config().copy(); return config.putObject("__context__", Contexts.serialize(context)); }
java
public static JsonObject buildConfig(InstanceContext context, Cluster cluster) { JsonObject config = context.component().config().copy(); return config.putObject("__context__", Contexts.serialize(context)); }
[ "public", "static", "JsonObject", "buildConfig", "(", "InstanceContext", "context", ",", "Cluster", "cluster", ")", "{", "JsonObject", "config", "=", "context", ".", "component", "(", ")", ".", "config", "(", ")", ".", "copy", "(", ")", ";", "return", "con...
Builds a verticle configuration. @param context The verticle context. @return A verticle configuration.
[ "Builds", "a", "verticle", "configuration", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/util/Components.java#L85-L88
40,657
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/util/Components.java
Components.parseContext
private static InstanceContext parseContext(JsonObject config) { JsonObject context = config.getObject("__context__"); if (context == null) { throw new IllegalArgumentException("No component context found."); } config.removeField("__context__"); return Contexts.deserialize(context); }
java
private static InstanceContext parseContext(JsonObject config) { JsonObject context = config.getObject("__context__"); if (context == null) { throw new IllegalArgumentException("No component context found."); } config.removeField("__context__"); return Contexts.deserialize(context); }
[ "private", "static", "InstanceContext", "parseContext", "(", "JsonObject", "config", ")", "{", "JsonObject", "context", "=", "config", ".", "getObject", "(", "\"__context__\"", ")", ";", "if", "(", "context", "==", "null", ")", "{", "throw", "new", "IllegalArg...
Parses an instance context from configuration. @param config The verticle configuration. @return The verticle context.
[ "Parses", "an", "instance", "context", "from", "configuration", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/util/Components.java#L96-L103
40,658
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/platform/impl/DefaultPlatformManager.java
DefaultPlatformManager.locateModules
private List<File> locateModules() { File[] files = modRoot.listFiles(); List<File> modFiles = new ArrayList<>(); for (File file : files) { if (file.isDirectory()) { // Check to determine whether the directory is a valid module directory. boolean isValid = true; try { ...
java
private List<File> locateModules() { File[] files = modRoot.listFiles(); List<File> modFiles = new ArrayList<>(); for (File file : files) { if (file.isDirectory()) { // Check to determine whether the directory is a valid module directory. boolean isValid = true; try { ...
[ "private", "List", "<", "File", ">", "locateModules", "(", ")", "{", "File", "[", "]", "files", "=", "modRoot", ".", "listFiles", "(", ")", ";", "List", "<", "File", ">", "modFiles", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "File",...
Locates all modules in the local repository.
[ "Locates", "all", "modules", "in", "the", "local", "repository", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/platform/impl/DefaultPlatformManager.java#L206-L229
40,659
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/platform/impl/DefaultPlatformManager.java
DefaultPlatformManager.locateModule
private File locateModule(ModuleIdentifier modID) { File modDir = new File(modRoot, modID.toString()); if (modDir.exists()) { return modDir; } return null; }
java
private File locateModule(ModuleIdentifier modID) { File modDir = new File(modRoot, modID.toString()); if (modDir.exists()) { return modDir; } return null; }
[ "private", "File", "locateModule", "(", "ModuleIdentifier", "modID", ")", "{", "File", "modDir", "=", "new", "File", "(", "modRoot", ",", "modID", ".", "toString", "(", ")", ")", ";", "if", "(", "modDir", ".", "exists", "(", ")", ")", "{", "return", ...
Locates a module in the modules root directory.
[ "Locates", "a", "module", "in", "the", "modules", "root", "directory", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/platform/impl/DefaultPlatformManager.java#L234-L240
40,660
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/platform/impl/DefaultPlatformManager.java
DefaultPlatformManager.pullInDependencies
private void pullInDependencies(ModuleIdentifier modID, File modDir) { // Load the module configuration file. File modJsonFile = new File(modDir, MOD_JSON_FILE); ModuleInfo info = loadModuleInfo(modID, modJsonFile); // Pull in all dependencies according to the "includes" and "deploys" fields. Modul...
java
private void pullInDependencies(ModuleIdentifier modID, File modDir) { // Load the module configuration file. File modJsonFile = new File(modDir, MOD_JSON_FILE); ModuleInfo info = loadModuleInfo(modID, modJsonFile); // Pull in all dependencies according to the "includes" and "deploys" fields. Modul...
[ "private", "void", "pullInDependencies", "(", "ModuleIdentifier", "modID", ",", "File", "modDir", ")", "{", "// Load the module configuration file.", "File", "modJsonFile", "=", "new", "File", "(", "modDir", ",", "MOD_JSON_FILE", ")", ";", "ModuleInfo", "info", "=",...
Pulls in all dependencies for a module.
[ "Pulls", "in", "all", "dependencies", "for", "a", "module", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/platform/impl/DefaultPlatformManager.java#L267-L319
40,661
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/platform/impl/DefaultPlatformManager.java
DefaultPlatformManager.zipModule
private File zipModule(ModuleIdentifier modID) { File modDir = new File(modRoot, modID.toString()); if (!modDir.exists()) { throw new PlatformManagerException("Cannot find module"); } // Create a temporary directory in which to store the module and its dependencies. File modRoot = new File(TE...
java
private File zipModule(ModuleIdentifier modID) { File modDir = new File(modRoot, modID.toString()); if (!modDir.exists()) { throw new PlatformManagerException("Cannot find module"); } // Create a temporary directory in which to store the module and its dependencies. File modRoot = new File(TE...
[ "private", "File", "zipModule", "(", "ModuleIdentifier", "modID", ")", "{", "File", "modDir", "=", "new", "File", "(", "modRoot", ",", "modID", ".", "toString", "(", ")", ")", ";", "if", "(", "!", "modDir", ".", "exists", "(", ")", ")", "{", "throw",...
Creates a zip file from a module.
[ "Creates", "a", "zip", "file", "from", "a", "module", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/platform/impl/DefaultPlatformManager.java#L324-L359
40,662
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/platform/impl/DefaultPlatformManager.java
DefaultPlatformManager.zipDirectory
private void zipDirectory(String zipFile, String dirToZip) { File directory = new File(dirToZip); try (ZipOutputStream stream = new ZipOutputStream(new FileOutputStream(zipFile))) { addDirectoryToZip(directory, directory, stream); } catch (Exception e) { throw new PlatformManagerException("Faile...
java
private void zipDirectory(String zipFile, String dirToZip) { File directory = new File(dirToZip); try (ZipOutputStream stream = new ZipOutputStream(new FileOutputStream(zipFile))) { addDirectoryToZip(directory, directory, stream); } catch (Exception e) { throw new PlatformManagerException("Faile...
[ "private", "void", "zipDirectory", "(", "String", "zipFile", ",", "String", "dirToZip", ")", "{", "File", "directory", "=", "new", "File", "(", "dirToZip", ")", ";", "try", "(", "ZipOutputStream", "stream", "=", "new", "ZipOutputStream", "(", "new", "FileOut...
Zips up a directory.
[ "Zips", "up", "a", "directory", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/platform/impl/DefaultPlatformManager.java#L364-L371
40,663
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/platform/impl/DefaultPlatformManager.java
DefaultPlatformManager.addDirectoryToZip
private void addDirectoryToZip(File topDirectory, File directory, ZipOutputStream out) throws IOException { Path top = Paths.get(topDirectory.getAbsolutePath()); File[] files = directory.listFiles(); byte[] buffer = new byte[BUFFER_SIZE]; for (int i = 0; i < files.length; i++) { Path entry = Pat...
java
private void addDirectoryToZip(File topDirectory, File directory, ZipOutputStream out) throws IOException { Path top = Paths.get(topDirectory.getAbsolutePath()); File[] files = directory.listFiles(); byte[] buffer = new byte[BUFFER_SIZE]; for (int i = 0; i < files.length; i++) { Path entry = Pat...
[ "private", "void", "addDirectoryToZip", "(", "File", "topDirectory", ",", "File", "directory", ",", "ZipOutputStream", "out", ")", "throws", "IOException", "{", "Path", "top", "=", "Paths", ".", "get", "(", "topDirectory", ".", "getAbsolutePath", "(", ")", ")"...
Recursively adds directories to a zip file.
[ "Recursively", "adds", "directories", "to", "a", "zip", "file", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/platform/impl/DefaultPlatformManager.java#L376-L406
40,664
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/platform/impl/DefaultPlatformManager.java
DefaultPlatformManager.parseIncludes
private String[] parseIncludes(String sincludes) { sincludes = sincludes.trim(); if ("".equals(sincludes)) { return null; } String[] arr = sincludes.split(","); if (arr != null) { for (int i = 0; i < arr.length; i++) { arr[i] = arr[i].trim(); } } return arr; }
java
private String[] parseIncludes(String sincludes) { sincludes = sincludes.trim(); if ("".equals(sincludes)) { return null; } String[] arr = sincludes.split(","); if (arr != null) { for (int i = 0; i < arr.length; i++) { arr[i] = arr[i].trim(); } } return arr; }
[ "private", "String", "[", "]", "parseIncludes", "(", "String", "sincludes", ")", "{", "sincludes", "=", "sincludes", ".", "trim", "(", ")", ";", "if", "(", "\"\"", ".", "equals", "(", "sincludes", ")", ")", "{", "return", "null", ";", "}", "String", ...
Parses an includes string.
[ "Parses", "an", "includes", "string", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/platform/impl/DefaultPlatformManager.java#L411-L423
40,665
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/platform/impl/DefaultPlatformManager.java
DefaultPlatformManager.unzipModuleData
private void unzipModuleData(File directory, File zipFile, boolean deleteZip) { try (InputStream in = new BufferedInputStream(new FileInputStream(zipFile)); ZipInputStream zin = new ZipInputStream(new BufferedInputStream(in))) { ZipEntry entry; while ((entry = zin.getNextEntry()) != null) { Stri...
java
private void unzipModuleData(File directory, File zipFile, boolean deleteZip) { try (InputStream in = new BufferedInputStream(new FileInputStream(zipFile)); ZipInputStream zin = new ZipInputStream(new BufferedInputStream(in))) { ZipEntry entry; while ((entry = zin.getNextEntry()) != null) { Stri...
[ "private", "void", "unzipModuleData", "(", "File", "directory", ",", "File", "zipFile", ",", "boolean", "deleteZip", ")", "{", "try", "(", "InputStream", "in", "=", "new", "BufferedInputStream", "(", "new", "FileInputStream", "(", "zipFile", ")", ")", ";", "...
Unzips a module.
[ "Unzips", "a", "module", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/platform/impl/DefaultPlatformManager.java#L436-L475
40,666
lordcodes/SnackbarBuilder
snackbarbuilder/src/main/java/com/github/andrewlord1990/snackbarbuilder/toastbuilder/ToastBuilder.java
ToastBuilder.build
@SuppressLint("ShowToast") public Toast build() { Toast toast = Toast.makeText(context, message, duration); TextView toastMessage = setupToastView(toast); setToastMessageTextColor(toastMessage); setToastGravity(toast); return toast; }
java
@SuppressLint("ShowToast") public Toast build() { Toast toast = Toast.makeText(context, message, duration); TextView toastMessage = setupToastView(toast); setToastMessageTextColor(toastMessage); setToastGravity(toast); return toast; }
[ "@", "SuppressLint", "(", "\"ShowToast\"", ")", "public", "Toast", "build", "(", ")", "{", "Toast", "toast", "=", "Toast", ".", "makeText", "(", "context", ",", "message", ",", "duration", ")", ";", "TextView", "toastMessage", "=", "setupToastView", "(", "...
Build a Toast using the options specified in the builder. @return The constructed Toast.
[ "Build", "a", "Toast", "using", "the", "options", "specified", "in", "the", "builder", "." ]
a104a753c78ed66940c19d295e141a521cf81d73
https://github.com/lordcodes/SnackbarBuilder/blob/a104a753c78ed66940c19d295e141a521cf81d73/snackbarbuilder/src/main/java/com/github/andrewlord1990/snackbarbuilder/toastbuilder/ToastBuilder.java#L174-L183
40,667
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java
NetworkManager.handleCreate
private void handleCreate(final NetworkContext context) { log.debug(String.format("%s - Network configuration created in cluster: %s", NetworkManager.this, cluster.address())); log.debug(String.format("%s - Scheduling network deployment task", NetworkManager.this)); tasks.runTask(new Handler<Task>() { ...
java
private void handleCreate(final NetworkContext context) { log.debug(String.format("%s - Network configuration created in cluster: %s", NetworkManager.this, cluster.address())); log.debug(String.format("%s - Scheduling network deployment task", NetworkManager.this)); tasks.runTask(new Handler<Task>() { ...
[ "private", "void", "handleCreate", "(", "final", "NetworkContext", "context", ")", "{", "log", ".", "debug", "(", "String", ".", "format", "(", "\"%s - Network configuration created in cluster: %s\"", ",", "NetworkManager", ".", "this", ",", "cluster", ".", "address...
Handles the creation of the network.
[ "Handles", "the", "creation", "of", "the", "network", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java#L255-L288
40,668
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java
NetworkManager.undeployRemovedComponents
private void undeployRemovedComponents(final NetworkContext context, final NetworkContext runningContext, final Handler<AsyncResult<Void>> doneHandler) { // Undeploy any components that were removed from the network. final List<ComponentContext<?>> removedComponents = new ArrayList<>(); for (ComponentContex...
java
private void undeployRemovedComponents(final NetworkContext context, final NetworkContext runningContext, final Handler<AsyncResult<Void>> doneHandler) { // Undeploy any components that were removed from the network. final List<ComponentContext<?>> removedComponents = new ArrayList<>(); for (ComponentContex...
[ "private", "void", "undeployRemovedComponents", "(", "final", "NetworkContext", "context", ",", "final", "NetworkContext", "runningContext", ",", "final", "Handler", "<", "AsyncResult", "<", "Void", ">", ">", "doneHandler", ")", "{", "// Undeploy any components that wer...
Undeploys components that were removed from the network.
[ "Undeploys", "components", "that", "were", "removed", "from", "the", "network", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java#L375-L401
40,669
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java
NetworkManager.handleDelete
private void handleDelete() { log.debug(String.format("%s - Network configuration removed from cluster: %s", NetworkManager.this, cluster.address())); tasks.runTask(new Handler<Task>() { @Override public void handle(final Task task) { unready(new Handler<AsyncResult<Void>>() { @Ove...
java
private void handleDelete() { log.debug(String.format("%s - Network configuration removed from cluster: %s", NetworkManager.this, cluster.address())); tasks.runTask(new Handler<Task>() { @Override public void handle(final Task task) { unready(new Handler<AsyncResult<Void>>() { @Ove...
[ "private", "void", "handleDelete", "(", ")", "{", "log", ".", "debug", "(", "String", ".", "format", "(", "\"%s - Network configuration removed from cluster: %s\"", ",", "NetworkManager", ".", "this", ",", "cluster", ".", "address", "(", ")", ")", ")", ";", "t...
Handles the deletion of the network.
[ "Handles", "the", "deletion", "of", "the", "network", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java#L436-L480
40,670
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java
NetworkManager.unready
private void unready(final Handler<AsyncResult<Void>> doneHandler) { if (currentContext != null && data != null) { log.debug(String.format("%s - Pausing network", NetworkManager.this)); data.remove(currentContext.status(), new Handler<AsyncResult<String>>() { @Override public void handle...
java
private void unready(final Handler<AsyncResult<Void>> doneHandler) { if (currentContext != null && data != null) { log.debug(String.format("%s - Pausing network", NetworkManager.this)); data.remove(currentContext.status(), new Handler<AsyncResult<String>>() { @Override public void handle...
[ "private", "void", "unready", "(", "final", "Handler", "<", "AsyncResult", "<", "Void", ">", ">", "doneHandler", ")", "{", "if", "(", "currentContext", "!=", "null", "&&", "data", "!=", "null", ")", "{", "log", ".", "debug", "(", "String", ".", "format...
Unreadies the network.
[ "Unreadies", "the", "network", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java#L485-L499
40,671
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java
NetworkManager.handleReady
private void handleReady(String address) { log.debug(String.format("%s - Received ready message from %s", NetworkManager.this, address)); ready.add(address); checkReady(); }
java
private void handleReady(String address) { log.debug(String.format("%s - Received ready message from %s", NetworkManager.this, address)); ready.add(address); checkReady(); }
[ "private", "void", "handleReady", "(", "String", "address", ")", "{", "log", ".", "debug", "(", "String", ".", "format", "(", "\"%s - Received ready message from %s\"", ",", "NetworkManager", ".", "this", ",", "address", ")", ")", ";", "ready", ".", "add", "...
Called when a component instance is ready.
[ "Called", "when", "a", "component", "instance", "is", "ready", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java#L504-L508
40,672
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java
NetworkManager.checkReady
private void checkReady() { if (allReady()) { log.debug(String.format("%s - All components ready in network, starting components", NetworkManager.this)); // Set the network's status key to the current context version. This // can be used by listeners to determine when a configuration change is com...
java
private void checkReady() { if (allReady()) { log.debug(String.format("%s - All components ready in network, starting components", NetworkManager.this)); // Set the network's status key to the current context version. This // can be used by listeners to determine when a configuration change is com...
[ "private", "void", "checkReady", "(", ")", "{", "if", "(", "allReady", "(", ")", ")", "{", "log", ".", "debug", "(", "String", ".", "format", "(", "\"%s - All components ready in network, starting components\"", ",", "NetworkManager", ".", "this", ")", ")", ";...
Checks whether the network is ready.
[ "Checks", "whether", "the", "network", "is", "ready", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java#L513-L527
40,673
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java
NetworkManager.handleUnready
private void handleUnready(String address) { log.debug(String.format("%s - Received unready message from: %s", NetworkManager.this, address)); ready.remove(address); checkUnready(); }
java
private void handleUnready(String address) { log.debug(String.format("%s - Received unready message from: %s", NetworkManager.this, address)); ready.remove(address); checkUnready(); }
[ "private", "void", "handleUnready", "(", "String", "address", ")", "{", "log", ".", "debug", "(", "String", ".", "format", "(", "\"%s - Received unready message from: %s\"", ",", "NetworkManager", ".", "this", ",", "address", ")", ")", ";", "ready", ".", "remo...
Called when a component instance is unready.
[ "Called", "when", "a", "component", "instance", "is", "unready", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java#L532-L536
40,674
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java
NetworkManager.checkUnready
private void checkUnready() { if (!allReady()) { log.debug(String.format("%s - Components not ready, pausing components", NetworkManager.this)); data.remove(currentContext.address(), new Handler<AsyncResult<String>>() { @Override public void handle(AsyncResult<String> result) { ...
java
private void checkUnready() { if (!allReady()) { log.debug(String.format("%s - Components not ready, pausing components", NetworkManager.this)); data.remove(currentContext.address(), new Handler<AsyncResult<String>>() { @Override public void handle(AsyncResult<String> result) { ...
[ "private", "void", "checkUnready", "(", ")", "{", "if", "(", "!", "allReady", "(", ")", ")", "{", "log", ".", "debug", "(", "String", ".", "format", "(", "\"%s - Components not ready, pausing components\"", ",", "NetworkManager", ".", "this", ")", ")", ";", ...
Checks whether the network is unready.
[ "Checks", "whether", "the", "network", "is", "unready", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java#L541-L553
40,675
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java
NetworkManager.allReady
private boolean allReady() { if (currentContext == null) return false; List<InstanceContext> instances = new ArrayList<>(); boolean match = true; outer: for (ComponentContext<?> component : currentContext.components()) { instances.addAll(component.instances()); for (InstanceContext instance ...
java
private boolean allReady() { if (currentContext == null) return false; List<InstanceContext> instances = new ArrayList<>(); boolean match = true; outer: for (ComponentContext<?> component : currentContext.components()) { instances.addAll(component.instances()); for (InstanceContext instance ...
[ "private", "boolean", "allReady", "(", ")", "{", "if", "(", "currentContext", "==", "null", ")", "return", "false", ";", "List", "<", "InstanceContext", ">", "instances", "=", "new", "ArrayList", "<>", "(", ")", ";", "boolean", "match", "=", "true", ";",...
Checks whether all components are ready in the network.
[ "Checks", "whether", "all", "components", "are", "ready", "in", "the", "network", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java#L558-L572
40,676
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java
NetworkManager.deployNetwork
private void deployNetwork(final NetworkContext context, final Handler<AsyncResult<NetworkContext>> doneHandler) { log.debug(String.format("%s - Deploying network", NetworkManager.this)); final CountingCompletionHandler<Void> complete = new CountingCompletionHandler<Void>(context.components().size()); compl...
java
private void deployNetwork(final NetworkContext context, final Handler<AsyncResult<NetworkContext>> doneHandler) { log.debug(String.format("%s - Deploying network", NetworkManager.this)); final CountingCompletionHandler<Void> complete = new CountingCompletionHandler<Void>(context.components().size()); compl...
[ "private", "void", "deployNetwork", "(", "final", "NetworkContext", "context", ",", "final", "Handler", "<", "AsyncResult", "<", "NetworkContext", ">", ">", "doneHandler", ")", "{", "log", ".", "debug", "(", "String", ".", "format", "(", "\"%s - Deploying networ...
Deploys a complete network.
[ "Deploys", "a", "complete", "network", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java#L577-L591
40,677
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java
NetworkManager.deployComponents
private void deployComponents(Collection<ComponentContext<?>> components, final CountingCompletionHandler<Void> counter) { for (final ComponentContext<?> component : components) { deployComponent(component, new Handler<AsyncResult<Void>>() { @Override public void handle(AsyncResult<Void> resul...
java
private void deployComponents(Collection<ComponentContext<?>> components, final CountingCompletionHandler<Void> counter) { for (final ComponentContext<?> component : components) { deployComponent(component, new Handler<AsyncResult<Void>>() { @Override public void handle(AsyncResult<Void> resul...
[ "private", "void", "deployComponents", "(", "Collection", "<", "ComponentContext", "<", "?", ">", ">", "components", ",", "final", "CountingCompletionHandler", "<", "Void", ">", "counter", ")", "{", "for", "(", "final", "ComponentContext", "<", "?", ">", "comp...
Deploys all network components.
[ "Deploys", "all", "network", "components", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java#L596-L618
40,678
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java
NetworkManager.deployInstances
private void deployInstances(List<InstanceContext> instances, final Handler<AsyncResult<Void>> doneHandler) { final CountingCompletionHandler<Void> counter = new CountingCompletionHandler<Void>(instances.size()).setHandler(doneHandler); for (final InstanceContext instance : instances) { // Before deployin...
java
private void deployInstances(List<InstanceContext> instances, final Handler<AsyncResult<Void>> doneHandler) { final CountingCompletionHandler<Void> counter = new CountingCompletionHandler<Void>(instances.size()).setHandler(doneHandler); for (final InstanceContext instance : instances) { // Before deployin...
[ "private", "void", "deployInstances", "(", "List", "<", "InstanceContext", ">", "instances", ",", "final", "Handler", "<", "AsyncResult", "<", "Void", ">", ">", "doneHandler", ")", "{", "final", "CountingCompletionHandler", "<", "Void", ">", "counter", "=", "n...
Deploys all network component instances.
[ "Deploys", "all", "network", "component", "instances", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java#L700-L731
40,679
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java
NetworkManager.deployInstance
private void deployInstance(final InstanceContext instance, final CountingCompletionHandler<Void> counter) { // First we need to select a node from the component's deployment group // to which to deploy the component. // If the component doesn't specify a group then deploy to any node in the cluster. if...
java
private void deployInstance(final InstanceContext instance, final CountingCompletionHandler<Void> counter) { // First we need to select a node from the component's deployment group // to which to deploy the component. // If the component doesn't specify a group then deploy to any node in the cluster. if...
[ "private", "void", "deployInstance", "(", "final", "InstanceContext", "instance", ",", "final", "CountingCompletionHandler", "<", "Void", ">", "counter", ")", "{", "// First we need to select a node from the component's deployment group", "// to which to deploy the component.", "...
Deploys a single component instance.
[ "Deploys", "a", "single", "component", "instance", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java#L736-L772
40,680
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java
NetworkManager.deployInstance
private void deployInstance(final Node node, final InstanceContext instance, final CountingCompletionHandler<Void> counter) { data.put(instance.address(), Contexts.serialize(instance).encode(), new Handler<AsyncResult<String>>() { @Override public void handle(AsyncResult<String> result) { if (re...
java
private void deployInstance(final Node node, final InstanceContext instance, final CountingCompletionHandler<Void> counter) { data.put(instance.address(), Contexts.serialize(instance).encode(), new Handler<AsyncResult<String>>() { @Override public void handle(AsyncResult<String> result) { if (re...
[ "private", "void", "deployInstance", "(", "final", "Node", "node", ",", "final", "InstanceContext", "instance", ",", "final", "CountingCompletionHandler", "<", "Void", ">", "counter", ")", "{", "data", ".", "put", "(", "instance", ".", "address", "(", ")", "...
Deploys an instance to a specific node.
[ "Deploys", "an", "instance", "to", "a", "specific", "node", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java#L777-L828
40,681
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java
NetworkManager.deployModule
private void deployModule(final Node node, final InstanceContext instance, final CountingCompletionHandler<Void> counter) { log.debug(String.format("%s - Deploying %s to %s", NetworkManager.this, instance.component().asModule().module(), node.address())); node.deployModule(instance.component().asModule().module...
java
private void deployModule(final Node node, final InstanceContext instance, final CountingCompletionHandler<Void> counter) { log.debug(String.format("%s - Deploying %s to %s", NetworkManager.this, instance.component().asModule().module(), node.address())); node.deployModule(instance.component().asModule().module...
[ "private", "void", "deployModule", "(", "final", "Node", "node", ",", "final", "InstanceContext", "instance", ",", "final", "CountingCompletionHandler", "<", "Void", ">", "counter", ")", "{", "log", ".", "debug", "(", "String", ".", "format", "(", "\"%s - Depl...
Deploys a module component instance in the network's cluster.
[ "Deploys", "a", "module", "component", "instance", "in", "the", "network", "s", "cluster", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java#L833-L850
40,682
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java
NetworkManager.installModules
private void installModules(final Node node, final NetworkContext context, final Handler<AsyncResult<Void>> doneHandler) { List<ModuleContext> modules = new ArrayList<>(); for (ComponentContext<?> component : context.components()) { if (component.isModule()) { modules.add(component.asModule()); ...
java
private void installModules(final Node node, final NetworkContext context, final Handler<AsyncResult<Void>> doneHandler) { List<ModuleContext> modules = new ArrayList<>(); for (ComponentContext<?> component : context.components()) { if (component.isModule()) { modules.add(component.asModule()); ...
[ "private", "void", "installModules", "(", "final", "Node", "node", ",", "final", "NetworkContext", "context", ",", "final", "Handler", "<", "AsyncResult", "<", "Void", ">", ">", "doneHandler", ")", "{", "List", "<", "ModuleContext", ">", "modules", "=", "new...
Installs all modules on a node.
[ "Installs", "all", "modules", "on", "a", "node", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java#L899-L911
40,683
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java
NetworkManager.installModule
private void installModule(final Node node, final ModuleContext module, final Handler<AsyncResult<Void>> doneHandler) { node.installModule(module.module(), doneHandler); }
java
private void installModule(final Node node, final ModuleContext module, final Handler<AsyncResult<Void>> doneHandler) { node.installModule(module.module(), doneHandler); }
[ "private", "void", "installModule", "(", "final", "Node", "node", ",", "final", "ModuleContext", "module", ",", "final", "Handler", "<", "AsyncResult", "<", "Void", ">", ">", "doneHandler", ")", "{", "node", ".", "installModule", "(", "module", ".", "module"...
Installs a module on a node.
[ "Installs", "a", "module", "on", "a", "node", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java#L916-L918
40,684
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java
NetworkManager.undeployComponents
private void undeployComponents(Collection<ComponentContext<?>> components, final CountingCompletionHandler<Void> complete) { for (final ComponentContext<?> component : components) { final CountingCompletionHandler<Void> counter = new CountingCompletionHandler<Void>(component.instances().size()); counte...
java
private void undeployComponents(Collection<ComponentContext<?>> components, final CountingCompletionHandler<Void> complete) { for (final ComponentContext<?> component : components) { final CountingCompletionHandler<Void> counter = new CountingCompletionHandler<Void>(component.instances().size()); counte...
[ "private", "void", "undeployComponents", "(", "Collection", "<", "ComponentContext", "<", "?", ">", ">", "components", ",", "final", "CountingCompletionHandler", "<", "Void", ">", "complete", ")", "{", "for", "(", "final", "ComponentContext", "<", "?", ">", "c...
Undeploys all network components.
[ "Undeploys", "all", "network", "components", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java#L941-L966
40,685
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java
NetworkManager.undeployInstances
private void undeployInstances(List<InstanceContext> instances, final CountingCompletionHandler<Void> counter) { for (final InstanceContext instance : instances) { if (instance.component().isModule()) { undeployModule(instance, counter); } else if (instance.component().isVerticle()) { un...
java
private void undeployInstances(List<InstanceContext> instances, final CountingCompletionHandler<Void> counter) { for (final InstanceContext instance : instances) { if (instance.component().isModule()) { undeployModule(instance, counter); } else if (instance.component().isVerticle()) { un...
[ "private", "void", "undeployInstances", "(", "List", "<", "InstanceContext", ">", "instances", ",", "final", "CountingCompletionHandler", "<", "Void", ">", "counter", ")", "{", "for", "(", "final", "InstanceContext", "instance", ":", "instances", ")", "{", "if",...
Undeploys all component instances.
[ "Undeploys", "all", "component", "instances", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java#L971-L979
40,686
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java
NetworkManager.unwatchInstance
private void unwatchInstance(final InstanceContext instance, final CountingCompletionHandler<Void> counter) { Handler<MapEvent<String, String>> watchHandler = watchHandlers.remove(instance.address()); if (watchHandler != null) { data.unwatch(instance.status(), watchHandler, new Handler<AsyncResult<Void>>(...
java
private void unwatchInstance(final InstanceContext instance, final CountingCompletionHandler<Void> counter) { Handler<MapEvent<String, String>> watchHandler = watchHandlers.remove(instance.address()); if (watchHandler != null) { data.unwatch(instance.status(), watchHandler, new Handler<AsyncResult<Void>>(...
[ "private", "void", "unwatchInstance", "(", "final", "InstanceContext", "instance", ",", "final", "CountingCompletionHandler", "<", "Void", ">", "counter", ")", "{", "Handler", "<", "MapEvent", "<", "String", ",", "String", ">", ">", "watchHandler", "=", "watchHa...
Unwatches a component instance's status and context.
[ "Unwatches", "a", "component", "instance", "s", "status", "and", "context", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java#L984-L1014
40,687
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java
NetworkManager.undeployModule
private void undeployModule(final InstanceContext instance, final CountingCompletionHandler<Void> counter) { deploymentIDs.remove(instance.address(), new Handler<AsyncResult<String>>() { @Override public void handle(AsyncResult<String> result) { if (result.failed()) { counter.fail(resu...
java
private void undeployModule(final InstanceContext instance, final CountingCompletionHandler<Void> counter) { deploymentIDs.remove(instance.address(), new Handler<AsyncResult<String>>() { @Override public void handle(AsyncResult<String> result) { if (result.failed()) { counter.fail(resu...
[ "private", "void", "undeployModule", "(", "final", "InstanceContext", "instance", ",", "final", "CountingCompletionHandler", "<", "Void", ">", "counter", ")", "{", "deploymentIDs", ".", "remove", "(", "instance", ".", "address", "(", ")", ",", "new", "Handler", ...
Undeploys a module component instance.
[ "Undeploys", "a", "module", "component", "instance", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java#L1019-L1037
40,688
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java
NetworkManager.updateNetwork
private void updateNetwork(final NetworkContext context, final Handler<AsyncResult<Void>> doneHandler) { final CountingCompletionHandler<Void> complete = new CountingCompletionHandler<Void>(context.components().size()); complete.setHandler(new Handler<AsyncResult<Void>>() { @Override public void han...
java
private void updateNetwork(final NetworkContext context, final Handler<AsyncResult<Void>> doneHandler) { final CountingCompletionHandler<Void> complete = new CountingCompletionHandler<Void>(context.components().size()); complete.setHandler(new Handler<AsyncResult<Void>>() { @Override public void han...
[ "private", "void", "updateNetwork", "(", "final", "NetworkContext", "context", ",", "final", "Handler", "<", "AsyncResult", "<", "Void", ">", ">", "doneHandler", ")", "{", "final", "CountingCompletionHandler", "<", "Void", ">", "complete", "=", "new", "CountingC...
Updates a network.
[ "Updates", "a", "network", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java#L1065-L1078
40,689
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java
NetworkManager.updateComponents
private void updateComponents(Collection<ComponentContext<?>> components, final CountingCompletionHandler<Void> complete) { for (final ComponentContext<?> component : components) { final CountingCompletionHandler<Void> counter = new CountingCompletionHandler<Void>(component.instances().size()); counter....
java
private void updateComponents(Collection<ComponentContext<?>> components, final CountingCompletionHandler<Void> complete) { for (final ComponentContext<?> component : components) { final CountingCompletionHandler<Void> counter = new CountingCompletionHandler<Void>(component.instances().size()); counter....
[ "private", "void", "updateComponents", "(", "Collection", "<", "ComponentContext", "<", "?", ">", ">", "components", ",", "final", "CountingCompletionHandler", "<", "Void", ">", "complete", ")", "{", "for", "(", "final", "ComponentContext", "<", "?", ">", "com...
Updates all network components.
[ "Updates", "all", "network", "components", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java#L1083-L1098
40,690
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java
NetworkManager.updateInstances
private void updateInstances(List<InstanceContext> instances, final CountingCompletionHandler<Void> counter) { for (final InstanceContext instance : instances) { data.put(instance.address(), Contexts.serialize(instance).encode(), new Handler<AsyncResult<String>>() { @Override public void handl...
java
private void updateInstances(List<InstanceContext> instances, final CountingCompletionHandler<Void> counter) { for (final InstanceContext instance : instances) { data.put(instance.address(), Contexts.serialize(instance).encode(), new Handler<AsyncResult<String>>() { @Override public void handl...
[ "private", "void", "updateInstances", "(", "List", "<", "InstanceContext", ">", "instances", ",", "final", "CountingCompletionHandler", "<", "Void", ">", "counter", ")", "{", "for", "(", "final", "InstanceContext", "instance", ":", "instances", ")", "{", "data",...
Updates all component instances.
[ "Updates", "all", "component", "instances", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java#L1103-L1116
40,691
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java
NetworkManager.doNodeJoined
private void doNodeJoined(final Node node) { tasks.runTask(new Handler<Task>() { @Override public void handle(final Task task) { if (currentContext != null) { log.info(String.format("%s - %s joined the cluster. Uploading components to new node", NetworkManager.this, node.address())); ...
java
private void doNodeJoined(final Node node) { tasks.runTask(new Handler<Task>() { @Override public void handle(final Task task) { if (currentContext != null) { log.info(String.format("%s - %s joined the cluster. Uploading components to new node", NetworkManager.this, node.address())); ...
[ "private", "void", "doNodeJoined", "(", "final", "Node", "node", ")", "{", "tasks", ".", "runTask", "(", "new", "Handler", "<", "Task", ">", "(", ")", "{", "@", "Override", "public", "void", "handle", "(", "final", "Task", "task", ")", "{", "if", "("...
Handles a node joining the cluster.
[ "Handles", "a", "node", "joining", "the", "cluster", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java#L1121-L1143
40,692
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java
NetworkManager.doNodeLeft
private void doNodeLeft(final Node node) { tasks.runTask(new Handler<Task>() { @Override public void handle(final Task task) { if (currentContext != null) { log.info(String.format("%s - %s left the cluster. Reassigning components", NetworkManager.this, node.address())); deplo...
java
private void doNodeLeft(final Node node) { tasks.runTask(new Handler<Task>() { @Override public void handle(final Task task) { if (currentContext != null) { log.info(String.format("%s - %s left the cluster. Reassigning components", NetworkManager.this, node.address())); deplo...
[ "private", "void", "doNodeLeft", "(", "final", "Node", "node", ")", "{", "tasks", ".", "runTask", "(", "new", "Handler", "<", "Task", ">", "(", ")", "{", "@", "Override", "public", "void", "handle", "(", "final", "Task", "task", ")", "{", "if", "(", ...
Handles a node leaving the cluster.
[ "Handles", "a", "node", "leaving", "the", "cluster", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/network/manager/NetworkManager.java#L1148-L1198
40,693
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/io/connection/impl/DefaultOutputConnection.java
DefaultOutputConnection.disconnect
private void disconnect(final Handler<AsyncResult<Void>> doneHandler) { eventBus.sendWithTimeout(inAddress, new JsonObject().putString("action", "disconnect"), 5000, new Handler<AsyncResult<Message<Boolean>>>() { @Override public void handle(AsyncResult<Message<Boolean>> result) { if (result.fai...
java
private void disconnect(final Handler<AsyncResult<Void>> doneHandler) { eventBus.sendWithTimeout(inAddress, new JsonObject().putString("action", "disconnect"), 5000, new Handler<AsyncResult<Message<Boolean>>>() { @Override public void handle(AsyncResult<Message<Boolean>> result) { if (result.fai...
[ "private", "void", "disconnect", "(", "final", "Handler", "<", "AsyncResult", "<", "Void", ">", ">", "doneHandler", ")", "{", "eventBus", ".", "sendWithTimeout", "(", "inAddress", ",", "new", "JsonObject", "(", ")", ".", "putString", "(", "\"action\"", ",", ...
Disconnects from the other side of the connection.
[ "Disconnects", "from", "the", "other", "side", "of", "the", "connection", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/io/connection/impl/DefaultOutputConnection.java#L288-L319
40,694
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/io/connection/impl/DefaultOutputConnection.java
DefaultOutputConnection.checkFull
private void checkFull() { if (!full && messages.size() >= maxQueueSize) { full = true; log.debug(String.format("%s - Connection to %s is full", this, context.target())); } }
java
private void checkFull() { if (!full && messages.size() >= maxQueueSize) { full = true; log.debug(String.format("%s - Connection to %s is full", this, context.target())); } }
[ "private", "void", "checkFull", "(", ")", "{", "if", "(", "!", "full", "&&", "messages", ".", "size", "(", ")", ">=", "maxQueueSize", ")", "{", "full", "=", "true", ";", "log", ".", "debug", "(", "String", ".", "format", "(", "\"%s - Connection to %s i...
Checks whether the connection is full.
[ "Checks", "whether", "the", "connection", "is", "full", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/io/connection/impl/DefaultOutputConnection.java#L331-L336
40,695
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/io/connection/impl/DefaultOutputConnection.java
DefaultOutputConnection.checkDrain
private void checkDrain() { if (full && !paused && messages.size() < maxQueueSize / 2) { full = false; log.debug(String.format("%s - Connection to %s is drained", this, context.target())); if (drainHandler != null) { drainHandler.handle((Void) null); } } }
java
private void checkDrain() { if (full && !paused && messages.size() < maxQueueSize / 2) { full = false; log.debug(String.format("%s - Connection to %s is drained", this, context.target())); if (drainHandler != null) { drainHandler.handle((Void) null); } } }
[ "private", "void", "checkDrain", "(", ")", "{", "if", "(", "full", "&&", "!", "paused", "&&", "messages", ".", "size", "(", ")", "<", "maxQueueSize", "/", "2", ")", "{", "full", "=", "false", ";", "log", ".", "debug", "(", "String", ".", "format", ...
Checks whether the connection has been drained.
[ "Checks", "whether", "the", "connection", "has", "been", "drained", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/io/connection/impl/DefaultOutputConnection.java#L341-L349
40,696
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/io/connection/impl/DefaultOutputConnection.java
DefaultOutputConnection.doAck
private void doAck(long id) { // The other side of the connection has sent a message indicating which // messages it has seen. We can clear any messages before the indicated ID. if (log.isDebugEnabled()) { log.debug(String.format("%s - Received ack for messages up to %d, removing all previous messages...
java
private void doAck(long id) { // The other side of the connection has sent a message indicating which // messages it has seen. We can clear any messages before the indicated ID. if (log.isDebugEnabled()) { log.debug(String.format("%s - Received ack for messages up to %d, removing all previous messages...
[ "private", "void", "doAck", "(", "long", "id", ")", "{", "// The other side of the connection has sent a message indicating which", "// messages it has seen. We can clear any messages before the indicated ID.", "if", "(", "log", ".", "isDebugEnabled", "(", ")", ")", "{", "log",...
Handles a batch ack.
[ "Handles", "a", "batch", "ack", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/io/connection/impl/DefaultOutputConnection.java#L373-L385
40,697
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/io/connection/impl/DefaultOutputConnection.java
DefaultOutputConnection.doFail
private void doFail(long id) { if (log.isDebugEnabled()) { log.debug(String.format("%s - Received resend request for messages starting at %d", this, id)); } // Ack all the entries before the given ID. doAck(id); // Now that all the entries before the given ID have been removed, // just i...
java
private void doFail(long id) { if (log.isDebugEnabled()) { log.debug(String.format("%s - Received resend request for messages starting at %d", this, id)); } // Ack all the entries before the given ID. doAck(id); // Now that all the entries before the given ID have been removed, // just i...
[ "private", "void", "doFail", "(", "long", "id", ")", "{", "if", "(", "log", ".", "isDebugEnabled", "(", ")", ")", "{", "log", ".", "debug", "(", "String", ".", "format", "(", "\"%s - Received resend request for messages starting at %d\"", ",", "this", ",", "...
Handles a batch fail.
[ "Handles", "a", "batch", "fail", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/io/connection/impl/DefaultOutputConnection.java#L390-L404
40,698
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/io/connection/impl/DefaultOutputConnection.java
DefaultOutputConnection.doPause
private void doPause(long id) { log.debug(String.format("%s - Paused connection to %s", this, context.target())); paused = true; }
java
private void doPause(long id) { log.debug(String.format("%s - Paused connection to %s", this, context.target())); paused = true; }
[ "private", "void", "doPause", "(", "long", "id", ")", "{", "log", ".", "debug", "(", "String", ".", "format", "(", "\"%s - Paused connection to %s\"", ",", "this", ",", "context", ".", "target", "(", ")", ")", ")", ";", "paused", "=", "true", ";", "}" ...
Handles a connection pause.
[ "Handles", "a", "connection", "pause", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/io/connection/impl/DefaultOutputConnection.java#L409-L412
40,699
kuujo/vertigo
core/src/main/java/net/kuujo/vertigo/io/connection/impl/DefaultOutputConnection.java
DefaultOutputConnection.doResume
private void doResume(long id) { if (paused) { log.debug(String.format("%s - Resumed connection to %s", this, context.target())); paused = false; checkDrain(); } }
java
private void doResume(long id) { if (paused) { log.debug(String.format("%s - Resumed connection to %s", this, context.target())); paused = false; checkDrain(); } }
[ "private", "void", "doResume", "(", "long", "id", ")", "{", "if", "(", "paused", ")", "{", "log", ".", "debug", "(", "String", ".", "format", "(", "\"%s - Resumed connection to %s\"", ",", "this", ",", "context", ".", "target", "(", ")", ")", ")", ";",...
Handles a connection resume.
[ "Handles", "a", "connection", "resume", "." ]
c5869dbc5fff89eb5262e83f7a81719b01a5ba6f
https://github.com/kuujo/vertigo/blob/c5869dbc5fff89eb5262e83f7a81719b01a5ba6f/core/src/main/java/net/kuujo/vertigo/io/connection/impl/DefaultOutputConnection.java#L417-L423