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 8493371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:59:12+00:00 2026-06-10T22:59:12+00:00

I know I can have SimpleType values like SimpleType.INTEGER, SimpleType.STRING in a CompositeData. But

  • 0

I know I can have SimpleType values like SimpleType.INTEGER, SimpleType.STRING in a CompositeData. But I wonder how do I get another instance of CompositeData into CompositeData. E. g.:

CompositeType type = new CompositeType("My Type", "My Type", new String[]{"item1", "item2"}, new String[]{"item1", "item2"}, new OpenType[]{SimpleType.STRING, SimpleType.STRING});
CompositeData data = new CompositeDataSupport(type, new String[]{"item1", "item2"}, new String[]{"item value 1", "item value 2"});

CompositeType compType = new CompositeType("compData", "compData", new String[]{"compItem1"}, new String[]{"compItem1"}, new OpenType[]{I_DONT_KNOW_WHAT_TO_PUT_HERE});
CompositeData compData = new CompositeDataSupport(compType, new String[]{"compData"}, data);

See the “I_DONT_KNOW_WHAT_TO_PUT_HERE” above, I could not find out how to pass an OpenType of CompositeData. And I have seen an examples of recursively getting the instances of nested CompositeData from CompositeData.

Some references:

http://docs.oracle.com/javase/6/docs/api/javax/management/openmbean/CompositeData.html
http://docs.oracle.com/javase/6/docs/api/javax/management/openmbean/CompositeType.html
http://docs.oracle.com/javase/6/docs/api/javax/management/openmbean/OpenType.html

  • 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-10T22:59:14+00:00Added an answer on June 10, 2026 at 10:59 pm

    The value of I_DONT_KNOW_WHAT_TO_PUT_HERE is type, but the 2nd argument in the constructor on code line 4 should have the string “compItem1“, not “compData” since this represents the item name you defined in the 3rd parameter on code line 4.

    Here’s the full code:

        CompositeType type = new CompositeType("My Type", "My Type", new String[]{"item1", "item2"}, new String[]{"item1", "item2"}, new OpenType[]{SimpleType.STRING, SimpleType.STRING});
        CompositeData data = new CompositeDataSupport(type, new String[]{"item1", "item2"}, new String[]{"item value 1", "item value 2"});
    
        CompositeType compType = new CompositeType("compData", "compData", new String[]{"compItem1"}, new String[]{"compItem1"}, new OpenType[]{type});
        CompositeData compData = new CompositeDataSupport(compType, new String[]{"compItem1"}, new Object[]{data});
    

    Have you considered using MXBeans ? Unless you really need all that additional meta-data, it’s a much simpler (and maintainable) way to go for exposing complex attributes in JMX.

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

Sidebar

Related Questions

I know that ScrollView can have only one Child but in my case I
I know that you can't have a constructor in an interface, but here is
I have a query that I know can be done using a subselect, but
I know with OO Perl I can have objects and inheritance, but are interfaces
I'd like to know if there are any mechanism in Akka that can have
I know i can have common stuff like this in django <html> {% include
I know you can have String answer = (5 == 5) ? yes :
I wanted to know can we have images as a values in properties file
I know you can have multiple components in a picker view but is there
I know I can have 1 parent element and 1 child element in my

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.