Package org.jenkinsci.remoting.protocol
Class ProtocolStack.Builder
- java.lang.Object
-
- org.jenkinsci.remoting.protocol.ProtocolStack.Builder
-
- Enclosing class:
- ProtocolStack<T>
@NotThreadSafe public static class ProtocolStack.Builder extends Object
Builder forProtocolStack
instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> ProtocolStack<T>
build(ApplicationLayer<T> application)
Create theProtocolStack
.ProtocolStack.Builder
filter(FilterLayer filter)
Adds the supplied filter into theProtocolStack
.ProtocolStack.Builder
listener(ProtocolStack.Listener listener)
Register aProtocolStack.Listener
for theProtocolStack
.ProtocolStack.Builder
named(String name)
Provide a custom name for theProtocolStack
.
-
-
-
Method Detail
-
filter
public ProtocolStack.Builder filter(@CheckForNull FilterLayer filter)
Adds the supplied filter into theProtocolStack
.- Parameters:
filter
- the filter to add, ifnull
then it will be ignored (useful for conditionally adding filters)- Returns:
this
.
-
named
public ProtocolStack.Builder named(String name)
Provide a custom name for theProtocolStack
.- Parameters:
name
- the custom name.- Returns:
this
-
listener
public ProtocolStack.Builder listener(ProtocolStack.Listener listener)
Register aProtocolStack.Listener
for theProtocolStack
.- Parameters:
listener
- the listener.- Returns:
this
-
build
public <T> ProtocolStack<T> build(ApplicationLayer<T> application) throws IOException
Create theProtocolStack
.- Type Parameters:
T
- the application specific API.- Parameters:
application
- theApplicationLayer
to use.- Returns:
- the
ProtocolStack
. - Throws:
IOException
- if theProtocolStack
could not be started.
-
-