Websphere MQ Everyplace

examples.queuemanager
Class MQeServlet

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--examples.queuemanager.MQeServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class MQeServlet
extends javax.servlet.http.HttpServlet

To provide a simple MQe servlet.

Components configured on a servlet at startup are :

      ... Aliases
      ... ChannelManager
      ... ChannelListener (only TimeInterval parameter)
      ... Registry
      ... QueueManager
      ... Preload
 

This class extends HttpServlet, the servlet base class.

------------------------------------------------------------------------------

 Example configuration data fields :

   Fields=Aliases
      (ascii)EventLog=examples.eventLog.LogToDiskFile
      (ascii)Network=com.ibm.mqe.adapters.MQeTcpipHttpAdapter
      (ascii)QueueManager=com.ibm.mqe.MQeQueueManager
      (ascii)Trace=com.ibm.mqe.trace.MQeTrace
      (ascii)MsgLog=com.ibm.mqe.adapters.MQeDiskFieldsAdapter

   Fields=ChannelManager
      (int)MaxChannels=0

   Fields=Listener
      (int)TimeInterval=300

   Fields=QueueManager
      (ascii)Name=ServerQMgr

   Fields=Registry
      (ascii)RegType=FileRegistry
      (ascii)Path=.\ExampleQM\Registry\
      (ascii)PrivRegPIN=12345678

   See ExampleMQeServer.ini for an example startup paramters file
 

See Also:
Serialized Form

Field Summary
protected  MQeChannelManager channelManager
           
protected  MQeChannelTimer channelTimer
           
 java.lang.String defaultStartupInifile
           
protected  java.util.Hashtable loadTable
           
protected  MQe mqe
           
protected  MQeQueueManager queueManager
           
static java.lang.String Section_ChannelManager
           
static short[] version
           
 
Constructor Summary
MQeServlet()
           
 
Method Summary
 void destroy()
          called when a request is made to stop the servlet.
 void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Handle POST.
 MQeChannelManager getChannelManager()
          Return a reference to the channel manager.
 MQeChannelTimer getChannelTimer()
          Return a reference to the channel timer.
 java.util.Hashtable getLoadTable()
          Return a reference to the load table.
 MQeQueueManager getQueueManager()
          Return a reference to the queue manager.
 void init(javax.servlet.ServletConfig sc)
          Servlet Initialisation.
static MQeChannelManager processChannelManager(MQeFields sections)
          Process the ChannelManager section of the configuration data.
 void read(java.io.InputStream in, byte[] data, int bytes)
          Read a number of bytes from an input stream.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

public static short[] version

Section_ChannelManager

public static final java.lang.String Section_ChannelManager
See Also:
Constant Field Values

defaultStartupInifile

public java.lang.String defaultStartupInifile

mqe

protected MQe mqe

channelManager

protected MQeChannelManager channelManager

queueManager

protected MQeQueueManager queueManager

channelTimer

protected MQeChannelTimer channelTimer

loadTable

protected java.util.Hashtable loadTable
Constructor Detail

MQeServlet

public MQeServlet()
Method Detail

destroy

public void destroy()
called when a request is made to stop the servlet.

Specified by:
destroy in interface javax.servlet.Servlet
Overrides:
destroy in class javax.servlet.GenericServlet
Returns:
void

doPost

public void doPost(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws java.io.IOException
Handle POST.

Overrides:
doPost in class javax.servlet.http.HttpServlet
Parameters:
request - HttpServletRequest object
response - HttpServletResponse object
Returns:
void
Throws:
java.io.IOException

getChannelManager

public MQeChannelManager getChannelManager()
Return a reference to the channel manager.

Returns:
MQeChannelManager the channel manager reference

getChannelTimer

public MQeChannelTimer getChannelTimer()
Return a reference to the channel timer.

Returns:
MQeChannelTimer the Channel Timer

getLoadTable

public java.util.Hashtable getLoadTable()
Return a reference to the load table.

Returns:
Hashtable the table

getQueueManager

public MQeQueueManager getQueueManager()
Return a reference to the queue manager.

Returns:
MQeQueueManager the queue manager

init

public void init(javax.servlet.ServletConfig sc)
          throws javax.servlet.ServletException
Servlet Initialisation.

Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Parameters:
sc - ServletConfig object
Returns:
void
Throws:
javax.servlet.ServletException

processChannelManager

public static MQeChannelManager processChannelManager(MQeFields sections)
                                               throws java.lang.Exception
Process the ChannelManager section of the configuration data.
  [ChannelManager]     Parameters for the channel manager
      (int)MaxChannels=.....       max number of concurrent channels
 

Parameters:
sections - MqeFields object
Returns:
MQeChannelManager object reference.
Throws:
java.lang.Exception

read

public void read(java.io.InputStream in,
                 byte[] data,
                 int bytes)
          throws java.io.IOException
Read a number of bytes from an input stream.

Parameters:
in - InputStream, the input stream
data - byte array to fill
bytes - An integer, number of bytes to read.
Returns:
void
Throws:
java.io.IOException - The exception description.

Websphere MQ Everyplace