Overriding the Default Servlet Mapping of the pubsub Java EE Library

12-14 Developing Web Applications, Servlets, and JSPs for Oracle WebLogic Server This section covers only the minimal information on using the Dojo toolkit to update a Web based client to communicate with the WebLogic pub-sub server; for additional details, see http:www.dojotoolkit.orgdocumentation .

12.3.5 Overriding the Default Servlet Mapping of the pubsub Java EE Library

The web.xml of the pubsub Java EE library defines the internal servlet called PubSubServlet that implements the pub-sub server as follows: web-app servlet servlet-namePubSubServletservlet-name servlet-classcom.bea.httppubsub.servlet.ControllerServletservlet-class load-on-startup1load-on-startup servlet servlet-mapping servlet-namePubSubServletservlet-name url-patterncometdurl-pattern servlet-mapping web-app As shown by the code in bold, the URL pattern for the PubSubServlet is cometd; this is why by default you must use a string such as mywebappcometd when initializing a Web client that communicates with the pub-sub server. If you need to override this default URL pattern, then update the web.xml file of your Web application with something like the following: servlet-mapping servlet-namePubSubServletservlet-name url-patternweb2url-pattern servlet-mapping Now you can specify this new URL pattern, rather than cometd, when using Dojo to initialize a Web client: dojo.io.cometd.init{}, contextweb2;

12.4 Getting Run-time Information about the Pub-Sub Server and Channels

The pub-sub server exposes all run-time monitoring information using Java Management Extensions JMX MBeans. Examples of the type of information you can gather at run time include details about registered clients, channel subscriptions, and message counts. The pub-sub server uses two kinds of run-time MBeans: ■ weblogic.management.runtime.WebPubSubRuntimeMBean—Encapsulates run-time information about the pub-sub server itself. Examples of information you can get about a pub-sub server using this MBean include the context root of the associated Web application and a handle to a configured channel. ■ weblogic.management.runtime.ChannelRuntimeMBean—Encapsulates information about the channels configured for the pub-sub server. Examples of information you can get about a channel using the MBean include the number of published messages to this channel, the number of current subscribers, and the list of subscribers.