Using a Service Locator

See Also

A service locator is a class that provides a single, reusable way to obtain a reference to the following:

You can create a regular service locator or one that caches the obtained reference for further use. Generally you use a caching service regulator in web applications and a regular service locator in the business tier. Enterprise beans especially need non-caching service locators. Because each enterprise bean has a unique JNDI name space, a resource reference with the same name can be declared in multiple enterprise beans, potentially with different types.

To create a service locator:

  1. Choose File > New.
  2. From the Enterprise category, select Service Locator or Caching Service Locator.

To use a service locator:

  1. Run any of the following commands:
  2. In the Service Locator Strategy section, select Use Existing Class and specify the class name of the service locator. You can use the Browse button to search for the class.

Notes:

See Also
Calling an Enterprise Bean
Sending a JMS Message
Accessing a Connection Pool from a Java Class
Sending an E-mail from a Java File

Legal Notices