Skip to content
This repository has been archived by the owner on Nov 26, 2020. It is now read-only.

Commit

Permalink
Update version
Browse files Browse the repository at this point in the history
  • Loading branch information
ardikars committed Nov 10, 2018
1 parent 91ddf46 commit bf7f852
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
6 changes: 3 additions & 3 deletions gradle/configure.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ext {

NAME = 'Jxnet'
GROUP = 'com.ardikars.jxnet'
VERSION = '1.4.7.RC1'
VERSION = '1.4.7.RC2'
DESCRIPTION = 'Jxnet is a java library for capturing and sending network packet.'

NDK_HOME = "${System.env.NDK_HOME}"
Expand All @@ -31,8 +31,8 @@ ext {
PMD_VERION = '6.5.0'
JACOCO_VERSION = '0.8.2'

COMMON_VERSION = '1.2.1.Final'
NETTY_VERSION = '4.1.29.Final'
COMMON_VERSION = '1.2.2.Final'
NETTY_VERSION = '4.1.31.Final'
JNR_VERSION = '2.1.9'

SPRING_BOOT_VERSION = '2.0.4.RELEASE'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,10 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
Expand All @@ -57,19 +56,26 @@
* @since 1.4.0
*/
@Configuration
@ConditionalOnClass(JxnetConfigurationProperties.class)
@ConditionalOnClass({Jxnet.class, Context.class})
@AutoConfigureOrder(Ordered.HIGHEST_PRECEDENCE)
@EnableConfigurationProperties(JxnetConfigurationProperties.class)
public class JxnetAutoConfiguration {

private static final Logger LOGGER = LoggerFactory.getLogger(JxnetAutoConfiguration.class.getName());

private final ApplicationContext context;
@Value("${spring.application.name:}")
private String applicationName;

@Value("${spring.application.displayName:}")
private String applicationDisplayName;

@Value("${spring.application.version:0.0.0}")
private String applicationVersion;

private final JxnetConfigurationProperties properties;

@Autowired
public JxnetAutoConfiguration(ApplicationContext context, JxnetConfigurationProperties properties) {
this.context = context;
public JxnetAutoConfiguration(JxnetConfigurationProperties properties) {
this.properties = properties;
}

Expand All @@ -80,8 +86,7 @@ public JxnetAutoConfiguration(ApplicationContext context, JxnetConfigurationProp
* @return returns application context.
*/
@Bean("com.ardikars.jxnet.contex")
public Context context(PcapIf pcapIf,
@Qualifier("com.ardikars.jxnet.errbuf") StringBuilder errbuf) {
public Context context(PcapIf pcapIf, StringBuilder errbuf) {
String source = pcapIf.getName();
Pcap.Builder builder = new Pcap.Builder()
.source(source)
Expand Down Expand Up @@ -117,7 +122,7 @@ public Context context(PcapIf pcapIf,
builder.pcapType(Pcap.PcapType.LIVE);
break;
}
Application.run(context.getApplicationName(), context.getDisplayName(), "", builder);
Application.run(applicationName, applicationDisplayName, applicationVersion, builder);
return Application.getApplicationContext();
}

Expand All @@ -128,7 +133,7 @@ public Context context(PcapIf pcapIf,
* @throws DeviceNotFoundException device not found exception.
*/
@Bean
public PcapIf pcapIf(@Qualifier("com.ardikars.jxnet.errbuf") StringBuilder errbuf) throws DeviceNotFoundException {
public PcapIf pcapIf(StringBuilder errbuf) throws DeviceNotFoundException {
String source = properties.getSource();
List<PcapIf> alldevsp = new ArrayList<>();
if (PcapFindAllDevs(alldevsp, errbuf) != OK && LOGGER.isDebugEnabled()) {
Expand Down Expand Up @@ -184,7 +189,7 @@ public MacAddress macAddress(PcapIf pcapIf) throws PlatformNotSupportedException
* Error buffer.
* @return error buffer.
*/
@Bean("com.ardikars.jxnet.errbuf")
@Bean
public StringBuilder errbuf() {
return new StringBuilder(PCAP_ERRBUF_SIZE);
}
Expand Down
2 changes: 2 additions & 0 deletions jxnet-spring-boot-starter/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ dependencyManagement {
}

dependencies {
implementation project (":jxnet-context")
implementation project (":jxnet-core")
implementation project (":jxnet-spring-boot-autoconfigure")
implementation ("com.ardikars.common:common-net")
implementation ("com.ardikars.common:common-util")
Expand Down

0 comments on commit bf7f852

Please sign in to comment.