|
Websphere MQ Everyplace | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--examples.osgi.server.MQeServerApp
Example MQe Application. An MQeQueueManager is defined and started with a listener and default queues in memory. MQe code is then run in a new thread which sits and via a message listener waits for incoming messages, any received messages are displayed in the console. This continues to listen until shutdownMQeServer() method is called at which time it stops and deletes the MQeQueueManager. This Example uses the helper class:
. MQeAdmin - used to configure MQe Components.This class contains the MQe code to create a message listener and wait for messages. It is written this way to separate the MQe configuration code from the Application code. This class is expected to be used in a particular way with the 5 main methods being called in a defined order as detailed below:
. MQeServerApp(String qmName, String regLocation) This constructor must be used, supplying the QM name and registry location to be used. . setServerAddressAndPort() Sets the servers address and port, the address is ignored here. . setupMQeServer() This defines and starts a QM in memory and then adds and starts a listener. . runTest() This creates a new MQeServer and starts it in a new thread. . shutdownMQeServer() This stops the MQeServer thread and shutsdown and deletes the QM.A main method is also supplied to enable testing of this class outside of the OSGI framework. By default the MQeTcpipHttpAdapter is used for comms and the MQeMemoryFieldsAdapter is used for registry storage. The Port to be used by the MQeListener can be configured by using the setReceiversAddressAndPort method.
Field Summary | |
static short[] |
version
|
Constructor Summary | |
MQeServerApp(java.lang.String qmName,
java.lang.String regLocation)
Constructor to create a new MQeServerApp. |
Method Summary | |
static void |
main(java.lang.String[] args)
This main method can be used to test the example outside of the OSGI framework. |
void |
messageArrived(MQeMessageEvent e)
This method is called when a message arrives on a queue. |
void |
run()
Run Method Adds the message listener to the default queue. |
void |
runTest()
This creates and starts a new MQeServerApp object in its own thread. |
void |
setServerAddressAndPort(java.lang.String targetQMIPAddress,
java.lang.String targetQMPort)
Method used to set the servers address and port. |
void |
setupMQeServer()
Checks to see if a QM is already running. |
void |
shutdownMQeServer()
This stops the MQeServer thread and shutsdown and deletes the QM. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static short[] version
Constructor Detail |
public MQeServerApp(java.lang.String qmName, java.lang.String regLocation)
Method Detail |
public void run()
run
in interface java.lang.Runnable
public void setServerAddressAndPort(java.lang.String targetQMIPAddress, java.lang.String targetQMPort)
public void setupMQeServer() throws java.lang.Exception
java.lang.Exception
public void runTest()
public void shutdownMQeServer()
public void messageArrived(MQeMessageEvent e) throws java.lang.Exception
messageArrived
in interface MQeMessageListenerInterface
e
- com.ibm.mqe.MQeMessageEvent
java.lang.Exception
public static void main(java.lang.String[] args)
|
Websphere MQ Everyplace | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |