felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Felix > apache-felix-ipojo-eclipse-integration
Date Tue, 03 Nov 2009 20:06:01 GMT
<html>
<head>
    <base href="http://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=FELIX&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background-color: white" bgcolor="white">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
     <h2><a href="http://cwiki.apache.org/confluence/display/FELIX/apache-felix-ipojo-eclipse-integration">apache-felix-ipojo-eclipse-integration</a></h2>
     <h4>Page <b>edited</b> by             <a href="http://cwiki.apache.org/confluence/display/~clement.escoffier">Clement
Escoffier</a>
    </h4>
     
          <br/>
     <div class="notificationGreySide">
         <style type="text/css">
 @import url(http://felix.apache.org/ipojo/site/superfish.css); 
</style>

<style type="text/css">
 @import url(http://felix.apache.org/ipojo/site/style.css); 
</style>

<p>
<script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shCore.js"></script>
<script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushCSharp.js"></script>
<script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushPhp.js"></script>
<script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushJScript.js"></script>
<script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushVb.js"></script>
<script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushSql.js"></script>
<script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushXml.js"></script>
<script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushShell.js"></script>
<script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushDelphi.js"></script>
<script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushPython.js"></script>
<script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushJava.js"></script>

<script type="text/javascript" src="http://felix.apache.org/ipojo/site/jquery-1.js"></script>
<script type="text/javascript" src="http://felix.apache.org/ipojo/site/hoverIntent.js"></script>
<script type="text/javascript" src="http://felix.apache.org/ipojo/site/superfish.js"></script>

<script type="text/javascript" src="http://felix.apache.org/ipojo/site/supersubs.js"></script>


<script type="text/javascript"> 
 
    $(document).ready(function(){ 
        $("ul.sf-menu").supersubs({ 
            minWidth:    14,   // minimum width of sub-menus in em units 
            maxWidth:    30,   // maximum width of sub-menus in em units 
            extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
                               // due to slight rounding differences and font-family 
        }).superfish();  // call supersubs first, then superfish, so that subs are 
                         // not display:none when measuring. Call before initialising 
                         // containing tabs for same reason. 
    }); 
 
</script>
<div class="main">
<div class="page-header"/>
<img src="http://felix.apache.org/ipojo/site/header.png" class="header">
<a href="http://ipojo.org"><img src="http://felix.apache.org/ipojo/site/ipojo.png"
width="225" class="header-logo"></a>
<ul class="sf-menu sf-js-enabled sf-shadow" id="ipojo-menu">
<li class="current">
<!-- Menu Overview -->
<a href="#" class="sf-with-ul">Overview<span class="sf-sub-indicator"> »</span><span
class="sf-sub-indicator"> »</span></a>
<ul>
	<li>
	<a href="/confluence/display/FELIX/Apache+Felix+iPOJO" title="Apache Felix iPOJO">Home</a>
						
	</li>
	<li>
	<a href="/confluence/display/FELIX/apache-felix-ipojo-why-choose-ipojo" title="apache-felix-ipojo-why-choose-ipojo">Why
choose iPOJO</a>
	</li>
	<li>
	<a href="/confluence/display/FELIX/apache-felix-ipojo-successstories" title="apache-felix-ipojo-successstories">Success
stories</a>
	</li>
	<li>
	<a href="/confluence/display/FELIX/Apache+Felix+iPOJO+Feature+Overview" title="Apache
Felix iPOJO Feature Overview">Features</a>
	</li>
</ul>
</li>	

<li class="">			
<!-- Menu download -->
<li>
<a href="/confluence/display/FELIX/Download" title="Download">Download </a>
</li>

<li class="">					
<!-- Menu Documentation -->
<a href="#" class="sf-with-ul">Documentation<span class="sf-sub-indicator"> »</span><span
class="sf-sub-indicator"> »</span></a>
<ul>
    <!-- sub-menu : getting started -->
    <li class="">
    <a href="#" class="sf-with-ul">Getting Started<span class="sf-sub-indicator">
»</span><span class="sf-sub-indicator"> »</span></a>
    <ul>
     <li><a href="/confluence/display/FELIX/iPOJO+in+10+minutes" title="iPOJO in
10 minutes">iPOJO in 10 minutes</a></li>
     <li><a href="/confluence/display/FELIX/How+to+use+iPOJO+Annotations" title="How
to use iPOJO Annotations">Using Annotations</a></li>
     <li><a href="/confluence/display/FELIX/iPOJO+Hello+Word+%28Maven-Based%29+tutorial"
title="iPOJO Hello Word (Maven-Based) tutorial">Maven tutorial</a></li>
     <li><a href="/confluence/display/FELIX/iPOJO+Advanced+Tutorial" title="iPOJO
Advanced Tutorial">Advanced tutorial</a></li>
     <li><a href="/confluence/display/FELIX/apache-felix-ipojo-dosgi" title="apache-felix-ipojo-dosgi">Using
Distributed OSGi</a></li>
     <li><a href="/confluence/display/FELIX/iPOJO+Composition+Tutorial" title="iPOJO
Composition Tutorial">Application Composition</a></li>
    </ul>
    </li> <!-- end of getting started -->
    <!-- sub menu : Describing Components -->
     <li class="">
        <a href="http://felix.apache.org/site/describing-components.html" class="sf-with-ul">Describing
components<span class="sf-sub-indicator"> »</span><span class="sf-sub-indicator">
»</span></a>
        <ul>
        <li><a href="/confluence/display/FELIX/Service+Requirement+Handler" title="Service
Requirement Handler">Requiring a service</a></li>
        <li><a href="/confluence/display/FELIX/Providing+OSGi+services" title="Providing
OSGi services">Providing a service</a></li>
        <li><a href="/confluence/display/FELIX/Lifecycle+Callback+Handler" title="Lifecycle
Callback Handler">Lifecycle management</a></li>
        <li><a href="/confluence/display/FELIX/Configuration+Handler" title="Configuration
Handler">Configuration</a></li>
        <li><a href="/confluence/display/FELIX/Architecture+Handler" title="Architecture
Handler">Introspection</a></li>
        <li><a href="/confluence/display/FELIX/Controller+Lifecycle+Handler" title="Controller
Lifecycle Handler">Impacting the lifecycle</a></li>
        <li><a href="/confluence/display/FELIX/Event+Admin+Handlers" title="Event
Admin Handlers">Asynchronous communication</a></li>
        <li><a href="/confluence/display/FELIX/iPOJO+JMX+Handler" title="iPOJO JMX
Handler">JMX management</a></li>
        <li><a href="/confluence/display/FELIX/Extender+Pattern+Handler" title="Extender
Pattern Handler">Extender pattern</a></li>
        <li><a href="/confluence/display/FELIX/White+Board+Pattern+Handler" title="White
Board Pattern Handler">Whiteboard pattern</a></li>
        <li><a href="/confluence/display/FELIX/Temporal+Service+Dependency" title="Temporal
Service Dependency">Temporal dependencies</a></li>
        </ul>
     </li> <!-- End of describing components -->
    <!-- sub-menu : User Guide -->
    <li class="">
    <a href="" class="sf-with-ul">User Guide<span class="sf-sub-indicator"> »</span><span
class="sf-sub-indicator"> »</span></a>
        <ul>
        <li><a href="/confluence/display/FELIX/Using+XML+Schemas" title="Using XML
Schemas">XML Schemas</a></li>
        <li><a href="/confluence/display/FELIX/apache-felix-ipojo-api" title="apache-felix-ipojo-api">API</a></li>
        <li><a href="/confluence/display/FELIX/apache-felix-ipojo-testing-components"
title="apache-felix-ipojo-testing-components">Testing components</a></li>
        <li><a href="/confluence/display/FELIX/apache-felix-ipojo-eclipse-integration"
title="apache-felix-ipojo-eclipse-integration">Eclipse Integration</a></li>
        <li><a href="/confluence/display/FELIX/iPOJO+FAQ" title="iPOJO FAQ">FAQ</a></li>
        <li><a href="/confluence/display/FELIX/iPOJO-Reference-Card" title="iPOJO-Reference-Card">Reference
Card</a></li>
        </ul>
    </li> <!-- end of user guide -->
    <!-- sub-menu : Dev Guide -->
    <li> 
    <a href="#" class="sf-with-ul">Advanced Topics<span class="sf-sub-indicator">
»</span><span class="sf-sub-indicator"> »</span></a>
       <ul>
        <li><a href="http://felix.apache.org/ipojo/api/1.4.0" rel="nofollow">Javadoc</a></li>
        <li><a href="/confluence/display/FELIX/How+to+write+your+own+handler" title="How
to write your own handler">Handler development</a></li>
        <li><a href="/confluence/display/FELIX/How+to+use+iPOJO+Manipulation+Metadata"
title="How to use iPOJO Manipulation Metadata">Manipulation Metadata </a></li>
        <li><a href="/confluence/display/FELIX/Dive+into+the+iPOJO+Manipulation+depths"
title="Dive into the iPOJO Manipulation depths">Dive into the iPOJO Manipulation depths</a></li>
       </ul>
    </li> <!-- End of Dev guide -->
</ul> 
</li> <!-- End of doc -->
<!-- Menu 4 : Tools -->
<li class="">
<a href="#" class="sf-with-ul">Tools<span class="sf-sub-indicator"> »</span><span
class="sf-sub-indicator"> »</span></a>
<ul>
   <li><a href="/confluence/display/FELIX/iPOJO+Ant+Task" title="iPOJO Ant Task">Ant
Task</a></li>
   <li><a href="/confluence/display/FELIX/iPOJO+Eclipse+Plug-in" title="iPOJO Eclipse
Plug-in">Eclipse Plugin</a></li>
   <li><a href="/confluence/display/FELIX/iPOJO+Maven+Plug-in" title="iPOJO Maven
Plug-in">Maven Plugin</a></li>
   <li><a href="/confluence/display/FELIX/iPOJO-Arch-Command" title="iPOJO-Arch-Command"><tt>arch</tt>
shell command</a></li>
   <li><a href="/confluence/display/FELIX/apache-felix-ipojo-online-manipulator"
title="apache-felix-ipojo-online-manipulator">Online Manipulator</a></li>
   <li><a href="/confluence/display/FELIX/iPOJO+Webconsole+Plugin" title="iPOJO Webconsole
Plugin">Webconsole plugin</a></li>
   <li><a href="/confluence/display/FELIX/apache-felix-ipojo-junit4osgi" title="apache-felix-ipojo-junit4osgi">Junit4OSGi</a></li>
</ul>   
</li><!-- End of tools -->	
<!-- Menu 5 : Support -->
<li>
<a href="/confluence/display/FELIX/ipojo-support" title="ipojo-support">Support </a>
</li>
<!-- End of the menu 5 -->			
<!-- Menu 6 : Misc -->
<li class="">
<a href="#" class="sf-with-ul">Misc<span class="sf-sub-indicator"> »</span><span
class="sf-sub-indicator"> »</span></a>
<ul>
   <li><a href="/confluence/display/FELIX/apache-felix-ipojo-supportedVMs" title="apache-felix-ipojo-supportedVMs">Supported
JVMs</a></li>
   <li><a href="/confluence/display/FELIX/apache-felix-ipojo-supportedOSGi" title="apache-felix-ipojo-supportedOSGi">Supported
OSGi Implementations</a></li>
   <li><a href="http://ipojo-dark-side.blogspot.com" rel="nofollow">iPOJO's Dark
Side Blog</a></li>
   <li><a href="/confluence/pages/viewpage.action?pageId=54954" title="Article &amp;
Presentations">Article &amp; Presentations</a></li>
   <li><a href="http://www.apache.org/">ASF</a></li>
   <li><a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li>
   <li><a href="http://www.apache.org/foundation/thanks.html">Sponsors</a></li>
</ul>
</li><!-- End of misc -->
</ul> <!-- End of the menu -->
</div> <!-- Page header -->
</p>

<div class="content">


<h1><a name="apache-felix-ipojo-eclipse-integration-BuildingandRunningiPOJObundlesfromEclipse"></a>Building
and Running iPOJO bundles from Eclipse</h1>
<p><em>This page explains how to build and run iPOJO bundles without exiting Eclipse
and breaking the compile-run cycle.</em></p>

<div class="toc"><div>
<ul>
    <li><a href='#apache-felix-ipojo-eclipse-integration-1%29ImporttheiPOJOBundleproject'>1)
Import the iPOJO Bundle project</a></li>
    <li><a href='#apache-felix-ipojo-eclipse-integration-2%29Configurethetargetplatform'>2)
