Example usage for org.apache.commons.collections.map LRUMap LRUMap

List of usage examples for org.apache.commons.collections.map LRUMap LRUMap

Introduction

In this page you can find the example usage for org.apache.commons.collections.map LRUMap LRUMap.

Prototype

public LRUMap() 

Source Link

Document

Constructs a new empty map with a maximum size of 100.

Usage

From source file:com.zatarox.chess.skychess.tables.TranspositionTable.java

private TranspositionTable() {
    super(new LRUMap());
}

From source file:org.apache.hawq.pxf.service.AggBridge.java

@Override
public boolean beginIteration() throws Exception {
    /* Initialize LRU cache with 100 items*/
    outputCache = new LRUMap();
    boolean openForReadStatus = super.fileAccessor.openForRead();
    ((StatsAccessor) fileAccessor).retrieveStats();
    return openForReadStatus;
}

From source file:org.apache.jackrabbit.core.security.principal.DefaultPrincipalProvider.java

/**
 * Creates a new DefaultPrincipalProvider reading the principals from the
 * storage below the given security root node.
 *
 * @param securitySession for Repository Access
 * @throws RepositoryException if an error accessing the repository occurs.
 *//*from   w ww.  j  a  v a 2s .  c o  m*/
public DefaultPrincipalProvider(Session securitySession, UserManagerImpl userManager)
        throws RepositoryException {

    this.userManager = userManager;
    everyonePrincipal = EveryonePrincipal.getInstance();
    membershipCache = new LRUMap();

    // listen to modifications of group-membership
    String[] ntNames = new String[1];
    if (securitySession instanceof SessionImpl) {
        NameResolver resolver = (SessionImpl) securitySession;
        ntNames[0] = resolver.getJCRName(UserManagerImpl.NT_REP_USER);
        pGroupName = resolver.getJCRName(UserManagerImpl.P_GROUPS);
    } else {
        ntNames[0] = "rep:User";
        pGroupName = "rep:groups";
    }
    securitySession.getWorkspace().getObservationManager().addEventListener(this,
            Event.NODE_REMOVED | Event.PROPERTY_ADDED | Event.PROPERTY_CHANGED | Event.PROPERTY_REMOVED,
            UserManagerImpl.SECURITY_ROOT_PATH, true, null, ntNames, false);
}

From source file:org.apache.jackrabbit.core.security.principal.DefaultPrincipalProvider.java

/**
 * Creates a new DefaultPrincipalProvider reading the principals from the
 * storage below the given security root node.
 *
 * @param securitySession for Repository Access
 * @throws RepositoryException if an error accessing the repository occurs.
 *///w  ww.  java2  s .  co m
public DefaultPrincipalProvider(Session securitySession, UserManagerImpl userManager)
        throws RepositoryException {

    this.userManager = userManager;
    everyonePrincipal = EveryonePrincipal.getInstance();
    membershipCache = new LRUMap();

    // listen to any modifications for users and groups
    securitySession.getWorkspace().getObservationManager()
            .addEventListener(this,
                    Event.NODE_ADDED | Event.NODE_REMOVED | Event.PROPERTY_ADDED | Event.PROPERTY_CHANGED
                            | Event.PROPERTY_REMOVED,
                    UserManagerImpl.SECURITY_ROOT_PATH, true, null, null, false);
}

From source file:org.mule.transformer.graph.GraphTransformerResolver.java

public GraphTransformerResolver() {
    this.readWriteLock = new ReentrantReadWriteLock();
    this.graph = new TransformationGraph();
    lookupStrategyTransformation = new TransformationGraphLookupStrategy(graph);
    converterFilter = new CompositeConverterFilter(new TransformationLengthConverterFilter(),
            new PriorityWeightingConverterFilter(), new NameConverterFilter());
    cache = new LRUMap();
}

From source file:org.opencms.util.CmsCollectionsGenericWrapper.java

/**
 * Provides a wrapper to create a {@link LRUMap} that avoids warnings with Java 1.5 generic code.<p> 
 * //  w w  w .  j av  a2 s. com
 * @param <K> the type of keys maintained by the returned map
 * @param <V> the type of mapped values
 * 
 * @return a {@link LRUMap} of the required generic type
 */
@SuppressWarnings("unchecked")
public static <K, V> Map<K, V> createLRUMap() {

    return new LRUMap();
}

From source file:org.paxle.filter.webgraph.gui.PrefuseServletTest.java

@SuppressWarnings("serial")
@Override/*w w w.  j a va 2 s . c  om*/
protected void setUp() throws Exception {
    super.setUp();

    // creating dummy data
    dataMap = new LRUMap();
    dataMap.put("navi.paxle.net", new HashSet<String>(Arrays.asList(new String[] { "www2.paxle.net",
            "svn.paxle.net", "wiki.paxle.net", "forum.paxle.info", "paste.paxle.de", "bugs.pxl.li" })));
    dataMap.put("wiki.paxle.net",
            new HashSet<String>(Arrays.asList(new String[] { "svn.paxle.net", "forum.paxle.info" })));
    dataMap.put("bugs.pxl.li", new HashSet<String>(Arrays.asList(new String[] { "paxle.net" })));

    // creating test dir
    this.testDir = new File(TESTDIR_NAME);
    this.testDir.mkdir();

    // creating a dummy response
    resp = mock(HttpServletResponse.class);
    req = mock(HttpServletRequest.class);

    // creating servlet
    servlet = new PrefuseServlet() {
        @Override
        protected LRUMap getRelations() {
            return dataMap;
        }
    };
}