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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidafterChannel(JnlpConnectionState event) Callback to notify theJnlpConnectionState.approve()listener that theChannelhas been created and is available viaJnlpConnectionState.getChannel().voidCallback to notify theJnlpConnectionState.approve()listener that theSockethas been closed.abstract voidNotification that properties have been exchanged.voidbeforeChannel(JnlpConnectionState event) Callback to allow theJnlpConnectionState.approve()listener to decorate theChannelBuilderviaJnlpConnectionState.getChannelBuilder().voidNotification that the connection has been established and properties will be exchanged.voidchannelClosed(JnlpConnectionState event) Callback to notify theJnlpConnectionState.approve()listener that theChannelhas 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 theChannelBuilderviaJnlpConnectionState.getChannelBuilder().- Parameters:
event- the event.
-
afterChannel
Callback to notify theJnlpConnectionState.approve()listener that theChannelhas been created and is available viaJnlpConnectionState.getChannel().- Parameters:
event- the event.
-
channelClosed
Callback to notify theJnlpConnectionState.approve()listener that theChannelhas been closed.- Parameters:
event- the event.
-
afterDisconnect
Callback to notify theJnlpConnectionState.approve()listener that theSockethas been closed.- Parameters:
event- the event.
-