Commit ccc08545d7dfb379445848c4ec0da99a5cbcf600
1 parent
9a81b653
Fixed SchedulerBean Skeleton.
Showing
5 changed files
with
37 additions
and
16 deletions
BeuthBot.ipr
@@ -631,6 +631,9 @@ | @@ -631,6 +631,9 @@ | ||
631 | <element id="library" level="project" name="Gradle: org.jboss.spec.javax.servlet:jboss-servlet-api_3.1_spec:1.0.0.Final" /> | 631 | <element id="library" level="project" name="Gradle: org.jboss.spec.javax.servlet:jboss-servlet-api_3.1_spec:1.0.0.Final" /> |
632 | <element id="library" level="project" name="Gradle: javax.el:javax.el-api:3.0.0" /> | 632 | <element id="library" level="project" name="Gradle: javax.el:javax.el-api:3.0.0" /> |
633 | <element id="library" level="project" name="Gradle: javax.interceptor:javax.interceptor-api:1.2" /> | 633 | <element id="library" level="project" name="Gradle: javax.interceptor:javax.interceptor-api:1.2" /> |
634 | + <element id="library" level="project" name="Gradle: org.apache.httpcomponents:httpclient:4.5.3" /> | ||
635 | + <element id="library" level="project" name="Gradle: org.apache.httpcomponents:httpmime:4.3.1" /> | ||
636 | + <element id="library" level="project" name="Gradle: org.apache.httpcomponents:httpcore:4.4.6" /> | ||
634 | </element> | 637 | </element> |
635 | </element> | 638 | </element> |
636 | </root> | 639 | </root> |
services/Scheduler/Scheduler_main.iml
@@ -19,6 +19,10 @@ | @@ -19,6 +19,10 @@ | ||
19 | <orderEntry type="inheritedJdk" /> | 19 | <orderEntry type="inheritedJdk" /> |
20 | <orderEntry type="sourceFolder" forTests="false" /> | 20 | <orderEntry type="sourceFolder" forTests="false" /> |
21 | <orderEntry type="module" module-name="Common_main" /> | 21 | <orderEntry type="module" module-name="Common_main" /> |
22 | + <orderEntry type="library" scope="PROVIDED" name="Gradle: org.apache.httpcomponents:httpclient:4.5.2" level="project" /> | ||
23 | + <orderEntry type="library" scope="PROVIDED" name="Gradle: org.apache.httpcomponents:httpcore:4.4.4" level="project" /> | ||
24 | + <orderEntry type="library" name="Gradle: org.apache.httpcomponents:httpclient:4.5.3" level="project" /> | ||
25 | + <orderEntry type="library" name="Gradle: org.apache.httpcomponents:httpmime:4.3.1" level="project" /> | ||
22 | <orderEntry type="library" scope="PROVIDED" name="Gradle: org.slf4j:slf4j-api:1.7.25" level="project" /> | 26 | <orderEntry type="library" scope="PROVIDED" name="Gradle: org.slf4j:slf4j-api:1.7.25" level="project" /> |
23 | <orderEntry type="library" scope="PROVIDED" name="Gradle: org.jboss.resteasy:resteasy-client:3.1.3.Final" level="project" /> | 27 | <orderEntry type="library" scope="PROVIDED" name="Gradle: org.jboss.resteasy:resteasy-client:3.1.3.Final" level="project" /> |
24 | <orderEntry type="library" name="Gradle: com.google.code.gson:gson:2.8.1" level="project" /> | 28 | <orderEntry type="library" name="Gradle: com.google.code.gson:gson:2.8.1" level="project" /> |
@@ -49,16 +53,15 @@ | @@ -49,16 +53,15 @@ | ||
49 | <orderEntry type="library" name="Gradle: org.jboss.spec.javax.xml.bind:jboss-jaxb-api_2.2_spec:1.0.4.Final" level="project" /> | 53 | <orderEntry type="library" name="Gradle: org.jboss.spec.javax.xml.bind:jboss-jaxb-api_2.2_spec:1.0.4.Final" level="project" /> |
50 | <orderEntry type="library" name="Gradle: org.jboss.spec.javax.xml.soap:jboss-saaj-api_1.3_spec:1.0.3.Final" level="project" /> | 54 | <orderEntry type="library" name="Gradle: org.jboss.spec.javax.xml.soap:jboss-saaj-api_1.3_spec:1.0.3.Final" level="project" /> |
51 | <orderEntry type="library" name="Gradle: org.jboss.spec.javax.xml.ws:jboss-jaxws-api_2.2_spec:2.0.3.Final" level="project" /> | 55 | <orderEntry type="library" name="Gradle: org.jboss.spec.javax.xml.ws:jboss-jaxws-api_2.2_spec:2.0.3.Final" level="project" /> |
56 | + <orderEntry type="library" name="Gradle: org.apache.httpcomponents:httpcore:4.4.6" level="project" /> | ||
57 | + <orderEntry type="library" scope="PROVIDED" name="Gradle: commons-logging:commons-logging:1.2" level="project" /> | ||
58 | + <orderEntry type="library" scope="PROVIDED" name="Gradle: commons-codec:commons-codec:1.9" level="project" /> | ||
52 | <orderEntry type="library" scope="PROVIDED" name="Gradle: org.jboss.resteasy:resteasy-jaxrs:3.1.3.Final" level="project" /> | 59 | <orderEntry type="library" scope="PROVIDED" name="Gradle: org.jboss.resteasy:resteasy-jaxrs:3.1.3.Final" level="project" /> |
53 | <orderEntry type="library" scope="PROVIDED" name="Gradle: org.jboss.resteasy:resteasy-jaxrs-services:3.1.3.Final" level="project" /> | 60 | <orderEntry type="library" scope="PROVIDED" name="Gradle: org.jboss.resteasy:resteasy-jaxrs-services:3.1.3.Final" level="project" /> |
54 | <orderEntry type="library" scope="PROVIDED" name="Gradle: org.jboss.logging:jboss-logging:3.3.0.Final" level="project" /> | 61 | <orderEntry type="library" scope="PROVIDED" name="Gradle: org.jboss.logging:jboss-logging:3.3.0.Final" level="project" /> |
55 | - <orderEntry type="library" scope="PROVIDED" name="Gradle: org.apache.httpcomponents:httpclient:4.5.2" level="project" /> | ||
56 | <orderEntry type="library" name="Gradle: org.jboss.spec.javax.servlet:jboss-servlet-api_3.1_spec:1.0.0.Final" level="project" /> | 62 | <orderEntry type="library" name="Gradle: org.jboss.spec.javax.servlet:jboss-servlet-api_3.1_spec:1.0.0.Final" level="project" /> |
57 | <orderEntry type="library" scope="PROVIDED" name="Gradle: commons-io:commons-io:2.5" level="project" /> | 63 | <orderEntry type="library" scope="PROVIDED" name="Gradle: commons-io:commons-io:2.5" level="project" /> |
58 | <orderEntry type="library" scope="PROVIDED" name="Gradle: net.jcip:jcip-annotations:1.0" level="project" /> | 64 | <orderEntry type="library" scope="PROVIDED" name="Gradle: net.jcip:jcip-annotations:1.0" level="project" /> |
59 | - <orderEntry type="library" scope="PROVIDED" name="Gradle: org.apache.httpcomponents:httpcore:4.4.4" level="project" /> | ||
60 | - <orderEntry type="library" scope="PROVIDED" name="Gradle: commons-logging:commons-logging:1.2" level="project" /> | ||
61 | - <orderEntry type="library" scope="PROVIDED" name="Gradle: commons-codec:commons-codec:1.9" level="project" /> | ||
62 | <orderEntry type="library" name="Gradle: javax.el:javax.el-api:3.0.0" level="project" /> | 65 | <orderEntry type="library" name="Gradle: javax.el:javax.el-api:3.0.0" level="project" /> |
63 | <orderEntry type="library" name="Gradle: javax.interceptor:javax.interceptor-api:1.2" level="project" /> | 66 | <orderEntry type="library" name="Gradle: javax.interceptor:javax.interceptor-api:1.2" level="project" /> |
64 | </component> | 67 | </component> |
services/Scheduler/Scheduler_test.iml
@@ -10,7 +10,11 @@ | @@ -10,7 +10,11 @@ | ||
10 | <orderEntry type="inheritedJdk" /> | 10 | <orderEntry type="inheritedJdk" /> |
11 | <orderEntry type="sourceFolder" forTests="false" /> | 11 | <orderEntry type="sourceFolder" forTests="false" /> |
12 | <orderEntry type="module" module-name="Scheduler_main" /> | 12 | <orderEntry type="module" module-name="Scheduler_main" /> |
13 | + <orderEntry type="library" scope="PROVIDED" name="Gradle: org.apache.httpcomponents:httpclient:4.5.2" level="project" /> | ||
14 | + <orderEntry type="library" scope="PROVIDED" name="Gradle: org.apache.httpcomponents:httpcore:4.4.4" level="project" /> | ||
13 | <orderEntry type="module" module-name="Common_main" /> | 15 | <orderEntry type="module" module-name="Common_main" /> |
16 | + <orderEntry type="library" name="Gradle: org.apache.httpcomponents:httpclient:4.5.3" level="project" /> | ||
17 | + <orderEntry type="library" name="Gradle: org.apache.httpcomponents:httpmime:4.3.1" level="project" /> | ||
14 | <orderEntry type="library" name="Gradle: org.slf4j:slf4j-api:1.7.25" level="project" /> | 18 | <orderEntry type="library" name="Gradle: org.slf4j:slf4j-api:1.7.25" level="project" /> |
15 | <orderEntry type="library" name="Gradle: org.jboss.resteasy:resteasy-client:3.1.3.Final" level="project" /> | 19 | <orderEntry type="library" name="Gradle: org.jboss.resteasy:resteasy-client:3.1.3.Final" level="project" /> |
16 | <orderEntry type="library" name="Gradle: com.google.code.gson:gson:2.8.1" level="project" /> | 20 | <orderEntry type="library" name="Gradle: com.google.code.gson:gson:2.8.1" level="project" /> |
@@ -41,16 +45,15 @@ | @@ -41,16 +45,15 @@ | ||
41 | <orderEntry type="library" name="Gradle: org.jboss.spec.javax.xml.bind:jboss-jaxb-api_2.2_spec:1.0.4.Final" level="project" /> | 45 | <orderEntry type="library" name="Gradle: org.jboss.spec.javax.xml.bind:jboss-jaxb-api_2.2_spec:1.0.4.Final" level="project" /> |
42 | <orderEntry type="library" name="Gradle: org.jboss.spec.javax.xml.soap:jboss-saaj-api_1.3_spec:1.0.3.Final" level="project" /> | 46 | <orderEntry type="library" name="Gradle: org.jboss.spec.javax.xml.soap:jboss-saaj-api_1.3_spec:1.0.3.Final" level="project" /> |
43 | <orderEntry type="library" name="Gradle: org.jboss.spec.javax.xml.ws:jboss-jaxws-api_2.2_spec:2.0.3.Final" level="project" /> | 47 | <orderEntry type="library" name="Gradle: org.jboss.spec.javax.xml.ws:jboss-jaxws-api_2.2_spec:2.0.3.Final" level="project" /> |
48 | + <orderEntry type="library" name="Gradle: org.apache.httpcomponents:httpcore:4.4.6" level="project" /> | ||
49 | + <orderEntry type="library" name="Gradle: commons-logging:commons-logging:1.2" level="project" /> | ||
50 | + <orderEntry type="library" name="Gradle: commons-codec:commons-codec:1.9" level="project" /> | ||
44 | <orderEntry type="library" name="Gradle: org.jboss.resteasy:resteasy-jaxrs:3.1.3.Final" level="project" /> | 51 | <orderEntry type="library" name="Gradle: org.jboss.resteasy:resteasy-jaxrs:3.1.3.Final" level="project" /> |
45 | <orderEntry type="library" name="Gradle: org.jboss.resteasy:resteasy-jaxrs-services:3.1.3.Final" level="project" /> | 52 | <orderEntry type="library" name="Gradle: org.jboss.resteasy:resteasy-jaxrs-services:3.1.3.Final" level="project" /> |
46 | <orderEntry type="library" name="Gradle: org.jboss.logging:jboss-logging:3.3.0.Final" level="project" /> | 53 | <orderEntry type="library" name="Gradle: org.jboss.logging:jboss-logging:3.3.0.Final" level="project" /> |
47 | - <orderEntry type="library" name="Gradle: org.apache.httpcomponents:httpclient:4.5.2" level="project" /> | ||
48 | <orderEntry type="library" name="Gradle: org.jboss.spec.javax.servlet:jboss-servlet-api_3.1_spec:1.0.0.Final" level="project" /> | 54 | <orderEntry type="library" name="Gradle: org.jboss.spec.javax.servlet:jboss-servlet-api_3.1_spec:1.0.0.Final" level="project" /> |
49 | <orderEntry type="library" name="Gradle: commons-io:commons-io:2.5" level="project" /> | 55 | <orderEntry type="library" name="Gradle: commons-io:commons-io:2.5" level="project" /> |
50 | <orderEntry type="library" name="Gradle: net.jcip:jcip-annotations:1.0" level="project" /> | 56 | <orderEntry type="library" name="Gradle: net.jcip:jcip-annotations:1.0" level="project" /> |
51 | - <orderEntry type="library" name="Gradle: org.apache.httpcomponents:httpcore:4.4.4" level="project" /> | ||
52 | - <orderEntry type="library" name="Gradle: commons-logging:commons-logging:1.2" level="project" /> | ||
53 | - <orderEntry type="library" name="Gradle: commons-codec:commons-codec:1.9" level="project" /> | ||
54 | <orderEntry type="library" name="Gradle: javax.el:javax.el-api:3.0.0" level="project" /> | 57 | <orderEntry type="library" name="Gradle: javax.el:javax.el-api:3.0.0" level="project" /> |
55 | <orderEntry type="library" name="Gradle: javax.interceptor:javax.interceptor-api:1.2" level="project" /> | 58 | <orderEntry type="library" name="Gradle: javax.interceptor:javax.interceptor-api:1.2" level="project" /> |
56 | </component> | 59 | </component> |
services/Scheduler/src/main/java/de/bht/beuthbot/scheduler/JAXActivator.java
0 → 100755
1 | +package de.bht.beuthbot.scheduler; | ||
2 | + | ||
3 | +import javax.ws.rs.ApplicationPath; | ||
4 | +import javax.ws.rs.core.Application; | ||
5 | + | ||
6 | +/** | ||
7 | + * JAXActivator is an arbitrary name, what is important is that javax.ws.rs.core.Application is extended | ||
8 | + * and the @ApplicationPath annotation is used with a "rest" path. Without this the rest routes linked to | ||
9 | + * from index.html would not be found. | ||
10 | + */ | ||
11 | +@ApplicationPath("") | ||
12 | +public class JAXActivator extends Application { | ||
13 | + // Left empty intentionally | ||
14 | +} |
services/Scheduler/src/main/java/de/bht/beuthbot/scheduler/SchedulerBean.java
@@ -14,14 +14,13 @@ import de.bht.beuthbot.jms.TaskMessage; | @@ -14,14 +14,13 @@ import de.bht.beuthbot.jms.TaskMessage; | ||
14 | import java.util.*; | 14 | import java.util.*; |
15 | import javax.annotation.PostConstruct; | 15 | import javax.annotation.PostConstruct; |
16 | import javax.annotation.Resource; | 16 | import javax.annotation.Resource; |
17 | -import javax.ejb.Singleton; | ||
18 | -import javax.ejb.Schedule; | ||
19 | -import javax.ejb.Stateless; | ||
20 | -import javax.ejb.Timeout; | 17 | +import javax.ejb.*; |
21 | import javax.ejb.Timer; | 18 | import javax.ejb.Timer; |
22 | -import javax.ejb.TimerService; | 19 | +import javax.ws.rs.GET; |
20 | +import javax.ws.rs.Path; | ||
23 | 21 | ||
24 | @Singleton | 22 | @Singleton |
23 | +@Startup | ||
25 | public class SchedulerBean { | 24 | public class SchedulerBean { |
26 | /** | 25 | /** |
27 | * slf4j Logger | 26 | * slf4j Logger |
@@ -48,11 +47,10 @@ public class SchedulerBean { | @@ -48,11 +47,10 @@ public class SchedulerBean { | ||
48 | //CONSTRUCTOR | 47 | //CONSTRUCTOR |
49 | @PostConstruct | 48 | @PostConstruct |
50 | public void init(){ | 49 | public void init(){ |
51 | - | 50 | + logger.debug("SchedulerBean initiated!"); |
52 | } | 51 | } |
53 | 52 | ||
54 | - | ||
55 | - @Schedule(minute="*") | 53 | + @Schedule(hour="*", minute="*") |
56 | public void fetchReminders() { | 54 | public void fetchReminders() { |
57 | //TODO: Establish DB connection and retrieve list of reminders | 55 | //TODO: Establish DB connection and retrieve list of reminders |
58 | logger.debug("SchedulerBean fired!"); | 56 | logger.debug("SchedulerBean fired!"); |