org.ow2.carol.jndi.spi
Class VirtualJNDILookup

java.lang.Object
  extended by org.ow2.carol.jndi.spi.VirtualJNDILookup
All Implemented Interfaces:
Context

public class VirtualJNDILookup
extends Object
implements Context

Handles virtual JNDI lookup.

Author:
S. Ali Tokmen

Field Summary
 
Fields inherited from interface javax.naming.Context
APPLET, AUTHORITATIVE, BATCHSIZE, DNS_URL, INITIAL_CONTEXT_FACTORY, LANGUAGE, OBJECT_FACTORIES, PROVIDER_URL, REFERRAL, SECURITY_AUTHENTICATION, SECURITY_CREDENTIALS, SECURITY_PRINCIPAL, SECURITY_PROTOCOL, STATE_FACTORIES, URL_PKG_PREFIXES
 
Constructor Summary
VirtualJNDILookup(Context parent)
          Saves the parent context.
 
Method Summary
 Object addToEnvironment(String propName, Object propVal)
          Calls the parent.
 void bind(Name name, Object obj)
          Calls the parent.
 void bind(String name, Object obj)
          Calls the parent.
 void close()
          Calls the parent.
 Name composeName(Name name, Name prefix)
          Calls the parent.
 String composeName(String name, String prefix)
          Calls the parent.
 Context createSubcontext(Name name)
          Calls the parent.
 Context createSubcontext(String name)
          Calls the parent.
 void destroySubcontext(Name name)
          Calls the parent.
 void destroySubcontext(String name)
          Calls the parent.
 Hashtable<?,?> getEnvironment()
          Calls the parent.
 String getNameInNamespace()
          Calls the parent.
 NameParser getNameParser(Name name)
          Calls the parent.
 NameParser getNameParser(String name)
          Calls the parent.
protected  String getPrefix()
          Gets the JNDI naming prefix.
static VersioningService getVersioningService()
           
 NamingEnumeration<NameClassPair> list(Name name)
          Calls the parent.
 NamingEnumeration<NameClassPair> list(String name)
          Calls the parent.
 NamingEnumeration<Binding> listBindings(Name name)
          Calls the parent.
 NamingEnumeration<Binding> listBindings(String name)
          Calls the parent.
 Object lookup(Name name)
           
 Object lookup(String name)
          Retrieves the named object using the prefixed naming strategy: First, the name prefix + name is looked up.
 Object lookupLink(Name name)
           
 Object lookupLink(String name)
          Retrieves the named object using the prefixed naming strategy: First, the name prefix + name is looked up.
 void rebind(Name name, Object obj)
          Calls the parent.
 void rebind(String name, Object obj)
          Calls the parent.
 Object removeFromEnvironment(String propName)
          Calls the parent.
 void rename(Name oldName, Name newName)
          Calls the parent.
 void rename(String oldName, String newName)
          Calls the parent.
static void setVersioningService(VersioningService versioningService)
           
 void unbind(Name name)
          Calls the parent.
 void unbind(String name)
          Calls the parent.
static void unsetVersioningService()
          Sets the versioning service to null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VirtualJNDILookup

public VirtualJNDILookup(Context parent)
Saves the parent context.

Parameters:
parent - Parent context.
Method Detail

lookup

public Object lookup(String name)
              throws NamingException
Retrieves the named object using the prefixed naming strategy: Note that name is looked up directly if no prefix exists.

Specified by:
lookup in interface Context
Parameters:
name - Name of the object to look up
Returns:
The object bound to name
Throws:
NamingException - If a naming exception is encountered

lookup

public Object lookup(Name name)
              throws NamingException
Specified by:
lookup in interface Context
Parameters:
name - Name of the object to look up
Returns:
The object bound to name
Throws:
NamingException - If a naming exception is encountered
See Also:
lookup(String)

lookupLink

public Object lookupLink(String name)
                  throws NamingException
Retrieves the named object using the prefixed naming strategy: Note that name is looked up directly if no prefix exists.

Specified by:
lookupLink in interface Context
Parameters:
name - Name of the object to look up
Returns:
The object bound to name, not following the terminal link (if any)
Throws:
NamingException - if a naming exception is encountered

lookupLink

public Object lookupLink(Name name)
                  throws NamingException
Specified by:
lookupLink in interface Context
Parameters:
name - Name of the object to look up
Returns:
The object bound to name, not following the terminal link (if any)
Throws:
NamingException - if a naming exception is encountered
See Also:
lookupLink(String)

getPrefix

protected String getPrefix()
Gets the JNDI naming prefix. This can be set using the EAR or the via the InitialContext properties.

Returns:
JNDI naming prefix to use, null if none found.

setVersioningService

public static void setVersioningService(VersioningService versioningService)
Parameters:
versioningService - The versioning service to set.

unsetVersioningService

public static void unsetVersioningService()
Sets the versioning service to null.


getVersioningService

public static VersioningService getVersioningService()
Returns:
The versioning service.

addToEnvironment

public Object addToEnvironment(String propName,
                               Object propVal)
                        throws NamingException
Calls the parent.

Specified by:
addToEnvironment in interface Context
Throws:
NamingException

bind

public void bind(Name name,
                 Object obj)
          throws NamingException
Calls the parent.

Specified by:
bind in interface Context
Throws:
NamingException

bind

public void bind(String name,
                 Object obj)
          throws NamingException
Calls the parent.

Specified by:
bind in interface Context
Throws:
NamingException

close

public void close()
           throws NamingException
Calls the parent.

Specified by:
close in interface Context
Throws:
NamingException

composeName

public Name composeName(Name name,
                        Name prefix)
                 throws NamingException
Calls the parent.

Specified by:
composeName in interface Context
Throws:
NamingException

composeName

public String composeName(String name,
                          String prefix)
                   throws NamingException
Calls the parent.

Specified by:
composeName in interface Context
Throws:
NamingException

createSubcontext

public Context createSubcontext(Name name)
                         throws NamingException
Calls the parent.

Specified by:
createSubcontext in interface Context
Throws:
NamingException

createSubcontext

public Context createSubcontext(String name)
                         throws NamingException
Calls the parent.

Specified by:
createSubcontext in interface Context
Throws:
NamingException

destroySubcontext

public void destroySubcontext(Name name)
                       throws NamingException
Calls the parent.

Specified by:
destroySubcontext in interface Context
Throws:
NamingException

destroySubcontext

public void destroySubcontext(String name)
                       throws NamingException
Calls the parent.

Specified by:
destroySubcontext in interface Context
Throws:
NamingException

getEnvironment

public Hashtable<?,?> getEnvironment()
                              throws NamingException
Calls the parent.

Specified by:
getEnvironment in interface Context
Throws:
NamingException

getNameInNamespace

public String getNameInNamespace()
                          throws NamingException
Calls the parent.

Specified by:
getNameInNamespace in interface Context
Throws:
NamingException

getNameParser

public NameParser getNameParser(Name name)
                         throws NamingException
Calls the parent.

Specified by:
getNameParser in interface Context
Throws:
NamingException

getNameParser

public NameParser getNameParser(String name)
                         throws NamingException
Calls the parent.

Specified by:
getNameParser in interface Context
Throws:
NamingException

list

public NamingEnumeration<NameClassPair> list(Name name)
                                      throws NamingException
Calls the parent.

Specified by:
list in interface Context
Throws:
NamingException

list

public NamingEnumeration<NameClassPair> list(String name)
                                      throws NamingException
Calls the parent.

Specified by:
list in interface Context
Throws:
NamingException

listBindings

public NamingEnumeration<Binding> listBindings(Name name)
                                        throws NamingException
Calls the parent.

Specified by:
listBindings in interface Context
Throws:
NamingException

listBindings

public NamingEnumeration<Binding> listBindings(String name)
                                        throws NamingException
Calls the parent.

Specified by:
listBindings in interface Context
Throws:
NamingException

rebind

public void rebind(Name name,
                   Object obj)
            throws NamingException
Calls the parent.

Specified by:
rebind in interface Context
Throws:
NamingException

rebind

public void rebind(String name,
                   Object obj)
            throws NamingException
Calls the parent.

Specified by:
rebind in interface Context
Throws:
NamingException

removeFromEnvironment

public Object removeFromEnvironment(String propName)
                             throws NamingException
Calls the parent.

Specified by:
removeFromEnvironment in interface Context
Throws:
NamingException

rename

public void rename(Name oldName,
                   Name newName)
            throws NamingException
Calls the parent.

Specified by:
rename in interface Context
Throws:
NamingException

rename

public void rename(String oldName,
                   String newName)
            throws NamingException
Calls the parent.

Specified by:
rename in interface Context
Throws:
NamingException

unbind

public void unbind(Name name)
            throws NamingException
Calls the parent.

Specified by:
unbind in interface Context
Throws:
NamingException

unbind

public void unbind(String name)
            throws NamingException
Calls the parent.

Specified by:
unbind in interface Context
Throws:
NamingException


Copyright © 2010 OW2 Consortium. All Rights Reserved.