Skip to content

Commit f3f8c8b

Browse files
committed
deploy: 0d460a5
1 parent fb21c13 commit f3f8c8b

File tree

4 files changed

+113
-5
lines changed

4 files changed

+113
-5
lines changed

feed.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>Quarkus</title>
66
<link>https://quarkus.io</link>
77
<description>Quarkus: Supersonic Subatomic Java</description>
8-
<lastBuildDate>Fri, 11 Oct 2024 03:07:19 +0000</lastBuildDate>
8+
<lastBuildDate>Sat, 12 Oct 2024 03:06:03 +0000</lastBuildDate>
99

1010

1111
<item>

version/main/guides/cdi-integration.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -999,6 +999,22 @@ <h3 id="inactive-synthetic-beans"><a class="anchor" href="#inactive-synthetic-be
999999
}</code></pre>
10001000
</div>
10011001
</div>
1002+
<div class="paragraph">
1003+
<p>If you want to consume only active beans, you can inject an <code>InjectableInstance&lt;&gt;</code> and call <code>getActive()</code> to get the single instance or <code>listActive()</code> to get all instances:</p>
1004+
</div>
1005+
<div class="listingblock">
1006+
<div class="content">
1007+
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">import io.quarkus.arc.InjectableInstance;
1008+
1009+
@Inject
1010+
@Any
1011+
InjectableInstance&lt;Foo&gt; foos;
1012+
1013+
for (Foo foo : foos.listActive())
1014+
...
1015+
}</code></pre>
1016+
</div>
1017+
</div>
10021018
</div>
10031019
</div>
10041020
</div>

version/main/guides/websockets-next-reference.html

Lines changed: 94 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,53 @@ <h4 id="list-open-connections"><a class="anchor" href="#list-open-connections"><
12021202
</div>
12031203
</div>
12041204
<div class="sect3">
1205-
<h4 id="server-cdi-events"><a class="anchor" href="#server-cdi-events"></a>6.3.2. CDI events</h4>
1205+
<h4 id="user-data"><a class="anchor" href="#user-data"></a>6.3.2. User data</h4>
1206+
<div class="paragraph">
1207+
<p>It is also possible to associate arbitrary user data with a specific connection.
1208+
The <code>io.quarkus.websockets.next.UserData</code> object obtained by the <code>WebSocketConnection#userData()</code> method represents mutable user data associated with a connection.</p>
1209+
</div>
1210+
<div class="listingblock">
1211+
<div class="content">
1212+
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">import io.quarkus.websockets.next.WebSocketConnection;
1213+
import io.quarkus.websockets.next.UserData.TypedKey;
1214+
1215+
@WebSocket(path = "/endpoint/{username}")
1216+
class MyEndpoint {
1217+
1218+
@Inject
1219+
CoolService service;
1220+
1221+
@OnOpen
1222+
void open(WebSocketConnection connection) {
1223+
connection.userData().put(TypedKey.forBoolean("isCool"), service.isCool(connection.pathParam("username"))); <i class="conum" data-value="1"></i><b>(1)</b>
1224+
}
1225+
1226+
@OnTextMessage
1227+
String process(String message) {
1228+
if (connection.userData().get(TypedKey.forBoolean("isCool"))) { <i class="conum" data-value="2"></i><b>(2)</b>
1229+
return "Cool message processed!";
1230+
} else {
1231+
return "Message processed!";
1232+
}
1233+
}
1234+
}</code></pre>
1235+
</div>
1236+
</div>
1237+
<div class="colist arabic">
1238+
<table>
1239+
<tr>
1240+
<td><i class="conum" data-value="1"></i><b>1</b></td>
1241+
<td><code>CoolService#isCool()</code> returns <code>Boolean</code> that is associated with the current connection.</td>
1242+
</tr>
1243+
<tr>
1244+
<td><i class="conum" data-value="2"></i><b>2</b></td>
1245+
<td>The <code>TypedKey.forBoolean("isCool")</code> is the key used to obtain the data stored when the connection was created.</td>
1246+
</tr>
1247+
</table>
1248+
</div>
1249+
</div>
1250+
<div class="sect3">
1251+
<h4 id="server-cdi-events"><a class="anchor" href="#server-cdi-events"></a>6.3.3. CDI events</h4>
12061252
<div class="paragraph">
12071253
<p>Quarkus fires a CDI event of type <code>io.quarkus.websockets.next.WebSocketConnection</code> with qualifier <code>@io.quarkus.websockets.next.Open</code> asynchronously when a new connection is opened.
12081254
Moreover, a CDI event of type <code>WebSocketConnection</code> with qualifier <code>@io.quarkus.websockets.next.Closed</code> is fired asynchronously when a connection is closed.</p>
@@ -1724,7 +1770,53 @@ <h4 id="list-open-client-connections"><a class="anchor" href="#list-open-client-
17241770
</div>
17251771
</div>
17261772
<div class="sect3">
1727-
<h4 id="client-cdi-events"><a class="anchor" href="#client-cdi-events"></a>7.2.2. CDI events</h4>
1773+
<h4 id="user-data-2"><a class="anchor" href="#user-data-2"></a>7.2.2. User data</h4>
1774+
<div class="paragraph">
1775+
<p>It is also possible to associate arbitrary user data with a specific connection.
1776+
The <code>io.quarkus.websockets.next.UserData</code> object obtained by the <code>WebSocketClientConnection#userData()</code> method represents mutable user data associated with a connection.</p>
1777+
</div>
1778+
<div class="listingblock">
1779+
<div class="content">
1780+
<pre class="highlightjs highlight"><code class="language-java hljs" data-lang="java">import io.quarkus.websockets.next.WebSocketClientConnection;
1781+
import io.quarkus.websockets.next.UserData.TypedKey;
1782+
1783+
@WebSocketClient(path = "/endpoint/{username}")
1784+
class MyEndpoint {
1785+
1786+
@Inject
1787+
CoolService service;
1788+
1789+
@OnOpen
1790+
void open(WebSocketClientConnection connection) {
1791+
connection.userData().put(TypedKey.forBoolean("isCool"), service.isCool(connection.pathParam("username"))); <i class="conum" data-value="1"></i><b>(1)</b>
1792+
}
1793+
1794+
@OnTextMessage
1795+
String process(String message) {
1796+
if (connection.userData().get(TypedKey.forBoolean("isCool"))) { <i class="conum" data-value="2"></i><b>(2)</b>
1797+
return "Cool message processed!";
1798+
} else {
1799+
return "Message processed!";
1800+
}
1801+
}
1802+
}</code></pre>
1803+
</div>
1804+
</div>
1805+
<div class="colist arabic">
1806+
<table>
1807+
<tr>
1808+
<td><i class="conum" data-value="1"></i><b>1</b></td>
1809+
<td><code>CoolService#isCool()</code> returns <code>Boolean</code> that is associated with the current connection.</td>
1810+
</tr>
1811+
<tr>
1812+
<td><i class="conum" data-value="2"></i><b>2</b></td>
1813+
<td>The <code>TypedKey.forBoolean("isCool")</code> is the key used to obtain the data stored when the connection was created.</td>
1814+
</tr>
1815+
</table>
1816+
</div>
1817+
</div>
1818+
<div class="sect3">
1819+
<h4 id="client-cdi-events"><a class="anchor" href="#client-cdi-events"></a>7.2.3. CDI events</h4>
17281820
<div class="paragraph">
17291821
<p>Quarkus fires a CDI event of type <code>io.quarkus.websockets.next.WebSocketClientConnection</code> with qualifier <code>@io.quarkus.websockets.next.Open</code> asynchronously when a new connection is opened.
17301822
Moreover, a CDI event of type <code>WebSocketClientConnection</code> with qualifier <code>@io.quarkus.websockets.next.Closed</code> is fired asynchronously when a connection is closed.</p>

