Class HTTPExposer

java.lang.Object
org.simple4j.wsfeeler.pojoashttp.HTTPExposer

public abstract class HTTPExposer extends Object
This class can be used to expose any method in any bean in a Spring ApplicationContext as a HTTP service
  • Constructor Details

    • HTTPExposer

      public HTTPExposer(org.springframework.context.ApplicationContext context)
      Constructor with org.springframework.context.ApplicationContext instance as parameter
      Parameters:
      context - - org.springframework.context.ApplicationContext instance
  • Method Details

    • expose

      public abstract void expose()
      This method will turn on the listener to expose bean methods as web service
    • processRequest

      protected String processRequest(String body) throws ClassNotFoundException, IllegalAccessException, NoSuchFieldException, com.fasterxml.jackson.core.JsonProcessingException, com.fasterxml.jackson.databind.JsonMappingException, NoSuchMethodException, InvocationTargetException
      Throws:
      ClassNotFoundException
      IllegalAccessException
      NoSuchFieldException
      com.fasterxml.jackson.core.JsonProcessingException
      com.fasterxml.jackson.databind.JsonMappingException
      NoSuchMethodException
      InvocationTargetException
    • getListenerPortNumber

      public int getListenerPortNumber()
      Port number to start the listener at
    • setListenerPortNumber

      public void setListenerPortNumber(int listenerPortNumber)
    • getListenerThreadMax

      public int getListenerThreadMax()
      Max thread count for the listener to serve requests
    • setListenerThreadMax

      public void setListenerThreadMax(int listenerThreadMax)
    • getListenerThreadMin

      public int getListenerThreadMin()
      Min thread count for the listener to serve requests
    • setListenerThreadMin

      public void setListenerThreadMin(int listenerThreadMin)
    • getListenerIdleTimeoutMillis

      public int getListenerIdleTimeoutMillis()
      Idle timeout in milli seconds for the listener thread to be destroyed to reach min thread count
    • setListenerIdleTimeoutMillis

      public void setListenerIdleTimeoutMillis(int listenerIdleTimeoutMillis)
    • getUrlBase

      public String getUrlBase()
      URL base path for the listener to expose the service
    • setUrlBase

      public void setUrlBase(String urlBase)