本文整理汇总了Java中org.apache.tomcat.JarScanner.scan方法的典型用法代码示例。如果您正苦于以下问题:Java JarScanner.scan方法的具体用法?Java JarScanner.scan怎么用?Java JarScanner.scan使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.tomcat.JarScanner
的用法示例。
在下文中一共展示了JarScanner.scan方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processJarsForWebFragments
import org.apache.tomcat.JarScanner; //导入方法依赖的package包/类
/**
* Scan /WEB-INF/lib for JARs and for each one found add it and any
* /META-INF/web-fragment.xml to the resulting Map. web-fragment.xml files
* will be parsed before being added to the map. Every JAR will be added and
* <code>null</code> will be used if no web-fragment.xml was found. Any JARs
* known not contain fragments will be skipped.
*
* @return A map of JAR name to processed web fragment (if any)
*/
protected Map<String,WebXml> processJarsForWebFragments(WebXml application) {
JarScanner jarScanner = context.getJarScanner();
boolean parseRequired = true;
Set<String> absoluteOrder = application.getAbsoluteOrdering();
if (absoluteOrder != null && absoluteOrder.isEmpty() &&
!context.getXmlValidation()) {
// Skip parsing when there is an empty absolute ordering and
// validation is not enabled
parseRequired = false;
}
FragmentJarScannerCallback callback =
new FragmentJarScannerCallback(parseRequired);
jarScanner.scan(context.getServletContext(),
context.getLoader().getClassLoader(), callback,
pluggabilityJarsToSkip);
return callback.getFragments();
}
示例2: init
import org.apache.tomcat.JarScanner; //导入方法依赖的package包/类
private synchronized void init() throws JasperException {
if (initialized) return;
try {
tldScanWebXml();
tldScanResourcePaths(WEB_INF);
JarScanner jarScanner = JarScannerFactory.getJarScanner(ctxt);
jarScanner.scan(ctxt,
Thread.currentThread().getContextClassLoader(),
new TldJarScannerCallback(), noTldJars);
initialized = true;
} catch (Exception ex) {
throw new JasperException(Localizer.getMessage(
"jsp.error.internal.tldinit", ex.getMessage()), ex);
}
}
示例3: processJarsForWebFragments
import org.apache.tomcat.JarScanner; //导入方法依赖的package包/类
/**
*
* Scan /WEB-INF/lib for JARs and for each one found add it and any
* /META-INF/web-fragment.xml to the resulting Map. web-fragment.xml files
* will be parsed before being added to the map. Every JAR will be added and
* <code>null</code> will be used if no web-fragment.xml was found. Any JARs
* known not contain fragments will be skipped.
*
* @return A map of JAR name to processed web fragment (if any)
*/
protected Map<String,WebXml> processJarsForWebFragments(WebXml application) {
// StandardJarScanner
JarScanner jarScanner = context.getJarScanner();
boolean parseRequired = true;
Set<String> absoluteOrder = application.getAbsoluteOrdering();
if (absoluteOrder != null && absoluteOrder.isEmpty() &&
!context.getXmlValidation()) {
// Skip parsing when there is an empty absolute ordering and
// validation is not enabled
parseRequired = false;
}
FragmentJarScannerCallback callback =
new FragmentJarScannerCallback(parseRequired);
jarScanner.scan(context.getServletContext(),
context.getLoader().getClassLoader(), callback,
pluggabilityJarsToSkip);
return callback.getFragments();
}
示例4: processJarsForWebFragments
import org.apache.tomcat.JarScanner; //导入方法依赖的package包/类
/**
* Scan /WEB-INF/lib for JARs and for each one found add it and any
* /META-INF/web-fragment.xml to the resulting Map. web-fragment.xml files
* will be parsed before being added to the map. Every JAR will be added and
* <code>null</code> will be used if no web-fragment.xml was found. Any JARs
* known not contain fragments will be skipped.
*
* @return A map of JAR name to processed web fragment (if any)
*/
protected Map<String, WebXml> processJarsForWebFragments(WebXml application) {
JarScanner jarScanner = context.getJarScanner();
boolean parseRequired = true;
Set<String> absoluteOrder = application.getAbsoluteOrdering();
if (absoluteOrder != null && absoluteOrder.isEmpty() && !context.getXmlValidation()) {
// Skip parsing when there is an empty absolute ordering and
// validation is not enabled
parseRequired = false;
}
FragmentJarScannerCallback callback = new FragmentJarScannerCallback(parseRequired);
jarScanner.scan(context.getServletContext(), context.getLoader().getClassLoader(), callback,
pluggabilityJarsToSkip);
return callback.getFragments();
}
示例5: init
import org.apache.tomcat.JarScanner; //导入方法依赖的package包/类
private synchronized void init() throws JasperException {
if (initialized)
return;
try {
tldScanWebXml();
tldScanResourcePaths(WEB_INF);
JarScanner jarScanner = JarScannerFactory.getJarScanner(ctxt);
jarScanner.scan(ctxt, Thread.currentThread().getContextClassLoader(), new TldJarScannerCallback(),
noTldJars);
initialized = true;
} catch (Exception ex) {
throw new JasperException(Localizer.getMessage("jsp.error.internal.tldinit", ex.getMessage()), ex);
}
}
示例6: init
import org.apache.tomcat.JarScanner; //导入方法依赖的package包/类
private synchronized void init() throws JasperException {
if (initialized) return;
try {
tldScanWebXml();
tldScanResourcePaths(WEB_INF);
JarScanner jarScanner = JarScannerFactory.getJarScanner(ctxt);
if (jarScanner != null) {
jarScanner.scan(ctxt,
Thread.currentThread().getContextClassLoader(),
new TldJarScannerCallback(), noTldJars);
}
initialized = true;
} catch (Exception ex) {
throw new JasperException(Localizer.getMessage(
"jsp.error.internal.tldinit", ex.getMessage()), ex);
}
}
示例7: scanJars
import org.apache.tomcat.JarScanner; //导入方法依赖的package包/类
/**
* Scan for TLDs in JARs in /WEB-INF/lib.
*/
public void scanJars() {
JarScanner scanner = JarScannerFactory.getJarScanner(context);
TldScannerCallback callback = new TldScannerCallback();
scanner.scan(JarScanType.TLD, context, callback);
if (callback.scanFoundNoTLDs()) {
log.info(Localizer.getMessage("jsp.tldCache.noTldSummary"));
}
}
示例8: processJarsForWebFragments
import org.apache.tomcat.JarScanner; //导入方法依赖的package包/类
/**
* Scan /META-INF/lib for JARs and for each one found add it and any
* /META-INF/web-fragment.xml to the resulting Map. web-fragment.xml files
* will be parsed before being added to the map. Every JAR will be added and
* <code>null</code> will be used if no web-fragment.xml was found. Any JARs
* known not contain fragments will be skipped.
*
* @return A map of JAR name to processed web fragment (if any)
*/
protected Map<String,WebXml> processJarsForWebFragments() {
JarScanner jarScanner = context.getJarScanner();
FragmentJarScannerCallback callback = new FragmentJarScannerCallback();
jarScanner.scan(context.getServletContext(),
context.getLoader().getClassLoader(), callback, null);
return callback.getFragments();
}
示例9: execute
import org.apache.tomcat.JarScanner; //导入方法依赖的package包/类
/**
* Scan for and configure all tag library descriptors found in this
* web application.
*
* This supports a Tomcat-specific extension to the TLD search
* order defined in the JSP spec. It allows tag libraries packaged as JAR
* files to be shared by web applications by simply dropping them in a
* location that all web applications have access to (e.g.,
* <CATALINA_HOME>/lib). It also supports some of the weird and
* wonderful arrangements present when Tomcat gets embedded.
*
* The set of shared JARs to be scanned for TLDs is narrowed down by
* the <tt>noTldJars</tt> class variable, which contains the names of JARs
* that are known not to contain any TLDs.
*/
@SuppressWarnings("deprecation") // Context.addApplicationListener(ApplicationListener) is deprecated.
public void execute() {
long t1=System.currentTimeMillis();
/*
* Priority order of URIs required by spec is:
* 1. J2EE platform taglibs - Tomcat doesn't provide these
* 2. web.xml entries
* 3. JARS in WEB-INF/lib & TLDs under WEB-INF (equal priority)
* 4. Additional entries from the container
*
* Keep processing order in sync with o.a.j.compiler.TldLocationsCache
*/
// Stage 2 - web.xml entries
tldScanWebXml();
// Stage 3a - TLDs under WEB-INF (not lib or classes)
tldScanResourcePaths(WEB_INF);
// Stages 3b & 4
JarScanner jarScanner = context.getJarScanner();
TldJarScannerCallback tldCallBack = new TldJarScannerCallback();
jarScanner.scan(context.getServletContext(), context.getLoader().getClassLoader(),
tldCallBack, noTldJars);
if(tldCallBack.scanFoundNoTLDs()){
log.info(sm.getString("tldConfig.noTldSummary"));
}
// Now add all the listeners we found to the listeners for this context
String list[] = getTldListeners();
if( log.isDebugEnabled() )
log.debug(sm.getString("tldConfig.addListeners",
Integer.valueOf(list.length)));
for( int i=0; i<list.length; i++ ) {
context.addApplicationListener(
new ApplicationListener(list[i], true));
}
long t2=System.currentTimeMillis();
if( context instanceof StandardContext ) {
((StandardContext)context).setTldScanTime(t2-t1);
}
}
示例10: execute
import org.apache.tomcat.JarScanner; //导入方法依赖的package包/类
/**
* Scan for and configure all tag library descriptors found in this web
* application.
*
* This supports a Tomcat-specific extension to the TLD search order defined
* in the JSP spec. It allows tag libraries packaged as JAR files to be
* shared by web applications by simply dropping them in a location that all
* web applications have access to (e.g., <CATALINA_HOME>/lib). It also
* supports some of the weird and wonderful arrangements present when Tomcat
* gets embedded.
*
* The set of shared JARs to be scanned for TLDs is narrowed down by the
* <tt>noTldJars</tt> class variable, which contains the names of JARs that
* are known not to contain any TLDs.
*/
@SuppressWarnings("deprecation") // Context.addApplicationListener(ApplicationListener)
// is deprecated.
public void execute() {
long t1 = System.currentTimeMillis();
/*
* Priority order of URIs required by spec is: 1. J2EE platform taglibs
* - Tomcat doesn't provide these 2. web.xml entries 3. JARS in
* WEB-INF/lib & TLDs under WEB-INF (equal priority) 4. Additional
* entries from the container
*
* Keep processing order in sync with o.a.j.compiler.TldLocationsCache
*/
// Stage 2 - web.xml entries
tldScanWebXml();
// Stage 3a - TLDs under WEB-INF (not lib or classes)
tldScanResourcePaths(WEB_INF);
// Stages 3b & 4
JarScanner jarScanner = context.getJarScanner();
TldJarScannerCallback tldCallBack = new TldJarScannerCallback();
jarScanner.scan(context.getServletContext(), context.getLoader().getClassLoader(), tldCallBack, noTldJars);
if (tldCallBack.scanFoundNoTLDs()) {
log.info(sm.getString("tldConfig.noTldSummary"));
}
// Now add all the listeners we found to the listeners for this context
String list[] = getTldListeners();
if (log.isDebugEnabled())
log.debug(sm.getString("tldConfig.addListeners", Integer.valueOf(list.length)));
for (int i = 0; i < list.length; i++) {
context.addApplicationListener(new ApplicationListener(list[i], true));
}
long t2 = System.currentTimeMillis();
if (context instanceof StandardContext) {
((StandardContext) context).setTldScanTime(t2 - t1);
}
}
示例11: execute
import org.apache.tomcat.JarScanner; //导入方法依赖的package包/类
/**
* Scan for and configure all tag library descriptors found in this
* web application.
*
* This supports a Tomcat-specific extension to the TLD search
* order defined in the JSP spec. It allows tag libraries packaged as JAR
* files to be shared by web applications by simply dropping them in a
* location that all web applications have access to (e.g.,
* <CATALINA_HOME>/lib). It also supports some of the weird and
* wonderful arrangements present when Tomcat gets embedded.
*
* The set of shared JARs to be scanned for TLDs is narrowed down by
* the <tt>noTldJars</tt> class variable, which contains the names of JARs
* that are known not to contain any TLDs.
*/
public void execute() {
long t1=System.currentTimeMillis();
/*
* Priority order of URIs required by spec is:
* 1. J2EE platform taglibs - Tomcat doesn't provide these
* 2. web.xml entries
* 3. JARS in WEB-INF/lib & TLDs under WEB-INF (equal priority)
* 4. Additional entries from the container
*
* Keep processing order in sync with o.a.j.compiler.TldLocationsCache
*/
// Stage 2 - web.xml entries
tldScanWebXml();
// Stage 3a - TLDs under WEB-INF (not lib or classes)
tldScanResourcePaths(WEB_INF);
// Stages 3b & 4
JarScanner jarScanner = context.getJarScanner();
jarScanner.scan(context.getServletContext(),
context.getLoader().getClassLoader(),
new TldJarScannerCallback(), noTldJars);
// Now add all the listeners we found to the listeners for this context
String list[] = getTldListeners();
if( log.isDebugEnabled() )
log.debug(sm.getString("tldConfig.addListeners",
Integer.valueOf(list.length)));
for( int i=0; list!=null && i<list.length; i++ ) {
context.addApplicationListener(
new ApplicationListener(list[i], true));
}
long t2=System.currentTimeMillis();
if( context instanceof StandardContext ) {
((StandardContext)context).setTldScanTime(t2-t1);
}
}
示例12: execute
import org.apache.tomcat.JarScanner; //导入方法依赖的package包/类
/**
* Scan for and configure all tag library descriptors found in this
* web application.
*
* This supports a Tomcat-specific extension to the TLD search
* order defined in the JSP spec. It allows tag libraries packaged as JAR
* files to be shared by web applications by simply dropping them in a
* location that all web applications have access to (e.g.,
* <CATALINA_HOME>/lib). It also supports some of the weird and
* wonderful arrangements present when Tomcat gets embedded.
*
* The set of shared JARs to be scanned for TLDs is narrowed down by
* the <tt>noTldJars</tt> class variable, which contains the names of JARs
* that are known not to contain any TLDs.
*/
@SuppressWarnings("deprecation") // Context.addApplicationListener(ApplicationListener) is deprecated.
public void execute() {
long t1=System.currentTimeMillis();
/*
* Priority order of URIs required by spec is:
* 1. J2EE platform taglibs - Tomcat doesn't provide these
* 2. web.xml entries
* 3. JARS in WEB-INF/lib & TLDs under WEB-INF (equal priority)
* 4. Additional entries from the container
*
* Keep processing order in sync with o.a.j.compiler.TldLocationsCache
*/
// Stage 2 - web.xml entries
tldScanWebXml();
// Stage 3a - TLDs under WEB-INF (not lib or classes)
tldScanResourcePaths(WEB_INF);
// Stages 3b & 4
JarScanner jarScanner = context.getJarScanner();
jarScanner.scan(context.getServletContext(),
context.getLoader().getClassLoader(),
new TldJarScannerCallback(), noTldJars);
// Now add all the listeners we found to the listeners for this context
String list[] = getTldListeners();
if( log.isDebugEnabled() )
log.debug(sm.getString("tldConfig.addListeners",
Integer.valueOf(list.length)));
for( int i=0; list!=null && i<list.length; i++ ) {
context.addApplicationListener(
new ApplicationListener(list[i], true));
}
long t2=System.currentTimeMillis();
if( context instanceof StandardContext ) {
((StandardContext)context).setTldScanTime(t2-t1);
}
}
示例13: execute
import org.apache.tomcat.JarScanner; //导入方法依赖的package包/类
/**
* Scan for and configure all tag library descriptors found in this
* web application.
*
* This supports a Tomcat-specific extension to the TLD search
* order defined in the JSP spec. It allows tag libraries packaged as JAR
* files to be shared by web applications by simply dropping them in a
* location that all web applications have access to (e.g.,
* <CATALINA_HOME>/lib). It also supports some of the weird and
* wonderful arrangements present when Tomcat gets embedded.
*
* The set of shared JARs to be scanned for TLDs is narrowed down by
* the <tt>noTldJars</tt> class variable, which contains the names of JARs
* that are known not to contain any TLDs.
*/
public void execute() {
long t1=System.currentTimeMillis();
/*
* Priority order of URIs required by spec is:
* 1. J2EE platform taglibs - Tomcat doesn't provide these
* 2. web.xml entries
* 3. JARS in WEB-INF/lib & TLDs under WEB-INF (equal priority)
* 4. Additional entries from the container
*
* Keep processing order in sync with o.a.j.compiler.TldLocationsCache
*/
// Stage 2 - web.xml entries
tldScanWebXml();
// Stage 3a - TLDs under WEB-INF (not lib or classes)
tldScanResourcePaths(WEB_INF);
// Stages 3b & 4
JarScanner jarScanner = context.getJarScanner();
jarScanner.scan(context.getServletContext(),
context.getLoader().getClassLoader(),
new TldJarScannerCallback(), noTldJars);
// Now add all the listeners we found to the listeners for this context
String list[] = getTldListeners();
if( log.isDebugEnabled() )
log.debug(sm.getString("tldConfig.addListeners",
Integer.valueOf(list.length)));
for( int i=0; list!=null && i<list.length; i++ ) {
context.addApplicationListener(list[i]);
}
long t2=System.currentTimeMillis();
if( context instanceof StandardContext ) {
((StandardContext)context).setTldScanTime(t2-t1);
}
}