ensureAccessToState

protected void ensureAccessToState()

Prohibits invoking state() method from within an applier method.

All applier methods are always invoked in scope of an active transaction. Until this transaction is completed, the state() of the corresponding aggregate is not up-to-date. Therefore, relying upon it in code is prone to errors, and is prohibited for good sake.

Throws

if this method is called from within an event applier