org.boon.Boon.className()方法的使用及代码示例

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

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

Boon.className介绍

[英]Gets class name from object. It is null safe.
[中]从对象获取类名。它是零安全的。

代码示例

代码示例来源:origin: io.fastjson/qbit

@Override
public void flushSends() {
  if (GlobalConstants.DEBUG) {
    logger.info(Boon.className(this), "::flushSends()");
  }
  this.methodSendQueue.flushSends();
}

代码示例来源:origin: io.fastjson/qbit

public void stop() {
  if (GlobalConstants.DEBUG) {
    logger.info(Boon.className(this), "::stop()");
  }
  methodQueue.stop();
  for (Service service : services) {
    service.stop();
  }
}

代码示例来源:origin: io.fastjson/qbit

@Override
public void addService(String serviceAddress, Object object) {
  if (GlobalConstants.DEBUG) {
    logger.info(Boon.className(this), serviceAddress, object);
  }
  final Service service = factory.createService(address, serviceAddress,
       object, responseQueue);
  services.add(service);
  final SendQueue<MethodCall<Object>> requests = service.requests();
  if (!Str.isEmpty(serviceAddress)) {
    serviceMapping.put(serviceAddress, requests);
  }
  serviceMapping.put(service.name(), requests);
  sendQueues.add(requests);
  final Collection<String> addresses = service.addresses(this.address);
  if (GlobalConstants.DEBUG) {
    logger.info(Boon.className(this), "addresses", addresses);
  }
  for (String addr : addresses) {
    addressesByDescending.add(addr);
    SendQueue<MethodCall<Object>> methodCallSendQueue =
        serviceMapping.get(service.name());
    serviceMapping.put(addr, methodCallSendQueue);
  }
}

代码示例来源:origin: boonproject/boon

/**
 * Get fields from object or Map.
 * Allows maps to act like they have fields.
 *
 * @param object
 * @return
 */
public static Map<String, FieldAccess> getFieldsFromObject( Object object ) {
  try {
    Map<String, FieldAccess> fields;
    if ( object instanceof Map ) {
      fields = getFieldsFromMap( ( Map<String, Object> ) object );
    } else {
      fields = getPropertyFieldAccessMap( object.getClass() );
    }
    return fields;
  } catch (Exception ex) {
    requireNonNull(object, "Item cannot be null" );
    return handle(Map.class, ex, "Unable to get fields from object", className(object));
  }
}

代码示例来源:origin: boonproject/boon

/**
 * Get fields from object or Map.
 * Allows maps to act like they have fields.
 *
 * @param object
 * @return
 */
public static Map<String, FieldAccess> getFieldsFromObject( Object object ) {
  try {
    Map<String, FieldAccess> fields;
    if ( object instanceof Map ) {
      fields = getFieldsFromMap( ( Map<String, Object> ) object );
    } else {
      fields = getPropertyFieldAccessMap( object.getClass() );
    }
    return fields;
  } catch (Exception ex) {
    requireNonNull(object, "Item cannot be null" );
    return handle(Map.class, ex, "Unable to get fields from object", className(object));
  }
}

代码示例来源:origin: io.fastjson/boon

/**
 * Get fields from object or Map.
 * Allows maps to act like they have fields.
 *
 * @param object
 * @return
 */
public static Map<String, FieldAccess> getFieldsFromObject( Object object ) {
  try {
    Map<String, FieldAccess> fields;
    if ( object instanceof Map ) {
      fields = getFieldsFromMap( ( Map<String, Object> ) object );
    } else {
      fields = getPropertyFieldAccessMap( object.getClass() );
    }
    return fields;
  } catch (Exception ex) {
    requireNonNull(object, "Item cannot be null" );
    return handle(Map.class, ex, "Unable to get fields from object", className(object));
  }
}

代码示例来源:origin: boonproject/boon

handle(ex, "Unable to set property for root object", className(root),
    "for property path", properties, "with new value", newValue,
    "last object in the tree was",
    className(object), "current property index", index);

代码示例来源:origin: boonproject/boon

handle(ex, "Unable to set property for root object", className(root),
    "for property path", properties, "with new value", newValue,
    "last object in the tree was",
    className(object), "current property index", index);

