📄 equinox in a servlet container.htm
字号:
point you should begin familiarizing yourself with the use of the OSGi console
to manage the platform.<BR>
<P>Here are a couple of Eclipse projects that might help get you started using
the OSGi Http Service:
<UL>
<LI><B><A
href="http://www.eclipse.org/equinox/server/downloads/sample-http.zip">sample.http</A></B>
- demonstrates basic Hello World type use of the OSGi Http Service
<LI><B><A
href="http://www.eclipse.org/equinox/server/downloads/sample-http-reg.zip">sample.http.registry</A></B>
- same as sample.http but instead uses extension points from
org.eclipse.equinox.http.registry </LI></UL>
<P></P>You might also see if you can install and start the http-console bundle
described <B><A
href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=122911">here</A></B>.
<P class=bar>Configuration</P>
<P>The servletbridge web.xml provides a couple of initial parameters:
<UL>
<LI><STRONG>commandline</STRONG> Allows all non-VM command line
parameterizations of Eclipse. <BR>The default value is "-console" to allow you
to use the console to "experiment" with managing an active framework (e.g.
installing, starting, stopping, uninstalling bundles etc.). Currently the
console is configured to run directly off standard input/output of the
launching appserver's process.
<LI><STRONG>enableFrameworkControls</STRONG> (true / false) - Controls whether
or not the sp_* control URLs are accessible<BR>
<UL>
<LI>sp_deploy - Copies the contents of /platform to the install area (the
servlet context tempdir is used - parameterizable someday)
<LI>sp_undeploy - Removes the copy of Eclipse from the install area
<LI>sp_redeploy - Resets the platform (e.g. stops, undeploys, deploys,
starts)
<LI>sp_start - Starts a deployed platform
<LI>sp_stop - Stops the platform
<LI>sp_test - Provides a sanity check and determines if an OSGi based
servlet is ready to accept requests </LI></UL>These commands are available at
http://yourhost/yourcontext/sp_command. ( for example,
http://localhost/bridge/sp_stop ) </LI></UL>
<P></P>
<P class=bar>Extending</P>
<P>Currently there are two approaches for extending the basic installation:
<OL>
<LI>Write a bundle that uses the OSGi HttpService registered by
org.eclipse.eqinox.servletbridge.http
<LI>Write a bundle that adds extensions from org.eclipse.equinox.http.registry
</LI></OL>The functionality offered by either approach is very similar. The
extension points in org.eclipse.equinox.http.registry are simply a mapping of
the OSGi HttpService.
<P></P>
<P class=bar>Build Information</P>
<P><I>The current eclipse build tools and wizards do not directly support
building this style of application so for the time being the build is performed
with a series of Ant scripts and resource templates</I> </P>
<P>At a high-level the idea is to create a WAR file structured as follows:
<UL style="LIST-STYLE-TYPE: none">
<LI>/WEB-INF
<UL style="LIST-STYLE-TYPE: none">
<LI>/web.xml (with one servlet entry assigning all incoming requests to the
BridgeServlet)
<LI>/lib/servletbridge.jar (the classes associated with the
equinox.servletbridge)
<LI><B>/eclipse</B> (the eclipse platform directory)
<UL style="LIST-STYLE-TYPE: none">
<LI>launch.ini (contains framework properties that will allow override of
any eclipse specific System Properties)
<LI>/configuration (contains config.ini which lists the bundles you want
to have available)
<LI>/features
<LI>/plugins </LI></UL></LI></UL></LI></UL>
<P>The above structure is meant to be very close to an RCP application with the
/eclipse directory holding something similar to an RCP application (but
naturally containing components more suitable for server side interaction).
</P>A reasonable way to think of the build is to divide into two initial pieces:
<OL>
<LI>The web-app portion (based on the servletbridge)
<LI>The eclipse portion </LI></OL>These two pieces should then be combined by
placing the eclipse portion in the "/eclipse" directory. <BR>
<P>org.eclipse.equinox.servletbridge contains an ant script in
"/scripts/webAppBuilder.xml" that can be used from the IDE for constructing the
war file structure above. (It can also be used for a head-less build by
customizing various properties) Additionally "/tempates" provides the resource
content like the web.xml, launch.ini, and config.ini which might also be
customized.</P>
<P>To create the WAR file's contents from the Quickstart section:
<OL>
<LI>Synch the following project from the equinox-incubator CVS site
<UL>
<LI>org.eclipse.equinox.servletbridge.feature </LI></UL>
<LI>Right-Click on the webAppBuilder.xml script in the IDE and "Run Ant".
<BR><I>(Note: So that the pde.exportFeatures task is available in the IDE
select "Run in the same JRE as the workspace" on the JRE tab from "Run
Ant..")</I> </LI></OL>
<P></P>
<P>As with RCP applications there are a wide variety of possible configurations.
What's given in org.eclipse.equinox.servletbridge.feature is just one
possibility.</P>
<P> </P></DIV>
<DIV id=rightcolumn>
<DIV class=sideitem>
<H6>Equinox links</H6>
<UL>
<LI><A href="http://www.eclipse.org/equinox">home</A>
<LI><A href="http://www.eclipse.org/equinox/framework">framework</A>
<LI><A href="http://www.eclipse.org/equinox/bundles">bundles</A>
<LI><A href="http://www.eclipse.org/equinox/incubator">incubator</A>
<LI><A href="http://www.eclipse.org/equinox/server">server</A>
<LI><A href="http://www.eclipse.org/equinox/incubator/provisioning">p2</A>
<LI><A href="http://www.eclipse.org/equinox/security">security</A>
<LI><A href="http://wiki.eclipse.org/Equinox">wiki</A>
<LI><A href="http://www.eclipse.org/equinox/documents">documents</A>
<LI><A href="http://download.eclipse.org/equinox/">downloads</A>
<LI><A href="http://www.eclipse.org/equinox/resources.php">resources</A>
<LI><A href="http://wiki.eclipse.org/Equinox/Plan">planning</A>
<LI><A href="http://www.eclipse.org/equinox/faq.php">faq</A>
</LI></UL></DIV></DIV>
<DIV id=rightcolumn>
<DIV class=sideitem>
<H6>Server links</H6>
<UL>
<LI><A
href="http://www.eclipse.org/equinox/server/http_quickstart.php">quickstart</A>
<LI><A
href="http://www.eclipse.org/equinox/documents/index.php#server">documents</A>
</LI></UL></DIV></DIV>
<SCRIPT type=text/javascript> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </SCRIPT>
<SCRIPT type=text/javascript> var pageTracker = _gat._getTracker("UA-910670-2"); pageTracker._initData(); pageTracker._trackPageview(); </SCRIPT>
<BR style="CLEAR: both; HEIGHT: 1em"> </DIV>
<DIV id=clearFooter></DIV>
<DIV id=footer>
<UL id=footernav>
<LI><A href="http://www.eclipse.org/">Home</A>
<LI><A href="http://www.eclipse.org/legal/privacy.php">Privacy Policy</A>
<LI><A href="http://www.eclipse.org/legal/termsofuse.php">Terms of Use</A>
<LI><A href="http://www.eclipse.org/legal/">Legal</A>
<LI><A href="http://www.eclipse.org/org/foundation/contact.php">Contact Us</A>
</LI></UL><SPAN id=copyright>Copyright © 2009 The Eclipse Foundation. All Rights
Reserved.</SPAN> </DIV></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -