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

PAYARA-223 hazelcast eclipselink cache coordination #2666

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
aac15da
added hazelcast cache coordination artifact including transport manag…
svendiedrichsen Mar 2, 2018
cdb4a3b
Merge branch 'master' of https://github.com/payara/Payara into hazelc…
svendiedrichsen Mar 2, 2018
e1c43c5
removing interface and caching topic name
svendiedrichsen Mar 2, 2018
449b896
minor refactoring
svendiedrichsen Mar 4, 2018
34dda47
Merge branch 'master' of https://github.com/payara/Payara into hazelc…
svendiedrichsen Mar 4, 2018
99b098f
added topic destruction on close
svendiedrichsen Mar 5, 2018
9aab944
Merge branch 'master' of https://github.com/payara/Payara into hazelc…
svendiedrichsen Mar 6, 2018
3760c3c
Merge branch 'master' of https://github.com/payara/Payara into hazelc…
svendiedrichsen Mar 9, 2018
6ecfea1
Merge branch 'master' of https://github.com/payara/Payara into hazelc…
svendiedrichsen Mar 13, 2018
3d0f470
Merge branch 'master' of https://github.com/payara/Payara into hazelc…
svendiedrichsen Mar 15, 2018
b9c6739
Merge branch 'master' of https://github.com/payara/Payara into hazelc…
svendiedrichsen Mar 25, 2018
b7ed0f5
Merge branch 'master' of https://github.com/payara/Payara into hazelc…
svendiedrichsen Mar 26, 2018
595ffb9
Merge branch 'master' of https://github.com/payara/Payara into hazelc…
svendiedrichsen Mar 26, 2018
9225f9c
Merge branch 'master' of https://github.com/payara/Payara into hazelc…
svendiedrichsen Apr 8, 2018
64a4e02
Merge branch 'master' of https://github.com/payara/Payara into hazelc…
svendiedrichsen Apr 15, 2018
63dcfc0
Merge branch 'master' of https://github.com/payara/Payara into hazelc…
svendiedrichsen Apr 18, 2018
8cdfee6
Merge branch 'master' of https://github.com/payara/Payara into hazelc…
svendiedrichsen Apr 22, 2018
5100c38
first working implementation using hazelcast topic for cache coordina…
svendiedrichsen Apr 23, 2018
2bf7849
further refactorings and additional javadoc
svendiedrichsen Apr 24, 2018
057e662
Merge branch 'master' of https://github.com/payara/Payara into hazelc…
svendiedrichsen Apr 24, 2018
c128657
some minor refactoring. introduced async message processing with the …
svendiedrichsen Apr 24, 2018
a270378
removed check for local publisher
svendiedrichsen Apr 24, 2018
64eb766
Added check that the connection which originally sent the message doe…
svendiedrichsen Apr 25, 2018
2bdf1f8
Added check that the connection which originally sent the message doe…
svendiedrichsen Apr 25, 2018
519a8b0
Merge branch 'master' of https://github.com/payara/Payara into hazelc…
svendiedrichsen Apr 25, 2018
4ff3dc0
removed unused method.
svendiedrichsen Apr 25, 2018
756bec8
removed unused dependency
svendiedrichsen Apr 26, 2018
0a718ee
Merge branch 'master' of https://github.com/payara/Payara into hazelc…
svendiedrichsen Apr 26, 2018
cc2140f
removed usage of hazelcast directly. using payara hazelcast wrapper.
svendiedrichsen Apr 26, 2018
9587f77
Merge branch 'master' of https://github.com/payara/Payara into hazelc…
svendiedrichsen May 1, 2018
5745a76
added reregistration of MessageReceivers on hz container restart
svendiedrichsen May 1, 2018
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
51 changes: 29 additions & 22 deletions appserver/extras/payara-micro/payara-micro-distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

-->
<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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion>

<parent>
<groupId>fish.payara.extras.payara-micro</groupId>
<artifactId>payara-micro-parent</artifactId>
Expand All @@ -51,9 +51,9 @@
<groupId>fish.payara.extras</groupId>
<artifactId>payara-micro</artifactId>
<packaging>jar</packaging>

<name>Payara Micro Distribution</name>


<build>
<defaultGoal>install</defaultGoal>
Expand Down Expand Up @@ -212,7 +212,7 @@
<type>zip</type>
<optional>true</optional>
</dependency>

