This repository has been archived by the owner on Jan 8, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 174
/
Global.java
98 lines (83 loc) · 2.86 KB
/
Global.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
* Copyright 2013 TORCH GmbH
*
* This file is part of Graylog2.
*
* Graylog2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Graylog2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Graylog2. If not, see <http://www.gnu.org/licenses/>.
*/
import play.Application;
import play.Configuration;
import play.GlobalSettings;
import play.api.mvc.EssentialFilter;
import play.api.mvc.Handler;
import play.libs.F;
import play.mvc.Action;
import play.mvc.Http;
import play.mvc.SimpleResult;
import java.io.File;
import java.lang.reflect.Method;
/**
* This class is simply delegating to the real class {@see lib.Global},
* to avoid having to configure the exact name in the application.conf
* which is lost when a user overrides the config file location with -Dconfig.file etc.
*/
@SuppressWarnings("unused")
public class Global extends GlobalSettings {
private final lib.Global global = new lib.Global();
@Override
public void onStart(Application app) {
global.onStart(app);
}
@Override
public void onStop(Application app) {
global.onStop(app);
}
@Override
public Configuration onLoadConfig(Configuration configuration, File file, ClassLoader classLoader) {
return global.onLoadConfig(configuration, file, classLoader);
}
@Override
public <A> A getControllerInstance(Class<A> controllerClass) throws Exception {
return global.getControllerInstance(controllerClass);
}
@Override
public Handler onRouteRequest(Http.RequestHeader request) {
return global.onRouteRequest(request);
}
@Override
public Action onRequest(Http.Request request, Method actionMethod) {
return global.onRequest(request, actionMethod);
}
@Override
public F.Promise<SimpleResult> onHandlerNotFound(Http.RequestHeader request) {
return global.onHandlerNotFound(request);
}
@Override
public F.Promise<SimpleResult> onError(Http.RequestHeader request, Throwable t) {
return global.onError(request, t);
}
@Override
public F.Promise<SimpleResult> onBadRequest(Http.RequestHeader request, String error) {
return global.onBadRequest(request, error);
}
@Override
public void beforeStart(Application app) {
global.beforeStart(app);
}
@Override
@SuppressWarnings("unchecked")
public <T extends EssentialFilter> Class<T>[] filters() {
return global.filters();
}
}