Class Services
java.lang.Object
dev.getelements.elements.service.util.Services
A class which helps implement the
Provider instances
for the service-level objects. This provides default implementations designed
to throw exceptions, effectively blocking usage of the service.
Created by patricktwohig on 4/2/15.-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TGets a proxy that always throws an instance ofForbiddenException.static <T> Tunimplemented(Class<T> cls) Gets a proxy that always throws an instance ofNotImplementedException.
-
Method Details
-
forbidden
Gets a proxy that always throws an instance ofForbiddenException. This uses theProxymethod builtin to the JDK. As such, this will not work properly with non-interface types.- Type Parameters:
T- the service proxy instance.- Parameters:
cls- the service typeClass.- Returns:
- a proxy instance of the service type
-
unimplemented
Gets a proxy that always throws an instance ofNotImplementedException. This uses theProxymethod builtin to the JDK. As such, this will not work properly with non-interface types.- Type Parameters:
T- the service proxy instance.- Parameters:
cls- the service typeClass.- Returns:
- a proxy instance of the service type
-