org.codehaus.cargo.util.log.Logger.warn()方法的使用及代码示例

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

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

Logger.warn介绍

[英]Logger warning messages.
[中]记录器警告消息。

代码示例

代码示例来源:origin: org.codehaus.cargo/cargo-core-container-tomcat

  1. /**
  2. * Configures the specified context element with the extra classpath (if any) of the given WAR.
  3. * @param deployable Deployable to create extra classpath XML token for.
  4. * @param context The context element to configure, must not be {@code null}.
  5. */
  6. protected void configureExtraClasspathToken(WAR deployable, Element context)
  7. {
  8. getLogger().warn("Tomcat 5.x doesn't support extra classpath on WARs",
  9. this.getClass().getName());
  10. }

代码示例来源:origin: codehaus-cargo/cargo

  1. /**
  2. * Creates the extra classpath XML token.
  3. * @param deployable Deployable to create extra classpath XML token for.
  4. * @return Extra classpath XML token.
  5. */
  6. protected String getExtraClasspathToken(WAR deployable)
  7. {
  8. getLogger().warn("Tomcat 5.x doesn't support extra classpath on WARs",
  9. this.getClass().getName());
  10. return "";
  11. }

代码示例来源:origin: codehaus-cargo/cargo

  1. /**
  2. * Configures the specified context element with the extra classpath (if any) of the given WAR.
  3. * @param deployable Deployable to create extra classpath XML token for.
  4. * @param context The context element to configure, must not be {@code null}.
  5. */
  6. protected void configureExtraClasspathToken(WAR deployable, Element context)
  7. {
  8. getLogger().warn("Tomcat 5.x doesn't support extra classpath on WARs",
  9. this.getClass().getName());
  10. }

代码示例来源:origin: org.codehaus.cargo/cargo-core-container-tomcat

  1. /**
  2. * Creates the extra classpath XML token.
  3. * @param deployable Deployable to create extra classpath XML token for.
  4. * @return Extra classpath XML token.
  5. */
  6. protected String getExtraClasspathToken(WAR deployable)
  7. {
  8. getLogger().warn("Tomcat 5.x doesn't support extra classpath on WARs",
  9. this.getClass().getName());
  10. return "";
  11. }

代码示例来源:origin: org.codehaus.cargo/cargo-core-container-jonas

  1. /**
  2. * If necessary, warn the user about this deployer's limitations.
  3. */
  4. protected void warn()
  5. {
  6. if (this.warn)
  7. {
  8. getLogger().warn("The jonas5x local deployer requires the target JOnAS server to be in"
  9. + " development mode.", getClass().getName());
  10. getLogger().warn("", getClass().getName());
  11. getLogger().warn("If this is not the case, please use the jonas5x remote deployer.",
  12. getClass().getName());
  13. getLogger().warn("Note that the jonas5x remote deployer can be used on a local server"
  14. + " by setting the server name to localhost.", getClass().getName());
  15. }
  16. }
  17. }

代码示例来源:origin: codehaus-cargo/cargo

  1. /**
  2. * If necessary, warn the user about this deployer's limitations.
  3. */
  4. protected void warn()
  5. {
  6. if (this.warn)
  7. {
  8. getLogger().warn("The jonas5x local deployer requires the target JOnAS server to be in"
  9. + " development mode.", getClass().getName());
  10. getLogger().warn("", getClass().getName());
  11. getLogger().warn("If this is not the case, please use the jonas5x remote deployer.",
  12. getClass().getName());
  13. getLogger().warn("Note that the jonas5x remote deployer can be used on a local server"
  14. + " by setting the server name to localhost.", getClass().getName());
  15. }
  16. }
  17. }

