|
Websphere MQ Everyplace | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--examples.midp.exampleapp.msgpump.MsgPumpModel
This is the basic outline of a message pump model. The model is the part of the system that does everything whereas the controller is the part that decides what needs to be done.
The model contains an MQeMessageService, which handles the queue manager, queues and other parts of MQe. It also contains a link to its controller, which is used if a decision needs to be made or if the user eed to be prompted for something.
The model part of the system will not be dependant on whether it is using MIDP, Foundation, J2SE or any other versions of java as it should be independant of these things; the controller will handle all java-version specific things. For this reason, when a message is sent and includes a timestamp, since MIDP does not contain the functions necessary to easily obtain a timestamp, this has been done manually within the model - hence the getTimestamp() and padNumber() functions.
Field Summary | |
java.lang.String |
compressor
The pump's compressor. |
java.lang.String |
cryptor
The pump's cryptor. |
static int |
DEFAULT_SECURITY
The default security value. |
static java.lang.String |
DEFAULT_SERVER_Q_NAME
The default name of the server queue being pumped to. |
static java.lang.String |
DEFAULT_SERVER_QM_NAME
The default name of the server queue manager. |
static int |
MESSAGE_SECURITY
|
static int |
NO_SECURITY
|
static int |
QUEUE_SECURITY
|
static java.lang.String |
SECURITY_KEY
The key used for encrypting messages with message based security. |
boolean |
sync
Shows whether the queues are synchronous or not . |
static short[] |
version
|
Constructor Summary | |
MsgPumpModel()
|
Method Summary | |
void |
createMessageAttribute()
Creates a new message attribute to use. |
void |
finish()
Any final actions necessary to finish stopping the model. |
protected MsgPumpController |
getController()
Returns the model's controller. |
java.lang.String |
getLocalQMname()
Gets the local queue manager name. |
MQeAttribute |
getMessageAttribute()
Returns the messsage attribute or, if none exists, creates a new one. |
protected MQeMessageService |
getMsgService()
Returns the model's message service ( creating a new one if necessary ). |
java.lang.String |
getQMrules()
Gets the rules used to configure the queue manager. |
protected java.lang.String |
getTimestamp()
Returns a nicely formatted datetimestamp. |
void |
initialize(MsgPumpController controller,
java.lang.String localQMname)
Used to initialize a message pump model. |
boolean |
isSecurity(int security)
Returns whether the security type being used matches the given type. |
protected java.lang.String |
padNumber(int size,
int number)
Given a number and a size, this function will return the original number padded with zeroes to fill in the spaces ( as a String ). |
abstract void |
pause()
Pauses the model. |
protected abstract void |
performInitialConfiguration()
Used to initially set up the queue manager, queues and anything else required by the model ( listeners etc ). |
void |
processStatus(java.lang.String statusMessage)
Used to process a message before it is displayed. |
abstract void |
resume()
Resumes the model. |
protected void |
setController(MsgPumpController controller)
Sets the model's controller. |
protected void |
setProperty(java.lang.String property,
java.lang.String value)
Sets a property of the pump. |
abstract void |
stop()
Called when something wants the model to stop. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.lang.Runnable |
run |
Methods inherited from interface examples.midp.exampleapp.messageservice.MessageConsumer |
processDataGramMsg, processReplyMsg, processRequestMsg |
Field Detail |
public static short[] version
public static final java.lang.String DEFAULT_SERVER_QM_NAME
public static final java.lang.String DEFAULT_SERVER_Q_NAME
public static final int NO_SECURITY
public static final int MESSAGE_SECURITY
public static final int QUEUE_SECURITY
public static final int DEFAULT_SECURITY
public static final java.lang.String SECURITY_KEY
public final java.lang.String cryptor
public final java.lang.String compressor
public final boolean sync
Constructor Detail |
public MsgPumpModel()
Method Detail |
public boolean isSecurity(int security)
security
- The security type
public void initialize(MsgPumpController controller, java.lang.String localQMname) throws java.lang.Exception
controller
- Link to this model's controllerlocalQMname
- Name of local queue manager
java.lang.Exception
protected MQeMessageService getMsgService()
public void finish() throws java.lang.Exception
java.lang.Exception
protected void setProperty(java.lang.String property, java.lang.String value)
property
- The propertyvalue
- The value to set it to
public void processStatus(java.lang.String statusMessage)
processStatus
in interface MessageConsumer
statusMessage
- The message to be displayed
protected java.lang.String getTimestamp()
Note - 'nicely' means US format 'hh:mm mm/dd/yy'.
Should only be used to generate a timestamp for a message to be sent.
protected java.lang.String padNumber(int size, int number)
size
- The size to pad number out tonumber
- The number to pad
protected MsgPumpController getController()
protected void setController(MsgPumpController controller)
public java.lang.String getLocalQMname()
public java.lang.String getQMrules()
public MQeAttribute getMessageAttribute() throws java.lang.Exception
java.lang.Exception
public void createMessageAttribute() throws java.lang.Exception
java.lang.Exception
protected abstract void performInitialConfiguration() throws java.lang.Exception
java.lang.Exception
public abstract void stop()
public abstract void pause()
public abstract void resume()
|
Websphere MQ Everyplace | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |