/*********************************************************************/
/* */
/* 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.Collections.Generic;
using AgentService.Agent;
using AgentService.Agent.Runtime;
using AgentService.Platform.MTS;
namespace AgentService.Platform.DF
{
///
/// Class DFTemplate. Defines the specific tasks performed by the Directory Facilitator agent.
///
[AgentService.Agent.AgentKnowledges(typeof(DFKnowledge))]
public class DFTemplate : AgentService.Agent.AgentTemplate
{
///
/// Initializes the agent before starting up.
///
/// reference to the context for the istantiation of new knowledge and behaviour objects
public override void Initiate(IFactoryContext factoryContext)
{
factoryContext.CreateKnowledge(typeof(DFKnowledge),"DefaultDFKnowledge",Agent.Knowledge.PersistenceMode.StrongPersistent);
}
///
/// Resumes the agent on Platform restart.
///
/// reference to the context for the registration of new knowledge and behaviour types
/// reference to the context for the istantiation of new knowledge and behaviour objects
public override void Resume(ITypeContext typeContext, IFactoryContext factoryContext)
{
}
///
/// Finalizes Agent before termination.
///
public override void Terminate()
{
}
///
/// Handles an incoming conversation. Called by the agent runtime when a
/// conversation request occurs. AgentTemplate types that want to receive a
/// conversation need to redefine this method.
/// By default the conversation request is refused.
///
/// information about the incoming conversation
/// the context that received the conversation request
public override void HandleConversation(IAgentContext sender, ConversationArgs args)
{
args.Conversation.Reject();
args.Conversation.Close();
}
}
}