Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Server.getContainer() in Jetty 9

oh! Awesome! 
Yes - "_jetty" is an instance of 'org.eclipse.jetty.server.Server'.

Thanks a lot for the input!
Vinay


On Thu, Sep 12, 2013 at 5:23 PM, Joakim Erdfelt <joakim@xxxxxxxxxxx> wrote:
What is "_jetty" in this code sample?

If it is an instance of org.eclipse.jetty.server.Server, then you can just cast that to org.eclipse.jetty.util.component.Container.

The Server is the Container, and the relationship is like this on Jetty 9...


Hope that helps.


--
Joakim Erdfelt <joakim@xxxxxxxxxxx>
Expert advice, services and support from from the Jetty & CometD experts


On Thu, Sep 12, 2013 at 5:07 PM, Vinay Pothnis <vinay.pothnis@xxxxxxxxx> wrote:
This is what I am doing currently:

------------------------------

private final org.eclipse.jetty.server.Server _jetty;

private MBeanContainer _jettyMBeanContainer;

...

          MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
            _jettyMBeanContainer = new MBeanContainer(mBeanServer);
            _jetty.getContainer().addEventListener(_jettyMBeanContainer);
            try {
                _jettyMBeanContainer.start();
            } catch (Exception e) {
                throw new IllegalArgumentException("...some message here...");
            }
...
------------------------------

Sorry for the poor formatting. 


On Thu, Sep 12, 2013 at 4:57 PM, Joakim Erdfelt <joakim@xxxxxxxxxxx> wrote:
Can you provide some example code on what you are doing currently?

--
Joakim Erdfelt <joakim@xxxxxxxxxxx>
Expert advice, services and support from from the Jetty & CometD experts


On Thu, Sep 12, 2013 at 4:43 PM, Vinay Pothnis <vinay.pothnis@xxxxxxxxx> wrote:
Hello All, 

In Jetty 9 - we no longer can access the container via the Server. 
How do we do this in Jetty 9 - since I am using embedded Jetty and would like to enable JMX.

The Jetty 9 documentation still seems to suggest the Server.getContainer() way - http://www.eclipse.org/jetty/documentation/current/jmx-chapter.html

Thanks
Vinay

_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users



_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users



_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users



_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users



Back to the top