Formal objects and executors
OwnerLior Malkainventor
Life of this patent
Estimating the term…
Abstract
Embodiments are provided for formal objects and executors. In one embodiment, a formal object serialization allows retrieving the object value using a Get method, writing the object value using a Write method, and reading the object value using a Read method. In one embodiment, a formal object validation uses a validator to validate assignments to the object value. Formal validation and serialization may be combined. In one embodiment, a formal executor is guaranteed to be closed regardless of whether an error has occurred or not.
Claims18
A method of formal object serialization, the method comprising:
- receiving input;
- and
- initializing a Boolean Readable variable from the input, and initializing a Value variable from the input if Readable is FALSE;
- and
- providing a Get method that returns the Value variable if Readable is FALSE and an error otherwise;
- and
- providing a Write method that writes the value to a stream if Readable is FALSE and returns an error otherwise;
- and
- providing a Read method that returns an error if Readable is FALSE, and otherwise sets Readable to FALSE and sets the Value variable to a value read from a stream.
A method of formal object validation, the method comprising:
- receiving input;
- and
- using a validator sub-object to validate a value before assigning the value to a Value variable;
- and
- providing a Read method that sets the Value variable to a value that has been read from a stream and validated by the validator;
- and
- providing a metadata sub-object that the Read method uses to determine the kind and amount of data that should be read from a stream and returning an error if data read from the stream is inconsistent with the metadata sub-object.
A method of a formal executor, the method comprising:
- providing a close method that shuts down an executor;
- and
- providing a thread with a closeable executor;
- and
- instantiating the executor within a try-with-resources statement;
- and
- submitting tasks to the executor;
- and
- waiting for the try clause to complete.
Dependencies are inferred from the claim text.