Trace the configuration (found by introspection) of the underlying object.
This is useful for newly created data sources.
165984
private void traceConfig() {
        writer.println(new StringBuilder(180).append(impl.getClass().getName()).append(' ').append(traceID).append(" = new ").
                        append(impl.getClass().getName()).append("();").toString());

        try {
            PropertyDescriptor[] props = Introspector.getBeanInfo(impl.getClass()).getPropertyDescriptors();
            Method readMeth, writeMeth;

            for (int i = 0; i < props.length; i++) {
                if ((readMeth = props[i].getReadMethod()) != null && (writeMeth = props[i].getWriteMethod()) != null) {
                    StringBuilder buffer = new StringBuilder(60);
                    buffer.append(traceID).append('.').append(writeMeth.getName()).append('(');

                    if (!"password".equals(props[i].getName())) {
                        try {
                            buffer.append(toString(readMeth.invoke(impl, (Object[]) null))); 
                        } catch (Throwable th) {
                        } // No FFDC code needed. Cannot read property.
                    }

                    buffer.append(");");
                    writer.println(new String(buffer));
                }
            }
        } catch (IntrospectionException introspectX) {
            // No FFDC code needed, just include the error in the trace.
            writer.println("Unable to read the configuration for " + traceID);
            introspectX.printStackTrace(writer);
        }
    }
16675
def introspect_service(self, service_name):
        
        data = {}
        service = self.get_service(service_name)

        for operation in service.operations:
            # These are ``Operation`` objects, not operation strings.
            op_data = self.introspect_operation(operation)
            data[op_data['method_name']] = op_data

        return data
517595
def get_id2config_mapping(self):
		
		new_dict = {}
		for k, v in self.data.items():
			new_dict[k] = {}
			new_dict[k]['config'] = copy.deepcopy(v.config)
			try:
				new_dict[k]['config_info'] = copy.deepcopy(v.config_info)
			except:
				pass
		return(new_dict)
245428
public static ExternalListenerMetadata introspect(Class<?> listenerClass) {
    ExternalListenerMetadata cachedMetadata = cache.get(listenerClass);
    if (cachedMetadata != null) {
      return cachedMetadata;
    }
    synchronized (listenerClass) {
      cachedMetadata = cache.get(listenerClass);
      if (cachedMetadata != null) {
        return cachedMetadata;
      }
      ExternalListenerIntrospector introspector = new ExternalListenerIntrospector(listenerClass);
      introspector.introspect();
      cache.put(listenerClass, introspector.metadata);
      return introspector.metadata;
    }
  }
762031
private void updateTraceConfiguration(TraceState state) {
		if (DIRECTORY_TYPE.equals(state.ivStorageType)) {
			LogRepositoryComponent.setTraceDirectoryDestination(state.ivDataDirectory, state.ivPurgeBySizeEnabled, state.ivPurgeByTimeEnabled, 
				state.ivFileSwitchEnabled, state.ivBufferingEnabled, state.ivPurgeMaxSize * ONE_MEG , state.ivPurgeMinTime * MILLIS_IN_HOURS, 
				state.ivFileSwitchTime, state.ivOutOfSpaceAction);
		} else if (MEMORYBUFFER_TYPE.equals(state.ivStorageType)) {
			LogRepositoryComponent.setTraceMemoryDestination(state.ivDataDirectory, state.ivMemoryBufferSize * ONE_MEG);
		} else {
			throw new IllegalArgumentException("Unknown value for trace storage type: " + state.ivStorageType);
		}
	}
1091789
private void exploreClass(Class<?>  clazzToAdd) throws IntrospectionException{
		List<InnerPropertyDescriptor> classList=getProperties(clazzToAdd);
	
		for (InnerPropertyDescriptor descriptor:classList){
			map.put(descriptor.getName(),descriptor);
		}
			
		this.list.addAll(classList);

		Class<?>  superClazz=clazzToAdd.getSuperclass();
		if (superClazz !=null){
			exploreClass(superClazz);
		}
	}
