當前位置: 首頁>>代碼示例>>Java>>正文


Java RuntimeEnvironment類代碼示例

本文整理匯總了Java中securesocial.core.RuntimeEnvironment的典型用法代碼示例。如果您正苦於以下問題:Java RuntimeEnvironment類的具體用法?Java RuntimeEnvironment怎麽用?Java RuntimeEnvironment使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


RuntimeEnvironment類屬於securesocial.core包,在下文中一共展示了RuntimeEnvironment類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getControllerInstance

import securesocial.core.RuntimeEnvironment; //導入依賴的package包/類
@Override
public <A> A getControllerInstance(Class<A> controllerClass) throws Exception {
    A result = (A) instances.get(controllerClass.getName());
    Logger.debug("result = " + result);
    if ( result == null ) {
        Logger.debug("creating controller: " + controllerClass.getName());
        try {
            result = controllerClass.getDeclaredConstructor(RuntimeEnvironment.class).newInstance(env);
        } catch (NoSuchMethodException e) {
            // the controller does not receive a RuntimeEnvironment, delegate creation to base class.
            result = super.getControllerInstance(controllerClass);
        }
        instances.put(controllerClass.getName(), result);
    }
    return result;
}
 
開發者ID:janih,項目名稱:play-java-securesocial,代碼行數:17,代碼來源:Global.java

示例2: getControllerInstance

import securesocial.core.RuntimeEnvironment; //導入依賴的package包/類
@Override
public <A> A getControllerInstance(Class<A> controllerClass) throws Exception {
    A result = (A) instances.get(controllerClass.getName());
    Logger.debug("result = " + result);
    if (result == null) {
        Logger.debug("creating controller: " + controllerClass.getName());
        try {
            result = controllerClass.getDeclaredConstructor(RuntimeEnvironment.class).newInstance(env);
        } catch (NoSuchMethodException e) {
            // the controller does not receive a RuntimeEnvironment, delegate creation to base class.
            result = super.getControllerInstance(controllerClass);
        }
        instances.put(controllerClass.getName(),result);
    }
    return result;
}
 
開發者ID:boaglio,項目名稱:play2-casadocodigo,代碼行數:17,代碼來源:Global.java

示例3: getControllerInstance

import securesocial.core.RuntimeEnvironment; //導入依賴的package包/類
@Override
public <A> A getControllerInstance(Class<A> controllerClass) throws Exception {
    A result;
    
    try {
        result = controllerClass.getDeclaredConstructor(RuntimeEnvironment.class).newInstance(env);
    } catch (NoSuchMethodException e) {
        // the controller does not receive a RuntimeEnvironment, delegate creation to base class.
        result = super.getControllerInstance(controllerClass);
    }
    return result;
}
 
開發者ID:play2-maven-plugin,項目名稱:play2-maven-test-projects,代碼行數:13,代碼來源:Global.java

示例4: configure

import securesocial.core.RuntimeEnvironment; //導入依賴的package包/類
@Override
protected void configure() {
    MyEnvironment environment = new MyEnvironment();
    bind(RuntimeEnvironment.class).toInstance(environment);
}
 
開發者ID:play2-maven-plugin,項目名稱:play2-maven-test-projects,代碼行數:6,代碼來源:DemoModule.java

示例5: Application

import securesocial.core.RuntimeEnvironment; //導入依賴的package包/類
/**
 * A constructor needed to get a hold of the environment instance.
 * This could be injected using a DI framework instead too.
 *
 * @param env
 */
public Application(RuntimeEnvironment<DemoUser> env) {
    this.env = env;
}
 
開發者ID:play2-maven-plugin,項目名稱:play2-maven-test-projects,代碼行數:10,代碼來源:Application.java

示例6: Application

import securesocial.core.RuntimeEnvironment; //導入依賴的package包/類
/**
 * A constructor needed to get a hold of the environment instance.
 * This could be injected using a DI framework instead too.
 *
 * @param env
 */
@Inject()
public Application (RuntimeEnvironment env) {
    this.env = env;
}
 
開發者ID:play2-maven-plugin,項目名稱:play2-maven-test-projects,代碼行數:11,代碼來源:Application.java


注:本文中的securesocial.core.RuntimeEnvironment類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。