Package org.mycore.frontend.ws.endoint
Class MCRAbstractEndpoint
java.lang.Object
org.mycore.frontend.ws.endoint.MCRAbstractEndpoint
- Direct Known Subclasses:
MCRProcessingEndpoint
,MCRWebCLIResourceSockets
Starting class for all mycore websocket endpoints.
- Author:
- Michel Buechner (mcrmibue), Matthias Eichner
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
activate
(jakarta.websocket.Session session) Retrieves the mycore session id from the websocket session and binds the current thread with this mycore session.protected void
passivate
(jakarta.websocket.Session session) Releases the mycore session from this thread.protected void
sessionized
(jakarta.websocket.Session session, Runnable runnable) Encapsulates a function with a mycore session.protected <T> T
sessionized
(jakarta.websocket.Session session, Supplier<T> supplier) Encapsulates a supplier with a mycore session.
-
Constructor Details
-
MCRAbstractEndpoint
public MCRAbstractEndpoint()
-
-
Method Details
-
sessionized
Encapsulates a supplier with a mycore session.- Parameters:
session
- the websocket sessionsupplier
- the supplier- Returns:
- the result of the supplier
-
sessionized
Encapsulates a function with a mycore session.- Parameters:
session
- the websocket sessionrunnable
- the runnable
-
activate
protected void activate(jakarta.websocket.Session session) Retrieves the mycore session id from the websocket session and binds the current thread with this mycore session.- Parameters:
session
- the websocket session
-
passivate
protected void passivate(jakarta.websocket.Session session) Releases the mycore session from this thread.- Parameters:
session
- the websocket session
-