avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ymikul...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/csframework/src/cs/Component ComponentException.cs
Date Fri, 08 Nov 2002 20:38:17 GMT
ymikulski    2002/11/08 12:38:17

  Modified:    csframework/src/cs/Service ServiceException.cs
               csframework/src/cs/Parameters Parameters.cs
                        ParameterException.cs
               csframework/src/cs/Context ContextException.cs
               csframework/src/cs/Configuration ConfigurationException.cs
               csframework/src/cs/Component ComponentException.cs
  Log:
  no message
  
  Revision  Changes    Path
  1.3       +22 -0     jakarta-avalon-excalibur/csframework/src/cs/Service/ServiceException.cs
  
  Index: ServiceException.cs
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/csframework/src/cs/Service/ServiceException.cs,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ServiceException.cs	25 Sep 2002 22:48:11 -0000	1.2
  +++ ServiceException.cs	8 Nov 2002 20:38:17 -0000	1.3
  @@ -6,6 +6,7 @@
   // the LICENSE.txt file.
   //------------------------------------------------------------------------------
   using System;
  +using System.Runtime.Serialization; 
   
   namespace Apache.Avalon.Service
   {
  @@ -65,6 +66,14 @@
   		}
   
   		/// <summary>
  +		/// Constructs a new <see cref="ServiceException"/> instance.
  +		/// </summary>
  +		public ServiceException(SerializationInfo info, StreamingContext context): base(info,
context)
  +		{
  +			info.AddValue("role", role); 
  +		}
  +
  +		/// <summary>
   		/// Gets the role that caused the exception.
   		/// </summary>
   		/// <value>The Role that caused the exception.</value> 
  @@ -74,6 +83,19 @@
   			{
   				return role;
   			}
  +		}
  +
  +		/// <summary>
  +		/// Populates the <see cref="SerializationInfo"/> object with 
  +		/// the data needed to serialize the <see cref="ServiceException"/> object.
  +		/// </summary>
  +		/// <param name="info"></param>
  +		/// <param name="context"></param>
  +		public void GetObjectData(SerializationInfo info, StreamingContext context)
  +		{
  +			base.GetObjectData(info, context);
  +
  +			role = info.GetString("role");
   		}
   	}
   }
  
  
  
  1.5       +37 -1     jakarta-avalon-excalibur/csframework/src/cs/Parameters/Parameters.cs
  
  Index: Parameters.cs
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/csframework/src/cs/Parameters/Parameters.cs,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Parameters.cs	25 Sep 2002 22:48:00 -0000	1.4
  +++ Parameters.cs	8 Nov 2002 20:38:17 -0000	1.5
  @@ -24,9 +24,10 @@
   	/// write access to this class to prevent potential data corruption.
   	/// </remarks> 
   	[Serializable]
  -	public class Parameters: IEnumerable 
  +	public class Parameters: IEnumerable, ISerializable
   	{
   		private bool readOnly;
  +
   		private Hashtable parameters = new Hashtable();
   
   		/// <summary>
  @@ -36,6 +37,33 @@
   		{
   		}
   
  +		public Parameters (SerializationInfo info, StreamingContext context)
  +		{
  +			
  +			parameters = new Hashtable();
  +
  +			object[] keys = (object[]) info.GetValue("parameters-keys", typeof(object));
  +			object[] values = (object[]) info.GetValue("parameters-values", typeof(object));
  +
  +			for (int i = 0; i < keys.Length; i++)
  +			{
  +				parameters[keys[i]] = values[i];
  +			}
  +		}
  +
  +		public void GetObjectData(SerializationInfo info, StreamingContext context)
  +		{
  +			
  +			object[] keys = new object[parameters.Keys.Count];
  +			parameters.Keys.CopyTo(keys, 0);
  +
  +			object[] values = new object[parameters.Values.Count];
  +			parameters.Values.CopyTo(values, 0);
  +
  +			info.AddValue("parameters-keys", keys);
  +			info.AddValue("parameters-values", values);
  +		}
  +
   		/// <summary>
   		/// Gets a value indicating whether the parameters is read-only.
   		/// </summary>
  @@ -189,6 +217,14 @@
   		public IEnumerator GetEnumerator()
   		{
   			return parameters.GetEnumerator();
  +		}
  +
  +		public int Count
  +		{
  +			get
  +			{
  +				return parameters.Count; 
  +			}
   		}
   	}
   }
  
  
  
  1.4       +9 -0      jakarta-avalon-excalibur/csframework/src/cs/Parameters/ParameterException.cs
  
  Index: ParameterException.cs
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/csframework/src/cs/Parameters/ParameterException.cs,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ParameterException.cs	25 Sep 2002 22:48:00 -0000	1.3
  +++ ParameterException.cs	8 Nov 2002 20:38:17 -0000	1.4
  @@ -6,6 +6,7 @@
   // the LICENSE.txt file.
   //------------------------------------------------------------------------------
   using System;
  +using System.Runtime.Serialization; 
   
   namespace Apache.Avalon.Parameter
   {
  @@ -13,6 +14,7 @@
   	/// Thrown when a <see cref="IParameterizable"/> component cannot be parameterized
   	/// properly, or if a value cannot be retrieved properly.
   	/// </summary>
  +	[Serializable()] 
   	public class ParameterException: Exception
   	{
   		/// <summary>
  @@ -36,6 +38,13 @@
   		/// <param name="message">The Detail message of the exception.</param>
   		/// <param name="inner">The Root cause of the exception.</param>
   		public ParameterException(string message, Exception inner): base (message, inner)
  +		{
  +		}
  +
  +		/// <summary>
  +		/// Constructs a new <see cref="ParameterException"/> instance.
  +		/// </summary>
  +		public ParameterException (SerializationInfo info, StreamingContext context): base(info,
context)
   		{
   		}
   	}
  
  
  
  1.3       +8 -0      jakarta-avalon-excalibur/csframework/src/cs/Context/ContextException.cs
  
  Index: ContextException.cs
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/csframework/src/cs/Context/ContextException.cs,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ContextException.cs	25 Sep 2002 22:47:12 -0000	1.2
  +++ ContextException.cs	8 Nov 2002 20:38:17 -0000	1.3
  @@ -6,6 +6,7 @@
   // the LICENSE.txt file.
   //------------------------------------------------------------------------------
   using System;
  +using System.Runtime.Serialization; 
   
   namespace Apache.Avalon.Context
   {
  @@ -40,6 +41,13 @@
   		/// <param name="message">The Detail message for this exception.</param>
   		/// <param name="inner">The Root cause of the exception.</param>
   		public ContextException(string message, Exception inner): base (message, inner)
  +		{
  +		}
  +
  +		/// <summary>
  +		/// Constructs a new <see cref="ContextException"/> instance.
  +		/// </summary>
  +		public ContextException(SerializationInfo info, StreamingContext context): base(info,
context)
   		{
   		}
   	}
  
  
  
  1.3       +8 -0      jakarta-avalon-excalibur/csframework/src/cs/Configuration/ConfigurationException.cs
  
  Index: ConfigurationException.cs
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/csframework/src/cs/Configuration/ConfigurationException.cs,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ConfigurationException.cs	25 Sep 2002 22:46:57 -0000	1.2
  +++ ConfigurationException.cs	8 Nov 2002 20:38:17 -0000	1.3
  @@ -6,6 +6,7 @@
   // the LICENSE.txt file.
   //------------------------------------------------------------------------------
   using System;
  +using System.Runtime.Serialization; 
   
   namespace Apache.Avalon.Configuration
   {
  @@ -36,6 +37,13 @@
   		/// <param name="message">The Detail message of the exception.</param>
   		/// <param name="inner">The Root cause of the exception.</param>
   		public ConfigurationException(string message, Exception inner): base(message, inner)
  +		{
  +		}
  +
  +		/// <summary>
  +		/// Constructs a new <see cref="ConfigurationException"/> instance.
  +		/// </summary>
  +		public ConfigurationException(SerializationInfo info, StreamingContext context): base(info,
context)
   		{
   		}
   	}
  
  
  
  1.3       +9 -0      jakarta-avalon-excalibur/csframework/src/cs/Component/ComponentException.cs
  
  Index: ComponentException.cs
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/csframework/src/cs/Component/ComponentException.cs,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ComponentException.cs	25 Sep 2002 22:46:42 -0000	1.2
  +++ ComponentException.cs	8 Nov 2002 20:38:17 -0000	1.3
  @@ -6,6 +6,7 @@
   // the LICENSE.txt file.
   //------------------------------------------------------------------------------
   using System;
  +using System.Runtime.Serialization; 
   
   namespace Apache.Avalon.Component
   {
  @@ -14,6 +15,7 @@
   	///	The exception thrown to indicate a problem with components.
   	/// It is usually thrown by <see cref="IComponentManager"/>. 
   	/// </summary>
  +	[Serializable()]
   	public class ComponentException: Exception
   	{
   		/// <summary>
  @@ -37,6 +39,13 @@
   		/// <param name="message">The Detail message for this exception.</param>
   		/// <param name="inner">The Root cause of the exception.</param>
   		public ComponentException(string message, Exception inner): base(message, inner)
  +		{
  +		}
  +
  +		/// <summary>
  +		/// Constructs a new <c>ComponentException</c> instance.
  +		/// </summary>
  +		public ComponentException(SerializationInfo info, StreamingContext context): base(info,
context)
   		{
   		}
   	}
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message