public void Dispose() { CheckSession(); lock (bindingLock) { GetSpi().Dispose(); session = null; } }
public CmisBinding(IDictionary <string, string> sessionParameters, IAuthenticationProvider authenticationProvider) { if (sessionParameters == null) { throw new ArgumentNullException(nameof(sessionParameters)); } if (!sessionParameters.ContainsKey(SessionParameter.BindingSpiClass)) { throw new ArgumentException("Session parameters do not contain a SPI class name!"); } // initialize session session = new BindingSession(); foreach (KeyValuePair <string, string> kv in sessionParameters) { session.PutValue(kv.Key, kv.Value); } // set up authentication provider if (authenticationProvider == null) { string authenticationProviderClass; if (sessionParameters.TryGetValue(SessionParameter.AuthenticationProviderClass, out authenticationProviderClass)) { try { Type authProvType = Type.GetType(authenticationProviderClass); authenticationProvider = (IAuthenticationProvider)Activator.CreateInstance(authProvType); authenticationProvider.Session = session; session.PutValue(BindingSession.AuthenticationProvider, authenticationProvider); } catch (Exception e) { throw new CmisRuntimeException("Could not load authentication provider: " + e.Message, e); } } } else { authenticationProvider.Session = session; session.PutValue(BindingSession.AuthenticationProvider, authenticationProvider); } // initialize the SPI GetSpi(); // set up caches ClearAllCaches(); // set up repository service repositoryServiceWrapper = new BindingRepositoryService(session); }
public BindingRepositoryService(BindingSession session) { this.session = session; }