flex.messaging.log.Logger.error()方法的使用及代码示例

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

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

Logger.error介绍

[英]Logs out an error message.
[中]注销一条错误消息。

代码示例

代码示例来源:origin: com.adobe.blazeds/blazeds-opt

public void workRejected(WorkEvent event) 
{
  WorkException e = event.getException();
  if (Log.isDebug())
    Log.getLogger(LogCategories.EXECUTOR).error("AsynchBeansWorkManager's WorkListener.workRejected() callback invoked. WorkException? " + e);
  
  handleFailedExecution(((WorkCommandWrapper)event.getWork()).command, e);
}
public void workStarted(WorkEvent event)

代码示例来源:origin: apache/flex-blazeds

static Session getSession(Request request, boolean create) 
{
  HttpServletRequest hreq = (HttpServletRequest)request.getRequest();
  HttpSession hses = hreq.getSession(create);
  if (hses == null)
    return null;
  Manager manager = request.getContext().getManager();
  if (manager == null)
    return null;
  try 
  {
    return manager.findSession(hses.getId());
  }
  catch (IOException e) 
  {
    Log.getLogger(LogCategories.SECURITY).error("Error in TomcatValve getting session id " + hses.getId() + " : " + ExceptionUtil.toString(e));
    return null;
  }
}

代码示例来源:origin: com.adobe.flex/com.springsource.flex.messaging

/**
 * @exclude
 * Removes a subscription from the subscription set for this MessageClient.
 * 
 * @param selector The selector expression for the subscription.
 * @param subtopic The subtopic for the subscription.
 * @return true if no subscriptions remain for this MessageClient; otherwise false.
 */
public boolean removeSubscription(String selector, String subtopic)
{
  synchronized (lock)
  {
    if (subscriptions.remove(new SubscriptionInfo(selector, subtopic)))
      return decrementReferences();
    else if (Log.isError())
      Log.getLogger(MessageService.LOG_CATEGORY).error("Error - unable to find subscription to remove for MessageClient: " + clientId + " selector: " + selector + " subtopic: " + subtopic);
    return numReferences == 0;            
  }
}

代码示例来源:origin: apache/flex-blazeds

static Session getSession(Request request, boolean create) 
{
  HttpServletRequest hreq = (HttpServletRequest)request.getRequest();
  HttpSession hses = hreq.getSession(create);
  if (hses == null)
    return null;
  Manager manager = request.getContext().getManager();
  if (manager == null)
    return null;
  try 
  {
    return manager.findSession(hses.getId());
  }
  catch (IOException e) 
  {
    Log.getLogger(LogCategories.SECURITY).error("Error in TomcatValve getting session id " + hses.getId() + " : " + ExceptionUtil.toString(e));
    return null;
  }
}

代码示例来源:origin: com.adobe.blazeds/blazeds-opt

public void workCompleted(WorkEvent event) 
{
  // This only needs to be handled if execution of the Runnable failed.
  WorkException e = event.getException();
  if (e != null)
  {
    if (Log.isDebug())
      Log.getLogger(LogCategories.EXECUTOR).error("AsynchBeansWorkManager's WorkListener.workCompleted() callback invoked for failed execution.", e);
    
    handleFailedExecution(((WorkCommandWrapper)event.getWork()).command, e);
  }
}
public void workRejected(WorkEvent event)

代码示例来源:origin: apache/flex-blazeds

static Session getSession(HttpRequest request, boolean create) 
{
  HttpServletRequest hreq =
    (HttpServletRequest) request.getRequest();
  HttpSession hses = hreq.getSession(create);
  if (hses == null)
    return (null);
  Manager manager = request.getContext().getManager();
  if (manager == null)
    return (null);
  else 
  {
    try 
    {
      return (manager.findSession(hses.getId()));
    } catch (IOException e) 
    {
      Log.getLogger(LogCategories.SECURITY).error("Error in TomcatValve getting session id " + hses.getId() + " : " + ExceptionUtil.toString(e));
      return (null);
    }
  }
}

代码示例来源:origin: org.apache.flex.blazeds/flex-messaging-core

/**
   *
   * This implementation relies on the default <code>RejectedExecutionHandler</code>, {@link java.util.concurrent.ThreadPoolExecutor.AbortPolicy}, which
   * throws a <code>RejectedExecutionException</code> if the command cannot be queued for execution.
   */
  public void execute(Runnable command)
  {
    try
    {
      super.execute(command);
    }
    catch (RejectedExecutionException e)
    {
      FailedExecutionHandler handler = getFailedExecutionHandler();
      if (handler != null)
      {
        handler.failedExecution(command, this, e);
      }
      else if (Log.isError())
      {
        Log.getLogger(LogCategories.EXECUTOR).error("DefaultThreadPoolExecutor hit a RejectedExecutionException but no FailedExecutionHandler is registered to handle the error.", e);
      }
    }
  }
}

