1 /*******************************************************************************
2 * Copyright (c) 2010, 2014 Sonatype, Inc.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * Sonatype, Inc. - initial API and implementation
10 *******************************************************************************/
11 package org
.eclipse
.aether
;
14 import java
.util
.concurrent
.ConcurrentHashMap
;
17 * A simplistic repository cache backed by a thread-safe map. The simplistic nature of this cache makes it only suitable
18 * for use with short-lived repository system sessions where pruning of cache data is not required.
20 public final class DefaultRepositoryCache
21 implements RepositoryCache
24 private final Map
<Object
, Object
> cache
= new ConcurrentHashMap
<Object
, Object
>( 256 );
26 public Object
get( RepositorySystemSession session
, Object key
)
28 return cache
.get( key
);
31 public void put( RepositorySystemSession session
, Object key
, Object data
)
35 cache
.put( key
, data
);