![JAR search and dependency download from the Maven repository](/logo.png)
com.sap.it.commons.context.ServiceContext Maven / Gradle / Ivy
package com.sap.it.commons.context;
/**
* Services interface for type safe, generically requesting service
* implementations. Serves as a common base for breaking API dependencies (with
* the consequence of RuntimeExceptions).
*
* @author D044677
*
*/
public interface ServiceContext {
/**
* Get a service for the specified type.
*
* @param serviceClass
* type of the requested service.
*
* @return A service implementation class of type {@literal } or
* {@code null}.
*/
T getService(Class serviceClass);
/**
* Grants a service for the specified type. Never returns {@code null}.
*
* @param serviceClass
* type of the requested service.
*
* @return A service implementation class of type {@literal }.
*
* @throws IllegalArgumentException
* if the requested service is not available.
*/
T grantService(Class serviceClass) throws IllegalArgumentException;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy