/// <summary>
        /// create a <see cref="StaticHandlerMethodResolver"/> with handling method <paramref name="method"/>
        /// </summary>
        /// <param name="method">the handling method</param>
        public StaticHandlerMethodResolver(MethodInfo method)
        {
            AssertUtils.ArgumentNotNull(method, "method must not be null");
            AssertUtils.ArgumentHasElements(method.GetParameters(), "Message-handling method [" + method + "] must accept at least one parameter.");
            AssertUtils.IsTrue(HandlerMethodUtils.IsValidHandlerMethod(method), "Invalid Message-handling method [" + method + "]");

            _method = method;
        }
 public ChannelPurger(IMessageSelector selector, params IPollableChannel[] channels)
 {
     AssertUtils.ArgumentHasElements(channels, "channel");
     if (channels.Length == 1)
     {
         if (channels[0] == null)
         {
             throw new ArgumentException("channel must not be null");
         }
     }
     _selector = selector;
     _channels = channels;
 }
Beispiel #3
0
 /// <summary>
 /// Creates a new instance of the
 /// <see cref="Spring.Context.Support.XmlApplicationContext"/> class,
 /// loading the definitions from the supplied XML resource locations,
 /// with the given <paramref name="parentContext"/>.
 /// </summary>
 /// <remarks>
 /// This constructor is meant to be used by derived classes. By passing <paramref name="refresh"/>=false, it is
 /// the responsibility of the deriving class to call <see cref="AbstractApplicationContext.Refresh()"/> to initialize the context instance.
 /// </remarks>
 /// <param name="refresh">if true, <see cref="AbstractApplicationContext.Refresh()"/> is called automatically.</param>
 /// <param name="name">The application context name.</param>
 /// <param name="caseSensitive">Flag specifying whether to make this context case sensitive or not.</param>
 /// <param name="parentContext">
 /// The parent context (may be <see langword="null"/>).
 /// </param>
 /// <param name="configurationLocations">
 /// Any number of XML based object definition resource locations.
 /// </param>
 public XmlApplicationContext(
     bool refresh,
     string name,
     bool caseSensitive,
     IApplicationContext parentContext,
     params string[] configurationLocations)
     : base(name, caseSensitive, parentContext)
 {
     _configurationLocations = configurationLocations;
     if (refresh)
     {
         AssertUtils.ArgumentHasElements(configurationLocations, "configurationLocations");
         Refresh();
     }
 }
Beispiel #4
0
 public void ArgumentHasElementsArgumentContainsNonNullsOnly()
 {
     AssertUtils.ArgumentHasElements(new object[] { new object(), new object(), new object() }, "foo");
 }
Beispiel #5
0
 public void ArgumentHasElementsArgumentIsEmpty()
 {
     AssertUtils.ArgumentHasElements(new object[0], "foo");
 }
Beispiel #6
0
 public void ArgumentHasElementsArgumentIsNull()
 {
     AssertUtils.ArgumentHasElements(null, "foo");
 }