Class PortServlet<T>
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.palladiosimulator.protocom.framework.java.ee.prototype.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>
The PortServlet class is the common base class for ports.
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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
Calls the postCallVisit method of all registered visitors.protected void
Calls the preCallVisit method of all registered visitors.void
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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.palladiosimulator.protocom.framework.java.ee.prototype.IPort
setContext
-
Field Details
-
location
-
component
-
-
Constructor Details
-
PortServlet
public PortServlet()Constructs a new PortServlet object.
-
-
Method Details
-
start
Starts the port and registers it.- Parameters:
componentId
- identifier of the started componentassemblyContext
- 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 classjavax.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 classjavax.servlet.http.HttpServlet
- Throws:
javax.servlet.ServletException
IOException
-
addVisitor
Adds a visitor that will be invoked for each method call.- Parameters:
visitor
- the visitor to add
-
preCall
Calls the preCallVisit method of all registered visitors.- Parameters:
callId
- the ID of the call
-
postCall
Calls the postCallVisit method of all registered visitors.- Parameters:
callId
- the ID of the call
-