Class PortServlet<T>

  • Type Parameters:
    T - the type of the component of the port
    All Implemented Interfaces:
    Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, IPort<T>

    public abstract class PortServlet<T>
    extends javax.servlet.http.HttpServlet
    implements IPort<T>
    The PortServlet class is the common base class for ports.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      PortServlet()
      Constructs a new PortServlet object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addVisitor​(ICallVisitor visitor)
      Adds a visitor that will be invoked for each method call.
      protected void doGet​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse httpResponse)  
      protected void doPost​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      protected void postCall​(String callId)
      Calls the postCallVisit method of all registered visitors.
      protected void preCall​(String callId)
      Calls the preCallVisit method of all registered visitors.
      void start​(String componentId, String assemblyContext)
      Starts the port and registers it.
      • Methods inherited from class javax.servlet.http.HttpServlet

        doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
      • Methods inherited from class javax.servlet.GenericServlet

        destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
      • Methods inherited from interface org.palladiosimulator.protocom.framework.java.ee.prototype.IPort

        setContext
    • Field Detail

      • location

        protected String location
      • component

        protected T component
    • Constructor Detail

      • PortServlet

        public PortServlet()
        Constructs a new PortServlet object.
    • Method Detail

      • start

        public void start​(String componentId,
                          String assemblyContext)
                   throws ModuleStartException
        Starts the port and registers it.
        Parameters:
        componentId - identifier of the started component
        assemblyContext - assembly context of the started component
        Throws:
        ModuleStartException - when the module could not be started
      • doGet

        protected void doGet​(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse httpResponse)
                      throws javax.servlet.ServletException,
                             IOException
        Overrides:
        doGet in class javax.servlet.http.HttpServlet
        Throws:
        javax.servlet.ServletException
        IOException
      • doPost

        protected void doPost​(javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response)
                       throws javax.servlet.ServletException,
                              IOException
        Overrides:
        doPost in class javax.servlet.http.HttpServlet
        Throws:
        javax.servlet.ServletException
        IOException
      • addVisitor

        protected void addVisitor​(ICallVisitor visitor)
        Adds a visitor that will be invoked for each method call.
        Parameters:
        visitor - the visitor to add
      • preCall

        protected void preCall​(String callId)
        Calls the preCallVisit method of all registered visitors.
        Parameters:
        callId - the ID of the call
      • postCall

        protected void postCall​(String callId)
        Calls the postCallVisit method of all registered visitors.
        Parameters:
        callId - the ID of the call