Websphere MQ Everyplace

examples.midp.exampleapp.msgpump
Class MsgPumpModelServer

java.lang.Object
  |
  +--examples.midp.exampleapp.msgpump.MsgPumpModel
        |
        +--examples.midp.exampleapp.msgpump.MsgPumpModelServer
All Implemented Interfaces:
MessageConsumer, java.lang.Runnable

public class MsgPumpModelServer
extends MsgPumpModel

This is the server side of the message pump model. The purpose of the server is to display messages it receives to the user.


Field Summary
static short[] version
           
 
Fields inherited from class examples.midp.exampleapp.msgpump.MsgPumpModel
compressor, cryptor, DEFAULT_SECURITY, DEFAULT_SERVER_Q_NAME, DEFAULT_SERVER_QM_NAME, MESSAGE_SECURITY, NO_SECURITY, QUEUE_SECURITY, SECURITY_KEY, sync
 
Method Summary
 java.lang.String getRequestQueue()
          Gets the request queue of the server - the queue messages are pumped to.
 void pause()
          The server cannot be paused.
protected  void performInitialConfiguration()
          Used to initially set up the queue manager, queues and anything else required by the model ( listeners etc ).
 void processDataGramMsg(MQeMsgObject message, java.lang.String qMgrName, java.lang.String qName)
          A datagram message has been received.
protected  void processMsg(java.lang.String qMgrName, java.lang.String qName, MQeMsgObject msg)
          A message of some form has been received, so display it and consume it ( remove it from the queue ).
 void processReplyMsg(MQeMsgObject message, java.lang.String qMgrName, java.lang.String qName)
          A reply message has been received.
 void processRequestMsg(MQeMsgObject message, java.lang.String qMgrName, java.lang.String qName)
          A new request message has been received.
 void resume()
          Resumes the model.
 void run()
           
 void stop()
          Called when something wants the model to stop.
 
Methods inherited from class examples.midp.exampleapp.msgpump.MsgPumpModel
createMessageAttribute, finish, getController, getLocalQMname, getMessageAttribute, getMsgService, getQMrules, getTimestamp, initialize, isSecurity, padNumber, processStatus, setController, setProperty
 
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
Method Detail

run

public void run()
See Also:
Runnable.run()

performInitialConfiguration

protected void performInitialConfiguration()
                                    throws java.lang.Exception
Description copied from class: MsgPumpModel
Used to initially set up the queue manager, queues and anything else required by the model ( listeners etc ). This is only run if there are no registry file located on the system.

Specified by:
performInitialConfiguration in class MsgPumpModel
Returns:
void
java.lang.Exception
See Also:
MsgPumpModel.performInitialConfiguration()

pause

public void pause()
The server cannot be paused.

Specified by:
pause in class MsgPumpModel
Returns:
void
See Also:
MsgPumpModel.pause()

resume

public void resume()
Description copied from class: MsgPumpModel
Resumes the model.

Specified by:
resume in class MsgPumpModel
Returns:
void
See Also:
As the server cannot be paused, it cannot be resumed either

stop

public void stop()
Description copied from class: MsgPumpModel
Called when something wants the model to stop. Returns whether the caller should wait on the model until it is done or not.

Specified by:
stop in class MsgPumpModel
Returns:
boolean
See Also:
MsgPumpModel.stop()

processDataGramMsg

public void processDataGramMsg(MQeMsgObject message,
                               java.lang.String qMgrName,
                               java.lang.String qName)
Description copied from interface: MessageConsumer
A datagram message has been received.

Parameters:
message - The message to display
qMgrName - The queue manager the message is on
qName - The queue the message is on
Returns:
void
See Also:
MessageConsumer.processDataGramMsg(MQeMsgObject, String, String)

processReplyMsg

public void processReplyMsg(MQeMsgObject message,
                            java.lang.String qMgrName,
                            java.lang.String qName)
Description copied from interface: MessageConsumer
A reply message has been received.

Parameters:
message - The message to display
qMgrName - The queue manager the message is on
qName - The queue the message is on
Returns:
void
See Also:
MessageConsumer.processReplyMsg(MQeMsgObject, String, String)

processRequestMsg

public void processRequestMsg(MQeMsgObject message,
                              java.lang.String qMgrName,
                              java.lang.String qName)
Description copied from interface: MessageConsumer
A new request message has been received. Note, the message still exists on the queue, it has been browsed so will stay on the queue until a get or delete operation.

Parameters:
message - The message to display.
qMgrName - The queue manager the message is on
qName - The queue the message is on
Returns:
void
See Also:
MessageConsumer.processRequestMsg(MQeMsgObject, String, String)

processMsg

protected void processMsg(java.lang.String qMgrName,
                          java.lang.String qName,
                          MQeMsgObject msg)
A message of some form has been received, so display it and consume it ( remove it from the queue ).

Parameters:
qMgrName - The name of the queue manager
qName - The name of the queue
msg - The message to display.
Returns:
void

getRequestQueue

public java.lang.String getRequestQueue()
Gets the request queue of the server - the queue messages are pumped to.

Returns:
String - the name of the request queue

Websphere MQ Everyplace