From fdba539aa81d6914d4c865b29c54aa471a731cf9 Mon Sep 17 00:00:00 2001 From: Jeremy Custenborder Date: Wed, 4 May 2016 04:26:31 -0500 Subject: [PATCH] Use SyslogServerConfigIF instead of AbstractSyslogServerConfig in AbstractSyslogServer (#9) This allows config items that do not inherit from AbstractSyslogServerConfig to be used. Fixes #8 --- .../syslog4j/server/impl/AbstractSyslogServer.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/graylog2/syslog4j/server/impl/AbstractSyslogServer.java b/src/main/java/org/graylog2/syslog4j/server/impl/AbstractSyslogServer.java index f988fa3..1ed7eda 100644 --- a/src/main/java/org/graylog2/syslog4j/server/impl/AbstractSyslogServer.java +++ b/src/main/java/org/graylog2/syslog4j/server/impl/AbstractSyslogServer.java @@ -96,21 +96,14 @@ public abstract class AbstractSyslogServer implements SyslogServerIF { } protected String syslogProtocol = null; - protected AbstractSyslogServerConfig syslogServerConfig = null; + protected SyslogServerConfigIF syslogServerConfig = null; protected Thread thread = null; protected boolean shutdown = false; public void initialize(String protocol, SyslogServerConfigIF config) throws SyslogRuntimeException { this.syslogProtocol = protocol; - - try { - this.syslogServerConfig = (AbstractSyslogServerConfig) config; - - } catch (ClassCastException cce) { - throw new SyslogRuntimeException(cce); - } - + this.syslogServerConfig = config; initialize(); }