Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Start order for webapps

Hi Nico,
I think that if you deploy your webapps via a context file you could
specify the order in which they are initialized.
For example this context file should deploy in the expected order 2
webapps. (disclaimer: untested)

<?xml version="1.0"  encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN"
"http://www.eclipse.org/jetty/configure.dtd";>
<Configure class="org.eclipse.jetty.server.handler.HandlerList">
  <New class="org.eclipse.jetty.server.handler.HandlerList">
    <Set name="handlers">
      <Array type="org.eclipse.jetty.server.Handler">
        <Item>
          <New class="org.eclipse.jetty.webapp.WebAppContext">
              <Set name="contextPath">/app1</Set>
              <Set name="war"><SystemProperty
name="jetty.home"/>/orderedwebapps/app1</Set>
          </New>
        </Item>
        <Item>
          <New class="org.eclipse.jetty.webapp.WebAppContext">
              <Set name="contextPath">/app1</Set>
              <Set name="war"><SystemProperty
name="jetty.home"/>/orderedwebapps/app2</Set>
          </New>
        </Item>
      </Array>
    </Set>
  </New>
</Configure>

If we were deploying webapps that are contained inside OSGi bundles
and started at the same time than the bundles that contain them you
would simply need to have one bundle depend on the other.

I hope this helps.
Hugues


On Mon, Oct 19, 2009 at 4:28 AM, Nicolas Modrzyk <nico@xxxxxxxxxxx> wrote:
> Hi Guys,
>
> What is the way to enforce a start order for webapps in jetty 7 ?
> I know there is no way to do that according to the java specs, but
> maybe there is a possible hack in jetty.
>
> Thanks,
> --
> -- Nico
> _______________________________________________
> jetty-users mailing list
> jetty-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jetty-users
>


Back to the top