예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RMICache"/> class.
        /// </summary>
        /// <param name="settings"><see cref="T:TcmCDService.Configuration.Settings" /></param>
        public RMICache(Settings settings)
            : base(settings)
        {
            String host = settings.Get<String>("host");

            if (String.IsNullOrEmpty(host))
                throw new ConfigurationErrorsException("RMICache: Host is unconfigured.");

            int port = settings.Get<int>("port");

            if (port == 0)
                throw new ConfigurationErrorsException("RMICache: Port is unconfigured.");

            String instanceIdentifier = settings.Get<String>("instanceIdentifier");

            try
            {
                mConnector = new com.tridion.tcmcdservice.rmi.CacheChannelConnector(host, port, instanceIdentifier);

                // Assign ourselves as a listener interface
                mConnector.setListener(this);

                Logger.Info("RMICache: {0}", mConnector.getGUID());
            }
            catch (com.tridion.tcmcdservice.rmi.CacheException ex)
            {
                Logger.Error("RMICache", ex.fillInStackTrace());
            }
        }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RMICache"/> class.
        /// </summary>
        /// <param name="settings"><see cref="T:TcmCDService.Configuration.Settings" /></param>
        public RMICache(Settings settings) : base(settings)
        {
            String host = settings.Get <String>("host");

            if (String.IsNullOrEmpty(host))
            {
                throw new ConfigurationErrorsException("RMICache: Host is unconfigured.");
            }

            int port = settings.Get <int>("port");

            if (port == 0)
            {
                throw new ConfigurationErrorsException("RMICache: Port is unconfigured.");
            }

            String instanceIdentifier = settings.Get <String>("instanceIdentifier");

            try
            {
                mConnector = new com.tridion.tcmcdservice.rmi.CacheChannelConnector(host, port, instanceIdentifier);

                // Assign ourselves as a listener interface
                mConnector.setListener(this);

                Logger.Info("RMICache: {0}", mConnector.getGUID());
            }
            catch (com.tridion.tcmcdservice.rmi.CacheException ex)
            {
                Logger.Error("RMICache", ex.fillInStackTrace());
            }
        }