protected void delay(BindingSession session) { session.writeLock(); try { int delayTime = session.get(DELAY_TIME, -1); if (delayTime < 0) { if (LOG.isInfoEnabled()) { LOG.info("No delay time configured."); } return; } Object lastExcution = session.get(LAST_EXECUTION); if (lastExcution instanceof Long) { long lastExcutionLong = (Long) lastExcution; long now = System.currentTimeMillis(); if (now - lastExcutionLong < delayTime) { try { Thread.sleep(delayTime - (now - lastExcutionLong)); } catch (InterruptedException e) { if (LOG.isDebugEnabled()) { LOG.debug("Interrupted sleep", e); } } } } session.put(LAST_EXECUTION, System.currentTimeMillis()); } finally { session.writeUnlock(); } }
protected void delay(BindingSession session) { session.writeLock(); try { int delayTime = session.get(DELAY_TIME, -1); if (delayTime < 0) { if (LOG.isInfoEnabled()) { LOG.info("No delay time configured."); } return; } Object lastExcution = session.get(LAST_EXECUTION); if (lastExcution instanceof Long) { long lastExcutionLong = (Long) lastExcution; long now = System.currentTimeMillis(); if (now - lastExcutionLong < delayTime) { try { Thread.sleep(delayTime - (now - lastExcutionLong)); } catch (InterruptedException e) { if (LOG.isDebugEnabled()) { LOG.debug("Interrupted sleep", e); } } } } session.put(LAST_EXECUTION, System.currentTimeMillis()); } finally { session.writeUnlock(); } }
session.put(entry.getKey(), entry.getValue()); session.put(CmisBindingsHelper.ACCEPT_LANGUAGE, acceptLanguage); if (forceCmisVersion != null) { try { session.put(CmisBindingsHelper.FORCE_CMIS_VERSION, CmisVersion.fromValue(forceCmisVersion)); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("Invalid CMIS version value: " + forceCmisVersion, e); session.put(CmisBindingsHelper.TYPE_DEFINTION_CACHE, typeDefCache); typeDefCache.initialize(session); session.put(CmisBindingsHelper.AUTHENTICATION_PROVIDER_OBJECT, authenticationProvider); if (authenticationProvider instanceof SessionAwareAuthenticationProvider) { ((SessionAwareAuthenticationProvider) authenticationProvider).setSession(session);
session.put(entry.getKey(), entry.getValue()); session.put(CmisBindingsHelper.ACCEPT_LANGUAGE, acceptLanguage); if (forceCmisVersion != null) { try { session.put(CmisBindingsHelper.FORCE_CMIS_VERSION, CmisVersion.fromValue(forceCmisVersion)); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("Invalid CMIS version value: " + forceCmisVersion, e); session.put(CmisBindingsHelper.TYPE_DEFINTION_CACHE, typeDefCache); typeDefCache.initialize(session); session.put(CmisBindingsHelper.AUTHENTICATION_PROVIDER_OBJECT, authenticationProvider); if (authenticationProvider instanceof SessionAwareAuthenticationProvider) { ((SessionAwareAuthenticationProvider) authenticationProvider).setSession(session);
/** * Returns the repository URL cache or creates a new cache if it doesn't * exist. */ protected RepositoryUrlCache getRepositoryUrlCache() { RepositoryUrlCache repositoryUrlCache = (RepositoryUrlCache) getSession().get( SpiSessionParameter.REPOSITORY_URL_CACHE); if (repositoryUrlCache == null) { repositoryUrlCache = new RepositoryUrlCache(); getSession().put(SpiSessionParameter.REPOSITORY_URL_CACHE, repositoryUrlCache); } return repositoryUrlCache; }
/** * Returns the repository URL cache or creates a new cache if it doesn't * exist. */ protected RepositoryUrlCache getRepositoryUrlCache() { RepositoryUrlCache repositoryUrlCache = (RepositoryUrlCache) getSession().get( SpiSessionParameter.REPOSITORY_URL_CACHE); if (repositoryUrlCache == null) { repositoryUrlCache = new RepositoryUrlCache(); getSession().put(SpiSessionParameter.REPOSITORY_URL_CACHE, repositoryUrlCache); } return repositoryUrlCache; }
/** * Returns the link cache or creates a new cache if it doesn't exist. */ protected LinkCache getLinkCache() { LinkCache linkCache = (LinkCache) getSession().get(SpiSessionParameter.LINK_CACHE); if (linkCache == null) { linkCache = new LinkCache(getSession()); getSession().put(SpiSessionParameter.LINK_CACHE, linkCache); } return linkCache; }
/** * Returns the link cache or creates a new cache if it doesn't exist. */ protected LinkCache getLinkCache() { LinkCache linkCache = (LinkCache) getSession().get(SpiSessionParameter.LINK_CACHE); if (linkCache == null) { linkCache = new LinkCache(getSession()); getSession().put(SpiSessionParameter.LINK_CACHE, linkCache); } return linkCache; }
if (httpclient == null) { httpclient = createClientBuilder(session).build(); session.put(HTTP_CLIENT, httpclient, true);
session.put(SPI_OBJECT, spi, true); } finally { session.writeUnlock();
session.put(SPI_OBJECT, spi, true); } finally { session.writeUnlock();
session.put(HTTP_INVOKER_OBJECT, invoker, true); } finally { session.writeUnlock();
if (serviceMap == null) { serviceMap = new EnumMap<CmisWebSerivcesService, CmisServiceHolder>(CmisWebSerivcesService.class); session.put(SpiSessionParameter.SERVICES, serviceMap, true);
session.put(HTTP_INVOKER_OBJECT, invoker, true); } finally { session.writeUnlock();
session.put(DELEGTAE_HTTP_INVOKER, invoker, true); } finally { session.writeUnlock();
session.put(DELEGTAE_HTTP_INVOKER, invoker, true); } finally { session.writeUnlock();
session.put(TYPE_DEFINTION_CACHE, cache); } finally { session.writeUnlock();
session.put(TYPE_DEFINTION_CACHE, cache); } finally { session.writeUnlock();
@Override public void clearAllCaches() { checkSession(); session.writeLock(); try { session.put(CmisBindingsHelper.REPOSITORY_INFO_CACHE, new RepositoryInfoCache(session)); TypeDefinitionCache typeDefCache = CmisBindingsHelper.getTypeDefinitionCache(session); typeDefCache.removeAll(); CmisSpi spi = CmisBindingsHelper.getSPI(session); spi.clearAllCaches(); } finally { session.writeUnlock(); } }
@Override public void clearAllCaches() { checkSession(); session.writeLock(); try { session.put(CmisBindingsHelper.REPOSITORY_INFO_CACHE, new RepositoryInfoCache(session)); TypeDefinitionCache typeDefCache = CmisBindingsHelper.getTypeDefinitionCache(session); typeDefCache.removeAll(); CmisSpi spi = CmisBindingsHelper.getSPI(session); spi.clearAllCaches(); } finally { session.writeUnlock(); } }