Commit Graph

18 Commits

Author SHA1 Message Date
Chris Rankin
2157df03b8 Migrate DJVM serialization modules into Corda. 2019-10-22 14:30:02 +01:00
Chris Rankin
bdd3377223 Update to use Corda 4.4-SNAPSHOT. (#95) 2019-10-22 09:23:16 +01:00
Chris Rankin
c0e62d0dfd CORDA-3330: Allow DJVM to preload / pregenerate classes from selected jars. (#92)
* Add support for SourceClassLoader.getResources().
* Allow a SandboxConfiguration to preload sandbox byte-code for all classes inside jars containing META-INF/DJVM-preload.
2019-10-21 14:11:51 +01:00
Chris Rankin
83ad11f21b CORDA-3309: Remove explicit try-catch in favour of UncaughtExceptionHandler. (#91) 2019-10-09 09:45:44 +01:00
Chris Rankin
90c2f7f129 CORDA-3309: Install UncaughtExceptionHandler for DJVM tasks. (#88) 2019-10-08 14:57:46 +01:00
Chris Rankin
ecc5ace4c7 Fix tests broken by Windows line endings. (#82) 2019-10-03 16:56:23 +01:00
Chris Rankin
a910ac9b67 CORDA-3292: Reimplement ExecutionProfile as a data class. (#80) 2019-10-03 09:10:05 +01:00
Chris Rankin
3d0a4aa614 CORDA-2877: Refactor how we create child SandboxConfiguration objects. (#76) 2019-09-30 10:07:02 +01:00
Chris Rankin
ed23c4b998 CORDA-2877: Load bytecode from a persistent cache to prevent repeated rewriting. (#75)
* Load bytecode from a persistent cache to prevent repeated rewriting.
* Refactor byte-code cache to SandboxConfiguration instead of AnalysisConfiguration. We cannot "mix and match" byte-code generated by different sets of rules.
2019-09-26 17:50:40 +01:00
Chris Rankin
d604308563 CORDA-3137: Enhance annotation handling so that we can allow some annotations to be mapped into the sandbox without also needing to be stitched. (#72) 2019-09-19 22:04:24 +01:00
Chris Rankin
8718433be6 CORDA-2871: Minor cosmetic fixes. (#69) 2019-09-15 01:28:31 +01:00
Chris Rankin
394d503d41 CORDA-3218: Align DJVM with internal Corda Serialisation API. (#68)
* Align DJVM with internal Corda Serialisation API.
* Ensure we get the latest SNAPSHOT of the serialisation code.
2019-09-14 14:00:23 +01:00
Chris Rankin
e0ce1bd525 CORDA-2871: Refactor SourceClassLoader to define source classes. (#66)
* Rewrite SourceClassLoader to support parent/child relationships.
* Revert catching TypNotPresebtException - it was a symptom of a bigger problem.
* Remove AutoCloseable from AnalysisConfiguration and SourceClassLoader.
* SourceClassLoader.getResource() must delegate to its parent first.
2019-09-12 15:11:08 +01:00
Chris Rankin
1a53f1a22a CORDA-2871: Ensure ClassLoader.loadClass() throws ClassNotFoundException for all cases where the class cannot be found. (#64) 2019-09-10 11:50:02 +01:00
Chris Rankin
062acf89be CORDA-2871: Modify sandbox tasks to implement both java.Function and sandbox.Function (#62)
* Modify sandbox tasks to implement both java.Function and sandbox.Function.
* Make TaskExecutors implement BiFunction to make them composable.
* Create ImportTask to wrap a java.Function inside a sandbox.Function.
* Add createExecutor() and createRawExecutor() APIs to SandboxClassLoader.
* Update serialization to use SandboxClassLoader.toSandboxClass().
* Remove a layer of lambdas from the serialisation code.
* Update SandboxExecutor and SandboxRawExecutor.
* Rename Executor to TaskFactory.
* Rename dangling executor -> taskFactory.
2019-09-10 10:55:55 +01:00
Chris Rankin
7a6c18156c CORDA-2871: Sanity fixes! (#63)
* Improve message for SandboxClassLoadingException.
* Fix serialisation API for using sandboxed environment.
2019-09-09 18:14:33 +01:00
Chris Rankin
f68c4b3308 CORDA-3174: Extend serialisation to include InputStream and OpaqueBytesSubSequence. (#60)
* Update DJVM Example project for serialisation.
* Add serializers for InputStream and OpaqueBytesSubSequence.
* Support ZIP Inflater and CRC32 inside the sandbox.
* Allow the DJVM to wrap java.io.InputStream as sandbox.java.io.InputStream.
* Configure tests also to preserve @DeprecatedConstructorForDeserialization.
2019-09-03 11:35:48 +01:00
Chris Rankin
67623f04a3 CORDA-3174: Implement Corda serialization modules. (#59)
* Create DJVM serialization modules.
* Create test cases for Array<T>, List<T> and List<Array<T>>.
* Refactor SandboxPrimiveSerializer for all primitive types.
* Implement SandboxCollectionSerializer to support Collection types.
* Implement SandboxMapSerializer to support Map types.
* Attempt to fix infinite loop when computing Collection and Map fingerprints.
* Apply special handling when deserialising sandbox.java.lang.Character.
* Remap Java primitive types to sandbox Java object types to deter evolution.
* Use Class.getPackage().getName() to determine sandbox package name.
* Implement SandboxEnumSerializer to support Enum types.
* Implement SandboxPublicKeySerializer to support Java security keys.
* Add serialization projects to the composite example project.
* Implement serializers for BigInteger, BigDecimal, Currency and StringBuffer.
* Test that deserialising does not instantiate the untrusted user classes.
* Implement serializers for java.time.* types.
* Add serialiser for BitSet - currently disabled until BitSet itself is supported.
* Add serialisers for EnumSet and Class.
* Include support for EnumMap in the SandboxMapSerializer.
* Ensure the DJVM Example project's tests preserve @CordaSerializable.
* Add support for UUID as a primitive type.
* Use common abortReadOnly() method for declaring serialization as unsupported.
* Streamline the API for deserialising into the sandbox.
* Add preliminary support for deserialising X.509 certificates.
* Implement serializer for java.util.Optional.
* Refactor configuration of the sandbox serialization scheme.
* Add tests for deserialising arrays of basic types.
* Include method annotations in annotation stitching. This ensures that `@ConstructorForDeserialization` is not dropped.
* Enable test for SandboxBitSetSerializer.
* Enable tests for X.509 serializers.
* Implement serializers for ProtonJ primitive types.
* Serialize java.util.Date as a primitive type.
* Add the bintray Gradle plugin to the serialisation modules.
* Do not publish serialisation modules - they will become part of Corda itself.
2019-09-02 16:12:49 +01:00