org.zuena.guiceex
クラス InjectorFactory

java.lang.Object
  上位を拡張 org.zuena.guiceex.InjectorFactory

public class InjectorFactory
extends Object

GuiceexInjectorインスタンスのファクトリクラスです。 作成したGuiceexInjectorインスタンスの管理をアプリケーションで行う場合は createInjector(Object[])を使用し、InjectorFactoryによって管理する場合は getInjector(Object[])を使用します。後者のメソッドは、GuiceexInjectorインスタンス をInjectorFactorystaticフィールドに配置して管理するシングルトン ファクトリメソッドです。

導入されたバージョン:
0.9.1

メソッドの概要
static void close()
          管理しているGuiceexInjectorインスタンスを終了します。
static GuiceexInjector createInjector(Object... configs)
          Guice.createInjector(Module[])を使用してインスタンスを作成します。
static GuiceexInjector getInjector(Object... configs)
          createInjector(Object...)で作成したGuiceexInjectorインスタンスを、 staticフィールドに配置して管理するシングルトンファクトリメソッドです。
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

メソッドの詳細

createInjector

public static GuiceexInjector createInjector(Object... configs)
                                      throws ConfigurationException,
                                             BindException
Guice.createInjector(Module[])を使用してインスタンスを作成します。 引数configsは、Moduleインスタンス及び(又は)guceex-cfg.xml ファイルへのクラスパスを表す文字列である必要があります。

パラメータ:
configs - Moduleインスタンス及び(又は)guceex-cfg.xml ファイルへのクラスパスを表す文字列。もしくはそれらを含むObject型の配列。
戻り値:
GuiceexInjectorインスタンス
例外:
ConfigurationException - guceex-cfg.xmlの読み込みエラー時にスローされる。
BindException - バインディングエラー時にスローされる。

getInjector

public static GuiceexInjector getInjector(Object... configs)
                                   throws ConfigurationException,
                                          BindException
createInjector(Object...)で作成したGuiceexInjectorインスタンスを、 staticフィールドに配置して管理するシングルトンファクトリメソッドです。

例外:
ConfigurationException
BindException
関連項目:
createInjector(Object...)

close

public static void close()
管理しているGuiceexInjectorインスタンスを終了します。



Copyright © 2007 zuena.org AllRights Reserved.