<!-- JMS Client dependencies -->
<dependency>
<groupId>org.glassfish.main.ejb</groupId>
Expand Down Expand Up @@ -246,7 +246,7 @@
<optional>true</optional>
</dependency>
<!-- End of JMS Client Dependencies -->

<dependency>
<groupId>org.glassfish.main.packager</groupId>
<artifactId>glassfish-jsf</artifactId>
Expand Down Expand Up @@ -296,7 +296,7 @@
<type>zip</type>
<optional>true</optional>
</dependency>

<!-- hazelcast package -->
<dependency>
<groupId>org.glassfish.main.packager</groupId>
Expand All @@ -305,7 +305,7 @@
<type>zip</type>
<optional>true</optional>
</dependency>

<!-- healthcheck package -->
<dependency>
<groupId>org.glassfish.main.packager</groupId>
Expand All @@ -314,7 +314,7 @@
<type>zip</type>
<optional>true</optional>
</dependency>

<!-- request tracing package -->
<dependency>
<groupId>org.glassfish.main.packager</groupId>
Expand All @@ -323,7 +323,7 @@
<type>zip</type>
<optional>true</optional>
</dependency>

<!-- notification package -->
<dependency>
<groupId>org.glassfish.main.packager</groupId>
Expand All @@ -332,7 +332,7 @@
<type>zip</type>
<optional>true</optional>
</dependency>

<!-- phonehome package -->
<dependency>
<groupId>org.glassfish.main.packager</groupId>
Expand All @@ -341,7 +341,7 @@
<type>zip</type>
<optional>true</optional>
</dependency>

<!-- payara api package -->
<dependency>
<groupId>org.glassfish.main.packager</groupId>
Expand All @@ -350,7 +350,7 @@
<type>zip</type>
<optional>true</optional>
</dependency>

<!-- ha package -->
<dependency>
<groupId>org.glassfish.main.packager</groupId>
Expand All @@ -359,7 +359,7 @@
<type>zip</type>
<optional>true</optional>
</dependency>

<!-- payara rest endpoint package -->
<dependency>
<groupId>org.glassfish.main.packager</groupId>
Expand All @@ -368,7 +368,7 @@
<type>zip</type>
<optional>true</optional>
</dependency>

<!-- Add Payara Micro Core -->
<dependency>
<groupId>fish.payara.micro</groupId>
Expand All @@ -377,7 +377,7 @@
<type>jar</type>
<optional>true</optional>
</dependency>

<!-- Add Payara Micro Services -->
<dependency>
<groupId>fish.payara.micro</groupId>
Expand All @@ -386,7 +386,7 @@
<type>jar</type>
<optional>true</optional>
</dependency>

<!-- Add Boot classes -->
<dependency>
<groupId>fish.payara.micro</groupId>
Expand All @@ -395,7 +395,7 @@
<type>jar</type>
<optional>true</optional>
</dependency>

<!-- Add Payara Micro CDI Integration -->
<dependency>
<groupId>fish.payara.micro</groupId>
Expand All @@ -404,7 +404,7 @@
<type>jar</type>
<optional>true</optional>
</dependency>

<!-- Add JBatch -->
<dependency>
<groupId>org.glassfish.main.batch</groupId>
Expand All @@ -427,7 +427,7 @@
<type>jar</type>
<optional>true</optional>
</dependency>

<!-- Add Hazelcast EJB Timer Store -->
<dependency>
<groupId>fish.payara.ejb.timer</groupId>
Expand All @@ -436,14 +436,21 @@
<type>jar</type>
<optional>true</optional>
</dependency>
<dependency>
<groupId>fish.payara.persistence.coordination</groupId>
<artifactId>hazelcast-eclipselink-coordination</artifactId>
<version>${project.version}</version>
<type>jar</type>
<optional>true</optional>
</dependency>
<dependency>
<groupId>fish.payara.jmx.monitoring</groupId>
<artifactId>jmx-monitoring</artifactId>
<version>${project.version}</version>
<type>jar</type>
<optional>true</optional>
</dependency>

<!-- JMS Annotation handlers -->
<dependency>
<groupId>org.glassfish.main.jms</groupId>
Expand All @@ -466,9 +473,9 @@
<version>${project.version}</version>
<type>zip</type>
<optional>true</optional>
</dependency>
</dependency>
</dependencies>

