|
| WebLogic Server 6.0 Code Examples, BEA Systems, Inc. |
SUMMARY: INNER | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD |
examples.jms.startup
Class PoolReceive
java.lang.Object
|
+--examples.jms.startup.PoolReceive
- All Implemented Interfaces:
- weblogic.common.T3StartupDef
- public class PoolReceive
- extends java.lang.Object
- implements weblogic.common.T3StartupDef
This example shows how to establish
a pool of message listeners
(MsgListener class)
from a startup class. As messages are
received from the topic they are displayed in the shell running
the WebLogic Server.
You can use the
TopicSend client
to send messages to the topic.
The following sections describe how to:
- Build the example
- Configure the server
- Run the example
- Set up your development shell, as described in
Setting up
your environment.
-
Compile the example by executing the following command or by executing the
build script
provided for this example in the samples/examples/jms/startup
directory. The script will perform the following step:
Compile the PoolReceive as shown in this example for Windows NT/2000:
$ javac -d %SERVER_CLASSES% MsgListener.java PoolReceive.java
The WebLogic startup class has been preconfigured for you convenience. You must deploy
the startup class on the server, as described in the following procedure.
To configure the server:
-
Start the server with the examples configuration.
-
Bring up the Administration Console in your browser.
-
Click to expand the Deployments node in the left pane.
-
Click to expand the Startup & Shutdown node in the left pane.
-
Choose the server target for the poolReceive startup class as follows:
-
Select the poolReceive node.
The poolReceive startup class configuration information displays
in the right pane.
-
Select the Targets tab in the right pane to display the Available and Chosen
targets.
-
Move the examplesServer target to the Chosen column and click the Apply button to
save the assignment.
Note: If you have configured the server to run the examples.jms.topic
example, then no additional configuration changes are required to run the
ServerReceive example. You can skip to the section Run the Example.
-
Click to expand the JMS node in the left pane.
-
Click to expand the JMS Connection Factories node in the left pane.
-
Choose the server target for the exampleTopic connection factory as follows:
-
Select the exampleTopic node.
The exampleTopic connection factory configuration information displays
in the right pane.
-
Select the Targets tab in the right pane to display the Available and Chosen
targets.
-
Move the examplesServer target to the Chosen column and click the Apply button to
save the assignment.
Note: Normally, you would also have to choose one or more targets for the JMS server
associated with the topic.
For your convenience, the examplesJMSServer server
has been preconfigured to include the examplesServer as a chosen target.
Run the Example
-
Restart the server to
invoke the startup class.
-
Start the
TopicSend client in your
development shell and send messages to the topic.
The messages are displayed in the shell running
WebLogic Server as they are
received from the topic. Send messages at less than 1 second intervals
to see the pool in action.
- Author:
- Copyright (c) 1999-2000 by BEA Systems, Inc. All Rights Reserved.
Method Summary |
void |
setServices(weblogic.common.T3ServicesDef services)
Pass to the startup class the handle of an object that can be used
to access WebLogic services. |
java.lang.String |
startup(java.lang.String name,
java.util.Hashtable args)
Create consumer. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PoolReceive
public PoolReceive()
setServices
public void setServices(weblogic.common.T3ServicesDef services)
- Pass 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.
- Specified by:
setServices
in interface weblogic.common.T3StartupDef
- Parameters:
services
- Services stub.
startup
public java.lang.String startup(java.lang.String name,
java.util.Hashtable args)
throws java.lang.Exception
- Create consumer.
- Specified by:
startup
in interface weblogic.common.T3StartupDef
- Parameters:
name
- Name.args
- Hashtable.- Throws:
java.lang.Exception
- if problems occurs
Copyright © 2000 BEA Systems, Inc. All Rights Reserved.