You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by ha...@apache.org on 2003/12/27 16:33:32 UTC

cvs commit: avalon-sandbox/avalon-net/Castle WARNING.txt

hammett     2003/12/27 07:33:32

  Modified:    avalon-net/Castle/CastleManagementExtensions/Default
                        MDefaultRegistry.cs MDefaultServer.cs
               avalon-net/Castle/CastleManagementExtensions MRegistry.cs
                        MServer.cs
  Added:       avalon-net/Castle/CastleManagementExtensionsTest
                        MDefaultServerTestCase.cs
               avalon-net/Castle/CastleManagementExtensions/Exception
                        ManagedObjectNotFoundException.cs
               avalon-net/Castle WARNING.txt
  Log:
  Few corrections. More TestCases.
  
  Revision  Changes    Path
  1.2       +74 -12    avalon-sandbox/avalon-net/Castle/CastleManagementExtensions/Default/MDefaultRegistry.cs
  
  Index: MDefaultRegistry.cs
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/avalon-net/Castle/CastleManagementExtensions/Default/MDefaultRegistry.cs,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MDefaultRegistry.cs	27 Dec 2003 03:13:29 -0000	1.1
  +++ MDefaultRegistry.cs	27 Dec 2003 15:33:32 -0000	1.2
  @@ -165,9 +165,14 @@
   
   			String domainName = name.Domain;
   			
  -			Domain domain = FindDomain(domainName);
  -
  -			domain.Remove(name);
  +			try
  +			{
  +				Domain domain = FindDomain(domainName);
  +				domain.Remove(name);
  +			}
  +			catch(InvalidDomainException)
  +			{
  +			}
   		}
   
   		/// <summary>
  @@ -221,18 +226,57 @@
   					throw new ArgumentNullException("name");
   				}
   
  -				Object instance = null;
  +				return GetEntry(name).Instance;
  +			}
  +		}
   
  -				Domain domain = FindDomain(name.Domain);
  -				Entry entry = domain[name];
  +		/// <summary>
  +		/// Invokes an action in managed object
  +		/// </summary>
  +		/// <param name="name"></param>
  +		/// <param name="action"></param>
  +		/// <param name="args"></param>
  +		/// <param name="signature"></param>
  +		/// <returns></returns>
  +		/// <exception cref="InvalidDomainException">If domain name is not found.</exception>
  +		public Object Invoke(ManagedObjectName name, String action, Object[] args, Type[] signature)
  +		{
  +			return GetEntry(name).Invoker.Invoke(action, args, signature);
  +		}
   
  -				if (entry != null)
  -				{
  -					instance = entry.Instance;
  -				}
  +		/// <summary>
  +		/// Returns the info (attributes and operations) about the specified object.
  +		/// </summary>
  +		/// <param name="name"></param>
  +		/// <returns></returns>
  +		/// <exception cref="InvalidDomainException">If domain name is not found.</exception>
  +		public ManagementInfo GetManagementInfo(ManagedObjectName name)
  +		{
  +			return GetEntry(name).Invoker.Info;
  +		}
   
  -				return instance;
  -			}
  +		/// <summary>
  +		/// Gets an attribute value of the specified managed object.
  +		/// </summary>
  +		/// <param name="name"></param>
  +		/// <param name="attributeName"></param>
  +		/// <returns></returns>
  +		/// <exception cref="InvalidDomainException">If domain name is not found.</exception>
  +		public Object GetAttributeValue(ManagedObjectName name, String attributeName)
  +		{
  +			return GetEntry(name).Invoker.GetAttributeValue(attributeName);
  +		}
  +
  +		/// <summary>
  +		/// Sets an attribute value of the specified managed object.
  +		/// </summary>
  +		/// <param name="name"></param>
  +		/// <param name="attributeName"></param>
  +		/// <param name="attributeValue"></param>
  +		/// <exception cref="InvalidDomainException">If domain name is not found.</exception>
  +		public void SetAttributeValue(ManagedObjectName name, String attributeName, Object attributeValue)
  +		{
  +			GetEntry(name).Invoker.SetAttributeValue(attributeName, attributeValue);
   		}
   
   		#endregion
  @@ -252,6 +296,24 @@
   			}
   
   			return domain;
  +		}
  +
  +		/// <summary>
  +		/// Helper to locate Entries.
  +		/// </summary>
  +		/// <param name="name"></param>
  +		/// <returns></returns>
  +		private Entry GetEntry(ManagedObjectName name)
  +		{
  +			Domain domain = FindDomain(name.Domain);
  +			Entry entry = domain[name];
  +
  +			if (entry == null)
  +			{
  +				throw new ManagedObjectNotFoundException(name.ToString());
  +			}
  +
  +			return entry;
   		}
   	}
   }
  
  
  
  1.2       +130 -0    avalon-sandbox/avalon-net/Castle/CastleManagementExtensions/Default/MDefaultServer.cs
  
  Index: MDefaultServer.cs
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/avalon-net/Castle/CastleManagementExtensions/Default/MDefaultServer.cs,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MDefaultServer.cs	27 Dec 2003 03:13:29 -0000	1.1
  +++ MDefaultServer.cs	27 Dec 2003 15:33:32 -0000	1.2
  @@ -104,6 +104,29 @@
   		}
   
   		/// <summary>
  +		/// Instantiates the specified type using the server domain.
  +		/// </summary>
  +		/// <param name="typeName"></param>
  +		/// <param name="typeName"></param>
  +		/// <returns></returns>
  +		public Object Instantiate(String assemblyName, String typeName)
  +		{
  +			if (assemblyName == null)
  +			{
  +				throw new ArgumentNullException("assemblyName");
  +			}
  +			if (typeName == null)
  +			{
  +				throw new ArgumentNullException("typeName");
  +			}
  +
  +			object instance = AppDomain.CurrentDomain.CreateInstanceAndUnwrap(
  +				assemblyName, typeName);
  +
  +			return instance;
  +		}
  +
  +		/// <summary>
   		/// TODO: Summary
   		/// </summary>
   		/// <param name="typeName"></param>
  @@ -127,6 +150,33 @@
   		/// <summary>
   		/// TODO: Summary
   		/// </summary>
  +		/// <param name="assemblyName"></param>
  +		/// <param name="typeName"></param>
  +		/// <param name="name"></param>
  +		/// <returns></returns>
  +		public ManagedInstance CreateManagedObject(String assemblyName, String typeName, ManagedObjectName name)
  +		{
  +			if (assemblyName == null)
  +			{
  +				throw new ArgumentNullException("assemblyName");
  +			}
  +			if (typeName == null)
  +			{
  +				throw new ArgumentNullException("typeName");
  +			}
  +			if (name == null)
  +			{
  +				throw new ArgumentNullException("name");
  +			}
  +
  +			Object instance = Instantiate(assemblyName, typeName);
  +			return RegisterManagedObject(instance, name);
  +		}
  +
  +
  +		/// <summary>
  +		/// TODO: Summary
  +		/// </summary>
   		/// <param name="instance"></param>
   		/// <param name="name"></param>
   		/// <returns></returns>
  @@ -171,6 +221,86 @@
   			}
   
   			registry.UnregisterManagedObject(name);
  +		}
  +
  +		/// <summary>
  +		/// Invokes an action in managed object
  +		/// </summary>
  +		/// <param name="name"></param>
  +		/// <param name="action"></param>
  +		/// <param name="args"></param>
  +		/// <param name="signature"></param>
  +		/// <returns></returns>
  +		/// <exception cref="InvalidDomainException">If domain name is not found.</exception>
  +		public Object Invoke(ManagedObjectName name, String action, Object[] args, Type[] signature)
  +		{
  +			if (name == null)
  +			{
  +				throw new ArgumentNullException("name");
  +			}
  +			if (action == null)
  +			{
  +				throw new ArgumentNullException("action");
  +			}
  +			return registry.Invoke(name, action, args, signature);
  +		}
  +
  +		/// <summary>
  +		/// Returns the info (attributes and operations) about the specified object.
  +		/// </summary>
  +		/// <param name="name"></param>
  +		/// <returns></returns>
  +		/// <exception cref="InvalidDomainException">If domain name is not found.</exception>
  +		public ManagementInfo GetManagementInfo(ManagedObjectName name)
  +		{
  +			if (name == null)
  +			{
  +				throw new ArgumentNullException("name");
  +			}
  +			
  +			return registry.GetManagementInfo(name);
  +		}
  +
  +		/// <summary>
  +		/// Gets an attribute value of the specified managed object.
  +		/// </summary>
  +		/// <param name="name"></param>
  +		/// <param name="attributeName"></param>
  +		/// <returns></returns>
  +		/// <exception cref="InvalidDomainException">If domain name is not found.</exception>
  +		public Object GetAttribute(ManagedObjectName name, String attributeName)
  +		{
  +			if (name == null)
  +			{
  +				throw new ArgumentNullException("name");
  +			}
  +			if (attributeName == null)
  +			{
  +				throw new ArgumentNullException("attributeName");
  +			}
  +
  +			return registry.GetAttributeValue(name, attributeName);
  +		}
  +
  +		/// <summary>
  +		/// Sets an attribute value of the specified managed object.
  +		/// </summary>
  +		/// <param name="name"></param>
  +		/// <param name="attributeName"></param>
  +		/// <param name="attributeValue"></param>
  +		/// <exception cref="InvalidDomainException">If domain name is not found.</exception>
  +		public void SetAttribute(ManagedObjectName name, String attributeName, Object attributeValue)
  +		{
  +			if (name == null)
  +			{
  +				throw new ArgumentNullException("name");
  +			}
  +			if (attributeName == null)
  +			{
  +				throw new ArgumentNullException("attributeName");
  +			}
  +			
  +			registry.SetAttributeValue(name, attributeName, attributeValue);
   		}
   
   		#endregion
  
  
  
  1.2       +56 -0     avalon-sandbox/avalon-net/Castle/CastleManagementExtensions/MRegistry.cs
  
  Index: MRegistry.cs
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/avalon-net/Castle/CastleManagementExtensions/MRegistry.cs,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MRegistry.cs	27 Dec 2003 03:13:29 -0000	1.1
  +++ MRegistry.cs	27 Dec 2003 15:33:32 -0000	1.2
  @@ -54,10 +54,29 @@
   	/// </summary>
   	public interface MRegistry
   	{
  +		/// <summary>
  +		/// Registers the specified managed object instance.
  +		/// </summary>
  +		/// <param name="instance"></param>
  +		/// <param name="name"></param>
  +		/// <returns></returns>
  +		/// <exception cref="InvalidDomainException">If domain name is not found.</exception>
   		ManagedInstance RegisterManagedObject(Object instance, ManagedObjectName name);
   		
  +		/// <summary>
  +		/// Returns a <see cref="ManagedInstance"/> representing 
  +		/// a managed object instance.
  +		/// </summary>
  +		/// <param name="name"></param>
  +		/// <returns></returns>
  +		/// <exception cref="InvalidDomainException">If domain name is not found.</exception>
   		ManagedInstance GetManagedInstance(ManagedObjectName name);
   
  +		/// <summary>
  +		/// Unregister a managed object from the domain.
  +		/// </summary>
  +		/// <param name="name"></param>
  +		/// <exception cref="InvalidDomainException">If domain name is not found.</exception>
   		void UnregisterManagedObject(ManagedObjectName name);
   
   		bool Contains(ManagedObjectName name);
  @@ -71,5 +90,42 @@
   		{
   			get;
   		}
  +
  +		/// <summary>
  +		/// Invokes an action in managed object
  +		/// </summary>
  +		/// <param name="name"></param>
  +		/// <param name="action"></param>
  +		/// <param name="args"></param>
  +		/// <param name="signature"></param>
  +		/// <returns></returns>
  +		/// <exception cref="InvalidDomainException">If domain name is not found.</exception>
  +		Object Invoke(ManagedObjectName name, String action, Object[] args, Type[] signature);
  +
  +		/// <summary>
  +		/// Returns the info (attributes and operations) about the specified object.
  +		/// </summary>
  +		/// <param name="name"></param>
  +		/// <returns></returns>
  +		/// <exception cref="InvalidDomainException">If domain name is not found.</exception>
  +		ManagementInfo GetManagementInfo(ManagedObjectName name);
  +
  +		/// <summary>
  +		/// Gets an attribute value of the specified managed object.
  +		/// </summary>
  +		/// <param name="name"></param>
  +		/// <param name="attributeName"></param>
  +		/// <returns></returns>
  +		/// <exception cref="InvalidDomainException">If domain name is not found.</exception>
  +		Object GetAttributeValue(ManagedObjectName name, String attributeName);
  +
  +		/// <summary>
  +		/// Sets an attribute value of the specified managed object.
  +		/// </summary>
  +		/// <param name="name"></param>
  +		/// <param name="attributeName"></param>
  +		/// <param name="attributeValue"></param>
  +		/// <exception cref="InvalidDomainException">If domain name is not found.</exception>
  +		void SetAttributeValue(ManagedObjectName name, String attributeName, Object attributeValue);
   	}
   }
  
  
  
  1.2       +84 -0     avalon-sandbox/avalon-net/Castle/CastleManagementExtensions/MServer.cs
  
  Index: MServer.cs
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/avalon-net/Castle/CastleManagementExtensions/MServer.cs,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MServer.cs	27 Dec 2003 03:13:29 -0000	1.1
  +++ MServer.cs	27 Dec 2003 15:33:32 -0000	1.2
  @@ -54,14 +54,98 @@
   	/// </summary>
   	public interface MServer
   	{
  +		/// <summary>
  +		/// Instantiates the specified type using the server domain.
  +		/// </summary>
  +		/// <param name="typeName"></param>
  +		/// <returns></returns>
   		Object Instantiate(String typeName);
   
  +		/// <summary>
  +		/// Instantiates the specified type using the server domain.
  +		/// </summary>
  +		/// <param name="typeName"></param>
  +		/// <param name="typeName"></param>
  +		/// <returns></returns>
  +		Object Instantiate(String assemblyName, String typeName);
  +
  +		/// <summary>
  +		/// Instantiates the specified managed object.
  +		/// </summary>
  +		/// <param name="typeName"></param>
  +		/// <param name="name"></param>
  +		/// <returns></returns>
  +		/// <exception cref="InvalidDomainException">If domain name is not found.</exception>
   		ManagedInstance CreateManagedObject(String typeName, ManagedObjectName name);
   
  +		/// <summary>
  +		/// Instantiates the specified managed object.
  +		/// </summary>
  +		/// <param name="typeName"></param>
  +		/// <param name="name"></param>
  +		/// <returns></returns>
  +		ManagedInstance CreateManagedObject(String assemblyName, String typeName, ManagedObjectName name);
  +
  +		/// <summary>
  +		/// Registers the specified managed object instance.
  +		/// </summary>
  +		/// <param name="instance"></param>
  +		/// <param name="name"></param>
  +		/// <returns></returns>
  +		/// <exception cref="InvalidDomainException">If domain name is not found.</exception>
   		ManagedInstance RegisterManagedObject(Object instance, ManagedObjectName name);
   		
  +		/// <summary>
  +		/// Returns a <see cref="ManagedInstance"/> representing 
  +		/// a managed object instance.
  +		/// </summary>
  +		/// <param name="name"></param>
  +		/// <returns></returns>
  +		/// <exception cref="InvalidDomainException">If domain name is not found.</exception>
   		ManagedInstance GetManagedInstance(ManagedObjectName name);
   
  +		/// <summary>
  +		/// Unregister a managed object from the domain.
  +		/// </summary>
  +		/// <param name="name"></param>
  +		/// <exception cref="InvalidDomainException">If domain name is not found.</exception>
   		void UnregisterManagedObject(ManagedObjectName name);
  +
  +		/// <summary>
  +		/// Invokes an action in managed object
  +		/// </summary>
  +		/// <param name="name"></param>
  +		/// <param name="action"></param>
  +		/// <param name="args"></param>
  +		/// <param name="signature"></param>
  +		/// <returns></returns>
  +		/// <exception cref="InvalidDomainException">If domain name is not found.</exception>
  +		Object Invoke(ManagedObjectName name, String action, Object[] args, Type[] signature);
  +
  +		/// <summary>
  +		/// Returns the info (attributes and operations) about the specified object.
  +		/// </summary>
  +		/// <param name="name"></param>
  +		/// <returns></returns>
  +		/// <exception cref="InvalidDomainException">If domain name is not found.</exception>
  +		ManagementInfo GetManagementInfo(ManagedObjectName name);
  +
  +		/// <summary>
  +		/// Gets an attribute value of the specified managed object.
  +		/// </summary>
  +		/// <param name="name"></param>
  +		/// <param name="attributeName"></param>
  +		/// <returns></returns>
  +		/// <exception cref="InvalidDomainException">If domain name is not found.</exception>
  +		Object GetAttribute(ManagedObjectName name, String attributeName);
  +
  +		/// <summary>
  +		/// Sets an attribute value of the specified managed object.
  +		/// </summary>
  +		/// <param name="name"></param>
  +		/// <param name="attributeName"></param>
  +		/// <param name="attributeValue"></param>
  +		/// <exception cref="InvalidDomainException">If domain name is not found.</exception>
  +		void SetAttribute(ManagedObjectName name, String attributeName, Object attributeValue);
   	}
   }
  
  
  
  1.1                  avalon-sandbox/avalon-net/Castle/CastleManagementExtensionsTest/MDefaultServerTestCase.cs
  
  Index: MDefaultServerTestCase.cs
  ===================================================================
  // ============================================================================
  //                   The Apache Software License, Version 1.1
  // ============================================================================
  // 
  // Copyright (C) 2002-2003 The Apache Software Foundation. All rights reserved.
  // 
  // Redistribution and use in source and binary forms, with or without modifica-
  // tion, are permitted provided that the following conditions are met:
  // 
  // 1. Redistributions of  source code must  retain the above copyright  notice,
  //    this list of conditions and the following disclaimer.
  // 
  // 2. Redistributions in binary form must reproduce the above copyright notice,
  //    this list of conditions and the following disclaimer in the documentation
  //    and/or other materials provided with the distribution.
  // 
  // 3. The end-user documentation included with the redistribution, if any, must
  //    include  the following  acknowledgment:  "This product includes  software
  //    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
  //    Alternately, this  acknowledgment may  appear in the software itself,  if
  //    and wherever such third-party acknowledgments normally appear.
  // 
  // 4. The names "Jakarta", "Avalon", "Excalibur" and "Apache Software Foundation"  
  //    must not be used to endorse or promote products derived from this  software 
  //    without  prior written permission. For written permission, please contact 
  //    apache@apache.org.
  // 
  // 5. Products  derived from this software may not  be called "Apache", nor may
  //    "Apache" appear  in their name,  without prior written permission  of the
  //    Apache Software Foundation.
  // 
  // THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  // FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
  // APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
  // INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
  // DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
  // OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
  // ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
  // (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
  // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  // 
  // This software  consists of voluntary contributions made  by many individuals
  // on  behalf of the Apache Software  Foundation. For more  information on the 
  // Apache Software Foundation, please see <http://www.apache.org/>.
  // ============================================================================
  
  namespace Apache.Avalon.Castle.ManagementExtensions.Test
  {
  	using System;
  
  	using NUnit.Framework;
  
  	using Apache.Avalon.Castle.ManagementExtensions.Default;
  	using Apache.Avalon.Castle.ManagementExtensions.Test.Components;
  
  	/// <summary>
  	/// Summary description for MDefaultServerTestCase.
  	/// </summary>
  	[TestFixture]
  	public class MDefaultServerTestCase : Assertion
  	{
  		protected MDefaultServer server = new MDefaultServer();
  		protected Type httpServerType = typeof(DummyHttpServer);
  		protected Type smtpServerType = typeof(DummySmtpServer);
  
  		[Test]
  		public void TestInstantiate()
  		{
  			Object obj = server.Instantiate( httpServerType.Assembly.FullName, httpServerType.FullName );
  			AssertNotNull( obj );
  			AssertEquals( httpServerType, obj.GetType() );
  		}
  
  		[Test]
  		public void TestCreateManagedObject()
  		{
  			ManagedObjectName name = new ManagedObjectName("domain.org:type=httpServer");
  
  			try
  			{
  				ManagedInstance inst = server.CreateManagedObject( 
  					httpServerType.Assembly.FullName, httpServerType.FullName, name );
  				AssertNotNull( inst );
  				AssertEquals( httpServerType.FullName, inst.TypeName );
  				AssertEquals( name, inst.Name );
  			}
  			finally
  			{
  				server.UnregisterManagedObject( name );
  			}
  		}
  
  		[Test]
  		public void TestRegisterManagedObject()
  		{
  			ManagedObjectName name = new ManagedObjectName("domain.org:type=httpServer");
  
  			try
  			{
  				Object httpServer = server.Instantiate( httpServerType.Assembly.FullName, httpServerType.FullName );
  
  				ManagedInstance inst = server.RegisterManagedObject( httpServer, name );
  				AssertNotNull( inst );
  				AssertEquals( httpServerType.FullName, inst.TypeName );
  				AssertEquals( name, inst.Name );
  			}
  			finally
  			{
  				server.UnregisterManagedObject( name );
  			}
  		}
  
  		[Test]
  		public void TestGetManagementInfo()
  		{
  			ManagedObjectName name1 = new ManagedObjectName("domain.org:type=httpServer");
  			ManagedObjectName name2 = new ManagedObjectName("domain.net:type=smtpServer");
  
  			try
  			{
  				Object httpServer = server.Instantiate( httpServerType.Assembly.FullName, httpServerType.FullName );
  				server.RegisterManagedObject( httpServer, name1 );
  
  				ManagementInfo info = server.GetManagementInfo( name1 );
  				AssertNotNull( info );
  				AssertEquals( 3, info.Operations.Count );
  				AssertEquals( 1, info.Attributes.Count );
  
  				Object smtpServer = server.Instantiate( smtpServerType.Assembly.FullName, smtpServerType.FullName );
  
  				try
  				{
  					server.RegisterManagedObject( smtpServer, name1 );
  
  					Fail("Should not allow register with same name.");
  				}
  				catch(InstanceAlreadyRegistredException)
  				{
  					// OK
  				}
  
  				server.RegisterManagedObject( smtpServer, name2 );
  
  				info = server.GetManagementInfo( name2 );
  				AssertNotNull( info );
  				AssertEquals( 2, info.Operations.Count );
  				AssertEquals( 1, info.Attributes.Count );
  			}
  			finally
  			{
  				server.UnregisterManagedObject( name1 );
  				server.UnregisterManagedObject( name2 );
  			}
  		}
  
  		[Test]
  		public void TestAttributes()
  		{
  			ManagedObjectName name = new ManagedObjectName("domain.net:type=smtpServer");
  
  			try
  			{
  				Object smtpServer = server.Instantiate( smtpServerType.Assembly.FullName, smtpServerType.FullName );
  
  				ManagedInstance inst = server.RegisterManagedObject( smtpServer, name );
  
  				int port = (int) server.GetAttribute(name, "Port");
  				AssertEquals( 1088, port );
  
  				server.SetAttribute( name, "Port", 25 );
  				
  				port = (int) server.GetAttribute(name, "Port");
  				AssertEquals( 25, port );
  			}
  			finally
  			{
  				server.UnregisterManagedObject( name );
  			}
  		}
  
  		[Test]
  		public void TestInvoke()
  		{
  			ManagedObjectName name = new ManagedObjectName("domain.org:type=httpServer");
  
  			try
  			{
  				Object httpServer = server.Instantiate( httpServerType.Assembly.FullName, httpServerType.FullName );
  
  				ManagedInstance inst = server.RegisterManagedObject( httpServer, name );
  
  				bool state = (bool) server.GetAttribute(name, "Started");
  				AssertEquals( false, state );
  
  				server.Invoke( name, "Start", null, null );
  				
  				state = (bool) server.GetAttribute(name, "Started");
  				AssertEquals( true, state );
  
  				server.Invoke( name, "Stop", null, null );
  				state = (bool) server.GetAttribute(name, "Started");
  				AssertEquals( false, state );
  			}
  			finally
  			{
  				server.UnregisterManagedObject( name );
  			}
  		}
  	}
  }
  
  
  
  1.1                  avalon-sandbox/avalon-net/Castle/CastleManagementExtensions/Exception/ManagedObjectNotFoundException.cs
  
  Index: ManagedObjectNotFoundException.cs
  ===================================================================
  // ============================================================================
  //                   The Apache Software License, Version 1.1
  // ============================================================================
  // 
  // Copyright (C) 2002-2003 The Apache Software Foundation. All rights reserved.
  // 
  // Redistribution and use in source and binary forms, with or without modifica-
  // tion, are permitted provided that the following conditions are met:
  // 
  // 1. Redistributions of  source code must  retain the above copyright  notice,
  //    this list of conditions and the following disclaimer.
  // 
  // 2. Redistributions in binary form must reproduce the above copyright notice,
  //    this list of conditions and the following disclaimer in the documentation
  //    and/or other materials provided with the distribution.
  // 
  // 3. The end-user documentation included with the redistribution, if any, must
  //    include  the following  acknowledgment:  "This product includes  software
  //    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
  //    Alternately, this  acknowledgment may  appear in the software itself,  if
  //    and wherever such third-party acknowledgments normally appear.
  // 
  // 4. The names "Jakarta", "Avalon", "Excalibur" and "Apache Software Foundation"  
  //    must not be used to endorse or promote products derived from this  software 
  //    without  prior written permission. For written permission, please contact 
  //    apache@apache.org.
  // 
  // 5. Products  derived from this software may not  be called "Apache", nor may
  //    "Apache" appear  in their name,  without prior written permission  of the
  //    Apache Software Foundation.
  // 
  // THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  // FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
  // APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
  // INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
  // DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
  // OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
  // ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
  // (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
  // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  // 
  // This software  consists of voluntary contributions made  by many individuals
  // on  behalf of the Apache Software  Foundation. For more  information on the 
  // Apache Software Foundation, please see <http://www.apache.org/>.
  // ============================================================================
  
  namespace Apache.Avalon.Castle.ManagementExtensions
  {
  	using System;
  
  	/// <summary>
  	/// Summary description for ManagedObjectNotFoundException.
  	/// </summary>
  	[Serializable]
  	public class ManagedObjectNotFoundException : System.Exception
  	{
  		public ManagedObjectNotFoundException()
  		{
  		}
  
  		public ManagedObjectNotFoundException(String objectName) : base(objectName)
  		{
  		}
  
  		public ManagedObjectNotFoundException(
  			System.Runtime.Serialization.SerializationInfo info, 
  			System.Runtime.Serialization.StreamingContext context) : base(info, context)
  		{
  		}
  	}
  }
  
  
  
  1.1                  avalon-sandbox/avalon-net/Castle/WARNING.txt
  
  Index: WARNING.txt
  ===================================================================
  *****************************  W A R N I N G  **********************************
  
    All user accessible points in this software package are to be considered
    "alpha". This means that the developer team is not investing _any_ effort
    in providing back compatibility between alpha releases.
    
    This software will continue to be released as "alpha" until both code, 
    schemas and APIs will be considered stable.
    
    Until then, there will be no warranty that newer versions will maintain back
    compatibility even in the most simple cases.
    
    On the other hand, once "beta" status is reached, back incompatible changes
    will be made only if absolutely necessary to reach "final" status.
    
    The Avalon development team understands the importance of reliable
    software as well as the importance of protecting user investiments by the
    creation of a solid development platform that doesn't change.
  
    On the other hand, being the Avalon project a pioneer in many fields, this
    cannot be guaranteed before a final status is reached for the software.
    
    Until then, no effort will be provided to guarantee back compatibility.
    
    You have been warned.
  
  *****************************  W A R N I N G  **********************************
  
  
  
  

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