本文整理匯總了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;
}
示例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;
}
示例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;
}
示例4: configure
import securesocial.core.RuntimeEnvironment; //導入依賴的package包/類
@Override
protected void configure() {
MyEnvironment environment = new MyEnvironment();
bind(RuntimeEnvironment.class).toInstance(environment);
}
示例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;
}
示例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;
}