Configure the target platform</a></li>
    <li><a href='#apache-felix-ipojo-eclipse-integration-3%29Developyoubundle'>3)
Develop you bundle</a></li>
    <li><a href='#apache-felix-ipojo-eclipse-integration-4%29Runyourbundle'>4)
Run your bundle</a></li>
    <li><a href='#apache-felix-ipojo-eclipse-integration-Iterate%3A%29'>Iterate
<img border="0" alt="" align="absmiddle" width="20" height="20" src="/confluence/images/icons/emoticons/smile.gif"
class="emoticon" /></a></li>
    <li><a href='#apache-felix-ipojo-eclipse-integration-Changesinthe1.4.0'>Changes
in the 1.4.0</a></li>
</ul></div></div>

<h2><a name="apache-felix-ipojo-eclipse-integration-1%29ImporttheiPOJOBundleproject"></a>1)
Import the iPOJO Bundle project</h2>
<p>Download the <a href="/confluence/download/attachments/109329/MyiPOJOBundle.zip?version=1">project
archive</a> (1.4.2 version is available <a href="/confluence/download/attachments/109329/MyiPOJOBundle-1.4.2.zip?version=1">here</a>),
and import it as an <b><tt>Existing Project into the Workspace</tt></b><br/>
<img src="/confluence/download/attachments/109329/Picture 1.png" align="absmiddle" border="0"
/><img src="/confluence/download/attachments/109329/Picture 2.png" align="absmiddle"
border="0" /><img src="/confluence/download/attachments/109329/Picture 3.png" align="absmiddle"
border="0" /> <br/>
Then click on <b><tt>finish</tt></b></p>

