public class ProtocolClassRegistry extends Object
ProtocolId
)
to an arbitrary BaseProtocol
class.
It is expected that all registered classes provide a default constructor.KrakenProtocolConfigurationBuilderImpl
Constructor and Description |
---|
ProtocolClassRegistry()
create a new instance
|
Modifier and Type | Method and Description |
---|---|
static ProtocolClassRegistry |
createDefaultKrakenProtocolRegistry() |
Class<? extends BaseProtocol> |
getRegisteredProtocolClass(ProtocolId id)
Return the registered class for a given protocol identifier
|
Collection<Class<? extends BaseProtocol>> |
getRegisteredProtocolClassList() |
Set<ProtocolId> |
getRegisteredProtocolIdSet() |
void |
registerHandler(ProtocolId protocolId,
Class<? extends BaseProtocol> protocolHandlerClazz)
Register a protocol identifier to a protocol handler class, which must provide a default constructor
|
void |
unregisterHandler(ProtocolId protocolId)
Delete a registry record, does nothing if the protocol id was not registered
|
public void registerHandler(ProtocolId protocolId, Class<? extends BaseProtocol> protocolHandlerClazz)
protocolId
- a protocol identifier, which should be advertised by the protocolHandlerClazz as wellprotocolHandlerClazz
- a class that is able to parse the protocol identified by the protocol id and
provides a default constructorIllegalArgumentException
- if any argument is null or the protocol id was already registeredpublic void unregisterHandler(ProtocolId protocolId)
protocolId
- the identifier for the handler to delete from the registrypublic Class<? extends BaseProtocol> getRegisteredProtocolClass(ProtocolId id)
id
- the identifier that was registered to this registrypublic Set<ProtocolId> getRegisteredProtocolIdSet()
public Collection<Class<? extends BaseProtocol>> getRegisteredProtocolClassList()
public static ProtocolClassRegistry createDefaultKrakenProtocolRegistry()
Copyright © 2013–2015 Institute of networks and security. All rights reserved.