Running Jetty as a Workbench service [message #105591] |
Fri, 29 February 2008 02:20 |
Eclipse User |
|
|
|
Originally posted by: csmith.adcaustin.com
I would like to use the embedded Jetty server to provide a http interface to
a running eclipse workbench. I created two action sets using the plug-in
wizards that start and stop Jetty using the JettyConfigurator.startServer()
and JettyConfigurator.stopServer() methods. Jetty starts up and a browser
pointed to them seems to confirm that Jetty is running. This is where I run
out of steam.
I created a servlet and context extension points and classes but I do not
know how I make this Jetty instance use them.
As you can see I'm pretty green so advise is welcome.
My goal is to have a program outside of a running eclipse workbench be able
to ask the the eclipse workbench to perform some actions and return a
response.
Thanks in advance.
|
|
|
|
Re: Running Jetty as a Workbench service [message #105777 is a reply to message #105618] |
Sun, 02 March 2008 17:53 |
Eclipse User |
|
|
|
Originally posted by: csmith.adcaustin.com
Thanks
How would my plugin check to see if it is running, and if not get and start
the "service" instead of it being auto-started?
"Dennis O'Flynn" <dennis.oflynn@compuware.com> wrote in message
news:fq8tci$o47$1@build.eclipse.org...
> Assumptions:
> * Your plugin has a dependency upon the
> "org.eclipse.equinox.http.registry"
> * Your plugin proves an extensions to the
> "org.eclipse.equinox.http.registry.servlets" extension point.
> The default startup configuration for the IDE does not launch the equinox
> http service by default. This needs to be added to the startup
> configuration in "configuration/config.ini".
>
> * Open "configuration/config.ini" in an editor
> * Modify the property "osgi.bundles"
> ** Append ", org.eclipse.equinox.http@3:start,
> org.eclipse.equinox.http.registry@start"
>
> Optionally, you can change the port number (e.g. 3080) used by the http
> service by define setting "org.osgi.service.http.port=3080".
>
> You may have to restart your IDE w/ the "clean" option (eclipse -clean),
> for your changes to the "osgi.bundles" property to take affect.
>
>
|
|
|
Re: Running Jetty as a Workbench service [message #107474 is a reply to message #105618] |
Wed, 02 April 2008 21:39 |
Eclipse User |
|
|
|
Originally posted by: csmith.adcaustin.com
Just to followup, I reviewed how Eclipse help uses the embeded Jetty. I
mimiced it and it worked. My plugin explicitly starts and stops jetty from
a singleton.
The servlet then runs inside of my workbench and can interact with the
workbench as it receives requests.
Works great... and less filling too
"Dennis O'Flynn" <dennis.oflynn@compuware.com> wrote in message
news:fq8tci$o47$1@build.eclipse.org...
> Assumptions:
> * Your plugin has a dependency upon the
> "org.eclipse.equinox.http.registry"
> * Your plugin proves an extensions to the
> "org.eclipse.equinox.http.registry.servlets" extension point.
> The default startup configuration for the IDE does not launch the equinox
> http service by default. This needs to be added to the startup
> configuration in "configuration/config.ini".
>
> * Open "configuration/config.ini" in an editor
> * Modify the property "osgi.bundles"
> ** Append ", org.eclipse.equinox.http@3:start,
> org.eclipse.equinox.http.registry@start"
>
> Optionally, you can change the port number (e.g. 3080) used by the http
> service by define setting "org.osgi.service.http.port=3080".
>
> You may have to restart your IDE w/ the "clean" option (eclipse -clean),
> for your changes to the "osgi.bundles" property to take affect.
>
>
> "Christopher Smith" <csmith@adcaustin.com> wrote in message
> news:fq7q68$37h$1@build.eclipse.org...
>>I would like to use the embedded Jetty server to provide a http interface
>>to a running eclipse workbench. I created two action sets using the
>>plug-in wizards that start and stop Jetty using the
>>JettyConfigurator.startServer() and JettyConfigurator.stopServer()
>>methods. Jetty starts up and a browser pointed to them seems to confirm
>>that Jetty is running. This is where I run out of steam.
>>
>> I created a servlet and context extension points and classes but I do not
>> know how I make this Jetty instance use them.
>>
>> As you can see I'm pretty green so advise is welcome.
>>
>> My goal is to have a program outside of a running eclipse workbench be
>> able to ask the the eclipse workbench to perform some actions and return
>> a response.
>>
>> Thanks in advance.
>
>
|
|
|
Re: Running Jetty as a Workbench service [message #111789 is a reply to message #107474] |
Thu, 12 June 2008 08:57 |
Lo�¯c Qu�©ran Messages: 45 Registered: July 2009 |
Member |
|
|
I have written an Activator which starts Jetty and I want to register a
servlet which acts on the workspace.
Although I have registered my servlet throught the extension point,
<extension
point="org.eclipse.equinox.http.registry.servlets">
<servlet
alias="/MyServlet"
class="com.example.MyServlet">
</servlet>
</extension>
the servlet is not available.
Here is how I start Jetty:
Dictionary<String, Object> settings = new Hashtable<String, Object>();
settings.put("http.enabled", Boolean.TRUE);
settings.put("http.port", 8079);
settings.put("http.host", "0.0.0.0");
settings.put("https.enabled", Boolean.FALSE);
settings.put("context.path", "/");
settings.put("context.sessioninactiveinterval", 1800);
try
{
JettyConfigurator.startServer(PLUGIN_ID + ".server",
settings);
serverId = PLUGIN_ID + ".server";
}
catch (Exception e)
{
e.printStackTrace();
}
Any idea would be appreciated.
Loïc
Christopher Smith a écrit :
> Just to followup, I reviewed how Eclipse help uses the embeded Jetty. I
> mimiced it and it worked. My plugin explicitly starts and stops jetty
> from a singleton.
>
> The servlet then runs inside of my workbench and can interact with the
> workbench as it receives requests.
>
> Works great... and less filling too
>
> "Dennis O'Flynn" <dennis.oflynn@compuware.com> wrote in message
> news:fq8tci$o47$1@build.eclipse.org...
>> Assumptions:
>> * Your plugin has a dependency upon the
>> "org.eclipse.equinox.http.registry"
>> * Your plugin proves an extensions to the
>> "org.eclipse.equinox.http.registry.servlets" extension point.
>> The default startup configuration for the IDE does not launch the
>> equinox http service by default. This needs to be added to the
>> startup configuration in "configuration/config.ini".
>>
>> * Open "configuration/config.ini" in an editor
>> * Modify the property "osgi.bundles"
>> ** Append ", org.eclipse.equinox.http@3:start,
>> org.eclipse.equinox.http.registry@start"
>>
>> Optionally, you can change the port number (e.g. 3080) used by the
>> http service by define setting "org.osgi.service.http.port=3080".
>>
>> You may have to restart your IDE w/ the "clean" option (eclipse
>> -clean), for your changes to the "osgi.bundles" property to take affect.
>>
>>
>> "Christopher Smith" <csmith@adcaustin.com> wrote in message
>> news:fq7q68$37h$1@build.eclipse.org...
>>> I would like to use the embedded Jetty server to provide a http
>>> interface to a running eclipse workbench. I created two action sets
>>> using the plug-in wizards that start and stop Jetty using the
>>> JettyConfigurator.startServer() and JettyConfigurator.stopServer()
>>> methods. Jetty starts up and a browser pointed to them seems to
>>> confirm that Jetty is running. This is where I run out of steam.
>>>
>>> I created a servlet and context extension points and classes but I do
>>> not know how I make this Jetty instance use them.
>>>
>>> As you can see I'm pretty green so advise is welcome.
>>>
>>> My goal is to have a program outside of a running eclipse workbench
>>> be able to ask the the eclipse workbench to perform some actions and
>>> return a response.
>>>
>>> Thanks in advance.
>>
>>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.02315 seconds