<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Guice on ilikeorangutans</title><link>https://kuelzer.ca/tags/guice/</link><description>Recent content in Guice on ilikeorangutans</description><generator>Hugo</generator><language>en</language><copyright>© 2026 Jakob Külzer</copyright><lastBuildDate>Sun, 12 Apr 2026 14:27:24 -0400</lastBuildDate><atom:link href="https://kuelzer.ca/tags/guice/index.xml" rel="self" type="application/rss+xml"/><item><title>OSGI, Guice, and Peaberry: first steps</title><link>https://kuelzer.ca/posts/2013/02/27/osgi-guice-and-peaberry-first-steps/</link><pubDate>Wed, 27 Feb 2013 13:59:40 -0400</pubDate><guid>https://kuelzer.ca/posts/2013/02/27/osgi-guice-and-peaberry-first-steps/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;I&amp;rsquo;ve been trying to get &lt;a href="https://code.google.com/p/google-guice/"&gt;Google Guice&lt;/a&gt; and &lt;a href="https://code.google.com/p/peaberry/"&gt;Peaberry&lt;/a&gt; to work in my OSGI projects for a while. Google Guice is a great dependency injection framework, and Peaberry promises to bridge the gap between OSGI services and dependency injection.&lt;/p&gt;
&lt;p&gt;However, getting Peaberry to work was not trivial, mostly because there aren&amp;rsquo;t many docs and the quality of the docs is somewhat lacking. The best piece is still this pdf &lt;a href="https://code.google.com/p/peaberry/downloads/detail?name=peaberry%20-%20blending%20services%20and%20extensions.pdf"&gt;Peaberry - blending services and extensions&lt;/a&gt;, but it&amp;rsquo;s a lot of information in very little space.&lt;/p&gt;</description></item><item><title>Google Guice and Scope Mixing</title><link>https://kuelzer.ca/posts/2012/12/11/google-guice-and-scope-mixing/</link><pubDate>Tue, 11 Dec 2012 13:59:40 -0400</pubDate><guid>https://kuelzer.ca/posts/2012/12/11/google-guice-and-scope-mixing/</guid><description>&lt;p&gt;I&amp;rsquo;ve been working on a small Java application I wrote a few years ago for some bug fixes and in the process of making it better, I introduced &lt;a href="https://code.google.com/p/google-guice/"&gt;Google Guice&lt;/a&gt;, my favourite dependency injection framework. On of the great features of Guice is that it supports different &lt;a href="https://code.google.com/p/google-guice/wiki/Scopes"&gt;scopes for injection&lt;/a&gt;. Per default, Guice will return a new object for every request. But sometimes you want to objects to be created a bit less liberally, for example, you want a certain object to be created only once. Guice has a &lt;code&gt;@Singleton&lt;/code&gt; scope for that. Want an object to be created once for a request? Guice and &lt;a href="https://code.google.com/p/google-guice/wiki/Servlets"&gt;guice-servlet&lt;/a&gt; offers &lt;code&gt;@RequestScoped&lt;/code&gt; and &lt;code&gt;SessionScoped&lt;/code&gt;. But there&amp;rsquo;s more, need JUnit per test scope? &lt;a href="https://code.google.com/p/guiceberry/"&gt;Guiceberry&lt;/a&gt; has exactly that: &lt;code&gt;@TestScoped&lt;/code&gt; that will make sure every test gets exactly one object.&lt;/p&gt;</description></item></channel></rss>