org.ocpsoft.logging.Logger.warn()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(9.6k)|赞(0)|评价(0)|浏览(248)

本文整理了Java中org.ocpsoft.logging.Logger.warn()方法的一些代码示例,展示了Logger.warn()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.warn()方法的具体详情如下:
包路径:org.ocpsoft.logging.Logger
类名称:Logger
方法名:warn

Logger.warn介绍

暂无

代码示例

代码示例来源:origin: ocpsoft/rewrite

protected void closeQuietly(Closeable closeable)
{
 try
 {
   closeable.close();
 }
 catch (IOException e)
 {
   logger.warn(e.getMessage(), e);
 }
}

代码示例来源:origin: ocpsoft/rewrite

@Override
 public String encode(final String value)
 {
   try {
    return URLEncoder.encode(value, "UTF-8");
   }
   catch (UnsupportedEncodingException e) {
    throw new RewriteException("Encoding type UTF-8 is not supported by this JVM.", e);
   }
   catch (IllegalArgumentException e)
   {
    log.warn("Could not encode query parameter: " + value);
    return value;
   }
 }
}

代码示例来源:origin: org.ocpsoft.rewrite/rewrite-api-servlet

@Override
 public String encode(final String value)
 {
   try {
    return URLEncoder.encode(value, "UTF-8");
   }
   catch (UnsupportedEncodingException e) {
    throw new RewriteException("Encoding type UTF-8 is not supported by this JVM.", e);
   }
   catch (IllegalArgumentException e)
   {
    log.warn("Could not encode query parameter: " + value);
    return value;
   }
 }
}

代码示例来源:origin: ocpsoft/rewrite

@Override
 public String encode(final String value)
 {
   try {
    return URLEncoder.encode(value, "UTF-8");
   }
   catch (UnsupportedEncodingException e) {
    throw new RewriteException("Encoding type UTF-8 is not supported by this JVM.", e);
   }
   catch (IllegalArgumentException e)
   {
    log.warn("Could not encode query parameter: " + value);
    return value;
   }
 }
}

代码示例来源:origin: ocpsoft/rewrite

@Override
 public String encode(final String value)
 {
   try {
    return URLDecoder.decode(value, "UTF-8");
   }
   catch (UnsupportedEncodingException e) {
    throw new RewriteException("Encoding type UTF-8 is not supported by this JVM.", e);
   }
   catch (IllegalArgumentException e)
   {
    log.warn("Could not decode query parameter: " + value);
    return value;
   }
 }
}

代码示例来源:origin: org.ocpsoft.rewrite/rewrite-api-servlet

@Override
 public String encode(final String value)
 {
   try {
    return URLDecoder.decode(value, "UTF-8");
   }
   catch (UnsupportedEncodingException e) {
    throw new RewriteException("Encoding type UTF-8 is not supported by this JVM.", e);
   }
   catch (IllegalArgumentException e)
   {
    log.warn("Could not decode query parameter: " + value);
    return value;
   }
 }
}

代码示例来源:origin: ocpsoft/rewrite

@Override
 public String encode(final String value)
 {
   try {
    return URLDecoder.decode(value, "UTF-8");
   }
   catch (UnsupportedEncodingException e) {
    throw new RewriteException("Encoding type UTF-8 is not supported by this JVM.", e);
   }
   catch (IllegalArgumentException e)
   {
    log.warn("Could not decode query parameter: " + value);
    return value;
   }
 }
}

代码示例来源:origin: ocpsoft/rewrite

@Override
public String getBeanName(Class<?> clazz)
{
 Set<Bean<?>> beans = beanManager.getBeans(clazz);
 // no matching beans, the BeanManager doesn't know something about this class
 if (beans == null || beans.size() == 0) {
   return null;
 }
 // more than one result -> warn the user
 else if (beans.size() > 1) {
   log.warn("The BeanManager returns more than one name for [{}]", clazz.getName());
   return null;
 }
 // exactly one result -> we got a name
 else {
   return beans.iterator().next().getName();
 }
}

代码示例来源:origin: ocpsoft/rewrite

