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

Commit

Permalink
Update lib version, remove unneeded classes, remove jvm info
Browse files Browse the repository at this point in the history
  • Loading branch information
ardikars committed Apr 28, 2019
1 parent 8e6bc91 commit 3ef28eb
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 179 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Getting Started
- Linux (x86/x86_64)
- Mac OS
- ##### Java Version
- Java 8 (or newer)
- Java 6 (java 8 required if you are using spring-boot)
- ##### Dependecies
- Windows
- Winpcap or Npcap
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.5.RC3
1.5.5.RC4
4 changes: 2 additions & 2 deletions gradle/configure.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ ext {
PMD_VERION = '6.10.0'
JACOCO_VERSION = '0.8.2'

COMMON_VERSION = '1.2.7.RC5'
JXPACKET_VERSION = '1.2.3.RC4'
COMMON_VERSION = '1.2.7.RELEASE'
JXPACKET_VERSION = '1.2.3.RELEASE'
REACTOR_VERSION = 'Californium-RELEASE'
JNR_VERSION = '2.1.9'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* @author <a href="mailto:contact@ardikars.com">Ardika Rommy Sanjaya</a>
*/
@Configuration("springJxnetRunnerConfig")
@EnablePacket(packetHandlerType = PacketHandlerType.JXPACKET)
@EnablePacket(packetHandlerType = PacketHandlerType.JXPACKET_RAW)
public class SpringJxnetRunnerConfig implements JxpacketHandler<String> {

@Override
Expand Down
2 changes: 1 addition & 1 deletion jxnet-benchmark/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
jxnet.file=${PCAP_FILE:file.pcapng}
jxnet.file=${PCAP_FILE:/tmp/dump.pcap}

jxnet.pcapType=offline
jxnet.numberOfThread=${NUMBER_OF_THREAD:}
Expand Down
18 changes: 9 additions & 9 deletions jxnet-example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
description = 'Jxnet example application.'

dependencies {
implementation ("com.ardikars.common:common-annotation")
implementation ("com.ardikars.common:common-util")
implementation ("com.ardikars.common:common-net")
implementation ("com.ardikars.common:common-tuple")
implementation ("com.ardikars.common:common-memory")
implementation ("com.ardikars.jxpacket:jxpacket-common:1.2.3.RC")
implementation ("com.ardikars.jxpacket:jxpacket-core:1.2.3.RC")
implementation project (":jxnet-core")
implementation project (":jxnet-context")
compile ("com.ardikars.common:common-annotation")
compile ("com.ardikars.common:common-util")
compile ("com.ardikars.common:common-net")
compile ("com.ardikars.common:common-tuple")
compile ("com.ardikars.common:common-memory")
compile ("com.ardikars.jxpacket:jxpacket-common:1.2.3.RC")
compile ("com.ardikars.jxpacket:jxpacket-core:1.2.3.RC")
compile project (":jxnet-core")
compile project (":jxnet-context")
testImplementation ("junit:junit:${JUNIT_VERSION}")
testImplementation ("org.mockito:mockito-core:${MOCKITO_VERSION}")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import static com.ardikars.jxnet.spring.boot.autoconfigure.constant.JxnetObjectName.DATALINK_TYPE_BEAN_NAME;
import static com.ardikars.jxnet.spring.boot.autoconfigure.constant.JxnetObjectName.ERRBUF_BEAN_NAME;
import static com.ardikars.jxnet.spring.boot.autoconfigure.constant.JxnetObjectName.EXECUTOR_SERVICE_BEAN_NAME;
import static com.ardikars.jxnet.spring.boot.autoconfigure.constant.JxnetObjectName.JVM_BEAN_NAME;
import static com.ardikars.jxnet.spring.boot.autoconfigure.constant.JxnetObjectName.JXNET_AUTO_CONFIGURATION_BEAN_NAME;
import static com.ardikars.jxnet.spring.boot.autoconfigure.constant.JxnetObjectName.MAC_ADDRESS_BEAN_NAME;
import static com.ardikars.jxnet.spring.boot.autoconfigure.constant.JxnetObjectName.NETMASK_BEAN_NAME;
Expand All @@ -36,7 +35,6 @@
import com.ardikars.common.net.Inet4Address;
import com.ardikars.common.net.MacAddress;
import com.ardikars.common.util.Platforms;
import com.ardikars.common.util.management.Jvm;
import com.ardikars.jxnet.DataLinkType;
import com.ardikars.jxnet.Jxnet;
import com.ardikars.jxnet.Pcap;
Expand Down Expand Up @@ -343,13 +341,4 @@ public Context context(@Qualifier(PCAP_BUILDER_BEAN_NAME) Pcap.Builder builder,
return context;
}

/**
* Get {@link Jvm}.
* @return returns {@link Jvm}.
*/
@Bean(JVM_BEAN_NAME)
public Jvm jvm() {
return properties.getJvm();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

import com.ardikars.common.logging.Logger;
import com.ardikars.common.logging.LoggerFactory;
import com.ardikars.common.util.management.Jvm;
import com.ardikars.common.util.management.Jvms;
import com.ardikars.jxnet.BpfProgram;
import com.ardikars.jxnet.DataLinkType;
import com.ardikars.jxnet.ImmediateMode;
Expand Down Expand Up @@ -80,8 +78,6 @@ public class JxnetConfigurationProperties {

private Integer numberOfThread;

private Jvm jvm;

/**
* Initialize properties.
*/
Expand All @@ -101,7 +97,9 @@ public JxnetConfigurationProperties() {
}
pcap();
bpf();
jvm();
if (numberOfThread == null) {
numberOfThread = Runtime.getRuntime().availableProcessors();
}
log();
}

Expand Down Expand Up @@ -141,22 +139,6 @@ private void bpf() {
}
}

private void jvm() {
try {
jvm = Jvms.getJvm();
if (numberOfThread == null) {
if (jvm.hasJvm()) {
numberOfThread = jvm.getAvailableProcessors();
} else {
numberOfThread = 0;
}
}
} catch (Exception e) {
jvm = null;
LOGGER.warn(e.getMessage());
}
}

private void log() {
LOGGER.debug("Source : {}", source);
LOGGER.debug("Snapshot length : {}", snapshot);
Expand Down Expand Up @@ -304,8 +286,4 @@ public void setNumberOfThread(Integer numberOfThread) {
this.numberOfThread = numberOfThread;
}

public Jvm getJvm() {
return jvm;
}

}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public final class JxnetObjectName {
public static final String JXPACKET_ASYNC_RAW_HANDLER_CONFIGURATION_BEAN_NAME = "com.ardikras.jxnet.jxpacketAsyncRawHandlerConfiguration";
public static final String JXPACKET_ASYNC_HANDLER_CONFIGURATION_BEAN_NAME = "com.ardikras.jxnet.jxpacketAsyncHandlerConfiguration";
public static final String PCAP_BUILDER_BEAN_NAME = "com.ardikras.jxnet.pcapBuilder";
public static final String JVM_BEAN_NAME = "com.ardikras.jxnet.jvm";

private final String prefix;
private final String separator;
Expand Down

This file was deleted.

0 comments on commit 3ef28eb

Please sign in to comment.