<commit_before>package org.cache2k.event;

/*
 * #%L
 * cache2k API
 * %%
 * Copyright (C) 2000 - 2019 headissue GmbH, Munich
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

import org.cache2k.Cache;
import org.cache2k.CacheEntry;

/**
 * A new entry is inserted into the cache, e.g. by {@link Cache#put(Object, Object)} or by
 * read through and the {@link org.cache2k.integration.CacheLoader}.
 *
 * @author <NAME>
 */
public interface CacheEntryCreatedListener<K, V> extends CacheEntryOperationListener<K, V> {

  /**
   * Called after a creation of a cache entry and after all cache writers ran successfully.
   *
   * <p>Exceptions thrown by asynchronous listeners will be propagated to the cache client
   * directly.
   *
   * @param cache Reference to the cache that generated the event.
   * @param entry Entry containing the current data. It is only valid to access the object during the
   *                     call of this method. The object value may become invalid afterwards.
   */
  void onEntryCreated(Cache<K,V> cache, CacheEntry<K,V> entry);

}<commit_msg>improve documentation<commit_after>package org.cache2k.event;

/*
 * #%L
 * cache2k API
 * %%
 * Copyright (C) 2000 - 2019 headissue GmbH, Munich
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

import org.cache2k.Cache;
import org.cache2k.CacheEntry;

/**
 * A new entry is inserted into the cache, e.g. by {@link Cache#put(Object, Object)} or by
 * read through and the {@link org.cache2k.integration.CacheLoader}.
 *
 * @author <NAME>
 */
public interface CacheEntryCreatedListener<K, V> extends CacheEntryOperationListener<K, V> {

  /**
   * Called for the creation of a cache entry and after all cache writers ran successfully.
   * A synchronous event is executed before the entry becomes visible for cache clients.
   * If an inserted or loaded value expires immediately, no created event is sent.
   *
   * <p>Exceptions thrown by asynchronous listeners will be propagated to the cache client
   * directly.
   *
   * @param cache Reference to the cache that generated the event.
   * @param entry Entry containing the current data. It is only valid to access the object during the
   *                     call of this method. The object value may become invalid afterwards.
   */
  void onEntryCreated(Cache<K,V> cache, CacheEntry<K,V> entry);

}
{'fraction_non_alphanumeric': 0.08353010625737899, 'fraction_numerical': 0.010035419126328217, 'mean_word_length': 3.4946949602122017, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4443645', 'n_tokens_mistral': 945, 'n_tokens_neox': 893, 'n_words': 419}