This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void bridgeHandlerInitialized(ThingHandler thingHandler, Bridge bridge) { | |
if (thingHandler instanceof BacNetBridgeHandler) { | |
this.client = ((BacNetBridgeHandler) thingHandler).getClient(); | |
BacNetDeviceConfiguration configuration = getConfigAs(BacNetDeviceConfiguration.class); | |
// hardcode network number temporary to 0 | |
this.device = new Device(configuration.id, configuration.ip, configuration.port, 0); | |
final List<Property> deviceProperties = client.getDeviceProperties(device); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final PipedInputStream stream = new PipedInputStream(); | |
final Process start = Runtime.getRuntime().exec(this.command); | |
new Thread(new Runnable() { | |
@Override | |
public void run() { | |
try { | |
InputStream inputStream = start.getInputStream(); | |
PipedOutputStream output = new PipedOutputStream(stream); | |
IOUtils.copy(inputStream, output); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[inputs.win_perf_counters]] | |
[[inputs.win_perf_counters.object]] | |
ObjectName = "Processor" | |
Instances = ["*"] | |
Counters = ["% Idle Time", "% Interrupt Time", "% Privileged Time", "% User Time", "% Processor Time"] | |
Measurement = "win_cpu" | |
[[inputs.win_perf_counters.object]] | |
ObjectName = "PhysicalDisk" | |
Instances = ["*"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.serotonin.bacnet4j.event.DeviceEventAdapter; | |
import com.serotonin.bacnet4j.exception.BACnetException; | |
import com.serotonin.bacnet4j.exception.ErrorAPDUException; | |
import com.serotonin.bacnet4j.npdu.ip.IpNetwork; | |
import com.serotonin.bacnet4j.service.acknowledgement.ReadPropertyAck; | |
import com.serotonin.bacnet4j.service.acknowledgement.ReadPropertyMultipleAck; | |
import com.serotonin.bacnet4j.service.confirmed.*; | |
import com.serotonin.bacnet4j.service.unconfirmed.WhoIsRequest; | |
import com.serotonin.bacnet4j.transport.DefaultTransport; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Counter failCounter = new Counter(); | |
Counter successCounter = new Counter(); | |
Timer timer = new Timer(); | |
@Override | |
public Y transform(X x) { | |
Timer.Context time = timer.time(); | |
try { | |
Y transform = delegate.transform(x); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.hamcrest.Description; | |
import org.mockito.ArgumentMatcher; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.Map.Entry; | |
public class MapMatcher extends ArgumentMatcher<Map> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
Licensed to the Austrian Association for Software Tool Integration (AASTI) | |
under one or more contributor license agreements. See the NOTICE file | |
distributed with this work for additional information regarding copyright | |
ownership. The AASTI licenses this file to you under the Apache License, | |
Version 2.0 (the "License"); you may not use this file except in compliance | |
with the License. You may obtain a copy of the License at |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class JacksonDataFormatSplitExpression extends ExpressionAdapter | |
{ | |
private final JacksonDataFormat format; | |
private final FormatSchema schema; | |
public JacksonDataFormatSplitExpression(JacksonDataFormat format, FormatSchema schema) | |
{ | |
this.format = format; | |
this.schema = schema; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.DataInputStream; | |
import java.io.DataOutputStream; | |
import java.io.File; | |
import org.eclipse.core.internal.localstore.SafeChunkyInputStream; | |
import org.eclipse.core.internal.localstore.SafeChunkyOutputStream; | |
public class Migrator { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.concurrent.BlockingQueue; | |
import java.util.concurrent.RejectedExecutionHandler; | |
import java.util.concurrent.ThreadFactory; | |
import java.util.concurrent.ThreadPoolExecutor; | |
import java.util.concurrent.TimeUnit; | |
import java.util.concurrent.atomic.AtomicLong; | |
public class InstrumentingThreadPoolExecutor extends ThreadPoolExecutor { |