org.jomc.ri
Class DefaultLocator

Package class diagram package DefaultLocator
java.lang.Object
  extended by org.jomc.ri.DefaultLocator
All Implemented Interfaces:
org.jomc.spi.Locator

@Generated(value="org.jomc.tools.JavaSources",
           comments="See http://jomc.sourceforge.net/jomc/1.0-alpha-11/jomc-tools")
public class DefaultLocator
extends Object
implements org.jomc.spi.Locator

Default Locator implementation. The default Locator implementation looks up objects using JNDI. It supports location URI schemes jndi and jndi+rmi.

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

Constructor Summary
DefaultLocator()
          Creates a new DefaultLocator instance.
 
Method Summary
 Context getJndiContext()
          Gets the JNDI context of the instance.
 String getJndiName(URI location)
          Gets the JNDI name for a given location.
<T> T
getObject(Class<T> specification, URI location)
           
 boolean isLocationSupported(URI location)
          Gets a flag indicating support for a given location URI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultLocator

@Generated(value="org.jomc.tools.JavaSources",
           comments="See http://jomc.sourceforge.net/jomc/1.0-alpha-11/jomc-tools")
public DefaultLocator()
Creates a new DefaultLocator instance.

Method Detail

isLocationSupported

public boolean isLocationSupported(URI location)
Gets a flag indicating support for a given location URI.

Parameters:
location - The location URI to test support for.
Returns:
true if location is supported by this implementation; false else.
Throws:
NullPointerException - if location is null.

getJndiContext

public Context getJndiContext()
                       throws NamingException
Gets the JNDI context of the instance.

Returns:
The JNDI context of the instance.
Throws:
NamingException - if getting the context fails.

getJndiName

public String getJndiName(URI location)
Gets the JNDI name for a given location.

Parameters:
location - The location to get a JNDI name for.
Returns:
The JNDI name for location.
Throws:
NullPointerException - if location is null.

getObject

public <T> T getObject(Class<T> specification,
                       URI location)
            throws IOException
Specified by:
getObject in interface org.jomc.spi.Locator
Throws:
IOException


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