|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.naming.resources.BaseDirContext org.apache.naming.resources.FileDirContext org.apache.naming.resources.VirtualDirContext
public class VirtualDirContext
Extended FileDirContext implementation that will allow loading of tld files
from the META-INF directory (or subdirectories) in classpath. This will fully
mimic the behavior of compressed jars also when using unjarred resources. Tld
files can be loaded indifferently from WEB-INF webapp dir (or subdirs) or
from META-INF dir from jars available in the classpath: using this DirContext
implementation you will be able to use unexpanded jars during development and
to make any tld in them virtually available to the webapp.
Sample context xml configuration:
<Context docBase="\webapps\mydocbase">
<Resources className="org.apache.naming.resources.VirtualDirContext"
virtualClasspath="\dir\classes;\somedir\somejar.jar"/>
</Resources>
This is not meant to be used for production.
Its meant to ease development with IDE's without the
need for fully republishing jars in WEB-INF/lib
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.naming.resources.FileDirContext |
---|
FileDirContext.FileResource, FileDirContext.FileResourceAttributes |
Field Summary |
---|
Fields inherited from class org.apache.naming.resources.FileDirContext |
---|
absoluteBase, allowLinking, base, BUFFER_SIZE, caseSensitive |
Fields inherited from class org.apache.naming.resources.BaseDirContext |
---|
cached, cacheMaxSize, cacheObjectMaxSize, cacheTTL, docBase, env, nameParser, sm |
Fields inherited from interface javax.naming.directory.DirContext |
---|
ADD_ATTRIBUTE, REMOVE_ATTRIBUTE, REPLACE_ATTRIBUTE |
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 | |
---|---|
VirtualDirContext()
|
Method Summary | |
---|---|
void |
allocate()
Allocate resources for this directory context. |
javax.naming.directory.Attributes |
getAttributes(java.lang.String name)
Retrieves all of the attributes associated with a named object. |
protected java.util.ArrayList |
list(java.io.File file)
List the resources which are members of a collection. |
java.lang.Object |
lookup(java.lang.String name)
Retrieves the named object. |
void |
release()
Release any resources allocated for this directory context. |
void |
setVirtualClasspath(java.lang.String path)
virtualClasspath attribute that will be automatically set
from the Context virtualClasspath attribute
from the context xml file. |
Methods inherited from class org.apache.naming.resources.FileDirContext |
---|
bind, createSubcontext, destroySubcontext, file, getAllowLinking, getAttributes, getNameInNamespace, getSchema, getSchemaClassDefinition, isCaseSensitive, list, listBindings, lookupLink, modifyAttributes, modifyAttributes, normalize, rebind, rename, search, search, search, search, setAllowLinking, setCaseSensitive, setDocBase, unbind |
Methods inherited from class org.apache.naming.resources.BaseDirContext |
---|
addToEnvironment, bind, bind, bind, close, composeName, composeName, createSubcontext, createSubcontext, createSubcontext, destroySubcontext, getAttributes, getAttributes, getCacheMaxSize, getCacheObjectMaxSize, getCacheTTL, getDocBase, getEnvironment, getNameParser, getNameParser, getSchema, getSchemaClassDefinition, isCached, list, listBindings, lookup, lookupLink, modifyAttributes, modifyAttributes, rebind, rebind, rebind, removeFromEnvironment, rename, search, search, search, search, setCached, setCacheMaxSize, setCacheObjectMaxSize, setCacheTTL, unbind |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VirtualDirContext()
Method Detail |
---|
public void setVirtualClasspath(java.lang.String path)
virtualClasspath
attribute that will be automatically set
from the Context
virtualClasspath
attribute
from the context xml file.
path
- ;
separated list of path elements.public void allocate()
allocate
in class BaseDirContext
public void release()
release
in class FileDirContext
public javax.naming.directory.Attributes getAttributes(java.lang.String name) throws javax.naming.NamingException
BaseDirContext
getAttributes
in interface javax.naming.directory.DirContext
getAttributes
in class BaseDirContext
name
- the name of the object from which to retrieve attributes
javax.naming.NamingException
- if a naming exception is encounteredprotected java.util.ArrayList list(java.io.File file)
FileDirContext
list
in class FileDirContext
file
- Collection
public java.lang.Object lookup(java.lang.String name) throws javax.naming.NamingException
FileDirContext
lookup
in interface javax.naming.Context
lookup
in class FileDirContext
name
- the name of the object to look up
javax.naming.NamingException
- if a naming exception is encountered
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |