Interface aglet.AgletContext
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface aglet.AgletContext

public interface AgletContext
extends Object
AgletContextインターフェースはagletが実行環境の情報を得るためや, 実行環境や他のアクティブなagletに対して メッセージを送ったりするのに用いられる. このインターフェースは, 悪意のあるagletから守られたホストシステムの 実行環境の保守や管理を提供する.

Method Index

 o activateAglet(AgletID)
agletを活性化(activate)する.
 o addContextListener(ContextListener)
指定されたcontext listenerをこのコンテキストに追加登録する.
 o createAglet(URL, String, Object)
指定されたクラスのagletを生成する.
 o getAgletProxies()
Gets an enumeration of all aglets in the current context including deactivated aglets.
 o getAgletProxies(int)
コンテキスト内で特定の状態にあるagletのproxyを返す.
 o getAgletProxy(AgletID)
コンテキスト内の特定のIDのagletを返す.
 o getAgletProxy(URL, AgletID)
リモートコンテキスト内の特定のIDのagletのproxyを返す.
 o getAudioClip(URL)
音声クリップを得る.
 o getHostingURL()
このコンテキストをサーブしているデーモンのURLを返す.
 o getImage(ImageData)
イメージデータを得ます。これは一時的な解決
 o getImage(URL)
イメージを得る.
 o getImageData(URL)
イメージデータを得ます。これは一時的な解決
 o getName()
コンテキストの名前を返す.
 o getProperty(String)
指定された名前(key)のコンテキストプロパティを返す.
 o getProperty(String, Object)
指定された名前(key)とコンテキストプロパティを返す.
 o multicastMessage(Message)
コンテキストにサブスクライブをかけているagletに対して, メッセージをマルチキャストする.
 o removeContextListener(ContextListener)
指定されたcontext listenerをこのコンテキストから取り外す.
 o retractAglet(URL)
