コード例 #1
0
ファイル: GroupChannel.cs プロジェクト: javithalion/NCache
		/// <summary> Opens the channel.<BR>
		/// this does the following actions<BR>
		/// 1. Resets the receiver queue by calling Queue.reset<BR>
		/// 2. Sets up the protocol stack by calling ProtocolStack.setup<BR>
		/// 3. Sets the closed flag to false.<BR>
		/// </summary>
		public override void  open()
		{
			lock (this)
			{
				if (!closed)
					throw new ChannelException("GroupChannel.open(): channel is already open.");
				
				try
				{
					mq.reset();
					
					// new stack is created on open() - bela June 12 2003
					prot_stack = new ProtocolStack(this, props);
					prot_stack.setup();
					closed = false;
				}
				catch (System.Exception e)
				{
					throw new ChannelException("GroupChannel().open(): " + e.Message);
				}
			}
		}
コード例 #2
0
ファイル: GroupChannel.cs プロジェクト: javithalion/NCache
		/// <summary> Constructs a <code>GroupChannel</code> instance with the protocol stack
		/// configuration based upon the specified properties parameter.
		/// 
		/// </summary>
		/// <param name="properties">an old style property string, a string representing a
		/// system resource containing a JGroups XML configuration,
		/// a string representing a URL pointing to a JGroups XML
		/// XML configuration, or a string representing a file name
		/// that contains a JGroups XML configuration.
		/// 
		/// </param>
		/// <throws>  ChannelException if problems occur during the configuration and </throws>
		/// <summary>                          initialization of the protocol stack.
		/// </summary>
        public GroupChannel(string properties, ILogger NCacheLog)
		{
			props = properties;
            this._ncacheLog = NCacheLog;

            /*create the new protocol stack*/
			prot_stack = new ProtocolStack(this, props);
            prot_stack.NCacheLog = NCacheLog;


			/* Setup protocol stack (create layers, queues between them */
			try
			{
				prot_stack.setup();
			}
			catch (System.Exception e)
			{
				NCacheLog.Error("GroupChannel.GroupChannel()",  e.ToString());
				throw new ChannelException("GroupChannel(): " + e);
			}
		}