261085
@SuppressWarnings("unchecked")
    private void setupTraceStateObjectField(ClassTraceInfo info) {
        // Skip adding trace object field if it already exists
        AnnotationNode traceObjectAnnotation = getAnnotation(TRACE_OBJECT_FIELD_TYPE.getDescriptor(), info.classNode.visibleAnnotations);
        if (traceObjectAnnotation != null) {
            TraceObjectFieldAnnotationVisitor visitor = new TraceObjectFieldAnnotationVisitor();
            traceObjectAnnotation.accept(visitor);
            List<FieldNode> fields = getFieldsByDesc(visitor.getFieldDescriptor(), info.classNode.fields);
            for (FieldNode fn : fields) {
                if (fn.name.equals(visitor.getFieldName())) {
                    info.traceStateField = fn;
                    break;
                }
            }
            return;
        }

        // If a logger or trace component has been declared, use it.
        // Preference is given to the Liberty TraceComponent over the
        // WebSphere TraceComponent and either TraceComponent over a
        // Logger reference.  If none are declared, generate as a
        // synthetic.
        if (info.libertyTraceComponentFieldNode != null) {
            info.traceStateField = info.libertyTraceComponentFieldNode;
            info.traceStateFieldAlreadyInitialized = info.libertyTraceComponentFieldAlreadyInitialized;
        } else if (info.websphereTraceComponentFieldNode != null) {
            StringBuilder sb = new StringBuilder();
            sb.append("INFO: Runtime BCI is not supported for com.ibm.ejs.ras.  Build-time BCI will be used for class ");
            sb.append(info.classNode.name.replace('/', '.'));
            sb.append(".  Consider using the com.ibm.websphere.ras package.");
            info.warnings.add(sb.toString());
            info.traceStateField = info.websphereTraceComponentFieldNode;
            info.traceStateFieldAlreadyInitialized = info.websphereTraceComponentFieldAlreadyInitialized;
        } else if (info.loggerFieldNode != null) {
            StringBuilder sb = new StringBuilder();
            sb.append("INFO: Runtime BCI is not supported for JSR47 Logging.  Build-time BCI will be used for class ");
            sb.append(info.classNode.name.replace('/', '.'));
            sb.append(".");
            info.warnings.add(sb.toString());
            info.traceStateField = info.loggerFieldNode;
            info.traceStateFieldAlreadyInitialized = info.loggerFieldAlreadyInitialized;
        } else if (defaultTraceType == TraceType.LIBERTY) {
            // TODO: Check for an outer class and a declared field
            int access = (Opcodes.ACC_PRIVATE | Opcodes.ACC_FINAL | Opcodes.ACC_STATIC | Opcodes.ACC_SYNTHETIC);
            info.traceStateField = (FieldNode) info.classNode.visitField(access, "$$$tc$$$", LIBERTY_TRACE_COMPONENT_TYPE.getDescriptor(), null, null);
        }

        // Add the class annotation with the field name and descriptor
        if (info.traceStateField != null) {
            AnnotationVisitor av = info.classNode.visitAnnotation(TRACE_OBJECT_FIELD_TYPE.getDescriptor(), true);
            av.visit("fieldName", info.traceStateField.name);
            av.visit("fieldDesc", info.traceStateField.desc);
            av.visitEnd();
        }
    }
1136276
def known(self, object):
        
        try:
            md = object.__metadata__
            known = md.sxtype
            return known
        except:
            pass
206975
private void addNewChild(String name, Object value) {
        IntrospectionLevelMember prospectiveMember = new IntrospectionLevelMember(_level + 1, name, makeDescription(value), makeMember(value), _allKnownMembersInThisTree);
        if (makeMember(value) != null) {
            // OK, we'd like to introspect the object further - have we seen it?
            if (_allKnownMembersInThisTree.contains(prospectiveMember)) {
                // Already seen it, so ensure we don't reexamine it
                prospectiveMember = new IntrospectionLevelMember(_level + 1, name, makeDescription(value), null, _allKnownMembersInThisTree);
            } else {
                // Ensure we don't reexamine it if we see it again!
                _allKnownMembersInThisTree.add(prospectiveMember);
            }
        }
        _children.add(prospectiveMember);
    }
858355
private void introspectMethods(Class type, Set introspectedClasses) {
		if (type == null || Object.class.equals(type) || introspectedClasses.contains(type)) {
			return;
		}
		introspectedClasses.add(type);
		Class[] interfaces = type.getInterfaces();
		for (int i = 0; i < interfaces.length; i++) {
			introspectMethods(interfaces[i], introspectedClasses);
		}
		introspectMethods(type.getSuperclass(), introspectedClasses);
		Method[] methods = type.getDeclaredMethods();
		for (int i = 0; i < methods.length; i++) {
			String methodName = methods[i].getName();
			if (methodName.startsWith("get") && methods[i].getParameterTypes().length == 0) {
				readAccessors.put(getPropertyName(methodName, 3), methods[i]);
			}
			else if (methodName.startsWith("is") && methods[i].getParameterTypes().length == 0) {
				readAccessors.put(getPropertyName(methodName, 2), methods[i]);
			}
			else if (methodName.startsWith("set") && methods[i].getParameterTypes().length == 1) {
				writeAccessors.put(getPropertyName(methodName, 3), methods[i]);
			}
		}
	}
