Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: mtconnect add examples module #3

Merged
merged 1 commit into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions mtconnect-examples/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.github.protocol-laboratory</groupId>
<artifactId>mtconnect-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>

<artifactId>mtconnect-examples</artifactId>

<dependencies>
<dependency>
<groupId>io.github.protocol-laboratory</groupId>
<artifactId>mtconnect-client</artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>io.github.protocol-laboratory</groupId>
<artifactId>mtconnect-server</artifactId>
<version>${version}</version>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package io.github.protocol.mtconnect.examples;

import io.github.protocol.mtconnect.client.MtConnectClient;
import io.github.protocol.mtconnect.client.MtConnectClientConfiguration;

public class MtConnectClientExample {
public static void main(String[] args) {
MtConnectClientConfiguration configuration = new MtConnectClientConfiguration();
new MtConnectClient(configuration);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package io.github.protocol.mtconnect.examples;

import io.github.protocol.mtconnect.server.MtConnectServer;
import io.github.protocol.mtconnect.server.MtConnectServerConfiguration;

public class MtConnectServerExample {
public static void main(String[] args) {
MtConnectServerConfiguration configuration = new MtConnectServerConfiguration();
MtConnectServer mtConnectServer = new MtConnectServer(configuration);
mtConnectServer.start().join();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import io.github.shoothzj.http.facade.server.HttpServer;
import io.github.shoothzj.http.facade.server.HttpServerFactory;

import java.util.concurrent.CompletableFuture;

public class MtConnectServer {
private final MtConnectServerConfiguration config;

Expand All @@ -12,4 +14,8 @@ public MtConnectServer(MtConnectServerConfiguration configuration) {
this.config = configuration;
this.httpServer = HttpServerFactory.createHttpServer(config.httpConfig());
}

public CompletableFuture<Void> start() {
return httpServer.start();
}
}
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

<modules>
<module>mtconnect-client</module>
<module>mtconnect-examples</module>
<module>mtconnect-server</module>
</modules>

Expand Down