-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Daniel Kec <[email protected]>
- Loading branch information
Showing
7 changed files
with
36 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
core-server/src/main/java/org/glassfish/jersey/server/model/internal/SseTypeResolver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.glassfish.jersey.server.model.internal; | ||
|
||
import java.util.Collections; | ||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
public class SseTypeResolver { | ||
|
||
private static final Set<Class<?>> SUPPORTED_SSE_SINK_TYPES; | ||
|
||
static { | ||
Set<Class<?>> set = new HashSet<>(8); | ||
|
||
set.add(org.glassfish.jersey.internal.jsr166.Flow.Subscriber.class); | ||
set.add(javax.ws.rs.sse.SseEventSink.class); | ||
try { | ||
Class<?> clazz = Class.forName("java.util.concurrent.Flow.Subscriber"); | ||
set.add(clazz); | ||
} catch (ClassNotFoundException e) { | ||
// Not java 9+ | ||
} | ||
SUPPORTED_SSE_SINK_TYPES = Collections.unmodifiableSet(set); | ||
} | ||
|
||
public static boolean isSseSinkParam(Class<?> type) { | ||
return SUPPORTED_SSE_SINK_TYPES.contains(type); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters