Class DefaultTransformRegistry

    • Field Detail

      • XML_ATTRIBUTE_NAME_ID

        private static final java.lang.String XML_ATTRIBUTE_NAME_ID
        See Also:
        Constant Field Values
      • XML_ELEMENT_NAME_EVENT

        private static final java.lang.String XML_ELEMENT_NAME_EVENT
        See Also:
        Constant Field Values
      • XML_ELEMENT_METHOD_NAME

        private static final java.lang.String XML_ELEMENT_METHOD_NAME
        See Also:
        Constant Field Values
      • XML_ELEMENT_FIELD_NAME

        private static final java.lang.String XML_ELEMENT_FIELD_NAME
        See Also:
        Constant Field Values
      • XML_ELEMENT_PARAMETER_NAME

        private static final java.lang.String XML_ELEMENT_PARAMETER_NAME
        See Also:
        Constant Field Values
      • XML_ELEMENT_RETURN_VALUE_NAME

        private static final java.lang.String XML_ELEMENT_RETURN_VALUE_NAME
        See Also:
        Constant Field Values
      • XML_ELEMENT_CONFIGURATION

        private static final java.lang.String XML_ELEMENT_CONFIGURATION
        See Also:
        Constant Field Values
      • logger

        private static final java.util.logging.Logger logger
      • transformData

        private final java.util.HashMap<java.lang.String,​java.util.List<TransformDescriptor>> transformData
      • revertInstrumentation

        private volatile boolean revertInstrumentation
      • currentConfiguration

        private java.lang.String currentConfiguration
      • PROBE_SCHEMA_XSD

        private static final java.lang.String PROBE_SCHEMA_XSD
        See Also:
        Constant Field Values
      • PROBE_SCHEMA

        private static final javax.xml.validation.Schema PROBE_SCHEMA
    • Constructor Detail

      • DefaultTransformRegistry

        public DefaultTransformRegistry()
    • Method Detail

      • hasPendingTransforms

        public boolean hasPendingTransforms​(java.lang.String className)
        Description copied from interface: TransformRegistry
        The named class has transforms that have not been executed yet.
        Specified by:
        hasPendingTransforms in interface TransformRegistry
        Parameters:
        className - the name of the class to be transformed.
        Returns:
        true if the class has transforms scheduled. false if not.
      • parseTransformData

        private static TransformDescriptor parseTransformData​(javax.xml.stream.XMLStreamReader streamReader,
                                                              java.util.HashMap<java.lang.String,​java.lang.String> globalDefaults)
                                                       throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • transfer

        private static void transfer​(java.util.HashMap<java.lang.String,​java.lang.String> globalDefaults,
                                     java.util.Map<java.lang.String,​java.lang.String> values)
      • readGlobalConfig

        private static void readGlobalConfig​(javax.xml.stream.XMLStreamReader streamReader,
                                             java.util.HashMap<java.lang.String,​java.lang.String> globalDefaults)
      • addDefaults

        private static void addDefaults​(java.util.HashMap<java.lang.String,​java.lang.String> globalDefaults)
      • parseParameter

        private static Parameter parseParameter​(int index,
                                                javax.xml.stream.XMLStreamReader streamReader)
                                         throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • parseField

        private static Field parseField​(javax.xml.stream.XMLStreamReader streamReader)
                                 throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • parseReturnValue

        private static ReturnValue parseReturnValue​(javax.xml.stream.XMLStreamReader streamReader)
                                             throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • parseMethod

        private static Method parseMethod​(javax.xml.stream.XMLStreamReader streamReader,
                                          java.util.List<Parameter> parameters,
                                          ReturnValue[] returnValue)
                                   throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • getTransformData

        public java.util.List<TransformDescriptor> getTransformData​(java.lang.String className)
        Description copied from interface: TransformRegistry
        Returns the unmodifiable list of TransformDescriptors for the named class.
        Specified by:
        getTransformData in interface TransformRegistry
        Parameters:
        className - the class for which to retrieve the transformation metadata.
        Returns:
        the list of transformation metadata for the named class; may be empty but never null.
      • isPendingTransforms

        private boolean isPendingTransforms​(java.util.List<TransformDescriptor> transforms)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • modify

        public java.util.Set<java.lang.String> modify​(java.lang.String xmlDescription)
                                               throws XMLValidationException
        Description copied from interface: TransformRegistry
        Modifies class information in the registry according to the xml description.
        Specified by:
        modify in interface TransformRegistry
        Parameters:
        xmlDescription - an XML snippet describing the wanted modifications.
        Returns:
        a set of class names associated with modified TransformDescriptors.
        Throws:
        XMLValidationException - if the supplied XML fails to validate.
      • clearAllOtherTransformData

        private void clearAllOtherTransformData​(java.util.Set<java.lang.String> classesToKeep)
      • clearAllTransformData

        public java.util.Set<java.lang.String> clearAllTransformData()
        Description copied from interface: TransformRegistry
        Clears all classes and their corresponding transforms in the registry.
        Specified by:
        clearAllTransformData in interface TransformRegistry
        Returns:
        the set of class names that were cleared.
      • getXmlAsString

        private static java.lang.String getXmlAsString​(java.io.InputStream in)
      • getClassNames

        public java.util.Set<java.lang.String> getClassNames()
        Description copied from interface: TransformRegistry
        Returns the names of all classes stored in the registry.
        Specified by:
        getClassNames in interface TransformRegistry
        Returns:
        the unmodifiable set of class names.
      • getCurrentConfiguration

        public java.lang.String getCurrentConfiguration()
        Description copied from interface: TransformRegistry
        Returns the currently instrumented configuration.
        Specified by:
        getCurrentConfiguration in interface TransformRegistry
        Returns:
        an XML snippet of the configuration.
      • setCurrentConfiguration

        public void setCurrentConfiguration​(java.lang.String configuration)
        Description copied from interface: TransformRegistry
        Set the current configuration that will be instrumented
        Specified by:
        setCurrentConfiguration in interface TransformRegistry
        Parameters:
        configuration - an XML snippet describing the current configuration
      • setRevertInstrumentation

        public void setRevertInstrumentation​(boolean shouldRevert)
        Description copied from interface: TransformRegistry
        Signify classes are or are not being reverted to their pre instrumentation versions.
        Specified by:
        setRevertInstrumentation in interface TransformRegistry
        Parameters:
        shouldRevert - true if class instrumentation should be reverted, false otherwise.
      • isRevertIntrumentation

        public boolean isRevertIntrumentation()
        Description copied from interface: TransformRegistry
        Determines if classes should be reverted to their pre instrumentation versions.
        Specified by:
        isRevertIntrumentation in interface TransformRegistry
        Returns:
        true, if classes should be reverted and false otherwise.
      • disableExternalEntityProcessing

        private static void disableExternalEntityProcessing​(javax.xml.stream.XMLInputFactory inputFactory)