public AttributeSet checkProtection() { if (!protect) { throw log.unprotectedAttributeSet(name); } return this; }
private static void warnLegacy(String oldKey, String newKey) { if (log.isInfoEnabled()) log.infof("Could not find value for key %1$s, but did find value under deprecated key %2$s. Please use %1$s as support for %2$s will eventually be discontinued.", newKey, oldKey); }
@Override public void validate() { if (coreThreads < 0) throw log.illegalValueThreadPoolParameter("core threads", ">= 0"); if (maxThreads <= 0) throw log.illegalValueThreadPoolParameter("max threads", "> 0"); if (maxThreads < coreThreads) throw log.illegalValueThreadPoolParameter( "max threads and core threads", "max threads >= core threads"); if (keepAlive < 0) throw log.illegalValueThreadPoolParameter("keep alive time", ">= 0"); if (queueLength < 0) throw log.illegalValueThreadPoolParameter("work queue length", ">= 0"); }
@Override final public void finishObjectOutput(final ObjectOutput oo) { try { if (trace) log.trace("Stop marshaller"); ((org.jboss.marshalling.Marshaller) oo).finish(); } catch (IOException ignored) { } }
@Override public Transaction suspend() throws SystemException { Transaction tx = getTransaction(); dissociateTransaction(); if (trace) { log.tracef("Suspending tx %s", tx); } return tx; }
@Override public final void unexpectedErrorFromResourceManager(final Throwable t) { super.log.logf(FQCN, ERROR, t, unexpectedErrorFromResourceManager$str()); } private static final String unexpectedErrorFromResourceManager = "ISPN000925: Unexpected error from resource manager!";
@Override public final void afterCompletionFailed(final String synchronization, final Throwable t) { super.log.logf(FQCN, ERROR, t, afterCompletionFailed$str(), synchronization); } private static final String afterCompletionFailed = "ISPN000926: afterCompletion() failed for %s";
@Override public final void couldNotRegisterObjectName(final ObjectName objectName, final InstanceAlreadyExistsException e) { super.log.logf(FQCN, WARN, e, couldNotRegisterObjectName$str(), objectName); } private static final String couldNotRegisterObjectName = "ISPN000943: Could not register object with name: %s";
private static double parseWeight(String weightValue) { try { return Double.valueOf(weightValue); } catch (NumberFormatException nf) { throw log.invalidWeight(weightValue); } }
@Override public final void propertyCouldNotBeReplaced(final String line) { super.log.logf(FQCN, WARN, null, propertyCouldNotBeReplaced$str(), line); } private static final String propertyCouldNotBeReplaced = "ISPN000901: Property %s could not be replaced as intended!";
@Override public final void ignoringException(final String methodName, final String exceptionName, final Throwable t) { super.log.logf(FQCN, WARN, t, ignoringException$str(), methodName, exceptionName); } private static final String ignoringException = "ISPN000902: Invocation of %s threw an exception %s. Exception is ignored.";
@Override public final void unableToConvertStringPropertyToInt(final String value, final int defaultValue) { super.log.logf(FQCN, WARN, null, unableToConvertStringPropertyToInt$str(), value, defaultValue); } private static final String unableToConvertStringPropertyToInt = "ISPN000906: Unable to convert string property [%s] to an int! Using default value of %d";
@Override public final void errorRollingBack(final Throwable e) { super.log.logf(FQCN, ERROR, e, errorRollingBack$str()); } private static final String errorRollingBack = "ISPN000922: Exception during rollback";
@Override public final void unableToConvertStringPropertyToLong(final String value, final long defaultValue) { super.log.logf(FQCN, WARN, null, unableToConvertStringPropertyToLong$str(), value, defaultValue); } private static final String unableToConvertStringPropertyToLong = "ISPN000907: Unable to convert string property [%s] to a long! Using default value of %d";
@Override public final void errorEnlistingResource(final Throwable e) { super.log.logf(FQCN, ERROR, e, errorEnlistingResource$str()); } private static final String errorEnlistingResource = "ISPN000923: Error enlisting resource";
@Override public final void errorCommittingTx(final Throwable e) { super.log.logf(FQCN, WARN, e, errorCommittingTx$str()); } private static final String errorCommittingTx = "ISPN000927: exception while committing";
@Override public final void xaResourceEndFailed(final String xaResource, final Throwable t) { super.log.logf(FQCN, ERROR, t, xaResourceEndFailed$str(), xaResource); } private static final String xaResourceEndFailed = "ISPN000928: end() failed for %s";
@Override public final void unableToConvertStringPropertyToEnum(final String value, final String defaultValue) { super.log.logf(FQCN, WARN, null, unableToConvertStringPropertyToEnum$str(), value, defaultValue); } private static final String unableToConvertStringPropertyToEnum = "ISPN000942: Unable to convert property [%s] to an enum! Using default value of %d";
private static void checkValidQuotes(String paramValue) { if (!checkStartAndEnd(paramValue, '\'') && !checkStartAndEnd(paramValue, '\"')) { throw log.unquotedMediaTypeParam(); } }
@Override final public void finishObjectInput(final ObjectInput oi) { try { if (trace) log.trace("Stop unmarshaller"); if (oi != null) ((Unmarshaller) oi).finish(); } catch (IOException ignored) { } }