예제 #1
0
        protected override Region LookupFallback(Cache cacheObject, string regionName)
        {
            AttributesFactory attributesFactory = (attributes != null
                                                       ? new AttributesFactory(attributes)
                                                       : new AttributesFactory());


            if (endpoints != null)
            {
                attributesFactory.SetEndpoints(endpoints);
            }
            if (poolName != null)
            {
                attributesFactory.SetPoolName(poolName);
            }
            SetCallbacks(attributesFactory);
            SetDistributionProperties(attributesFactory);

            PostProcessAttributes(attributesFactory);

            Region reg = cacheObject.CreateRegion(regionName, attributesFactory.CreateRegionAttributes());

            log.Info("Created new cache region [" + regionName + "]");
            return(reg);
        }
예제 #2
0
        /// <summary>
        /// Indented for subclasses to override and provide additional configuration of the AttributesFactory,
        /// for example setting persistence manager option is not currenlty exposed as a public property on the
        /// ClientRegionFactoryObject.
        /// </summary>
        /// <param name="attrFactory">The attributes factory.</param>
        protected virtual void PostProcessAttributes(AttributesFactory attrFactory)
        {
            // try to eagerly initialize the pool name, if defined as an object
            if (poolName != null && objectFactory.IsTypeMatch(poolName, typeof(GemStone.GemFire.Cache.Pool)))
            {
                if (log.IsDebugEnabled)
                {
                    log.Debug("Found object definition for pool '" + poolName + "'. Eagerly initializing it...");
                }
                objectFactory.GetObject(poolName, typeof(GemStone.GemFire.Cache.Pool));
            }

            attrFactory.SetPoolName(poolName);
        }
        /// <summary>
        /// Indented for subclasses to override and provide additional configuration of the AttributesFactory,
        /// for example setting persistence manager option is not currenlty exposed as a public property on the
        /// ClientRegionFactoryObject.
        /// </summary>
        /// <param name="attrFactory">The attributes factory.</param>
        protected virtual void PostProcessAttributes(AttributesFactory attrFactory)
        {
            // try to eagerly initialize the pool name, if defined as an object
            if (poolName != null && objectFactory.IsTypeMatch(poolName, typeof(GemStone.GemFire.Cache.Pool))) {
                if (log.IsDebugEnabled) {
                    log.Debug("Found object definition for pool '" + poolName + "'. Eagerly initializing it...");
                }
                objectFactory.GetObject(poolName, typeof(GemStone.GemFire.Cache.Pool));
            }

            attrFactory.SetPoolName(poolName);
        }