Can I register my own MBean by JVM built-in MBeans?

Hi!
I'm looking for a way to run my own MBean with JVM, just like how the JVM built-in MBeans run in JVM (you don't have to call them in your java program, but only set the JVM parameter -Dcom.sun.management.jmxremote).
Is there a mechanism to register my own MBean by the built-in MBeans?
Thank you!

I can see two ways to accomplish what you are asking for.
The first is to define an "instrumentation agent" as described in the documentation for java.lang.instrument. You create myagent.jar which has a class com.example.PreMain with a method premain(String,Instrumentation) that registers your MBeans. You arrange for Premain-Class: com.example.PreMain to appear in the jar's manifest. Then you run your applications with -javaagent:myagent.jar.
The second is to intervene during the construction of MBeanServer instances by running your applications with -Djavax.management.builder.initial=com.example.MyMBeanServerBuilder. The MyMBeanServerBuilder class might look like this:
public class MyMBeanServerBuilder extends MBeanServerBuilder {
    @Override
    public MBeanServer newMBeanServer(
            String defaultDomain, MBeanServer outer, MBeanServerDelegate delegate) {
        MBeanServer mbs = super.newMBeanServer(defaultDomain, outer, delegate);
        mbs.registerMBean(myMBean, myMBeanName);
        return mbs;
}I think the first approach is considerably cleaner.
Regards,
�amonn McManus -- JMX Spec Lead -- http://weblogs.java.net/blog/emcmanus

Similar Messages

  • How to register and unregister Mbean server when jvm is crashed.

    Hi All,
    how to register and unregister Mbean server when jvm is crashed with specifying like internal error(xxxxxxxxxxxsome number)
    I am getting error NameAlreadyBindExcetion when i call the below method in my program, how to unregister and register again, can any one can help on this topic?
    internalConnectorService.start();
    regards
    Prasad.Nadendla

    Looks like your server object is already bound and registered and your trying to re-register the same...
    is that a corba server? if yes, you'd be able to check that with the NamingService tools

  • HT5622 I own three Apple devices, but my iPad remained associated with my old email address and password. How can I register it with the same new email and password?

    I own three Apple devices, but my iPad remained associated with my old email address and password. How can I register it with the same new email and password?

    If you updated your existing account then try logging out of it on the iPad by tapping on the id in Settings > Store and then log back in and see if that 'refreshes' the account on the iPad. If you created a new account then any content that you purchased/downloaded via the old account will remain tied to that old account, and only that old account can download updates to its apps.

  • How many Shuffles can I register on one computer?

    I'm planning on purchasing 7 shuffles for groomsmen gifts. I'd like to add the same playlist to each one.
    Can I register this many shuffles - along with my own nano - on one computer?
    Thanks.

    As said you prolly want to post this in iPod section, but to my knowledge I don't think there's a limit as to how many devices you can register to a computer's iTunes account.
    There is, however, a limit (think 5) to the number of computers you can authenticate an iTunes account to. But that won't affect the scenario you mention.
    Congrats.... Cool gift idea btw.

  • How many iMacs can i register Logic Pro on?

    How many iMacs can i register Logic Pro on?
    We use Logic Pro at our work.  We are using using 6 macs at the moment, i would like to have logic on all 6

    Hi
    Technically this is NOT the 'legal' case:
    https://discussions.apple.com/message/18228781#18228781
    CCTM wrote:
    Hi
    According to the details in this:
    http://www.apple.com/legal/itunes/uk/terms.html#SALE
    You could well be out of luck....
    MAC APP STORE PRODUCT USAGE RULES
    Except as otherwise set forth herein,
    If you are an individual acting in your personal capacity, you may download and use an application from the Mac App Store (“Mac App Store Product”) for personal, non-commercial use on any Apple-branded products running Mac OS X (“Mac Computer”) that you own or control.
    (ii) If you are a commercial enterprise or educational institution, you may download a Mac App Store Product for use by either (a) a single individual on each of the Mac Computer(s) used by that individual that you own or control, or (b) multiple individuals on a single shared Mac Computer that you own or control. For example, a single employee may use a Mac App Store Product on both the employee’s desktop Mac Computer and laptop Mac Computer, or multiple students may serially use the Mac App Store Product on a single Mac Computer located at a resource centre or library. For the sake of clarity, each Mac Computer used serially by multiple users requires a separate licence.
    (iii) Use of Mac App Store Products may require sign-in with the Apple ID used to download the Mac App Store Product from the Mac App Store. Mac App Store Products can be updated through the Mac App Store only."
    HTH???
    CCT

  • Can I register an iPod(s) to more than one computer?

