Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9201591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:03:07+00:00 2026-06-17T23:03:07+00:00

All I have seen the jboss-service.xml which use an extended SystemPropertiesService class to reference

  • 0

All

I have seen the jboss-service.xml which use an extended SystemPropertiesService class to reference to custom property file. But I didn’t totally understood this kind of usage yet.
Could someone please give me some help to understand how to use these two class? thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T23:03:08+00:00Added an answer on June 17, 2026 at 11:03 pm

    The SystemPropertiesService is very useful to define properties that then can be accessed from your application, it’s usually used to parametrize the application without having to change to code, or even the application package (provided you place the jboss-service.xml outside de war / ear / jar structure). For example, you can create a myapp-service.xml file with the following content:

    <server>
     <mbean code="org.jboss.varia.property.SystemPropertiesService" name="jboss:type=Service,name=MyAppProperties">
     <!-- Define the properties directly in the service.xml file-->
     <attribute name="Properties">
         myapp.property1=property1Value
         myapp.property2=property2Value
     </attribute>
     <!-- You can also specify a route to another file where you define properties-->
     <attribute name="URLList">
         /home/myuser/txtlist.properties
     </attribute>
     </mbean>
    </server>
    

    Then you can deploy this file directly in JBoss, the properties defined will be visible to all the applications deployed in the same JBoss and you’ll be able to access them with the static method:

    String System.getProperty(String propertyName)
    

    So if you want to access to the value of myapp.property1 from your application you’d do:

    String property = System.getProperty("myapp.property");
    

    On the other hand the PropertyListener is really an interface that defines a listener that will be triggered when any event occurs with a property. The org.jboss.util.property.PropertyAdapter is an abstract implementation of this interface. To use it you’ve to implement its three methods (propertyAdded, propertyChanged, propertyRemoved), that will be called by the container when a property is added, changed or removed respectively. Those methods have a PropertyEvent object as parameter, which let you know the property affected.

    This interface/class is useful when you want your application to do something every time a property changes (a bad implementation would be that you check every certain time for a property change), this way, when JBoss detects that a property has changed its value, it will call the respective method (that you should implement with the behaviour you want).

    For example, if you want to print the new property value everytime it’s changed you could implement the propertyChanged method this way:

    void propertyChanged (PropertyEvent pe){
        // check the property that has changed
        if (pe.getPropertyName().equals("myapp.property1")){
             System.out.println("The value of " + pe.getPropertyName() + " has changed to " + pe.getPropertyValue());
        }
    }
    

    Look for more information in the API, and for PropertyAdapter and PropertyEvent.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have seen n-tiers solutions on the web, they all use DLLs for each
I have seen numerous ways to highlight the current tab, but they all have
We have all seen countless instances of forms with a select drop down having
I have seen posts all over the internet that talk about how to fix
I have seen tutorials all over the place for explaining how to get Code
All the examples I have seen where the PropertyPlaceHolderConfigurer is used seem to be
I have seen the example here . All well and good and I understand
All the in-browser chat rooms I have seen so far append messages into the
I have seen on many sites the silverlight video player. I noticed that all
I have seen some demos about the jQuery wizard plugin on websites. But all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.