org.jpu.patterns.serviceLocator
Class Locator.DefaultLookupStrategy

java.lang.Object
  extended byorg.jpu.patterns.serviceLocator.Locator.DefaultLookupStrategy
All Implemented Interfaces:
ILocator.ILookupStrategy
Direct Known Subclasses:
opctest.BogusLookupStrategy
Enclosing class:
Locator

public static class Locator.DefaultLookupStrategy
extends java.lang.Object
implements ILocator.ILookupStrategy

Simple lookup strategy implementation based on "new InitialContext(System.getProperties()).lookup()".


Constructor Summary
Locator.DefaultLookupStrategy(Locator locator)
           
 
Method Summary
protected  java.util.Properties getJndiProperties(java.util.Properties props)
           
 java.util.Properties getProperties()
           
 java.lang.Object lookup(java.lang.String namingIdentifier, ServiceLocatorOptions options)
          Looks up the object with the given name and returns it, or throws an exception if it can't be found.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Locator.DefaultLookupStrategy

public Locator.DefaultLookupStrategy(Locator locator)
Method Detail

getProperties

public java.util.Properties getProperties()
Specified by:
getProperties in interface ILocator.ILookupStrategy

getJndiProperties

protected java.util.Properties getJndiProperties(java.util.Properties props)

lookup

public java.lang.Object lookup(java.lang.String namingIdentifier,
                               ServiceLocatorOptions options)
                        throws ServiceLocatorException
Description copied from interface: ILocator.ILookupStrategy
Looks up the object with the given name and returns it, or throws an exception if it can't be found. The ServiceLocatorOptions object passed to ILocator.getObject(String) is passed to this method.

This method should not narrow the object as that will be done by the caller.

Specified by:
lookup in interface ILocator.ILookupStrategy
Throws:
ServiceLocatorException


Copyright (c) 2001-2003 - Apache Software Foundation