All Examples This Package JMS Examples
Class examples.jms.startup.ServerReceive
examples.jms.startup.ServerReceive
- public class ServerReceive
This example shows how to establish a JMS message consumer
from a WebLogic Startup Class. Startup classes are loaded
and executed when the server is first started. The
ServerReceive startup
class establishes a single message listener. As messages are
received from the tropic they are displayed in shell running the WebLogic Server.
You can use the
TopicSend client
to send messages to the Topic.
Configure the server:
-
Add the following properties to your weblogic.properties file:
weblogic.system.startupClass.serverReceive=examples.jms.startup.ServerReceive
weblogic.system.startupArgs.serverReceive=\
connectionFactory=javax.jms.TopicConnectionFactory,\
topic=javax.jms.exampleTopic
Build the example:
-
Set up your development shell, as described in
Setting up
your environment.
-
Compile the file in this directory as shown in this examples for Windows NT:
$ javac -d %SERVER_CLASSES% ServerReceive.java
Run the example:
-
Start the WebLogic Server in a new command shell.
-
Start the
TopicSend client in your
development shell and send messages to the topic.
The
ServerReceive startup class displays messages in the shell running
WebLogic Server as they are
received from the Topic.
- Author:
- Copyright (c) 1999-2000 by BEA Systems, Inc. All Rights Reserved.
-
ServerReceive()
-
-
onMessage(Message)
-
-
setServices(T3ServicesDef)
- The setServices() method passes to the
startup class the handle of an object that can be used
to access WebLogic services.
-
startup(String, Hashtable)
-
ServerReceive
public ServerReceive()
setServices
public void setServices(T3ServicesDef services)
- The setServices() method passes to the
startup class the handle of an object that can be used
to access WebLogic services. This makes another reference
to the services object so it can be used later.
- Parameters:
- services - Services stub
startup
public String startup(String name,
Hashtable args) throws Exception
onMessage
public void onMessage(Message msg)
All Examples This Package JMS Examples