Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to analyze Release with source code

2025-02-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how to use the source code to analyze Release, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

The entrance to release is bin/release, and you also need a build directory to instantiate the buildpack object and call its release interface buildpack#release method

The basic structure of the code is similar to that of compile, probing whether each component supports it or not, and then calling the release method of each component. The entrance to release is bin/release.

Ruby code

Def release

Container = component_detection ('container', @ containers, true) .first

Fail'No container can run this application' unless container

Component_detection ('JRE', @ jres, true) .first.release

Component_detection ('framework', @ frameworks, false) .each (&: release)

Command = container.release

Payload = {

'addons' = > []

'config_vars' = > {}

'default_process_types' = > {' web' = > command}

}. To_yaml

@ logger .debug {"Release Payload:\ n # {payload}"}

Payload

End

Release method of JRE

The instantiation of the JRE component is actually an instance of OpenJdkJRE, and OpenJdkJRE inherits from the OpenJDKLike,release method in the OpenJDKLike class

Ruby code

Def release

@ droplet.java_opts

.add _ system_property ('java.io.tmpdir',' $TMPDIR')

.add _ option ('- XX:OnOutOfMemoryError', killjava)

.concat memory

End

From this you can see that the release method returns run-time parameters.

JRE includes temporary directory of JDK, scripts executed after memory overflow, and parameters of memory limit.

Release method of Tomcat

Call the release method that is still a subproject

Ruby code

Def release

@ sub_components.map (&: release)

Command

End

Release method of TomcatInstance

I didn't do anything.

Ruby code

Def release

End

TomcatLifecycleSupport,TomcatLifecycleSupport 's release method does nothing either.

Release method of TomcatAccessLoggingSupport

Ruby code

Def release

@ droplet.java_opts.add_system_property 'access.logging.enabled', @ arrangement [key _ ENABLED] =' enabled'

End

Added run-time parameters:

Summary of access.logging.enabled and access_logging enabled

From the source code, the release method is to get the run-time parameters of a component.

The above is how to use the source code to analyze Release, the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report