Top Description Fields Constructors Methods
org.mortbay.jetty.plus.naming

public abstract Class NamingEntry

extends Object
Class Inheritance
Known Direct Subclasses
org.mortbay.jetty.plus.naming.Resource, org.mortbay.jetty.plus.naming.Transaction, org.mortbay.jetty.plus.naming.EnvEntry, org.mortbay.jetty.plus.naming.Link
Imports
javax.naming.Context, .InitialContext, .LinkRef, .Name, .NameParser, .NamingException, org.mortbay.log.Log, org.mortbay.naming.NamingUtil

NamingEntry Base class for all jndi related entities. Instances of subclasses of this class are declared in jetty.xml or in a webapp's WEB-INF/jetty-env.xml file.

Note

that all NamingEntries will be bound in a single namespace. The "global" level is just in the top level context. The "local" level is a context specific to a webapp.

Field Summary

Modifier and TypeField and Description
public static final String
protected String
protected String
protected String
protected Object

Constructor Summary

AccessConstructor and Description
public
NamingEntry(Object scope, String jndiName, Object object)

public
NamingEntry(String
the name of the object which will eventually be in java:comp/env
jndiName
,
Object
the object to be bound
object
)

Create a NamingEntry.

Method Summary

Modifier and TypeMethod and Description
public void
bindToENC(String localName)

Add a java:comp/env binding for the object represented by this NamingEntry, but bind it as the name supplied

public String
getJndiName()

Get the unique name of the object

public Object
getObjectToBind()

Get the object that is to be bound

public void
release()

Unbind this NamingEntry entirely

protected void
save(Object scope)

Save the NamingEntry for later use.

public void
unbindENC()

Unbind this NamingEntry from a java:comp/env

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

__contextNameback to summary
public static final String __contextName
jndiNameback to summary
protected String jndiName
namingEntryNameStringback to summary
protected String namingEntryNameString
objectNameStringback to summary
protected String objectNameString
objectToBindback to summary
protected Object objectToBind

Constructor Detail

NamingEntryback to summary
public NamingEntry(Object scope, String jndiName, Object object) throws NamingException
NamingEntryback to summary
public NamingEntry(String jndiName, Object object) throws NamingException

Create a NamingEntry. A NamingEntry is a name associated with a value which can later be looked up in JNDI by a webapp. We create the NamingEntry and put it into JNDI where it can be linked to the webapp's env-entry, resource-ref etc entries.

Parameters
jndiName:String

the name of the object which will eventually be in java:comp/env

object:Object

the object to be bound

Method Detail

bindToENCback to summary
public void bindToENC(String localName) throws NamingException

Add a java:comp/env binding for the object represented by this NamingEntry, but bind it as the name supplied

getJndiNameback to summary
public String getJndiName()

Get the unique name of the object

getObjectToBindback to summary
public Object getObjectToBind() throws NamingException

Get the object that is to be bound

releaseback to summary
public void release()

Unbind this NamingEntry entirely

saveback to summary
protected void save(Object scope) throws NamingException

Save the NamingEntry for later use. Saving is done by binding the NamingEntry itself, and the value it represents into JNDI. In this way, we can link to the value it represents later, but also still retrieve the NamingEntry itself too. The object is bound at the jndiName passed in. This NamingEntry is bound at __/jndiName. eg jdbc/foo : DataSource __/jdbc/foo : NamingEntry

unbindENCback to summary
public void unbindENC()

Unbind this NamingEntry from a java:comp/env