@Test public void testAfterPropertiesSet() throws Exception { try { factory.setRepository(null); factory.afterPropertiesSet(); fail("expected exception (session factory badly initialized"); } catch (IllegalArgumentException e) { } }
@Override public void afterPropertiesSet() throws Exception { Assert.notNull(getRepository(), "repository is required"); if (eventListeners != null && eventListeners.length > 0 && !JcrUtils.supportsObservation(getRepository())) throw new IllegalArgumentException("repository " + getRepositoryInfo() + " does NOT support Observation; remove Listener definitions"); registerNamespaces(); registerNodeTypes(); if (sessionHolderProviderManager == null) { if (LOG.isDebugEnabled()) LOG.debug("no session holder provider manager set; using the default one"); sessionHolderProvider = new GenericSessionHolderProvider(); } else sessionHolderProvider = sessionHolderProviderManager.getSessionProvider(getRepository()); }
JcrSessionFactory implements InitializingBean, DisposableBean, SessionFactory { @Override public void afterPropertiesSet() throws Exception { Assert.notNull(getRepository(), "repository is required"); if (eventListeners != null && eventListeners.length > 0 && !JcrUtils.supportsObservation(getRepository())) throw new IllegalArgumentException("repository " + getRepositoryInfo() + " does NOT support Observation; remove Listener definitions"); registerNamespaces(); registerNodeTypes(); if (sessionHolderProviderManager == null) { if (LOG.isDebugEnabled()) LOG.debug("no session holder provider manager set; using the default one"); sessionHolderProvider = new GenericSessionHolderProvider(); } else sessionHolderProvider = sessionHolderProviderManager.getSessionProvider(getRepository()); } }
JcrSessionFactory implements InitializingBean, DisposableBean, SessionFactory { @Override public void afterPropertiesSet() throws Exception { Assert.notNull(getRepository(), "repository is required"); if (eventListeners != null && eventListeners.length > 0 && !JcrUtils.supportsObservation(getRepository())) throw new IllegalArgumentException("repository " + getRepositoryInfo() + " does NOT support Observation; remove Listener definitions"); registerNamespaces(); registerNodeTypes(); if (sessionHolderProviderManager == null) { if (LOG.isDebugEnabled()) LOG.debug("no session holder provider manager set; using the default one"); sessionHolderProvider = new GenericSessionHolderProvider(); } else sessionHolderProvider = sessionHolderProviderManager.getSessionProvider(getRepository()); } JcrSessionFactory(Repository repository, String workspaceName, Credentials credentials);  JcrSessionFactory(Repository repository, String workspaceName, Credentials credentials, SessionHolderProviderManager sessionHolderProviderManager);  JcrSessionFactory(); }
JcrSessionFactory implements InitializingBean, DisposableBean, SessionFactory { @Override public void afterPropertiesSet() throws Exception { Assert.notNull(getRepository(), "repository is required"); if (eventListeners != null && eventListeners.length > 0 && !JcrUtils.supportsObservation(getRepository())) throw new IllegalArgumentException("repository " + getRepositoryInfo() + " does NOT support Observation; remove Listener definitions"); registerNamespaces(); registerNodeTypes(); if (sessionHolderProviderManager == null) { if (LOG.isDebugEnabled()) LOG.debug("no session holder provider manager set; using the default one"); sessionHolderProvider = new GenericSessionHolderProvider(); } else sessionHolderProvider = sessionHolderProviderManager.getSessionProvider(getRepository()); } JcrSessionFactory(Repository repository, String workspaceName, Credentials credentials);  JcrSessionFactory(Repository repository, String workspaceName, Credentials credentials, SessionHolderProviderManager sessionHolderProviderManager);  JcrSessionFactory(); @Override void afterPropertiesSet(); @Override void destroy(); @Override Session getSession(); @Override SessionHolder getSessionHolder(Session session); Repository getRepository(); void setRepository(Repository repository); void setWorkspaceName(String workspaceName); void setCredentials(Credentials credentials); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); EventListenerDefinition[] getEventListeners(); void setEventListeners(EventListenerDefinition[] eventListenerDefinitions); Properties getNamespaces(); void setNamespaces(Properties namespaces); SessionHolderProviderManager getSessionHolderProviderManager(); void setSessionHolderProviderManager(SessionHolderProviderManager sessionHolderProviderManager); void setKeepNewNamespaces(boolean keepNamespaces); void setForceNamespacesRegistration(boolean forceNamespacesRegistration); void setSkipExistingNamespaces(boolean skipRegisteredNamespace); boolean isForceNamespacesRegistration(); boolean isKeepNewNamespaces(); boolean isSkipExistingNamespaces(); Credentials getCredentials(); String getWorkspaceName(); }
JcrSessionFactory implements InitializingBean, DisposableBean, SessionFactory { @Override public void afterPropertiesSet() throws Exception { Assert.notNull(getRepository(), "repository is required"); if (eventListeners != null && eventListeners.length > 0 && !JcrUtils.supportsObservation(getRepository())) throw new IllegalArgumentException("repository " + getRepositoryInfo() + " does NOT support Observation; remove Listener definitions"); registerNamespaces(); registerNodeTypes(); if (sessionHolderProviderManager == null) { if (LOG.isDebugEnabled()) LOG.debug("no session holder provider manager set; using the default one"); sessionHolderProvider = new GenericSessionHolderProvider(); } else sessionHolderProvider = sessionHolderProviderManager.getSessionProvider(getRepository()); } JcrSessionFactory(Repository repository, String workspaceName, Credentials credentials);  JcrSessionFactory(Repository repository, String workspaceName, Credentials credentials, SessionHolderProviderManager sessionHolderProviderManager);  JcrSessionFactory(); @Override void afterPropertiesSet(); @Override void destroy(); @Override Session getSession(); @Override SessionHolder getSessionHolder(Session session); Repository getRepository(); void setRepository(Repository repository); void setWorkspaceName(String workspaceName); void setCredentials(Credentials credentials); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); EventListenerDefinition[] getEventListeners(); void setEventListeners(EventListenerDefinition[] eventListenerDefinitions); Properties getNamespaces(); void setNamespaces(Properties namespaces); SessionHolderProviderManager getSessionHolderProviderManager(); void setSessionHolderProviderManager(SessionHolderProviderManager sessionHolderProviderManager); void setKeepNewNamespaces(boolean keepNamespaces); void setForceNamespacesRegistration(boolean forceNamespacesRegistration); void setSkipExistingNamespaces(boolean skipRegisteredNamespace); boolean isForceNamespacesRegistration(); boolean isKeepNewNamespaces(); boolean isSkipExistingNamespaces(); Credentials getCredentials(); String getWorkspaceName();  }