Example #1
0
        public void Deserialize(Runtime.Serialization.IO.CompactReader reader)
        {
            cacheIsRunning    = reader.ReadBoolean();
            cacheIsRegistered = reader.ReadBoolean();
            licenseIsExpired  = reader.ReadBoolean();

            name         = reader.ReadObject() as string;
            inproc       = reader.ReadBoolean();
            cacheType    = reader.ReadObject() as string;
            log          = reader.ReadObject() as Log;
            perfCounters = reader.ReadObject() as PerfCounters;

            indexes              = reader.ReadObject() as QueryIndex;
            backingSource        = reader.ReadObject() as BackingSource;
            notifications        = reader.ReadObject() as Notifications;
            cleanup              = reader.ReadObject() as Cleanup;
            storage              = reader.ReadObject() as Storage;
            evictionPolicy       = reader.ReadObject() as EvictionPolicy;
            expirationPolicy     = reader.ReadObject() as ExpirationPolicy;
            cluster              = reader.ReadObject() as Cluster;
            _replicationStrategy = reader.ReadObject() as ReplicationStrategy;

            autoBalancing            = reader.ReadObject() as AutoLoadBalancing;
            clientNodes              = reader.ReadObject() as ClientNodes;
            _sqlDependencyConfig     = reader.ReadObject() as SQLDependencyConfig;
            _taskConfiguration       = reader.ReadObject() as TaskConfiguration;
            deathDetection           = reader.ReadObject() as ClientDeathDetection;
            _runtimeContextValue     = reader.ReadObject() as string == "1" ? RtContextValue.JVCACHE : RtContextValue.NCACHE;
            _synchronizationStrategy = reader.ReadObject() as SynchronizationStrategy;

            string temp = reader.ReadObject() as String;

            _dataFormat = Common.Enum.DataFormat.Binary;
            clientActivityNotification = reader.ReadObject() as ClientActivityNotification;
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="ticks"></param>
        /// <param name="isSliding"></param>
        /// <returns></returns>
        ///
        public static void ValidateExpiration(Alachisoft.NCache.Config.Dom.ExpirationPolicy policy)
        {
            if (policy.SlidingExpiration.DefaultEnabled || policy.SlidingExpiration.LongerEnabled || policy.AbsoluteExpiration.DefaultEnabled || policy.AbsoluteExpiration.LongerEnabled)
            {
                if (policy.AbsoluteExpiration.Default < 5 && policy.AbsoluteExpiration.DefaultEnabled)
#if !NETCORE
                { throw new ManagementException("Absolute Default expiration value is less than 5 seconds."); }
#elif NETCORE
                { throw new Exception("Absolute Default expiration value is less than 5 seconds.");   //TODO: ALACHISOFT (System.Management has some issues)
                }
#endif
                if (policy.AbsoluteExpiration.Longer < 5 && policy.AbsoluteExpiration.LongerEnabled)
#if !NETCORE
                { throw new ManagementException("Absolute Longer expiration value is less than 5 seconds."); }
#elif NETCORE
                { throw new Exception("Absolute Longer expiration value is less than 5 seconds.");   //TODO: ALACHISOFT (System.Management has some issues)
                }
#endif
                if (policy.SlidingExpiration.Default < 5 && policy.SlidingExpiration.DefaultEnabled)
#if !NETCORE
                { throw new ManagementException("Sliding Default expiration value is less than 5 seconds."); }
#elif NETCORE
                { throw new Exception("Sliding Default expiration value is less than 5 seconds.");   //TODO: ALACHISOFT (System.Management has some issues)
                }
#endif
                if (policy.SlidingExpiration.Longer < 5 && policy.SlidingExpiration.LongerEnabled)
#if !NETCORE
                { throw new ManagementException("Sliding Longer expiration value is less than 5 seconds."); }
#elif NETCORE
                { throw new Exception("Sliding Longer expiration value is less than 5 seconds.");   //TODO: ALACHISOFT (System.Management has some issues)
                }
#endif
            }
        }
Example #3
0
        public object Clone()
        {
            ExpirationPolicy expPolicy = new ExpirationPolicy();

            expPolicy.IsExpirationEnabled = this._isExpirationEnabled;
            expPolicy.AbsoluteExpiration  = this._absoluteExpiration;
            expPolicy._slidingExpiration  = this._slidingExpiration;
            return(expPolicy);
        }
 public CacheServerConfigSetting()
 {
     log                        = new Alachisoft.NCache.Config.Dom.Log();
     perfCounters               = new Alachisoft.NCache.Config.Dom.PerfCounters();
     cleanup                    = new Alachisoft.NCache.Config.Dom.Cleanup();
     notifications              = new Alachisoft.NCache.Config.Dom.Notifications();
     _taskConfiguration         = new TaskConfiguration();
     deathDetection             = new ClientDeathDetection();
     clientActivityNotification = new ClientActivityNotification();
     expirationPolicy           = new Alachisoft.NCache.Config.Dom.ExpirationPolicy();
 }
Example #5
0
        public CacheServerConfig()

        {
            log = new Log();

            notifications              = new Notifications();
            _taskConfiguration         = new TaskConfiguration();
            deathDetection             = new ClientDeathDetection();
            clientActivityNotification = new ClientActivityNotification();
            autoBalancing              = new AutoLoadBalancing();
            expirationPolicy           = new ExpirationPolicy();
            _synchronizationStrategy   = new SynchronizationStrategy();
        }
Example #6
0
        public object Clone()
        {
            CacheServerConfig config = new CacheServerConfig();

            config.Name      = Name != null ? (string)Name.Clone() : null;
            config.cacheType = this.cacheType;

            config.InProc = InProc;

            config.clientNodes = clientNodes != null?clientNodes.Clone() as ClientNodes : null;

            config.Log          = Log != null ? (Log)Log.Clone() : null;
            config.PerfCounters = PerfCounters != null ? (PerfCounters)PerfCounters.Clone() : null;


#if COMMUNITY || CLIENT
            config.ReplicationStrategy = ReplicationStrategy != null ? (ReplicationStrategy)ReplicationStrategy.Clone() : null;
            config.autoBalancing       = this.autoBalancing != null ? (AutoLoadBalancing)this.autoBalancing.Clone() : null;
#endif

            config.Cleanup          = Cleanup != null ? (Cleanup)Cleanup.Clone() : null;
            config.Storage          = Storage != null ? (Storage)Storage.Clone() : null;
            config.EvictionPolicy   = EvictionPolicy != null ? (EvictionPolicy)EvictionPolicy.Clone() : null;
            config.ExpirationPolicy = ExpirationPolicy != null ? (ExpirationPolicy)ExpirationPolicy.Clone() : null;

            config.Cluster = Cluster != null ? (Cluster)Cluster.Clone() : null;


            config.backingSource = this.backingSource != null ? (BackingSource)this.backingSource.Clone() : null;


            config.QueryIndices  = QueryIndices != null ? (QueryIndex)QueryIndices.Clone() : null;
            config.Notifications = Notifications != null ? (Notifications)Notifications.Clone() : null;

            config.SQLDependencyConfig     = SQLDependencyConfig != null ? (SQLDependencyConfig)SQLDependencyConfig.Clone() : null;
            config.TaskConfiguration       = TaskConfiguration != null ? (TaskConfiguration)TaskConfiguration.Clone() : null;
            config.ClientDeathDetection    = ClientDeathDetection != null ? (ClientDeathDetection)ClientDeathDetection.Clone() : null;
            config.SynchronizationStrategy = SynchronizationStrategy != null ? (SynchronizationStrategy)SynchronizationStrategy.Clone() : null;

            config.ClientActivityNotification = ClientActivityNotification != null
                ? (ClientActivityNotification)ClientActivityNotification.Clone()
                : null;
            config.IsRegistered     = this.IsRegistered;
            config.IsRunning        = this.IsRunning;
            config.licenseIsExpired = this.licenseIsExpired;
            config.RuntimeContext   = this.RuntimeContext;
            config.DataFormat       = this.DataFormat;

            return(config);
        }
        public void Deserialize(Runtime.Serialization.IO.CompactReader reader)
        {
            inproc                   = reader.ReadBoolean();
            cacheType                = reader.ReadObject() as String;
            log                      = reader.ReadObject() as Log;
            perfCounters             = reader.ReadObject() as Alachisoft.NCache.Config.Dom.PerfCounters;
            indexes                  = reader.ReadObject() as QueryIndex;
            backingSource            = reader.ReadObject() as BackingSource;
            notifications            = reader.ReadObject() as Notifications;
            cleanup                  = reader.ReadObject() as Cleanup;
            storage                  = reader.ReadObject() as Alachisoft.NCache.Config.Dom.Storage;
            evictionPolicy           = reader.ReadObject() as EvictionPolicy;
            expirationPolicy         = reader.ReadObject() as ExpirationPolicy;
            _sqlDependencyConfig     = reader.ReadObject() as SQLDependencyConfig;
            _synchronizationStrategy = reader.ReadObject() as SynchronizationStrategy;
            cacheTopology            = reader.ReadObject() as CacheTopology;
            _taskConfiguration       = reader.ReadObject() as TaskConfiguration;

            string temp = reader.ReadObject() as String;

            _dataFormat                = Common.Enum.DataFormat.Binary;
            deathDetection             = reader.ReadObject() as ClientDeathDetection;
            clientActivityNotification = reader.ReadObject() as ClientActivityNotification;
        }