<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>CodeScale Blog</title>
	<atom:link href="http://codescale.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://codescale.wordpress.com</link>
	<description>deviate from the truth - think different</description>
	<lastBuildDate>Tue, 13 Sep 2011 18:55:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='codescale.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/6221828cc4d9eba8d78409e9aa30a0dc?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>CodeScale Blog</title>
		<link>http://codescale.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://codescale.wordpress.com/osd.xml" title="CodeScale Blog" />
	<atom:link rel='hub' href='http://codescale.wordpress.com/?pushpress=hub'/>
		<item>
		<title>-[UIViewController _loadViewFromNibNamed:bundle:] loaded the &#8220;X&#8221; nib but the view outlet was not set.</title>
		<link>http://codescale.wordpress.com/2011/04/21/uiviewcontroller-_loadviewfromnibnamedbundle-loaded-the-x-nib-but-the-view-outlet-was-not-set/</link>
		<comments>http://codescale.wordpress.com/2011/04/21/uiviewcontroller-_loadviewfromnibnamedbundle-loaded-the-x-nib-but-the-view-outlet-was-not-set/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 22:19:31 +0000</pubDate>
		<dc:creator>codescale</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[controller]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[exception]]></category>
		<category><![CDATA[nib]]></category>
		<category><![CDATA[view]]></category>

		<guid isPermaLink="false">http://codescale.wordpress.com/?p=219</guid>
		<description><![CDATA[If you get such an error while starting your iPhone Application: -[UIViewController _loadViewFromNibNamed:bundle:] loaded the &#8220;X&#8221; nib but the view outlet was not set. You may have changed the content of you view. And because of that the nib has lost its view element. To fix this error open you nib and select the &#8216;File&#8217;s <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codescale.wordpress.com&amp;blog=5365988&amp;post=219&amp;subd=codescale&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you get such an error while starting your iPhone Application:</p>
<blockquote><p>-[UIViewController _loadViewFromNibNamed:bundle:] loaded the &#8220;X&#8221; nib but the view outlet was not set.</p></blockquote>
<p>You may have changed the content of you view. And because of that the nib has lost its view element.</p>
<p>To fix this error open you nib and select the &#8216;File&#8217;s Owner&#8217; entry as you see below.</p>
<p><a href="http://codescale.files.wordpress.com/2011/04/select-file-owner.png"><img class="aligncenter size-full wp-image-233" title="Select File Owner" src="http://codescale.files.wordpress.com/2011/04/select-file-owner.png?w=510" alt=""   /></a>Within the utilities you can define the necessary view.</p>
<p><a href="http://codescale.files.wordpress.com/2011/04/select-view.png"><img class="aligncenter size-medium wp-image-235" title="Select view" src="http://codescale.files.wordpress.com/2011/04/select-view.png?w=300&#038;h=127" alt="" width="300" height="127" /></a>Restart and the error will be gone.</p>
<p>be happy until cancelled,<br />
Your Codescale’s</p>
<br /> Tagged: <a href='http://codescale.wordpress.com/tag/controller/'>controller</a>, <a href='http://codescale.wordpress.com/tag/development-2/'>Development</a>, <a href='http://codescale.wordpress.com/tag/exception/'>exception</a>, <a href='http://codescale.wordpress.com/tag/iphone/'>iPhone</a>, <a href='http://codescale.wordpress.com/tag/nib/'>nib</a>, <a href='http://codescale.wordpress.com/tag/view/'>view</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codescale.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codescale.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codescale.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codescale.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codescale.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codescale.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codescale.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codescale.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codescale.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codescale.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codescale.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codescale.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codescale.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codescale.wordpress.com/219/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codescale.wordpress.com&amp;blog=5365988&amp;post=219&amp;subd=codescale&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codescale.wordpress.com/2011/04/21/uiviewcontroller-_loadviewfromnibnamedbundle-loaded-the-x-nib-but-the-view-outlet-was-not-set/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2e28c2dd067daeba089e2d4417a92cee?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">codescale</media:title>
		</media:content>

		<media:content url="http://codescale.files.wordpress.com/2011/04/select-file-owner.png" medium="image">
			<media:title type="html">Select File Owner</media:title>
		</media:content>

		<media:content url="http://codescale.files.wordpress.com/2011/04/select-view.png?w=300" medium="image">
			<media:title type="html">Select view</media:title>
		</media:content>
	</item>
		<item>
		<title>Inspect the magic of Eclipse Fragments</title>
		<link>http://codescale.wordpress.com/2011/04/14/inspect-the-magic-of-eclips-fragments/</link>
		<comments>http://codescale.wordpress.com/2011/04/14/inspect-the-magic-of-eclips-fragments/#comments</comments>
		<pubDate>Thu, 14 Apr 2011 21:21:58 +0000</pubDate>
		<dc:creator>codescale</dc:creator>
				<category><![CDATA[OSGi]]></category>
		<category><![CDATA[Bundle]]></category>
		<category><![CDATA[BundleLoader]]></category>
		<category><![CDATA[Classloading]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Equinox]]></category>
		<category><![CDATA[Fragment]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Resource]]></category>

		<guid isPermaLink="false">https://codescale.wordpress.com/2011/04/14/inspect-the-magic-of-bundle-fragments/</guid>
		<description><![CDATA[In the post ‘Basics about OSGi Classloading’ we have learned the fundamental knowledge how Classes are defined and loaded within OSGi. And we have worked with ‘pure’ OSGi Bundles. But there is another ‘type’ of a Bundle, called Fragment. Basically a Fragment is an extension to its Host-Bundle. And because such a Fragment will lead <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codescale.wordpress.com&amp;blog=5365988&amp;post=226&amp;subd=codescale&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In the post ‘<a title="Basics about OSGi Classloading" href="http://codescale.wordpress.com/2009/05/22/basics-about-osgi-classloading/">Basics about OSGi Classloading</a>’ we have learned the fundamental knowledge how Classes are defined and loaded within OSGi.<br />
And we have worked with ‘pure’ OSGi <a href="http://www.osgi.org/javadoc/r4v42/org/osgi/framework/Bundle.html">Bundles</a>. But there is another ‘type’ of a Bundle, called <a href="http://wiki.eclipse.org/FAQ_What_is_a_plug-in_fragment%3F">Fragment</a>. Basically a Fragment is an extension to its Host-Bundle.</p>
<p>And because such a Fragment will lead to a ‘special’ kind of Classloading within Equinox, we will take a look at what happens if we load a Class out of a Fragment.</p>
<p>This is our test setup (get it from git@github.com:codescale/osgi-playground.git):</p>
<p style="text-align:center;"><img src="http://codescale.files.wordpress.com/2011/04/designfragmentclassloading-2011-04-14-23-21.png?w=304&#038;h=190" alt="designfragmentclassloading-2011-04-14-23-21.png" width="304" height="190" /></p>
<p>Our starting point is a <a href="http://help.eclipse.org/helios/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/osgi/framework/console/CommandProvider.html">Console Service</a> to control the test executions. This Bundle does have a dependency to ‘org.codescale.bundle.a’ which does have the Fragment ‘org.codescale.fragment.a’. This Fragment does define another dependency to ‘org.codescale.bundle.b’.</p>
<p>To learn about the behavior of OSGi and Fragments we will go through these six parts:</p>
<ol style="list-style-type:decimal;">
<li><strong>Load a Class from the Fragment</strong> whereat the <strong>package</strong> is only <strong>exported by the Bundle A</strong></li>
<li><strong>Load a Class from the Fragment</strong> whereat the <strong>package</strong> is also <strong>exported by the Fragment</strong></li>
<li><strong>Load a Class from Bundle A</strong> whereat the <strong>package</strong> is only <strong>exported by the Fragment</strong></li>
<li><strong>Load a Class from Bundle B</strong> from a Class inside of the Bundle A at what this bundle does not have the necessary dependency</li>
<li><strong>Load a resource from Bundle A</strong> from within a Class of Bundle A</li>
<li><strong>Load a resource from the Fragment</strong> from within a Class of Bundle A</li>
</ol>
<p>Let’s start&#8230;</p>
<p>If you have setup a workspace in <a class="zem_slink" title="Eclipse (software)" href="http://www.eclipse.org" rel="homepage">Eclipse</a> with the source from git@github.com:codescale/osgi-playground.git you can start an OSGi Framework using the prepared launcher from the project ‘org.eclipse.console’.</p>
<p>Now we start an OSGi Framework with all the four bundles started.</p>
<p><span style="font-size:17pt;text-decoration:underline;"><strong>Part 1</strong></span><br />
Enter ‘<span style="font-size:11pt;color:#3f5fbf;">loadClass org.codescale.bundle.a.PublicBundleClass</span>‘ into the console. After executing this command you will see the following output:</p>
<pre>Load the class 'org.codescale.bundle.a.PublicBundleClass', called by bundle 'org.codescale.console'.
The class was loaded by 'org.codescale.bundle.a' instance '64212394'.
...</pre>
<p>In the first line we see that the ‘Console Bundle’ is going to load a class which seems to be ‘Bundle A’. Let’s have a look at this bundle.</p>
<p style="text-align:center;"><img src="http://codescale.files.wordpress.com/2011/04/eclipse3-2011-04-14-23-21.png?w=204&#038;h=134" alt="eclipse3-2011-04-14-23-21.png" width="204" height="134" /></p>
<p>There is not such a Class. But let’s take a look at the fragment.</p>
<p style="text-align:center;"><img src="http://codescale.files.wordpress.com/2011/04/eclipse2-2011-04-14-23-21.png?w=179&#038;h=169" alt="eclipse2-2011-04-14-23-21.png" width="179" height="169" /></p>
<p>Here it is <span style="font-size:20pt;">☺</span> Ok what happens? <a title="Basics about OSGi Classloading" href="http://codescale.wordpress.com/2009/05/22/basics-about-osgi-classloading/">As we’ve learned</a>, the place to step into is the ‘BundleLoader#findClassInternal’.<br />
(1) The first Bundle-ClassLoader which will be checked is the one of the ‘Console Bundle’, of course. (2) There the required ‘Bundle A’ is identified to be a possibility to load the Class, because this bundle does export the necessary package. (3) Within this bundle, firstly the ClasspathManager tries to load the class from the bundle itself, then (if this approach fails) all the fragments are called.</p>
<p style="text-align:center;"><img src="http://codescale.files.wordpress.com/2011/04/eclipse2-2011-04-14-23-211.png?w=459&#038;h=183" alt="eclipse2-2011-04-14-23-211.png" width="459" height="183" /></p>
<p>This is the code that does iterate through all the fragments and tries to load the class.</p>
<p><pre class="brush: java;">
for (int i = 0; i &lt; fragments.length; i++) {
 ClasspathEntry[] fragEntries = fragments[i].getEntries();
 for (int j = 0; j &lt; fragEntries.length; j++) {
  result = findClassImpl(classname, fragEntries[j], hooks);
  if (result != null)
   return result;
 }
}
</pre></p>
<p>That’s how it happens, that the class will be loaded by ‘Bundle A’.</p>
<p><span style="font-size:17pt;text-decoration:underline;"><strong>Part 2</strong></span><br />
Enter <span style="font-size:11pt;color:#3f5fbf;">loadClass org.codescale.fragment.a.PublicFragmentClass</span> into the console to get a class loaded whose package is exported by the fragment. The output will be:</p>
<pre>Load the class 'org.codescale.fragment.a.PublicFragmentClass', called by bundle 'org.codescale.console'.
The class was loaded by 'org.codescale.bundle.a' instance '1762688005'.
...</pre>
<p>O.K. the class is once again loaded by ‘Bundle A’. How?<br />
Stepping through the ‘BundleLoader’ we see that the ‘Bundle A’ does have all his exported packages, plus the one of the Fragment. <strong>That’s the key point!</strong> The Bundle description of ‘Bundle A’ and its Fragment are merged. This will happen in ‘org.eclipse.osgi.internal.module.ResolverBundle’ e.g. #getExportedPackages().<br />
With the help of the ‘PackageAdmin’ Service we can get some infos out of ‘Bundle A’.</p>
<pre>Symbolic-Name: org.codescale.bundle.a
The bundle exported packages:
 &gt; org.codescale.bundle.a
 &gt; org.codescale.fragment.a
 &gt; org.codescale.bundle.internal.a
The bundle does have 1 fragments:
 &gt; org.codescale.fragment.a</pre>
<p>There you see, that ‘Bundle A’ does have three exported packages, merged together by the bundle itself an its Fragment.</p>
<p><span style="font-size:17pt;text-decoration:underline;"><strong>Part 3</strong></span><br />
Enter <span style="font-size:11pt;color:#3f5fbf;">loadClass org.codescale.bundle.internal.a.InternalBundleClass </span>into the console to get a class loaded from ‘Bundle A’ even though the package is exported by its Fragment.</p>
<p>Because of the previous recognition we now know that this will work. See the output:</p>
<pre>Load the class 'org.codescale.bundle.internal.a.InternalBundleClass', called by bundle 'org.codescale.console'.
The class was loaded by 'org.codescale.bundle.a' instance '744919514'.</pre>
<p>Both Bundle descriptions are merged, so the ‘Bundle A’ does export the necessary package through the definition by its Fragment.</p>
<p><span style="font-size:17pt;text-decoration:underline;"><strong>Part 4</strong></span><br />
Now we’re going to load a class from ‘Bundle B’ by a class of ‘Bundle A’. This scenario is equal to the previous Part 2 and 3. The Fragment does extend the Bundle-Description of ‘Bundle A’ with an additional dependency to ‘Bundle B’.</p>
<p>You can step through this by entering <span style="font-size:11pt;color:#3f5fbf;">instance org.codescale.bundle.internal.a.InternalBundleClass</span> into the console.</p>
<p><span style="font-size:17pt;text-decoration:underline;"><strong>Part 5</strong></span><br />
Enter <span style="font-size:11pt;color:#3f5fbf;">instance org.codescale.bundle.internal.a.InternalBundleClass</span> into the console to get a stream of a resource which is located in ‘Bundle A’. This will be the output:</p>
<pre>Instantiate the class 'org.codescale.bundle.internal.a.InternalBundleClass', called by bundle 'org.codescale.console'.
The class was loaded by 'org.codescale.bundle.a' instance '2052558331'.
Created instance of org.codescale.bundle.internal.a.InternalBundleClass
The resource /resources/bundle.file was found.
Content &gt; Hi I'm the bundle.file</pre>
<p>First of all the Class will be loaded (as we’ve done previously) then we create an instance of it. Within the constructor a resource will be loaded.</p>
<p><pre class="brush: java;">
URL url = getClass().getResource(&quot;/resources/bundle.file&quot;);
</pre></p>
<p>This scenario is not so special &#8211; we’ve just requested a resource within the same bundle as the class lives. Anyway let’s have a look at the ‘BundleLoader’ (this time the method ‘findResource(String, boolean)’) to get the default behavior known.</p>
<p style="text-align:center;"><img src="http://codescale.files.wordpress.com/2011/04/eclipse-2011-04-14-23-21.png?w=294&#038;h=116" alt="eclipse-2011-04-14-23-21.png" width="294" height="116" /></p>
<p>As you see it’s not so different to Part 1 where we’ve looked at the Stacktrace of Classloading. We also end up at the ‘ClasspathManager’.</p>
<p><span style="font-size:17pt;text-decoration:underline;"><strong>Part 6</strong></span><br />
If you enter <span style="font-size:11pt;color:#3f5fbf;">instance org.codescale.fragment.a.PublicFragmentClass</span> into the console a resource from the Fragment should be loaded by a class of ‘Bundle A’. As we see in the output, the resource is loaded as well:</p>
<pre>Instantiate the class 'org.codescale.fragment.a.PublicFragmentClass', called by bundle 'org.codescale.console'.
The class was loaded by 'org.codescale.bundle.a' instance '1609377764'.
Created instance of org.codescale.bundle.internal.a.InternalBundleClass
The resource /resources/fragment.file was found.
Content &gt; Hi I'm the fragment.file</pre>
<p>One more time the implementation of the ‘ClasspathManager’ does the trick.</p>
<p><pre class="brush: java;">
private URL findLocalResourceImpl(String resource, int classPathIndex) {
 ...
 // look in fragments
 for (int i = 0; i &amp;lt; fragments.length; i++) {
  ClasspathEntry[] fragEntries = fragments[i].getEntries();
  for (int j = 0; j &amp;lt; fragEntries.length; j++) {
   result = findResourceImpl(resource, fragEntries[j].getBundleFile(), curIndex);
   if (result != null &amp;amp;&amp;amp; (classPathIndex == -1 || classPathIndex == curIndex))
    return result;
   curIndex++;
   }
  }
</pre></p>
<p><span style="font-size:17pt;text-decoration:underline;"><strong>Conclusion</strong></span><br />
Now we know how a fragment does behave in a OSGi environment. A Fragment can <strong>help you to interact directly with its Host-Bundle</strong> ‘without borders’. This can be helpful if you have to <strong>test the internal implementation of a Bundle</strong>. Another imaginable region is to<strong><a href="http://underlap.blogspot.com/2011/03/importing-packages-into-3rd-party.html"> extend a third party library</a></strong> (because of this Bundle-Description merge). But be aware you can’t ‘overwrite’ a Class of your Host-Bundle. A Class will be loaded first from its own Bundle, then from the Fragments!</p>
<p>Finally I leave you with a question. We add a Fragment to ‘Bundle B’, add a dependency from ‘Bundle A’ to ‘Bundle B’ and (as we’ve done in Part 6) load a resource from a Class in ‘Bundle A’ out of this Fragment. Will it work?</p>
<p>be happy until cancelled,<br />
Your Codescale’s</p>
<br /> Tagged: <a href='http://codescale.wordpress.com/tag/bundle/'>Bundle</a>, <a href='http://codescale.wordpress.com/tag/bundleloader/'>BundleLoader</a>, <a href='http://codescale.wordpress.com/tag/classloading/'>Classloading</a>, <a href='http://codescale.wordpress.com/tag/eclipse/'>Eclipse</a>, <a href='http://codescale.wordpress.com/tag/equinox/'>Equinox</a>, <a href='http://codescale.wordpress.com/tag/fragment/'>Fragment</a>, <a href='http://codescale.wordpress.com/tag/java/'>Java</a>, <a href='http://codescale.wordpress.com/tag/osgi/'>OSGi</a>, <a href='http://codescale.wordpress.com/tag/programming/'>Programming</a>, <a href='http://codescale.wordpress.com/tag/resource/'>Resource</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codescale.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codescale.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codescale.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codescale.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codescale.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codescale.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codescale.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codescale.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codescale.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codescale.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codescale.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codescale.wordpress.com/226/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codescale.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codescale.wordpress.com/226/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codescale.wordpress.com&amp;blog=5365988&amp;post=226&amp;subd=codescale&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codescale.wordpress.com/2011/04/14/inspect-the-magic-of-eclips-fragments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2e28c2dd067daeba089e2d4417a92cee?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">codescale</media:title>
		</media:content>

		<media:content url="http://codescale.files.wordpress.com/2011/04/designfragmentclassloading-2011-04-14-23-21.png" medium="image">
			<media:title type="html">designfragmentclassloading-2011-04-14-23-21.png</media:title>
		</media:content>

		<media:content url="http://codescale.files.wordpress.com/2011/04/eclipse3-2011-04-14-23-21.png" medium="image">
			<media:title type="html">eclipse3-2011-04-14-23-21.png</media:title>
		</media:content>

		<media:content url="http://codescale.files.wordpress.com/2011/04/eclipse2-2011-04-14-23-21.png" medium="image">
			<media:title type="html">eclipse2-2011-04-14-23-21.png</media:title>
		</media:content>

		<media:content url="http://codescale.files.wordpress.com/2011/04/eclipse2-2011-04-14-23-211.png" medium="image">
			<media:title type="html">eclipse2-2011-04-14-23-211.png</media:title>
		</media:content>

		<media:content url="http://codescale.files.wordpress.com/2011/04/eclipse-2011-04-14-23-21.png" medium="image">
			<media:title type="html">eclipse-2011-04-14-23-21.png</media:title>
		</media:content>
	</item>
		<item>
		<title>Text and image &#8216;Slideup Boxes&#8217; with CSS3 (not one line of javascript)</title>
		<link>http://codescale.wordpress.com/2011/01/16/text-and-image-slideup-boxes-with-css3-not-one-line-of-javascript/</link>
		<comments>http://codescale.wordpress.com/2011/01/16/text-and-image-slideup-boxes-with-css3-not-one-line-of-javascript/#comments</comments>
		<pubDate>Sun, 16 Jan 2011 14:37:12 +0000</pubDate>
		<dc:creator>codescale</dc:creator>
				<category><![CDATA[Code Snippet]]></category>
		<category><![CDATA[Webdesign]]></category>
		<category><![CDATA[Animation]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Slideup Boxes]]></category>
		<category><![CDATA[Style Sheets]]></category>
		<category><![CDATA[Transition]]></category>

		<guid isPermaLink="false">https://codescale.wordpress.com/2011/01/16/text-and-image-slideup-boxes-with-css3-not-one-line-of-javascript/</guid>
		<description><![CDATA[The basic idea is very similar to these sliding boxes that are animated with JQuery. The difference is, that I will not use one line of javascript (nor JQuery) but CSS3. OK, that’s also not completely new. But I do have the requirement to let flow out a box with text inside as well as <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codescale.wordpress.com&amp;blog=5365988&amp;post=208&amp;subd=codescale&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The basic idea is very similar to <span style="text-decoration:underline;"><a href="http://buildinternet.com/2009/03/sliding-boxes-and-captions-with-jquery/">these sliding boxes</a></span> that are animated with <span style="text-decoration:underline;"><a href="http://jquery.com/">JQuery</a></span>. The difference is, that I will not use one line of <span style="text-decoration:underline;"><a href="http://en.wikipedia.org/wiki/JavaScript">javascript</a></span> (nor JQuery) but <span style="text-decoration:underline;"><a href="http://de.wikipedia.org/wiki/Cascading_Style_Sheets">CSS3</a></span>.<br />
OK, that’s also <span style="text-decoration:underline;"><a href="http://css-tricks.com/video-screencasts/93-css3-slideup-boxes/">not completely new</a></span>. But <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  I do have the requirement to let flow out a box with text inside as well as an image.</p>
<p><span style="font-size:16pt;background-color:#ccff66;"><strong><a href="http://codescale.pytalhost.org/blog_additional_content/slideupboxes/index.html">View Demo</a></strong></span></p>
<p><span style="font-size:16pt;background-color:#ccff66;"><strong><strong><a href="http://codescale.pytalhost.org/blog_additional_content/slideupboxes/slideupboxes.zip">Download Source</a></strong><br />
</strong></span></p>
<br /> Tagged: <a href='http://codescale.wordpress.com/tag/animation/'>Animation</a>, <a href='http://codescale.wordpress.com/tag/css3/'>CSS3</a>, <a href='http://codescale.wordpress.com/tag/javascript/'>JavaScript</a>, <a href='http://codescale.wordpress.com/tag/jquery/'>JQuery</a>, <a href='http://codescale.wordpress.com/tag/slideup-boxes/'>Slideup Boxes</a>, <a href='http://codescale.wordpress.com/tag/style-sheets/'>Style Sheets</a>, <a href='http://codescale.wordpress.com/tag/transition/'>Transition</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codescale.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codescale.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codescale.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codescale.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codescale.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codescale.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codescale.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codescale.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codescale.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codescale.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codescale.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codescale.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codescale.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codescale.wordpress.com/208/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codescale.wordpress.com&amp;blog=5365988&amp;post=208&amp;subd=codescale&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codescale.wordpress.com/2011/01/16/text-and-image-slideup-boxes-with-css3-not-one-line-of-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2e28c2dd067daeba089e2d4417a92cee?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">codescale</media:title>
		</media:content>
	</item>
		<item>
		<title>Find the OSGi bundle that does contain this Class</title>
		<link>http://codescale.wordpress.com/2010/05/26/find-the-osgi-bundle-that-does-contain-this-class/</link>
		<comments>http://codescale.wordpress.com/2010/05/26/find-the-osgi-bundle-that-does-contain-this-class/#comments</comments>
		<pubDate>Wed, 26 May 2010 21:26:49 +0000</pubDate>
		<dc:creator>codescale</dc:creator>
				<category><![CDATA[OSGi]]></category>
		<category><![CDATA[Bundle]]></category>
		<category><![CDATA[Class]]></category>
		<category><![CDATA[Equinox]]></category>
		<category><![CDATA[FrameworkUtil]]></category>
		<category><![CDATA[Quick Tip]]></category>
		<category><![CDATA[Search]]></category>

		<guid isPermaLink="false">https://codescale.wordpress.com/2010/05/26/find-the-osgi-bundle-by-class/</guid>
		<description><![CDATA[Hi, Just a quick tip. If you need to find the bundle which does contain a specific Class, use FrameworkUtil#getBundle(java.lang.Class classFromBundle) In equinox it does reside in the bundle org.eclipse.osgi. Then you can get all the information you may require from the bundle. E.g. you can use this to get your bundles’ context and register <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codescale.wordpress.com&amp;blog=5365988&amp;post=203&amp;subd=codescale&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>Just a quick tip.</p>
<p>If you need to find the bundle which does contain a specific Class, use <a href="http://www.osgi.org/javadoc/r4v42/org/osgi/framework/FrameworkUtil.html">FrameworkUtil</a>#<a href="http://www.osgi.org/javadoc/r4v42/org/osgi/framework/FrameworkUtil.html#getBundle(java.lang.Class)">getBundle(java.lang.Class classFromBundle)</a></p>
<p>In <a href="http://www.eclipse.org/equinox/">equinox</a> it does reside in the bundle org.eclipse.osgi.</p>
<p>Then you can get all the information you may require from the <a href="http://www.osgi.org/javadoc/r4v42/org/osgi/framework/Bundle.html">bundle</a>.<br />
E.g. you can use this to get your bundles’ context and register or request an OSGi Service.<br />
Or start the bundle which does contain the specific class.</p>
<p>be happy until cancelled,<br />
Your Codescale’s</p>
<br /> Tagged: <a href='http://codescale.wordpress.com/tag/bundle/'>Bundle</a>, <a href='http://codescale.wordpress.com/tag/class/'>Class</a>, <a href='http://codescale.wordpress.com/tag/equinox/'>Equinox</a>, <a href='http://codescale.wordpress.com/tag/frameworkutil/'>FrameworkUtil</a>, <a href='http://codescale.wordpress.com/tag/osgi/'>OSGi</a>, <a href='http://codescale.wordpress.com/tag/quick-tip/'>Quick Tip</a>, <a href='http://codescale.wordpress.com/tag/search/'>Search</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codescale.wordpress.com/203/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codescale.wordpress.com/203/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codescale.wordpress.com/203/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codescale.wordpress.com/203/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codescale.wordpress.com/203/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codescale.wordpress.com/203/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codescale.wordpress.com/203/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codescale.wordpress.com/203/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codescale.wordpress.com/203/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codescale.wordpress.com/203/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codescale.wordpress.com/203/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codescale.wordpress.com/203/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codescale.wordpress.com/203/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codescale.wordpress.com/203/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codescale.wordpress.com&amp;blog=5365988&amp;post=203&amp;subd=codescale&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codescale.wordpress.com/2010/05/26/find-the-osgi-bundle-that-does-contain-this-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2e28c2dd067daeba089e2d4417a92cee?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">codescale</media:title>
		</media:content>
	</item>
		<item>
		<title>Get your callers class as fast as possible</title>
		<link>http://codescale.wordpress.com/2010/04/27/get-your-callers-class-as-fast-as-possible/</link>
		<comments>http://codescale.wordpress.com/2010/04/27/get-your-callers-class-as-fast-as-possible/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 14:01:43 +0000</pubDate>
		<dc:creator>codescale</dc:creator>
				<category><![CDATA[Code Snippet]]></category>
		<category><![CDATA[Caller]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Reflection]]></category>
		<category><![CDATA[SecurityManager]]></category>
		<category><![CDATA[Stacktrace]]></category>
		<category><![CDATA[Throwable]]></category>

		<guid isPermaLink="false">https://codescale.wordpress.com/2010/04/27/get-your-callers-class-as-fast-as-possible/</guid>
		<description><![CDATA[If you have to dive into the java stacktrace, you can use three possible functions to do so. Use a Throwable Create a SecurityManager and get his ClassContext Or do the trick with Reflection API (thanks to Heinz’s advise) Here are the three solutions written down: &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;private String getCallerClassFromThrowable() { &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Throwable trace = new Throwable(); <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codescale.wordpress.com&amp;blog=5365988&amp;post=195&amp;subd=codescale&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-size:10pt;">If you have to dive into the java stacktrace, you can use three possible functions to do so.</p>
<p></span>
<ol style="list-style-type:decimal;">
<li><span style="font-size:10pt;">Use a Throwable</span></li>
<li><span style="font-size:10pt;">Create a SecurityManager and get his ClassContext</span></li>
<li><span style="font-size:10pt;">Or do the trick with Reflection API (thanks to <a href="http://www.javaspecialists.eu/">Heinz</a>’s advise)</span></li>
</ol>
<p><span style="font-size:10pt;">Here are the three solutions written down:</p>
<p></span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:rgb(127,0,85);">private</span> String getCallerClassFromThrowable() {<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Throwable trace = <span style="color:rgb(127,0,85);">new</span> Throwable();<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:rgb(127,0,85);">return</span> trace.getStackTrace()[1].getClassName();<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:rgb(127,0,85);">private</span> <span style="color:rgb(127,0,85);">static</span> <span style="color:rgb(127,0,85);">class</span> MySecurityManager <span style="color:rgb(127,0,85);">extends</span> SecurityManager {<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:rgb(100,100,100);">@Override</span><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:rgb(127,0,85);">public</span> Class&lt;?&gt;[] getClassContext() {<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:rgb(127,0,85);">return</span> <span style="color:rgb(127,0,85);">super</span>.getClassContext();<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:rgb(127,0,85);">private</span> String getCallerClassFromSecurityManager() {<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Class&lt;?&gt;[] classContext = <span style="color:rgb(127,0,85);">new</span> MySecurityManager().getClassContext();<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:rgb(127,0,85);">return</span> classContext[1].getName();<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:rgb(127,0,85);">private</span> String getCallerClassFromReflection() {<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:rgb(127,0,85);">return</span> <span style="text-decoration:underline;">Reflection.getCallerClass(2)</span>.getName();<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}</p>
<p><span style="font-size:10pt;">The result of a tiny performance test shows&#8230;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</span><span style="color:rgb(127,0,85);">private</span> <span style="color:rgb(127,0,85);">void</span> doMeasurement(<span style="color:rgb(127,0,85);">int</span> counter) {<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:rgb(127,0,85);">if</span> (counter == 0) {</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:rgb(127,0,85);">long</span> time1 = System.currentTimeMillis();<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:rgb(127,0,85);">for</span> (<span style="color:rgb(127,0,85);">int</span> i = 0; i &lt; <span style="color:rgb(0,0,192);">REPEATS</span>; i++) {<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;getCallerClassFromThrowable();<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;time1 = System.currentTimeMillis() &#8211; time1;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;System.<span style="color:rgb(0,0,192);">out</span>.println(<span style="color:rgb(42,0,255);">&#8220;time1 = &#8220;</span> + time1 + <span style="color:rgb(42,0,255);">&#8220;ms&#8221;</span>);</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:rgb(127,0,85);">long</span> time2 = System.currentTimeMillis();<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:rgb(127,0,85);">for</span> (<span style="color:rgb(127,0,85);">int</span> i = 0; i &lt; <span style="color:rgb(0,0,192);">REPEATS</span>; i++) {<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;getCallerClassFromSecurityManager();<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;time2 = System.currentTimeMillis() &#8211; time2;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;System.<span style="color:rgb(0,0,192);">out</span>.println(<span style="color:rgb(42,0,255);">&#8220;time2 = &#8220;</span> + time2 + <span style="color:rgb(42,0,255);">&#8220;ms&#8221;</span>);</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:rgb(127,0,85);">long</span> time3 = System.currentTimeMillis();<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:rgb(127,0,85);">for</span> (<span style="color:rgb(127,0,85);">int</span> i = 0; i &lt; <span style="color:rgb(0,0,192);">REPEATS</span>; i++) {<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;getCallerClassFromReflection();<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;time3 = System.currentTimeMillis() &#8211; time3;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;System.<span style="color:rgb(0,0,192);">out</span>.println(<span style="color:rgb(42,0,255);">&#8220;time3 = &#8220;</span> + time3 + <span style="color:rgb(42,0,255);">&#8220;ms&#8221;</span>);<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:rgb(127,0,85);">return</span>;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;doMeasurement(&#8211;counter);<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:rgb(127,0,85);">private</span> <span style="color:rgb(127,0,85);">static</span> <span style="color:rgb(127,0,85);">void</span> test() {<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;PerformanceTest test = <span style="color:rgb(127,0,85);">new</span> PerformanceTest();<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<span style="color:rgb(127,0,85);">for</span> (<span style="color:rgb(127,0,85);">int</span> i = 1; i &lt; 1025; i *= 2) {<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;System.<span style="color:rgb(0,0,192);">out</span>.println(<span style="color:rgb(42,0,255);">&#8220;doMeasurement(&#8220;</span> + i + <span style="color:rgb(42,0,255);">&#8220;)&#8221;</span>);<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;test.doMeasurement(i);<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}</p>
<p><span style="font-size:10pt;">&#8230; that the reflection hack really does the trick.</p>
<p></span>doMeasurement(1024)<br />
time1 = 36598ms<br />
time2 = 4924ms<br />
time3 = 0ms</p>
<p><span style="font-size:10pt;">be happy until cancelled,<br />
Your Codescale’s</span></p>
<br /> Tagged: <a href='http://codescale.wordpress.com/tag/caller/'>Caller</a>, <a href='http://codescale.wordpress.com/tag/code/'>Code</a>, <a href='http://codescale.wordpress.com/tag/code-snippet/'>Code Snippet</a>, <a href='http://codescale.wordpress.com/tag/development-2/'>Development</a>, <a href='http://codescale.wordpress.com/tag/java/'>Java</a>, <a href='http://codescale.wordpress.com/tag/performance/'>Performance</a>, <a href='http://codescale.wordpress.com/tag/reflection/'>Reflection</a>, <a href='http://codescale.wordpress.com/tag/securitymanager/'>SecurityManager</a>, <a href='http://codescale.wordpress.com/tag/stacktrace/'>Stacktrace</a>, <a href='http://codescale.wordpress.com/tag/throwable/'>Throwable</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codescale.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codescale.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codescale.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codescale.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codescale.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codescale.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codescale.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codescale.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codescale.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codescale.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codescale.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codescale.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codescale.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codescale.wordpress.com/195/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codescale.wordpress.com&amp;blog=5365988&amp;post=195&amp;subd=codescale&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codescale.wordpress.com/2010/04/27/get-your-callers-class-as-fast-as-possible/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2e28c2dd067daeba089e2d4417a92cee?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">codescale</media:title>
		</media:content>
	</item>
		<item>
		<title>Log the Ant output to the Eclipse console</title>
		<link>http://codescale.wordpress.com/2010/04/25/log-the-ant-output-to-the-eclipse-console/</link>
		<comments>http://codescale.wordpress.com/2010/04/25/log-the-ant-output-to-the-eclipse-console/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 11:52:24 +0000</pubDate>
		<dc:creator>codescale</dc:creator>
				<category><![CDATA[Code Snippet]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Ant]]></category>
		<category><![CDATA[AntLauncher]]></category>
		<category><![CDATA[AntRunner]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Console]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Launcher]]></category>
		<category><![CDATA[Log]]></category>
		<category><![CDATA[Logger]]></category>

		<guid isPermaLink="false">https://codescale.wordpress.com/2010/04/25/log-the-ant-output-to-the-eclipse-console-from-within-your-own-plug-in/</guid>
		<description><![CDATA[Have you ever written an Eclipse Plug-In that has to call an Ant-Script? OK, I’m sure you get this done. Maybe then you’ve ask yourself (or someone else ): “How do I get the Ant output into the console of Eclipse?” So, I have and also was asked. My spontaneous and innocent answer: “Just call <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codescale.wordpress.com&amp;blog=5365988&amp;post=175&amp;subd=codescale&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Have you ever written an Eclipse Plug-In that has to call an Ant-Script? OK, I’m sure you get this done. Maybe then you’ve ask yourself (or someone else <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> ): “<strong>How do I get the Ant output into the console of Eclipse?</strong>” So, I have and also was asked.</p>
<p>My spontaneous and innocent answer: “Just call ‘addBuildLogger’ on your AntRunner.”</p>
<p>The Logger has to look like that:</p>
<p><pre class="brush: java;">
public class EclipseAntLogger extends DefaultLogger {

private IOConsole console = new IOConsole(&amp;quot;Ant&amp;quot;, null);
private IOConsoleOutputStream outputStream = console.newOutputStream();

public EclipseAntLogger() {
 ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] { console });
}

@Override
protected void printMessage(String message, PrintStream stream, int priority) {
 super.printMessage(message, stream, priority);
 try {
  outputStream.write(message + &amp;quot;\n&amp;quot;);
 } catch (IOException e) {
  e.printStackTrace();
 }
}
</pre></p>
<p>The problem I’ve got with that was a ClassNotFound exception of my logger class. Of course! My AntRunner uses a different VM and with that a totally different ClassPath than the one of Eclipse.</p>
<p>How to put your logger class onto the AntRunner ClassPath?<br />
-&gt; Setup the <strong>custom classpath</strong> of the AntRunner.</p>
<p><pre class="brush: java;">
// get the default custom classpath from the preferences
AntCorePreferences corePreferences = AntCorePlugin.getPlugin().getPreferences();
URL[] urls = corePreferences.getURLs();

// get the location of the plugin jar
File bundleFile = FileLocator.getBundleFile(myPlugin.getBundle());
URL url = bundleFile.toURI().toURL();

// bond urls to complete classpath
List&lt;URL&gt; classpath = new ArrayList&lt;URL&gt;();
classpath.addAll(Arrays.asList(urls));
classpath.add(url);

// set custom classpath
antRunner.setCustomClasspath(classpath.toArray(new URL[classpath.size()]));
</pre></p>
<p><strong>Not too nice</strong> in my opinion. Another possibility is to use an extension.</p>
<p><pre class="brush: xml;">
&lt;extension point=&quot;org.eclipse.ant.core.extraClasspathEntries&quot;&gt;
 &lt;extraClasspathEntry library=&quot;ant/logger.jar&quot;&gt;
 &lt;/extraClasspathEntry&gt;
&lt;/extension&gt;
</pre></p>
<p>You have to put the logger class into another jar and add it to the extra classpath of the eclipse ant classpath.</p>
<p>Better! But I wasn’t almost happy with this solution.<br />
After some days of work there was the flash of genius &#8211; or something like that <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>You know the laucher from the Eclipse-UI where you can create a new ‘External Tools Configurations&#8230;’?<br />
<a href="http://codescale.files.wordpress.com/2010/04/eclipse1.png"><img class="aligncenter size-full wp-image-190" title="Open External Tools Configurations..." src="http://codescale.files.wordpress.com/2010/04/eclipse1.png?w=510" alt=""   /></a><br />
In your code you have to use ‘ILaunchConfigurationType’ to create a new configuration. <strong>My solution looks like this:</strong></p>
<p><pre class="brush: java; wrap-lines: false;">
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType lcType = launchManager.getLaunchConfigurationType(IAntLaunchConstants.ID_ANT_LAUNCH_CONFIGURATION_TYPE);

String name = launchManager.generateLaunchConfigurationName(&amp;quot;Run Ant&amp;quot;);
ILaunchConfigurationWorkingCopy wc = lcType.newInstance(null, name);
wc.setAttribute(ILaunchManager.ATTR_PRIVATE, true);
wc.setAttribute(IExternalToolConstants.ATTR_LOCATION, buildFile.toString());
wc.setAttribute(IAntLaunchConstants.ATTR_ANT_TARGETS, &amp;quot;run&amp;quot;);

wc.launch(ILaunchManager.RUN_MODE, null);
</pre></p>
<p>It&#8217;s based on the new API that will be introduced with <strong>Eclipse 3.6</strong> and requires at least these bundles:</p>
<ul>
<li><strong>org.eclipse.debug.core</strong></li>
<li><strong>org.eclipse.ant.launching</strong></li>
<li><strong>org.eclipse.core.externaltools </strong></li>
</ul>
<p>It works beautiful I think? So what do you?</p>
<p>Do you have another suggestion how to solve the problem? Let me know.</p>
<p>be happy until cancelled,<br />
Your Codescale’s</p>
<br /> Tagged: <a href='http://codescale.wordpress.com/tag/ant/'>Ant</a>, <a href='http://codescale.wordpress.com/tag/antlauncher/'>AntLauncher</a>, <a href='http://codescale.wordpress.com/tag/antrunner/'>AntRunner</a>, <a href='http://codescale.wordpress.com/tag/code/'>Code</a>, <a href='http://codescale.wordpress.com/tag/console/'>Console</a>, <a href='http://codescale.wordpress.com/tag/development-2/'>Development</a>, <a href='http://codescale.wordpress.com/tag/eclipse/'>Eclipse</a>, <a href='http://codescale.wordpress.com/tag/launcher/'>Launcher</a>, <a href='http://codescale.wordpress.com/tag/log/'>Log</a>, <a href='http://codescale.wordpress.com/tag/logger/'>Logger</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codescale.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codescale.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codescale.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codescale.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codescale.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codescale.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codescale.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codescale.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codescale.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codescale.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codescale.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codescale.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codescale.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codescale.wordpress.com/175/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codescale.wordpress.com&amp;blog=5365988&amp;post=175&amp;subd=codescale&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codescale.wordpress.com/2010/04/25/log-the-ant-output-to-the-eclipse-console/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2e28c2dd067daeba089e2d4417a92cee?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">codescale</media:title>
		</media:content>

		<media:content url="http://codescale.files.wordpress.com/2010/04/eclipse1.png" medium="image">
			<media:title type="html">Open External Tools Configurations...</media:title>
		</media:content>
	</item>
		<item>
		<title>Second day at Eclipse Summit Europe 2009</title>
		<link>http://codescale.wordpress.com/2009/10/29/second-day-at-eclipse-summit-europe-2009/</link>
		<comments>http://codescale.wordpress.com/2009/10/29/second-day-at-eclipse-summit-europe-2009/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 10:58:49 +0000</pubDate>
		<dc:creator>codescale</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Backminster]]></category>
		<category><![CDATA[E4]]></category>
		<category><![CDATA[Eclipse Summit Europe]]></category>
		<category><![CDATA[ESE2009]]></category>
		<category><![CDATA[I/O]]></category>
		<category><![CDATA[JPicus]]></category>

		<guid isPermaLink="false">http://codescale.wordpress.com/2009/10/29/second-day-at-eclipse-summit-europe-2009/</guid>
		<description><![CDATA[Once again e4 (exactly what&#8217;s in) was on the agenda. And i will have to say once more that a deeper look to e4 is required Another topic was about JPicus. An I/O Analyser made by SAP. You can inject JPicus into the JVM of your application by adding JPicus as a java-agent (&#8220;-javaagent:jpicus.jar&#8221;). Very <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codescale.wordpress.com&amp;blog=5365988&amp;post=155&amp;subd=codescale&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="clear:both;">Once again e4 (exactly <a href="http://www.eclipsecon.org/summiteurope2009/sessions?id=982" target="_blank">what&#8217;s in</a>) was on the agenda. And i will have to say once more that a deeper look to e4 is required <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p style="clear:both;">Another topic was about <a href="https://wiki.sdn.sap.com/wiki/display/Java/JPicus" target="_blank">JPicus</a>. <a href="http://www.genevski.com/2009/04/jpicus-javatm-io-analysis-framework.html" target="_blank">An I/O Analyser</a> made by SAP. You can inject JPicus into the JVM of your application by adding JPicus as a java-agent (&#8220;-javaagent:jpicus.jar&#8221;).<br />
Very interesting to me was the discovery that equinox holds up the FileHandler to the Bundle-Jar until the OSGi Environment gets closed. This maybe results in a data leak and you can run out of memory. There is a property called &#8220;osgi.equinox.bundle.file&#8221; which reduces the amount of FileHandlers.</p>
<p style="clear:both;">Later on i&#8217;ve attend the <a href="http://www.eclipse.org/buckminster/" target="_blank">Buckminster</a> talk given by Henrik, Thomas and Filip Hrbek.<br />
There was a large audience listened to them. They have explained how Buckminster will create a p2 repository by defining a so called cquery. And this will equally work headless.<br />
There is even more you will get out of an cquery. You can let Buckminster create a dependency graph named BOM (bill of material).<br />
Beside of building a p2 repository you will get this repository as a maven repository as well. Isn&#8217;t that fantastic?<br />
So take a look at the <a href="http://www.eclipse.org/downloads/download.php?file=/tools/buckminster/doc/BuckyBook.pdf" target="_blank">Buckminster book</a> and setup up your build based on models (i will do so <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  ).</p>
<p><br class="final-break" style="clear:both;" /></p>
<br /> Tagged: Backminster, E4, Eclipse, Eclipse Summit Europe, ESE2009, I/O, JPicus <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codescale.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codescale.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codescale.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codescale.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codescale.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codescale.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codescale.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codescale.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codescale.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codescale.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codescale.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codescale.wordpress.com/155/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codescale.wordpress.com/155/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codescale.wordpress.com/155/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codescale.wordpress.com&amp;blog=5365988&amp;post=155&amp;subd=codescale&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codescale.wordpress.com/2009/10/29/second-day-at-eclipse-summit-europe-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2e28c2dd067daeba089e2d4417a92cee?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">codescale</media:title>
		</media:content>
	</item>
		<item>
		<title>First day at eclipse summit europe 2009 with OSGi and e4</title>
		<link>http://codescale.wordpress.com/2009/10/27/first_day_ese_2009_with_osgi_and_e4/</link>
		<comments>http://codescale.wordpress.com/2009/10/27/first_day_ese_2009_with_osgi_and_e4/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 22:24:49 +0000</pubDate>
		<dc:creator>codescale</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Apache Felix]]></category>
		<category><![CDATA[Apache Sling]]></category>
		<category><![CDATA[E4]]></category>
		<category><![CDATA[Eclipse Summit Europe]]></category>
		<category><![CDATA[ESE2009]]></category>
		<category><![CDATA[OSGi]]></category>

		<guid isPermaLink="false">http://codescale.wordpress.com/2009/10/27/untitled/</guid>
		<description><![CDATA[Today i&#8217;ve participated in the OSGi Meeting which was launched at the early beginning of eclipse summit. The first topic on this session was the &#8220;new&#8221; released OSGi Spec. 4.2. And in context of that, the OSGi Service Notation was announced. Not very special but important to know. First of all to bring the communication <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codescale.wordpress.com&amp;blog=5365988&amp;post=152&amp;subd=codescale&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="clear:both;">Today i&#8217;ve participated in the OSGi Meeting which was launched at the early beginning of eclipse summit.</p>
<p style="clear:both;">The first topic on this session was the &#8220;new&#8221; released OSGi Spec. 4.2.</p>
<p style="clear:both;">
<p style="clear:both;"><img src="http://codescale.files.wordpress.com/2009/10/osgi_service_notation-thumb.jpg?w=262&#038;h=243" height="243" width="262" style="text-align:center;display:block;margin:0 auto 10px;" />And in context of that, the <strong>OSGi Service Notation</strong> was announced. Not very special but important to know. First of all to bring the communication to a more comprehensible and uniform one.</p>
<p style="clear:both;">
<p style="clear:both;">Then the new <strong>Service Hook</strong> possibility was announced. In basic meaning you can compare it (if you know) to the classloading hook. With this model you can &#8220;hack&#8221; the default behavior of how Bundles are found, Service-Events are delivered and Service-Listener can interact. Of course i needn&#8217;t mention that these possibilities shouldn&#8217;t be the first idea to solve a problem. But in context of a framework (for example with the usage of a service proxy) a Service Hook can solve a problem and provide a great opportunity.</p>
<p style="clear:both;">
<p style="clear:both;">Also the <strong>Remote</strong> (old named delayed) <strong>Services</strong> were announced. The main parts of this technology came from Spring. One thing i will mention is that these Remote Services are defined by property convention. But if you are interested in more detail i will refer you to the OSGi Spec. One thing i will append is a (maybe called) &#8220;Remote Services Proxy Pattern&#8221;.</p>
<p style="clear:both;">
<p style="clear:both;"><img src="http://codescale.files.wordpress.com/2009/10/remote_service_proxy_pattern-thumb.jpg?w=380&#038;h=184" height="184" alt="" width="380" style="text-align:center;display:block;margin:0 auto 10px;" />For example in a framework you can use a Service Hook to implement a Service Proxy which hides the dynamic of Remote Services.</p>
<p style="clear:both;">
<p style="clear:both;">The next part of the OSGi Meeting took a presentation about lessons learned during the <strong>Apache Sling</strong> project and OSGi. In their opinion Spring contains a too static Descriptor and it&#8217;s also not really dynamic. So they have setup their execution environment with the implementation of <strong>Apache Felix</strong>.</p>
<p style="clear:both;">
<p style="clear:both;">The main problem during the project was the <strong>thinking of developers</strong>. It doesn&#8217;t match in deed with the dynamic approach of OSGi. So their statement was, that a developer requires about <strong>half a year to realize</strong> and &#8220;think&#8221; in the way OSGi expected it.</p>
<p style="clear:both;">
<p style="clear:both;">Later in the afternoon five representatives of four implementations of OSGi sit together and talk about Felix, Knopperfish, Prosys (i thought it was named) and Equinox. It was a very interesting discussion. And one topic was present every time &#8211; <strong>Tooling Issue</strong>.</p>
<p style="clear:both;">
<p style="clear:both;">&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p style="clear:both;">
<p style="clear:both;">The <strong>e4</strong> symposium was the second big part I have participated in today. In my opinion it&#8217;s a very interesting topic and it requires more space than i can actually give. Some <a href="http://wiki.eclipse.org/E4/Eclipse_Application_Model" target="_blank">keywords</a> i can give:</p>
<p style="clear:both;">
<ul style="clear:both;">
<li>e4 setup a new abstraction layer upon SWT and the Workbench Model</li>
<li>one major goal is to <strong>remove all static accessors</strong> inside of e4 UI (for example IWorkbench)</li>
<li>The Renderer, CSSEngine and Workbench Model are decoupled</li>
<li>you can extend the default <strong>UI-Metamodel</strong> delivered with e4</li>
<li>declarative UI</li>
<li><strong>Dependency-Injection</strong> instead of static accessor</li>
</ul>
<p style="clear:both;">
<p style="clear:both;">
<p style="clear:both;">
<p style="clear:both;">
<p><br class="final-break" style="clear:both;" /></p>
<br /> Tagged: Apache Felix, Apache Sling, E4, Eclipse, Eclipse Summit Europe, ESE2009, OSGi <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codescale.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codescale.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codescale.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codescale.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codescale.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codescale.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codescale.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codescale.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codescale.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codescale.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codescale.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codescale.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codescale.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codescale.wordpress.com/152/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codescale.wordpress.com&amp;blog=5365988&amp;post=152&amp;subd=codescale&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codescale.wordpress.com/2009/10/27/first_day_ese_2009_with_osgi_and_e4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2e28c2dd067daeba089e2d4417a92cee?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">codescale</media:title>
		</media:content>

		<media:content url="http://codescale.files.wordpress.com/2009/10/osgi_service_notation-thumb.jpg" medium="image" />

		<media:content url="http://codescale.files.wordpress.com/2009/10/remote_service_proxy_pattern-thumb.jpg" medium="image" />
	</item>
		<item>
		<title>Arrived at Ludwigsburg to attend Eclipse Summit Europe 2009</title>
		<link>http://codescale.wordpress.com/2009/10/27/arrived-at-ludwigsburg-to-attend-eclipse-summit-europe-2009/</link>
		<comments>http://codescale.wordpress.com/2009/10/27/arrived-at-ludwigsburg-to-attend-eclipse-summit-europe-2009/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 12:53:44 +0000</pubDate>
		<dc:creator>codescale</dc:creator>
				<category><![CDATA[Eclipse]]></category>

		<guid isPermaLink="false">http://codescale.wordpress.com/2009/10/27/arrived-at-ludwigsburg-to-attend-eclipse-summit-europe-2009/</guid>
		<description><![CDATA[Tonight i&#8217;ve been arrived at Ludwigsburg to attend Eclipse Summit Europe 2009 from tomorrow 27. until Thursday 29. October. There is a big program launched and I&#8217;m looking forward to attend in a few presentations during the next days. 27. Oct OSGi Meeting &#8211; Parallel to the Eclipse Summit Europe there is the first OSGi <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codescale.wordpress.com&amp;blog=5365988&amp;post=145&amp;subd=codescale&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="clear:both;">Tonight i&#8217;ve been arrived at Ludwigsburg to attend Eclipse Summit Europe 2009 from tomorrow 27. until Thursday 29. October.<br />
There is a big program launched and I&#8217;m looking forward to attend in a few presentations during the next days.</p>
<p>27. Oct<br />
<a href="http://germany.osgiusers.org/Main/HomePage" target="_blank">OSGi Meeting</a> &#8211; Parallel to the Eclipse Summit Europe there is the first OSGi Meeting organize by OSGi User Forum Europe.<br />
<a href="http://www.eclipsecon.org/summiteurope2009/sessions?id=981" target="_blank">e4 Symposium</a><br />
<a href="http://www.eclipsecon.org/summiteurope2009/sessions?id=1037" target="_blank">Symposium on Eclipse Foundation 2.0</a></p>
<p style="clear:both;">28. Oct<br />
<a href="http://www.eclipsecon.org/summiteurope2009/sessions?id=1046" target="_blank">Taking Functional Programming Into the Mainstream</a><br />
<a href="http://www.eclipsecon.org/summiteurope2009/sessions?id=982" target="_blank">What&#8217;s in e4</a><br />
<a href="http://www.eclipsecon.org/summiteurope2009/sessions?id=924" target="_blank">How about I/O?</a><br />
<a href="http://www.eclipsecon.org/summiteurope2009/sessions?id=861" target="_blank">Climb the Babel Tower</a><br />
<a href="http://www.eclipsecon.org/summiteurope2009/sessions?id=1002" target="_blank">OSGi Best Practices</a><br />
<a href="http://www.eclipsecon.org/summiteurope2009/sessions?id=937" target="_blank">OSGi Versioning and Testing</a><br />
<a href="http://www.eclipsecon.org/summiteurope2009/sessions?id=1035" target="_blank">Web meets Eclipse</a><br />
<a href="http://www.eclipsecon.org/summiteurope2009/sessions?id=997" target="_blank">From source to automated builds with Buckminster and p2</a></p>
<p style="clear:both;">29. Oct<br />
<a href="http://www.eclipsecon.org/summiteurope2009/sessions?id=1045" target="_blank">Open Source Maturity Curve and Ecosystems Interactions &#8211; Lessons Learned</a><br />
<a href="http://www.eclipsecon.org/summiteurope2009/sessions?id=965" target="_blank">Stop the Architecture Erosion</a><br />
<a href="http://www.eclipsecon.org/summiteurope2009/sessions?id=884" target="_blank">WebTools Incubator: Creating Web Services with JAXWS</a><br />
<a href="http://www.eclipsecon.org/summiteurope2009/sessions?id=887" target="_blank">Building Equinox OSGi Applications with EclipseLink–-Even Better in Galileo!</a><br />
<a href="http://www.eclipsecon.org/summiteurope2009/sessions?id=1034" target="_blank">The e4 Toolkit Model &#8211; A new view on UIs</a><span style="text-decoration:underline;"><br />
</span><a href="http://www.eclipsecon.org/summiteurope2009/sessions?id=927" target="_blank">ReviewClipse &#8211; Continuous Code Reviews within the Eclipse IDE</a><span style="text-decoration:underline;"><br />
</span><a href="http://www.eclipsecon.org/summiteurope2009/sessions?id=996" target="_blank">The p2 provisioning platform</a></p>
<p style="clear:both;">After a day full of presentations, ideas and innovations <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  I will look to give you a sum-up. Also you can ask for your special concern which i have to enter in my sum-up. Or you can setup a question about a presentation i&#8217;ve participated in.</p>
<p style="clear:both;">Be happy until canceled,</p>
<p style="clear:both;">Your CodeScale&#8217;s</p>
<p><br class="final-break" style="clear:both;" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codescale.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codescale.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codescale.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codescale.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codescale.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codescale.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codescale.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codescale.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codescale.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codescale.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codescale.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codescale.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codescale.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codescale.wordpress.com/145/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codescale.wordpress.com&amp;blog=5365988&amp;post=145&amp;subd=codescale&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codescale.wordpress.com/2009/10/27/arrived-at-ludwigsburg-to-attend-eclipse-summit-europe-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2e28c2dd067daeba089e2d4417a92cee?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">codescale</media:title>
		</media:content>
	</item>
		<item>
		<title>Lazy activation and registration of a declarative service</title>
		<link>http://codescale.wordpress.com/2009/06/30/lazy-activation-and-registration-of-a-declarative-service/</link>
		<comments>http://codescale.wordpress.com/2009/06/30/lazy-activation-and-registration-of-a-declarative-service/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 17:34:10 +0000</pubDate>
		<dc:creator>codescale</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[OSGi]]></category>
		<category><![CDATA[Declarative Service]]></category>
		<category><![CDATA[OSGi-Service]]></category>

		<guid isPermaLink="false">http://codescale.wordpress.com/?p=128</guid>
		<description><![CDATA[The org.eclipse.equinox.ds bundle released with Eclipse Galileo supports lazy activation of declarative services. The source code of org.eclipse.equinox.ds is located at dev.eclipse.org/cvsroot/rt/org.eclipse.equinox/compendium/ bundles/org.eclipse.equinox.ds And there we will find the following source code lines: Important is the check if the bundle is in the LAZY_ACTIVATION state. In this case the bundle will also be started in <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codescale.wordpress.com&amp;blog=5365988&amp;post=128&amp;subd=codescale&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The org.eclipse.equinox.ds bundle <strong>released</strong><strong> with </strong><a href="http://www.eclipse.org/galileo/" target="_blank"><strong>Eclipse Galileo</strong></a> supports <strong>lazy activation of declarative services</strong>.</p>
<p>The source code of org.eclipse.equinox.ds is located at dev.eclipse.org/cvsroot/rt/org.eclipse.equinox/compendium/<br />
bundles/org.eclipse.equinox.ds</p>
<p>And there we will find the following source code lines:</p>
<p><pre class="brush: java; gutter: false; highlight: [12]; pad-line-numbers: true;">
public final void bundleChanged(BundleEvent event) {
 long start = 0l;
 if (Activator.PERF) {
  start = System.currentTimeMillis();
  log.info(NLS.bind(Messages.PROCESSING_BUNDLE_EVENT, event));
 }
 int type = event.getType();
 if (type == BundleEvent.STOPPING) {
  stoppingBundle(event.getBundle());
 } else if (type == BundleEvent.STARTED) {
  startedBundle(event.getBundle());
 } else if (type == BundleEvent.LAZY_ACTIVATION) {
  startedBundle(event.getBundle());
 } else if (type == BundleEvent.UNINSTALLED &amp;&amp; Activator.DBSTORE) {
  storage.deleteComponentDefinitions(event.getBundle().getBundleId());
 }
 if (Activator.PERF) {
  start = System.currentTimeMillis() - start;
  log.info(NLS.bind(Messages.PROCESSED_BUNDLE_EVENT, event, new Long(start)));
  // ... 
</pre></p>
<p>Important is the check if the bundle is in the <strong>LAZY_ACTIVATION</strong> state. In this case the bundle will also be started in the meaning of the DS implementation. This starting invokes the <strong>registration of the OSGi-Service</strong>. But, and that&#8217;s important, the bundle <strong>will not be activated</strong> and the Activator (if one exists) <strong>will not be instantiated</strong>. And this is pretty damn lazy <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  <strong>No single class must be loaded!!!</strong></p>
<br /> Tagged: Declarative Service, Eclipse, OSGi, OSGi-Service <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codescale.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codescale.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codescale.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codescale.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codescale.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codescale.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codescale.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codescale.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codescale.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codescale.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codescale.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codescale.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codescale.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codescale.wordpress.com/128/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codescale.wordpress.com&amp;blog=5365988&amp;post=128&amp;subd=codescale&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codescale.wordpress.com/2009/06/30/lazy-activation-and-registration-of-a-declarative-service/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2e28c2dd067daeba089e2d4417a92cee?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">codescale</media:title>
		</media:content>
	</item>
	</channel>
</rss>
