[jetty-users] Server.getContainer() in Jetty 9

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[jetty-users] Server.getContainer() in Jetty 9

Vinay Pothnis
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
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-users] Server.getContainer() in Jetty 9

Joakim Erdfelt-9
Can you provide some example code on what you are doing currently?

--
Joakim Erdfelt <[hidden email]>
Expert advice, services and support from from the Jetty & CometD experts


On Thu, Sep 12, 2013 at 4:43 PM, Vinay Pothnis <[hidden email]> 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
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users



_______________________________________________
jetty-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-users] Server.getContainer() in Jetty 9

Vinay Pothnis
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 <[hidden email]> wrote:
Can you provide some example code on what you are doing currently?

--
Joakim Erdfelt <[hidden email]>
Expert advice, services and support from from the Jetty & CometD experts


On Thu, Sep 12, 2013 at 4:43 PM, Vinay Pothnis <[hidden email]> 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
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users



_______________________________________________
jetty-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users



_______________________________________________
jetty-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-users] Server.getContainer() in Jetty 9

Joakim Erdfelt-9
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 <[hidden email]>
Expert advice, services and support from from the Jetty & CometD experts


On Thu, Sep 12, 2013 at 5:07 PM, Vinay Pothnis <[hidden email]> 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 <[hidden email]> wrote:
Can you provide some example code on what you are doing currently?

--
Joakim Erdfelt <[hidden email]>
Expert advice, services and support from from the Jetty & CometD experts


On Thu, Sep 12, 2013 at 4:43 PM, Vinay Pothnis <[hidden email]> 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
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users



_______________________________________________
jetty-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users



_______________________________________________
jetty-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users



_______________________________________________
jetty-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-users] Server.getContainer() in Jetty 9

Vinay Pothnis
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 <[hidden email]> 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 <[hidden email]>
Expert advice, services and support from from the Jetty & CometD experts


On Thu, Sep 12, 2013 at 5:07 PM, Vinay Pothnis <[hidden email]> 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 <[hidden email]> wrote:
Can you provide some example code on what you are doing currently?

--
Joakim Erdfelt <[hidden email]>
Expert advice, services and support from from the Jetty & CometD experts


On Thu, Sep 12, 2013 at 4:43 PM, Vinay Pothnis <[hidden email]> 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
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users



_______________________________________________
jetty-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users



_______________________________________________
jetty-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users



_______________________________________________
jetty-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users



_______________________________________________
jetty-users mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-users