The openAtomicBoolean field in Core is not publicly gettable, so I added a boolean getter Core#isOpen(). Additionally, I subclassed IllegalStateException and created CoreClosedException which is easier to catch for than a plain IllegalStateException.
My rationale for this change is that any of the SDK methods that eventually call (the package-private) Core#execute method may throw an IllegalArgumentException if the Core is unexpectedly closed. I would prefer to avoid exception-based handling as a user of this library, so being able to check if the Core is open or not is useful. The CoreClosedException was my original plan since I could catch-filter for it, but I think both options are flexible.
The
open
AtomicBoolean
field inCore
is not publicly gettable, so I added a boolean getterCore#isOpen()
. Additionally, I subclassedIllegalStateException
and createdCoreClosedException
which is easier to catch for than a plainIllegalStateException
.My rationale for this change is that any of the SDK methods that eventually call (the package-private)
Core#execute
method may throw an IllegalArgumentException if the Core is unexpectedly closed. I would prefer to avoid exception-based handling as a user of this library, so being able to check if the Core is open or not is useful. TheCoreClosedException
was my original plan since I could catch-filter for it, but I think both options are flexible.