Package org.apache.commons.collections.map

Examples of org.apache.commons.collections.map.ReferenceMap$SoftRef


    public NodeTypeManagerImpl(SessionContext context) {
        this.context = context;

        // setup caches with soft references to node type
        // & item definition instances
        ntCache = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.SOFT);
        pdCache = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.SOFT);
        ndCache = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.SOFT);

        NodeTypeRegistry registry = context.getNodeTypeRegistry();

        rootNodeDef = new NodeDefinitionImpl(
                registry.getRootNodeDef(), this, context);
View Full Code Here


  public StatefulPersistenceContext(SessionImplementor session) {
    this.session = session;

    entitiesByKey = new HashMap( INIT_COLL_SIZE );
    entitiesByUniqueKey = new HashMap( INIT_COLL_SIZE );
    proxiesByKey = new ReferenceMap( AbstractReferenceMap.HARD, AbstractReferenceMap.WEAK );
    entitySnapshotsByKey = new HashMap( INIT_COLL_SIZE );

    entityEntries = IdentityMap.instantiateSequenced( INIT_COLL_SIZE );
    collectionEntries = IdentityMap.instantiateSequenced( INIT_COLL_SIZE );
    collectionsByKey = new HashMap( INIT_COLL_SIZE );
View Full Code Here

        rtn.entitiesByUniqueKey.put( EntityUniqueKey.deserialize( ois, session ), ois.readObject() );
      }

      count = ois.readInt();
      if ( tracing ) LOG.trace("Starting deserialization of [" + count + "] proxiesByKey entries");
      rtn.proxiesByKey = new ReferenceMap( AbstractReferenceMap.HARD, AbstractReferenceMap.WEAK, count < INIT_COLL_SIZE ? INIT_COLL_SIZE : count, .75f );
      for ( int i = 0; i < count; i++ ) {
        EntityKey ek = EntityKey.deserialize( ois, session );
        Object proxy = ois.readObject();
        if ( proxy instanceof HibernateProxy ) {
          ( ( HibernateProxy ) proxy ).getHibernateLazyInitializer().setSession( session );
View Full Code Here

        this.nsReg = nsReg;
        this.ntReg.addListener(this);

        // setup caches with soft references to node type
        // & item definition instances
        ntCache = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.SOFT);
        pdCache = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.SOFT);
        ndCache = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.SOFT);

        rootNodeDef = new NodeDefinitionImpl(ntReg.getRootNodeDef(), this,
                nsResolver);
        ndCache.put(rootNodeDef.unwrap().getId(), rootNodeDef);
    }
View Full Code Here

        this.session = session;
        this.rootNodeDef = rootNodeDef;
        this.rootNodeId = rootNodeId;

        // setup item cache with weak references to items
        itemCache = new ReferenceMap(ReferenceMap.HARD, ReferenceMap.WEAK);
        itemStateProvider.addListener(this);
    }
View Full Code Here

  public StatefulPersistenceContext(SessionImplementor session) {
    this.session = session;

    entitiesByKey = new HashMap( INIT_COLL_SIZE );
    entitiesByUniqueKey = new HashMap( INIT_COLL_SIZE );
    proxiesByKey = new ReferenceMap( ReferenceMap.HARD, ReferenceMap.WEAK );
    entitySnapshotsByKey = new HashMap( INIT_COLL_SIZE );

    entityEntries = IdentityMap.instantiateSequenced( INIT_COLL_SIZE );
    collectionEntries = IdentityMap.instantiateSequenced( INIT_COLL_SIZE );
    collectionsByKey = new HashMap( INIT_COLL_SIZE );
View Full Code Here

        rtn.entitiesByUniqueKey.put( EntityUniqueKey.deserialize( ois, session ), ois.readObject() );
      }

      count = ois.readInt();
      log.trace( "staring deserialization of [" + count + "] proxiesByKey entries" );
      rtn.proxiesByKey = new ReferenceMap( ReferenceMap.HARD, ReferenceMap.WEAK, count < INIT_COLL_SIZE ? INIT_COLL_SIZE : count, .75f );
      for ( int i = 0; i < count; i++ ) {
        EntityKey ek = EntityKey.deserialize( ois, session );
        Object proxy = ois.readObject();
        if ( proxy instanceof HibernateProxy ) {
          ( ( HibernateProxy ) proxy ).getHibernateLazyInitializer().setSession( session );
View Full Code Here

  public StatefulPersistenceContext(SessionImplementor session) {
    this.session = session;

    entitiesByKey = new HashMap( INIT_COLL_SIZE );
    entitiesByUniqueKey = new HashMap( INIT_COLL_SIZE );
    proxiesByKey = new ReferenceMap( ReferenceMap.HARD, ReferenceMap.WEAK );
    entitySnapshotsByKey = new HashMap( INIT_COLL_SIZE );

    entityEntries = IdentityMap.instantiateSequenced( INIT_COLL_SIZE );
    collectionEntries = IdentityMap.instantiateSequenced( INIT_COLL_SIZE );
    collectionsByKey = new HashMap( INIT_COLL_SIZE );
View Full Code Here

        rtn.entitiesByUniqueKey.put( EntityUniqueKey.deserialize( ois, session ), ois.readObject() );
      }

      count = ois.readInt();
      log.trace( "staring deserialization of [" + count + "] proxiesByKey entries" );
      rtn.proxiesByKey = new ReferenceMap( ReferenceMap.HARD, ReferenceMap.WEAK, count < INIT_COLL_SIZE ? INIT_COLL_SIZE : count, .75f );
      for ( int i = 0; i < count; i++ ) {
        EntityKey ek = EntityKey.deserialize( ois, session );
        Object proxy = ois.readObject();
        if ( proxy instanceof HibernateProxy ) {
          ( ( HibernateProxy ) proxy ).getHibernateLazyInitializer().setSession( session );
View Full Code Here

  public StatefulPersistenceContext(SessionImplementor session) {
    this.session = session;

    entitiesByKey = new HashMap( INIT_COLL_SIZE );
    entitiesByUniqueKey = new HashMap( INIT_COLL_SIZE );
    proxiesByKey = new ReferenceMap( ReferenceMap.HARD, ReferenceMap.WEAK );
    entitySnapshotsByKey = new HashMap( INIT_COLL_SIZE );

    entityEntries = IdentityMap.instantiateSequenced( INIT_COLL_SIZE );
    collectionEntries = IdentityMap.instantiateSequenced( INIT_COLL_SIZE );
    collectionsByKey = new HashMap( INIT_COLL_SIZE );
View Full Code Here

TOP

Related Classes of org.apache.commons.collections.map.ReferenceMap$SoftRef

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.