working-groups/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ <h3 class="mb-0">Organizing the community around a specific topics or goals.</h3
163163
<div class="card-body">
164164
<p class="card-text"><span class="key">Status:</span>&nbsp;<span class="status on-track">on track</span></p>
165165
<p class="card-text"><span class="key">Description:</span>&nbsp;<span class="short-description">Allow Static Site Generation with Quarkus.</span></p>
166-
<p class="card-text"><span class="key">Last Activity:</span>&nbsp;<span class="last-activity">October 10, 2024 </span></p>
166+
<p class="card-text"><span class="key">Last Activity:</span>&nbsp;<span class="last-activity">October 11, 2024 </span></p>
167167
</div>
168168
<div class="card-footer">
169169
<a href="https://github.com/orgs/quarkiverse/projects/6" class="float-end"> View the Roq :: Quarkus SSG Board <i class="fa-solid fa-chevron-right"></i></a>
@@ -179,7 +179,7 @@ <h3 class="mb-0">Organizing the community around a specific topics or goals.</h3
179179
<div class="card-body">
180180
<p class="card-text"><span class="key">Status:</span>&nbsp;<span class="status on-track">on track</span></p>
181181
<p class="card-text"><span class="key">Description:</span>&nbsp;<span class="short-description">WebSocket-Next related tasks</span></p>
182-
<p class="card-text"><span class="key">Last Activity:</span>&nbsp;<span class="last-activity">October 10, 2024 </span></p>
182+
<p class="card-text"><span class="key">Last Activity:</span>&nbsp;<span class="last-activity">October 11, 2024 </span></p>
183183
</div>
184184
<div class="card-footer">
185185
<a href="https://github.com/orgs/quarkusio/projects/26" class="float-end"> View the WebSocket Next Board <i class="fa-solid fa-chevron-right"></i></a>

0 commit comments

Comments
 (0)