本文整理了Java中org.eclipse.jetty.webapp.WebAppContext.getAttribute()
方法的一些代码示例,展示了WebAppContext.getAttribute()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebAppContext.getAttribute()
方法的具体详情如下:
包路径:org.eclipse.jetty.webapp.WebAppContext
类名称:WebAppContext
方法名:getAttribute
暂无
代码示例来源:origin: apache/hbase
/**
* Get the value in the webapp context.
* @param name The name of the attribute
* @return The value of the attribute
*/
public Object getAttribute(String name) {
return webAppContext.getAttribute(name);
}
代码示例来源:origin: org.apache.hadoop/hadoop-common
/**
* Get the value in the webapp context.
* @param name The name of the attribute
* @return The value of the attribute
*/
public Object getAttribute(String name) {
return webAppContext.getAttribute(name);
}
代码示例来源:origin: org.eclipse.jetty/jetty-webapp
/**
* Add in fragment descriptors that have already been discovered by MetaInfConfiguration
*
* @param context the web app context to look in
* @param metaData the metadata to populate with fragments
*
* @throws Exception if unable to find web fragments
*/
public void addWebFragments (final WebAppContext context, final MetaData metaData) throws Exception
{
@SuppressWarnings("unchecked")
Map<Resource, Resource> frags = (Map<Resource,Resource>)context.getAttribute(FRAGMENT_RESOURCES);
if (frags!=null)
{
for (Resource key : frags.keySet())
{
if (key.isDirectory()) //tolerate the case where the library is a directory, not a jar. useful for OSGi for example
{
metaData.addFragment(key, frags.get(key));
}
else //the standard case: a jar most likely inside WEB-INF/lib
{
metaData.addFragment(key, frags.get(key));
}
}
}
}
}
代码示例来源:origin: org.eclipse.jetty/jetty-webapp
throws Exception
String tmp = (String)context.getAttribute(WEBINF_JAR_PATTERN);
Pattern webInfPattern = (tmp==null?null:Pattern.compile(tmp));
代码示例来源:origin: org.eclipse.jetty/jetty-webapp
Object target = context.getAttribute(JavaVersion.JAVA_TARGET_PLATFORM);
if (target!=null)
targetPlatform = Integer.parseInt(target.toString());
String tmp = (String)context.getAttribute(CONTAINER_JAR_PATTERN);
Pattern containerPattern = (tmp==null?null:Pattern.compile(tmp));
ContainerPathNameMatcher containerPathNameMatcher = new ContainerPathNameMatcher(context, containerPattern);
代码示例来源:origin: org.eclipse.jetty/jetty-webapp
@Override
public void preConfigure(final WebAppContext context) throws Exception
{
boolean useContainerCache = DEFAULT_USE_CONTAINER_METAINF_CACHE;
if (context.getServer() != null)
{
Boolean attr = (Boolean)context.getServer().getAttribute(USE_CONTAINER_METAINF_CACHE);
if (attr != null)
useContainerCache = attr.booleanValue();
}
if (LOG.isDebugEnabled()) LOG.debug("{} = {}", USE_CONTAINER_METAINF_CACHE, useContainerCache);
//pre-emptively create empty lists for tlds, fragments and resources as context attributes
//this signals that this class has been called. This differentiates the case where this class
//has been called but finds no META-INF data from the case where this class was never called
if (context.getAttribute(METAINF_TLDS) == null)
context.setAttribute(METAINF_TLDS, new HashSet<URL>());
if (context.getAttribute(METAINF_RESOURCES) == null)
context.setAttribute(METAINF_RESOURCES, new HashSet<Resource>());
if (context.getAttribute(METAINF_FRAGMENTS) == null)
context.setAttribute(METAINF_FRAGMENTS, new HashMap<Resource, Resource>());
//always scan everything from the container's classpath
scanJars(context, context.getMetaData().getContainerResources(), useContainerCache, __allScanTypes);
//only look for fragments if web.xml is not metadata complete, or it version 3.0 or greater
List<String> scanTypes = new ArrayList<>(__allScanTypes);
if (context.getMetaData().isMetaDataComplete() || (context.getServletContext().getEffectiveMajorVersion() < 3) && !context.isConfigurationDiscovered())
scanTypes.remove(METAINF_FRAGMENTS);
scanJars(context, context.getMetaData().getWebInfJars(), false, scanTypes);
}
代码示例来源:origin: org.eclipse.jetty/jetty-webapp
File servletTmpDir = asFile(context.getAttribute(WebAppContext.TEMPDIR));
if (servletTmpDir != null)
File baseTemp = asFile(context.getAttribute(WebAppContext.BASETEMPDIR));
if (baseTemp != null && baseTemp.isDirectory() && baseTemp.canWrite())
代码示例来源:origin: org.eclipse.jetty/jetty-webapp
Collection<URL> metaInfTlds = (Collection<URL>)context.getAttribute(METAINF_TLDS);
if (metaInfTlds == null)
代码示例来源:origin: org.eclipse.jetty/jetty-webapp
@Override
public void deconfigure(WebAppContext context) throws Exception
{
//if we're not persisting the temp dir contents delete it
if (!context.isPersistTempDirectory())
{
IO.delete(context.getTempDirectory());
}
//if it wasn't explicitly configured by the user, then unset it
Boolean tmpdirConfigured = (Boolean)context.getAttribute(TEMPDIR_CONFIGURED);
if (tmpdirConfigured != null && !tmpdirConfigured)
context.setTempDirectory(null);
//reset the base resource back to what it was before we did any unpacking of resources
if (context.getBaseResource() != null)
context.getBaseResource().close();
context.setBaseResource(_preUnpackBaseResource);
}
代码示例来源:origin: org.eclipse.jetty/jetty-webapp
@Override
protected void doStart() throws Exception
{
try
{
_metadata.setAllowDuplicateFragmentNames(isAllowDuplicateFragmentNames());
Boolean validate = (Boolean)getAttribute(MetaData.VALIDATE_XML);
_metadata.setValidateXml((validate!=null && validate.booleanValue()));
preConfigure();
super.doStart();
postConfigure();
if (isLogUrlOnStart())
dumpUrl();
}
catch (Throwable t)
{
// start up of the webapp context failed, make sure it is not started
LOG.warn("Failed startup of context "+this, t);
_unavailableException=t;
setAvailable(false); // webapp cannot be accessed (results in status code 503)
if (isThrowUnavailableOnStartupException())
throw t;
}
}
代码示例来源:origin: org.eclipse.jetty/jetty-webapp
Map<Resource, Resource> fragments = (Map<Resource,Resource>)context.getAttribute(METAINF_FRAGMENTS);
if (fragments == null)
代码示例来源:origin: org.eclipse.jetty/jetty-webapp
Set<Resource> dirs = (Set<Resource>)context.getAttribute(METAINF_RESOURCES);
if (dirs == null)
代码示例来源:origin: org.eclipse.jetty/jetty-webapp
Set<Resource> resources = (Set<Resource>)context.getAttribute(RESOURCE_DIRS);
if (resources!=null && !resources.isEmpty())
代码示例来源:origin: org.eclipse.jetty/jetty-webapp
LOG.debug("Configure: "+jetty);
Object xml_attr=context.getAttribute(XML_CONFIGURATION);
context.removeAttribute(XML_CONFIGURATION);
final XmlConfiguration jetty_config = xml_attr instanceof XmlConfiguration?(XmlConfiguration)xml_attr:new XmlConfiguration(jetty.getURI().toURL());
代码示例来源:origin: org.apache.hbase/hbase-http
/**
* Get the value in the webapp context.
* @param name The name of the attribute
* @return The value of the attribute
*/
public Object getAttribute(String name) {
return webAppContext.getAttribute(name);
}
代码示例来源:origin: org.eclipse.jetty/jetty-annotations
@Override
public void preConfigure(final WebAppContext context) throws Exception
{
String tmp = (String)context.getAttribute(SERVLET_CONTAINER_INITIALIZER_EXCLUSION_PATTERN);
_sciExcludePattern = (tmp==null?null:Pattern.compile(tmp));
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
public void addResource (WebAppContext context, String attribute, Resource jar)
{
@SuppressWarnings("unchecked")
List<Resource> list = (List<Resource>)context.getAttribute(attribute);
if (list==null)
{
list=new ArrayList<Resource>();
context.setAttribute(attribute,list);
}
if (!list.contains(jar))
list.add(jar);
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus
public void addResource (WebAppContext context, String attribute, Resource jar)
{
@SuppressWarnings("unchecked")
List<Resource> list = (List<Resource>)context.getAttribute(attribute);
if (list==null)
{
list=new ArrayList<Resource>();
context.setAttribute(attribute,list);
}
if (!list.contains(jar))
list.add(jar);
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp
public void addResource (WebAppContext context, String attribute, Resource jar)
{
@SuppressWarnings("unchecked")
List<Resource> list = (List<Resource>)context.getAttribute(attribute);
if (list==null)
{
list=new ArrayList<Resource>();
context.setAttribute(attribute,list);
}
if (!list.contains(jar))
list.add(jar);
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9
public void addResource (WebAppContext context, String attribute, Resource jar)
{
@SuppressWarnings("unchecked")
List<Resource> list = (List<Resource>)context.getAttribute(attribute);
if (list==null)
{
list=new ArrayList<Resource>();
context.setAttribute(attribute,list);
}
if (!list.contains(jar))
list.add(jar);
}
内容来源于网络,如有侵权,请联系作者删除!