Class Services

java.lang.Object
dev.getelements.elements.service.util.Services

public class Services extends Object
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 Details

    • forbidden

      public static <T> T forbidden(Class<T> cls)
      Gets a proxy that always throws an instance of ForbiddenException. This uses the Proxy method 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 type Class.
      Returns:
      a proxy instance of the service type
    • unimplemented

      public static <T> T unimplemented(Class<T> cls)
      Gets a proxy that always throws an instance of NotImplementedException. This uses the Proxy method 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 type Class.
      Returns:
      a proxy instance of the service type