1 // Copyright 2004-2007 Castle Project - http://www.castleproject.org/
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle
.MonoRail
.Framework
20 /// Represents an binary tree of registered controllers.
22 /// It is used by the controller factory to resolve a controller instance
23 /// based on the specified area (which is optional) and controller name
25 /// <seealso cref="Castle.MonoRail.Framework.Services.AbstractControllerFactory"/>
27 public interface IControllerTree
30 /// Register a controller on the tree. If the specified
31 /// area name matches the current node, the controller is
32 /// register on the node itself, otherwise on the right or
36 /// Note that the controller is an <c>object</c>. That allows
37 /// different implementation of a controller factory to register
38 /// different representation of what a controller is (a name, a descriptor etc)
40 /// <param name="areaName">The area name, or <c>String.Empty</c></param>
41 /// <param name="controllerName">The controller name</param>
42 /// <param name="controller">The controller representation</param>
43 void AddController(String areaName
, String controllerName
, Type controller
);
46 /// Returns a controller previously registered.
48 /// <param name="areaName">The area name, or <c>String.Empty</c></param>
49 /// <param name="controllerName">The controller name</param>
50 /// <returns>The controller representation or null</returns>
51 Type
GetController(String areaName
, String controllerName
);