diff options
author | Thomas Knall <t.knall@datentechnik-innovation.com> | 2015-01-30 10:45:59 +0100 |
---|---|---|
committer | Thomas Knall <t.knall@datentechnik-innovation.com> | 2015-01-30 10:45:59 +0100 |
commit | 373641cfb0e404e89f4d9a011ae53d8b8cfc06c5 (patch) | |
tree | 6aff1a1dba922374c9eb8da2bffd4b2b32494b49 /id/server/idserverlib/src/main | |
parent | 6371e01c520de77b0f37f59c72dbe20fce88c91a (diff) | |
download | moa-id-spss-373641cfb0e404e89f4d9a011ae53d8b8cfc06c5.tar.gz moa-id-spss-373641cfb0e404e89f4d9a011ae53d8b8cfc06c5.tar.bz2 moa-id-spss-373641cfb0e404e89f4d9a011ae53d8b8cfc06c5.zip |
Add dynamic servlet registration for STORK processes.
- Add STORKWebApplicationInitializer.java
- Adjust web.xml
- Move STORK.authmodule.beans.xml to src/main/resources/...
Diffstat (limited to 'id/server/idserverlib/src/main')
-rw-r--r-- | id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/STORKWebApplicationInitializer.java | 37 | ||||
-rw-r--r-- | id/server/idserverlib/src/main/resources/at/gv/egovernment/moa/id/auth/modules/stork/STORK.authmodule.beans.xml (renamed from id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/STORK.authmodule.beans.xml) | 0 |
2 files changed, 37 insertions, 0 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/STORKWebApplicationInitializer.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/STORKWebApplicationInitializer.java new file mode 100644 index 000000000..7478a57c3 --- /dev/null +++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/STORKWebApplicationInitializer.java @@ -0,0 +1,37 @@ +package at.gv.egovernment.moa.id.auth.modules.stork;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRegistration;
+
+import org.springframework.web.WebApplicationInitializer;
+
+import at.gv.egovernment.moa.id.auth.servlet.ProcessEngineSignalServlet;
+
+/**
+ * Spring automatically discovers {@link WebApplicationInitializer} implementations at startup.<br/>
+ * This STORK webapp initializer adds the required servlet mappings:
+ * <ul>
+ * <li>{@code /PEPSConnector}</li>
+ * <li>{@code /PEPSConnectorWithLocalSigning}</li>
+ * </ul>
+ * for the {@linkplain ProcessEngineSignalServlet process engine servlet} (named {@code ProcessEngineSignal}) that wakes
+ * up a process in order to execute asynchronous tasks. Therefore the servlet mappings mentioned above do not need to be
+ * declared in {@code web.xml}.
+ *
+ * @author tknall
+ * @see ProcessEngineSignalServlet
+ */
+public class STORKWebApplicationInitializer implements WebApplicationInitializer {
+
+ @Override
+ public void onStartup(ServletContext servletContext) throws ServletException {
+ ServletRegistration servletRegistration = servletContext.getServletRegistration("ProcessEngineSignal");
+ if (servletRegistration == null) {
+ throw new IllegalStateException("Servlet 'ProcessEngineSignal' expected to be registered.");
+ }
+ servletRegistration.addMapping("/PEPSConnectorWithLocalSigning");
+ servletRegistration.addMapping("/PEPSConnector");
+ }
+
+}
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/STORK.authmodule.beans.xml b/id/server/idserverlib/src/main/resources/at/gv/egovernment/moa/id/auth/modules/stork/STORK.authmodule.beans.xml index 2e924bdd0..2e924bdd0 100644 --- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/auth/modules/stork/STORK.authmodule.beans.xml +++ b/id/server/idserverlib/src/main/resources/at/gv/egovernment/moa/id/auth/modules/stork/STORK.authmodule.beans.xml |