Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/main/java/io/openliberty/guides/startup/StartupDelay.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package io.openliberty.guides.startup;

import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;

@ApplicationScoped
public class StartupDelay {

@PostConstruct
public void delay() {
try {
System.out.println("== STARTUP DELAY: Sleeping for 30 seconds ==");
Thread.sleep(60000); // 30 sec delay
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}
}
10 changes: 10 additions & 0 deletions src/main/java/io/openliberty/sample/system/SystemConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@
@ApplicationScoped
public class SystemConfig {

@PostConstruct
public void delay() {
try {
System.out.println("== STARTUP DELAY: Sleeping for 30 seconds ==");
Thread.sleep(60000); // 30 sec delay
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}

@Inject
@ConfigProperty(name = "io_openliberty_sample_system_inMaintenance")
Provider<Boolean> inMaintenance;
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/META-INF/beans.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd">
</beans>