Skip to content

Commit

Permalink
Issue #6 Infinispan Server extension
Browse files Browse the repository at this point in the history
  • Loading branch information
tristantarrant committed Feb 8, 2022
1 parent 242a5e9 commit 90988ae
Show file tree
Hide file tree
Showing 20 changed files with 486 additions and 168 deletions.
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>org.crucial</groupId>
<artifactId>dso</artifactId>
<version>2.0</version>
<relativePath>../</relativePath>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>dso-core</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/org/crucial/dso/Factory.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ public static Factory get(String server) {
.host(host)
.port(port)
.forceReturnValues(true)
.addJavaSerialWhiteList(".*")
.marshaller(new JavaSerializationMarshaller()).addJavaSerialWhiteList(".*")
.addJavaSerialAllowList(".*")
.marshaller(new JavaSerializationMarshaller())
.connectionTimeout(3000)
.maxRetries(5);
RemoteCacheManager manager = new RemoteCacheManager(cb.build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import org.crucial.dso.object.Call;
import org.crucial.dso.object.CallResponse;
import org.crucial.dso.object.Reference;
import org.crucial.dso.utils.Reflection;
import org.infinispan.commons.logging.Log;
import org.infinispan.commons.logging.LogFactory;

Expand Down
11 changes: 3 additions & 8 deletions core/src/main/java/org/crucial/dso/container/BaseContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,11 @@
import javassist.util.proxy.MethodHandler;
import javassist.util.proxy.ProxyFactory;
import javassist.util.proxy.ProxyObject;
import org.crucial.dso.object.*;
import org.crucial.dso.utils.Context;
import org.crucial.dso.utils.ContextManager;
import org.crucial.dso.utils.Reflection;
import org.infinispan.commons.api.BasicCache;
import org.crucial.dso.object.BoxedReference;
import org.crucial.dso.object.Call;
import org.crucial.dso.object.CallConstruct;
import org.crucial.dso.object.CallInvoke;
import org.crucial.dso.object.CallResponse;
import org.crucial.dso.object.Reference;

import javax.persistence.Entity;
import java.lang.reflect.InvocationTargetException;
Expand Down Expand Up @@ -154,7 +149,7 @@ private synchronized void open()
if (!isOpen) {

if (log.isTraceEnabled())
log.trace(" Opening - "+this.toString());
log.trace(" Opening - " + this);

CallConstruct construct = new CallConstruct(reference,
generateCallID(), forceNew, initArgs, readOptimization, isIdempotent);
Expand All @@ -164,7 +159,7 @@ private synchronized void open()
isOpen = true;

if (log.isTraceEnabled())
log.trace(" Opened - "+this.toString());
log.trace(" Opened - " + this);

}

Expand Down
51 changes: 37 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@
<version.java-uuid-generator>3.1.3</version.java-uuid-generator>
<version.javax-persistance-api>2.2</version.javax-persistance-api>
<version.args4j>2.32</version.args4j>
<version.javassist>3.23.1-GA</version.javassist>
<version.javassist>3.28.0-GA</version.javassist>
<version.testng>6.14.3</version.testng>
<version.infinispan>11.0.4.Final</version.infinispan>
<version.infinispan>13.0.6.Final</version.infinispan>
<version.io-kubernetes-client-java>4.0.0</version.io-kubernetes-client-java>
<version.picocli>4.0.4</version.picocli>
<version.aspectj>1.9.</version.aspectj>
<version.aspectj>1.9.7</version.aspectj>
<version.javax.annotation>1.3.2</version.javax.annotation>
<log4j.configurationFile>log4j2.xml</log4j.configurationFile>
</properties>

Expand Down Expand Up @@ -77,6 +78,22 @@
<version>${version.infinispan}</version>
</dependency>

<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-component-annotations</artifactId>
<version>${version.infinispan}</version>
<!-- compile-only dependency -->
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-component-processor</artifactId>
<version>${version.infinispan}</version>
<!-- compile-only dependency -->
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-jboss-marshalling</artifactId>
Expand Down Expand Up @@ -107,6 +124,13 @@
<version>${version.javax-persistance-api}</version>
</dependency>

<dependency>
<groupId>org.kohsuke.metainf-services</groupId>
<artifactId>metainf-services</artifactId>
<version>1.8</version>
<scope>provided</scope>
</dependency>

<!-- fixme -->
<dependency>
<groupId>args4j</groupId>
Expand All @@ -131,6 +155,7 @@
<groupId>org.infinispan</groupId>
<artifactId>infinispan-commons-test</artifactId>
<version>${version.infinispan}</version>
<scope>test</scope>
</dependency>

<dependency>
Expand Down Expand Up @@ -158,6 +183,13 @@
<version>${aspectj.version}</version>
</dependency>

<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>${version.javax.annotation}</version>
<scope>provided</scope>
</dependency>

<!-- TEST -->

<dependency>
Expand Down Expand Up @@ -196,23 +228,14 @@
</profiles>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>11</release>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<version>${maven-compiler-plugin-version}</version>
<configuration>
<release>${maven.compiler.source-target}</release>
<source>${maven.compiler.source-target}</source>
<target>${maven.compiler.source-target}</target>
<!-- IMPORTANT -->
Expand Down
136 changes: 93 additions & 43 deletions server/pom.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.crucial</groupId>
<artifactId>dso</artifactId>
<version>2.0</version>
<relativePath>../</relativePath>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>dso-server</artifactId>
Expand All @@ -30,6 +31,16 @@
<artifactId>infinispan-core</artifactId>
</dependency>

<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-component-annotations</artifactId>
</dependency>

<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-component-processor</artifactId>
</dependency>

<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-commons</artifactId>
Expand All @@ -40,6 +51,11 @@
<artifactId>infinispan-server-hotrod</artifactId>
</dependency>

<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
</dependency>

<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-server-hotrod</artifactId>
Expand All @@ -65,25 +81,22 @@
</dependency>

<dependency>
<groupId>org.jgroups.kubernetes</groupId>
<artifactId>jgroups-kubernetes</artifactId>
<version>1.0.9.Final</version>
<groupId>org.jgroups.kubernetes</groupId>
<artifactId>jgroups-kubernetes</artifactId>
<version>1.0.9.Final</version>
</dependency>

<dependency>
<groupId>com.fasterxml.uuid</groupId>
<artifactId>java-uuid-generator</artifactId>
</dependency>

<!-- TEST -->

<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-commons-test</artifactId>
<type>test-jar</type>
<version>${version.infinispan}</version>
<groupId>org.kohsuke.metainf-services</groupId>
<artifactId>metainf-services</artifactId>
</dependency>

<!-- TEST -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>dso-core</artifactId>
Expand All @@ -99,13 +112,6 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-component-annotations</artifactId>
<version>${version.infinispan}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
Expand All @@ -129,51 +135,95 @@
</resources>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
<goal>test-jar</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptor>src/main/assembly/bin.xml</descriptor>
<finalName>${project.name}-${project.version}</finalName>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<includeScope>compile</includeScope>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>docker</id>
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.37.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
<configuration>
<images>
<image>
<name>otrack/dso-server</name>
<build>
<dockerFile>${project.basedir}/src/main/docker/Dockerfile</dockerFile>
<contextDir>${project.basedir}</contextDir>
</build>
</image>
</images>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>standalone</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<finalName>${project.name}-${project.version}</finalName>
<descriptors>
<descriptor>src/main/assembly/bin.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>

Loading

0 comments on commit 90988ae

Please sign in to comment.