Skip to content

Commit

Permalink
MNEMONIC-814: Improved Durable Object Creation Interface
Browse files Browse the repository at this point in the history
  • Loading branch information
katarinaking committed Feb 18, 2024
1 parent 05601d0 commit ce79288
Showing 1 changed file with 26 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,35 @@

import org.apache.mnemonic.RestorableAllocator;

/**
* Interface for creating durable objects.
*
* @param <V> Type of the durable object
* @param <A> Type of the allocator used for allocation
*/
public interface ObjectCreator<V, A extends RestorableAllocator<A>> {

V newDurableObjectRecord();
/**
* Creates a new durable object record.
*
* @return the newly created durable object record
*/
V newDurableObjectRecord();

V newDurableObjectRecord(long size);
/**
* Creates a new durable object record with the specified size.
*
* @param size the size of the durable object record
* @return the newly created durable object record
*/
V newDurableObjectRecord(long size);

A getAllocator();
/**
* Retrieves the allocator used for allocation.
*
* @return the allocator used for allocation
*/
A getAllocator();
}


0 comments on commit ce79288

Please sign in to comment.