@Test public void testGetReadWriteContext_DirContext() { when(contextSourceMock.getReadWriteContext()).thenReturn(dirContextMock); DirContext result = tested.getReadWriteContext(); assertThat(result).as("Result should not be null").isNotNull(); assertThat(result instanceof DirContext).isTrue(); assertThat(result instanceof LdapContext).isFalse(); assertThat(result instanceof DirContextProxy).isTrue(); }
@Override public DirContext getReadWriteContext() { DirContextHolder contextHolder = (DirContextHolder) TransactionSynchronizationManager .getResource(target); DirContext ctx = null; if (contextHolder != null) { ctx = contextHolder.getCtx(); } if (ctx == null) { ctx = target.getReadWriteContext(); if (contextHolder != null) { contextHolder.setCtx(ctx); } } return getTransactionAwareDirContextProxy(ctx, target); }
TransactionAwareContextSourceProxy extends DelegatingBaseLdapPathContextSourceSupport implements ContextSource { @Override public DirContext getReadWriteContext() { DirContextHolder contextHolder = (DirContextHolder) TransactionSynchronizationManager .getResource(target); DirContext ctx = null; if (contextHolder != null) { ctx = contextHolder.getCtx(); } if (ctx == null) { ctx = target.getReadWriteContext(); if (contextHolder != null) { contextHolder.setCtx(ctx); } } return getTransactionAwareDirContextProxy(ctx, target); } }
TransactionAwareContextSourceProxy extends DelegatingBaseLdapPathContextSourceSupport implements ContextSource { @Override public DirContext getReadWriteContext() { DirContextHolder contextHolder = (DirContextHolder) TransactionSynchronizationManager .getResource(target); DirContext ctx = null; if (contextHolder != null) { ctx = contextHolder.getCtx(); } if (ctx == null) { ctx = target.getReadWriteContext(); if (contextHolder != null) { contextHolder.setCtx(ctx); } } return getTransactionAwareDirContextProxy(ctx, target); } TransactionAwareContextSourceProxy(ContextSource target); }
TransactionAwareContextSourceProxy extends DelegatingBaseLdapPathContextSourceSupport implements ContextSource { @Override public DirContext getReadWriteContext() { DirContextHolder contextHolder = (DirContextHolder) TransactionSynchronizationManager .getResource(target); DirContext ctx = null; if (contextHolder != null) { ctx = contextHolder.getCtx(); } if (ctx == null) { ctx = target.getReadWriteContext(); if (contextHolder != null) { contextHolder.setCtx(ctx); } } return getTransactionAwareDirContextProxy(ctx, target); } TransactionAwareContextSourceProxy(ContextSource target); @Override ContextSource getTarget(); @Override DirContext getReadOnlyContext(); @Override DirContext getReadWriteContext(); @Override DirContext getContext(String principal, String credentials); }
TransactionAwareContextSourceProxy extends DelegatingBaseLdapPathContextSourceSupport implements ContextSource { @Override public DirContext getReadWriteContext() { DirContextHolder contextHolder = (DirContextHolder) TransactionSynchronizationManager .getResource(target); DirContext ctx = null; if (contextHolder != null) { ctx = contextHolder.getCtx(); } if (ctx == null) { ctx = target.getReadWriteContext(); if (contextHolder != null) { contextHolder.setCtx(ctx); } } return getTransactionAwareDirContextProxy(ctx, target); } TransactionAwareContextSourceProxy(ContextSource target); @Override ContextSource getTarget(); @Override DirContext getReadOnlyContext(); @Override DirContext getReadWriteContext(); @Override DirContext getContext(String principal, String credentials);  }