本文整理汇总了Java中org.apache.openejb.util.Logger.isDebugEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java Logger.isDebugEnabled方法的具体用法?Java Logger.isDebugEnabled怎么用?Java Logger.isDebugEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.openejb.util.Logger
的用法示例。
在下文中一共展示了Logger.isDebugEnabled方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: print
import org.apache.openejb.util.Logger; //导入方法依赖的package包/类
public void print(final Logger log, boolean formatXml) {
if (log.isDebugEnabled()) {
final StringBuilder builder = new StringBuilder();
builder.append("******************* REQUEST ******************\n");
builder.append(method).append(" ").append(uri).append("\n");
for (Map.Entry<String, List<String>> entry : headers.entrySet()) {
builder.append(entry).append("\n");
}
builder.append("\n");
final String text = new String(body);
if (formatXml && OpenEJBHttpServer.isTextXml(headers)) {
builder.append(OpenEJBHttpServer.reformat(text)).append("\n");
} else {
builder.append(text).append("\n");
}
builder.append("**********************************************").append("\n");
log.debug(builder.toString());
}
}
示例2: logInTomEE
import org.apache.openejb.util.Logger; //导入方法依赖的package包/类
private Principal logInTomEE(final Principal pcp) {
if (pcp == null) {
return null;
}
if (securityService == null) { // tomee-embedded get it later than startInternals so we need it this way
securityService = (TomcatSecurityService) SystemInstance.get().getComponent(SecurityService.class);
}
// normally we don't care about oldstate because the listener already contains one
// which is the previous one
// so no need to clean twice here
final Request request = OpenEJBSecurityListener.requests.get();
if (request != null) {
final Object securityContext = securityService.enterWebApp(this, pcp, OpenEJBSecurityListener.requests.get().getWrapper().getRunAs());
request.setNote(SECURITY_NOTE, securityContext);
} else {
final CUTask.Context context = CUTask.Context.CURRENT.get();
if (context != null) {
final Object state = securityService.enterWebApp(this, pcp, null);
context.pushExitTask(new Runnable() {
@Override
public void run() {
securityService.exitWebApp(state);
}
});
} else {
final Logger instance = Logger.getInstance(LogCategory.OPENEJB_SECURITY, TomEERealm.class);
if (instance.isDebugEnabled()) {
instance.debug(
"No request or concurrency-utilities context so skipping login context propagation, " +
"thread=" + Thread.currentThread().getName());
}
}
}
return pcp;
}
示例3: applyTransactionAttributes
import org.apache.openejb.util.Logger; //导入方法依赖的package包/类
public static void applyTransactionAttributes(final BeanContext beanContext, List<MethodTransactionInfo> methodTransactionInfos) throws OpenEJBException {
if (beanContext.isBeanManagedTransaction()) {
return;
}
methodTransactionInfos = normalize(methodTransactionInfos);
final Map<MethodInfoUtil.ViewMethod, MethodAttributeInfo> attributes = resolveViewAttributes(methodTransactionInfos, beanContext);
final Logger log = Logger.getInstance(LogCategory.OPENEJB_STARTUP.createChild("attributes"), MethodTransactionBuilder.class);
final boolean debug = log.isDebugEnabled();
for (final Map.Entry<MethodInfoUtil.ViewMethod, MethodAttributeInfo> entry : attributes.entrySet()) {
final MethodInfoUtil.ViewMethod viewMethod = entry.getKey();
final Method method = viewMethod.getMethod();
final String view = viewMethod.getView();
final MethodTransactionInfo transactionInfo = (MethodTransactionInfo) entry.getValue();
if (debug) {
log.debug("Transaction Attribute: " + method + " -- " + MethodInfoUtil.toString(transactionInfo));
}
beanContext.setMethodTransactionAttribute(method, TransactionType.get(transactionInfo.transAttribute), view);
}
}