代码示例来源:origin: org.codehaus.cargo/cargo-core-container-jboss

  1. /**
  2. * runs the thread.
  3. */
  4. @Override
  5. public void run()
  6. {
  7. try
  8. {
  9. this.runAndThrow();
  10. }
  11. catch (Throwable t)
  12. {
  13. if (!this.stopped)
  14. {
  15. this.lastException = t;
  16. this.logger.warn("Error in the embedded HTTP server: " + t.toString(),
  17. this.getClass().getName());
  18. for (StackTraceElement ste : t.getStackTrace())
  19. {
  20. this.logger.warn(ste.toString(), this.getClass().getName());
  21. }
  22. }
  23. }
  24. }

代码示例来源:origin: codehaus-cargo/cargo

  1. /**
  2. * runs the thread.
  3. */
  4. @Override
  5. public void run()
  6. {
  7. try
  8. {
  9. this.runAndThrow();
  10. }
  11. catch (Throwable t)
  12. {
  13. if (!this.stopped)
  14. {
  15. this.lastException = t;
  16. this.logger.warn("Error in the embedded HTTP server: " + t.toString(),
  17. this.getClass().getName());
  18. for (StackTraceElement ste : t.getStackTrace())
  19. {
  20. this.logger.warn(ste.toString(), this.getClass().getName());
  21. }
  22. }
  23. }
  24. }

代码示例来源:origin: org.codehaus.cargo/cargo-core-container-wildfly

  1. /**
  2. * @param jndiName JNDI name to be sanitized.
  3. * @return Sanitized JNDI name.
  4. */
  5. private String sanitizeJndiName(String jndiName)
  6. {
  7. String response = jndiName;
  8. if (!jndiName.startsWith("java:/"))
  9. {
  10. response = "java:/" + jndiName;
  11. getConfiguration().getLogger().warn("WildFly requires resource JNDI names "
  12. + "to start with java:/, hence changing the given JNDI name to: " + response,
  13. this.getClass().getName());
  14. }
  15. return response;
  16. }

代码示例来源:origin: codehaus-cargo/cargo

  1. /**
  2. * @param jndiName JNDI name to be sanitized.
  3. * @return Sanitized JNDI name.
  4. */
  5. private String sanitizeJndiName(String jndiName)
  6. {
  7. String response = jndiName;
  8. if (!jndiName.startsWith("java:/"))
  9. {
  10. response = "java:/" + jndiName;
  11. getConfiguration().getLogger().warn("WildFly requires resource JNDI names "
  12. + "to start with java:/, hence changing the given JNDI name to: " + response,
  13. this.getClass().getName());
  14. }
  15. return response;
  16. }

代码示例来源:origin: org.codehaus.cargo/cargo-core-container-jetty

  1. /**
  2. * @return Jetty <code>OPTIONS</code> argument.
  3. */
  4. protected synchronized String getOptions()
  5. {
  6. if (this.options == null)
  7. {
  8. StringBuilder options = new StringBuilder("OPTIONS=Server");
  9. File jspLib = new File(getHome(), "lib/jsp");
  10. if (jspLib.isDirectory())
  11. {
  12. options.append(",jsp");
  13. }
  14. else
  15. {
  16. getLogger().warn("JSP librairies not found in " + jspLib
  17. + ", JSP support will be disabled", this.getClass().getName());
  18. }
  19. options.append("," + this.defaultFinalOptions);
  20. this.options = options.toString();
  21. }
  22. return this.options;
  23. }
  24. }

代码示例来源:origin: codehaus-cargo/cargo

  1. /**
  2. * @return Jetty <code>OPTIONS</code> argument.
  3. */
  4. protected synchronized String getOptions()
  5. {
  6. if (this.options == null)
  7. {
  8. StringBuilder options = new StringBuilder("OPTIONS=Server");
  9. File jspLib = new File(getHome(), "lib/jsp");
  10. if (jspLib.isDirectory())
  11. {
  12. options.append(",jsp");
  13. }
  14. else
  15. {
  16. getLogger().warn("JSP librairies not found in " + jspLib
  17. + ", JSP support will be disabled", this.getClass().getName());
  18. }
  19. options.append("," + this.defaultFinalOptions);
  20. this.options = options.toString();
  21. }
  22. return this.options;
  23. }
  24. }

