📄 agent.java
字号:
/* * $Source: /home/data/cvsroot/src/jacomma/platform/core/Agent.java,v $ * $Revision: 1.7 $ * $Date: 2000/10/28 20:09:07 $ * * This file is part of the jacomma framework * Copyright (c) 2000 Dimitrios Vyzovitis * mailto:dviz@egnatia.ee.auth.gr * * * * * * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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 Library General Public License for more details. * * You should have received a copy of the GNU Library 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 */package jacomma.platform.core;import jacomma.icm.type.Handle;import jacomma.icm.type.Message;import jacomma.util.Visitor;import java.util.Iterator;import java.util.List;import java.util.Collection;import java.util.Map;import java.util.Set;import java.util.Date;import java.net.InetAddress;import java.util.Collection;/** * TBA **/public interface Agent { public Handle getHandle(); public Object setProperty( Object key, Object val ); public Object getProperty( Object key ); public Object clearProperty( Object key ); public java.util.Map properties(); public Thread spawnThread( Runnable rb ); public void register( ) // to local comm-server throws RequestFailedException; public void register( Date lt ) // to local comm-server throws RequestFailedException; public void register( InetAddress to ) throws RequestFailedException; public void register( InetAddress to, Date lt ) throws RequestFailedException; public void deregister( ) // from all throws RequestFailedException; public void deregister( InetAddress from ) throws RequestFailedException; public void detach() // from all throws RequestFailedException; public void detach( InetAddress from ) throws RequestFailedException; public void attach() // to all throws RequestFailedException; public void attach( InetAddress to ) throws RequestFailedException; public void attach( Date lt ) // to all throws RequestFailedException; public void attach( InetAddress to, Date lt ) throws RequestFailedException; public void destroy() throws RequestFailedException; public void reqFwd( Handle to ) // rq from local comm-server throws RequestFailedException; public void reqFwd( InetAddress from, Handle to ) throws RequestFailedException; public void cancelFwd( Handle to ) // rq from local comm-server throws RequestFailedException; public void cancelFwd( InetAddress from, Handle to ) throws RequestFailedException; public int getRegisterCount(); // clones public Collection commServers(); public Collection attachedCommServers(); public Map forwards(); // Message management public Object accept( Visitor v ) throws InterruptedException; public Object try_accept( Visitor v ); public Message recv() throws InterruptedException; public Message recv( MessagePattern ptrn ) throws InterruptedException; public Message try_recv( ); public Message try_recv( MessagePattern ptrn ); public void send( Message msg ) throws java.io.IOException; public void send( Handle to, Object cnt ) throws java.io.IOException; public void send( Collection to, Object cnt ) throws java.io.IOException; public Message sendAndWait( Handle to, Object cnt, MessagePattern ptrn ) throws java.io.IOException, InterruptedException; public Message sendAndWait( Message msg, MessagePattern ptrn ) throws java.io.IOException, InterruptedException; // Message handlers for the agent (reactive behavior) public void registerHandler( MessagePattern ptrn, MessageHandler hdlr ); public void unregisterHandler( MessagePattern ptrn, MessageHandler hdlr ); public void unregisterHandler( MessageHandler hdlr ); // quick handler reset public void addHandlers( Map map ); public Map setHandlers( Map map ); public Map clearHandlers(); /** * @return a clone of the MessagePattern-MessageHandler mapping that the agent * maintins **/ public Map handlers(); public interface MessageHandler extends java.io.Serializable { public void onMessage( Agent container, Message msg ); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -