org.aludratest.service
Interface AludraServiceContext

All Superinterfaces:
AludraContext
All Known Implementing Classes:
AludraServiceContextImpl

public interface AludraServiceContext
extends AludraContext

Interface for AludraService contexts. Each service will get such a context during its initialization. The context can be used to retrieve other contexts, or to get the name of the current instance of the service, if any.

Author:
falbrech

Method Summary
 String getInstanceName()
          Returns the name of the current service instance, if any.
<T extends AludraService>
T
getNonLoggingService(Class<T> serviceInterface)
          Gets the service for the given service interface.
<T extends AludraService>
T
getService(Class<T> serviceInterface)
          Gets the service for the given service interface.
 
Methods inherited from interface org.aludratest.service.AludraContext
getNonLoggingService, getService, newComponentInstance
 

Method Detail

getInstanceName

String getInstanceName()
Returns the name of the current service instance, if any.

Returns:
The name of the current service instance, if any. May be null if no instance name is set.

getService

<T extends AludraService> T getService(Class<T> serviceInterface)
Gets the service for the given service interface. The service is ensured to be configured and initialized. Calls to the service will be logged in the test case log.

Parameters:
serviceInterface - Class of the service interface to retrieve (e.g. FileService.class).
Returns:
A ready-to-use service instance.

getNonLoggingService

<T extends AludraService> T getNonLoggingService(Class<T> serviceInterface)
Gets the service for the given service interface. The service is ensured to be configured and initialized.

Parameters:
serviceInterface - Class of the service interface to retrieve (e.g. FileService.class).
Returns:
A ready-to-use service instance.


Copyright © 2015 aludratest.org. All rights reserved.