org.jomc.spi
Interface Locator

Package class diagram package Locator

@Generated(value="org.jomc.tools.JavaSources",
           comments="See http://jomc.sourceforge.net/jomc/1.0-alpha-11/jomc-tools")
public interface Locator

Locates objects.

This specification declares a multiplicity of Many. An application assembler may provide multiple implementations of this specification (including none). Use of class ObjectManager is supported for getting these implementations or for selecting a single implementation.

 Locator[] objects = (Locator[]) ObjectManagerFactory.getObjectManager( getClassLoader() ).getObject( Locator.class );
 Locator object = ObjectManagerFactory.getObjectManager( getClassLoader() ).getObject( Locator.class, "implementation name" );
 

This specification does not apply to any scope. A new object is returned whenever requested.

Version:
$Id: Locator.java 1102 2009-12-07 03:01:58Z schulte2005 $
Author:
Christian Schulte 1.0

Method Summary
<T> T
getObject(Class<T> specification, URI location)
          Gets an object for a given location URI.
 

Method Detail

getObject

<T> T getObject(Class<T> specification,
                URI location)
            throws NullPointerException,
                   IOException
Gets an object for a given location URI.

Type Parameters:
T - The type of the object.
Parameters:
specification - The specification class of the object to locate.
location - The location URI of the object to locate.
Returns:
The object located at location or null if no object is found at location.
Throws:
NullPointerException - if specification or location is null.
IOException - if locating the object fails.


Copyright © 2005-2009 The JOMC Project. All Rights Reserved.