/*********************************************************************/ /* */ /* 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.Reflection; using AgentService.Platform; namespace AgentService.Agent.Runtime { /// /// Class DefaultRuntime. Implements the interface IRuntimeEx. /// public class DefaultRuntimeProxy : AgentService.Agent.Runtime.IRuntimeEx { private IRuntimeEx runtime; /// /// Messaging Service (Sends, retrieves messages and conversation management). /// public IMsgClient MessageSvc { get { return this.runtime.MessageSvc; } } /// /// Persistence Service (Persists and resumes Knowledge objects). /// public IPersistenceClient PersistenceSvc { get { return this.runtime.PersistenceSvc; } } /// /// Logging Service (Gives access to the agent logging subsystem). /// public ILogClient LogSvc { get { return this.runtime.LogSvc; } } /// /// Yellow Pages Service (Searches agent's aid by service). /// public IYellowPagesClient YPageSvc { get { return this.runtime.YPageSvc; } } /// /// White Pages Service (Searches agent's aid by name). /// public IWhitePagesClient WPageSvc { get { return this.runtime.WPageSvc; } } /// /// Mobility Service (Move the agent to a remote platform) /// public IMobilityClient MobilitySvc { get { return this.runtime.MobilitySvc; } } /// /// Gets a reference to the Platform Console. /// public ConsoleProxy Console { get { return this.runtime.Console; } } // CHANGE 30/01/2006: added the support for the mobility Services // parameter and assignation /// /// Constructs a DefaultRuntime object with the given components. /// /// client of the messagin system. /// client of the persistence system. /// client of the logging system. /// yellow page service. /// white page service. /// platform console public DefaultRuntimeProxy(AgentService.Agent.IAgent agent, IMsgClient msgClient, IPersistenceClient prsClient, ILogClient logClient, IYellowPagesClient ypClient, IWhitePagesClient wpClient, IMobilityClient mobClient, ConsoleProxy platformConsole) { this.runtime = new DefaultRuntime(agent, msgClient, prsClient, logClient, ypClient, wpClient, mobClient, platformConsole); } /// /// Constructor used for cloning. /// /// private DefaultRuntimeProxy() { // we do not have to do anything // since all the fields will be // set up in the Clone method } // CHANGE 30/01/2006: added the support for the mobility Services // assignation /// /// Gives a Runtime object for a new behaviour instance. /// /// behaviour that will host the runtime /// a Runtime object bound to the new behaviour public IRuntime Clone(Behaviour.Behaviour behaviour) { return this.runtime.Clone(behaviour); } /// /// Gets a reference to the IBehaviourContext interface. /// public IBehaviourContext Context { get { return this.runtime.Context; } } } }