Interface ProxyExtension
- All Superinterfaces:
AutoCloseable
The extension interface for support additional extensions on Pulsar Proxy.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanVerify if the extension can handle the given extension name.voidclose()Returns the unique extension name.voidinitialize(ProxyConfiguration conf) Initialize the extension when the extension is constructed from reflection.Map<InetSocketAddress,io.netty.channel.ChannelInitializer<io.netty.channel.socket.SocketChannel>> Create the list of channel initializers for the ports that this extension will listen on.voidstart(ProxyService service) Start the extension with the provided proxy service.
-
Method Details
-
extensionName
String extensionName()Returns the unique extension name. For example, `kafka-v2` for extension for Kafka v2 protocol. -
accept
Verify if the extension can handle the given extension name.- Parameters:
extension- the extension to verify- Returns:
- true if the extension can handle the given extension name, otherwise false.
-
initialize
Initialize the extension when the extension is constructed from reflection.The initialize should initialize all the resources required for serving the extension but don't start those resources until
start(ProxyService)is called.- Parameters:
conf- proxy service configuration- Throws:
Exception- when fail to initialize the extension.
-
start
Start the extension with the provided proxy service.The proxy service provides the accesses to the Pulsar Proxy components.
- Parameters:
service- the broker service to start with.
-
newChannelInitializers
Map<InetSocketAddress,io.netty.channel.ChannelInitializer<io.netty.channel.socket.SocketChannel>> newChannelInitializers()Create the list of channel initializers for the ports that this extension will listen on.NOTE: this method is called after
start(ProxyService).- Returns:
- the list of channel initializers for the ports that this extension listens on.
-
close
void close()- Specified by:
closein interfaceAutoCloseable
-