代码示例来源:origin: org.codehaus.cargo/cargo-ant

  1. /**
  2. * Calculate the absolute directory for any given path. This method will also emit a warning if
  3. * the given path is not absolute.
  4. * @param type Directory type, for example <code>container home</code>.
  5. * @param directory Directory path.
  6. * @return Absolute directory path.
  7. */
  8. private String calculateAbsoluteDirectory(String type, String directory)
  9. {
  10. File directoryFile = new File(directory);
  11. if (!directoryFile.isAbsolute())
  12. {
  13. String absoluteDirectory = directoryFile.getAbsolutePath();
  14. if (getLogger() != null)
  15. {
  16. getLogger().warn("The provided " + type + " directory [" + directory
  17. + "] is not an absolute directory. Replacing it with its absolute directory "
  18. + "counterpart, i.e. [" + absoluteDirectory + "] To avoid this message in "
  19. + "the future, you can also use the ${basedir} variable in your "
  20. + "paths.", this.getClass().getName());
  21. }
  22. return absoluteDirectory;
  23. }
  24. else
  25. {
  26. return directory;
  27. }
  28. }

代码示例来源:origin: org.codehaus.cargo/cargo-core-container-wildfly

  1. /**
  2. * Create module from JAR file and add it to the script list.
  3. * @param jarFile JAR resource representing module.
  4. * @param container Container with modules.
  5. * @param configurationScript List of configuration scripts to be executed.
  6. */
  7. protected void addModuleScript(String jarFile, InstalledLocalContainer container,
  8. List<ScriptCommand> configurationScript)
  9. {
  10. String moduleName = WildFlyModuleUtils.getModuleName(container, jarFile);
  11. boolean isModuleDeployed = WildFlyModuleUtils.isModuleDeployed(container, jarFile);
  12. if (isModuleDeployed)
  13. {
  14. getLogger().warn("Module " + moduleName + " already exists, skipping it.",
  15. this.getClass().getName());
  16. }
  17. else
  18. {
  19. // Dependencies needed for DataSource driver initialization.
  20. List<String> commonDependencies = Arrays.asList("javax.api", "javax.transaction.api");
  21. List<String> dependencies = new ArrayList<String>();
  22. dependencies.addAll(commonDependencies);
  23. dependencies.addAll(modules);
  24. configurationScript.add(getConfigurationFactory().addModuleScript(moduleName,
  25. Arrays.asList(jarFile), dependencies));
  26. }
  27. modules.add(moduleName);
  28. }

代码示例来源:origin: codehaus-cargo/cargo

  1. /**
  2. * Create module from JAR file and add it to the script list.
  3. * @param jarFile JAR resource representing module.
  4. * @param container Container with modules.
  5. * @param configurationScript List of configuration scripts to be executed.
  6. */
  7. protected void addModuleScript(String jarFile, InstalledLocalContainer container,
  8. List<ScriptCommand> configurationScript)
  9. {
  10. String moduleName = WildFlyModuleUtils.getModuleName(container, jarFile);
  11. boolean isModuleDeployed = WildFlyModuleUtils.isModuleDeployed(container, jarFile);
  12. if (isModuleDeployed)
  13. {
  14. getLogger().warn("Module " + moduleName + " already exists, skipping it.",
  15. this.getClass().getName());
  16. }
  17. else
  18. {
  19. // Dependencies needed for DataSource driver initialization.
  20. List<String> commonDependencies = Arrays.asList("javax.api", "javax.transaction.api");
  21. List<String> dependencies = new ArrayList<String>();
  22. dependencies.addAll(commonDependencies);
  23. dependencies.addAll(modules);
  24. configurationScript.add(getConfigurationFactory().addModuleScript(moduleName,
  25. Arrays.asList(jarFile), dependencies));
  26. }
  27. modules.add(moduleName);
  28. }

