/*********************************************************************/ /* */ /* AgentService Framework */ /* www.agentservice.it */ /* */ /* Copyright (C) 2007 l.i.d.o. - DIST, University of Genoa, Italy */ /* GNU Lesser General Public License */ /* */ /* This library is free software; you can redistribute it and/or */ /* modify it under the terms of the GNU Lesser General Public */ /* License as published by the Free Software Foundation, */ /* version 2.1 of the License. */ /* */ /* This library is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */ /* Lesser General Public License for more details. */ /* */ /* You should have received a copy of the GNU Lesser General Public */ /* License along with this library; if not, write to the */ /* Free Software Foundation, Inc., 59 Temple Place - Suite 330, */ /* Boston, MA 02111-1307, USA. */ /* */ /*********************************************************************/ using System; using System.IO; using System.Reflection; using AgentService.Agent; using AgentService.Agent.Runtime; using AgentService.Platform; using AgentService.Platform.Modules; using AgentService.Platform.Configuration; using AgentService.Platform.Commands; using AgentService.Platform.AMS; using AgentService.Interop; namespace AgentService.Platform { /// //// Interface IPlatform. Defines the contract and the /// API exposed to control the platform instance. /// public interface IPlatform { #region Platform structure constant strings #endregion #region Data Member string amsName { get; } /// /// Name of the MTS agent. /// string mtsName { get; } /// /// Name of the DF agent. /// string dfName { get; } IPlatformDescription Description { get; } /// /// Gets the Yellow Pages Service. /// IYellowPagesServer YellowPageSvc { get; } /// /// Gets the White Pages Service. /// IWhitePagesServer WhitePageSvc { get; } #endregion #region Platform Startup and Configuration /// /// Gets the Platform Configuration Information. /// Configuration.Configuration Configuration { get; } /// /// Gets the platform State. /// PlatformState State { get; } #endregion #region Support Members IPlatformConsole Console { get; } #endregion #region Platform Modules /// /// Gets the Storage Module. /// IStorageModule Storage { get; } /// /// Gets the Messaging Module. /// IMessagingModule Messaging { get; } /// /// Gets the Persistence Module. /// IPersistenceModule Persistence { get; } /// /// Gets the Logging Module. /// ILoggingModule Logging { get; } /// /// Gets the additional modules loaded in the platform. /// IPlatformModule[] Modules { get; } #endregion #region Core Agents References AgentService.Platform.AMS.AMS ams { get; } AgentService.Platform.MTS.IMTSGateway mts { get; } #endregion #region Constructors #endregion #region Platform Control Methods /// /// Installs a module into the AgentService platform /// /// full name of the type that define the module /// path to the assembly where the type is defined /// name of the file to store configuration information /// true if the installation is successful bool InstallModule(ModuleInfo modInfo); /// /// Uninstalls a module from the AgentService platform /// /// full name of the type that implements the module /// true if the assembly need to be removed after uninstall /// true if the uninstallation has been successful bool UninstallModule(string typeName, bool bRemoveAssembly); #endregion #region Worker Private Methods #endregion #region Agent Management Methods /// /// Create an agent with the given agent template, name, and configuration file /// /// name of the agent template /// name of the agent to be created /// name of the configuration file including the path /// persistence flag /// True if the agent is been created, false otherwise AID CreateAgent(string agentTemplate, string agentName, string configFile, bool bPersist); /// /// Create an agent with the given agent template, name, and configuration file /// /// name of the agent template /// name of the agent to be created /// name of the configuration file including the path /// persistence flag /// if true do not perform agent initialization /// domain flag /// True if the agent is been created, false otherwise AID CreateAgent(string agentTemplate, string agentName, string configFile, bool bPersist, bool bCreateForResume, bool bDomain); /// /// Create an agent with the given agent template, name, and configuration file /// /// name of the agent template /// name of the agent to be created /// name of the configuration file including the path /// persistence flag /// if true do not perform agent initialization /// domain flag /// the name of the AppDomain in which the Agent is created /// True if the agent is been created, false otherwise AID CreateAgent(string agentTemplate, string agentName, string configFile, bool bPersist, bool bCreateForResume, bool bDomain, string domainName); /// /// persistence event handler /// /// source of the event /// event args void persistAgent(object sender, PersistenceEventArgs args); /// /// Callback or agent activation /// /// aid of the activted agent void onActivateAgent(AID sender); /// /// Callback for agent termination /// /// aid of the terminated agent void onTerminateAgent(AID sender); #endregion } }