代码示例来源:origin: apache/flex-blazeds

/**
   *
   * This implementation relies on the default <code>RejectedExecutionHandler</code>, {@link java.util.concurrent.ThreadPoolExecutor.AbortPolicy}, which
   * throws a <code>RejectedExecutionException</code> if the command cannot be queued for execution.
   */
  public void execute(Runnable command)
  {
    try
    {
      super.execute(command);
    }
    catch (RejectedExecutionException e)
    {
      FailedExecutionHandler handler = getFailedExecutionHandler();
      if (handler != null)
      {
        handler.failedExecution(command, this, e);
      }
      else if (Log.isError())
      {
        Log.getLogger(LogCategories.EXECUTOR).error("DefaultThreadPoolExecutor hit a RejectedExecutionException but no FailedExecutionHandler is registered to handle the error.", e);
      }
    }
  }
}

代码示例来源:origin: com.adobe.flex/com.springsource.flex.messaging

/**
 * Removes the subscriber, unsubscribing it from all current subscriptions.
 * This is used by the admin UI.
 */
public void removeSubscriber(MessageClient client)
{
  // Sends unsub messages for each subscription for this MessageClient which
  // should mean we remove the client at the end.
  client.invalidate();
  if (getSubscriber(client.getClientId()) != null)
    Log.getLogger(MessageService.LOG_CATEGORY).error("Failed to remove client: " + client.getClientId());
}

代码示例来源:origin: com.adobe.blazeds/blazeds-opt

/**
 * Handles command execution problems by notifying the FailedExecutionHandler if one has been set
 * and otherwise logging the failure.
 * 
 * @param command The command that failed to execute successfully.
 * @param e The exception generated by the failed command.
 */
private void handleFailedExecution(Runnable command, Exception e)
{
  FailedExecutionHandler handler = getFailedExecutionHandler();
  if (handler != null)
  {
    handler.failedExecution(command, this, e);
  }   
  else if (Log.isError())
  {
    Log.getLogger(LogCategories.EXECUTOR).error("AsynchBeansWorkManager hit an Exception but no FailedExecutionHandler is registered to handle the error.", e);
  }
}

代码示例来源:origin: org.apache.flex.blazeds/flex-messaging-core

/**
 * Removes the subscriber, unsubscribing it from all current subscriptions.
 * This is used by the admin UI.
 *
 * @param client the client
 */
public void removeSubscriber(MessageClient client)
{
  // Sends unsub messages for each subscription for this MessageClient which
  // should mean we remove the client at the end.
  client.invalidate();
  if (getSubscriber(client.getClientId()) != null)
    Log.getLogger(MessageService.LOG_CATEGORY).error("Failed to remove client: " + client.getClientId());
}

代码示例来源:origin: org.apache.flex.blazeds/flex-messaging-core

/**
 * This method is provided for a cluster peer broadcast, it is not invoked locally.  It is used
 * by remote clients to send their subscription table to this server.
 *
 *
 */
public void receiveSubscriptions(String destinationId, Object subscriptions, Object senderAddress)
{
  Destination destination = getDestination(destinationId);
  if (destination instanceof MessageDestination)
    ((MessageDestination) destination).getRemoteSubscriptionManager().setSubscriptionState(subscriptions, senderAddress);
  else if (subscriptions != null && Log.isError())
    Log.getLogger(LOG_CATEGORY).error("receiveSubscriptions called with non-null value but destination: " + destinationId + " is not a MessageDestination");
}

代码示例来源:origin: apache/flex-blazeds

/**
 * This method is provided for a cluster peer broadcast, it is not invoked locally.  It is used
 * by remote clients to send their subscription table to this server.
 *
 *
 */
public void receiveSubscriptions(String destinationId, Object subscriptions, Object senderAddress)
{
  Destination destination = getDestination(destinationId);
  if (destination instanceof MessageDestination)
    ((MessageDestination) destination).getRemoteSubscriptionManager().setSubscriptionState(subscriptions, senderAddress);
  else if (subscriptions != null && Log.isError())
    Log.getLogger(LOG_CATEGORY).error("receiveSubscriptions called with non-null value but destination: " + destinationId + " is not a MessageDestination");
}

代码示例来源:origin: apache/flex-blazeds

/**
 * Removes the subscriber, unsubscribing it from all current subscriptions.
 * This is used by the admin UI.
 *
 * @param client the client
 */
public void removeSubscriber(MessageClient client)
{
  // Sends unsub messages for each subscription for this MessageClient which
  // should mean we remove the client at the end.
  client.invalidate();
  if (getSubscriber(client.getClientId()) != null)
    Log.getLogger(MessageService.LOG_CATEGORY).error("Failed to remove client: " + client.getClientId());
}

