File tree Expand file tree Collapse file tree
microprofile/websocket/src/main/java/io/helidon/microprofile/tyrus
grpc/src/main/java/io/helidon/webserver/grpc
webserver/src/main/java/io/helidon/webserver
websocket/src/main/java/io/helidon/webserver/websocket Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2022, 2023 Oracle and/or its affiliates.
2+ * Copyright (c) 2022, 2024 Oracle and/or its affiliates.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -42,6 +42,11 @@ private TyrusRouting(Builder builder) {
4242 this .extensions = builder .extensions ;
4343 }
4444
45+ @ Override
46+ public Class <? extends Routing > routingType () {
47+ return TyrusRouting .class ;
48+ }
49+
4550 /**
4651 * Builder for WebSocket routing.
4752 *
Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2022, 2023 Oracle and/or its affiliates.
2+ * Copyright (c) 2022, 2024 Oracle and/or its affiliates.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -42,6 +42,11 @@ private GrpcRouting(Builder builder) {
4242 this .routes = new ArrayList <>(builder .routes );
4343 }
4444
45+ @ Override
46+ public Class <? extends Routing > routingType () {
47+ return GrpcRouting .class ;
48+ }
49+
4550 /**
4651 * New routing builder.
4752 *
Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2022, 2023 Oracle and/or its affiliates.
2+ * Copyright (c) 2022, 2024 Oracle and/or its affiliates.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -30,7 +30,7 @@ private RouterImpl(Builder builder) {
3030 builder .routings .values ()
3131 .forEach (it -> {
3232 Routing routing = it .build ();
33- routings .put (routing .getClass (), routing );
33+ routings .put (routing .routingType (), routing );
3434 });
3535 }
3636
Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2022, 2023 Oracle and/or its affiliates.
2+ * Copyright (c) 2022, 2024 Oracle and/or its affiliates.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
2020 * Routing abstraction.
2121 */
2222public interface Routing extends ServerLifecycle {
23+
24+ /**
25+ * The class used by a {@link Router} to identify this {@link Routing} type and associate a connection with it.
26+ *
27+ * @return this routing type
28+ */
29+ default Class <? extends Routing > routingType () {
30+ return getClass ();
31+ }
32+
2333}
You can’t perform that action at this time.
0 commit comments