URL(atp://host-domain-name/#aglet-identity) で指定されたagletを撤収(retract)する.
 o retractAglet(URL, AgletID)
URLとIDで指定されたagletを撤収(retract)する.
 o setProperty(String, Object)
名前(key)で指定されるコンテキストプロパティの値を設定する.
 o showDocument(URL)
新たなdocumentを表示する.
 o shutdown()
コンテキストをshutdownする.
 o shutdown(Message)
コンテキストをshutdownする.
 o start()
コンテキストの実行を開始する.

Methods

 o getName
  public abstract String getName()
コンテキストの名前を返す.
Returns:
コンテキストの名前.
 o getAgletProxies
  public abstract Enumeration getAgletProxies()
Gets an enumeration of all aglets in the current context including deactivated aglets. This will be changed so that it returns an array of proxies.
Returns:
a list of proxies.
 o getAgletProxies
  public abstract AgletProxy[] getAgletProxies(int type)
コンテキスト内で特定の状態にあるagletのproxyを返す.
Parameters:
type - アグレットの状態(ACTIVEかINACTIVEかACTIVE | INACTIVE).
Returns:
proxyのリスト
See Also:
ACTIVE, INACTIVE
 o getAgletProxy
  public abstract AgletProxy getAgletProxy(AgletID id)
コンテキスト内の特定のIDのagletを返す.
Parameters:
id - agletのID
Returns:
the proxy.
 o getAgletProxy
  public abstract AgletProxy getAgletProxy(URL host,
                                           AgletID id)
リモートコンテキスト内の特定のIDのagletのproxyを返す. リモートコンテキストはそのURLによって指定する.
Parameters:
identity - agletのID
Returns:
the proxy.
 o createAglet
  public abstract AgletProxy createAglet(URL codeBase,
                                         String code,
                                         Object init) throws IOException, AgletException, ClassNotFoundException, InstantiationException
指定されたクラスのagletを生成する. クラスのcodeファイルはリモートにあっても良い. もしcodeBasenullだった場合, コンテキストは codeファイルをローカルシステムのAGLET_PATHで指定された ファイルシステムから探し出す. メソッドcreateAgletは3つの引数(codeBase, code, init)をとる.
  1. codeBase agletのclassファイルのbaseとなるURLを指定する. 言い換えるならば, これはおそらくリモートにあるagletのコードがある ディレクトリである. もしcodeBasenullの場合, ローカルホストで指定されたagletのコード探索パスを探索する. agletのコード探索パスは, いわばJavaのクラスパスのようなものである. 一般的にはこれは環境変数であり, agletのcodeファイルを探索するパスの リストである.
  2. code agletのコンパイルされたclass codeを含む ファイルの名前. このファイルはagletのbaseとなるURLからの相対パスで あり, 絶対パスで指定することはできない.
  3. init agletのonCreationメソッドを呼び出す際に渡される オブジェクト.
Parameters:
codeBase - agletのclassファイルのbase URL.
code - agletのclassファイルの名前.
init - 初期化引数.
Returns:
新たなagletのproxy
Throws: UnknownHostException
if the given host could not be found.
Throws: ServerNotFoundException
if the server could not be found.
Throws: InstantiationException
if the instantiation failed.
Throws: ClassNotFoundException
if the class not found.
See Also:
onCreation
 o retractAglet
  public abstract AgletProxy retractAglet(URL url) throws IOException, AgletException
URL(atp://host-domain-name/#aglet-identity) で指定されたagletを撤収(retract)する.
Parameters:
url - the location and aglet identity of the aglet to be retracted.
Returns:
the aglet proxy for the retracted aglet.
Throws: UnknownHostException
if the specified HOST is not found.
Throws: ServerNotFoundException
if the aglet server specified in the URL is not available.
Throws: MalformedURLException
if the given url is not URI for an aglet.
Throws: RequestRefusedException
if the retraction refused.
Throws: AgletNotFoundException
if the aglet could not be found.
 o retractAglet
  public abstract AgletProxy retractAglet(URL url,
                                          AgletID aid) throws IOException, AgletException
URLとIDで指定されたagletを撤収(retract)する.
Parameters:
url - the location of the aglet to be retracted.
id - the aglet identity of the aglet to be retracted.
Returns:
the aglet proxy for the retracted aglet.
Throws: UnknownHostException
if the specified HOST is not found.
Throws: ServerNotFoundException
if the aglet server specified in the URL is not available.
Throws: MalformedURLException
if the given url is not URI for an aglet.
Throws: RequestRefusedException
if the retraction refused.
Throws: AgletNotFoundException
if the aglet could not be found.
 o activateAglet
  public abstract AgletProxy activateAglet(AgletID aid) throws IOException, AgletException
agletを活性化(activate)する. 非活性化(deactivate)されたagletを強制的に活性化する.
Parameters:
aid - aglet identifier.
Returns:
proxy of the activated aglet.
Throws: AgletNotFoundException
if the aglet could not be found.
 o multicastMessage
  public abstract ReplySet multicastMessage(Message msg)
コンテキストにサブスクライブをかけているagletに対して, メッセージをマルチキャストする.
Parameters:
message - 送るメッセージ.
Returns:
FutureReplyを含むReplySet.
 o getHostingURL
  public abstract URL getHostingURL()
このコンテキストをサーブしているデーモンのURLを返す.
Returns:
デーモンのURL. ホストの情報が得られない場合はnull.
 o showDocument
  public abstract void showDocument(URL url)
新たなdocumentを表示する. コンテキストには無視される.
Parameters:
url - 表示するURL.
 o getProperty
  public abstract Object getProperty(String key)
指定された名前(key)のコンテキストプロパティを返す.
Parameters:
key - コンテキストプロパティの名前.
Returns:
プロパティの値.
 o getProperty
  public abstract Object getProperty(String key,
                                     Object def)
指定された名前(key)とコンテキストプロパティを返す.
Parameters:
key - コンテキストプロパティの名前.
def - プロパティが設定されていない場合に返すデフォルト値
Returns:
プロパティの値.
 o setProperty
  public abstract void setProperty(String key,
                                   Object value)
名前(key)で指定されるコンテキストプロパティの値を設定する.
Parameters:
key - コンテキストプロパティの名前.
value - プロパティに設定する値.
Returns:
プロパティの値.
 o getImage
  public abstract Image getImage(URL image)
イメージを得る.
 o getAudioClip
  public abstract AudioClip getAudioClip(URL audio)
音声クリップを得る.
 o getImageData
  public abstract ImageData getImageData(URL image)
イメージデータを得ます。これは一時的な解決法です。
 o getImage
  public abstract Image getImage(ImageData image)
イメージデータを得ます。これは一時的な解決法です。
 o addContextListener
  public abstract void addContextListener(ContextListener listener)
指定されたcontext listenerをこのコンテキストに追加登録する.
Parameters:
listener - the context listener
 o removeContextListener
  public abstract void removeContextListener(ContextListener listener)
指定されたcontext listenerをこのコンテキストから取り外す.
Parameters:
listener - the context listener
 o start
  public abstract void start()
コンテキストの実行を開始する. すでに実行が始まっていた場合には無視される.
 o shutdown
  public abstract void shutdown(Message msg)
コンテキストをshutdownする. shutdownの前には指定されたメッセージオブジェクト がコンテキスト内のすべてのagletに(killされる前に)送られる. すでにコンテキストが停止していた場合には無視される.
Throws: SecurityException
カレントコンテキストのshutdownは許されていない.
See Also:
start
 o shutdown
  public abstract void shutdown()
コンテキストをshutdownする. すでにコンテキストが停止していた場合には無視される.
Throws: SecurityException
カレントコンテキストのshutdownは許されていない.
See Also:
start

All Packages  Class Hierarchy  This Package  Previous  Next  Index