demo.org.powermock.examples.tutorial.staticmocking
Interface IServiceRegistrator

All Known Implementing Classes:
ServiceRegistrator, ServiceRegistratorWithoutPowerMock

public interface IServiceRegistrator

An interface to be implemented by services that performs service registrations.


Method Summary
 long registerService(String name, Object serviceImplementation)
          Registers a service to the service framework.
 void unregisterService(long id)
          Unregisters a service from the service framework.
 

Method Detail

registerService

long registerService(String name,
                     Object serviceImplementation)
Registers a service to the service framework.

Parameters:
name - The name of the service the register.
serviceImplementation - The implementation of the service.
Returns:
An id of the service that got registered. Should be used when unregistering the service.

unregisterService

void unregisterService(long id)
Unregisters a service from the service framework.

Parameters:
id - The id of the service that should be removed. The id was generated by registerService(String, Object).
Throws:
IllegalStateException - If this ServiceRegistration object has already been unregistered.


Copyright © 2007-2012. All Rights Reserved.