@Test public void test_get_copy_of_appObject() throws Exception { UUID txId = UUID.randomUUID(); Serializable coreOrigin = "aaa"; AppObject originAppObject = new AppObject(coreOrigin); TwoPCCohortPolicy.TwoPCCohortServerPolicy origin = new TwoPCCohortPolicy.TwoPCCohortServerPolicy(); origin.$__initialize(originAppObject); AppObjectSandboxProvider provider = new AppObjectSandboxProvider(); AppObjectShimServerPolicy sandbox = (AppObjectShimServerPolicy) provider.getSandbox(origin, txId); AppObject sandboxAppObject = sandbox.getAppObject(); assertNotSame(sandboxAppObject, originAppObject); }
@Override public ServerUpcalls getSandbox(ServerPolicyLibrary origin, UUID transactionId) throws Exception { if (!this.sandboxes.containsKey(transactionId)) { AppObjectShimServerPolicy sandbox = AppObjectShimServerPolicy.cloneInShimServerPolicy(origin.getAppObject()); this.sandboxes.put(transactionId, sandbox); } return this.sandboxes.get(transactionId); }
AppObjectSandboxProvider implements SandboxProvider, Serializable { @Override public ServerUpcalls getSandbox(ServerPolicyLibrary origin, UUID transactionId) throws Exception { if (!this.sandboxes.containsKey(transactionId)) { AppObjectShimServerPolicy sandbox = AppObjectShimServerPolicy.cloneInShimServerPolicy(origin.getAppObject()); this.sandboxes.put(transactionId, sandbox); } return this.sandboxes.get(transactionId); } }
AppObjectSandboxProvider implements SandboxProvider, Serializable { @Override public ServerUpcalls getSandbox(ServerPolicyLibrary origin, UUID transactionId) throws Exception { if (!this.sandboxes.containsKey(transactionId)) { AppObjectShimServerPolicy sandbox = AppObjectShimServerPolicy.cloneInShimServerPolicy(origin.getAppObject()); this.sandboxes.put(transactionId, sandbox); } return this.sandboxes.get(transactionId); }  }
AppObjectSandboxProvider implements SandboxProvider, Serializable { @Override public ServerUpcalls getSandbox(ServerPolicyLibrary origin, UUID transactionId) throws Exception { if (!this.sandboxes.containsKey(transactionId)) { AppObjectShimServerPolicy sandbox = AppObjectShimServerPolicy.cloneInShimServerPolicy(origin.getAppObject()); this.sandboxes.put(transactionId, sandbox); } return this.sandboxes.get(transactionId); }  @Override ServerUpcalls getSandbox(ServerPolicyLibrary origin, UUID transactionId); @Override ServerUpcalls getSandbox(UUID transactionId); @Override void removeSandbox(UUID transactionId); }
AppObjectSandboxProvider implements SandboxProvider, Serializable { @Override public ServerUpcalls getSandbox(ServerPolicyLibrary origin, UUID transactionId) throws Exception { if (!this.sandboxes.containsKey(transactionId)) { AppObjectShimServerPolicy sandbox = AppObjectShimServerPolicy.cloneInShimServerPolicy(origin.getAppObject()); this.sandboxes.put(transactionId, sandbox); } return this.sandboxes.get(transactionId); }  @Override ServerUpcalls getSandbox(ServerPolicyLibrary origin, UUID transactionId); @Override ServerUpcalls getSandbox(UUID transactionId); @Override void removeSandbox(UUID transactionId);  }