org.jpu.patterns.serviceLocator
Interface ILocator.INarrowStrategy

All Known Implementing Classes:
Locator.DefaultNarrowStrategy
Enclosing interface:
ILocator

public static interface ILocator.INarrowStrategy

Defines the interface for strategies that narrow objects. Narrowing is necessary for remote objects and is usually done through "PortableRemoteObject.narrow()". The default implementation Locator.DefaultNarrowStrategy uses this form of narrowing. To set your own narrow strategy, either override ILocator.newNarrowStrategy() or call ILocator.setNarrowStrategy(org.jpu.patterns.serviceLocator.ILocator.INarrowStrategy).


Method Summary
 java.lang.Object narrow(java.lang.Object o, java.lang.Class c)
          Narrows the given object to the given type.
 

Method Detail

narrow

public java.lang.Object narrow(java.lang.Object o,
                               java.lang.Class c)
                        throws ServiceLocatorException
Narrows the given object to the given type. If either o or c are null, this method returns o. Otherwise it attempts to narrow using PortableRemoteObject.narrow() and rethrows any exceptions as ServiceLocatorException, wrapping the original exception.

Subclasses are free to override this method; in particular, local homes should not be narrowed using PortableRemoteObject.narrow().

Throws:
ServiceLocatorException


Copyright (c) 2001-2003 - Apache Software Foundation