Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dependency on spring-boot-starter-web #10

Merged
merged 4 commits into from
Mar 2, 2016
Merged
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
5 changes: 0 additions & 5 deletions mesos-starter-sample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@
<artifactId>spring-boot-starter</artifactId>
<version>1.3.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>1.3.2.RELEASE</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>spring-boot-starter-mesos</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import org.apache.mesos.SchedulerDriver;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.embedded.EmbeddedServletContainerInitializedEvent;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationListener;

Expand All @@ -25,7 +25,7 @@
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Supplier;

public class UniversalScheduler implements Scheduler, ApplicationListener<EmbeddedServletContainerInitializedEvent> {
public class UniversalScheduler implements Scheduler, ApplicationListener<ApplicationReadyEvent> {
protected final Log logger = LogFactory.getLog(getClass());

@Value("${mesos.master}")
Expand Down Expand Up @@ -57,7 +57,7 @@ public class UniversalScheduler implements Scheduler, ApplicationListener<Embedd
protected AtomicReference<SchedulerDriver> driver = new AtomicReference<>();

@Override
public void onApplicationEvent(EmbeddedServletContainerInitializedEvent event) {
public void onApplicationEvent(ApplicationReadyEvent event) {
start();
}

Expand All @@ -77,6 +77,8 @@ public void start() {
throw new IllegalStateException("Driver already initialised");
}
driver.start();

new Thread(driver::join).start();
}

@PreDestroy
Expand Down