You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _versions/main/guides/cdi-integration.adoc
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -486,6 +486,21 @@ if (foo.getHandle().getBean().isActive()) {
486
486
}
487
487
----
488
488
489
+
If you want to consume only active beans, you can inject an `InjectableInstance<>` and call `getActive()` to get the single instance or `listActive()` to get all instances:
Copy file name to clipboardExpand all lines: _versions/main/guides/websockets-next-reference.adoc
+69Lines changed: 69 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -640,6 +640,40 @@ class MyBean {
640
640
There are also other convenient methods.
641
641
For example, `OpenConnections#findByEndpointId(String)` makes it easy to find connections for a specific endpoint.
642
642
643
+
==== User data
644
+
645
+
It is also possible to associate arbitrary user data with a specific connection.
646
+
The `io.quarkus.websockets.next.UserData` object obtained by the `WebSocketConnection#userData()` method represents mutable user data associated with a connection.
if (connection.userData().get(TypedKey.forBoolean("isCool"))) { <2>
667
+
return "Cool message processed!";
668
+
} else {
669
+
return "Message processed!";
670
+
}
671
+
}
672
+
}
673
+
----
674
+
<1> `CoolService#isCool()` returns `Boolean` that is associated with the current connection.
675
+
<2> The `TypedKey.forBoolean("isCool")` is the key used to obtain the data stored when the connection was created.
676
+
643
677
[[server-cdi-events]]
644
678
==== CDI events
645
679
@@ -997,6 +1031,41 @@ class MyBean {
997
1031
There are also other convenient methods.
998
1032
For example, `OpenClientConnections#findByClientId(String)` makes it easy to find connections for a specific endpoint.
999
1033
1034
+
==== User data
1035
+
1036
+
It is also possible to associate arbitrary user data with a specific connection.
1037
+
The `io.quarkus.websockets.next.UserData` object obtained by the `WebSocketClientConnection#userData()` method represents mutable user data associated with a connection.
0 commit comments