org.jomc.ri
Class DefaultLocator

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

@Generated(value="org.jomc.tools.JavaSources",
           comments="See http://jomc.sourceforge.net/jomc/1.0-alpha-1/jomc-tools")
public class DefaultLocator
extends Object
implements 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 540 2009-09-21 18:50:19Z schulte2005 $
Author:
Christian Schulte 1.0

Field Summary
private static String JNDI_RMI_URI_SCHEME
          Constant for the 'jndi+rmi' URI scheme.
private static String JNDI_URI_SCHEME
          Constant for the 'jndi' URI scheme.
private  Context jndiContext
          The JNDI context of the instance.
private static String[] SUPPORTED_URI_SCHEMES
          URI schemes supported by this Locator implementation.
 
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.
private  String getMessage(String key, Object args)
           
<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
 

Field Detail

JNDI_URI_SCHEME

private static final String JNDI_URI_SCHEME
Constant for the 'jndi' URI scheme.

See Also:
Constant Field Values

JNDI_RMI_URI_SCHEME

private static final String JNDI_RMI_URI_SCHEME
Constant for the 'jndi+rmi' URI scheme.

See Also:
Constant Field Values

SUPPORTED_URI_SCHEMES

private static final String[] SUPPORTED_URI_SCHEMES
URI schemes supported by this Locator implementation.


jndiContext

private Context jndiContext
The JNDI context of the instance.

Constructor Detail

DefaultLocator

@Generated(value="org.jomc.tools.JavaSources",
           comments="See http://jomc.sourceforge.net/jomc/1.0-alpha-1/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 Locator
Throws:
IOException

getMessage

private String getMessage(String key,
                          Object args)


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