562121
def trace(self, trace_obj):
        
        tracer = self
        tracer.writeln(u'%s = ' % trace_obj.__class__.__name__)
        tracer.incr('{')
        for attr_name in trace_obj.__tracing_attrs__:
            attr = getattr(trace_obj, attr_name)
            if isinstance(attr, tuple) and hasattr(attr, '_fields'):
                # probably a namedtuple instance
                tracer.writeln(u'%s = ' % (attr_name,))
                tracer.incr('[')
                for k, v in attr._asdict().items():
                    # _asdict() creates an OrderedDict, so elements are still in order
                    tracer.writeln(u'%s = %s' % (k, v))
                tracer.decr(']')
            elif isinstance(attr, (list, tuple)):
                if attr:
                    tracer.writeln(u'%s = ' % (attr_name,))
                    tracer.incr('[')
                    for elem in attr:
                        if hasattr(elem, '__tracing_attrs__'):
                            self.trace(elem)
                        else:
                            # some other plain list element, just print it as it is:
                            tracer.writeln(u'%s' % repr(elem))
                    tracer.decr(']')
                else:
                    tracer.writeln(u'%s = []' % (attr_name,))
            else:
                # a plain attribute object, just print it as it is
                tracer.writeln(u'%s = %s' % (attr_name, repr(attr)))
        tracer.decr('}')
        return self.getvalue()
367137
protected ClassConfigData processClassConfiguration(final InputStream inputStream) throws IOException {
        if (introspectAnnotations == false) {
            return new ClassConfigData(inputStream);
        }

        ClassReader cr = new ClassReader(inputStream);
        ClassWriter cw = new ClassWriter(cr, 0); // Don't compute anything - read only mode
        TraceConfigClassVisitor cv = new TraceConfigClassVisitor(cw);
        cr.accept(cv, 0);
        ClassInfo classInfo = cv.getClassInfo();
        InputStream classInputStream = new ByteArrayInputStream(cw.toByteArray());

        return new ClassConfigData(classInputStream, classInfo);
    }
233235
def describe(self):
        
        result = {}
        #Because we created an Instance object, we already know that this object
        #is not one of the regular built-in types (except, perhaps, for list,
        #dict and set objects that can have their tracking turned on).

        #For objects that are instantiated by the user in __main__, we will
        #already have a paper trail that shows exactly how it was done; but for
        #these, we have to rely on human-specified descriptions.
        from acorn.logging.descriptors import describe
        return describe(self.obj)
909572
void introspectThisClassOnly(com.ibm.ws.rsadapter.FFDCLogger info) {
        info.createFFDCHeader(this);

        info.append("ManagedConnection:", ivManagedConnection);
        info.append("Underlying XAResource Object: " + AdapterUtil.toString(ivXaRes), ivXaRes);
        info.append("Xid: ", AdapterUtil.toString(ivXid)); 
    }
891831
protected void ensureTraceObjectFieldAnnotated() {
        if (traceObjectFieldAnnotationVisitor == null && getTraceObjectFieldType() != null) {
            visitAnnotation(TRACE_OBJECT_FIELD_TYPE.getDescriptor(), true);

            // Save and restore the reference to the traceObjectFieldAnnotationVisitor
            // so subclasses don't believe it existed prior to processing
            TraceObjectFieldAnnotationVisitor av = traceObjectFieldAnnotationVisitor;
            traceObjectFieldAnnotationVisitor = null;
            av.visit("fieldName", getTraceObjectFieldName());
            av.visit("fieldDesc", getTraceObjectFieldType().getDescriptor());
            av.visitEnd();
            traceObjectFieldAnnotationVisitor = av;
        }
    }
1243370
function configuration(self, name) {
  if (!self.__configurations__[name]) {
    throw new Error('Unknown configuration: ' + name);
  }

  return self.__configurations__[name];
}
1170874
void introspectThisClassOnly(com.ibm.ws.rsadapter.FFDCLogger info) {
        // ManagedConnection already reports all of these objects, so we only need to display
        // the hashcode, for verifying we have the right reference in this class.

        info.createFFDCHeader(this);
        info.append("Connection:", AdapterUtil.toString(ivConnection));
        info.append("ManagedConnection:", ivMC);
    }