Interaction between servlet contexts is a cooperative processing between HTTP servlet contexts managed by WebLogic Server 8.1 SP4 and SIP servlet contexts managed by WebLogic SIP Server. WebLogic SIP Server 2.0 provides the following functions:
Note: The WEB-INF subdirectory of a SIP application must contain both a web.xml and sip.xml descriptor, even if your are deploying a pure SIP application. WebLogic SIP Server creates both an HTTP servlet context and SIP servlet context for each SIP application.
When a SIP application's HTTP servlet is discarded, the WebLogic SIP Server also discards the SIP servlet context. This lifecycle interaction is implemented using a ServletContextListener as described in the Servlet API 2.3. Application developers or system administrators must define the following event listener in the deployment descriptor (web.xml) when deploying a SIP Servlet:
<web-app> <listener> <listener-class>com.bea.wcp.sip.engine.server.ContextEventHook</listener-class> </listener>
</web-app>
This event listener is provided by WebLogic SIP Server and its class name is fixed.*1 No additional entries are required for a pure SIP application.
Context attribute interaction is a function that allows you to take attribute information registered with setAttribute() in one servlet context from the other context. For example, SIP Servlet API registers SipFactory with the context attribute under the name "javax.Servlet.sip.SipFactory." This attribute can be extracted from the HTTP servlet context under the same name.
You can set an event listener in the context attribute. Events are delivered properly when the context is managed from either side. For example, when you add a context attribute on the HTTP side, attributeAdded method is invoked on the listener that is registered in the SIP context.
Note: Event notification to the event listener on the SIP is implemented through the ContextEventHook object described earlier.