private void checkIsBuilt() { if (!isBuilt()) { throw new IllegalStateException("BeanIdentifier index not built!"); } }
private void checkIsBuilt() { if (!isBuilt()) { throw new IllegalStateException("BeanIdentifier index not built!"); } }
private void checkIsBuilt() { if (!isBuilt()) { throw new IllegalStateException("BeanIdentifier index not built!"); } }
private void checkIsBuilt() { if (!isBuilt()) { throw new IllegalStateException("BeanIdentifier index not built!"); } }
private void checkIsBuilt() { if (!isBuilt()) { throw new IllegalStateException("BeanIdentifier index not built!"); } }
private void checkIsBuilt() { if (!isBuilt()) { throw new IllegalStateException("BeanIdentifier index not built!"); } }
private void checkBeanIdentifierIndexConsistency(HttpServletRequest request) { HttpSession session = request.getSession(false); if (session != null) { BeanIdentifierIndex index = getServiceRegistry().get(BeanIdentifierIndex.class); if (index != null && index.isBuilt()) { Object hash = session.getAttribute(KEY_BEAN_ID_INDEX_HASH); if (hash != null) { if (!index.getIndexHash().equals(hash)) { throw ContextLogger.LOG.beanIdentifierIndexInconsistencyDetected(hash.toString(), index.getDebugInfo()); } } else { session.setAttribute(KEY_BEAN_ID_INDEX_HASH, index.getIndexHash()); } } } }
private void checkBeanIdentifierIndexConsistency(HttpServletRequest request) { HttpSession session = request.getSession(false); if (session != null) { BeanIdentifierIndex index = getServiceRegistry().get(BeanIdentifierIndex.class); if (index != null && index.isBuilt()) { Object hash = session.getAttribute(KEY_BEAN_ID_INDEX_HASH); if (hash != null) { if (!index.getIndexHash().equals(hash)) { throw ContextLogger.LOG.beanIdentifierIndexInconsistencyDetected(hash.toString(), index.getDebugInfo()); } } else { session.setAttribute(KEY_BEAN_ID_INDEX_HASH, index.getIndexHash()); } } } }
private void checkBeanIdentifierIndexConsistency(HttpServletRequest request) { HttpSession session = request.getSession(false); if (session != null) { BeanIdentifierIndex index = getServiceRegistry().get(BeanIdentifierIndex.class); if (index != null && index.isBuilt()) { Object hash = session.getAttribute(KEY_BEAN_ID_INDEX_HASH); if (hash != null) { if (!index.getIndexHash().equals(hash)) { throw ContextLogger.LOG.beanIdentifierIndexInconsistencyDetected(hash.toString(), index.getDebugInfo()); } } else { session.setAttribute(KEY_BEAN_ID_INDEX_HASH, index.getIndexHash()); } } } }
private void checkBeanIdentifierIndexConsistency(Map<String, Object> storage) { BeanIdentifierIndex index = getServiceRegistry().get(BeanIdentifierIndex.class); if (index != null && index.isBuilt()) { Object hash = storage.get(KEY_BEAN_ID_INDEX_HASH); if (hash != null) { if (!index.getIndexHash().equals(hash)) { throw ContextLogger.LOG.beanIdentifierIndexInconsistencyDetected(hash.toString(), index.getDebugInfo()); } } else { storage.put(KEY_BEAN_ID_INDEX_HASH, index.getIndexHash()); } } } }
private void checkBeanIdentifierIndexConsistency(HttpServletRequest request) { HttpSession session = request.getSession(false); if (session != null) { BeanIdentifierIndex index = getServiceRegistry().get(BeanIdentifierIndex.class); if (index != null && index.isBuilt()) { Object hash = session.getAttribute(KEY_BEAN_ID_INDEX_HASH); if (hash != null) { if (!index.getIndexHash().equals(hash)) { throw ContextLogger.LOG.beanIdentifierIndexInconsistencyDetected(hash.toString(), index.getDebugInfo()); } } else { session.setAttribute(KEY_BEAN_ID_INDEX_HASH, index.getIndexHash()); } } } }
private void checkBeanIdentifierIndexConsistency(Map<String, Object> storage) { BeanIdentifierIndex index = getServiceRegistry().get(BeanIdentifierIndex.class); if (index != null && index.isBuilt()) { Object hash = storage.get(KEY_BEAN_ID_INDEX_HASH); if (hash != null) { if (!index.getIndexHash().equals(hash)) { throw ContextLogger.LOG.beanIdentifierIndexInconsistencyDetected(hash.toString(), index.getDebugInfo()); } } else { storage.put(KEY_BEAN_ID_INDEX_HASH, index.getIndexHash()); } } } }
private void checkBeanIdentifierIndexConsistency(Map<String, Object> storage) { BeanIdentifierIndex index = getServiceRegistry().get(BeanIdentifierIndex.class); if (index != null && index.isBuilt()) { Object hash = storage.get(KEY_BEAN_ID_INDEX_HASH); if (hash != null) { if (!index.getIndexHash().equals(hash)) { throw ContextLogger.LOG.beanIdentifierIndexInconsistencyDetected(hash.toString(), index.getDebugInfo()); } } else { storage.put(KEY_BEAN_ID_INDEX_HASH, index.getIndexHash()); } } } }
private void checkBeanIdentifierIndexConsistency(Map<String, Object> storage) { BeanIdentifierIndex index = getServiceRegistry().get(BeanIdentifierIndex.class); if (index != null && index.isBuilt()) { Object hash = storage.get(KEY_BEAN_ID_INDEX_HASH); if (hash != null) { if (!index.getIndexHash().equals(hash)) { throw ContextLogger.LOG.beanIdentifierIndexInconsistencyDetected(hash.toString(), index.getDebugInfo()); } } else { storage.put(KEY_BEAN_ID_INDEX_HASH, index.getIndexHash()); } } } }
private void checkBeanIdentifierIndexConsistency(Map<String, Object> storage) { BeanIdentifierIndex index = getServiceRegistry().get(BeanIdentifierIndex.class); if (index != null && index.isBuilt()) { Object hash = storage.get(KEY_BEAN_ID_INDEX_HASH); if (hash != null) { if (!index.getIndexHash().equals(hash)) { throw ContextLogger.LOG.beanIdentifierIndexInconsistencyDetected(hash.toString(), index.getDebugInfo()); } } else { storage.put(KEY_BEAN_ID_INDEX_HASH, index.getIndexHash()); } } } }
private void checkBeanIdentifierIndexConsistency(Map<String, Object> storage) { BeanIdentifierIndex index = getServiceRegistry().get(BeanIdentifierIndex.class); if (index != null && index.isBuilt()) { Object hash = storage.get(KEY_BEAN_ID_INDEX_HASH); if (hash != null) { if (!index.getIndexHash().equals(hash)) { throw ContextLogger.LOG.beanIdentifierIndexInconsistencyDetected(hash.toString(), index.getDebugInfo()); } } else { storage.put(KEY_BEAN_ID_INDEX_HASH, index.getIndexHash()); } } } }
SerializableContextualHolder(String contextId, C contextual, ContextualStore contextualStore, BeanIdentifierIndex beanIdentifierIndex) { this.contextId = contextId; this.cachedContextualStore = contextualStore; if (contextual instanceof Serializable) { // the contextual is serializable, so we can just use it this.serializable = contextual; this.identifier = null; this.identifierIndex = null; } else { this.serializable = null; BeanIdentifier beanIdentifier = getId(contextual, contextualStore); // The index may be null or not built yet Integer idx = null; if (beanIdentifierIndex != null && beanIdentifierIndex.isBuilt()) { idx = beanIdentifierIndex.getIndex(beanIdentifier); } if (idx != null) { this.identifierIndex = idx; this.identifier = null; } else { this.identifierIndex = null; this.identifier = beanIdentifier; } } // cache the contextual this.cached = contextual; }
SerializableContextualHolder(String contextId, C contextual, ContextualStore contextualStore, BeanIdentifierIndex beanIdentifierIndex) { this.contextId = contextId; this.cachedContextualStore = contextualStore; if (contextual instanceof Serializable) { // the contextual is serializable, so we can just use it this.serializable = contextual; this.identifier = null; this.identifierIndex = null; } else { this.serializable = null; BeanIdentifier beanIdentifier = getId(contextual, contextualStore); // The index may be null or not built yet Integer idx = null; if (beanIdentifierIndex != null && beanIdentifierIndex.isBuilt()) { idx = beanIdentifierIndex.getIndex(beanIdentifier); } if (idx != null) { this.identifierIndex = idx; this.identifier = null; } else { this.identifierIndex = null; this.identifier = beanIdentifier; } } // cache the contextual this.cached = contextual; }
SerializableContextualHolder(String contextId, C contextual, ContextualStore contextualStore, BeanIdentifierIndex beanIdentifierIndex) { this.contextId = contextId; this.cachedContextualStore = contextualStore; if (contextual instanceof Serializable) { // the contextual is serializable, so we can just use it this.serializable = contextual; this.identifier = null; this.identifierIndex = null; } else { this.serializable = null; BeanIdentifier beanIdentifier = getId(contextual, contextualStore); // The index may be null or not built yet Integer idx = null; if (beanIdentifierIndex != null && beanIdentifierIndex.isBuilt()) { idx = beanIdentifierIndex.getIndex(beanIdentifier); } if (idx != null) { this.identifierIndex = idx; this.identifier = null; } else { this.identifierIndex = null; this.identifier = beanIdentifier; } } // cache the contextual this.cached = contextual; }
SerializableContextualHolder(String contextId, C contextual, ContextualStore contextualStore, BeanIdentifierIndex beanIdentifierIndex) { this.contextId = contextId; this.cachedContextualStore = contextualStore; if (contextual instanceof Serializable) { // the contextual is serializable, so we can just use it this.serializable = contextual; this.identifier = null; this.identifierIndex = null; } else { this.serializable = null; BeanIdentifier beanIdentifier = getId(contextual, contextualStore); // The index may be null or not built yet Integer idx = null; if (beanIdentifierIndex != null && beanIdentifierIndex.isBuilt()) { idx = beanIdentifierIndex.getIndex(beanIdentifier); } if (idx != null) { this.identifierIndex = idx; this.identifier = null; } else { this.identifierIndex = null; this.identifier = beanIdentifier; } } // cache the contextual this.cached = contextual; }