/** * 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 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 { super.commit(xid, onePhase); try { NucleusLogger.CONNECTION.debug(Localiser.msg("009015", mconn.toString())); conn.commit(); ((ManagedConnectionImpl)mconn).xaRes = null; } catch (SQLException e) { NucleusLogger.CONNECTION.debug(Localiser.msg("009020", mconn.toString(), xid.toString(), onePhase)); XAException xe = new XAException(StringUtils.getStringFromStackTrace(e)); xe.initCause(e); throw xe; } }
/** * 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(); } }
RelationType relationType = mmd.getRelationType(clr); EmbeddedMetaData embmd = mmds.get(0).getEmbeddedMetaData(); if (mmds.size() == 1 && embmd != null && embmd.getOwnerMember() != null && embmd.getOwnerMember().equals(mmd.getName())) NucleusLogger.PERSISTENCE.debug("Field=" + mmd.getFullFieldName() + " not currently supported (embedded)");
/** * 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 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; }
RelationType relationType = mmd.getRelationType(clr); EmbeddedMetaData embmd = mmds.get(0).getEmbeddedMetaData(); if (mmds.size() == 1 && embmd != null && embmd.getOwnerMember() != null && embmd.getOwnerMember().equals(mmd.getName())) NucleusLogger.PERSISTENCE.debug("Field=" + mmd.getFullFieldName() + " not currently supported (embedded)");
public void rollback(Xid xid) throws XAException { super.rollback(xid); try { NucleusLogger.CONNECTION.debug(Localiser.msg("009016", mconn.toString())); conn.rollback(); ((ManagedConnectionImpl)mconn).xaRes = null; } catch (SQLException e) { NucleusLogger.CONNECTION.debug(Localiser.msg("009022", mconn.toString(), xid.toString())); XAException xe = new XAException(StringUtils.getStringFromStackTrace(e)); xe.initCause(e); throw xe; } }
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)
/** * 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("==========================================================="); } }
AbstractMemberMetaData lastMmd = mmds.get(mmds.size()-1); EmbeddedMetaData embmd = mmds.get(0).getEmbeddedMetaData(); if (mmds.size() == 1 && embmd != null && embmd.getOwnerMember() != null && embmd.getOwnerMember().equals(mmd.getName())) NucleusLogger.PERSISTENCE.debug("Field=" + mmd.getFullFieldName() + " not currently supported (embedded), storing as null"); return;
protected boolean addColumnFamilyForColumn(Column col, HTableDescriptor htable, String tableName, Set<String> familyNames, boolean validateOnly) { boolean modified = false; String familyName = HBaseUtils.getFamilyNameForColumn(col); if (!familyNames.contains(familyName)) { familyNames.add(familyName); if (!htable.hasFamily(familyName.getBytes())) { if (validateOnly) { NucleusLogger.DATASTORE_SCHEMA.debug(Localiser.msg("HBase.SchemaValidate.Class.Family", tableName, familyName)); } else if (storeMgr.getSchemaHandler().isAutoCreateColumns()) { NucleusLogger.DATASTORE_SCHEMA.debug(Localiser.msg("HBase.SchemaCreate.Class.Family", tableName, familyName)); HColumnDescriptor hColumn = new HColumnDescriptor(familyName); htable.addFamily(hColumn); modified = true; } } } return modified; }
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()); } }
public void close() { if (NucleusLogger.CONNECTION.isDebugEnabled()) { NucleusLogger.CONNECTION.debug("Closing MongoClient object on resource " + getResourceName()); } mongo.close(); super.close(); }
AbstractMemberMetaData mmd = cmd.getMetaDataForManagedMemberAtAbsolutePosition(fieldNumber); EmbeddedMetaData embmd = mmds.get(0).getEmbeddedMetaData(); if (mmds.size() == 1 && embmd != null && embmd.getOwnerMember() != null && embmd.getOwnerMember().equals(mmd.getName())) NucleusLogger.PERSISTENCE.debug("Field=" + mmd.getFullFieldName() + " not currently supported as embedded into the owning object");
/** * Method called to inform the query result that the connection is being closed so perform * any required operations now, or rest in peace. */ protected void closingConnection() { if (loadResultsAtCommit && isOpen() && moreResultSetRows) { // Query connection closing message NucleusLogger.QUERY.debug(Localiser.msg("052606", query.toString())); try { // If we are still open navigate to the end of the ResultSet before it gets closed advanceToEndOfResultSet(); } catch (RuntimeException re) { if (re instanceof NucleusUserException) { // TODO Localise this message // Log any exception - can get exceptions when maybe the user has specified an invalid result class etc NucleusLogger.QUERY.warn("Exception thrown while loading remaining rows of query : " + re.getMessage()); } else { throw api.getUserExceptionForException("Exception thrown while loading remaining rows of query", re); } } } }