/Aurora/Framework/Modules/IRegionModuleBase.cs

https://bitbucket.org/VirtualReality/software-testing · C# · 101 lines · 16 code · 8 blank · 77 comment · 0 complexity · bfd4b79c4f6078c35a8c84cd312fa96a MD5 · raw file

  1. /*
  2. * Copyright (c) Contributors, http://aurora-sim.org/, http://opensimulator.org/
  3. * See CONTRIBUTORS.TXT for a full list of copyright holders.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of the Aurora-Sim Project nor the
  13. * names of its contributors may be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
  20. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. using System;
  28. using Aurora.Framework.SceneInfo;
  29. using Nini.Config;
  30. namespace Aurora.Framework.Modules
  31. {
  32. public interface IRegionModuleBase
  33. {
  34. /// <value>
  35. /// The name of the module
  36. /// </value>
  37. string Name { get; }
  38. /// <summary>
  39. /// If this returns non-null, it is the type of an interface that
  40. /// this module intends to register.
  41. /// This will cause the loader to defer loading of this module
  42. /// until all other modules have been loaded. If no other module
  43. /// has registered the interface by then, this module will be
  44. /// activated, else it will remain inactive, letting the other module
  45. /// take over. This should return non-null ONLY in modules that are
  46. /// intended to be easily replaceable, e.g. stub implementations
  47. /// that the developer expects to be replaced by third party provided
  48. /// modules.
  49. /// </summary>
  50. Type ReplaceableInterface { get; }
  51. /// <summary>
  52. /// This is called to initialize the region module. For shared modules, this is called
  53. /// exactly once, after creating the single (shared) instance. For non-shared modules,
  54. /// this is called once on each instance, after the instace for the region has been created.
  55. /// </summary>
  56. /// <param name="source">
  57. /// A <see cref="IConfigSource" />
  58. /// </param>
  59. void Initialise(IConfigSource source);
  60. /// <summary>
  61. /// This is called whenever a <see cref="IScene" /> is added. For shared modules, this can happen several times.
  62. /// For non-shared modules, this happens exactly once, after <see cref="Initialise" /> has been called.
  63. /// </summary>
  64. /// <param name="scene">
  65. /// A <see cref="IScene" />
  66. /// </param>
  67. void AddRegion(IScene scene);
  68. /// <summary>
  69. /// This will be called once for every scene loaded. In a shared module
  70. /// this will be multiple times in one instance, while a nonshared
  71. /// module instance will only be called once.
  72. /// This method is called after AddRegion has been called in all
  73. /// modules for that scene, providing an opportunity to request
  74. /// another module's interface, or hook an event from another module.
  75. /// </summary>
  76. /// <param name="scene">
  77. /// A <see cref="IScene" />
  78. /// </param>
  79. void RegionLoaded(IScene scene);
  80. /// <summary>
  81. /// This is called whenever a <see cref="IScene" /> is removed. For shared modules, this can happen several times.
  82. /// For non-shared modules, this happens exactly once, if the scene this instance is associated with is removed.
  83. /// </summary>
  84. /// <param name="scene">
  85. /// A <see cref="IScene" />
  86. /// </param>
  87. void RemoveRegion(IScene scene);
  88. /// <summary>
  89. /// This is the inverse to <see cref="Initialise" />. After a Close(), this instance won't be usable anymore.
  90. /// </summary>
  91. void Close();
  92. }
  93. }