Skip to content

Commit

Permalink
Add first implementations of new JAX-RS 3.1 APIs
Browse files Browse the repository at this point in the history
(cherry picked from commit 9134fa8)
(cherry picked from commit 7bfb03f)
  • Loading branch information
geoand authored and gsmet committed Sep 28, 2022
1 parent 3e7b6d5 commit a4c161e
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
import java.util.Date;
import java.util.Locale;
import java.util.ServiceLoader;
import java.util.concurrent.CompletionStage;

import jakarta.ws.rs.SeBootstrap;
import jakarta.ws.rs.core.Application;
import jakarta.ws.rs.core.CacheControl;
import jakarta.ws.rs.core.Cookie;
import jakarta.ws.rs.core.EntityPart;
import jakarta.ws.rs.core.EntityTag;
import jakarta.ws.rs.core.Link;
import jakarta.ws.rs.core.MediaType;
Expand Down Expand Up @@ -115,4 +118,30 @@ public <T> HeaderDelegate<T> createHeaderDelegate(Class<T> type) throws IllegalA
public Link.Builder createLinkBuilder() {
return new LinkBuilderImpl();
}

@Override
public SeBootstrap.Configuration.Builder createConfigurationBuilder() {
// RR does not implement currently implement the bootstrapping API
throw new UnsupportedOperationException("Pending implementation");
}

@Override
public CompletionStage<SeBootstrap.Instance> bootstrap(Application application,
SeBootstrap.Configuration configuration) {
// RR does not implement currently implement the bootstrapping API
throw new UnsupportedOperationException("Pending implementation");
}

@Override
public CompletionStage<SeBootstrap.Instance> bootstrap(Class<? extends Application> aClass,
SeBootstrap.Configuration configuration) {
// RR does not implement currently implement the bootstrapping API
throw new UnsupportedOperationException("Pending implementation");
}

@Override
public EntityPart.Builder createEntityPartBuilder(String s) throws IllegalArgumentException {
// TODO: figure out how to implement this
throw new UnsupportedOperationException("Pending implementation");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,20 @@ private void checkClosed() {
}

@Override
public synchronized void close() {
public void close() {
close(true);
}

@Override
public synchronized void close(boolean cascading) {
if (isClosed)
return;
isClosed = true;
for (SseEventSink sink : sinks) {
// this will in turn fire close events to our listeners
sink.close();
if (cascading) {
for (SseEventSink sink : sinks) {
// this will in turn fire close events to our listeners
sink.close();
}
}
}

Expand Down

0 comments on commit a4c161e

Please sign in to comment.