    We're getting 3 iPods for the family (maybe 4) and we have 2 identical Dell Dimension8400 PC in our home. Can we register the iPods to ONE iPod account OR is the registration only allowed to ONE PC? I'd like to be able to use either computer on our network, especially since we may have 4 iPods in our home.
    Any advice on how to set this up?
    I think I want all children (and myself) to share an iTunes account so we can share songs. Each child has own account to access PC in family room.
    Thanks in advance

    macgirl_k, I don't know why Apple designed the shuffle that way.
    That article I linked to has this note
    +Note: iPod shuffle is intended for use with a single computer. You cannot load music from multiple computers or iTunes libraries onto iPod shuffle like you can with other iPods.+
    You CAN use it with both your PCs, but it will replace the entire shuffle's contents each time.
    So if laptop has Song A, and desktop has Song B - you will never be able to get both Song A&B on your shuffle at one time.
    You'll have to choose either song A or song B
    .....or put song A & B on both PCs.
    Clear as mud?

  • Can't register my paid for acrobat X Pro Mac

    have my serial number. serial number upgrade window says " this serial number is not for a qualifying product. Please choose the one you own and enter it''s serial number." Well, that's all I can do! I upgraded to Yosemite, and reinstalled the Acrobat x pro from the download window on the adobe site. It installed smoothly but I can't use it because I can't register it. Now what?

    The serial number is an upgrade. You just need to prove you are eligible (qualified) to use the upgrade. You do that by using the serial number of the OLDER product when asked. So you enter BOTH serials. Be sure to keep them both forever, along with archiving the downloaded installer, since there is no guarantee you'll be able to download it again to reinstall.

  • How to register a custom MBean in weblogic 9.1

    Dear All,
    In weblogic 8.1, I usually register my custom mbeans using the <startup> tag in config.xml file. But in weblogic 9.1 I can not do this. <startup> tag is unrecognizable in weblogic config.xml file. Anybody knows how to write a java program and run it to register the custom MBeans?
    Regards,
    Fahad

    I never promote the method the deletion unless you understand the underlying tables of planning, if you search on the forum you will see posts on the subject just like this one - Delete dimension from planning application
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How can i reload font information while the jvm is running.

    l.s.
    how can i reload font information while the jvm is running.
    I'm having the following problem...
    A program is running.
    A user installs a new font on the system (Xwindows in this case)
    Java doesn't display the font when i ask :
    java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();Thus i think that java buffers its font information somewhere. Anyone knows how to refresh te buffer?
    many thanks

    ungalcrys, welcome to the forum. Please don't post in threads that are long dead and don't hijack another poster's thread. When you have a question, start your own topic. Feel free to provide a link to an old post that may be relevant to your problem.
    I'm locking this thread now.
    db

  • How can I register joltasp?

    I have registered all the joltasp classes located
    in "G:\WINNT\java\trustlib\bea\jolt\pool\asp"
    manually as follows:
    G:\WINNT\java\trustlib>javareg /register /control
    /q /class:bea.jolt.pool.asp.AspDataSet
    /codebase:. /progid:BEAJOLTPOOL.AspDataSet
    /typelib:AspDataSet.tlb
    ...and other nine classes .....
    The registration job is successfully accomplished. In
    bankapp samples for ASP, tellerForm.asp is correctly loaded.
    In the service call, inquiry the balance of 10001 account retrieves Nothing:
    Set output = pool.call(Request("SVCNAME"), Null, Nothing)
    After I replace Null with iodata(0)
    <!--the content of iodata(0) is:
    {SVCNAME=[INQUIRY], ACCOUNT_ID=[10001]}
    //-->
    the sentence retrieves:
    {SBALANCE=[$20343.00], FORMNAM=[CBALANCE]}
    It's right! But another sentence goes wrong:
    Call template.eval(iodata)
    In IIS log files, I found the reason:
    2001-09-26 04:03:23 211.68.68.60 - 211.68.68.60 80 POST /bankapp/tlr.asp |66|80004005|java.lang.ClassCastException:_bea/jolt/pool/Result
    500 Mozilla/4.0+(compatible;+MSIE+5.01;+Windows+NT+5.0)
    the data type of iodata(0) is AspDataSet, but
    the data type of iodata(1) is Result. Although both parents
    are "bea.jolt.pool.DataSet"
    What's the problem? Maybe I should register other classes
    located in "G:\WINNT\java\trustlib\bea\jolt\pool", if so, How
    can I register it?

    Please be aware that this forum is a peer to peer support forum, it is not a direct link to HP support.  To Contact HP click here for information.
    Bob Headrick,  HP Expert
    I am not an employee of HP, I am a volunteer posting here on my own time.
    If your problem is solved please click the "Accept as Solution" button ------------V
    If my answer was helpful please click the "Thumbs Up" to say "Thank You"--V

  • I share icloud apps with other ipads.  can i buy my own itunes card and add things i want to my ipad?