代码示例来源:origin: codehaus-cargo/cargo

  1. /**
  2. * Warn user and throw an Exception if any unsupported {@link Resource}s are setup for this
  3. * configuration.
  4. */
  5. public void collectUnsupportedResourcesAndThrowException()
  6. {
  7. if (!getResources().isEmpty()
  8. && !this.getCapability().supportsProperty(ResourcePropertySet.RESOURCE))
  9. {
  10. StringBuilder errorMessage = new StringBuilder();
  11. for (Resource resource : getResources())
  12. {
  13. String message =
  14. "This configuration does not support Resource configuration! JndiName: "
  15. + resource.getName();
  16. getLogger().warn(message, getClass().getName());
  17. if (!errorMessage.toString().equals(""))
  18. {
  19. errorMessage.append("\n");
  20. }
  21. errorMessage.append(message);
  22. }
  23. throw new CargoException(errorMessage.toString());
  24. }
  25. }

代码示例来源:origin: codehaus-cargo/cargo

  1. /**
  2. * Add option of spawn if property exists
  3. *
  4. * @param java the predefined JVM launcher which will spawn
  5. */
  6. private void addSpawn(JvmLauncher java)
  7. {
  8. boolean spawnProcess = Boolean.parseBoolean(getConfiguration().getPropertyValue(
  9. GeneralPropertySet.SPAWN_PROCESS));
  10. if (spawnProcess)
  11. {
  12. if (getOutput() == null)
  13. {
  14. java.setSpawn(spawnProcess);
  15. }
  16. else
  17. {
  18. getLogger().warn("Process cannot be spawned unless output is null",
  19. this.getClass().getName());
  20. }
  21. }
  22. }

代码示例来源:origin: org.codehaus.cargo/cargo-core-api-module

  1. /**
  2. * Checks the versions of the servlet API in each descriptor, and logs a warning if a mismatch
  3. * might result in the loss of definitions.
  4. *
  5. * @param theWebXml The descriptor that will be merged with the original
  6. */
  7. protected final void checkServletVersions(WebXml theWebXml)
  8. {
  9. if (this.webXml.getVersion() != null
  10. && this.webXml.getVersion().compareTo(theWebXml.getVersion()) < 0)
  11. {
  12. getLogger().warn("Merging elements from a version " + theWebXml.getVersion()
  13. + " descriptor into a version " + this.webXml.getVersion()
  14. + ", some elements may be skipped", this.getClass().getName());
  15. }
  16. }

代码示例来源:origin: com.atlassian.sdk/ap3-api

  1. @Override
  2. public void run()
  3. {
  4. try
  5. {
  6. if (container != null && (org.codehaus.cargo.container.State.STARTED == container.getState() || org.codehaus.cargo.container.State.STARTING == container.getState()))
  7. {
  8. log.info("Stopping container...","");
  9. container.stop();
  10. }
  11. }
  12. catch (Exception e)
  13. {
  14. log.warn("Failed stopping the container", "");
  15. }
  16. }
  17. });

代码示例来源:origin: codehaus-cargo/cargo

  1. /**
  2. * Checks the versions of the servlet API in each descriptor, and logs a warning if a mismatch
  3. * might result in the loss of definitions.
  4. *
  5. * @param theWebXml The descriptor that will be merged with the original
  6. */
  7. protected final void checkServletVersions(WebXml theWebXml)
  8. {
  9. if (this.webXml.getVersion() != null
  10. && this.webXml.getVersion().compareTo(theWebXml.getVersion()) < 0)
  11. {
  12. getLogger().warn("Merging elements from a version " + theWebXml.getVersion()
  13. + " descriptor into a version " + this.webXml.getVersion()
  14. + ", some elements may be skipped", this.getClass().getName());
  15. }
  16. }

相关文章