本文整理了Java中play.Application.getWrappedApplication()
方法的一些代码示例,展示了Application.getWrappedApplication()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Application.getWrappedApplication()
方法的具体详情如下:
包路径:play.Application
类名称:Application
方法名:getWrappedApplication
[英]Get the underlying Scala application.
[中]获取底层Scala应用程序。
代码示例来源:origin: com.typesafe.play/play-test_2.10
/**
* Starts a new application.
*/
public static void start(Application application) {
play.api.Play.start(application.getWrappedApplication());
}
代码示例来源:origin: com.typesafe.play/play-test_2.10
/**
* Stops an application.
*/
public static void stop(Application application) {
play.api.Play.stop(application.getWrappedApplication());
}
代码示例来源:origin: com.typesafe.play/play-test_2.10
/**
* A test Netty web server with HTTPS support
* @param port HTTP port to bind on
* @param application The Application to load in this server
* @param sslPort HTTPS port to bind on
*/
public TestServer(int port, Application application, int sslPort) {
super(port, application.getWrappedApplication(), Option.<Object>apply(sslPort), play.libs.Scala.<ServerProvider>None());
}
代码示例来源:origin: com.typesafe.play/play-test_2.10
/**
* A test Netty web server.
*
* @param port HTTP port to bind on.
* @param application The Application to load in this server.
*/
public TestServer(int port, Application application) {
super(port, application.getWrappedApplication(), play.libs.Scala.<Object>None(), play.libs.Scala.<ServerProvider>None());
}
代码示例来源:origin: com.typesafe.play/play-test_2.10
@Deprecated
public static Result route(Application app, RequestBuilder requestBuilder, byte[] body, long timeout) {
return wrapScalaResult(Scala.orNull(play.api.test.Helpers.jRoute(app.getWrappedApplication(), requestBuilder.build()._underlyingRequest(), body)), timeout);
}
代码示例来源:origin: com.typesafe.play/play-test_2.10
@SuppressWarnings("unchecked")
public static Result route(Application app, RequestBuilder requestBuilder, long timeout) {
final scala.Option<scala.concurrent.Future<play.api.mvc.Result>> opt = play.api.test.Helpers.jRoute(
app.getWrappedApplication(), requestBuilder.build()._underlyingRequest(), requestBuilder.bodyAsAnyContent());
return wrapScalaResult(Scala.orNull(opt), timeout);
}
代码示例来源:origin: com.typesafe.play/play_2.10
/**
* Get a file relative to the application root path.
*
* @param relativePath relative path of the file to fetch
* @return a file instance - it is not guaranteed that the file exists
*/
default File getFile(String relativePath) {
return getWrappedApplication().getFile(relativePath);
}
代码示例来源:origin: com.typesafe.play/play_2.10
/**
* Get the application path.
*
* @return the application path
*/
default File path() {
return getWrappedApplication().path();
}
代码示例来源:origin: com.typesafe.play/play_2.10
/**
* Check whether the application is in {@link Mode#DEV} mode.
*
* @return true if the application is in DEV mode
*/
default boolean isDev() {
return play.api.Play.isDev(getWrappedApplication());
}
代码示例来源:origin: com.typesafe.play/play_2.10
/**
* Check whether the application is in {@link Mode#PROD} mode.
*
* @return true if the application is in PROD mode
*/
default boolean isProd() {
return play.api.Play.isProd(getWrappedApplication());
}
代码示例来源:origin: com.typesafe.play/play_2.10
/**
* Get the application classloader.
*
* @return the application classloader
*/
default ClassLoader classloader() {
return getWrappedApplication().classloader();
}
代码示例来源:origin: com.typesafe.play/play_2.10
/**
* Check whether the application is in {@link Mode#TEST} mode.
*
* @return true if the application is in TEST mode
*/
default boolean isTest() {
return play.api.Play.isTest(getWrappedApplication());
}
代码示例来源:origin: com.typesafe.play/play_2.10
/**
* Get a resource from the classpath.
*
* @param relativePath relative path of the resource to fetch
* @return URL to the resource (may be null)
*/
default URL resource(String relativePath) {
return Scala.orNull(getWrappedApplication().resource(relativePath));
}
代码示例来源:origin: com.typesafe.play/play_2.10
/**
* Get the {@link play.Plugin} instance for the given class.
*
* @param pluginClass the Class of the plugin
* @return an instance of the plugin (if found, otherwise null)
*/
default <T> T plugin(Class<T> pluginClass) {
return Scala.orNull(getWrappedApplication().plugin(pluginClass));
}
代码示例来源:origin: com.typesafe.play/play_2.10
/**
* Get a resource stream from the classpath.
*
* @param relativePath relative path of the resource to fetch
* @return InputStream to the resource (may be null)
*/
default InputStream resourceAsStream(String relativePath) {
return Scala.orNull(getWrappedApplication().resourceAsStream(relativePath));
}
代码示例来源:origin: uk.gov.hmrc/microservice-bootstrap-java
default void onStop(play.Application app) {
onStop(app.getWrappedApplication());
}
代码示例来源:origin: uk.gov.hmrc/microservice-bootstrap-java
default void onStart(play.Application app) {
onStart(app.getWrappedApplication());
}
代码示例来源:origin: play/play-test
public static Result route(Application app, FakeRequest fakeRequest) {
final scala.Option<play.api.mvc.Result> opt = play.api.test.Helpers.jRoute(app.getWrappedApplication(), fakeRequest.fake);
final play.api.mvc.Result r = opt.getOrElse(null);
if(r != null){
return new Result() {
public play.api.mvc.Result getWrappedResult(){
return r;
}
};
}
return null;
}
代码示例来源:origin: uk.gov.hmrc/microservice-bootstrap-java
@Override
public void onStop(Application app) {
super.onStop(app);
if (graphiteConfig != null) {
graphiteConfig.onStop(app.getWrappedApplication());
}
}
代码示例来源:origin: play/play-test
public static <T> Result route(Application app, FakeRequest fakeRequest, byte[] body) {
final play.api.mvc.Result r = play.api.test.Helpers.jRoute(app.getWrappedApplication(), fakeRequest.getWrappedRequest(), body).getOrElse(null);
if(r != null){
return new Result() {
public play.api.mvc.Result getWrappedResult(){
return r;
}
};
}
return null;
}
内容来源于网络,如有侵权,请联系作者删除!