org.xwiki.component.logging.Logger.error()方法的使用及代码示例

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

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

Logger.error介绍

暂无

代码示例

代码示例来源:origin: org.xwiki.platform/xwiki-core-extension-api

/**
 * {@inheritDoc}
 * 
 * @see org.codehaus.plexus.logging.Logger#fatalError(java.lang.String)
 */
public void fatalError(String message)
{
  this.logger.error(message);
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-extension-api

/**
 * {@inheritDoc}
 * 
 * @see org.codehaus.plexus.logging.Logger#error(java.lang.String, java.lang.Throwable)
 */
public void error(String message, Throwable throwable)
{
  this.logger.error(message, throwable);
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-extension-api

/**
 * {@inheritDoc}
 * 
 * @see org.codehaus.plexus.logging.Logger#error(java.lang.String)
 */
public void error(String message)
{
  this.logger.error(message);
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-extension-api

/**
 * {@inheritDoc}
 * 
 * @see org.codehaus.plexus.logging.Logger#fatalError(java.lang.String, java.lang.Throwable)
 */
public void fatalError(String message, Throwable throwable)
{
  this.logger.error(message, throwable);
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-officeimporter

/**
 * Utility method for attaching artifacts into a wiki page.
 * 
 * @param artifacts map of artifact content against their names.
 * @param target target wiki page into which artifacts are to be attached.
 */
private void attachArtifacts(Map<String, byte[]> artifacts, String target)
{
  for (Map.Entry<String, byte[]> artifact : artifacts.entrySet()) {
    try {
      docBridge.setAttachmentContent(target, artifact.getKey(), artifact.getValue());
    } catch (Exception ex) {
      // Log the error and skip the artifact.
      logger.error("Error while attaching artifact.", ex);
    }
  }
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-officeimporter

/**
 * Utility method for attaching artifacts into a wiki page.
 * 
 * @param documentName name of the document.
 * @param artifacts artifacts.
 */
private void attachArtifacts(String documentName, Map<String, byte[]> artifacts)
{
  for (Map.Entry<String, byte[]> artifact : artifacts.entrySet()) {
    try {
      docBridge.setAttachmentContent(documentName, artifact.getKey(), artifact.getValue());
    } catch (Exception ex) {
      // Log the error and skip the artifact.
      getLogger().error("Error while attaching artifact.", ex);
    }
  }
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-observation-remote

/**
 * @return the RemoteObservationManager
 */
public RemoteObservationManager getRemoteObservationManager()
{
  if (this.remoteObservationManager == null) {
    try {
      this.remoteObservationManager = componentManager.lookup(RemoteObservationManager.class);
    } catch (ComponentLookupException e) {
      getLogger().error("Failed to lookup RemoteObservationManager componenent.", e);
    }
  }
  return remoteObservationManager;
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-officeimporter

/**
   * {@inheritDoc}
   */
  public void initialize(VelocityContext context)
  {
    try {
      OfficeImporterVelocityBridge bridge = new OfficeImporterVelocityBridge(componentManager, getLogger());
      context.put(VELOCITY_CONTEXT_KEY, bridge);
    } catch (OfficeImporterException ex) {
      String message = "Unrecoverable error, office importer will not be available for velocity scripts.";
      getLogger().error(message, ex);
    }        
  }
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-officeimporter

/**
   * Stop Open Office.
   */
  private void stopOpenOffice()
  {
    // TODO: We shouldn't stop OO if it hasn't been started automatically or if the config doesn't
    // say to stop it automatically.
    try {
      this.ooManager.stop();
    } catch (OpenOfficeManagerException ex) {
      getLogger().error(ex.getMessage(), ex);
    }
  }        
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-observation-remote

/**
 * {@inheritDoc}
 * 
 * @see org.xwiki.observation.remote.NetworkAdapter#send(org.xwiki.observation.remote.RemoteEventData)
 */
public void send(RemoteEventData remoteEvent)
{
  getLogger().debug("Send JGroups remote event [" + remoteEvent + "]");
  Message message = new Message(null, null, remoteEvent);
  // Send message to jgroups channels
  for (Map.Entry<String, JChannel> entry : this.channels.entrySet()) {
    try {
      entry.getValue().send(message);
    } catch (Exception e) {
      getLogger().error("Fail to send message to the channel [" + entry.getKey() + "]", e);
    }
  }
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-extension-api

/**
 * {@inheritDoc}
 * 
 * @see org.xwiki.component.phase.Initializable#initialize()
 */
public void initialize() throws InitializationException
{
  // Load extension repositories
  for (ExtensionRepositorySource repositoriesSource : this.repositoriesSources) {
    for (ExtensionRepositoryId repositoryId : repositoriesSource.getExtensionRepositories()) {
      try {
        this.repositoryManager.addRepository(repositoryId);
      } catch (ExtensionRepositoryException e) {
        getLogger().error("Failed to add repository [" + repositoryId + "]", e);
      }
    }
  }
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-officeimporter

/**
 * Start Open Office if the configuration says to start it automatically.
 */
private void startOpenOffice()
{
  if (this.ooConfig.isAutoStart()) {
    try {
      this.ooManager.start();
    } catch (OpenOfficeManagerException ex) {
      getLogger().error(ex.getMessage(), ex);
    }
  }
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-container-api

/**
 * {@inheritDoc}
 */
public void initializeApplicationContext(ApplicationContext applicationContext)
{
  try {
    List<ApplicationContextListener> initializers =
      this.componentManager.lookupList(ApplicationContextListener.class);
    for (ApplicationContextListener initializer : initializers) {
      initializer.initializeApplicationContext(applicationContext);
    }
  } catch (ComponentLookupException ex) {
    getLogger().error(ex.getMessage(), ex);
  }
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-container-api

/**
   * {@inheritDoc}
   */
  public void destroyApplicationContext(ApplicationContext applicationContext)
  {
    try {
      List<ApplicationContextListener> initializers =
        this.componentManager.lookupList(ApplicationContextListener.class);
      for (ApplicationContextListener initializer : initializers) {
        initializer.destroyApplicationContext(applicationContext);
      }
    } catch (ComponentLookupException ex) {
      getLogger().error(ex.getMessage(), ex);
    }
  }       
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-observation-remote

/**
   * {@inheritDoc}
   * 
   * @see org.xwiki.observation.EventListener#onEvent(org.xwiki.observation.event.Event, java.lang.Object,
   *      java.lang.Object)
   */
  public void onEvent(Event event, Object source, Object data)
  {
    if (this.remoteObservationManager == null) {
      try {
        this.remoteObservationManager = this.componentManager.lookup(RemoteObservationManager.class);
      } catch (ComponentLookupException e) {
        getLogger().error("Fail to initialize RemoteObservationManager", e);
      }
    }

    this.remoteObservationManager.notify(new LocalEventData(event, source, data));
  }
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-officeimporter

/**
 * <p>
 * Imports the given {@link XHTMLOfficeDocument} into an {@link XDOMOfficeDocument}.
 * </p>
 * 
 * @param xhtmlOfficeDocument {@link XHTMLOfficeDocument} to be imported.
 * @return {@link XDOMOfficeDocument} containing {@link org.xwiki.rendering.block.XDOM} result of the import
 *         operation or null if an error occurs.
 * @since 2.2M1
 */
public XDOMOfficeDocument xhtmlToXDOM(XHTMLOfficeDocument xhtmlOfficeDocument)
{
  try {
    return xdomBuilder.build(xhtmlOfficeDocument);
  } catch (OfficeImporterException ex) {
    setErrorMessage(ex.getMessage());
    logger.error(ex.getMessage(), ex);
  }
  return null;
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-observation-remote

/**
   * Make sure an ExecutionContext initialized for remote->local thread.
   */
  private void initiContext()
  {
    if (this.execution.getContext() == null) {
      ExecutionContext context = new ExecutionContext();

      try {
        this.executionContextManager.initialize(context);
      } catch (ExecutionContextException e) {
        getLogger().error("failed to initialize execution context", e);
      }

      this.execution.setContext(context);
    }
  }
}

代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core

/**
   * {@inheritDoc}
   * 
   * @see org.xwiki.rendering.internal.macro.wikibridge.WikiMacroBindingInitializer#initialize(org.xwiki.model.reference.DocumentReference,
   *      org.xwiki.rendering.macro.wikibridge.WikiMacroParameters, java.lang.String,
   *      org.xwiki.rendering.transformation.MacroTransformationContext, java.util.Map)
   */
  public void initialize(DocumentReference macroDocumentReference, WikiMacroParameters parameters,
    String macroContent, MacroTransformationContext context, Map<String, Object> macroBinding)
  {
    try {
      XWikiDocument document = getContext().getWiki().getDocument(macroDocumentReference, getContext());
      macroBinding.put(MACRO_DOC_KEY, document.newDocument(getContext()));
    } catch (XWikiException e) {
      getLogger().error("Failed to get document " + macroDocumentReference, e);
    }
  }
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-observation-local

/**
 * @param event event object containing the new component descriptor
 * @param descriptor the component descriptor removed from component manager
 */
private void componentAdded(ComponentDescriptorAddedEvent event, ComponentDescriptor<EventListener> descriptor)
{
  try {
    EventListener eventListener = this.componentManager.lookup(EventListener.class, event.getRoleHint());
    if (getListener(eventListener.getName()) != eventListener) {
      addListener(eventListener);
    }
  } catch (ComponentLookupException e) {
    getLogger().error("Failed to lookup event listener corresponding to the component registration event", e);
  }
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-officeimporter

/**
 * Tries to start the oo server process.
 * 
 * @return true if the operation succeeds, false otherwise.
 */
public boolean startServer()
{
  if (!isMainXWiki()) {
    setErrorMessage(ERROR_FORBIDDEN);
  } else if (!docBridge.hasProgrammingRights()) {
    setErrorMessage(ERROR_PRIVILEGES);
  } else {
    try {
      ooManager.start();
      return true;
    } catch (OpenOfficeManagerException ex) {
      logger.error(ex.getMessage(), ex);
      setErrorMessage(ex.getMessage());
    }
  }
  return false;
}

相关文章