Class DecoratingService<T_I extends Request,​T_O extends Response,​R_I extends Request,​R_O extends Response>

java.lang.Object
com.linecorp.armeria.common.util.AbstractUnwrappable<Service<T_I,​T_O>>
com.linecorp.armeria.server.DecoratingService<T_I,​T_O,​R_I,​R_O>
Type Parameters:
T_I - the Request type of the Service being decorated
T_O - the Response type of the Service being decorated
R_I - the Request type of this Service
R_O - the Response type of this Service
All Implemented Interfaces:
Unwrappable, Service<R_I,​R_O>
Direct Known Subclasses:
SimpleDecoratingService, THttpService

public abstract class DecoratingService<T_I extends Request,​T_O extends Response,​R_I extends Request,​R_O extends Response> extends AbstractUnwrappable<Service<T_I,​T_O>> implements Service<R_I,​R_O>
A Service that decorates another Service. Use SimpleDecoratingHttpService or SimpleDecoratingRpcService if your Service has the same Request and Response type with the Service being decorated.
  • Constructor Details

    • DecoratingService

      protected DecoratingService(Service<T_I,​T_O> delegate)
      Creates a new instance that decorates the specified Service.
  • Method Details

    • serviceAdded

      public void serviceAdded(ServiceConfig cfg) throws Exception
      Description copied from interface: Service
      Invoked when this service has been added to a Server with the specified configuration. Please note that this method can be invoked more than once if this service has been added more than once.
      Specified by:
      serviceAdded in interface Service<T_I extends Request,​T_O extends Response>
      Throws:
      Exception
    • shouldCachePath

      public boolean shouldCachePath(String path, @Nullable @Nullable String query, Route route)
      Description copied from interface: Service
      Returns whether the given path and query should be cached if the service's result is successful. By default, exact path mappings with no input query are cached.
      Specified by:
      shouldCachePath in interface Service<T_I extends Request,​T_O extends Response>