<h2><a name="apache-felix-ipojo-eclipse-integration-2%29Configurethetargetplatform"></a>2)
Configure the target platform</h2>

<p><img src="/confluence/download/attachments/109329/Picture 4.png" align="left"
border="0" /><br/>
<img src="/confluence/download/attachments/109329/Picture 5.png" align="right" border="0"
/><br/>
The resulting project, you looks like the left picture.<br/>
Before using the project, you need to configure the OSGi platform. It will be run inside Equinox.
To achieve this, open the <b><tt>.target</tt></b> file and then click
on <b><tt>set as Target Platform</tt></b> (on the top-right corner).
You don't have to change the configuration. It just configure Equinox to start iPOJO (contained
in the <tt>lib</tt> folder). <br clear="all" /></p>


<h2><a name="apache-felix-ipojo-eclipse-integration-3%29Developyoubundle"></a>3)
Develop you bundle</h2>
<p>The imported project contains a very simple component using annotations. But, obviously
you can delete/change it. For XML-metadata, use <tt>metadata.xml</tt> file is
in the project root.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
@Component
<span class="code-keyword">public</span> class MyComponentImpl {
    
    @Validate
    <span class="code-keyword">public</span> void start() {
        <span class="code-object">System</span>.out.println(<span class="code-quote">"I'm
started !!!"</span>);
    }
    
    @Invalidate
    <span class="code-keyword">public</span> void stop() {
        <span class="code-object">System</span>.out.println(<span class="code-quote">"I'm
leaving :-(..."</span>);
    }

}
</pre>
</div></div>
<p>Once you're done, you are able to run your bundle !</p>

<h2><a name="apache-felix-ipojo-eclipse-integration-4%29Runyourbundle"></a>4)
Run your bundle</h2>
<p><img src="/confluence/download/attachments/109329/Picture 6.png" align="left"
border="0" /><br/>
Right-click on the <b><tt>.launch</tt></b> file and then go on <b><tt>Run-As
-&gt; MyiPOJOBundle</tt></b>. Equinox will be started and your iPOJO bundle
deployed and started:<br/>
Once run for the first time, you can re-run it from the <tt>run</tt> icon. In
the console view, you get your Equinox shell, and you see your application result. If you
don't edit the given development, the output is as:<br/>
<div align="center"><img src="/confluence/download/attachments/109329/Picture 8.png"
border="0" /></div>
<br clear="all" /></p>

<h2><a name="apache-felix-ipojo-eclipse-integration-Iterate%3A%29"></a>Iterate
<img class="emoticon" src="/confluence/images/icons/emoticons/smile.gif" height="20" width="20"
align="absmiddle" alt="" border="0"/></h2>
<p>Then, go back to the step 3, change your components, and see the new result...<br/>
That's it !</p>

<h2><a name="apache-felix-ipojo-eclipse-integration-Changesinthe1.4.0"></a>Changes
in the 1.4.0</h2>

<p>The 1.4.0+ iPOJO manipulator allows manipulating classes from a directory (<a
href="http://cwiki.apache.org/jira/browse/FELIX-943" rel="nofollow">FELIX-943</a>).
This feature is very convenient for the Eclipse integration because it avoids creating the
Jar and unzipping it inside the Eclipse build directory. Moreover, it allows reusing the Java
Eclipse builder (compiling classes).</p>

<p><br clear="all" />
<br clear="all" /></p>

 </div>
        <img src="http://felix.apache.org/ipojo/site/footer.png" class="footer">
</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">
try{
var pageTracker = _gat._getTracker("UA-1518442-4");
pageTracker._trackPageview();
} catch(err) {}
</script>

     </div>
     <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
       </div>

       <a href="http://cwiki.apache.org/confluence/display/FELIX/apache-felix-ipojo-eclipse-integration">View
Online</a>
       |
       <a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=109329&revisedVersion=25&originalVersion=24">View
Change</a>
              |
       <a href="http://cwiki.apache.org/confluence/display/FELIX/apache-felix-ipojo-eclipse-integration?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message