"Getting Started with GlassFish" using jvm-options

Source: Internet
Author: User
Tags glassfish

First, explain what jvm-options can do, and simply say that you can pass parameters while the program is running. Similar to the configuration file, but there is no way to configure the configuration file, you can only use this method.


1. Start Gf,start-domain


2. Create Jvm-options
Create-jvm-options-da= ' true '

create-jvm-options-db= ' abc '

Create-jvm-options-dc= ' 10\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3} '

Attention:

-D directly after the parameter name;

If there are special characters in the string, such as {}, you can use single quotation marks, or you can use "\" to escape each special character (such as \{\}).


3. View Jvm-options
List-jvm-options


4. Delete Jvm-options
Delete-jvm-options--target server-da= ' true '

Attention:

When you need to change the parameter value, you must delete the original value and reset it;

The parameter names and values must be the same as the original values when deleting;

When there are multiple identical parameter names, you can only get one of them (forget the first one or the last one).


5. Get the Jvm-options parameter method in the application (some versions need to be restarted to take effect)
public static final String a= "A";
public static final String b= "B";
1), gets the string, or returns NULL if the fetch fails.
String b= System.getproperty (b);
2), gets the Boolean, gets the failure return false.
Private Boolean a= Boolean.getboolean (a);

This article is from the "Night" blog, be sure to keep this source http://icyore.blog.51cto.com/8486958/1690058

"Getting Started with GlassFish" using jvm-options

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.