/** * Method to close the definition of the class method. * This implementation simply logs a debug message to category ENHANCER. */ public void close() { if (DataNucleusEnhancer.LOGGER.isDebugEnabled()) { String msg = getMethodAdditionMessage(methodName, returnType, argTypes, argNames); DataNucleusEnhancer.LOGGER.debug(LOCALISER.msg("Enhancer.AddMethod", msg)); } }
/** * Convenience method to report an error in the enhancement of this class. * @param msg The message */ protected void reportError(String msg) { if (logErrors) { DataNucleusEnhancer.LOGGER.error(msg); } else { if (DataNucleusEnhancer.LOGGER.isDebugEnabled()) { DataNucleusEnhancer.LOGGER.debug(msg); } } enhanced = false; }
/** * Method to add fields to match the PK fields of the persistable class * @param cw The ClassWriter to use */ protected void addFields(ClassWriter cw) { int[] pkPositions = cmd.getPKMemberPositions(); for (int i=0;i<pkPositions.length;i++) { AbstractMemberMetaData mmd = cmd.getMetaDataForManagedMemberAtPosition(pkPositions[i]); String fieldTypeName = getTypeNameForField(mmd); if (DataNucleusEnhancer.LOGGER.isDebugEnabled()) { DataNucleusEnhancer.LOGGER.debug(LOCALISER.msg("Enhancer.AddField", fieldTypeName + " " + pkClassName + " " + mmd.getName())); } FieldVisitor fv = cw.visitField(Opcodes.ACC_PUBLIC, mmd.getName(), ASMUtils.getTypeDescriptorForType(fieldTypeName), null, null); fv.visitEnd(); } }
/** * Close the method */ public void close() { // Override the log message if (DataNucleusEnhancer.LOGGER.isDebugEnabled()) { DataNucleusEnhancer.LOGGER.debug(LOCALISER.msg("Enhancer.AddConstructor", getClassEnhancer().className + "()")); } } }
/** * Method called at the end of visiting the setXXX method. * This is used to add the aaaSetXXX method with the same code as is present originally in the setXXX method. */ public void visitEnd() { visitor.visitEnd(); if (DataNucleusEnhancer.LOGGER.isDebugEnabled()) { String msg = ClassMethod.getMethodAdditionMessage(ASMClassEnhancer.MN_SetterPrefix + mmd.getName(), null, new Object[]{mmd.getType()}, new String[] {"val"}); DataNucleusEnhancer.LOGGER.debug(LOCALISER.msg("Enhancer.AddMethod", msg)); } if (!mmd.isAbstract()) { // Property is not abstract so generate the setXXX method to use the aaaSetXXX we just added generateSetXXXMethod(mv, mmd, enhancer.getASMClassName(), enhancer.getClassDescriptor(), ASMClassEnhancer.useFrames()); } }
/** * Convenience method to log the configuration of this store manager. */ protected void logConfiguration() { super.logConfiguration(); if (NucleusLogger.DATASTORE.isDebugEnabled()) { NucleusLogger.DATASTORE.debug("StorageVersion : " + storageVersion.toString()); NucleusLogger.DATASTORE.debug("Default Relation Mode : " + getStringProperty(RELATION_DEFAULT_MODE)); NucleusLogger.DATASTORE.debug("==========================================================="); } }
public void commit(Xid xid, boolean onePhase) throws XAException { if (NucleusLogger.CONNECTION.isDebugEnabled()) { NucleusLogger.CONNECTION.debug(Localiser.msg("009015", this.toString())); } super.commit(xid, onePhase); }
if (DataNucleusEnhancer.LOGGER.isDebugEnabled()) DataNucleusEnhancer.LOGGER.debug(LOCALISER.msg("Enhancer.AddMethod", "int " + pkClassName + ".hashCode()")); mv.visitFieldInsn(Opcodes.GETFIELD, className_ASM, mmd.getName(), ASMUtils.getTypeDescriptorForType(mmd.getTypeName())); if (mmd.getType() == long.class)
public void close() { if (NucleusLogger.CONNECTION.isDebugEnabled()) { NucleusLogger.CONNECTION.debug("Closing MongoClient object on resource " + getResourceName()); } mongo.close(); super.close(); }
public void rollback(Xid xid) throws XAException { if (NucleusLogger.CONNECTION.isDebugEnabled()) { NucleusLogger.CONNECTION.debug(Localiser.msg("009016", this.toString())); } super.rollback(xid); } }
/** * Method called at the end of visiting the getXXX method. * This is used to add the aaaGetXXX method with the same code as is present originally in the getXXX method. */ public void visitEnd() { visitor.visitEnd(); if (DataNucleusEnhancer.LOGGER.isDebugEnabled()) { String msg = ClassMethod.getMethodAdditionMessage(enhancer.getGetMethodPrefixMethodName() + mmd.getName(), mmd.getType(), null, null); DataNucleusEnhancer.LOGGER.debug(LOCALISER.msg("Enhancer.AddMethod", msg)); } if (!mmd.isAbstract()) { // Property is not abstract so generate the getXXX method to use the aaaGetXXX we just added generateGetXXXMethod(mv, mmd, enhancer.getASMClassName(), enhancer.getClassDescriptor(), false, ASMClassEnhancer.useFrames()); } }
/** * Convenience method to log the configuration of this store manager. */ protected void logConfiguration() { super.logConfiguration(); if (NucleusLogger.DATASTORE.isDebugEnabled()) { // DB4O specific configuration NucleusLogger.DATASTORE.debug("DB4O Version : " + Db4o.version()); PersistenceConfiguration conf = nucleusContext.getPersistenceConfiguration(); String outputFilename = conf.getStringProperty("datanucleus.db4o.outputFile"); if (outputFilename != null) { NucleusLogger.DATASTORE.debug("DB4O Output : " + outputFilename); } // TODO Add db4o global properties here NucleusLogger.DATASTORE.debug("==========================================================="); } }
/** * Utility method to add a column to the internal representation * @param col The column */ protected synchronized void addColumnInternal(Column col) { DatastoreIdentifier colName = col.getIdentifier(); columns.add(col); columnsByIdentifier.put(colName, col); if (NucleusLogger.DATASTORE_SCHEMA.isDebugEnabled()) { NucleusLogger.DATASTORE_SCHEMA.debug(Localiser.msg("057034", col)); } }
if (DataNucleusEnhancer.LOGGER.isDebugEnabled()) DataNucleusEnhancer.LOGGER.debug(LOCALISER.msg("Enhancer.AddMethod", "String " + pkClassName + ".toString()")); mv.visitFieldInsn(Opcodes.GETFIELD, className_ASM, mmd.getName(), ASMUtils.getTypeDescriptorForType(mmd.getTypeName())); mv.visitFieldInsn(Opcodes.GETFIELD, className_ASM, mmd.getName(), ASMUtils.getTypeDescriptorForType(mmd.getTypeName())); mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "java/lang/StringBuilder", "append",
if (NucleusLogger.DATASTORE_NATIVE.isDebugEnabled()) NucleusLogger.DATASTORE_NATIVE.debug("Retrieving objects for candidate=" + candidateClass.getName() + (subclasses ? " and subclasses" : "") + (filter != null ? (" with filter=" + filter) : ""));
/** * Method to initialise the table. * This will initialise the primary key columns for the table. Any other columns * are added via the addFieldMapping() method. * @param clr The ClassLoaderResolver */ public void initialize(ClassLoaderResolver clr) { assertIsUninitialized(); // TODO Support <primary-key> specification of the columns to use in the PK. // This doesnt seem too important IMHO since the secondary table should *always* be // joined using the PK of the primary table (and one row in the secondary table matches // one row in the primary table). if (NucleusLogger.DATASTORE_SCHEMA.isDebugEnabled()) { NucleusLogger.DATASTORE_SCHEMA.debug(Localiser.msg("057023", this)); } state = TABLE_STATE_INITIALIZED; }
if (NucleusLogger.PERSISTENCE.isDebugEnabled()) str.append(cmd.getMetaDataForManagedMemberAtAbsolutePosition(fieldNumbers[i]).getName()); NucleusLogger.PERSISTENCE.debug(str.toString()); if (NucleusLogger.DATASTORE_RETRIEVE.isDebugEnabled()) NucleusLogger.DATASTORE_RETRIEVE.debug(Localiser.msg("NeoDatis.Fetch.Start", sm.getObjectAsPrintable(), sm.getInternalObjectId())); updateVersionOfManagedObject(sm); if (NucleusLogger.DATASTORE_RETRIEVE.isDebugEnabled()) NucleusLogger.DATASTORE_RETRIEVE.debug(Localiser.msg("NeoDatis.ExecutionTime", (System.currentTimeMillis() - startTime)));
@Override public boolean validateObject(PooledObject<PoolableConnection> p) { try { validateLifetime(p); validateConnection(p.getObject()); return true; } catch (Exception e) { if (log.isDebugEnabled()) { log.debug(Utils.getMessage( "poolableConnectionFactory.validateObject.fail"), e); } return false; } }
public void release() { if (commitOnRelease) { if (NucleusLogger.CONNECTION.isDebugEnabled()) { NucleusLogger.CONNECTION.debug(Localiser.msg("009015", this.toString())); } } super.release(); }
if (NucleusLogger.DATASTORE_RETRIEVE.isDebugEnabled()) fieldsString.append(cmd.getMetaDataForManagedMemberAtAbsolutePosition(fieldNumbers[i]).getName()); NucleusLogger.DATASTORE_RETRIEVE.debug(Localiser.msg("XML.Fetch.Start", op.getObjectAsPrintable(), op.getInternalObjectId(), fieldsString)); if (NucleusLogger.DATASTORE_RETRIEVE.isDebugEnabled()) NucleusLogger.DATASTORE_RETRIEVE.debug(Localiser.msg("XML.ExecutionTime", (System.currentTimeMillis() - startTime)));