Package org.jenkinsci.remoting.engine
Class JnlpConnectionStateListener
java.lang.Object
org.jenkinsci.remoting.engine.JnlpConnectionStateListener
A listener for connection state changes.
The listeners will be called in order for any unique event. Use
JnlpConnectionState.setStash(JnlpConnectionState.ListenerState)
and
JnlpConnectionState.getStash(Class)
if you need to maintain state between callbacks.
beforeProperties(JnlpConnectionState)
(if closed thenafterDisconnect(JnlpConnectionState)
)afterProperties(JnlpConnectionState)
(if closed thenafterDisconnect(JnlpConnectionState)
)beforeChannel(JnlpConnectionState)
(if closed thenafterDisconnect(JnlpConnectionState)
)afterChannel(JnlpConnectionState)
(if closed thenchannelClosed(JnlpConnectionState)
)channelClosed(JnlpConnectionState)
afterDisconnect(JnlpConnectionState)
- Since:
- 3.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
afterChannel
(JnlpConnectionState event) Callback to notify theJnlpConnectionState.approve()
listener that theChannel
has been created and is available viaJnlpConnectionState.getChannel()
.void
Callback to notify theJnlpConnectionState.approve()
listener that theSocket
has been closed.abstract void
Notification that properties have been exchanged.void
beforeChannel
(JnlpConnectionState event) Callback to allow theJnlpConnectionState.approve()
listener to decorate theChannelBuilder
viaJnlpConnectionState.getChannelBuilder()
.void
Notification that the connection has been established and properties will be exchanged.void
channelClosed
(JnlpConnectionState event) Callback to notify theJnlpConnectionState.approve()
listener that theChannel
has been closed.
-
Constructor Details
-
JnlpConnectionStateListener
public JnlpConnectionStateListener()
-
-
Method Details
-
beforeProperties
Notification that the connection has been established and properties will be exchanged. CallJnlpConnectionState.ignore()
to suppress any further notifications of this event. CallJnlpConnectionState.reject(ConnectionRefusalException)
to reject the connection. CallJnlpConnectionState.approve()
to declare ownership of this event (normally better to defer this toafterProperties(JnlpConnectionState)
)- Parameters:
event
- the event.
-
afterProperties
Notification that properties have been exchanged. CallJnlpConnectionState.ignore()
to suppress any further notifications of this event. CallJnlpConnectionState.reject(ConnectionRefusalException)
to reject the connection. CallJnlpConnectionState.approve()
to declare ownership of this event.- Parameters:
event
- the event.
-
beforeChannel
Callback to allow theJnlpConnectionState.approve()
listener to decorate theChannelBuilder
viaJnlpConnectionState.getChannelBuilder()
.- Parameters:
event
- the event.
-
afterChannel
Callback to notify theJnlpConnectionState.approve()
listener that theChannel
has been created and is available viaJnlpConnectionState.getChannel()
.- Parameters:
event
- the event.
-
channelClosed
Callback to notify theJnlpConnectionState.approve()
listener that theChannel
has been closed.- Parameters:
event
- the event.
-
afterDisconnect
Callback to notify theJnlpConnectionState.approve()
listener that theSocket
has been closed.- Parameters:
event
- the event.
-