@Override
public void findClasses(ClassVisitor visitor)
{
 try
 {
   // get the absolute URL of the classes folder
   URL classesFolderUrl = servletContext.getResource(CLASSES_FOLDER);
   // abort if classes folder is missing
   if (classesFolderUrl == null)
   {
    log.warn("Cannot find classes folder: " + CLASSES_FOLDER);
    return;
   }
   // call recursive directory processing method
   processDirectory(classesFolderUrl, CLASSES_FOLDER, visitor);
 }
 catch (MalformedURLException e)
 {
   throw new IllegalStateException("Invalid URL: " + e.getMessage(), e);
 }
}

代码示例来源:origin: ocpsoft/rewrite

@Override
public void findClasses(ClassVisitor visitor)
{
 try
 {
   // get the absolute URL of the classes folder
   URL classesFolderUrl = servletContext.getResource(CLASSES_FOLDER);
   // abort if classes folder is missing
   if (classesFolderUrl == null)
   {
    log.warn("Cannot find classes folder: " + CLASSES_FOLDER);
    return;
   }
   // call recursive directory processing method
   processDirectory(classesFolderUrl, CLASSES_FOLDER, visitor);
 }
 catch (MalformedURLException e)
 {
   throw new IllegalStateException("Invalid URL: " + e.getMessage(), e);
 }
}

代码示例来源:origin: org.jboss.windup.web.addons/windup-web-support-impl

private static List<String> findPaths(Path path, boolean relativeOnly)
  {
    List<String> results = new ArrayList<>();
    results.add(path.normalize().toAbsolutePath().toString());

    if (Files.isDirectory(path))
    {
      try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(path))
      {
        for (Path child : directoryStream)
        {
          results.addAll(findPaths(child, relativeOnly));
        }
      }
      catch (IOException e)
      {
        Logger.getLogger(PackageDiscoveryServiceImpl.class).warn("Could not read file: " + path + " due to: " + e.getMessage());
      }
    }
    else if (Files.isRegularFile(path) && ZipUtil.endsWithZipExtension(path.toString()))
    {
      results.addAll(ZipUtil.scanZipFile(path, relativeOnly));
    }

    return results;
  }
}

代码示例来源:origin: ocpsoft/rewrite

@SuppressWarnings("unchecked")
private static List<ExpressionLanguageProvider> getProviders()
{
 if (_providers == null)
 {
   synchronized (El.class)
   {
    if (_providers == null)
    {
      _providers = Iterators.asList(ServiceLoader.load(ExpressionLanguageProvider.class));
      Collections.sort(_providers, new WeightedComparator());
      if (_providers.isEmpty())
      {
       log.warn("No instances of [{}] were configured. EL support is disabled.",
            ExpressionLanguageProvider.class.getName());
      }
    }
   }
 }
 return _providers;
}

代码示例来源:origin: org.ocpsoft.rewrite/rewrite-api-el

@SuppressWarnings("unchecked")
private static List<ExpressionLanguageProvider> getProviders()
{
 if (_providers == null)
 {
   synchronized (El.class)
   {
    if (_providers == null)
    {
      _providers = Iterators.asList(ServiceLoader.load(ExpressionLanguageProvider.class));
      Collections.sort(_providers, new WeightedComparator());
      if (_providers.isEmpty())
      {
       log.warn("No instances of [{}] were configured. EL support is disabled.",
            ExpressionLanguageProvider.class.getName());
      }
    }
   }
 }
 return _providers;
}

代码示例来源:origin: ocpsoft/rewrite

@SuppressWarnings("unchecked")
private static List<ExpressionLanguageProvider> getProviders()
{
 if (_providers == null)
 {
   synchronized (El.class)
   {
    if (_providers == null)
    {
      _providers = Iterators.asList(ServiceLoader.load(ExpressionLanguageProvider.class));
      Collections.sort(_providers, new WeightedComparator());
      if (_providers.isEmpty())
      {
       log.warn("No instances of [{}] were configured. EL support is disabled.",
            ExpressionLanguageProvider.class.getName());
      }
    }
   }
 }
 return _providers;
}

