Skip to content

Commit 1b81758

Browse files
Document thread safety.
1 parent 3ee920b commit 1b81758

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

src/main/java/com/cloudbees/syslog/sender/SyslogMessageSender.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,19 @@
2020

2121
import javax.annotation.Nonnull;
2222
import javax.annotation.Nullable;
23+
import javax.annotation.concurrent.ThreadSafe;
2324
import java.io.CharArrayWriter;
2425
import java.io.IOException;
2526
import java.util.concurrent.TimeUnit;
2627

2728
/**
29+
* Send messages to a Syslog server.
30+
* <p/>
31+
* Implementation <strong>MUST</strong> be thread safe.
32+
*
2833
* @author <a href="mailto:[email protected]">Cyrille Le Clerc</a>
2934
*/
35+
@ThreadSafe
3036
public interface SyslogMessageSender {
3137
public static final long DEFAULT_INET_ADDRESS_TTL_IN_MILLIS = TimeUnit.MILLISECONDS.convert(30, TimeUnit.SECONDS);
3238
public static final long DEFAULT_INET_ADDRESS_TTL_IN_NANOS = TimeUnit.NANOSECONDS.convert(DEFAULT_INET_ADDRESS_TTL_IN_MILLIS, TimeUnit.MILLISECONDS);

src/main/java/com/cloudbees/syslog/sender/TcpSyslogMessageSender.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import javax.annotation.Nonnull;
2323
import javax.annotation.Nullable;
24+
import javax.annotation.concurrent.ThreadSafe;
2425
import javax.net.SocketFactory;
2526
import javax.net.ssl.SSLSession;
2627
import javax.net.ssl.SSLSocket;
@@ -40,6 +41,7 @@
4041
*
4142
* @author <a href="mailto:[email protected]">Cyrille Le Clerc</a>
4243
*/
44+
@ThreadSafe
4345
public class TcpSyslogMessageSender extends AbstractSyslogMessageSender {
4446
public final static int SETTING_SOCKET_CONNECT_TIMEOUT_IN_MILLIS_DEFAULT_VALUE = 500;
4547

src/main/java/com/cloudbees/syslog/sender/UdpSyslogMessageSender.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.cloudbees.syslog.util.CachingReference;
2020

2121
import javax.annotation.Nullable;
22+
import javax.annotation.concurrent.ThreadSafe;
2223
import java.io.ByteArrayOutputStream;
2324
import java.io.IOException;
2425
import java.io.OutputStreamWriter;
@@ -37,6 +38,7 @@
3738
*
3839
* @author <a href="mailto:[email protected]">Cyrille Le Clerc</a>
3940
*/
41+
@ThreadSafe
4042
public class UdpSyslogMessageSender extends AbstractSyslogMessageSender {
4143
/**
4244
* {@link java.net.InetAddress InetAddress} of the remote Syslog Server.

0 commit comments

Comments
 (0)