<profiles>
<profile>
<!-- generate empty javadoc jar -->
Expand Down
10 changes: 8 additions & 2 deletions appserver/packager/glassfish-jpa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<profile>
<id>ips</id>
<activation>
<activeByDefault>false</activeByDefault>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
Expand Down Expand Up @@ -121,7 +121,7 @@
</profile>

</profiles>


<dependencies>
<dependency>
Expand Down Expand Up @@ -181,6 +181,12 @@
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.asm</artifactId>
</dependency>
<!-- JPA hazelcast cache coordination -->
<dependency>
<groupId>fish.payara.persistence.coordination</groupId>
<artifactId>hazelcast-eclipselink-coordination</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>

Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?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>org.glassfish.main</groupId>
<artifactId>payara-appserver-modules</artifactId>
<version>5.182-SNAPSHOT</version>
</parent>
<groupId>fish.payara.persistence.coordination</groupId>
<artifactId>hazelcast-eclipselink-coordination</artifactId>
<packaging>glassfish-jar</packaging>
<name>HZ Eclipselink Coordination</name>
<description>Hazelcast Based Eclipselink L2 Cache Coordination</description>
<developers>
<developer>
<id>svendiedrichsen</id>
<name>Sven Diedrichsen</name>
<roles>
<role>developer</role>
</roles>
</developer>
</developers>
<dependencies>
<dependency>
<groupId>fish.payara.payara-modules</groupId>
<artifactId>payara-executor-service</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>fish.payara.payara-modules</groupId>
<artifactId>hazelcast-bootstrap</artifactId>
<version>${project.version}</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>org.eclipse.persistence.core</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2016-2018 Payara Foundation and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* https://github.com/payara/Payara/blob/master/LICENSE.txt
* See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at glassfish/legal/LICENSE.txt.
*
* GPL Classpath Exception:
* The Payara Foundation designates this particular file as subject to the "Classpath"
* exception as provided by the Payara Foundation in the GPL Version 2 section of the License
* file that accompanied this code.
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
package fish.payara.persistence.eclipselink.cache.coordination;

import org.eclipse.persistence.internal.sessions.AbstractSession;
import org.eclipse.persistence.sessions.coordination.RemoteCommandManager;
import org.eclipse.persistence.sessions.serializers.JavaSerializer;
import org.eclipse.persistence.sessions.serializers.Serializer;

import java.io.Serializable;
import java.util.UUID;

/**
* Represents the payload transported via Hazelcast topic.
*
* @author Sven Diedrichsen
*/
public abstract class HazelcastPayload implements Serializable {

private static final long serialVersionUID = 1;

/**
* This payloads id.
*/
private final UUID id = UUID.randomUUID();

public abstract org.eclipse.persistence.sessions.coordination.Command getCommand(RemoteCommandManager rcm);

public UUID getId() { return id; }

/**
* Implements a payload for raw bytes to transfer.
*/
public static class Bytes extends HazelcastPayload {

private final byte[] bytes;

public Bytes(byte[] bytes) {
this.bytes = bytes;
}

/**
* Returns the serialized {@link org.eclipse.persistence.sessions.coordination.Command} from
* the provided bytes.
* @param rcm The {@link RemoteCommandManager} to use for serialization.
* @return coordination command serialized from bytes.
*/
public org.eclipse.persistence.sessions.coordination.Command getCommand(RemoteCommandManager rcm) {
Serializer serializer = rcm.getSerializer();
if (serializer == null) {
serializer = JavaSerializer.instance;
}
return (org.eclipse.persistence.sessions.coordination.Command)serializer.deserialize(this.bytes, (AbstractSession) rcm.getCommandProcessor());
}
}

/**
* Implements a payload consisting of a coordination command.
*/
public static class Command extends HazelcastPayload {

private final org.eclipse.persistence.sessions.coordination.Command command;

public Command(org.eclipse.persistence.sessions.coordination.Command command) {
this.command = command;
}

/**
* Simply returns the original command.
* @param rcm The {@link RemoteCommandManager} to use for serialization. Will not be used.
* @return The original command.
*/
@Override
public org.eclipse.persistence.sessions.coordination.Command getCommand(RemoteCommandManager rcm) {
return this.command;
}
}

}
Loading