Class InvokerTube<T>

All Implemented Interfaces:
Pipe, Tube, EndpointAwareTube, InvokerSource<Invoker>
Direct Known Subclasses:
ProviderInvokerTube, SEIInvokerTube

public abstract class InvokerTube<T> extends InvokerTube<Invoker> implements EndpointAwareTube
Base code for ProviderInvokerTube and SEIInvokerTube.

This hides InstanceResolver and performs a set up necessary for WebServiceContext to correctly.

Author:
Kohsuke Kawaguchi
  • Constructor Details

    • InvokerTube

      protected InvokerTube(Invoker invoker)
  • Method Details

    • setEndpoint

      public void setEndpoint(WSEndpoint endpoint)
      Description copied from interface: EndpointAwareTube
      Setter for WSEndpoint holding this tube
      Specified by:
      setEndpoint in interface EndpointAwareTube
      Parameters:
      endpoint - WSEndpoint holding this tube
    • getEndpoint

      protected WSEndpoint getEndpoint()
    • getInvoker

      @NotNull public final Invoker getInvoker(Packet request)
      Returns the Invoker object that serves the request.
      Specified by:
      getInvoker in interface InvokerSource<T>
      Overrides:
      getInvoker in class InvokerTube<Invoker>
      Parameters:
      request - Packet for request
      Returns:
      Selected invoker
    • copy

      public final AbstractTubeImpl copy(TubeCloner cloner)
      processRequest() and processResponse() do not share any instance variables while processing the request. InvokerTube is stateless and terminal, so no need to create copies.
      Specified by:
      copy in interface Tube
      Specified by:
      copy in class AbstractTubeImpl
      Parameters:
      cloner - Use this object (in particular its TubeCloner.copy(Tube) method to clone other pipe references you have in your pipe. See TubeCloner for more discussion about why.
      Returns:
      always non-null Tube.
    • preDestroy

      public void preDestroy()
      Description copied from interface: Tube
      Invoked before the last copy of the pipeline is about to be discarded, to give Tubes a chance to clean up any resources.

      This can be used to invoke PreDestroy lifecycle methods on user handler. The invocation of it is optional on the client side, but mandatory on the server side.

      When multiple copies of pipelines are created, this method is called only on one of them.

      Specified by:
      preDestroy in interface Pipe
      Specified by:
      preDestroy in interface Tube
    • getCurrentPacket

      @NotNull public static Packet getCurrentPacket()
      This method can be called while the user service is servicing the request synchronously, to obtain the current request packet.

      This is primarily designed for StatefulInstanceResolver. Use with care.