implements TaskEntity {
+
+ /**
+ * The current state of the entity. Subclasses may read and write this field directly
+ * in their operation methods.
+ */
+ protected TState state;
+
+ /**
+ * The current entity context, providing access to entity metadata such as the entity ID
+ * and the ability to signal other entities.
+ *
+ * This property is automatically set before each operation dispatch and is available for use
+ * in operation methods. This mirrors the .NET SDK's {@code TaskEntity.Context} property.
+ */
+ protected TaskEntityContext context;
+
+ /**
+ * Controls whether operations can be dispatched to methods on the state object.
+ * When {@code true}, if no matching method is found on the entity class itself,
+ * the framework will look for a matching method on the state object.
+ * When {@code false} (the default), only methods on the entity class are considered.
+ *
+ * This matches the .NET SDK default where {@code AllowStateDispatch} is {@code false}.
+ */
+ private boolean allowStateDispatch = false;
+
+ // Per-class cache for resolved methods, keyed by operation name (lowercased).
+ // Uses ClassValue to scope the cache per entity class, matching the .NET model
+ // where MethodInfo caching is per-type. GC can collect entries when classes are unloaded.
+ private static final ClassValue