Can jetty have a hook after the server is ready?

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

Can jetty have a hook after the server is ready?

Lin Ren

Hi all,

 

I’m currently trying my project on Jetty standalone mode.

 

I wrote a BootstrapServerService, which annotated by “@ManagedObject” and extends org.eclipse.jetty.util.component.AbstractLifeCycle.

 

The BootstrapServerService is now added into Server as a bean (in jetty.xml):

 

    <Call name="addBean">

      <Arg>

        <New class="com.bea.wlcp.wlng.core.wls.BootstrapServerService"/>

      </Arg>

    </Call>

 

Then the BootstrapServerService is started before deployed application is activated, just as my expected.

 

However, in the BootstrapServerService, there is logic to get the RMI repository and bind local object:

 

        final Registry registry = LocateRegistry.getRegistry();

        registry.bind(fullJndiName, stub);

 

It fails because the RMI service is NOT started yet. So I tried to single out the bind logic and trying to find a hook from Jetty to execute this logic after the RMI is ready, but so far I’m not able to find it out.

 

Can anyone give advisement?

 

Thanks!

 

Lin


_______________________________________________
jetty-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users
Reply | Threaded
Open this post in threaded view
|

Re: Can jetty have a hook after the server is ready?

Joakim Erdfelt-8

Joakim Erdfelt / [hidden email]

On Wed, May 16, 2018 at 1:11 AM, Lin Ren <[hidden email]> wrote:

Hi all,

 

I’m currently trying my project on Jetty standalone mode.

 

I wrote a BootstrapServerService, which annotated by “@ManagedObject” and extends org.eclipse.jetty.util.component.AbstractLifeCycle.

 

The BootstrapServerService is now added into Server as a bean (in jetty.xml):

 

    <Call name="addBean">

      <Arg>

        <New class="com.bea.wlcp.wlng.core.wls.BootstrapServerService"/>

      </Arg>

    </Call>

 

Then the BootstrapServerService is started before deployed application is activated, just as my expected.

 

However, in the BootstrapServerService, there is logic to get the RMI repository and bind local object:

 

        final Registry registry = LocateRegistry.getRegistry();

        registry.bind(fullJndiName, stub);

 

It fails because the RMI service is NOT started yet. So I tried to single out the bind logic and trying to find a hook from Jetty to execute this logic after the RMI is ready, but so far I’m not able to find it out.

 

Can anyone give advisement?

 

Thanks!

 

Lin


_______________________________________________
jetty-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users


_______________________________________________
jetty-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users
Reply | Threaded
Open this post in threaded view
|

Re: Can jetty have a hook after the server is ready?

Lin Ren

Thanks a lot!

 

From: Joakim Erdfelt [mailto:[hidden email]]
Sent: 2018
516 18:40
To: JETTY user mailing list
Subject: Re: [jetty-users] Can jetty have a hook after the server is ready?

 


Joakim Erdfelt / [hidden email]

 

On Wed, May 16, 2018 at 1:11 AM, Lin Ren <[hidden email]> wrote:

Hi all,

 

I’m currently trying my project on Jetty standalone mode.

 

I wrote a BootstrapServerService, which annotated by “@ManagedObject” and extends org.eclipse.jetty.util.component.AbstractLifeCycle.

 

The BootstrapServerService is now added into Server as a bean (in jetty.xml):

 

    <Call name="addBean">

      <Arg>

        <New class="com.bea.wlcp.wlng.core.wls.BootstrapServerService"/>

      </Arg>

    </Call>

 

Then the BootstrapServerService is started before deployed application is activated, just as my expected.

 

However, in the BootstrapServerService, there is logic to get the RMI repository and bind local object:

 

        final Registry registry = LocateRegistry.getRegistry();

        registry.bind(fullJndiName, stub);

 

It fails because the RMI service is NOT started yet. So I tried to single out the bind logic and trying to find a hook from Jetty to execute this logic after the RMI is ready, but so far I’m not able to find it out.

 

Can anyone give advisement?

 

Thanks!

 

Lin


_______________________________________________
jetty-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users

 


_______________________________________________
jetty-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users