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
104,100
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/advertising/IBeacon.java
IBeacon.setUUID
public void setUUID(UUID uuid) { if (uuid == null) { throw new IllegalArgumentException("'uuid' is null."); } mUUID = uuid; long msbits = uuid.getMostSignificantBits(); long lsbits = uuid.getLeastSignificantBits(); byte[] data = getData(); ...
java
public void setUUID(UUID uuid) { if (uuid == null) { throw new IllegalArgumentException("'uuid' is null."); } mUUID = uuid; long msbits = uuid.getMostSignificantBits(); long lsbits = uuid.getLeastSignificantBits(); byte[] data = getData(); ...
[ "public", "void", "setUUID", "(", "UUID", "uuid", ")", "{", "if", "(", "uuid", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"'uuid' is null.\"", ")", ";", "}", "mUUID", "=", "uuid", ";", "long", "msbits", "=", "uuid", ".", ...
Set the proximity UUID. @param uuid The proximity UUID. The value must not be {@code null}. @throws IllegalArgumentException The given value is {@code null}.
[ "Set", "the", "proximity", "UUID", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/advertising/IBeacon.java#L117-L146
104,101
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/advertising/IBeacon.java
IBeacon.setMajor
public void setMajor(int major) { if (major < 0 || 0xFFFF < major) { throw new IllegalArgumentException("'major' is out of the valid range: " + major); } mMajor = major; byte[] data = getData(); data[MAJOR_INDEX ] = (byte)((major >> 8) & 0xFF); ...
java
public void setMajor(int major) { if (major < 0 || 0xFFFF < major) { throw new IllegalArgumentException("'major' is out of the valid range: " + major); } mMajor = major; byte[] data = getData(); data[MAJOR_INDEX ] = (byte)((major >> 8) & 0xFF); ...
[ "public", "void", "setMajor", "(", "int", "major", ")", "{", "if", "(", "major", "<", "0", "||", "0xFFFF", "<", "major", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"'major' is out of the valid range: \"", "+", "major", ")", ";", "}", "mMajo...
Set the major number. @param major The major number. The value should be in the range from 0 to 65535. @throws IllegalArgumentException The given value is out of the valid range.
[ "Set", "the", "major", "number", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/advertising/IBeacon.java#L170-L182
104,102
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/advertising/IBeacon.java
IBeacon.setMinor
public void setMinor(int minor) { if (minor < 0 || 0xFFFF < minor) { throw new IllegalArgumentException("'minor' is out of the valid range: " + minor); } mMinor = minor; byte[] data = getData(); data[MINOR_INDEX ] = (byte)((minor >> 8) & 0xFF); ...
java
public void setMinor(int minor) { if (minor < 0 || 0xFFFF < minor) { throw new IllegalArgumentException("'minor' is out of the valid range: " + minor); } mMinor = minor; byte[] data = getData(); data[MINOR_INDEX ] = (byte)((minor >> 8) & 0xFF); ...
[ "public", "void", "setMinor", "(", "int", "minor", ")", "{", "if", "(", "minor", "<", "0", "||", "0xFFFF", "<", "minor", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"'minor' is out of the valid range: \"", "+", "minor", ")", ";", "}", "mMino...
Set the minor number. @param minor The minor number. The value should be in the range from 0 to 65535. @throws IllegalArgumentException The given value is out of the valid range.
[ "Set", "the", "minor", "number", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/advertising/IBeacon.java#L206-L218
104,103
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/advertising/ADPayloadParser.java
ADPayloadParser.registerBuilder
public void registerBuilder(int type, ADStructureBuilder builder) { if (type < 0 || 0xFF < type) { String message = String.format("'type' is out of the valid range: %d", type); throw new IllegalArgumentException(message); } if (builder == null) { ...
java
public void registerBuilder(int type, ADStructureBuilder builder) { if (type < 0 || 0xFF < type) { String message = String.format("'type' is out of the valid range: %d", type); throw new IllegalArgumentException(message); } if (builder == null) { ...
[ "public", "void", "registerBuilder", "(", "int", "type", ",", "ADStructureBuilder", "builder", ")", "{", "if", "(", "type", "<", "0", "||", "0xFF", "<", "type", ")", "{", "String", "message", "=", "String", ".", "format", "(", "\"'type' is out of the valid r...
Register an AD structure builder for the AD type. The given builder is added at the beginning of the list of the builders for the AD type. <p> Note that a builder for the type <i>Manufacturer Specific Data</i> (0xFF) should not be registered by this method. Instead, use {@link #registerManufacturerSpecificBuilder(int,...
[ "Register", "an", "AD", "structure", "builder", "for", "the", "AD", "type", ".", "The", "given", "builder", "is", "added", "at", "the", "beginning", "of", "the", "list", "of", "the", "builders", "for", "the", "AD", "type", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/advertising/ADPayloadParser.java#L152-L180
104,104
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/advertising/ADPayloadParser.java
ADPayloadParser.registerManufacturerSpecificBuilder
public void registerManufacturerSpecificBuilder(int companyId, ADManufacturerSpecificBuilder builder) { if (companyId < 0 || 0xFFFF < companyId) { String message = String.format("'companyId' is out of the valid range: %d", companyId); throw new IllegalArgumentException(messag...
java
public void registerManufacturerSpecificBuilder(int companyId, ADManufacturerSpecificBuilder builder) { if (companyId < 0 || 0xFFFF < companyId) { String message = String.format("'companyId' is out of the valid range: %d", companyId); throw new IllegalArgumentException(messag...
[ "public", "void", "registerManufacturerSpecificBuilder", "(", "int", "companyId", ",", "ADManufacturerSpecificBuilder", "builder", ")", "{", "if", "(", "companyId", "<", "0", "||", "0xFFFF", "<", "companyId", ")", "{", "String", "message", "=", "String", ".", "f...
Register a builder for the company ID. The given builder is added at the beginning of the list of the builders for the company ID. @param companyId Company ID. The value must be in the range from 0 to 0xFFFF. @param builder A builder.
[ "Register", "a", "builder", "for", "the", "company", "ID", ".", "The", "given", "builder", "is", "added", "at", "the", "beginning", "of", "the", "list", "of", "the", "builders", "for", "the", "company", "ID", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/advertising/ADPayloadParser.java#L193-L221
104,105
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/util/Bytes.java
Bytes.parseBE4BytesAsUnsigned
public static long parseBE4BytesAsUnsigned(byte[] data, int offset) { long value = ((long)(data[offset + 0] & 0xFF) << 24) | ((long)(data[offset + 1] & 0xFF) << 16) | ((long)(data[offset + 2] & 0xFF) << 8) | ((long)(data[offset + 3] & 0xFF) << 0); ...
java
public static long parseBE4BytesAsUnsigned(byte[] data, int offset) { long value = ((long)(data[offset + 0] & 0xFF) << 24) | ((long)(data[offset + 1] & 0xFF) << 16) | ((long)(data[offset + 2] & 0xFF) << 8) | ((long)(data[offset + 3] & 0xFF) << 0); ...
[ "public", "static", "long", "parseBE4BytesAsUnsigned", "(", "byte", "[", "]", "data", ",", "int", "offset", ")", "{", "long", "value", "=", "(", "(", "long", ")", "(", "data", "[", "offset", "+", "0", "]", "&", "0xFF", ")", "<<", "24", ")", "|", ...
Parse 4 bytes in big endian byte order as an unsigned integer.
[ "Parse", "4", "bytes", "in", "big", "endian", "byte", "order", "as", "an", "unsigned", "integer", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/util/Bytes.java#L64-L72
104,106
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/util/Bytes.java
Bytes.copyOfRange
public static byte[] copyOfRange(byte[] source, int from, int to) { if (source == null || from < 0 || to < 0) { return null; } int length = to - from; if (length < 0) { return null; } if (source.length < from + length) ...
java
public static byte[] copyOfRange(byte[] source, int from, int to) { if (source == null || from < 0 || to < 0) { return null; } int length = to - from; if (length < 0) { return null; } if (source.length < from + length) ...
[ "public", "static", "byte", "[", "]", "copyOfRange", "(", "byte", "[", "]", "source", ",", "int", "from", ",", "int", "to", ")", "{", "if", "(", "source", "==", "null", "||", "from", "<", "0", "||", "to", "<", "0", ")", "{", "return", "null", "...
Copy a range of a given byte array. @param source A source byte array. @param from The start index of the range in the source byte array (inclusive). @param to The end index of the range in the source byte array (exclusive). @return A copied byte array. {@code null} is returned if (1) {@code source} is {@code null}...
[ "Copy", "a", "range", "of", "a", "given", "byte", "array", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/util/Bytes.java#L142-L166
104,107
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/util/UUIDCreator.java
UUIDCreator.from16
public static UUID from16(byte[] data, int offset, boolean littleEndian) { if (data == null || offset < 0 || data.length <= (offset + 1) || Integer.MAX_VALUE == offset) { return null; } int v2, v3; if (littleEndian) { v2 = data[offset + 1] & ...
java
public static UUID from16(byte[] data, int offset, boolean littleEndian) { if (data == null || offset < 0 || data.length <= (offset + 1) || Integer.MAX_VALUE == offset) { return null; } int v2, v3; if (littleEndian) { v2 = data[offset + 1] & ...
[ "public", "static", "UUID", "from16", "(", "byte", "[", "]", "data", ",", "int", "offset", ",", "boolean", "littleEndian", ")", "{", "if", "(", "data", "==", "null", "||", "offset", "<", "0", "||", "data", ".", "length", "<=", "(", "offset", "+", "...
Create a UUID instance from 16-bit UUID data. <pre style="padding: 0.5em; margin: 1em; border: 1px solid black;"> <span style="color: green;">// Prepare a byte array containing 32-bit UUID data (<b>little</b> endian).</span> byte[] data = new byte[] { (byte)0xAB, (byte)0xCD }; <span style="color: green;">// Create a ...
[ "Create", "a", "UUID", "instance", "from", "16", "-", "bit", "UUID", "data", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/util/UUIDCreator.java#L130-L151
104,108
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/util/UUIDCreator.java
UUIDCreator.from32
public static UUID from32(byte[] data, int offset, boolean littleEndian) { if (data == null || offset < 0 || data.length <= (offset + 3) || (Integer.MAX_VALUE - 3) < offset) { return null; } int v0, v1, v2, v3; if (littleEndian) { v0 = data[o...
java
public static UUID from32(byte[] data, int offset, boolean littleEndian) { if (data == null || offset < 0 || data.length <= (offset + 3) || (Integer.MAX_VALUE - 3) < offset) { return null; } int v0, v1, v2, v3; if (littleEndian) { v0 = data[o...
[ "public", "static", "UUID", "from32", "(", "byte", "[", "]", "data", ",", "int", "offset", ",", "boolean", "littleEndian", ")", "{", "if", "(", "data", "==", "null", "||", "offset", "<", "0", "||", "data", ".", "length", "<=", "(", "offset", "+", "...
Create a UUID instance from 32-bit UUID data. <pre style="padding: 0.5em; margin: 1em; border: 1px solid black;"> <span style="color: green;">// Prepare a byte array containing 32-bit UUID data (<b>little</b> endian).</span> byte[] data = new byte[] { (byte)0x89, (byte)0xAB, (byte)0xCD, (byte)0xEF }; <span style="col...
[ "Create", "a", "UUID", "instance", "from", "32", "-", "bit", "UUID", "data", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/util/UUIDCreator.java#L237-L262
104,109
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/util/UUIDCreator.java
UUIDCreator.from128
public static UUID from128(byte[] data, int offset, boolean littleEndian) { if (data == null || offset < 0 || data.length <= (offset + 15) || (Integer.MAX_VALUE - 15) < offset) { return null; } String uuid; if (littleEndian) { uuid = String.f...
java
public static UUID from128(byte[] data, int offset, boolean littleEndian) { if (data == null || offset < 0 || data.length <= (offset + 15) || (Integer.MAX_VALUE - 15) < offset) { return null; } String uuid; if (littleEndian) { uuid = String.f...
[ "public", "static", "UUID", "from128", "(", "byte", "[", "]", "data", ",", "int", "offset", ",", "boolean", "littleEndian", ")", "{", "if", "(", "data", "==", "null", "||", "offset", "<", "0", "||", "data", ".", "length", "<=", "(", "offset", "+", ...
Create a UUID instance from 128-bit UUID data. <pre style="padding: 0.5em; margin: 1em; border: 1px solid black;"> <span style="color: green;">// Prepare a byte array containing 128-bit UUID data (<b>little</b> endian).</span> byte[] data = new byte[] { (byte)0x10, (byte)0x32, (byte)0x54, (byte)0x76, (byte)0x98, (byte...
[ "Create", "a", "UUID", "instance", "from", "128", "-", "bit", "UUID", "data", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/util/UUIDCreator.java#L356-L391
104,110
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/advertising/Ucode.java
Ucode.setVersion
public void setVersion(int version) { if (version < 0 || 255 < version) { throw new IllegalArgumentException("'version' is out of the valid range: " + version); } mVersion = version; getData()[VERSION_INDEX] = (byte)(version & 0xFF); }
java
public void setVersion(int version) { if (version < 0 || 255 < version) { throw new IllegalArgumentException("'version' is out of the valid range: " + version); } mVersion = version; getData()[VERSION_INDEX] = (byte)(version & 0xFF); }
[ "public", "void", "setVersion", "(", "int", "version", ")", "{", "if", "(", "version", "<", "0", "||", "255", "<", "version", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"'version' is out of the valid range: \"", "+", "version", ")", ";", "}",...
Set the version of the packet format of Bluetooth LE ucode Marker. @param version The version number. The value should be in the range from 0 to 255. @throws IllegalArgumentException The given value is out of the valid range.
[ "Set", "the", "version", "of", "the", "packet", "format", "of", "Bluetooth", "LE", "ucode", "Marker", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/advertising/Ucode.java#L142-L152
104,111
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/advertising/Ucode.java
Ucode.setUcode
public void setUcode(String ucode) { if (ucode == null) { throw new IllegalArgumentException("'ucode' is null."); } if (UCODE_PATTERN.matcher(ucode).matches() == false) { throw new IllegalArgumentException("The format of 'ucode' is wrong: " + ucode); ...
java
public void setUcode(String ucode) { if (ucode == null) { throw new IllegalArgumentException("'ucode' is null."); } if (UCODE_PATTERN.matcher(ucode).matches() == false) { throw new IllegalArgumentException("The format of 'ucode' is wrong: " + ucode); ...
[ "public", "void", "setUcode", "(", "String", "ucode", ")", "{", "if", "(", "ucode", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"'ucode' is null.\"", ")", ";", "}", "if", "(", "UCODE_PATTERN", ".", "matcher", "(", "ucode", ")...
Set the ucode. @param ucode The string representation of the ucode. It must consist of 32 hex letters. @throws IllegalArgumentException {@code ucode} is {@code null} or it does not consist of 32 hex letters.
[ "Set", "the", "ucode", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/advertising/Ucode.java#L179-L205
104,112
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/advertising/Ucode.java
Ucode.setPower
public void setPower(int power) { if (power < -128 || 127 < power) { throw new IllegalArgumentException("'power' is out of the valid range: " + power); } mPower = power; getData()[POWER_INDEX] = (byte)power; }
java
public void setPower(int power) { if (power < -128 || 127 < power) { throw new IllegalArgumentException("'power' is out of the valid range: " + power); } mPower = power; getData()[POWER_INDEX] = (byte)power; }
[ "public", "void", "setPower", "(", "int", "power", ")", "{", "if", "(", "power", "<", "-", "128", "||", "127", "<", "power", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"'power' is out of the valid range: \"", "+", "power", ")", ";", "}", ...
Set the transmission power in dBm. @param power The transmission power in dBm. The valid range is from -128 to 127. @throws IllegalArgumentException The given value is out of the valid range.
[ "Set", "the", "transmission", "power", "in", "dBm", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/advertising/Ucode.java#L422-L432
104,113
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/advertising/Ucode.java
Ucode.setCount
public void setCount(int count) { if (count < 0 || 0xFF < count) { throw new IllegalArgumentException("'count' is out of the valid range: " + count); } mCount = count; getData()[COUNT_INDEX] = (byte)count; }
java
public void setCount(int count) { if (count < 0 || 0xFF < count) { throw new IllegalArgumentException("'count' is out of the valid range: " + count); } mCount = count; getData()[COUNT_INDEX] = (byte)count; }
[ "public", "void", "setCount", "(", "int", "count", ")", "{", "if", "(", "count", "<", "0", "||", "0xFF", "<", "count", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"'count' is out of the valid range: \"", "+", "count", ")", ";", "}", "mCount"...
Set the transmission count. @param count The transmission count. The value should be in the range from 0x00 to 0xFF. @throws IllegalArgumentException The given value is out of the valid range.
[ "Set", "the", "transmission", "count", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/advertising/Ucode.java#L462-L472
104,114
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/advertising/EddystoneUID.java
EddystoneUID.getNamespaceIdAsString
public String getNamespaceIdAsString() { if (mNamespaceIdAsString == null) { mNamespaceIdAsString = Bytes.toHexString(getNamespaceId(), true); } return mNamespaceIdAsString; }
java
public String getNamespaceIdAsString() { if (mNamespaceIdAsString == null) { mNamespaceIdAsString = Bytes.toHexString(getNamespaceId(), true); } return mNamespaceIdAsString; }
[ "public", "String", "getNamespaceIdAsString", "(", ")", "{", "if", "(", "mNamespaceIdAsString", "==", "null", ")", "{", "mNamespaceIdAsString", "=", "Bytes", ".", "toHexString", "(", "getNamespaceId", "(", ")", ",", "true", ")", ";", "}", "return", "mNamespace...
Get the 10-byte namespace ID as an upper-case hex string. @return The namespace ID.
[ "Get", "the", "10", "-", "byte", "namespace", "ID", "as", "an", "upper", "-", "case", "hex", "string", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/advertising/EddystoneUID.java#L145-L153
104,115
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/advertising/EddystoneUID.java
EddystoneUID.getInstanceIdAsString
public String getInstanceIdAsString() { if (mInstanceIdAsString == null) { mInstanceIdAsString = Bytes.toHexString(getInstanceId(), true); } return mInstanceIdAsString; }
java
public String getInstanceIdAsString() { if (mInstanceIdAsString == null) { mInstanceIdAsString = Bytes.toHexString(getInstanceId(), true); } return mInstanceIdAsString; }
[ "public", "String", "getInstanceIdAsString", "(", ")", "{", "if", "(", "mInstanceIdAsString", "==", "null", ")", "{", "mInstanceIdAsString", "=", "Bytes", ".", "toHexString", "(", "getInstanceId", "(", ")", ",", "true", ")", ";", "}", "return", "mInstanceIdAsS...
Get the 6-byte instance ID as an upper-case hex string. @return The instance ID.
[ "Get", "the", "6", "-", "byte", "instance", "ID", "as", "an", "upper", "-", "case", "hex", "string", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/advertising/EddystoneUID.java#L179-L187
104,116
TakahikoKawasaki/nv-bluetooth
src/main/java/com/neovisionaries/bluetooth/ble/advertising/EddystoneUID.java
EddystoneUID.getBeaconIdAsString
public String getBeaconIdAsString() { if (mBeaconIdAsString == null) { mBeaconIdAsString = Bytes.toHexString(getBeaconId(), true); } return mBeaconIdAsString; }
java
public String getBeaconIdAsString() { if (mBeaconIdAsString == null) { mBeaconIdAsString = Bytes.toHexString(getBeaconId(), true); } return mBeaconIdAsString; }
[ "public", "String", "getBeaconIdAsString", "(", ")", "{", "if", "(", "mBeaconIdAsString", "==", "null", ")", "{", "mBeaconIdAsString", "=", "Bytes", ".", "toHexString", "(", "getBeaconId", "(", ")", ",", "true", ")", ";", "}", "return", "mBeaconIdAsString", ...
Get the 16-byte beacon ID as an upper-case hex string. @return The beacon ID.
[ "Get", "the", "16", "-", "byte", "beacon", "ID", "as", "an", "upper", "-", "case", "hex", "string", "." ]
ef0099e941cd377571398615ea5e18cfc84cadd3
https://github.com/TakahikoKawasaki/nv-bluetooth/blob/ef0099e941cd377571398615ea5e18cfc84cadd3/src/main/java/com/neovisionaries/bluetooth/ble/advertising/EddystoneUID.java#L217-L225
104,117
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/ops4j/pax/logging/slf4j/Slf4jMDCAdapter.java
Slf4jMDCAdapter.getContext
private static PaxContext getContext(){ if( m_context==null && m_paxLogging!=null ){ m_context=(m_paxLogging.getPaxLoggingService()!=null)?m_paxLogging.getPaxLoggingService().getPaxContext():null; } return m_context!=null?m_context:m_defaultContext; }
java
private static PaxContext getContext(){ if( m_context==null && m_paxLogging!=null ){ m_context=(m_paxLogging.getPaxLoggingService()!=null)?m_paxLogging.getPaxLoggingService().getPaxContext():null; } return m_context!=null?m_context:m_defaultContext; }
[ "private", "static", "PaxContext", "getContext", "(", ")", "{", "if", "(", "m_context", "==", "null", "&&", "m_paxLogging", "!=", "null", ")", "{", "m_context", "=", "(", "m_paxLogging", ".", "getPaxLoggingService", "(", ")", "!=", "null", ")", "?", "m_pax...
For all the methods that operate against the context, return true if the MDC should use the PaxContext object from the PaxLoggingManager, or if the logging manager is not set, or does not have its context available yet, use a default context local to this MDC. @return m_context if the MDC should use the PaxContext obje...
[ "For", "all", "the", "methods", "that", "operate", "against", "the", "context", "return", "true", "if", "the", "MDC", "should", "use", "the", "PaxContext", "object", "from", "the", "PaxLoggingManager", "or", "if", "the", "logging", "manager", "is", "not", "s...
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/ops4j/pax/logging/slf4j/Slf4jMDCAdapter.java#L48-L53
104,118
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/component/plugins/Receiver.java
Receiver.setThreshold
public void setThreshold(final Level level) { Level oldValue = this.thresholdLevel; thresholdLevel = level; firePropertyChange("threshold", oldValue, this.thresholdLevel); }
java
public void setThreshold(final Level level) { Level oldValue = this.thresholdLevel; thresholdLevel = level; firePropertyChange("threshold", oldValue, this.thresholdLevel); }
[ "public", "void", "setThreshold", "(", "final", "Level", "level", ")", "{", "Level", "oldValue", "=", "this", ".", "thresholdLevel", ";", "thresholdLevel", "=", "level", ";", "firePropertyChange", "(", "\"threshold\"", ",", "oldValue", ",", "this", ".", "thres...
Sets the receiver theshold to the given level. @param level The threshold level events must equal or be greater than before further processing can be done.
[ "Sets", "the", "receiver", "theshold", "to", "the", "given", "level", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/component/plugins/Receiver.java#L78-L82
104,119
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/component/plugins/Receiver.java
Receiver.doPost
public void doPost(final LoggingEvent event) { // if event does not meet threshold, exit now if (!isAsSevereAsThreshold(event.getLevel())) { return; } // get the "local" logger for this event from the // configured repository. Logger localLogger = ...
java
public void doPost(final LoggingEvent event) { // if event does not meet threshold, exit now if (!isAsSevereAsThreshold(event.getLevel())) { return; } // get the "local" logger for this event from the // configured repository. Logger localLogger = ...
[ "public", "void", "doPost", "(", "final", "LoggingEvent", "event", ")", "{", "// if event does not meet threshold, exit now", "if", "(", "!", "isAsSevereAsThreshold", "(", "event", ".", "getLevel", "(", ")", ")", ")", "{", "return", ";", "}", "// get the \"local\"...
Posts the logging event to a logger in the configured logger repository. @param event the log event to post to the local log4j environment.
[ "Posts", "the", "logging", "event", "to", "a", "logger", "in", "the", "configured", "logger", "repository", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/component/plugins/Receiver.java#L112-L130
104,120
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/net/JMSReceiver.java
JMSReceiver.activateOptions
public void activateOptions() { if (!isActive()) { try { remoteInfo = topicFactoryName + ":" + topicName; Context ctx = null; if (jndiPath == null || jndiPath.equals("")) { ctx = new InitialContext(); } else { FileInputStream is = new FileInputS...
java
public void activateOptions() { if (!isActive()) { try { remoteInfo = topicFactoryName + ":" + topicName; Context ctx = null; if (jndiPath == null || jndiPath.equals("")) { ctx = new InitialContext(); } else { FileInputStream is = new FileInputS...
[ "public", "void", "activateOptions", "(", ")", "{", "if", "(", "!", "isActive", "(", ")", ")", "{", "try", "{", "remoteInfo", "=", "topicFactoryName", "+", "\":\"", "+", "topicName", ";", "Context", "ctx", "=", "null", ";", "if", "(", "jndiPath", "==",...
Starts the JMSReceiver with the current options.
[ "Starts", "the", "JMSReceiver", "with", "the", "current", "options", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/net/JMSReceiver.java#L186-L241
104,121
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/net/JMSReceiver.java
JMSReceiver.shutdown
public synchronized void shutdown() { if (isActive()) { // mark this as no longer running setActive(false); if (topicConnection != null) { try { topicConnection.close(); } catch (Exception e) { // do nothing } topicConnection = null; }...
java
public synchronized void shutdown() { if (isActive()) { // mark this as no longer running setActive(false); if (topicConnection != null) { try { topicConnection.close(); } catch (Exception e) { // do nothing } topicConnection = null; }...
[ "public", "synchronized", "void", "shutdown", "(", ")", "{", "if", "(", "isActive", "(", ")", ")", "{", "// mark this as no longer running", "setActive", "(", "false", ")", ";", "if", "(", "topicConnection", "!=", "null", ")", "{", "try", "{", "topicConnecti...
Called when the receiver should be stopped.
[ "Called", "when", "the", "receiver", "should", "be", "stopped", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/net/JMSReceiver.java#L245-L259
104,122
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/filter/ExpressionFilter.java
ExpressionFilter.decide
public int decide(final LoggingEvent event) { if (expressionRule.evaluate(event, null)) { if (acceptOnMatch) { return Filter.ACCEPT; } else { return Filter.DENY; } } return Filter.NEUTRAL; }
java
public int decide(final LoggingEvent event) { if (expressionRule.evaluate(event, null)) { if (acceptOnMatch) { return Filter.ACCEPT; } else { return Filter.DENY; } } return Filter.NEUTRAL; }
[ "public", "int", "decide", "(", "final", "LoggingEvent", "event", ")", "{", "if", "(", "expressionRule", ".", "evaluate", "(", "event", ",", "null", ")", ")", "{", "if", "(", "acceptOnMatch", ")", "{", "return", "Filter", ".", "ACCEPT", ";", "}", "else...
Determines if event matches the filter. @param event logging event; @return {@link Filter#NEUTRAL} is there is no string match.
[ "Determines", "if", "event", "matches", "the", "filter", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/filter/ExpressionFilter.java#L152-L161
104,123
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/spi/AbstractLoggerAdapter.java
AbstractLoggerAdapter.getLoggersInContext
public ConcurrentMap<String, L> getLoggersInContext(final LoggerContext context) { ConcurrentMap<String, L> loggers; lock.readLock ().lock (); try { loggers = registry.get (context); } finally { lock.readLock ().unlock (); } if (loggers != null) {...
java
public ConcurrentMap<String, L> getLoggersInContext(final LoggerContext context) { ConcurrentMap<String, L> loggers; lock.readLock ().lock (); try { loggers = registry.get (context); } finally { lock.readLock ().unlock (); } if (loggers != null) {...
[ "public", "ConcurrentMap", "<", "String", ",", "L", ">", "getLoggersInContext", "(", "final", "LoggerContext", "context", ")", "{", "ConcurrentMap", "<", "String", ",", "L", ">", "loggers", ";", "lock", ".", "readLock", "(", ")", ".", "lock", "(", ")", "...
Gets or creates the ConcurrentMap of named loggers for a given LoggerContext. @param context the LoggerContext to get loggers for @return the map of loggers for the given LoggerContext
[ "Gets", "or", "creates", "the", "ConcurrentMap", "of", "named", "loggers", "for", "a", "given", "LoggerContext", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/spi/AbstractLoggerAdapter.java#L62-L86
104,124
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/net/SocketHubReceiver.java
SocketHubReceiver.shutdown
public synchronized void shutdown() { // mark this as no longer running active = false; // close the socket try { if (socketNode != null) { socketNode.close(); socketNode = null; } } catch (Exception e) { getLogger().info("Excpetion closing socket", e); // ig...
java
public synchronized void shutdown() { // mark this as no longer running active = false; // close the socket try { if (socketNode != null) { socketNode.close(); socketNode = null; } } catch (Exception e) { getLogger().info("Excpetion closing socket", e); // ig...
[ "public", "synchronized", "void", "shutdown", "(", ")", "{", "// mark this as no longer running", "active", "=", "false", ";", "// close the socket", "try", "{", "if", "(", "socketNode", "!=", "null", ")", "{", "socketNode", ".", "close", "(", ")", ";", "socke...
Called when the receiver should be stopped. Closes the socket
[ "Called", "when", "the", "receiver", "should", "be", "stopped", ".", "Closes", "the", "socket" ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/net/SocketHubReceiver.java#L259-L282
104,125
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/net/SocketHubReceiver.java
SocketHubReceiver.fireConnector
private synchronized void fireConnector(final boolean isReconnect) { if (active && connector == null) { getLogger().debug("Starting a new connector thread."); connector = new Connector(isReconnect); connector.setDaemon(true); connector.setPriority(Thread.MIN_PRIORITY); connector.start(...
java
private synchronized void fireConnector(final boolean isReconnect) { if (active && connector == null) { getLogger().debug("Starting a new connector thread."); connector = new Connector(isReconnect); connector.setDaemon(true); connector.setPriority(Thread.MIN_PRIORITY); connector.start(...
[ "private", "synchronized", "void", "fireConnector", "(", "final", "boolean", "isReconnect", ")", "{", "if", "(", "active", "&&", "connector", "==", "null", ")", "{", "getLogger", "(", ")", ".", "debug", "(", "\"Starting a new connector thread.\"", ")", ";", "c...
Fire connectors. @param isReconnect true if reconnect.
[ "Fire", "connectors", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/net/SocketHubReceiver.java#L304-L312
104,126
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/net/SocketHubReceiver.java
SocketHubReceiver.setSocket
private synchronized void setSocket(final Socket newSocket) { connector = null; socketNode = new SocketNode13(newSocket, this); socketNode.addSocketNodeEventListener(this); synchronized (listenerList) { for (Iterator iter = listenerList.iterator(); iter.hasNext();) { SocketNodeEvent...
java
private synchronized void setSocket(final Socket newSocket) { connector = null; socketNode = new SocketNode13(newSocket, this); socketNode.addSocketNodeEventListener(this); synchronized (listenerList) { for (Iterator iter = listenerList.iterator(); iter.hasNext();) { SocketNodeEvent...
[ "private", "synchronized", "void", "setSocket", "(", "final", "Socket", "newSocket", ")", "{", "connector", "=", "null", ";", "socketNode", "=", "new", "SocketNode13", "(", "newSocket", ",", "this", ")", ";", "socketNode", ".", "addSocketNodeEventListener", "(",...
Set socket. @param newSocket new value for socket.
[ "Set", "socket", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/net/SocketHubReceiver.java#L318-L331
104,127
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/extras/SoundAppender.java
SoundAppender.activateOptions
public void activateOptions() { /* * AudioSystem.getAudioInputStream requires jdk 1.3, * so we use applet.newaudioclip instead * */ try { clip = Applet.newAudioClip(new URL(audioURL)); } catch (MalformedURLException mue) { LogLog.error("unable to initialize SoundAppender", mue);} if (...
java
public void activateOptions() { /* * AudioSystem.getAudioInputStream requires jdk 1.3, * so we use applet.newaudioclip instead * */ try { clip = Applet.newAudioClip(new URL(audioURL)); } catch (MalformedURLException mue) { LogLog.error("unable to initialize SoundAppender", mue);} if (...
[ "public", "void", "activateOptions", "(", ")", "{", "/*\n\t\t * AudioSystem.getAudioInputStream requires jdk 1.3,\n\t\t * so we use applet.newaudioclip instead\n\t\t *\n\t\t */", "try", "{", "clip", "=", "Applet", ".", "newAudioClip", "(", "new", "URL", "(", "audioURL", ")", ...
Attempt to initialize the appender by creating a reference to an AudioClip. Will log a message if format is not supported, file not found, etc.
[ "Attempt", "to", "initialize", "the", "appender", "by", "creating", "a", "reference", "to", "an", "AudioClip", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/extras/SoundAppender.java#L61-L74
104,128
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/rule/RuleFactory.java
RuleFactory.isRule
public boolean isRule(final String symbol) { return ((symbol != null) && (RULES.contains(symbol.toLowerCase(Locale.ENGLISH)))); }
java
public boolean isRule(final String symbol) { return ((symbol != null) && (RULES.contains(symbol.toLowerCase(Locale.ENGLISH)))); }
[ "public", "boolean", "isRule", "(", "final", "String", "symbol", ")", "{", "return", "(", "(", "symbol", "!=", "null", ")", "&&", "(", "RULES", ".", "contains", "(", "symbol", ".", "toLowerCase", "(", "Locale", ".", "ENGLISH", ")", ")", ")", ")", ";"...
Determine if specified string is a known operator. @param symbol string @return true if string is a known operator
[ "Determine", "if", "specified", "string", "is", "a", "known", "operator", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/rule/RuleFactory.java#L127-L129
104,129
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/rule/RuleFactory.java
RuleFactory.getRule
public Rule getRule(final String symbol, final Stack stack) { if (AND_RULE.equals(symbol)) { return AndRule.getRule(stack); } if (OR_RULE.equals(symbol)) { return OrRule.getRule(stack); } if (NOT_RULE.equals(symbol)) { return NotRule.getRule(stack); } if (NOT_EQUALS_RULE...
java
public Rule getRule(final String symbol, final Stack stack) { if (AND_RULE.equals(symbol)) { return AndRule.getRule(stack); } if (OR_RULE.equals(symbol)) { return OrRule.getRule(stack); } if (NOT_RULE.equals(symbol)) { return NotRule.getRule(stack); } if (NOT_EQUALS_RULE...
[ "public", "Rule", "getRule", "(", "final", "String", "symbol", ",", "final", "Stack", "stack", ")", "{", "if", "(", "AND_RULE", ".", "equals", "(", "symbol", ")", ")", "{", "return", "AndRule", ".", "getRule", "(", "stack", ")", ";", "}", "if", "(", ...
Create rule from applying operator to stack. @param symbol symbol @param stack stack @return new instance
[ "Create", "rule", "from", "applying", "operator", "to", "stack", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/rule/RuleFactory.java#L137-L186
104,130
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/rolling/RollingFileAppender.java
RollingFileAppender.activateOptions
public void activateOptions() { if (rollingPolicy == null) { LogLog.warn( "Please set a rolling policy for the RollingFileAppender named '" + getName() + "'"); return; } // // if no explicit triggering policy and ...
java
public void activateOptions() { if (rollingPolicy == null) { LogLog.warn( "Please set a rolling policy for the RollingFileAppender named '" + getName() + "'"); return; } // // if no explicit triggering policy and ...
[ "public", "void", "activateOptions", "(", ")", "{", "if", "(", "rollingPolicy", "==", "null", ")", "{", "LogLog", ".", "warn", "(", "\"Please set a rolling policy for the RollingFileAppender named '\"", "+", "getName", "(", ")", "+", "\"'\"", ")", ";", "return", ...
Prepare instance of use.
[ "Prepare", "instance", "of", "use", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/rolling/RollingFileAppender.java#L122-L193
104,131
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/rolling/RollingFileAppender.java
RollingFileAppender.createFileOutputStream
private FileOutputStream createFileOutputStream(String newFileName, boolean append) throws FileNotFoundException { try { // // attempt to create file // return new FileOutputStream(newFileName, append); } catch (FileNotFoundException ex) { ...
java
private FileOutputStream createFileOutputStream(String newFileName, boolean append) throws FileNotFoundException { try { // // attempt to create file // return new FileOutputStream(newFileName, append); } catch (FileNotFoundException ex) { ...
[ "private", "FileOutputStream", "createFileOutputStream", "(", "String", "newFileName", ",", "boolean", "append", ")", "throws", "FileNotFoundException", "{", "try", "{", "//", "// attempt to create file", "//", "return", "new", "FileOutputStream", "(", "newFileName", ...
Creates a new FileOutputStream of a new log file, possibly creating first all the needed parent directories @param newFileName Filename of new log file to be created @param append If file should be appended @return newly created FileOutputStream @throws FileNotFoundException if creating log file or parent directo...
[ "Creates", "a", "new", "FileOutputStream", "of", "a", "new", "log", "file", "possibly", "creating", "first", "all", "the", "needed", "parent", "directories" ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/rolling/RollingFileAppender.java#L350-L375
104,132
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java
StringBuilders.appendValue
public static void appendValue(final StringBuilder stringBuilder, final Object obj) { if (obj == null || obj instanceof String) { stringBuilder.append((String) obj); } else if (obj instanceof StringBuilderFormattable) { ((StringBuilderFormattable) obj).formatTo(stringBuilder); ...
java
public static void appendValue(final StringBuilder stringBuilder, final Object obj) { if (obj == null || obj instanceof String) { stringBuilder.append((String) obj); } else if (obj instanceof StringBuilderFormattable) { ((StringBuilderFormattable) obj).formatTo(stringBuilder); ...
[ "public", "static", "void", "appendValue", "(", "final", "StringBuilder", "stringBuilder", ",", "final", "Object", "obj", ")", "{", "if", "(", "obj", "==", "null", "||", "obj", "instanceof", "String", ")", "{", "stringBuilder", ".", "append", "(", "(", "St...
Appends a text representation of the specified object to the specified StringBuilder, if possible without allocating temporary objects. @param stringBuilder the StringBuilder to append the value to @param obj the object whose text representation to append to the StringBuilder
[ "Appends", "a", "text", "representation", "of", "the", "specified", "object", "to", "the", "specified", "StringBuilder", "if", "possible", "without", "allocating", "temporary", "objects", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java#L71-L95
104,133
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java
StringBuilders.equalsIgnoreCase
public static boolean equalsIgnoreCase(final CharSequence left, final int leftOffset, final int leftLength, final CharSequence right, final int rightOffset, final int rightLength) { if (leftLength == rightLength) { for (int i = 0; i < rightLength; i++) {...
java
public static boolean equalsIgnoreCase(final CharSequence left, final int leftOffset, final int leftLength, final CharSequence right, final int rightOffset, final int rightLength) { if (leftLength == rightLength) { for (int i = 0; i < rightLength; i++) {...
[ "public", "static", "boolean", "equalsIgnoreCase", "(", "final", "CharSequence", "left", ",", "final", "int", "leftOffset", ",", "final", "int", "leftLength", ",", "final", "CharSequence", "right", ",", "final", "int", "rightOffset", ",", "final", "int", "rightL...
Returns true if the specified section of the left CharSequence equals, ignoring case, the specified section of the right CharSequence. @param left the left CharSequence @param leftOffset start index in the left CharSequence @param leftLength length of the section in the left CharSequence @param right the right CharSeq...
[ "Returns", "true", "if", "the", "specified", "section", "of", "the", "left", "CharSequence", "equals", "ignoring", "case", "the", "specified", "section", "of", "the", "right", "CharSequence", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java#L134-L145
104,134
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/log4j/MDC.java
MDC.setContext
private static boolean setContext() { if (m_context == null && m_paxLogging != null) { m_context = (m_paxLogging.getPaxLoggingService() != null) ? m_paxLogging.getPaxLoggingService().getPaxContext() : null; } return m_context != null; }
java
private static boolean setContext() { if (m_context == null && m_paxLogging != null) { m_context = (m_paxLogging.getPaxLoggingService() != null) ? m_paxLogging.getPaxLoggingService().getPaxContext() : null; } return m_context != null; }
[ "private", "static", "boolean", "setContext", "(", ")", "{", "if", "(", "m_context", "==", "null", "&&", "m_paxLogging", "!=", "null", ")", "{", "m_context", "=", "(", "m_paxLogging", ".", "getPaxLoggingService", "(", ")", "!=", "null", ")", "?", "m_paxLog...
For all the methods that operate against the context, return true if the MDC should use the PaxContext object ffrom the PaxLoggingManager, or if the logging manager is not set, or does not have its context available yet, use a default context local to this MDC. @return true if the MDC should use the PaxContext object f...
[ "For", "all", "the", "methods", "that", "operate", "against", "the", "context", "return", "true", "if", "the", "MDC", "should", "use", "the", "PaxContext", "object", "ffrom", "the", "PaxLoggingManager", "or", "if", "the", "logging", "manager", "is", "not", "...
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/log4j/MDC.java#L46-L51
104,135
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/xml/XMLDecoder.java
XMLDecoder.decode
public Vector decode(final URL url) throws IOException { LineNumberReader reader; boolean isZipFile = url.getPath().toLowerCase().endsWith(".zip"); InputStream inputStream; if (isZipFile) { inputStream = new ZipInputStream(url.openStream()); //move stream to next entry so we can read it ...
java
public Vector decode(final URL url) throws IOException { LineNumberReader reader; boolean isZipFile = url.getPath().toLowerCase().endsWith(".zip"); InputStream inputStream; if (isZipFile) { inputStream = new ZipInputStream(url.openStream()); //move stream to next entry so we can read it ...
[ "public", "Vector", "decode", "(", "final", "URL", "url", ")", "throws", "IOException", "{", "LineNumberReader", "reader", ";", "boolean", "isZipFile", "=", "url", ".", "getPath", "(", ")", ".", "toLowerCase", "(", ")", ".", "endsWith", "(", "\".zip\"", ")...
Decodes a File into a Vector of LoggingEvents. @param url the url of a file containing events to decode @return Vector of LoggingEvents @throws IOException if IO error during processing.
[ "Decodes", "a", "File", "into", "a", "Vector", "of", "LoggingEvents", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/xml/XMLDecoder.java#L180-L226
104,136
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/xml/XMLDecoder.java
XMLDecoder.decode
public LoggingEvent decode(final String data) { Document document = parse(data); if (document == null) { return null; } Vector events = decodeEvents(document); if (events.size() > 0) { return (LoggingEvent) events.firstElement(); } return null; }
java
public LoggingEvent decode(final String data) { Document document = parse(data); if (document == null) { return null; } Vector events = decodeEvents(document); if (events.size() > 0) { return (LoggingEvent) events.firstElement(); } return null; }
[ "public", "LoggingEvent", "decode", "(", "final", "String", "data", ")", "{", "Document", "document", "=", "parse", "(", "data", ")", ";", "if", "(", "document", "==", "null", ")", "{", "return", "null", ";", "}", "Vector", "events", "=", "decodeEvents",...
Converts the string data into an XML Document, and then soaks out the relevant bits to form a new LoggingEvent instance which can be used by any Log4j element locally. @param data XML fragment @return a single LoggingEvent or null
[ "Converts", "the", "string", "data", "into", "an", "XML", "Document", "and", "then", "soaks", "out", "the", "relevant", "bits", "to", "form", "a", "new", "LoggingEvent", "instance", "which", "can", "be", "used", "by", "any", "Log4j", "element", "locally", ...
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/xml/XMLDecoder.java#L282-L296
104,137
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/xml/XMLDecoder.java
XMLDecoder.getCData
private String getCData(final Node n) { StringBuffer buf = new StringBuffer(); NodeList nl = n.getChildNodes(); for (int x = 0; x < nl.getLength(); x++) { Node innerNode = nl.item(x); if ( (innerNode.getNodeType() == Node.TEXT_NODE) || (innerNode.getNodeType() == Node.CDATA_S...
java
private String getCData(final Node n) { StringBuffer buf = new StringBuffer(); NodeList nl = n.getChildNodes(); for (int x = 0; x < nl.getLength(); x++) { Node innerNode = nl.item(x); if ( (innerNode.getNodeType() == Node.TEXT_NODE) || (innerNode.getNodeType() == Node.CDATA_S...
[ "private", "String", "getCData", "(", "final", "Node", "n", ")", "{", "StringBuffer", "buf", "=", "new", "StringBuffer", "(", ")", ";", "NodeList", "nl", "=", "n", ".", "getChildNodes", "(", ")", ";", "for", "(", "int", "x", "=", "0", ";", "x", "<"...
Get contents of CDATASection. @param n CDATASection @return text content of all text or CDATA children of node.
[ "Get", "contents", "of", "CDATASection", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/xml/XMLDecoder.java#L472-L487
104,138
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/xml/UtilLoggingXMLDecoder.java
UtilLoggingXMLDecoder.decodeEvents
public Vector decodeEvents(final String document) { if (document != null) { if (document.trim().equals("")) { return null; } String newDoc; String newPartialEvent = null; //separate the string into the last portion ending with </record> ...
java
public Vector decodeEvents(final String document) { if (document != null) { if (document.trim().equals("")) { return null; } String newDoc; String newPartialEvent = null; //separate the string into the last portion ending with </record> ...
[ "public", "Vector", "decodeEvents", "(", "final", "String", "document", ")", "{", "if", "(", "document", "!=", "null", ")", "{", "if", "(", "document", ".", "trim", "(", ")", ".", "equals", "(", "\"\"", ")", ")", "{", "return", "null", ";", "}", "S...
Decodes a String representing a number of events into a Vector of LoggingEvents. @param document to decode events from @return Vector of LoggingEvents
[ "Decodes", "a", "String", "representing", "a", "number", "of", "events", "into", "a", "Vector", "of", "LoggingEvents", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/xml/UtilLoggingXMLDecoder.java#L228-L270
104,139
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/message/SimpleMessage.java
SimpleMessage.getFormattedMessage
@Override public String getFormattedMessage() { return message = message == null ? String.valueOf(charSequence) : message ; }
java
@Override public String getFormattedMessage() { return message = message == null ? String.valueOf(charSequence) : message ; }
[ "@", "Override", "public", "String", "getFormattedMessage", "(", ")", "{", "return", "message", "=", "message", "==", "null", "?", "String", ".", "valueOf", "(", "charSequence", ")", ":", "message", ";", "}" ]
Returns the message. @return the message.
[ "Returns", "the", "message", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/message/SimpleMessage.java#L62-L65
104,140
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/Category.java
Category.removeAllAppenders
public void removeAllAppenders() { for (Appender appender : aai.getAppenders()) { aai.removeAppender(appender); fireRemoveAppenderEvent(appender); } }
java
public void removeAllAppenders() { for (Appender appender : aai.getAppenders()) { aai.removeAppender(appender); fireRemoveAppenderEvent(appender); } }
[ "public", "void", "removeAllAppenders", "(", ")", "{", "for", "(", "Appender", "appender", ":", "aai", ".", "getAppenders", "(", ")", ")", "{", "aai", ".", "removeAppender", "(", "appender", ")", ";", "fireRemoveAppenderEvent", "(", "appender", ")", ";", "...
Remove all previously added appenders from this Category instance. <p> This is useful when re-reading configuration information.
[ "Remove", "all", "previously", "added", "appenders", "from", "this", "Category", "instance", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/Category.java#L750-L755
104,141
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/Category.java
Category.removeAppender
public void removeAppender(Appender appender) { boolean wasAttached = aai.isAttached(appender); if (wasAttached) { aai.removeAppender(appender); fireRemoveAppenderEvent(appender); } }
java
public void removeAppender(Appender appender) { boolean wasAttached = aai.isAttached(appender); if (wasAttached) { aai.removeAppender(appender); fireRemoveAppenderEvent(appender); } }
[ "public", "void", "removeAppender", "(", "Appender", "appender", ")", "{", "boolean", "wasAttached", "=", "aai", ".", "isAttached", "(", "appender", ")", ";", "if", "(", "wasAttached", ")", "{", "aai", ".", "removeAppender", "(", "appender", ")", ";", "fir...
Remove the appender passed as parameter form the list of appenders. @since 0.8.2
[ "Remove", "the", "appender", "passed", "as", "parameter", "form", "the", "list", "of", "appenders", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/Category.java#L762-L768
104,142
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/component/spi/ComponentBase.java
ComponentBase.setLoggerRepository
public void setLoggerRepository(final LoggerRepository repository) { if (this.repository == null) { this.repository = repository; } else if (this.repository != repository) { throw new IllegalStateException("Repository has been already set"); } }
java
public void setLoggerRepository(final LoggerRepository repository) { if (this.repository == null) { this.repository = repository; } else if (this.repository != repository) { throw new IllegalStateException("Repository has been already set"); } }
[ "public", "void", "setLoggerRepository", "(", "final", "LoggerRepository", "repository", ")", "{", "if", "(", "this", ".", "repository", "==", "null", ")", "{", "this", ".", "repository", "=", "repository", ";", "}", "else", "if", "(", "this", ".", "reposi...
Set the owning repository. The owning repository cannot be set more than once. @param repository repository
[ "Set", "the", "owning", "repository", ".", "The", "owning", "repository", "cannot", "be", "set", "more", "than", "once", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/component/spi/ComponentBase.java#L71-L77
104,143
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/util/SortedArrayStringMap.java
SortedArrayStringMap.inflateTable
private void inflateTable(final int toSize) { threshold = toSize; keys = new String[toSize]; values = new Object[toSize]; }
java
private void inflateTable(final int toSize) { threshold = toSize; keys = new String[toSize]; values = new Object[toSize]; }
[ "private", "void", "inflateTable", "(", "final", "int", "toSize", ")", "{", "threshold", "=", "toSize", ";", "keys", "=", "new", "String", "[", "toSize", "]", ";", "values", "=", "new", "Object", "[", "toSize", "]", ";", "}" ]
Inflates the table.
[ "Inflates", "the", "table", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/util/SortedArrayStringMap.java#L333-L337
104,144
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/spi/LoggerRegistry.java
LoggerRegistry.getLogger
public T getLogger(final String name, final MessageFactory messageFactory) { return getOrCreateInnerMap(factoryKey(messageFactory)).get(name); }
java
public T getLogger(final String name, final MessageFactory messageFactory) { return getOrCreateInnerMap(factoryKey(messageFactory)).get(name); }
[ "public", "T", "getLogger", "(", "final", "String", "name", ",", "final", "MessageFactory", "messageFactory", ")", "{", "return", "getOrCreateInnerMap", "(", "factoryKey", "(", "messageFactory", ")", ")", ".", "get", "(", "name", ")", ";", "}" ]
Returns an ExtendedLogger. @param name The name of the Logger to return. @param messageFactory The message factory is used only when creating a logger, subsequent use does not change the logger but will log a warning if mismatched. @return The logger with the specified name.
[ "Returns", "an", "ExtendedLogger", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/spi/LoggerRegistry.java#L124-L126
104,145
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/spi/LoggerRegistry.java
LoggerRegistry.hasLogger
public boolean hasLogger(final String name, final MessageFactory messageFactory) { return getOrCreateInnerMap(factoryKey(messageFactory)).containsKey(name); }
java
public boolean hasLogger(final String name, final MessageFactory messageFactory) { return getOrCreateInnerMap(factoryKey(messageFactory)).containsKey(name); }
[ "public", "boolean", "hasLogger", "(", "final", "String", "name", ",", "final", "MessageFactory", "messageFactory", ")", "{", "return", "getOrCreateInnerMap", "(", "factoryKey", "(", "messageFactory", ")", ")", ".", "containsKey", "(", "name", ")", ";", "}" ]
Detects if a Logger with the specified name and MessageFactory exists. @param name The Logger name to search for. @param messageFactory The message factory to search for. @return true if the Logger exists, false otherwise. @since 2.5
[ "Detects", "if", "a", "Logger", "with", "the", "specified", "name", "and", "MessageFactory", "exists", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/spi/LoggerRegistry.java#L164-L166
104,146
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/spi/LoggerRegistry.java
LoggerRegistry.hasLogger
public boolean hasLogger(final String name, final Class<? extends MessageFactory> messageFactoryClass) { return getOrCreateInnerMap(factoryClassKey(messageFactoryClass)).containsKey(name); }
java
public boolean hasLogger(final String name, final Class<? extends MessageFactory> messageFactoryClass) { return getOrCreateInnerMap(factoryClassKey(messageFactoryClass)).containsKey(name); }
[ "public", "boolean", "hasLogger", "(", "final", "String", "name", ",", "final", "Class", "<", "?", "extends", "MessageFactory", ">", "messageFactoryClass", ")", "{", "return", "getOrCreateInnerMap", "(", "factoryClassKey", "(", "messageFactoryClass", ")", ")", "."...
Detects if a Logger with the specified name and MessageFactory type exists. @param name The Logger name to search for. @param messageFactoryClass The message factory class to search for. @return true if the Logger exists, false otherwise. @since 2.5
[ "Detects", "if", "a", "Logger", "with", "the", "specified", "name", "and", "MessageFactory", "type", "exists", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/spi/LoggerRegistry.java#L175-L177
104,147
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/log4j/Logger.java
Logger.getLogger
public static Logger getLogger( String name ) { PaxLogger paxLogger; if( m_paxLogging == null ) { paxLogger = FallbackLogFactory.createFallbackLog( null, name ); } else { paxLogger = m_paxLogging.getLogger( name, LOG4J_FQCN ); } ...
java
public static Logger getLogger( String name ) { PaxLogger paxLogger; if( m_paxLogging == null ) { paxLogger = FallbackLogFactory.createFallbackLog( null, name ); } else { paxLogger = m_paxLogging.getLogger( name, LOG4J_FQCN ); } ...
[ "public", "static", "Logger", "getLogger", "(", "String", "name", ")", "{", "PaxLogger", "paxLogger", ";", "if", "(", "m_paxLogging", "==", "null", ")", "{", "paxLogger", "=", "FallbackLogFactory", ".", "createFallbackLog", "(", "null", ",", "name", ")", ";"...
Retrieve a logger by name. If the named logger already exists, then the existing instance will be reutrned. Otherwise, a new instance is created. <p>By default, loggers do not have a set level but inherit it from their ancestors. This is one of the central features of log4j. </p> @param name The name of the logger to...
[ "Retrieve", "a", "logger", "by", "name", ".", "If", "the", "named", "logger", "already", "exists", "then", "the", "existing", "instance", "will", "be", "reutrned", ".", "Otherwise", "a", "new", "instance", "is", "created", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/log4j/Logger.java#L121-L135
104,148
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/net/UDPAppender.java
UDPAppender.cleanUp
public void cleanUp() { if (outSocket != null) { try { outSocket.close(); } catch (Exception e) { LogLog.error("Could not close outSocket.", e); } outSocket = null; } }
java
public void cleanUp() { if (outSocket != null) { try { outSocket.close(); } catch (Exception e) { LogLog.error("Could not close outSocket.", e); } outSocket = null; } }
[ "public", "void", "cleanUp", "(", ")", "{", "if", "(", "outSocket", "!=", "null", ")", "{", "try", "{", "outSocket", ".", "close", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "LogLog", ".", "error", "(", "\"Could not close outSocket.\...
Close the UDP Socket and release the underlying connector thread if it has been created
[ "Close", "the", "UDP", "Socket", "and", "release", "the", "underlying", "connector", "thread", "if", "it", "has", "been", "created" ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/net/UDPAppender.java#L176-L186
104,149
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/net/XMLSocketReceiver.java
XMLSocketReceiver.doShutdown
private synchronized void doShutdown() { active = false; getLogger().debug("{} doShutdown called", getName()); // close the server socket closeServerSocket(); // close all of the accepted sockets closeAllAcceptedSockets(); if (advertiseViaMulticastDNS) { zeroConf....
java
private synchronized void doShutdown() { active = false; getLogger().debug("{} doShutdown called", getName()); // close the server socket closeServerSocket(); // close all of the accepted sockets closeAllAcceptedSockets(); if (advertiseViaMulticastDNS) { zeroConf....
[ "private", "synchronized", "void", "doShutdown", "(", ")", "{", "active", "=", "false", ";", "getLogger", "(", ")", ".", "debug", "(", "\"{} doShutdown called\"", ",", "getName", "(", ")", ")", ";", "// close the server socket", "closeServerSocket", "(", ")", ...
Does the actual shutting down by closing the server socket and any connected sockets that have been created.
[ "Does", "the", "actual", "shutting", "down", "by", "closing", "the", "server", "socket", "and", "any", "connected", "sockets", "that", "have", "been", "created", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/net/XMLSocketReceiver.java#L196-L210
104,150
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/net/XMLSocketReceiver.java
XMLSocketReceiver.closeServerSocket
private void closeServerSocket() { getLogger().debug("{} closing server socket", getName()); try { if (serverSocket != null) { serverSocket.close(); } } catch (Exception e) { // ignore for now } serverSocket = null; }
java
private void closeServerSocket() { getLogger().debug("{} closing server socket", getName()); try { if (serverSocket != null) { serverSocket.close(); } } catch (Exception e) { // ignore for now } serverSocket = null; }
[ "private", "void", "closeServerSocket", "(", ")", "{", "getLogger", "(", ")", ".", "debug", "(", "\"{} closing server socket\"", ",", "getName", "(", ")", ")", ";", "try", "{", "if", "(", "serverSocket", "!=", "null", ")", "{", "serverSocket", ".", "close"...
Closes the server socket, if created.
[ "Closes", "the", "server", "socket", "if", "created", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/net/XMLSocketReceiver.java#L215-L227
104,151
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/component/scheduler/Scheduler.java
Scheduler.findIndex
int findIndex(final Job job) { int size = jobList.size(); boolean found = false; int i = 0; for (; i < size; i++) { ScheduledJobEntry se = (ScheduledJobEntry) jobList.get(i); if (se.job == job) { found = true; break; } ...
java
int findIndex(final Job job) { int size = jobList.size(); boolean found = false; int i = 0; for (; i < size; i++) { ScheduledJobEntry se = (ScheduledJobEntry) jobList.get(i); if (se.job == job) { found = true; break; } ...
[ "int", "findIndex", "(", "final", "Job", "job", ")", "{", "int", "size", "=", "jobList", ".", "size", "(", ")", ";", "boolean", "found", "=", "false", ";", "int", "i", "=", "0", ";", "for", "(", ";", "i", "<", "size", ";", "i", "++", ")", "{"...
Find the index of a given job. @param job job @return -1 if the job could not be found.
[ "Find", "the", "index", "of", "a", "given", "job", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/component/scheduler/Scheduler.java#L57-L74
104,152
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/component/scheduler/Scheduler.java
Scheduler.delete
public synchronized boolean delete(final Job job) { // if already shutdown in the process of shutdown, there is no // need to remove Jobs as they will never be executed. if (shutdown) { return false; } int i = findIndex(job); if (i != -1) { Schedul...
java
public synchronized boolean delete(final Job job) { // if already shutdown in the process of shutdown, there is no // need to remove Jobs as they will never be executed. if (shutdown) { return false; } int i = findIndex(job); if (i != -1) { Schedul...
[ "public", "synchronized", "boolean", "delete", "(", "final", "Job", "job", ")", "{", "// if already shutdown in the process of shutdown, there is no", "// need to remove Jobs as they will never be executed.", "if", "(", "shutdown", ")", "{", "return", "false", ";", "}", "in...
Delete the given job. @param job job. @return true if the job could be deleted, and false if the job could not be found or if the Scheduler is about to shutdown in which case deletions are not permitted.
[ "Delete", "the", "given", "job", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/component/scheduler/Scheduler.java#L83-L104
104,153
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/component/scheduler/Scheduler.java
Scheduler.run
public synchronized void run() { while (!shutdown) { if (jobList.isEmpty()) { linger(); } else { ScheduledJobEntry sje = (ScheduledJobEntry) jobList.get(0); long now = System.currentTimeMillis(); if (now >= sje.desiredExecut...
java
public synchronized void run() { while (!shutdown) { if (jobList.isEmpty()) { linger(); } else { ScheduledJobEntry sje = (ScheduledJobEntry) jobList.get(0); long now = System.currentTimeMillis(); if (now >= sje.desiredExecut...
[ "public", "synchronized", "void", "run", "(", ")", "{", "while", "(", "!", "shutdown", ")", "{", "if", "(", "jobList", ".", "isEmpty", "(", ")", ")", "{", "linger", "(", ")", ";", "}", "else", "{", "ScheduledJobEntry", "sje", "=", "(", "ScheduledJobE...
Run scheduler.
[ "Run", "scheduler", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/component/scheduler/Scheduler.java#L200-L223
104,154
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/component/scheduler/Scheduler.java
Scheduler.executeInABox
void executeInABox(final Job job) { try { job.execute(); } catch (Exception e) { System.err.println("The execution of the job threw an exception"); e.printStackTrace(System.err); } }
java
void executeInABox(final Job job) { try { job.execute(); } catch (Exception e) { System.err.println("The execution of the job threw an exception"); e.printStackTrace(System.err); } }
[ "void", "executeInABox", "(", "final", "Job", "job", ")", "{", "try", "{", "job", ".", "execute", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "System", ".", "err", ".", "println", "(", "\"The execution of the job threw an exception\"", ")...
We do not want a single failure to affect the whole scheduler. @param job job to execute.
[ "We", "do", "not", "want", "a", "single", "failure", "to", "affect", "the", "whole", "scheduler", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/component/scheduler/Scheduler.java#L229-L236
104,155
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/varia/LogFilePatternReceiver.java
LogFilePatternReceiver.process
protected void process(BufferedReader bufferedReader) throws IOException { Matcher eventMatcher; Matcher exceptionMatcher; String line; while ((line = bufferedReader.readLine()) != null) { //skip empty line entries eventMatcher = regexpPattern.matcher(line); ...
java
protected void process(BufferedReader bufferedReader) throws IOException { Matcher eventMatcher; Matcher exceptionMatcher; String line; while ((line = bufferedReader.readLine()) != null) { //skip empty line entries eventMatcher = regexpPattern.matcher(line); ...
[ "protected", "void", "process", "(", "BufferedReader", "bufferedReader", ")", "throws", "IOException", "{", "Matcher", "eventMatcher", ";", "Matcher", "exceptionMatcher", ";", "String", "line", ";", "while", "(", "(", "line", "=", "bufferedReader", ".", "readLine"...
Read, parse and optionally tail the log file, converting entries into logging events. A runtimeException is thrown if the logFormat pattern is malformed. @param bufferedReader @throws IOException
[ "Read", "parse", "and", "optionally", "tail", "the", "log", "file", "converting", "entries", "into", "logging", "events", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/varia/LogFilePatternReceiver.java#L479-L534
104,156
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/varia/LogFilePatternReceiver.java
LogFilePatternReceiver.passesExpression
private boolean passesExpression(LoggingEvent event) { if (event != null) { if (expressionRule != null) { return (expressionRule.evaluate(event, null)); } } return true; }
java
private boolean passesExpression(LoggingEvent event) { if (event != null) { if (expressionRule != null) { return (expressionRule.evaluate(event, null)); } } return true; }
[ "private", "boolean", "passesExpression", "(", "LoggingEvent", "event", ")", "{", "if", "(", "event", "!=", "null", ")", "{", "if", "(", "expressionRule", "!=", "null", ")", "{", "return", "(", "expressionRule", ".", "evaluate", "(", "event", ",", "null", ...
Helper method that supports the evaluation of the expression @param event @return true if expression isn't set, or the result of the evaluation otherwise
[ "Helper", "method", "that", "supports", "the", "evaluation", "of", "the", "expression" ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/varia/LogFilePatternReceiver.java#L546-L553
104,157
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/varia/LogFilePatternReceiver.java
LogFilePatternReceiver.convertTimestamp
private String convertTimestamp() { //some locales (for example, French) generate timestamp text with characters not included in \w - // now using \S (all non-whitespace characters) instead of /w String result = timestampFormat.replaceAll(VALID_DATEFORMAT_CHAR_PATTERN + "+", "\\\\S+"); //make sure dots...
java
private String convertTimestamp() { //some locales (for example, French) generate timestamp text with characters not included in \w - // now using \S (all non-whitespace characters) instead of /w String result = timestampFormat.replaceAll(VALID_DATEFORMAT_CHAR_PATTERN + "+", "\\\\S+"); //make sure dots...
[ "private", "String", "convertTimestamp", "(", ")", "{", "//some locales (for example, French) generate timestamp text with characters not included in \\w -", "// now using \\S (all non-whitespace characters) instead of /w ", "String", "result", "=", "timestampFormat", ".", "replaceAll", ...
Helper method that will convert timestamp format to a pattern @return string
[ "Helper", "method", "that", "will", "convert", "timestamp", "format", "to", "a", "pattern" ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/varia/LogFilePatternReceiver.java#L582-L589
104,158
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/varia/LogFilePatternReceiver.java
LogFilePatternReceiver.replaceMetaChars
private String replaceMetaChars(String input) { //escape backslash first since that character is used to escape the remaining meta chars input = input.replaceAll("\\\\", "\\\\\\"); //don't escape star - it's used as the wildcard input = input.replaceAll(Pattern.quote("]"), "\\\\]"); input = input.r...
java
private String replaceMetaChars(String input) { //escape backslash first since that character is used to escape the remaining meta chars input = input.replaceAll("\\\\", "\\\\\\"); //don't escape star - it's used as the wildcard input = input.replaceAll(Pattern.quote("]"), "\\\\]"); input = input.r...
[ "private", "String", "replaceMetaChars", "(", "String", "input", ")", "{", "//escape backslash first since that character is used to escape the remaining meta chars", "input", "=", "input", ".", "replaceAll", "(", "\"\\\\\\\\\"", ",", "\"\\\\\\\\\\\\\"", ")", ";", "//don't es...
Some perl5 characters may occur in the log file format. Escape these characters to prevent parsing errors. @param input @return string
[ "Some", "perl5", "characters", "may", "occur", "in", "the", "log", "file", "format", ".", "Escape", "these", "characters", "to", "prevent", "parsing", "errors", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/varia/LogFilePatternReceiver.java#L811-L831
104,159
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/varia/LogFilePatternReceiver.java
LogFilePatternReceiver.shutdown
public void shutdown() { getLogger().info(getPath() + " shutdown"); active = false; try { if (reader != null) { reader.close(); reader = null; } } catch (IOException ioe) { ioe.printStackTrace(); } }
java
public void shutdown() { getLogger().info(getPath() + " shutdown"); active = false; try { if (reader != null) { reader.close(); reader = null; } } catch (IOException ioe) { ioe.printStackTrace(); } }
[ "public", "void", "shutdown", "(", ")", "{", "getLogger", "(", ")", ".", "info", "(", "getPath", "(", ")", "+", "\" shutdown\"", ")", ";", "active", "=", "false", ";", "try", "{", "if", "(", "reader", "!=", "null", ")", "{", "reader", ".", "close",...
Close the reader.
[ "Close", "the", "reader", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/varia/LogFilePatternReceiver.java#L966-L977
104,160
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/varia/LogFilePatternReceiver.java
LogFilePatternReceiver.activateOptions
public void activateOptions() { getLogger().info("activateOptions"); active = true; Runnable runnable = new Runnable() { public void run() { initialize(); while (reader == null) { getLogger().info("attempting to load file: " + getFileURL()); try { ...
java
public void activateOptions() { getLogger().info("activateOptions"); active = true; Runnable runnable = new Runnable() { public void run() { initialize(); while (reader == null) { getLogger().info("attempting to load file: " + getFileURL()); try { ...
[ "public", "void", "activateOptions", "(", ")", "{", "getLogger", "(", ")", ".", "info", "(", "\"activateOptions\"", ")", ";", "active", "=", "true", ";", "Runnable", "runnable", "=", "new", "Runnable", "(", ")", "{", "public", "void", "run", "(", ")", ...
Read and process the log file.
[ "Read", "and", "process", "the", "log", "file", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/varia/LogFilePatternReceiver.java#L982-L1032
104,161
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/rule/AbstractRule.java
AbstractRule.firePropertyChange
protected void firePropertyChange( final String propertyName, final Object oldVal, final Object newVal) { propertySupport.firePropertyChange(propertyName, oldVal, newVal); }
java
protected void firePropertyChange( final String propertyName, final Object oldVal, final Object newVal) { propertySupport.firePropertyChange(propertyName, oldVal, newVal); }
[ "protected", "void", "firePropertyChange", "(", "final", "String", "propertyName", ",", "final", "Object", "oldVal", ",", "final", "Object", "newVal", ")", "{", "propertySupport", ".", "firePropertyChange", "(", "propertyName", ",", "oldVal", ",", "newVal", ")", ...
Send property change notification to attached listeners. @param propertyName property name. @param oldVal old value. @param newVal new value.
[ "Send", "property", "change", "notification", "to", "attached", "listeners", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/rule/AbstractRule.java#L66-L71
104,162
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/rolling/TimeBasedRollingPolicy.java
TimeBasedRollingPolicy.activateOptions
public void activateOptions() { super.activateOptions(); PatternConverter dtc = getDatePatternConverter(); if (dtc == null) { throw new IllegalStateException( "FileNamePattern [" + getFileNamePattern() + "] does not contain a valid date format specifier"); } long n = System....
java
public void activateOptions() { super.activateOptions(); PatternConverter dtc = getDatePatternConverter(); if (dtc == null) { throw new IllegalStateException( "FileNamePattern [" + getFileNamePattern() + "] does not contain a valid date format specifier"); } long n = System....
[ "public", "void", "activateOptions", "(", ")", "{", "super", ".", "activateOptions", "(", ")", ";", "PatternConverter", "dtc", "=", "getDatePatternConverter", "(", ")", ";", "if", "(", "dtc", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "...
Prepares instance of use.
[ "Prepares", "instance", "of", "use", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/rolling/TimeBasedRollingPolicy.java#L166-L189
104,163
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/status/StatusConsoleListener.java
StatusConsoleListener.log
@Override public void log(final StatusData data) { if (!filtered(data)) { stream.println(data.getFormattedStatus()); } }
java
@Override public void log(final StatusData data) { if (!filtered(data)) { stream.println(data.getFormattedStatus()); } }
[ "@", "Override", "public", "void", "log", "(", "final", "StatusData", "data", ")", "{", "if", "(", "!", "filtered", "(", "data", ")", ")", "{", "stream", ".", "println", "(", "data", ".", "getFormattedStatus", "(", ")", ")", ";", "}", "}" ]
Writes status messages to the console. @param data The StatusData.
[ "Writes", "status", "messages", "to", "the", "console", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/status/StatusConsoleListener.java#L78-L83
104,164
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/rolling/helper/FileRenameAction.java
FileRenameAction.execute
public static boolean execute( final File source, final File destination, boolean renameEmptyFiles) { if (renameEmptyFiles || (source.length() > 0)) { return source.renameTo(destination); } return source.delete(); }
java
public static boolean execute( final File source, final File destination, boolean renameEmptyFiles) { if (renameEmptyFiles || (source.length() > 0)) { return source.renameTo(destination); } return source.delete(); }
[ "public", "static", "boolean", "execute", "(", "final", "File", "source", ",", "final", "File", "destination", ",", "boolean", "renameEmptyFiles", ")", "{", "if", "(", "renameEmptyFiles", "||", "(", "source", ".", "length", "(", ")", ">", "0", ")", ")", ...
Rename file. @param source current file name. @param destination new file name. @param renameEmptyFiles if true, rename file even if empty, otherwise delete empty files. @return true if successfully renamed.
[ "Rename", "file", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/rolling/helper/FileRenameAction.java#L74-L81
104,165
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/rule/ExistsRule.java
ExistsRule.getRule
public static Rule getRule(final Stack stack) { if (stack.size() < 1) { throw new IllegalArgumentException( "Invalid EXISTS rule - expected one parameter but received " + stack.size()); } return new ExistsRule(stack.pop().toString()); }
java
public static Rule getRule(final Stack stack) { if (stack.size() < 1) { throw new IllegalArgumentException( "Invalid EXISTS rule - expected one parameter but received " + stack.size()); } return new ExistsRule(stack.pop().toString()); }
[ "public", "static", "Rule", "getRule", "(", "final", "Stack", "stack", ")", "{", "if", "(", "stack", ".", "size", "(", ")", "<", "1", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Invalid EXISTS rule - expected one parameter but received \"", "+", ...
Create an instance of ExistsRule using the top name on the stack. @param stack stack @return instance of ExistsRule.
[ "Create", "an", "instance", "of", "ExistsRule", "using", "the", "top", "name", "on", "the", "stack", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/rule/ExistsRule.java#L78-L86
104,166
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/extras/XSLTLayout.java
XSLTLayout.setTransform
public void setTransform(final Document xsltdoc) throws TransformerConfigurationException { // // scan transform source for xsl:output elements // and extract encoding, media (mime) type and output method // String encodingName = null; mediaType = null; ...
java
public void setTransform(final Document xsltdoc) throws TransformerConfigurationException { // // scan transform source for xsl:output elements // and extract encoding, media (mime) type and output method // String encodingName = null; mediaType = null; ...
[ "public", "void", "setTransform", "(", "final", "Document", "xsltdoc", ")", "throws", "TransformerConfigurationException", "{", "//", "// scan transform source for xsl:output elements", "// and extract encoding, media (mime) type and output method", "//", "String", "encodingName"...
Sets XSLT transform. @param xsltdoc DOM document containing XSLT transform source, may be modified. @throws TransformerConfigurationException if transformer can not be created.
[ "Sets", "XSLT", "transform", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/extras/XSLTLayout.java#L407-L461
104,167
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/util/LowLevelLogUtil.java
LowLevelLogUtil.setOutputStream
public static void setOutputStream(final OutputStream out) { LowLevelLogUtil.writer = new PrintWriter(Objects.requireNonNull(out), true); }
java
public static void setOutputStream(final OutputStream out) { LowLevelLogUtil.writer = new PrintWriter(Objects.requireNonNull(out), true); }
[ "public", "static", "void", "setOutputStream", "(", "final", "OutputStream", "out", ")", "{", "LowLevelLogUtil", ".", "writer", "=", "new", "PrintWriter", "(", "Objects", ".", "requireNonNull", "(", "out", ")", ",", "true", ")", ";", "}" ]
Sets the underlying OutputStream where exceptions are printed to. @param out the OutputStream to log to
[ "Sets", "the", "underlying", "OutputStream", "where", "exceptions", "are", "printed", "to", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/util/LowLevelLogUtil.java#L52-L54
104,168
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/util/LowLevelLogUtil.java
LowLevelLogUtil.setWriter
public static void setWriter(final Writer writer) { LowLevelLogUtil.writer = new PrintWriter(Objects.requireNonNull(writer), true); }
java
public static void setWriter(final Writer writer) { LowLevelLogUtil.writer = new PrintWriter(Objects.requireNonNull(writer), true); }
[ "public", "static", "void", "setWriter", "(", "final", "Writer", "writer", ")", "{", "LowLevelLogUtil", ".", "writer", "=", "new", "PrintWriter", "(", "Objects", ".", "requireNonNull", "(", "writer", ")", ",", "true", ")", ";", "}" ]
Sets the underlying Writer where exceptions are printed to. @param writer the Writer to log to
[ "Sets", "the", "underlying", "Writer", "where", "exceptions", "are", "printed", "to", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/util/LowLevelLogUtil.java#L61-L63
104,169
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/filter/TimeFilter.java
TimeFilter.setTimeZone
public void setTimeZone(final String s) { if (s == null) { calendar = Calendar.getInstance(); } else { calendar = Calendar.getInstance(TimeZone.getTimeZone(s)); } }
java
public void setTimeZone(final String s) { if (s == null) { calendar = Calendar.getInstance(); } else { calendar = Calendar.getInstance(TimeZone.getTimeZone(s)); } }
[ "public", "void", "setTimeZone", "(", "final", "String", "s", ")", "{", "if", "(", "s", "==", "null", ")", "{", "calendar", "=", "Calendar", ".", "getInstance", "(", ")", ";", "}", "else", "{", "calendar", "=", "Calendar", ".", "getInstance", "(", "T...
Set timezone. @param s time zone.
[ "Set", "timezone", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/filter/TimeFilter.java#L108-L114
104,170
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/rule/AndRule.java
AndRule.getRule
public static Rule getRule(final Stack stack) { if (stack.size() < 2) { throw new IllegalArgumentException( "Invalid AND rule - expected two rules but received " + stack.size()); } Object o2 = stack.pop(); Object o1 = stack.pop(); if ((o2 instanceof Ru...
java
public static Rule getRule(final Stack stack) { if (stack.size() < 2) { throw new IllegalArgumentException( "Invalid AND rule - expected two rules but received " + stack.size()); } Object o2 = stack.pop(); Object o1 = stack.pop(); if ((o2 instanceof Ru...
[ "public", "static", "Rule", "getRule", "(", "final", "Stack", "stack", ")", "{", "if", "(", "stack", ".", "size", "(", ")", "<", "2", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Invalid AND rule - expected two rules but received \"", "+", "stac...
Create rule from top two elements of stack. @param stack stack of rules. @return Rule that evaluates true only if both rules are true.
[ "Create", "rule", "from", "top", "two", "elements", "of", "stack", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/rule/AndRule.java#L65-L79
104,171
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/Level.java
Level.isInRange
public boolean isInRange(final Level minLevel, final Level maxLevel) { return this.intLevel >= minLevel.intLevel && this.intLevel <= maxLevel.intLevel; }
java
public boolean isInRange(final Level minLevel, final Level maxLevel) { return this.intLevel >= minLevel.intLevel && this.intLevel <= maxLevel.intLevel; }
[ "public", "boolean", "isInRange", "(", "final", "Level", "minLevel", ",", "final", "Level", "maxLevel", ")", "{", "return", "this", ".", "intLevel", ">=", "minLevel", ".", "intLevel", "&&", "this", ".", "intLevel", "<=", "maxLevel", ".", "intLevel", ";", "...
Compares this level against the levels passed as arguments and returns true if this level is in between the given levels. @param minLevel The minimum level to test. @param maxLevel The maximum level to test. @return True true if this level is in between the given levels @since 2.4
[ "Compares", "this", "level", "against", "the", "levels", "passed", "as", "arguments", "and", "returns", "true", "if", "this", "level", "is", "in", "between", "the", "given", "levels", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/Level.java#L154-L156
104,172
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/Level.java
Level.forName
public static Level forName(final String name, final int intValue) { final Level level = LEVELS.get(name); if (level != null) { return level; } try { return new Level(name, intValue); } catch (final IllegalStateException ex) { // The level was ...
java
public static Level forName(final String name, final int intValue) { final Level level = LEVELS.get(name); if (level != null) { return level; } try { return new Level(name, intValue); } catch (final IllegalStateException ex) { // The level was ...
[ "public", "static", "Level", "forName", "(", "final", "String", "name", ",", "final", "int", "intValue", ")", "{", "final", "Level", "level", "=", "LEVELS", ".", "get", "(", "name", ")", ";", "if", "(", "level", "!=", "null", ")", "{", "return", "lev...
Retrieves an existing Level or creates on if it didn't previously exist. @param name The name of the level. @param intValue The integer value for the Level. If the level was previously created this value is ignored. @return The Level. @throws java.lang.IllegalArgumentException if the name is null or intValue is less t...
[ "Retrieves", "an", "existing", "Level", "or", "creates", "on", "if", "it", "didn", "t", "previously", "exist", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/Level.java#L241-L252
104,173
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/Level.java
Level.values
public static Level[] values() { final Collection<Level> values = Level.LEVELS.values(); return values.toArray(new Level[values.size()]); }
java
public static Level[] values() { final Collection<Level> values = Level.LEVELS.values(); return values.toArray(new Level[values.size()]); }
[ "public", "static", "Level", "[", "]", "values", "(", ")", "{", "final", "Collection", "<", "Level", ">", "values", "=", "Level", ".", "LEVELS", ".", "values", "(", ")", ";", "return", "values", ".", "toArray", "(", "new", "Level", "[", "values", "."...
Return an array of all the Levels that have been registered. @return An array of Levels.
[ "Return", "an", "array", "of", "all", "the", "Levels", "that", "have", "been", "registered", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/Level.java#L300-L303
104,174
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/Level.java
Level.valueOf
public static Level valueOf(final String name) { Objects.requireNonNull(name, "No level name given."); final String levelName = toUpperCase(name); final Level level = LEVELS.get(levelName); if (level != null) { return level; } throw new IllegalArgumentExceptio...
java
public static Level valueOf(final String name) { Objects.requireNonNull(name, "No level name given."); final String levelName = toUpperCase(name); final Level level = LEVELS.get(levelName); if (level != null) { return level; } throw new IllegalArgumentExceptio...
[ "public", "static", "Level", "valueOf", "(", "final", "String", "name", ")", "{", "Objects", ".", "requireNonNull", "(", "name", ",", "\"No level name given.\"", ")", ";", "final", "String", "levelName", "=", "toUpperCase", "(", "name", ")", ";", "final", "L...
Return the Level associated with the name. @param name The name of the Level to return. @return The Level. @throws java.lang.NullPointerException if the Level name is {@code null}. @throws java.lang.IllegalArgumentException if the Level name is not registered.
[ "Return", "the", "Level", "associated", "with", "the", "name", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/Level.java#L313-L321
104,175
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
MapMessage.getParameters
@Override public Object[] getParameters() { final Object[] result = new Object[data.size()]; for (int i = 0; i < data.size(); i++) { result[i] = data.getValueAt(i); } return result; }
java
@Override public Object[] getParameters() { final Object[] result = new Object[data.size()]; for (int i = 0; i < data.size(); i++) { result[i] = data.getValueAt(i); } return result; }
[ "@", "Override", "public", "Object", "[", "]", "getParameters", "(", ")", "{", "final", "Object", "[", "]", "result", "=", "new", "Object", "[", "data", ".", "size", "(", ")", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "data", "...
Returns the data elements as if they were parameters on the logging event. @return the data elements.
[ "Returns", "the", "data", "elements", "as", "if", "they", "were", "parameters", "on", "the", "logging", "event", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java#L127-L134
104,176
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
MapMessage.getData
@SuppressWarnings("unchecked") public Map<String, V> getData() { final TreeMap<String, V> result = new TreeMap<>(); // returned map must be sorted for (int i = 0; i < data.size(); i++) { // The Eclipse compiler does not need the typecast to V, but the Oracle compiler sure does. ...
java
@SuppressWarnings("unchecked") public Map<String, V> getData() { final TreeMap<String, V> result = new TreeMap<>(); // returned map must be sorted for (int i = 0; i < data.size(); i++) { // The Eclipse compiler does not need the typecast to V, but the Oracle compiler sure does. ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "Map", "<", "String", ",", "V", ">", "getData", "(", ")", "{", "final", "TreeMap", "<", "String", ",", "V", ">", "result", "=", "new", "TreeMap", "<>", "(", ")", ";", "// returned map must be ...
Returns the message data as an unmodifiable Map. @return the message data as an unmodifiable map.
[ "Returns", "the", "message", "data", "as", "an", "unmodifiable", "Map", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java#L149-L157
104,177
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
MapMessage.putAll
public void putAll(final Map<String, String> map) { for (final Map.Entry<String, ?> entry : map.entrySet()) { data.putValue(entry.getKey(), entry.getValue()); } }
java
public void putAll(final Map<String, String> map) { for (final Map.Entry<String, ?> entry : map.entrySet()) { data.putValue(entry.getKey(), entry.getValue()); } }
[ "public", "void", "putAll", "(", "final", "Map", "<", "String", ",", "String", ">", "map", ")", "{", "for", "(", "final", "Map", ".", "Entry", "<", "String", ",", "?", ">", "entry", ":", "map", ".", "entrySet", "(", ")", ")", "{", "data", ".", ...
Adds all the elements from the specified Map. @param map The Map to add.
[ "Adds", "all", "the", "elements", "from", "the", "specified", "Map", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java#L202-L206
104,178
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
MapMessage.remove
public String remove(final String key) { final String result = data.getValue(key); data.remove(key); return result; }
java
public String remove(final String key) { final String result = data.getValue(key); data.remove(key); return result; }
[ "public", "String", "remove", "(", "final", "String", "key", ")", "{", "final", "String", "result", "=", "data", ".", "getValue", "(", "key", ")", ";", "data", ".", "remove", "(", "key", ")", ";", "return", "result", ";", "}" ]
Removes the element with the specified name. @param key The name of the element. @return The previous value of the element.
[ "Removes", "the", "element", "with", "the", "specified", "name", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java#L222-L226
104,179
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
MapMessage.asXml
public void asXml(final StringBuilder sb) { sb.append("<Map>\n"); for (int i = 0; i < data.size(); i++) { sb.append(" <Entry key=\"").append(data.getKeyAt(i)).append("\">").append((String)data.getValueAt(i)) .append("</Entry>\n"); } sb.append("</Map>"); ...
java
public void asXml(final StringBuilder sb) { sb.append("<Map>\n"); for (int i = 0; i < data.size(); i++) { sb.append(" <Entry key=\"").append(data.getKeyAt(i)).append("\">").append((String)data.getValueAt(i)) .append("</Entry>\n"); } sb.append("</Map>"); ...
[ "public", "void", "asXml", "(", "final", "StringBuilder", "sb", ")", "{", "sb", ".", "append", "(", "\"<Map>\\n\"", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "data", ".", "size", "(", ")", ";", "i", "++", ")", "{", "sb", ".", ...
Formats this message as an XML fragment String into the given builder. @param sb format into this builder.
[ "Formats", "this", "message", "as", "an", "XML", "fragment", "String", "into", "the", "given", "builder", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java#L338-L345
104,180
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
MapMessage.newInstance
@SuppressWarnings("unchecked") public M newInstance(final Map<String, V> map) { return (M) new MapMessage<>(map); }
java
@SuppressWarnings("unchecked") public M newInstance(final Map<String, V> map) { return (M) new MapMessage<>(map); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "M", "newInstance", "(", "final", "Map", "<", "String", ",", "V", ">", "map", ")", "{", "return", "(", "M", ")", "new", "MapMessage", "<>", "(", "map", ")", ";", "}" ]
Constructs a new instance based on an existing Map. @param map The Map. @return A new MapMessage
[ "Constructs", "a", "new", "instance", "based", "on", "an", "existing", "Map", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java#L419-L422
104,181
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java
MapMessage.with
@SuppressWarnings("unchecked") public M with(final String key, final String value) { put(key, value); return (M) this; }
java
@SuppressWarnings("unchecked") public M with(final String key, final String value) { put(key, value); return (M) this; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "M", "with", "(", "final", "String", "key", ",", "final", "String", "value", ")", "{", "put", "(", "key", ",", "value", ")", ";", "return", "(", "M", ")", "this", ";", "}" ]
Adds an item to the data Map in fluent style. @param key The name of the data item. @param value The value of the data item. @return {@code this}
[ "Adds", "an", "item", "to", "the", "data", "Map", "in", "fluent", "style", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/message/MapMessage.java#L665-L669
104,182
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/spi/ExtendedLoggerWrapper.java
ExtendedLoggerWrapper.logMessage
@Override public void logMessage(final String fqcn, final Level level, final Marker marker, final Message message, final Throwable t) { logger.logMessage(fqcn, level, marker, message, t); }
java
@Override public void logMessage(final String fqcn, final Level level, final Marker marker, final Message message, final Throwable t) { logger.logMessage(fqcn, level, marker, message, t); }
[ "@", "Override", "public", "void", "logMessage", "(", "final", "String", "fqcn", ",", "final", "Level", "level", ",", "final", "Marker", "marker", ",", "final", "Message", "message", ",", "final", "Throwable", "t", ")", "{", "logger", ".", "logMessage", "(...
Always log an event. This tends to be already guarded by an enabled check, so this method should not check for the logger level again @param fqcn The fully qualified class name of the <b>caller</b> @param level The logging level @param marker The Marker @param message The Message. @param t A Throwable or null.
[ "Always", "log", "an", "event", ".", "This", "tends", "to", "be", "already", "guarded", "by", "an", "enabled", "check", "so", "this", "method", "should", "not", "check", "for", "the", "logger", "level", "again" ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/spi/ExtendedLoggerWrapper.java#L214-L218
104,183
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/jboss/logging/MDC.java
MDC.put
public static Object put(String key, Object val) { return LoggerProviders.PROVIDER.putMdc(key, val); }
java
public static Object put(String key, Object val) { return LoggerProviders.PROVIDER.putMdc(key, val); }
[ "public", "static", "Object", "put", "(", "String", "key", ",", "Object", "val", ")", "{", "return", "LoggerProviders", ".", "PROVIDER", ".", "putMdc", "(", "key", ",", "val", ")", ";", "}" ]
Puts the value onto the context. @param key the key for the value @param val the value @return the previous value set or {@code null} if no value was set
[ "Puts", "the", "value", "onto", "the", "context", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/jboss/logging/MDC.java#L40-L42
104,184
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/rule/ExpressionRule.java
ExpressionRule.getRule
public static Rule getRule(final String expression, final boolean isPostFix) { String postFix = expression; if (!isPostFix) { postFix = CONVERTER.convert(expression); } return new ExpressionRule(COMPILER.compileExpression(postFix)); }
java
public static Rule getRule(final String expression, final boolean isPostFix) { String postFix = expression; if (!isPostFix) { postFix = CONVERTER.convert(expression); } return new ExpressionRule(COMPILER.compileExpression(postFix)); }
[ "public", "static", "Rule", "getRule", "(", "final", "String", "expression", ",", "final", "boolean", "isPostFix", ")", "{", "String", "postFix", "=", "expression", ";", "if", "(", "!", "isPostFix", ")", "{", "postFix", "=", "CONVERTER", ".", "convert", "(...
Get rule. @param expression expression. @param isPostFix If post-fix. @return rule
[ "Get", "rule", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/rule/ExpressionRule.java#L93-L101
104,185
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/helpers/UtilLoggingLevel.java
UtilLoggingLevel.toLevel
public static UtilLoggingLevel toLevel(final int val, final UtilLoggingLevel defaultLevel) { switch (val) { case SEVERE_INT: return SEVERE; case WARNING_INT: return WARNING; case INFO_INT: return...
java
public static UtilLoggingLevel toLevel(final int val, final UtilLoggingLevel defaultLevel) { switch (val) { case SEVERE_INT: return SEVERE; case WARNING_INT: return WARNING; case INFO_INT: return...
[ "public", "static", "UtilLoggingLevel", "toLevel", "(", "final", "int", "val", ",", "final", "UtilLoggingLevel", "defaultLevel", ")", "{", "switch", "(", "val", ")", "{", "case", "SEVERE_INT", ":", "return", "SEVERE", ";", "case", "WARNING_INT", ":", "return",...
Convert an integer passed as argument to a level. If the conversion fails, then this method returns the specified default. @param val numeric value. @param defaultLevel level to be returned if no level matches numeric value. @return matching level or default level.
[ "Convert", "an", "integer", "passed", "as", "argument", "to", "a", "level", ".", "If", "the", "conversion", "fails", "then", "this", "method", "returns", "the", "specified", "default", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/helpers/UtilLoggingLevel.java#L129-L156
104,186
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/helpers/UtilLoggingLevel.java
UtilLoggingLevel.getAllPossibleLevels
public static List getAllPossibleLevels() { ArrayList list = new ArrayList(); list.add(FINE); list.add(FINER); list.add(FINEST); list.add(INFO); list.add(CONFIG); list.add(WARNING); list.add(SEVERE); return list; }
java
public static List getAllPossibleLevels() { ArrayList list = new ArrayList(); list.add(FINE); list.add(FINER); list.add(FINEST); list.add(INFO); list.add(CONFIG); list.add(WARNING); list.add(SEVERE); return list; }
[ "public", "static", "List", "getAllPossibleLevels", "(", ")", "{", "ArrayList", "list", "=", "new", "ArrayList", "(", ")", ";", "list", ".", "add", "(", "FINE", ")", ";", "list", ".", "add", "(", "FINER", ")", ";", "list", ".", "add", "(", "FINEST", ...
Gets list of supported levels. @return list of supported levels.
[ "Gets", "list", "of", "supported", "levels", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/helpers/UtilLoggingLevel.java#L171-L181
104,187
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/receivers/helpers/UtilLoggingLevel.java
UtilLoggingLevel.toLevel
public static Level toLevel(final String sArg, final Level defaultLevel) { if (sArg == null) { return defaultLevel; } String s = sArg.toUpperCase(); if (s.equals("SEVERE")) { return SEVERE; } //if(s.equals("FINE")...
java
public static Level toLevel(final String sArg, final Level defaultLevel) { if (sArg == null) { return defaultLevel; } String s = sArg.toUpperCase(); if (s.equals("SEVERE")) { return SEVERE; } //if(s.equals("FINE")...
[ "public", "static", "Level", "toLevel", "(", "final", "String", "sArg", ",", "final", "Level", "defaultLevel", ")", "{", "if", "(", "sArg", "==", "null", ")", "{", "return", "defaultLevel", ";", "}", "String", "s", "=", "sArg", ".", "toUpperCase", "(", ...
Get level with specified symbolic name. @param sArg symbolic name. @param defaultLevel level to return if no match. @return matching level or defaultLevel if no match.
[ "Get", "level", "with", "specified", "symbolic", "name", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/helpers/UtilLoggingLevel.java#L199-L236
104,188
ops4j/org.ops4j.pax.logging
pax-logging-log4j2/src/main/java/org/ops4j/pax/logging/log4j2/appender/PaxOsgiAppender.java
PaxOsgiAppender.createAppender
@PluginFactory public static PaxOsgiAppender createAppender( // @formatter:off @PluginAttribute("name") final String name, @PluginAttribute("filter") final String filter, @PluginConfiguration final Configuration config) { // @formatter:on if (name...
java
@PluginFactory public static PaxOsgiAppender createAppender( // @formatter:off @PluginAttribute("name") final String name, @PluginAttribute("filter") final String filter, @PluginConfiguration final Configuration config) { // @formatter:on if (name...
[ "@", "PluginFactory", "public", "static", "PaxOsgiAppender", "createAppender", "(", "// @formatter:off", "@", "PluginAttribute", "(", "\"name\"", ")", "final", "String", "name", ",", "@", "PluginAttribute", "(", "\"filter\"", ")", "final", "String", "filter", ",", ...
Create a Pax Osgi Appender. @param name The name of the Appender. @param filter defaults to "*", can be any string that works as a value in {@link org.osgi.framework.Filter} @param config The Configuration @return The FileAppender.
[ "Create", "a", "Pax", "Osgi", "Appender", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-log4j2/src/main/java/org/ops4j/pax/logging/log4j2/appender/PaxOsgiAppender.java#L93-L106
104,189
ops4j/org.ops4j.pax.logging
pax-logging-samples/config/src/main/java/org/ops4j/pax/logging/samples/config/internal/Activator.java
Activator.updateConfiguration
private void updateConfiguration( BundleContext bundleContext, final String pattern ) throws IOException { final ConfigurationAdmin configAdmin = getConfigurationAdmin( bundleContext ); final Configuration configuration = configAdmin.getConfiguration( "o...
java
private void updateConfiguration( BundleContext bundleContext, final String pattern ) throws IOException { final ConfigurationAdmin configAdmin = getConfigurationAdmin( bundleContext ); final Configuration configuration = configAdmin.getConfiguration( "o...
[ "private", "void", "updateConfiguration", "(", "BundleContext", "bundleContext", ",", "final", "String", "pattern", ")", "throws", "IOException", "{", "final", "ConfigurationAdmin", "configAdmin", "=", "getConfigurationAdmin", "(", "bundleContext", ")", ";", "final", ...
Updates Pax Logging configuration to a specifid conversion pattern. @param bundleContext bundle context @param pattern layout conversion pattern @throws IOException - Re-thrown
[ "Updates", "Pax", "Logging", "configuration", "to", "a", "specifid", "conversion", "pattern", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-samples/config/src/main/java/org/ops4j/pax/logging/samples/config/internal/Activator.java#L69-L83
104,190
ops4j/org.ops4j.pax.logging
pax-logging-samples/config/src/main/java/org/ops4j/pax/logging/samples/config/internal/Activator.java
Activator.getConfigurationAdmin
private ConfigurationAdmin getConfigurationAdmin( final BundleContext bundleContext ) { final ServiceReference ref = bundleContext.getServiceReference( ConfigurationAdmin.class.getName() ); if( ref == null ) { throw new IllegalStateException( "Cannot find a configuration admin se...
java
private ConfigurationAdmin getConfigurationAdmin( final BundleContext bundleContext ) { final ServiceReference ref = bundleContext.getServiceReference( ConfigurationAdmin.class.getName() ); if( ref == null ) { throw new IllegalStateException( "Cannot find a configuration admin se...
[ "private", "ConfigurationAdmin", "getConfigurationAdmin", "(", "final", "BundleContext", "bundleContext", ")", "{", "final", "ServiceReference", "ref", "=", "bundleContext", ".", "getServiceReference", "(", "ConfigurationAdmin", ".", "class", ".", "getName", "(", ")", ...
Gets Configuration Admin service from service registry. @param bundleContext bundle context @return configuration admin service @throws IllegalStateException - If no Configuration Admin service is available
[ "Gets", "Configuration", "Admin", "service", "from", "service", "registry", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-samples/config/src/main/java/org/ops4j/pax/logging/samples/config/internal/Activator.java#L94-L102
104,191
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java
StatusLogger.removeListener
public void removeListener(final StatusListener listener) { closeSilently(listener); listenersLock.writeLock().lock(); try { listeners.remove(listener); int lowest = Level.toLevel(DEFAULT_STATUS_LEVEL, Level.WARN).intLevel(); for (final StatusListener statusLi...
java
public void removeListener(final StatusListener listener) { closeSilently(listener); listenersLock.writeLock().lock(); try { listeners.remove(listener); int lowest = Level.toLevel(DEFAULT_STATUS_LEVEL, Level.WARN).intLevel(); for (final StatusListener statusLi...
[ "public", "void", "removeListener", "(", "final", "StatusListener", "listener", ")", "{", "closeSilently", "(", "listener", ")", ";", "listenersLock", ".", "writeLock", "(", ")", ".", "lock", "(", ")", ";", "try", "{", "listeners", ".", "remove", "(", "lis...
Removes a StatusListener. @param listener The StatusListener to remove.
[ "Removes", "a", "StatusListener", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java#L150-L166
104,192
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java
StatusLogger.reset
public void reset() { listenersLock.writeLock().lock(); try { for (final StatusListener listener : listeners) { closeSilently(listener); } } finally { listeners.clear(); listenersLock.writeLock().unlock(); // note this s...
java
public void reset() { listenersLock.writeLock().lock(); try { for (final StatusListener listener : listeners) { closeSilently(listener); } } finally { listeners.clear(); listenersLock.writeLock().unlock(); // note this s...
[ "public", "void", "reset", "(", ")", "{", "listenersLock", ".", "writeLock", "(", ")", ".", "lock", "(", ")", ";", "try", "{", "for", "(", "final", "StatusListener", "listener", ":", "listeners", ")", "{", "closeSilently", "(", "listener", ")", ";", "}...
Clears the list of status events and listeners.
[ "Clears", "the", "list", "of", "status", "events", "and", "listeners", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java#L186-L198
104,193
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java
StatusLogger.logMessage
@Override public void logMessage(final String fqcn, final Level level, final Marker marker, final Message msg, final Throwable t) { StackTraceElement element = null; if (fqcn != null) { element = getStackTraceElement(fqcn, Thread.currentThread().getStackTrace()); } ...
java
@Override public void logMessage(final String fqcn, final Level level, final Marker marker, final Message msg, final Throwable t) { StackTraceElement element = null; if (fqcn != null) { element = getStackTraceElement(fqcn, Thread.currentThread().getStackTrace()); } ...
[ "@", "Override", "public", "void", "logMessage", "(", "final", "String", "fqcn", ",", "final", "Level", "level", ",", "final", "Marker", "marker", ",", "final", "Message", "msg", ",", "final", "Throwable", "t", ")", "{", "StackTraceElement", "element", "=", ...
Adds an event. @param marker The Marker @param fqcn The fully qualified class name of the <b>caller</b> @param level The logging level @param msg The message associated with the event. @param t A Throwable or null.
[ "Adds", "an", "event", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java#L248-L276
104,194
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/pattern/ExtrasFormattingInfo.java
ExtrasFormattingInfo.format
public void format(final int fieldStart, final StringBuffer buffer) { final int rawLength = buffer.length() - fieldStart; if (rawLength > maxLength) { if(rightTruncate) { buffer.setLength(fieldStart + maxLength); } else { buffer.delete(fieldStart, buffer.length() - maxLength); ...
java
public void format(final int fieldStart, final StringBuffer buffer) { final int rawLength = buffer.length() - fieldStart; if (rawLength > maxLength) { if(rightTruncate) { buffer.setLength(fieldStart + maxLength); } else { buffer.delete(fieldStart, buffer.length() - maxLength); ...
[ "public", "void", "format", "(", "final", "int", "fieldStart", ",", "final", "StringBuffer", "buffer", ")", "{", "final", "int", "rawLength", "=", "buffer", ".", "length", "(", ")", "-", "fieldStart", ";", "if", "(", "rawLength", ">", "maxLength", ")", "...
Adjust the content of the buffer based on the specified lengths and alignment. @param fieldStart start of field in buffer. @param buffer buffer to be modified.
[ "Adjust", "the", "content", "of", "the", "buffer", "based", "on", "the", "specified", "lengths", "and", "alignment", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/pattern/ExtrasFormattingInfo.java#L148-L175
104,195
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/util/LoaderUtil.java
LoaderUtil.newCheckedInstanceOf
public static <T> T newCheckedInstanceOf(final String className, final Class<T> clazz) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException { return clazz.cast(newInstanceOf(className)); }
java
public static <T> T newCheckedInstanceOf(final String className, final Class<T> clazz) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException { return clazz.cast(newInstanceOf(className)); }
[ "public", "static", "<", "T", ">", "T", "newCheckedInstanceOf", "(", "final", "String", "className", ",", "final", "Class", "<", "T", ">", "clazz", ")", "throws", "ClassNotFoundException", ",", "NoSuchMethodException", ",", "InvocationTargetException", ",", "Insta...
Loads and instantiates a derived class using its default constructor. @param className The class name. @param clazz The class to cast it to. @param <T> The type of the class to check. @return new instance of the class cast to {@code T} @throws ClassNotFoundException if the class isn't available to the usual ClassLoade...
[ "Loads", "and", "instantiates", "a", "derived", "class", "using", "its", "default", "constructor", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/util/LoaderUtil.java#L198-L202
104,196
ops4j/org.ops4j.pax.logging
pax-logging-api/src/main/java/org/apache/logging/log4j/util/LoaderUtil.java
LoaderUtil.newCheckedInstanceOfProperty
public static <T> T newCheckedInstanceOfProperty(final String propertyName, final Class<T> clazz) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException { final String className = PropertiesUtil.getProperties().getStringPro...
java
public static <T> T newCheckedInstanceOfProperty(final String propertyName, final Class<T> clazz) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException { final String className = PropertiesUtil.getProperties().getStringPro...
[ "public", "static", "<", "T", ">", "T", "newCheckedInstanceOfProperty", "(", "final", "String", "propertyName", ",", "final", "Class", "<", "T", ">", "clazz", ")", "throws", "ClassNotFoundException", ",", "NoSuchMethodException", ",", "InvocationTargetException", ",...
Loads and instantiates a class given by a property name. @param propertyName The property name to look up a class name for. @param clazz The class to cast it to. @param <T> The type to cast it to. @return new instance of the class given in the property or {@code null} if the property was unset. @throws...
[ "Loads", "and", "instantiates", "a", "class", "given", "by", "a", "property", "name", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/util/LoaderUtil.java#L219-L227
104,197
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/component/plugins/PluginRegistry.java
PluginRegistry.addPlugin
public void addPlugin(final Plugin plugin) { // put plugin into the repository's reciever map synchronized (pluginMap) { String name = plugin.getName(); // make sure the plugin has reference to repository plugin.setLoggerRepository(getLoggerRepository()); ...
java
public void addPlugin(final Plugin plugin) { // put plugin into the repository's reciever map synchronized (pluginMap) { String name = plugin.getName(); // make sure the plugin has reference to repository plugin.setLoggerRepository(getLoggerRepository()); ...
[ "public", "void", "addPlugin", "(", "final", "Plugin", "plugin", ")", "{", "// put plugin into the repository's reciever map", "synchronized", "(", "pluginMap", ")", "{", "String", "name", "=", "plugin", ".", "getName", "(", ")", ";", "// make sure the plugin has refe...
Adds a plugin to the plugin registry. If a plugin with the same name exists already, it is shutdown and removed. @param plugin the plugin to add.
[ "Adds", "a", "plugin", "to", "the", "plugin", "registry", ".", "If", "a", "plugin", "with", "the", "same", "name", "exists", "already", "it", "is", "shutdown", "and", "removed", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/component/plugins/PluginRegistry.java#L98-L115
104,198
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/component/plugins/PluginRegistry.java
PluginRegistry.firePluginStarted
private void firePluginStarted(final Plugin plugin) { PluginEvent e = null; synchronized (listenerList) { for (Iterator iter = listenerList.iterator(); iter.hasNext();) { PluginListener l = (PluginListener) iter.next(); if (e == null) { e =...
java
private void firePluginStarted(final Plugin plugin) { PluginEvent e = null; synchronized (listenerList) { for (Iterator iter = listenerList.iterator(); iter.hasNext();) { PluginListener l = (PluginListener) iter.next(); if (e == null) { e =...
[ "private", "void", "firePluginStarted", "(", "final", "Plugin", "plugin", ")", "{", "PluginEvent", "e", "=", "null", ";", "synchronized", "(", "listenerList", ")", "{", "for", "(", "Iterator", "iter", "=", "listenerList", ".", "iterator", "(", ")", ";", "i...
Calls the pluginStarted method on every registered PluginListener. @param plugin The plugin that has been started.
[ "Calls", "the", "pluginStarted", "method", "on", "every", "registered", "PluginListener", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/component/plugins/PluginRegistry.java#L123-L134
104,199
ops4j/org.ops4j.pax.logging
pax-logging-service/src/main/java/org/apache/log4j/component/plugins/PluginRegistry.java
PluginRegistry.firePluginStopped
private void firePluginStopped(final Plugin plugin) { PluginEvent e = null; synchronized (listenerList) { for (Iterator iter = listenerList.iterator(); iter.hasNext();) { PluginListener l = (PluginListener) iter.next(); if (e == null) { e =...
java
private void firePluginStopped(final Plugin plugin) { PluginEvent e = null; synchronized (listenerList) { for (Iterator iter = listenerList.iterator(); iter.hasNext();) { PluginListener l = (PluginListener) iter.next(); if (e == null) { e =...
[ "private", "void", "firePluginStopped", "(", "final", "Plugin", "plugin", ")", "{", "PluginEvent", "e", "=", "null", ";", "synchronized", "(", "listenerList", ")", "{", "for", "(", "Iterator", "iter", "=", "listenerList", ".", "iterator", "(", ")", ";", "i...
Calls the pluginStopped method for every registered PluginListner. @param plugin The plugin that has been stopped.
[ "Calls", "the", "pluginStopped", "method", "for", "every", "registered", "PluginListner", "." ]
493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d
https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/component/plugins/PluginRegistry.java#L142-L153