What is the meaning of $$$view in java log file?

大兔子大兔子 提交于 2021-01-20 12:52:34

问题


I got an exception with a stack trace containing the following line

my.company.Service$$$view26.myMethod(Unknown Source)

Can anybody help me to understand what the $$$view part means?

We are using JBoss EAP 6.4 and Java 8.


回答1:


A dollar sign ($, one or multiple) means that it is a generated class.

CDI (Weld 1.x in case of EAP 6.4 you are using) is one of the 'frameworks' which uses this pattern. It creates proxies based on your classes in order to allow for interception decoration and bean injection. All generated classes will have the same package name and class name and will be appended by the magical dollar affixes. My guess is that you came across it with some CDI functionality.

Also some of the JBoss logging frameworks (probably used in either Weld or other EAP part) allowed to create an automated logger classes based on annotations. The creation of these loggers was also based on adding the $ affix to class name.

It is a common practice and allows to 'easily' (not really easy though) identify generated classes. Although I cannot dig up any official requirement that generated classes should have this.



来源:https://stackoverflow.com/questions/39828803/what-is-the-meaning-of-view-in-java-log-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!