Chapter 13. Startup beans 385
In Example 13-2, you can see part of what is displayed in the test environment
server output console. For more detailed traces of startup service execution for
this sample, refer to 13.7, “Problem determination” on page 390.
Example 13-2 Output from Startup bean on the Console
SystemErr **************************************************
SystemOut Startup bean: starting...
SystemOut Startup bean: Executing SayHello() method
SystemOut Hello World
SystemOut Startup bean: Finished executing SayHello() method
SystemErr **************************************************
13.5 Assembly
At assembly time, you may need to specify the following settings for Startup
򐂰 Startup Bean priorities
򐂰 Security identity
򐂰 Transactional properties
Startup bean priorities
If there is more than one Startup Bean in your application, you can specify
priorities among them. See 13.5.1, “Priorities when using multiple Startup beans”
on page 386 for further details.
Security identity
You can set security for the bean using the Application Server Toolkit. You will
need to install this as it is a separate executable from WebSphere Studio
Application Developer Integration Edition V5.1.
In the J2EE perspective, double-click StartupEJB to open the EJB Deployment
Descriptor. On the Assembly Descriptor tab, you can create roles, define method
permissions (you can set security on your start and stop methods) and set
transactional properties on these methods as seen in Figure 13-4 on page 386.
386 WebSphere Business Integrator Server Foundation V5.1 Handbook
Figure 13-4 Setting security for the Startup EJB
For further information, consult the appropriate topics in the Help at WebSphere
Developing EJB Applications Editing the EJB Deployment
Defining the assembly settings.
JNDI considerations
During application assembly, we can specify a JNDI name for the Startup Bean.
However, Startup beans are not exposed in JNDI this is not required since the
only client for Startup Beans is the application server runtime.
13.5.1 Priorities when using multiple Startup beans
When an application has more than one Startup Bean, an environment property
must be defined on each Startup Bean. The name of this priority must be
wasStartupPriority and its type must be java.lang.Integer. In Figure 13-5 on
page 387, you can see how to add an environment property in WebSphere
Studio or in the Application Server Toolkit.
The default priority of a Startup Bean is 0. The property can be looked up using
JNDI via java:comp/env/wasStartupPriority.
Within one application’s scope, a Startup Bean with a higher priority will be
executed first. Beans with the same priority will be executed in undefined order.
Beans are stopped in the reverse order that they are started in.

Get WebSphere Business Integration Server Foundation V5.1 Handbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.