Введение в Мобильные Агенты
Предыдущий | Следующий
MAF IDL
Итак, имеется три типа взаимодействия с (между) агентами:
- создание удаленного агента
- перемещение агентов
- вызов метода у агента
В функции агентской системы входит:
- перемещение агентов, который может включать в себя посылку агента, получение агента или пересылку классов
- создание агента
- обеспечение уникального имени каждому агенту и его местоположению
- поддержка сущности Регион
- поиск мобильных агентов
- обеспечение безопасности при выполнении агентами операций
В MAF описывается два интерфейса: MAFAgentSystem и MAFFinder. Интерфейс MAFAgentSystem описывает такие операции с агентами как создание, удаление и управление, а MAFFinder описывает операции для регистрации и поиска агентов, мест и агентских систем.
Интерфейс MAFFinder представляет собой аналог naming-сервиса. Каждый регион имеет свой собственный MAFFinder.Для получения ссылки на MAFFinder клиент может воспользоваться как стандартными средствами (например CORBA Naming Service), так и методом AgentSystem.get_MAFFinder().

Рисунок 5. Два региона
Name, Class Name и Location
typedef short AgentSystemType;
typedef sequence OctetString;
struct ClassName {
string name;
OctetString descriminator;
};
typedef sequence ClassNameList;
typedef sequence OctetStrings;
typedef OctetString Authority;
typedef OctetString Identity;
struct Name {
Authority auhtority;
Identity identity;
AgentSystemType agent_system_type;
};
typedef sequence NameList;
typedef string Location;
OMG Naming Authority Identifiers
typedef short LanguageID;
typedef short AgentSystemType;
typedef short Authenticator;
typedef short SerializationID;
typedef sequence SerializationIDList;
enum AgentStatus {
CfMAFRunning, CfMAFSuspended, CfMAFTerminated
};
typedef any Property;
typedef sequence PropertyList;
struct LanguageMap {
LanguageID language_id;
SerializationIDList serializations;
};
typedef sequence LanguageMapList;
struct AgentSystemInfo {
Name system_name;
AgentSystemType system_type;
LanguageMapList language_maps;
string system_description;
short major_version;
short minor_version;
PropertyList properties;
};
struct AuthInfo {
boolean is_auth;
Authenticator authenticator;
};
struct AgentProfile {
LanguageID language_id;
AgentSystemtype agent_system_type;
string agent_system_description;
short major_version;
short minor_version;
SerializationID serializations;
PropertyList properties;
};
Интерфейс MAFAgentSystem
interface MAFAgentSystem {
Name create_agent(
in Name agent_name,
in AgentProfile agent_profile,
in OctetString agent,
in string place_name,
in Arguments arguments,
in ClassNameList class_names,
in string code_base,
in MAFAgentSystem class_provider) raises (ClassUnknown,
ArgumentInvalid, DeserializationFailed, MAFExtendedException);
OctetStrings fetch_class(in ClassNameList class_name_list, in string code_base,
in AgentProfile agent_profile) raised (ClassUnknown, MAFExtendedException);
Location find_nearby_agent_system_of_profile(in AgentProfile profile)
raises (EntryNotFound);
AgentStatus get_agent_status(in Name agent_name) raises (AgentNotFound);
AgentSystemInfo get_agent_system_info();
AuthInfo get_authinfo(in Name agent_name) raises (AgentNotFound);
MAFFinder get_MAFFinder() raises (FinderNotFound);
NameList list_all_agents();
NameList list_all_agents_of_authority(in Authority authority);
Locations list_all_places();
void receice_agent(
in Name agent_name,
in AgentProfile agent_profile,
in OctetString agent,
in string place_name,
in ClassNameList class_names,
in string code_base,
in MAFAgentSystem agent_sender) raises (ClassUnknown,
DeserializationFailed, MAFExtendedException);
void resume_agent(in Name agent_name) raises (AgentNotFound, ResumeFailed,
AgentIsRunning);
void suspend_agent(in Name agent_name) raises (AgentNotFound, SuspendFailed,
AgentIsSuspended);
void terminate_agent(in Name agent_name) raises (AgentNotFound, TerminateFailed);
void terminate_agent_system() raises (TerminationFailed);
};
Интерфейс MAFFinder
interface MAFFinder {
void register_agent(
in Name agent_name,
in Location agent_location,
in AgentProfile agent_profile) raises (NameInvalid);
void register_agent_system(
in Name agent_system_name,
in Location agent_location,
in AgentSystemInfo agent_system_info) raises (NameInvalid);
void register_place(
in string place_name,
in Location place)location) raises (NameInvalid);
Locations lookup_agent(
in Name agent_name,
in AgentProfile agent_profile) raises (EntryNotFound);
Locations lookup_agent_system(
in Name agent_system_name,
in AgentSystemInfo agent_system_info) raises (EntryNotFound);
Location lookup_place(in string place_name) raises (EntryNotFound);
void unregister_agent(in Name agent_name) raises (EntryNotFound);
void unregister_agent_system(in Name agent_system_name) raises (EntryNotFound);
void unregister_place(in string place_name) raises (EntryNotFound);
};
Литература
[1] CORBA Facilities: Mobile Agents System Interoperability Fascilities Submission , OMG document 98-03-09.
[2] William T. Cockayne, Michael Zydd, Mobile Agents , Manning Publication Co., 1998.
Предыдущий | Следующий




Узнай о чем ты на самом деле сейчас думаешь