    i share icloud apps with other ipads.  can i buy my own itunes card and add things i want to my ipad?

    WoodyK,
    If you are going to use your iTunes account as you and your partners iCloud account then you need to go into each phone and change your settings.  In messages, you need to change from iCloud to the phone number.  Create a contact with your unformation and re-train Siri with your name.  Let me know if this helps.
    WoodyK wrote:
    I registered my Iphone4s on icloud with my seperate login account and wanted to create my own profile. But now it has found my partners login and when I use SIRI i get references from SIRI that my name is hers.......eg ; I don't understand you JULIE. But my name is male........
    If this an indication of what I can expect ........then be warned APPLE I am not happy!!!!!!!!!
    HELP!!!!!!

  • HT3702 i can't register my prepay mastercard, living in ireland but card is from uk??? what to do!!!

    i can't register my prepay mastercard, living in ireland but card is from uk??? what to do!!!

    The Apple Support Communities are an international user to user technical support forum. As a man from Mexico, Spanish is my native tongue. I do not speak English very well, however, I do write in English with the aid of the Mac OS X spelling and grammar checks. I also live in a culture perhaps very very different from your own. When offering advice in the ASC, my comments are not meant to be anything more than helpful and certainly not to be taken as insults.
    To make purchases from any Apple online stores you must use the store for the country in which you reside, if paying with a bank card it must be a verifiable card from a bank in the country where you live with a verifiable billing address in the country where you live.

  • I can not register for my account as i did not give email addrees what can i do

    when i purchesed ee i did not give a email address and password so i can not register for my account what can i do?

    It's your own email address and you give it a password yourself. You need to create your own online account.

  • Can I register my daughters iphone to more than one icloud account?

    Can I register my daughters iphone to more than one icloud account so if she can't find it either her dad or myself can use find your iphone without sharing our account information?

    Not really. Each device can only work with one Apple ID at a time. If it were lost or stolen you could not change the Apple ID on it, so there would be little point.
    iDevices are intended for use by one person with one Apple ID and one iTunes account, and synced to the users own computer or user account on a shared computer. They are not multi-user or multi-account devices. This protects the users security and privacy.

  • Does jconsole support monitoring of MBeans registered to New MBean Server?

    I see that jconsole is displaying the MBeans registered to Platform MBean Server (obtained through java.lang.ManagementFactory.getPlatformMBeanServer()) but not the MBeans that are registered to a newly created MBean Server (created using javax.management.MBeanServerFactory.createMBeanServer()).
    Is there a way through which I can view the MBeans registered to newly created MBean Server in the jconsole?

    Thank you for the information emcmanus.
    So what I understand is that the jconsole if opened in a normal way (i.e. Local), it loads MBeans by looking up the Platform MBean Server.
    All the MBeans belonging to other MBean Servers or custom created MBean Servers can be managed & monitored if jconsole is loaded using Advanced option (i.e. providing JMX URL) and with the help of remote connectors.
    When I open Platform MBean Server, I dont see MBeans of other MBean Server and vice versa. (I think they are mutually exclusive).
    Please correct me if what I have mentioned above is incorrect.
    One confusing thing is that I see "JVImplementation" MBean is available when I open jconsole with either of the two option mentioned above.
    Is there any specific reason for that?
    Is that MBean part of Platform MBean Server or some other MBean Server?

Maybe you are looking for

  • Jabber for iPhone and iPad cannot receive calls

    We currently have Call Manager 9.1.1 and Presence 9.1.1. I am starting to use the Jabber Client for iPhone and iPad, but am having trouble receiving calls dialed to a particular extension. If I can go settings for the iPhone Jabber client as an examp

  • My iTunes wont open and my iPhone is stuck and says it needs to connect?

    my iphone has the itunes icon with the arrow pointing to it and the plug in. ive been trying to update it to iOS 5. i just got the new 10.5.2 iTunes it wont open now! i have the Windows XP and the iTunes wont open so it wont say my phone is connected

  • Installing and uninstalling Quick time

    I am trying to install quick time and every time I get this message '' The installer encountered errors before requested operations for quicktime could be completed, retry later. '' I have quick time in my add / remove programs so I try to delete but

  • Please tell me table that stores texts in Sales Orders

    To everyone, Does anybody know which table stores text in sales orders(VA01 screen -> item data -> under texts tab)? I would like to create a query or ABAP report to check data entered in the text field but I don't think it is in VBAK or VBAP. Thank

  • Scenario selection in Template Selection tab of the Scope of a project

    Hi All I've just installed SolMan 7.0 EhP 1 and am creating a new project (with transaction SOLAR_PROJECT_ADMIN). In the Scope tab, under the Template Selection I can only find 1 Scenario to choose. Under "Select one or more Scenarios", there is only