Interface RPCHandlerRegistry
public interface RPCHandlerRegistry
The registry for all rpc handler, distributed to a packet listener for the rpc channel to handle incoming rpc
requests. All class names are in the canonical format.
- Since:
- 4.0
-
Method Summary
Modifier and TypeMethodDescriptionGet the handler which is registered for the given target class or null if no handler for the class is registered.Get the handler which is registered for the given class by its name or null if no handler for the class is registered.booleanhasHandler(@NonNull Class<?> targetClass) Checks if this registry has a handler for the given target class.booleanhasHandler(@NonNull String targetClassName) Checks if this registry has a handler for the given target class name.Get all handlers which are registered to this registry.booleanregisterHandler(@NonNull RPCHandler rpcHandler) Registers the given handler to this registry, replacing the handler which was registered previously for the target class of the handler.booleanunregisterHandler(@NonNull RPCHandler rpcHandler) Unregisters the given rpc handler from this registry if previously registered.booleanunregisterHandler(@NonNull Class<?> rpcHandlerTargetClass) Unregisters the rpc handler associated with the given target class from this registry if registered previously.booleanunregisterHandler(@NonNull String rpcHandlerTargetClassName) Unregisters the rpc handler associated with the given target class name from this registry if registered previously.voidunregisterHandlers(@NonNull ClassLoader classLoader) Unregisters all rpc handlers from this registry whose classes were loaded by the given class loader.
-
Method Details
-
registeredHandlers
Get all handlers which are registered to this registry. The keys of the map is the target class of the handler registered as its value.- Returns:
- all handlers which are registered to this registry.
-
hasHandler
Checks if this registry has a handler for the given target class.- Parameters:
targetClass- the class to check for.- Returns:
- true if this registry has a handler for the given class, false otherwise.
- Throws:
NullPointerException- if the given target class is null.
-
hasHandler
Checks if this registry has a handler for the given target class name.- Parameters:
targetClassName- the name of the class to check for.- Returns:
- true if this registry has a handler for the given target class, false otherwise.
- Throws:
NullPointerException- if the given class name is null.
-
handler
Get the handler which is registered for the given target class or null if no handler for the class is registered.- Parameters:
targetClass- the class to get the rpc handler for.- Returns:
- the registered rpc handler for the class or null if no handler is registered.
- Throws:
NullPointerException- if the given class is null.
-
handler
Get the handler which is registered for the given class by its name or null if no handler for the class is registered.- Parameters:
targetClassName- the name of the class to get the handler for.- Returns:
- the registered rpc handler for the class or null if no handler is registered.
- Throws:
NullPointerException- if the given class name is null.
-
registerHandler
Registers the given handler to this registry, replacing the handler which was registered previously for the target class of the handler.- Parameters:
rpcHandler- the handler to register.- Returns:
- true if no handler was replaced to register the handler (clean insert), false otherwise.
- Throws:
NullPointerException- if the given rpc handler is null.
-
unregisterHandler
Unregisters the given rpc handler from this registry if previously registered.- Parameters:
rpcHandler- the handler to unregister.- Returns:
- true if the handler was removed from this registry, false otherwise.
- Throws:
NullPointerException- if the given rpc handler is null.
-
unregisterHandler
Unregisters the rpc handler associated with the given target class from this registry if registered previously.- Parameters:
rpcHandlerTargetClass- the class to unregister the rpc handler of.- Returns:
- true if the handler was removed from this registry, false otherwise.
- Throws:
NullPointerException- if the given target class is null.
-
unregisterHandler
Unregisters the rpc handler associated with the given target class name from this registry if registered previously.- Parameters:
rpcHandlerTargetClassName- the name of the class to unregister the rpc handler of.- Returns:
- true if the handler was removed from this registry, false otherwise.
- Throws:
NullPointerException- if the given target class name is null.
-
unregisterHandlers
Unregisters all rpc handlers from this registry whose classes were loaded by the given class loader.- Parameters:
classLoader- the class loader to unregister the handlers based on.- Throws:
NullPointerException- if the given class loader is null.
-