Skip to content
This repository has been archived by the owner on Mar 11, 2022. It is now read-only.

Add pure Kotlin EventSourcedEntityFactory, EntityHandler and ResolvedEntityFactory implementations #26

Merged
merged 25 commits into from
Apr 28, 2020

Conversation

sleipnir
Copy link

It partially solves the issue #6 and allows new handlers to be created in the future without depending on the Scala handlers.
Eliminates the need for Bytebuddy for EventSourced entities

@sleipnir
Copy link
Author

@vkorenev do you want to take a look at this PR? I find it interesting to merge this before your PR to facilitate the merge

/** Mark annotation for all CloudState annotations */
@Target(ElementType.ANNOTATION_TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface CloudStateAnnotation {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This annotation does not seem to be used anywhere.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the annotation for EventSourced support but I will keep the original annotation from the java support package for CRDT

if (other.additionalDescriptors == null) return false
if (!additionalDescriptors.contentEquals(other.additionalDescriptors)) return false
} else if (other.additionalDescriptors != null) return false
if (!additionalDescriptors.contentEquals(other.additionalDescriptors)) return false
Copy link
Contributor

@vkorenev vkorenev Apr 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How's about using a List of FileDescriptors instead of Array? Then it should be possible to use equals and hashCode generated by Kotlin.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good. because I chose to expose the registration api in a similar way to java api. But I will change

import scala.collection.immutable.Map
import java.util.*

class KotlinAnnotationBasedCrdt(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class does not seem to be used anywhere.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is initial implementation of CRDT support

Copy link
Contributor

@vkorenev vkorenev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sleipnir
Copy link
Author

Thanks @vkorenev

@sleipnir sleipnir merged commit 1c74990 into master Apr 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants