Package ghidra.framework.plugintool
Class ServiceProviderDecorator
- java.lang.Object
-
- ghidra.framework.plugintool.ServiceProviderDecorator
-
- All Implemented Interfaces:
ServiceProvider
public class ServiceProviderDecorator extends java.lang.Object implements ServiceProvider
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addServiceListener(ServiceListener listener)
Adds a listener that will be called as services are added and removed from this ServiceProvider.static ServiceProviderDecorator
createEmptyDecorator()
static ServiceProviderDecorator
decorate(ServiceProvider delegate)
<T> T
getService(java.lang.Class<T> serviceClass)
Returns the Service object that implements the given service interface.<T> void
overrideService(java.lang.Class<T> serviceClass, java.lang.Object service)
Adds a service that will override any service contained in the delegateServiceProvider
.void
removeServiceListener(ServiceListener listener)
Removes the given listener from this ServiceProvider.
-
-
-
Method Detail
-
decorate
public static ServiceProviderDecorator decorate(ServiceProvider delegate)
-
createEmptyDecorator
public static ServiceProviderDecorator createEmptyDecorator()
-
overrideService
public <T> void overrideService(java.lang.Class<T> serviceClass, java.lang.Object service)
Adds a service that will override any service contained in the delegateServiceProvider
.Note: this will not notify any clients that services have been changed. This means that you should call this method before passing this service provider on to your clients.
- Parameters:
serviceClass
- the service classservice
- the service implementation
-
getService
public <T> T getService(java.lang.Class<T> serviceClass)
Description copied from interface:ServiceProvider
Returns the Service object that implements the given service interface.- Specified by:
getService
in interfaceServiceProvider
- Parameters:
serviceClass
- the interface class.
-
addServiceListener
public void addServiceListener(ServiceListener listener)
Description copied from interface:ServiceProvider
Adds a listener that will be called as services are added and removed from this ServiceProvider.- Specified by:
addServiceListener
in interfaceServiceProvider
- Parameters:
listener
- The listener to add.
-
removeServiceListener
public void removeServiceListener(ServiceListener listener)
Description copied from interface:ServiceProvider
Removes the given listener from this ServiceProvider. This method does nothing if the given listener is not contained by this ServiceProvider.- Specified by:
removeServiceListener
in interfaceServiceProvider
-
-