代码示例来源:origin: org.apache.flex.blazeds/flex-messaging-core

/** {@inheritDoc} */
@Override
public Object clone()
{
  try
  {
    AbstractProxy clonedProxy= (AbstractProxy) super.clone();
    clonedProxy.setCloneFieldsFrom(this);
    return clonedProxy;
  }
  catch (CloneNotSupportedException e)
  {
    if (Log.isError())
    {
      Logger log = Log.getLogger(LOG_CATEGORY);
      log.error("Failed to clone a property proxy: " + toString());
    }
    MessageException ex = new MessageException();
    ex.setMessage(CONVERSION_ERROR);
    throw ex;
  }
}

代码示例来源:origin: com.adobe.flex/com.springsource.flex.messaging

/** {@inheritDoc} */
public Object clone()
{
  try
  {
    AbstractProxy clonedProxy= (AbstractProxy) super.clone();
    clonedProxy.setCloneFieldsFrom(this);
    return clonedProxy;
  }
  catch (CloneNotSupportedException e)
  {
    if (Log.isError())
    {
      Logger log = Log.getLogger(LOG_CATEGORY);
      log.error("Failed to clone a property proxy: " + toString());
    }
    MessageException ex = new MessageException();
    ex.setMessage(CONVERSION_ERROR);
    throw ex;            
  }
}

代码示例来源:origin: apache/flex-blazeds

/** {@inheritDoc} */
@Override
public Object clone()
{
  try
  {
    AbstractProxy clonedProxy= (AbstractProxy) super.clone();
    clonedProxy.setCloneFieldsFrom(this);
    return clonedProxy;
  }
  catch (CloneNotSupportedException e)
  {
    if (Log.isError())
    {
      Logger log = Log.getLogger(LOG_CATEGORY);
      log.error("Failed to clone a property proxy: " + toString());
    }
    MessageException ex = new MessageException();
    ex.setMessage(CONVERSION_ERROR);
    throw ex;
  }
}

代码示例来源:origin: com.adobe.flex/com.springsource.flex.messaging

/**
 * This method is provided for a cluster peer broadcast, it is not invoked locally.  It is used
 * by remote clients to send their subscription table to this server.
 *
 * @exclude
 */
public void receiveSubscriptions(String destinationId, Object subscriptions, Object senderAddress)
{
  Destination destination = getDestination(destinationId);
  if (destination instanceof MessageDestination)
  {
    ((MessageDestination) destination).getRemoteSubscriptionManager().setSubscriptionState(subscriptions, senderAddress);
  }
  else if (subscriptions != null)
  {
    if (Log.isError())
      Log.getLogger(LOG_CATEGORY).error("receiveSubscriptions called with non-null value but destination: " + destinationId + " is not a MessageDestination");
  }
}

代码示例来源:origin: com.adobe.flex/com.springsource.flex.messaging

/**
   * @exclude
   * This implementation relies on the default <code>RejectedExecutionHandler</code>, {@link java.util.concurrent.ThreadPoolExecutor.AbortPolicy}, which
   * throws a <code>RejectedExecutionException</code> if the command cannot be queued for execution.
   */
  public void execute(Runnable command)
  {
    try
    {
      super.execute(command);
    }
    catch (RejectedExecutionException e)
    {
      FailedExecutionHandler handler = getFailedExecutionHandler();
      if (handler != null)
      {
        handler.failedExecution(command, this, e);
      }
      else if (Log.isError())
      {
        Log.getLogger(LogCategories.EXECUTOR).error("DefaultThreadPoolExecutor hit a RejectedExecutionException but no FailedExecutionHandler is registered to handle the error.", e);
      }
    }
  }
}

代码示例来源:origin: com.adobe.flex/com.springsource.flex.messaging

/**
 * This is called remotely from other cluster members when a new remote subscription is identified.
 *
 * We add or remove a remote subscription...
 */
public void subscribeFromPeer(String destinationId, Boolean subscribe, String selector, String subtopic, Object remoteAddress)
{
  Destination destination = getDestination(destinationId);
  RemoteSubscriptionManager subMgr = ((MessageDestination) destination).getRemoteSubscriptionManager();
  if (destination instanceof MessageDestination)
  {
    if (Log.isDebug())
      Log.getLogger(MessageService.LOG_CATEGORY).debug("Received subscription from peer: " + remoteAddress + " subscribe? " + subscribe + " selector: " + selector + " subtopic: " + subtopic);
    if (subscribe.booleanValue())
      subMgr.addSubscriber(remoteAddress, selector, subtopic, null);
    else
      subMgr.removeSubscriber(remoteAddress, selector, subtopic, null);
  }
  else if (Log.isError())
    Log.getLogger(LOG_CATEGORY).error("subscribeFromPeer called with destination: " + destinationId + " that is not a MessageDestination");
}

相关文章