代码示例来源:origin: boonproject/boon

handle(ex, "Unable to set property for root object", className(root),
    "for property path", properties, "with new value", newValue,
    "last object in the tree was",
    className(object), "current property index", index);

代码示例来源:origin: boonproject/boon

handle(ex, "Unable to set property for root object", className(root),
    "for property path", properties, "with new value", newValue,
    "last object in the tree was",
    className(object), "current property index", index);

代码示例来源:origin: io.fastjson/qbit

@Override
public Response<Object> receiveMethodCall(MethodCall<Object> methodCall) {
  if (GlobalConstants.DEBUG) {
    logger.info(Boon.className(this), "::receiveMethodCall",
        methodCall.name(),
        methodCall.address(),
        "\n", methodCall);
  }
  try {
    if (!Str.isEmpty(methodCall.name())) {
      return invokeByName(methodCall);
    } else {
      return invokeByAddress(methodCall);
    }
  } catch (Exception ex) {
    if (ex.getCause() instanceof InvocationTargetException) {
      InvocationTargetException tex = (InvocationTargetException) ex.getCause();
      return new ResponseImpl<>(methodCall, tex.getTargetException());
    }
    return new ResponseImpl<>(methodCall, ex);
  }
}

代码示例来源:origin: io.fastjson/qbit

@Override
public void call(MethodCall<Object> methodCall) {
  if (GlobalConstants.DEBUG) {
    logger.info(Boon.className(this), "::call()",
        methodCall.name(),
        methodCall.address(),
        "\n", methodCall);
  }
  Object object = methodCall.body();
  if (object instanceof List) {
    List list = (List)object;
    for (int index = 0; index < list.size(); index++) {
      Object arg = list.get(index);
      if (arg instanceof Handler) {
        registerHandlerCallbackForClient(methodCall, (Handler) arg);
      }
    }
  } else if (object instanceof Object[]) {
    Object[] array = (Object[]) object;
    for (int index = 0; index < array.length; index++) {
      Object arg = array[index];
      if (arg instanceof Handler) {
        registerHandlerCallbackForClient(methodCall, (Handler) arg);
      }
    }
  }
  methodSendQueue.send(methodCall);
}

代码示例来源:origin: io.fastjson/qbit

private void doCall(MethodCall<Object> methodCall) {
  if (GlobalConstants.DEBUG) {
    logger.info(Boon.className(this), "::doCall()",
        methodCall.name(),
        methodCall.address(),
        "\n", methodCall);
  }
  boolean [] continueFlag = new boolean[1];
  methodCall = beforeMethodCall(methodCall, continueFlag);
  if (!continueFlag[0]) {
    logger.info(Boon.className(this), "::doCall()",
        "Flag from before call handling does not want to continue");
  }
  SendQueue<MethodCall<Object>> sendQueue = null;
  if (  !Str.isEmpty(methodCall.address())  ) {
    sendQueue = handleByAddressCall(methodCall);
  } else if (  !Str.isEmpty(methodCall.objectName())  ) {
    sendQueue = serviceMapping.get(methodCall.objectName());
  }
  if (GlobalConstants.DEBUG && sendQueue==null) {
    putl(serviceMapping.keySet());
    die("SEND QUEUE IS NULL FOR METHOD", methodCall,
        "\n",  serviceMapping.keySet());
    return;
  }
  sendQueue.send(methodCall);
}

代码示例来源:origin: boonproject/boon

"class name of instance", Boon.className(instance),
      "obj", instance);
} finally {

代码示例来源:origin: boonproject/boon

"class name of instance", Boon.className(instance),
      "obj", instance);
} finally {

代码示例来源:origin: io.fastjson/boon

"class name of instance", Boon.className(instance),
      "obj", instance);
} finally {

代码示例来源:origin: boonproject/boon

"VALUE TYPE", className(value), field.type());

代码示例来源:origin: boonproject/boon

"VALUE TYPE", className(value), field.type());

代码示例来源:origin: boonproject/boon

"VALUE TYPE", className(value), field.type());

代码示例来源:origin: boonproject/boon

if (finalArgs!=null) {
  for (Object o : finalArgs) {
    buf.puts("argument type    ", className(o));

相关文章