代码示例来源:origin: ocpsoft/rewrite

@Override
public List<ServletRegistration> getServletRegistrations(ServletContext context)
{
 InputStream webXmlStream = context.getResourceAsStream("/WEB-INF/web.xml");
 if (webXmlStream != null) {
   try {
    WebXmlServletRegistrationParser parser = new WebXmlServletRegistrationParser();
    parser.parse(webXmlStream);
    return parser.getRegistrations();
   }
   catch (IOException e) {
    log.warn("Failed to parse web.xml to look for servlet registations", e);
   }
 }
 return null;
}

代码示例来源:origin: ocpsoft/rewrite

@Override
public List<ServletRegistration> getServletRegistrations(ServletContext context)
{
 InputStream webXmlStream = context.getResourceAsStream("/WEB-INF/web.xml");
 if (webXmlStream != null) {
   try {
    WebXmlServletRegistrationParser parser = new WebXmlServletRegistrationParser();
    parser.parse(webXmlStream);
    return parser.getRegistrations();
   }
   catch (IOException e) {
    log.warn("Failed to parse web.xml to look for servlet registations", e);
   }
 }
 return null;
}

代码示例来源:origin: ocpsoft/rewrite

public Boolean isDevelopmentMode(ServletContext servletContext)
{
 try {
   return !ProjectStage.Production.equals(FacesFactory.getApplication().getProjectStage());
 }
 catch (Exception e) {
   log.warn("Could not determine project stage due to underlying exception.", e);
   return false;
 }
}

代码示例来源:origin: org.ocpsoft.rewrite/rewrite-impl-servlet

@Override
public String encodeURL(final String url)
{
 /*
  * In some situations "url" may be not valid according to the rules defined in the RFC.
  * In this case AddressBuilder.create() will fail. In these situations we basically
  * skip outbound rewriting and just return the result of the super class.
  */
 Address address;
 try
 {
   address = AddressBuilder.create(url);
 }
 catch (IllegalArgumentException e) {
   log.warn("Skipping outbound rewriting of invalid URL: " + url);
   return super.encodeURL(url);
 }
 OutboundServletRewrite<ServletRequest, ServletResponse, Address> event = rewrite(address);
 if (event.getFlow().is(ServletRewriteFlow.ABORT_REQUEST))
 {
   return event.getOutboundAddress().toString();
 }
 return super.encodeURL(event.getOutboundAddress().toString());
}

代码示例来源:origin: ocpsoft/rewrite

@Override
public String encodeURL(final String url)
{
 /*
  * In some situations "url" may be not valid according to the rules defined in the RFC.
  * In this case AddressBuilder.create() will fail. In these situations we basically
  * skip outbound rewriting and just return the result of the super class.
  */
 Address address;
 try
 {
   address = AddressBuilder.create(url);
 }
 catch (IllegalArgumentException e) {
   log.warn("Skipping outbound rewriting of invalid URL: " + url);
   return super.encodeURL(url);
 }
 OutboundServletRewrite<ServletRequest, ServletResponse, Address> event = rewrite(address);
 if (event.getFlow().is(ServletRewriteFlow.ABORT_REQUEST))
 {
   return event.getOutboundAddress().toString();
 }
 return super.encodeURL(event.getOutboundAddress().toString());
}

代码示例来源:origin: ocpsoft/rewrite

private void checkConfLocal(final Conf conf)
{
 if (conf.isOk() && conf.isEngineEnabled()) {
   urlRewriter = new UrlRewriter(conf);
   log.debug("Tuckey UrlRewriteFilter configuration loaded (Status: OK)");
 }
 else {
   if (!conf.isOk()) {
    log.error("Tuckey UrlRewriteFilter configuration failed (Status: ERROR)");
   }
   if (!conf.isEngineEnabled()) {
    log.warn("Tuckey UrlRewriteFilter engine explicitly disabled in configuration");
   }
   if (urlRewriter != null) {
    log.debug("Tuckey UrlRewriteFilter configuration unloaded");
    urlRewriter = null;
   }
 }
}

相关文章